Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

49601 rinda
1.6 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/v2.7"
  12. // ...
  13. // dfareportingService, err := dfareporting.New(oauthHttpClient)
  14. package dfareporting // import "google.golang.org/api/dfareporting/v2.7"
  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:v2.7"
  43. const apiName = "dfareporting"
  44. const apiVersion = "v2.7"
  45. const basePath = "https://www.googleapis.com/dfareporting/v2.7/"
  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.Advertisers = NewAdvertisersService(s)
  69. s.Browsers = NewBrowsersService(s)
  70. s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s)
  71. s.Campaigns = NewCampaignsService(s)
  72. s.ChangeLogs = NewChangeLogsService(s)
  73. s.Cities = NewCitiesService(s)
  74. s.ConnectionTypes = NewConnectionTypesService(s)
  75. s.ContentCategories = NewContentCategoriesService(s)
  76. s.Conversions = NewConversionsService(s)
  77. s.Countries = NewCountriesService(s)
  78. s.CreativeAssets = NewCreativeAssetsService(s)
  79. s.CreativeFieldValues = NewCreativeFieldValuesService(s)
  80. s.CreativeFields = NewCreativeFieldsService(s)
  81. s.CreativeGroups = NewCreativeGroupsService(s)
  82. s.Creatives = NewCreativesService(s)
  83. s.DimensionValues = NewDimensionValuesService(s)
  84. s.DirectorySiteContacts = NewDirectorySiteContactsService(s)
  85. s.DirectorySites = NewDirectorySitesService(s)
  86. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  87. s.EventTags = NewEventTagsService(s)
  88. s.Files = NewFilesService(s)
  89. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  90. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  91. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  92. s.InventoryItems = NewInventoryItemsService(s)
  93. s.LandingPages = NewLandingPagesService(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. Advertisers *AdvertisersService
  135. Browsers *BrowsersService
  136. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  137. Campaigns *CampaignsService
  138. ChangeLogs *ChangeLogsService
  139. Cities *CitiesService
  140. ConnectionTypes *ConnectionTypesService
  141. ContentCategories *ContentCategoriesService
  142. Conversions *ConversionsService
  143. Countries *CountriesService
  144. CreativeAssets *CreativeAssetsService
  145. CreativeFieldValues *CreativeFieldValuesService
  146. CreativeFields *CreativeFieldsService
  147. CreativeGroups *CreativeGroupsService
  148. Creatives *CreativesService
  149. DimensionValues *DimensionValuesService
  150. DirectorySiteContacts *DirectorySiteContactsService
  151. DirectorySites *DirectorySitesService
  152. DynamicTargetingKeys *DynamicTargetingKeysService
  153. EventTags *EventTagsService
  154. Files *FilesService
  155. FloodlightActivities *FloodlightActivitiesService
  156. FloodlightActivityGroups *FloodlightActivityGroupsService
  157. FloodlightConfigurations *FloodlightConfigurationsService
  158. InventoryItems *InventoryItemsService
  159. LandingPages *LandingPagesService
  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 NewAdvertisersService(s *Service) *AdvertisersService {
  244. rs := &AdvertisersService{s: s}
  245. return rs
  246. }
  247. type AdvertisersService struct {
  248. s *Service
  249. }
  250. func NewBrowsersService(s *Service) *BrowsersService {
  251. rs := &BrowsersService{s: s}
  252. return rs
  253. }
  254. type BrowsersService struct {
  255. s *Service
  256. }
  257. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  258. rs := &CampaignCreativeAssociationsService{s: s}
  259. return rs
  260. }
  261. type CampaignCreativeAssociationsService struct {
  262. s *Service
  263. }
  264. func NewCampaignsService(s *Service) *CampaignsService {
  265. rs := &CampaignsService{s: s}
  266. return rs
  267. }
  268. type CampaignsService struct {
  269. s *Service
  270. }
  271. func NewChangeLogsService(s *Service) *ChangeLogsService {
  272. rs := &ChangeLogsService{s: s}
  273. return rs
  274. }
  275. type ChangeLogsService struct {
  276. s *Service
  277. }
  278. func NewCitiesService(s *Service) *CitiesService {
  279. rs := &CitiesService{s: s}
  280. return rs
  281. }
  282. type CitiesService struct {
  283. s *Service
  284. }
  285. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  286. rs := &ConnectionTypesService{s: s}
  287. return rs
  288. }
  289. type ConnectionTypesService struct {
  290. s *Service
  291. }
  292. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  293. rs := &ContentCategoriesService{s: s}
  294. return rs
  295. }
  296. type ContentCategoriesService struct {
  297. s *Service
  298. }
  299. func NewConversionsService(s *Service) *ConversionsService {
  300. rs := &ConversionsService{s: s}
  301. return rs
  302. }
  303. type ConversionsService struct {
  304. s *Service
  305. }
  306. func NewCountriesService(s *Service) *CountriesService {
  307. rs := &CountriesService{s: s}
  308. return rs
  309. }
  310. type CountriesService struct {
  311. s *Service
  312. }
  313. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  314. rs := &CreativeAssetsService{s: s}
  315. return rs
  316. }
  317. type CreativeAssetsService struct {
  318. s *Service
  319. }
  320. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  321. rs := &CreativeFieldValuesService{s: s}
  322. return rs
  323. }
  324. type CreativeFieldValuesService struct {
  325. s *Service
  326. }
  327. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  328. rs := &CreativeFieldsService{s: s}
  329. return rs
  330. }
  331. type CreativeFieldsService struct {
  332. s *Service
  333. }
  334. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  335. rs := &CreativeGroupsService{s: s}
  336. return rs
  337. }
  338. type CreativeGroupsService struct {
  339. s *Service
  340. }
  341. func NewCreativesService(s *Service) *CreativesService {
  342. rs := &CreativesService{s: s}
  343. return rs
  344. }
  345. type CreativesService struct {
  346. s *Service
  347. }
  348. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  349. rs := &DimensionValuesService{s: s}
  350. return rs
  351. }
  352. type DimensionValuesService struct {
  353. s *Service
  354. }
  355. func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService {
  356. rs := &DirectorySiteContactsService{s: s}
  357. return rs
  358. }
  359. type DirectorySiteContactsService struct {
  360. s *Service
  361. }
  362. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  363. rs := &DirectorySitesService{s: s}
  364. return rs
  365. }
  366. type DirectorySitesService struct {
  367. s *Service
  368. }
  369. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  370. rs := &DynamicTargetingKeysService{s: s}
  371. return rs
  372. }
  373. type DynamicTargetingKeysService struct {
  374. s *Service
  375. }
  376. func NewEventTagsService(s *Service) *EventTagsService {
  377. rs := &EventTagsService{s: s}
  378. return rs
  379. }
  380. type EventTagsService struct {
  381. s *Service
  382. }
  383. func NewFilesService(s *Service) *FilesService {
  384. rs := &FilesService{s: s}
  385. return rs
  386. }
  387. type FilesService struct {
  388. s *Service
  389. }
  390. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  391. rs := &FloodlightActivitiesService{s: s}
  392. return rs
  393. }
  394. type FloodlightActivitiesService struct {
  395. s *Service
  396. }
  397. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  398. rs := &FloodlightActivityGroupsService{s: s}
  399. return rs
  400. }
  401. type FloodlightActivityGroupsService struct {
  402. s *Service
  403. }
  404. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  405. rs := &FloodlightConfigurationsService{s: s}
  406. return rs
  407. }
  408. type FloodlightConfigurationsService struct {
  409. s *Service
  410. }
  411. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  412. rs := &InventoryItemsService{s: s}
  413. return rs
  414. }
  415. type InventoryItemsService struct {
  416. s *Service
  417. }
  418. func NewLandingPagesService(s *Service) *LandingPagesService {
  419. rs := &LandingPagesService{s: s}
  420. return rs
  421. }
  422. type LandingPagesService 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 DCM 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 DCM require an
  839. // 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 DCM
  991. // user profile. This resource is specifically for managing user
  992. // profiles, whereas UserProfiles is for accessing the API.
  993. type AccountUserProfile struct {
  994. // AccountId: Account ID of the user profile. This is a read-only field
  995. // that can be left blank.
  996. AccountId int64 `json:"accountId,omitempty,string"`
  997. // Active: Whether this user profile is active. This defaults to false,
  998. // and must be set true on insert for the user profile to be usable.
  999. Active bool `json:"active,omitempty"`
  1000. // AdvertiserFilter: Filter that describes which advertisers are visible
  1001. // to the user profile.
  1002. AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"`
  1003. // CampaignFilter: Filter that describes which campaigns are visible to
  1004. // the user profile.
  1005. CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"`
  1006. // Comments: Comments for this user profile.
  1007. Comments string `json:"comments,omitempty"`
  1008. // Email: Email of the user profile. The email addresss must be linked
  1009. // to a Google Account. This field is required on insertion and is
  1010. // read-only after insertion.
  1011. Email string `json:"email,omitempty"`
  1012. // Id: ID of the user profile. This is a read-only, auto-generated
  1013. // field.
  1014. Id int64 `json:"id,omitempty,string"`
  1015. // Kind: Identifies what kind of resource this is. Value: the fixed
  1016. // string "dfareporting#accountUserProfile".
  1017. Kind string `json:"kind,omitempty"`
  1018. // Locale: Locale of the user profile. This is a required
  1019. // field.
  1020. // Acceptable values are:
  1021. // - "cs" (Czech)
  1022. // - "de" (German)
  1023. // - "en" (English)
  1024. // - "en-GB" (English United Kingdom)
  1025. // - "es" (Spanish)
  1026. // - "fr" (French)
  1027. // - "it" (Italian)
  1028. // - "ja" (Japanese)
  1029. // - "ko" (Korean)
  1030. // - "pl" (Polish)
  1031. // - "pt-BR" (Portuguese Brazil)
  1032. // - "ru" (Russian)
  1033. // - "sv" (Swedish)
  1034. // - "tr" (Turkish)
  1035. // - "zh-CN" (Chinese Simplified)
  1036. // - "zh-TW" (Chinese Traditional)
  1037. Locale string `json:"locale,omitempty"`
  1038. // Name: Name of the user profile. This is a required field. Must be
  1039. // less than 64 characters long, must be globally unique, and cannot
  1040. // contain whitespace or any of the following characters: "&;"#%,".
  1041. Name string `json:"name,omitempty"`
  1042. // SiteFilter: Filter that describes which sites are visible to the user
  1043. // profile.
  1044. SiteFilter *ObjectFilter `json:"siteFilter,omitempty"`
  1045. // SubaccountId: Subaccount ID of the user profile. This is a read-only
  1046. // field that can be left blank.
  1047. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1048. // TraffickerType: Trafficker type of this user profile.
  1049. //
  1050. // Possible values:
  1051. // "EXTERNAL_TRAFFICKER"
  1052. // "INTERNAL_NON_TRAFFICKER"
  1053. // "INTERNAL_TRAFFICKER"
  1054. TraffickerType string `json:"traffickerType,omitempty"`
  1055. // UserAccessType: User type of the user profile. This is a read-only
  1056. // field that can be left blank.
  1057. //
  1058. // Possible values:
  1059. // "INTERNAL_ADMINISTRATOR"
  1060. // "NORMAL_USER"
  1061. // "READ_ONLY_SUPER_USER"
  1062. // "SUPER_USER"
  1063. UserAccessType string `json:"userAccessType,omitempty"`
  1064. // UserRoleFilter: Filter that describes which user roles are visible to
  1065. // the user profile.
  1066. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1067. // UserRoleId: User role ID of the user profile. This is a required
  1068. // field.
  1069. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1070. // ServerResponse contains the HTTP response code and headers from the
  1071. // server.
  1072. googleapi.ServerResponse `json:"-"`
  1073. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1074. // unconditionally include in API requests. By default, fields with
  1075. // empty values are omitted from API requests. However, any non-pointer,
  1076. // non-interface field appearing in ForceSendFields will be sent to the
  1077. // server regardless of whether the field is empty or not. This may be
  1078. // used to include empty fields in Patch requests.
  1079. ForceSendFields []string `json:"-"`
  1080. // NullFields is a list of field names (e.g. "AccountId") to include in
  1081. // API requests with the JSON null value. By default, fields with empty
  1082. // values are omitted from API requests. However, any field with an
  1083. // empty value appearing in NullFields will be sent to the server as
  1084. // null. It is an error if a field in this list has a non-empty value.
  1085. // This may be used to include null fields in Patch requests.
  1086. NullFields []string `json:"-"`
  1087. }
  1088. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1089. type NoMethod AccountUserProfile
  1090. raw := NoMethod(*s)
  1091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1092. }
  1093. // AccountUserProfilesListResponse: Account User Profile List Response
  1094. type AccountUserProfilesListResponse struct {
  1095. // AccountUserProfiles: Account user profile collection.
  1096. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1097. // Kind: Identifies what kind of resource this is. Value: the fixed
  1098. // string "dfareporting#accountUserProfilesListResponse".
  1099. Kind string `json:"kind,omitempty"`
  1100. // NextPageToken: Pagination token to be used for the next list
  1101. // operation.
  1102. NextPageToken string `json:"nextPageToken,omitempty"`
  1103. // ServerResponse contains the HTTP response code and headers from the
  1104. // server.
  1105. googleapi.ServerResponse `json:"-"`
  1106. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1107. // to unconditionally include in API requests. By default, fields with
  1108. // empty values are omitted from API requests. However, any non-pointer,
  1109. // non-interface field appearing in ForceSendFields will be sent to the
  1110. // server regardless of whether the field is empty or not. This may be
  1111. // used to include empty fields in Patch requests.
  1112. ForceSendFields []string `json:"-"`
  1113. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1114. // include in API requests with the JSON null value. By default, fields
  1115. // with empty values are omitted from API requests. However, any field
  1116. // with an empty value appearing in NullFields will be sent to the
  1117. // server as null. It is an error if a field in this list has a
  1118. // non-empty value. This may be used to include null fields in Patch
  1119. // requests.
  1120. NullFields []string `json:"-"`
  1121. }
  1122. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1123. type NoMethod AccountUserProfilesListResponse
  1124. raw := NoMethod(*s)
  1125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1126. }
  1127. // AccountsListResponse: Account List Response
  1128. type AccountsListResponse struct {
  1129. // Accounts: Account collection.
  1130. Accounts []*Account `json:"accounts,omitempty"`
  1131. // Kind: Identifies what kind of resource this is. Value: the fixed
  1132. // string "dfareporting#accountsListResponse".
  1133. Kind string `json:"kind,omitempty"`
  1134. // NextPageToken: Pagination token to be used for the next list
  1135. // operation.
  1136. NextPageToken string `json:"nextPageToken,omitempty"`
  1137. // ServerResponse contains the HTTP response code and headers from the
  1138. // server.
  1139. googleapi.ServerResponse `json:"-"`
  1140. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1141. // unconditionally include in API requests. By default, fields with
  1142. // empty values are omitted from API requests. However, any non-pointer,
  1143. // non-interface field appearing in ForceSendFields will be sent to the
  1144. // server regardless of whether the field is empty or not. This may be
  1145. // used to include empty fields in Patch requests.
  1146. ForceSendFields []string `json:"-"`
  1147. // NullFields is a list of field names (e.g. "Accounts") to include in
  1148. // API requests with the JSON null value. By default, fields with empty
  1149. // values are omitted from API requests. However, any field with an
  1150. // empty value appearing in NullFields will be sent to the server as
  1151. // null. It is an error if a field in this list has a non-empty value.
  1152. // This may be used to include null fields in Patch requests.
  1153. NullFields []string `json:"-"`
  1154. }
  1155. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1156. type NoMethod AccountsListResponse
  1157. raw := NoMethod(*s)
  1158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1159. }
  1160. // Activities: Represents an activity group.
  1161. type Activities struct {
  1162. // Filters: List of activity filters. The dimension values need to be
  1163. // all either of type "dfa:activity" or "dfa:activityGroup".
  1164. Filters []*DimensionValue `json:"filters,omitempty"`
  1165. // Kind: The kind of resource this is, in this case
  1166. // dfareporting#activities.
  1167. Kind string `json:"kind,omitempty"`
  1168. // MetricNames: List of names of floodlight activity metrics.
  1169. MetricNames []string `json:"metricNames,omitempty"`
  1170. // ForceSendFields is a list of field names (e.g. "Filters") to
  1171. // unconditionally include in API requests. By default, fields with
  1172. // empty values are omitted from API requests. However, any non-pointer,
  1173. // non-interface field appearing in ForceSendFields will be sent to the
  1174. // server regardless of whether the field is empty or not. This may be
  1175. // used to include empty fields in Patch requests.
  1176. ForceSendFields []string `json:"-"`
  1177. // NullFields is a list of field names (e.g. "Filters") to include in
  1178. // API requests with the JSON null value. By default, fields with empty
  1179. // values are omitted from API requests. However, any field with an
  1180. // empty value appearing in NullFields will be sent to the server as
  1181. // null. It is an error if a field in this list has a non-empty value.
  1182. // This may be used to include null fields in Patch requests.
  1183. NullFields []string `json:"-"`
  1184. }
  1185. func (s *Activities) MarshalJSON() ([]byte, error) {
  1186. type NoMethod Activities
  1187. raw := NoMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1189. }
  1190. // Ad: Contains properties of a DCM ad.
  1191. type Ad struct {
  1192. // AccountId: Account ID of this ad. This is a read-only field that can
  1193. // be left blank.
  1194. AccountId int64 `json:"accountId,omitempty,string"`
  1195. // Active: Whether this ad is active. When true, archived must be false.
  1196. Active bool `json:"active,omitempty"`
  1197. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1198. // insertion.
  1199. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1200. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1201. // advertiser. This is a read-only, auto-generated field.
  1202. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1203. // Archived: Whether this ad is archived. When true, active must be
  1204. // false.
  1205. Archived bool `json:"archived,omitempty"`
  1206. // AudienceSegmentId: Audience segment ID that is being targeted for
  1207. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1208. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1209. // CampaignId: Campaign ID of this ad. This is a required field on
  1210. // insertion.
  1211. CampaignId int64 `json:"campaignId,omitempty,string"`
  1212. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1213. // This is a read-only, auto-generated field.
  1214. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1215. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1216. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1217. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1218. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1219. // for this ad. Applies to the URL in the ad or (if overriding ad
  1220. // properties) the URL in the creative.
  1221. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1222. // Comments: Comments for this ad.
  1223. Comments string `json:"comments,omitempty"`
  1224. // Compatibility: Compatibility of this ad. Applicable when type is
  1225. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1226. // either rendering on desktop or on mobile devices or in mobile apps
  1227. // for regular or interstitial ads, respectively. APP and
  1228. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1229. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1230. // default ads created for those placements will be limited to those
  1231. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1232. // video ads developed with the VAST standard.
  1233. //
  1234. // Possible values:
  1235. // "APP"
  1236. // "APP_INTERSTITIAL"
  1237. // "DISPLAY"
  1238. // "DISPLAY_INTERSTITIAL"
  1239. // "IN_STREAM_VIDEO"
  1240. Compatibility string `json:"compatibility,omitempty"`
  1241. // CreateInfo: Information about the creation of this ad. This is a
  1242. // read-only field.
  1243. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1244. // CreativeGroupAssignments: Creative group assignments for this ad.
  1245. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1246. // per creative group number is allowed for a maximum of two
  1247. // assignments.
  1248. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1249. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1250. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1251. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1252. // should have exactly one creativeAssignment.
  1253. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1254. // DayPartTargeting: Time and day targeting information for this ad.
  1255. // This field must be left blank if the ad is using a targeting
  1256. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1257. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1258. // DefaultClickThroughEventTagProperties: Default click-through event
  1259. // tag properties for this ad.
  1260. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1261. // DeliverySchedule: Delivery schedule information for this ad.
  1262. // Applicable when type is AD_SERVING_STANDARD_AD or
  1263. // AD_SERVING_TRACKING. This field along with subfields priority and
  1264. // impressionRatio are required on insertion when type is
  1265. // AD_SERVING_STANDARD_AD.
  1266. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1267. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1268. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1269. // field on insert, and is read-only after insert.
  1270. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1271. // EndTime: Date and time that this ad should stop serving. Must be
  1272. // later than the start time. This is a required field on insertion.
  1273. EndTime string `json:"endTime,omitempty"`
  1274. // EventTagOverrides: Event tag overrides for this ad.
  1275. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1276. // GeoTargeting: Geographical targeting information for this ad. This
  1277. // field must be left blank if the ad is using a targeting template.
  1278. // Applicable when type is AD_SERVING_STANDARD_AD.
  1279. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1280. // Id: ID of this ad. This is a read-only, auto-generated field.
  1281. Id int64 `json:"id,omitempty,string"`
  1282. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1283. // read-only, auto-generated field.
  1284. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1285. // KeyValueTargetingExpression: Key-value targeting information for this
  1286. // ad. This field must be left blank if the ad is using a targeting
  1287. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1288. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1289. // Kind: Identifies what kind of resource this is. Value: the fixed
  1290. // string "dfareporting#ad".
  1291. Kind string `json:"kind,omitempty"`
  1292. // LanguageTargeting: Language targeting information for this ad. This
  1293. // field must be left blank if the ad is using a targeting template.
  1294. // Applicable when type is AD_SERVING_STANDARD_AD.
  1295. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1296. // LastModifiedInfo: Information about the most recent modification of
  1297. // this ad. This is a read-only field.
  1298. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1299. // Name: Name of this ad. This is a required field and must be less than
  1300. // 256 characters long.
  1301. Name string `json:"name,omitempty"`
  1302. // PlacementAssignments: Placement assignments for this ad.
  1303. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1304. // RemarketingListExpression: Remarketing list targeting expression for
  1305. // this ad. This field must be left blank if the ad is using a targeting
  1306. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1307. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1308. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1309. Size *Size `json:"size,omitempty"`
  1310. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1311. // field that is auto-generated when the ad is inserted or updated.
  1312. SslCompliant bool `json:"sslCompliant,omitempty"`
  1313. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1314. // that is auto-generated when the ad is inserted or updated.
  1315. SslRequired bool `json:"sslRequired,omitempty"`
  1316. // StartTime: Date and time that this ad should start serving. If
  1317. // creating an ad, this field must be a time in the future. This is a
  1318. // required field on insertion.
  1319. StartTime string `json:"startTime,omitempty"`
  1320. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1321. // that can be left blank.
  1322. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1323. // TargetingTemplateId: Targeting template ID, used to apply
  1324. // preconfigured targeting information to this ad. This cannot be set
  1325. // while any of dayPartTargeting, geoTargeting,
  1326. // keyValueTargetingExpression, languageTargeting,
  1327. // remarketingListExpression, or technologyTargeting are set. Applicable
  1328. // when type is AD_SERVING_STANDARD_AD.
  1329. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1330. // TechnologyTargeting: Technology platform targeting information for
  1331. // this ad. This field must be left blank if the ad is using a targeting
  1332. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1333. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1334. // Type: Type of ad. This is a required field on insertion. Note that
  1335. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1336. // Creative resource).
  1337. //
  1338. // Possible values:
  1339. // "AD_SERVING_CLICK_TRACKER"
  1340. // "AD_SERVING_DEFAULT_AD"
  1341. // "AD_SERVING_STANDARD_AD"
  1342. // "AD_SERVING_TRACKING"
  1343. Type string `json:"type,omitempty"`
  1344. // ServerResponse contains the HTTP response code and headers from the
  1345. // server.
  1346. googleapi.ServerResponse `json:"-"`
  1347. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1348. // unconditionally include in API requests. By default, fields with
  1349. // empty values are omitted from API requests. However, any non-pointer,
  1350. // non-interface field appearing in ForceSendFields will be sent to the
  1351. // server regardless of whether the field is empty or not. This may be
  1352. // used to include empty fields in Patch requests.
  1353. ForceSendFields []string `json:"-"`
  1354. // NullFields is a list of field names (e.g. "AccountId") to include in
  1355. // API requests with the JSON null value. By default, fields with empty
  1356. // values are omitted from API requests. However, any field with an
  1357. // empty value appearing in NullFields will be sent to the server as
  1358. // null. It is an error if a field in this list has a non-empty value.
  1359. // This may be used to include null fields in Patch requests.
  1360. NullFields []string `json:"-"`
  1361. }
  1362. func (s *Ad) MarshalJSON() ([]byte, error) {
  1363. type NoMethod Ad
  1364. raw := NoMethod(*s)
  1365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1366. }
  1367. // AdSlot: Ad Slot
  1368. type AdSlot struct {
  1369. // Comment: Comment for this ad slot.
  1370. Comment string `json:"comment,omitempty"`
  1371. // Compatibility: Ad slot compatibility. DISPLAY and
  1372. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1373. // devices or in mobile apps for regular or interstitial ads
  1374. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1375. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1376. // developed with the VAST standard.
  1377. //
  1378. // Possible values:
  1379. // "APP"
  1380. // "APP_INTERSTITIAL"
  1381. // "DISPLAY"
  1382. // "DISPLAY_INTERSTITIAL"
  1383. // "IN_STREAM_VIDEO"
  1384. Compatibility string `json:"compatibility,omitempty"`
  1385. // Height: Height of this ad slot.
  1386. Height int64 `json:"height,omitempty,string"`
  1387. // LinkedPlacementId: ID of the placement from an external platform that
  1388. // is linked to this ad slot.
  1389. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1390. // Name: Name of this ad slot.
  1391. Name string `json:"name,omitempty"`
  1392. // PaymentSourceType: Payment source type of this ad slot.
  1393. //
  1394. // Possible values:
  1395. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1396. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1397. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1398. // Primary: Primary ad slot of a roadblock inventory item.
  1399. Primary bool `json:"primary,omitempty"`
  1400. // Width: Width of this ad slot.
  1401. Width int64 `json:"width,omitempty,string"`
  1402. // ForceSendFields is a list of field names (e.g. "Comment") to
  1403. // unconditionally include in API requests. By default, fields with
  1404. // empty values are omitted from API requests. However, any non-pointer,
  1405. // non-interface field appearing in ForceSendFields will be sent to the
  1406. // server regardless of whether the field is empty or not. This may be
  1407. // used to include empty fields in Patch requests.
  1408. ForceSendFields []string `json:"-"`
  1409. // NullFields is a list of field names (e.g. "Comment") to include in
  1410. // API requests with the JSON null value. By default, fields with empty
  1411. // values are omitted from API requests. However, any field with an
  1412. // empty value appearing in NullFields will be sent to the server as
  1413. // null. It is an error if a field in this list has a non-empty value.
  1414. // This may be used to include null fields in Patch requests.
  1415. NullFields []string `json:"-"`
  1416. }
  1417. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1418. type NoMethod AdSlot
  1419. raw := NoMethod(*s)
  1420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1421. }
  1422. // AdsListResponse: Ad List Response
  1423. type AdsListResponse struct {
  1424. // Ads: Ad collection.
  1425. Ads []*Ad `json:"ads,omitempty"`
  1426. // Kind: Identifies what kind of resource this is. Value: the fixed
  1427. // string "dfareporting#adsListResponse".
  1428. Kind string `json:"kind,omitempty"`
  1429. // NextPageToken: Pagination token to be used for the next list
  1430. // operation.
  1431. NextPageToken string `json:"nextPageToken,omitempty"`
  1432. // ServerResponse contains the HTTP response code and headers from the
  1433. // server.
  1434. googleapi.ServerResponse `json:"-"`
  1435. // ForceSendFields is a list of field names (e.g. "Ads") to
  1436. // unconditionally include in API requests. By default, fields with
  1437. // empty values are omitted from API requests. However, any non-pointer,
  1438. // non-interface field appearing in ForceSendFields will be sent to the
  1439. // server regardless of whether the field is empty or not. This may be
  1440. // used to include empty fields in Patch requests.
  1441. ForceSendFields []string `json:"-"`
  1442. // NullFields is a list of field names (e.g. "Ads") to include in API
  1443. // requests with the JSON null value. By default, fields with empty
  1444. // values are omitted from API requests. However, any field with an
  1445. // empty value appearing in NullFields will be sent to the server as
  1446. // null. It is an error if a field in this list has a non-empty value.
  1447. // This may be used to include null fields in Patch requests.
  1448. NullFields []string `json:"-"`
  1449. }
  1450. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1451. type NoMethod AdsListResponse
  1452. raw := NoMethod(*s)
  1453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1454. }
  1455. // Advertiser: Contains properties of a DCM advertiser.
  1456. type Advertiser struct {
  1457. // AccountId: Account ID of this advertiser.This is a read-only field
  1458. // that can be left blank.
  1459. AccountId int64 `json:"accountId,omitempty,string"`
  1460. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1461. // to. You can group advertisers for reporting purposes, allowing you to
  1462. // see aggregated information for all advertisers in each group.
  1463. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1464. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1465. // creative associations under this advertiser. Must be less than 129
  1466. // characters long.
  1467. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1468. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1469. // apply by default to the landing pages of this advertiser's campaigns.
  1470. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1471. // DefaultEmail: Default email address used in sender field for tag
  1472. // emails.
  1473. DefaultEmail string `json:"defaultEmail,omitempty"`
  1474. // FloodlightConfigurationId: Floodlight configuration ID of this
  1475. // advertiser. The floodlight configuration ID will be created
  1476. // automatically, so on insert this field should be left blank. This
  1477. // field can be set to another advertiser's floodlight configuration ID
  1478. // in order to share that advertiser's floodlight configuration with
  1479. // this advertiser, so long as:
  1480. // - This advertiser's original floodlight configuration is not already
  1481. // associated with floodlight activities or floodlight activity groups.
  1482. //
  1483. // - This advertiser's original floodlight configuration is not already
  1484. // shared with another advertiser.
  1485. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1486. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1487. // of the floodlight configuration. This is a read-only, auto-generated
  1488. // field.
  1489. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1490. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1491. Id int64 `json:"id,omitempty,string"`
  1492. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1493. // is a read-only, auto-generated field.
  1494. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1495. // Kind: Identifies what kind of resource this is. Value: the fixed
  1496. // string "dfareporting#advertiser".
  1497. Kind string `json:"kind,omitempty"`
  1498. // Name: Name of this advertiser. This is a required field and must be
  1499. // less than 256 characters long and unique among advertisers of the
  1500. // same account.
  1501. Name string `json:"name,omitempty"`
  1502. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1503. // before any sharing occurred. Set the floodlightConfigurationId of
  1504. // this advertiser to originalFloodlightConfigurationId to unshare the
  1505. // advertiser's current floodlight configuration. You cannot unshare an
  1506. // advertiser's floodlight configuration if the shared configuration has
  1507. // activities associated with any campaign or placement.
  1508. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1509. // Status: Status of this advertiser.
  1510. //
  1511. // Possible values:
  1512. // "APPROVED"
  1513. // "ON_HOLD"
  1514. Status string `json:"status,omitempty"`
  1515. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1516. // field that can be left blank.
  1517. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1518. // Suspended: Suspension status of this advertiser.
  1519. Suspended bool `json:"suspended,omitempty"`
  1520. // ServerResponse contains the HTTP response code and headers from the
  1521. // server.
  1522. googleapi.ServerResponse `json:"-"`
  1523. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1524. // unconditionally include in API requests. By default, fields with
  1525. // empty values are omitted from API requests. However, any non-pointer,
  1526. // non-interface field appearing in ForceSendFields will be sent to the
  1527. // server regardless of whether the field is empty or not. This may be
  1528. // used to include empty fields in Patch requests.
  1529. ForceSendFields []string `json:"-"`
  1530. // NullFields is a list of field names (e.g. "AccountId") to include in
  1531. // API requests with the JSON null value. By default, fields with empty
  1532. // values are omitted from API requests. However, any field with an
  1533. // empty value appearing in NullFields will be sent to the server as
  1534. // null. It is an error if a field in this list has a non-empty value.
  1535. // This may be used to include null fields in Patch requests.
  1536. NullFields []string `json:"-"`
  1537. }
  1538. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1539. type NoMethod Advertiser
  1540. raw := NoMethod(*s)
  1541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1542. }
  1543. // AdvertiserGroup: Groups advertisers together so that reports can be
  1544. // generated for the entire group at once.
  1545. type AdvertiserGroup struct {
  1546. // AccountId: Account ID of this advertiser group. This is a read-only
  1547. // field that can be left blank.
  1548. AccountId int64 `json:"accountId,omitempty,string"`
  1549. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1550. // field.
  1551. Id int64 `json:"id,omitempty,string"`
  1552. // Kind: Identifies what kind of resource this is. Value: the fixed
  1553. // string "dfareporting#advertiserGroup".
  1554. Kind string `json:"kind,omitempty"`
  1555. // Name: Name of this advertiser group. This is a required field and
  1556. // must be less than 256 characters long and unique among advertiser
  1557. // groups of the same account.
  1558. Name string `json:"name,omitempty"`
  1559. // ServerResponse contains the HTTP response code and headers from the
  1560. // server.
  1561. googleapi.ServerResponse `json:"-"`
  1562. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1563. // unconditionally include in API requests. By default, fields with
  1564. // empty values are omitted from API requests. However, any non-pointer,
  1565. // non-interface field appearing in ForceSendFields will be sent to the
  1566. // server regardless of whether the field is empty or not. This may be
  1567. // used to include empty fields in Patch requests.
  1568. ForceSendFields []string `json:"-"`
  1569. // NullFields is a list of field names (e.g. "AccountId") to include in
  1570. // API requests with the JSON null value. By default, fields with empty
  1571. // values are omitted from API requests. However, any field with an
  1572. // empty value appearing in NullFields will be sent to the server as
  1573. // null. It is an error if a field in this list has a non-empty value.
  1574. // This may be used to include null fields in Patch requests.
  1575. NullFields []string `json:"-"`
  1576. }
  1577. func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1578. type NoMethod AdvertiserGroup
  1579. raw := NoMethod(*s)
  1580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1581. }
  1582. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1583. type AdvertiserGroupsListResponse struct {
  1584. // AdvertiserGroups: Advertiser group collection.
  1585. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1586. // Kind: Identifies what kind of resource this is. Value: the fixed
  1587. // string "dfareporting#advertiserGroupsListResponse".
  1588. Kind string `json:"kind,omitempty"`
  1589. // NextPageToken: Pagination token to be used for the next list
  1590. // operation.
  1591. NextPageToken string `json:"nextPageToken,omitempty"`
  1592. // ServerResponse contains the HTTP response code and headers from the
  1593. // server.
  1594. googleapi.ServerResponse `json:"-"`
  1595. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1596. // unconditionally include in API requests. By default, fields with
  1597. // empty values are omitted from API requests. However, any non-pointer,
  1598. // non-interface field appearing in ForceSendFields will be sent to the
  1599. // server regardless of whether the field is empty or not. This may be
  1600. // used to include empty fields in Patch requests.
  1601. ForceSendFields []string `json:"-"`
  1602. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1603. // include in API requests with the JSON null value. By default, fields
  1604. // with empty values are omitted from API requests. However, any field
  1605. // with an empty value appearing in NullFields will be sent to the
  1606. // server as null. It is an error if a field in this list has a
  1607. // non-empty value. This may be used to include null fields in Patch
  1608. // requests.
  1609. NullFields []string `json:"-"`
  1610. }
  1611. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1612. type NoMethod AdvertiserGroupsListResponse
  1613. raw := NoMethod(*s)
  1614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1615. }
  1616. // AdvertisersListResponse: Advertiser List Response
  1617. type AdvertisersListResponse struct {
  1618. // Advertisers: Advertiser collection.
  1619. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1620. // Kind: Identifies what kind of resource this is. Value: the fixed
  1621. // string "dfareporting#advertisersListResponse".
  1622. Kind string `json:"kind,omitempty"`
  1623. // NextPageToken: Pagination token to be used for the next list
  1624. // operation.
  1625. NextPageToken string `json:"nextPageToken,omitempty"`
  1626. // ServerResponse contains the HTTP response code and headers from the
  1627. // server.
  1628. googleapi.ServerResponse `json:"-"`
  1629. // ForceSendFields is a list of field names (e.g. "Advertisers") to
  1630. // unconditionally include in API requests. By default, fields with
  1631. // empty values are omitted from API requests. However, any non-pointer,
  1632. // non-interface field appearing in ForceSendFields will be sent to the
  1633. // server regardless of whether the field is empty or not. This may be
  1634. // used to include empty fields in Patch requests.
  1635. ForceSendFields []string `json:"-"`
  1636. // NullFields is a list of field names (e.g. "Advertisers") to include
  1637. // in API requests with the JSON null value. By default, fields with
  1638. // empty values are omitted from API requests. However, any field with
  1639. // an empty value appearing in NullFields will be sent to the server as
  1640. // null. It is an error if a field in this list has a non-empty value.
  1641. // This may be used to include null fields in Patch requests.
  1642. NullFields []string `json:"-"`
  1643. }
  1644. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1645. type NoMethod AdvertisersListResponse
  1646. raw := NoMethod(*s)
  1647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1648. }
  1649. // AudienceSegment: Audience Segment.
  1650. type AudienceSegment struct {
  1651. // Allocation: Weight allocated to this segment. The weight assigned
  1652. // will be understood in proportion to the weights assigned to other
  1653. // segments in the same segment group. Acceptable values are 1 to 1000,
  1654. // inclusive.
  1655. Allocation int64 `json:"allocation,omitempty"`
  1656. // Id: ID of this audience segment. This is a read-only, auto-generated
  1657. // field.
  1658. Id int64 `json:"id,omitempty,string"`
  1659. // Name: Name of this audience segment. This is a required field and
  1660. // must be less than 65 characters long.
  1661. Name string `json:"name,omitempty"`
  1662. // ForceSendFields is a list of field names (e.g. "Allocation") to
  1663. // unconditionally include in API requests. By default, fields with
  1664. // empty values are omitted from API requests. However, any non-pointer,
  1665. // non-interface field appearing in ForceSendFields will be sent to the
  1666. // server regardless of whether the field is empty or not. This may be
  1667. // used to include empty fields in Patch requests.
  1668. ForceSendFields []string `json:"-"`
  1669. // NullFields is a list of field names (e.g. "Allocation") to include in
  1670. // API requests with the JSON null value. By default, fields with empty
  1671. // values are omitted from API requests. However, any field with an
  1672. // empty value appearing in NullFields will be sent to the server as
  1673. // null. It is an error if a field in this list has a non-empty value.
  1674. // This may be used to include null fields in Patch requests.
  1675. NullFields []string `json:"-"`
  1676. }
  1677. func (s *AudienceSegment) MarshalJSON() ([]byte, error) {
  1678. type NoMethod AudienceSegment
  1679. raw := NoMethod(*s)
  1680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1681. }
  1682. // AudienceSegmentGroup: Audience Segment Group.
  1683. type AudienceSegmentGroup struct {
  1684. // AudienceSegments: Audience segments assigned to this group. The
  1685. // number of segments must be between 2 and 100.
  1686. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1687. // Id: ID of this audience segment group. This is a read-only,
  1688. // auto-generated field.
  1689. Id int64 `json:"id,omitempty,string"`
  1690. // Name: Name of this audience segment group. This is a required field
  1691. // and must be less than 65 characters long.
  1692. Name string `json:"name,omitempty"`
  1693. // ForceSendFields is a list of field names (e.g. "AudienceSegments") to
  1694. // unconditionally include in API requests. By default, fields with
  1695. // empty values are omitted from API requests. However, any non-pointer,
  1696. // non-interface field appearing in ForceSendFields will be sent to the
  1697. // server regardless of whether the field is empty or not. This may be
  1698. // used to include empty fields in Patch requests.
  1699. ForceSendFields []string `json:"-"`
  1700. // NullFields is a list of field names (e.g. "AudienceSegments") to
  1701. // include in API requests with the JSON null value. By default, fields
  1702. // with empty values are omitted from API requests. However, any field
  1703. // with an empty value appearing in NullFields will be sent to the
  1704. // server as null. It is an error if a field in this list has a
  1705. // non-empty value. This may be used to include null fields in Patch
  1706. // requests.
  1707. NullFields []string `json:"-"`
  1708. }
  1709. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1710. type NoMethod AudienceSegmentGroup
  1711. raw := NoMethod(*s)
  1712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1713. }
  1714. // Browser: Contains information about a browser that can be targeted by
  1715. // ads.
  1716. type Browser struct {
  1717. // BrowserVersionId: ID referring to this grouping of browser and
  1718. // version numbers. This is the ID used for targeting.
  1719. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1720. // DartId: DART ID of this browser. This is the ID used when generating
  1721. // reports.
  1722. DartId int64 `json:"dartId,omitempty,string"`
  1723. // Kind: Identifies what kind of resource this is. Value: the fixed
  1724. // string "dfareporting#browser".
  1725. Kind string `json:"kind,omitempty"`
  1726. // MajorVersion: Major version number (leftmost number) of this browser.
  1727. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1728. // 5. An asterisk (*) may be used to target any version number, and a
  1729. // question mark (?) may be used to target cases where the version
  1730. // number cannot be identified. For example, Chrome *.* targets any
  1731. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1732. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1733. // server knows the browser is Firefox but can't tell which version it
  1734. // is.
  1735. MajorVersion string `json:"majorVersion,omitempty"`
  1736. // MinorVersion: Minor version number (number after first dot on left)
  1737. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1738. // should be set to 0. An asterisk (*) may be used to target any version
  1739. // number, and a question mark (?) may be used to target cases where the
  1740. // version number cannot be identified. For example, Chrome *.* targets
  1741. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1742. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1743. // server knows the browser is Firefox but can't tell which version it
  1744. // is.
  1745. MinorVersion string `json:"minorVersion,omitempty"`
  1746. // Name: Name of this browser.
  1747. Name string `json:"name,omitempty"`
  1748. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1749. // unconditionally include in API requests. By default, fields with
  1750. // empty values are omitted from API requests. However, any non-pointer,
  1751. // non-interface field appearing in ForceSendFields will be sent to the
  1752. // server regardless of whether the field is empty or not. This may be
  1753. // used to include empty fields in Patch requests.
  1754. ForceSendFields []string `json:"-"`
  1755. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1756. // include in API requests with the JSON null value. By default, fields
  1757. // with empty values are omitted from API requests. However, any field
  1758. // with an empty value appearing in NullFields will be sent to the
  1759. // server as null. It is an error if a field in this list has a
  1760. // non-empty value. This may be used to include null fields in Patch
  1761. // requests.
  1762. NullFields []string `json:"-"`
  1763. }
  1764. func (s *Browser) MarshalJSON() ([]byte, error) {
  1765. type NoMethod Browser
  1766. raw := NoMethod(*s)
  1767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1768. }
  1769. // BrowsersListResponse: Browser List Response
  1770. type BrowsersListResponse struct {
  1771. // Browsers: Browser collection.
  1772. Browsers []*Browser `json:"browsers,omitempty"`
  1773. // Kind: Identifies what kind of resource this is. Value: the fixed
  1774. // string "dfareporting#browsersListResponse".
  1775. Kind string `json:"kind,omitempty"`
  1776. // ServerResponse contains the HTTP response code and headers from the
  1777. // server.
  1778. googleapi.ServerResponse `json:"-"`
  1779. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1780. // unconditionally include in API requests. By default, fields with
  1781. // empty values are omitted from API requests. However, any non-pointer,
  1782. // non-interface field appearing in ForceSendFields will be sent to the
  1783. // server regardless of whether the field is empty or not. This may be
  1784. // used to include empty fields in Patch requests.
  1785. ForceSendFields []string `json:"-"`
  1786. // NullFields is a list of field names (e.g. "Browsers") to include in
  1787. // API requests with the JSON null value. By default, fields with empty
  1788. // values are omitted from API requests. However, any field with an
  1789. // empty value appearing in NullFields will be sent to the server as
  1790. // null. It is an error if a field in this list has a non-empty value.
  1791. // This may be used to include null fields in Patch requests.
  1792. NullFields []string `json:"-"`
  1793. }
  1794. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1795. type NoMethod BrowsersListResponse
  1796. raw := NoMethod(*s)
  1797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1798. }
  1799. // Campaign: Contains properties of a DCM campaign.
  1800. type Campaign struct {
  1801. // AccountId: Account ID of this campaign. This is a read-only field
  1802. // that can be left blank.
  1803. AccountId int64 `json:"accountId,omitempty,string"`
  1804. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1805. // optimization configurations for the campaign.
  1806. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1807. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1808. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1809. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1810. // field.
  1811. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1812. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1813. // this campaign. This is a read-only, auto-generated field.
  1814. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1815. // Archived: Whether this campaign has been archived.
  1816. Archived bool `json:"archived,omitempty"`
  1817. // AudienceSegmentGroups: Audience segment groups assigned to this
  1818. // campaign. Cannot have more than 300 segment groups.
  1819. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1820. // BillingInvoiceCode: Billing invoice code included in the DCM client
  1821. // billing invoices associated with the campaign.
  1822. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1823. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1824. // properties for this campaign.
  1825. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1826. // Comment: Arbitrary comments about this campaign. Must be less than
  1827. // 256 characters long.
  1828. Comment string `json:"comment,omitempty"`
  1829. // CreateInfo: Information about the creation of this campaign. This is
  1830. // a read-only field.
  1831. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1832. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1833. // campaign.
  1834. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1835. // CreativeOptimizationConfiguration: Creative optimization
  1836. // configuration for the campaign.
  1837. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1838. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1839. // override properties for this campaign.
  1840. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1841. // EndDate: Date on which the campaign will stop running. On insert, the
  1842. // end date must be today or a future date. The end date must be later
  1843. // than or be the same as the start date. If, for example, you set
  1844. // 6/25/2015 as both the start and end dates, the effective campaign run
  1845. // date is just that day only, 6/25/2015. The hours, minutes, and
  1846. // seconds of the end date should not be set, as doing so will result in
  1847. // an error. This is a required field.
  1848. EndDate string `json:"endDate,omitempty"`
  1849. // EventTagOverrides: Overrides that can be used to activate or
  1850. // deactivate advertiser event tags.
  1851. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1852. // ExternalId: External ID for this campaign.
  1853. ExternalId string `json:"externalId,omitempty"`
  1854. // Id: ID of this campaign. This is a read-only auto-generated field.
  1855. Id int64 `json:"id,omitempty,string"`
  1856. // IdDimensionValue: Dimension value for the ID of this campaign. This
  1857. // is a read-only, auto-generated field.
  1858. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1859. // Kind: Identifies what kind of resource this is. Value: the fixed
  1860. // string "dfareporting#campaign".
  1861. Kind string `json:"kind,omitempty"`
  1862. // LastModifiedInfo: Information about the most recent modification of
  1863. // this campaign. This is a read-only field.
  1864. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1865. // LookbackConfiguration: Lookback window settings for the campaign.
  1866. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  1867. // Name: Name of this campaign. This is a required field and must be
  1868. // less than 256 characters long and unique among campaigns of the same
  1869. // advertiser.
  1870. Name string `json:"name,omitempty"`
  1871. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  1872. // campaign.
  1873. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  1874. // StartDate: Date on which the campaign starts running. The start date
  1875. // can be any date. The hours, minutes, and seconds of the start date
  1876. // should not be set, as doing so will result in an error. This is a
  1877. // required field.
  1878. StartDate string `json:"startDate,omitempty"`
  1879. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  1880. // field that can be left blank.
  1881. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1882. // TraffickerEmails: Campaign trafficker contact emails.
  1883. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  1884. // ServerResponse contains the HTTP response code and headers from the
  1885. // server.
  1886. googleapi.ServerResponse `json:"-"`
  1887. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1888. // unconditionally include in API requests. By default, fields with
  1889. // empty values are omitted from API requests. However, any non-pointer,
  1890. // non-interface field appearing in ForceSendFields will be sent to the
  1891. // server regardless of whether the field is empty or not. This may be
  1892. // used to include empty fields in Patch requests.
  1893. ForceSendFields []string `json:"-"`
  1894. // NullFields is a list of field names (e.g. "AccountId") to include in
  1895. // API requests with the JSON null value. By default, fields with empty
  1896. // values are omitted from API requests. However, any field with an
  1897. // empty value appearing in NullFields will be sent to the server as
  1898. // null. It is an error if a field in this list has a non-empty value.
  1899. // This may be used to include null fields in Patch requests.
  1900. NullFields []string `json:"-"`
  1901. }
  1902. func (s *Campaign) MarshalJSON() ([]byte, error) {
  1903. type NoMethod Campaign
  1904. raw := NoMethod(*s)
  1905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1906. }
  1907. // CampaignCreativeAssociation: Identifies a creative which has been
  1908. // associated with a given campaign.
  1909. type CampaignCreativeAssociation struct {
  1910. // CreativeId: ID of the creative associated with the campaign. This is
  1911. // a required field.
  1912. CreativeId int64 `json:"creativeId,omitempty,string"`
  1913. // Kind: Identifies what kind of resource this is. Value: the fixed
  1914. // string "dfareporting#campaignCreativeAssociation".
  1915. Kind string `json:"kind,omitempty"`
  1916. // ServerResponse contains the HTTP response code and headers from the
  1917. // server.
  1918. googleapi.ServerResponse `json:"-"`
  1919. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  1920. // unconditionally include in API requests. By default, fields with
  1921. // empty values are omitted from API requests. However, any non-pointer,
  1922. // non-interface field appearing in ForceSendFields will be sent to the
  1923. // server regardless of whether the field is empty or not. This may be
  1924. // used to include empty fields in Patch requests.
  1925. ForceSendFields []string `json:"-"`
  1926. // NullFields is a list of field names (e.g. "CreativeId") to include in
  1927. // API requests with the JSON null value. By default, fields with empty
  1928. // values are omitted from API requests. However, any field with an
  1929. // empty value appearing in NullFields will be sent to the server as
  1930. // null. It is an error if a field in this list has a non-empty value.
  1931. // This may be used to include null fields in Patch requests.
  1932. NullFields []string `json:"-"`
  1933. }
  1934. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  1935. type NoMethod CampaignCreativeAssociation
  1936. raw := NoMethod(*s)
  1937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1938. }
  1939. // CampaignCreativeAssociationsListResponse: Campaign Creative
  1940. // Association List Response
  1941. type CampaignCreativeAssociationsListResponse struct {
  1942. // CampaignCreativeAssociations: Campaign creative association
  1943. // collection
  1944. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  1945. // Kind: Identifies what kind of resource this is. Value: the fixed
  1946. // string "dfareporting#campaignCreativeAssociationsListResponse".
  1947. Kind string `json:"kind,omitempty"`
  1948. // NextPageToken: Pagination token to be used for the next list
  1949. // operation.
  1950. NextPageToken string `json:"nextPageToken,omitempty"`
  1951. // ServerResponse contains the HTTP response code and headers from the
  1952. // server.
  1953. googleapi.ServerResponse `json:"-"`
  1954. // ForceSendFields is a list of field names (e.g.
  1955. // "CampaignCreativeAssociations") to unconditionally include in API
  1956. // requests. By default, fields with empty values are omitted from API
  1957. // requests. However, any non-pointer, non-interface field appearing in
  1958. // ForceSendFields will be sent to the server regardless of whether the
  1959. // field is empty or not. This may be used to include empty fields in
  1960. // Patch requests.
  1961. ForceSendFields []string `json:"-"`
  1962. // NullFields is a list of field names (e.g.
  1963. // "CampaignCreativeAssociations") to include in API requests with the
  1964. // JSON null value. By default, fields with empty values are omitted
  1965. // from API requests. However, any field with an empty value appearing
  1966. // in NullFields will be sent to the server as null. It is an error if a
  1967. // field in this list has a non-empty value. This may be used to include
  1968. // null fields in Patch requests.
  1969. NullFields []string `json:"-"`
  1970. }
  1971. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  1972. type NoMethod CampaignCreativeAssociationsListResponse
  1973. raw := NoMethod(*s)
  1974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1975. }
  1976. // CampaignsListResponse: Campaign List Response
  1977. type CampaignsListResponse struct {
  1978. // Campaigns: Campaign collection.
  1979. Campaigns []*Campaign `json:"campaigns,omitempty"`
  1980. // Kind: Identifies what kind of resource this is. Value: the fixed
  1981. // string "dfareporting#campaignsListResponse".
  1982. Kind string `json:"kind,omitempty"`
  1983. // NextPageToken: Pagination token to be used for the next list
  1984. // operation.
  1985. NextPageToken string `json:"nextPageToken,omitempty"`
  1986. // ServerResponse contains the HTTP response code and headers from the
  1987. // server.
  1988. googleapi.ServerResponse `json:"-"`
  1989. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  1990. // unconditionally include in API requests. By default, fields with
  1991. // empty values are omitted from API requests. However, any non-pointer,
  1992. // non-interface field appearing in ForceSendFields will be sent to the
  1993. // server regardless of whether the field is empty or not. This may be
  1994. // used to include empty fields in Patch requests.
  1995. ForceSendFields []string `json:"-"`
  1996. // NullFields is a list of field names (e.g. "Campaigns") to include in
  1997. // API requests with the JSON null value. By default, fields with empty
  1998. // values are omitted from API requests. However, any field with an
  1999. // empty value appearing in NullFields will be sent to the server as
  2000. // null. It is an error if a field in this list has a non-empty value.
  2001. // This may be used to include null fields in Patch requests.
  2002. NullFields []string `json:"-"`
  2003. }
  2004. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2005. type NoMethod CampaignsListResponse
  2006. raw := NoMethod(*s)
  2007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2008. }
  2009. // ChangeLog: Describes a change that a user has made to a resource.
  2010. type ChangeLog struct {
  2011. // AccountId: Account ID of the modified object.
  2012. AccountId int64 `json:"accountId,omitempty,string"`
  2013. // Action: Action which caused the change.
  2014. Action string `json:"action,omitempty"`
  2015. // ChangeTime: Time when the object was modified.
  2016. ChangeTime string `json:"changeTime,omitempty"`
  2017. // FieldName: Field name of the object which changed.
  2018. FieldName string `json:"fieldName,omitempty"`
  2019. // Id: ID of this change log.
  2020. Id int64 `json:"id,omitempty,string"`
  2021. // Kind: Identifies what kind of resource this is. Value: the fixed
  2022. // string "dfareporting#changeLog".
  2023. Kind string `json:"kind,omitempty"`
  2024. // NewValue: New value of the object field.
  2025. NewValue string `json:"newValue,omitempty"`
  2026. // ObjectId: ID of the object of this change log. The object could be a
  2027. // campaign, placement, ad, or other type.
  2028. ObjectId int64 `json:"objectId,omitempty,string"`
  2029. // ObjectType: Object type of the change log.
  2030. ObjectType string `json:"objectType,omitempty"`
  2031. // OldValue: Old value of the object field.
  2032. OldValue string `json:"oldValue,omitempty"`
  2033. // SubaccountId: Subaccount ID of the modified object.
  2034. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2035. // TransactionId: Transaction ID of this change log. When a single API
  2036. // call results in many changes, each change will have a separate ID in
  2037. // the change log but will share the same transactionId.
  2038. TransactionId int64 `json:"transactionId,omitempty,string"`
  2039. // UserProfileId: ID of the user who modified the object.
  2040. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2041. // UserProfileName: User profile name of the user who modified the
  2042. // object.
  2043. UserProfileName string `json:"userProfileName,omitempty"`
  2044. // ServerResponse contains the HTTP response code and headers from the
  2045. // server.
  2046. googleapi.ServerResponse `json:"-"`
  2047. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2048. // unconditionally include in API requests. By default, fields with
  2049. // empty values are omitted from API requests. However, any non-pointer,
  2050. // non-interface field appearing in ForceSendFields will be sent to the
  2051. // server regardless of whether the field is empty or not. This may be
  2052. // used to include empty fields in Patch requests.
  2053. ForceSendFields []string `json:"-"`
  2054. // NullFields is a list of field names (e.g. "AccountId") to include in
  2055. // API requests with the JSON null value. By default, fields with empty
  2056. // values are omitted from API requests. However, any field with an
  2057. // empty value appearing in NullFields will be sent to the server as
  2058. // null. It is an error if a field in this list has a non-empty value.
  2059. // This may be used to include null fields in Patch requests.
  2060. NullFields []string `json:"-"`
  2061. }
  2062. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2063. type NoMethod ChangeLog
  2064. raw := NoMethod(*s)
  2065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2066. }
  2067. // ChangeLogsListResponse: Change Log List Response
  2068. type ChangeLogsListResponse struct {
  2069. // ChangeLogs: Change log collection.
  2070. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2071. // Kind: Identifies what kind of resource this is. Value: the fixed
  2072. // string "dfareporting#changeLogsListResponse".
  2073. Kind string `json:"kind,omitempty"`
  2074. // NextPageToken: Pagination token to be used for the next list
  2075. // operation.
  2076. NextPageToken string `json:"nextPageToken,omitempty"`
  2077. // ServerResponse contains the HTTP response code and headers from the
  2078. // server.
  2079. googleapi.ServerResponse `json:"-"`
  2080. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2081. // unconditionally include in API requests. By default, fields with
  2082. // empty values are omitted from API requests. However, any non-pointer,
  2083. // non-interface field appearing in ForceSendFields will be sent to the
  2084. // server regardless of whether the field is empty or not. This may be
  2085. // used to include empty fields in Patch requests.
  2086. ForceSendFields []string `json:"-"`
  2087. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2088. // API requests with the JSON null value. By default, fields with empty
  2089. // values are omitted from API requests. However, any field with an
  2090. // empty value appearing in NullFields will be sent to the server as
  2091. // null. It is an error if a field in this list has a non-empty value.
  2092. // This may be used to include null fields in Patch requests.
  2093. NullFields []string `json:"-"`
  2094. }
  2095. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2096. type NoMethod ChangeLogsListResponse
  2097. raw := NoMethod(*s)
  2098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2099. }
  2100. // CitiesListResponse: City List Response
  2101. type CitiesListResponse struct {
  2102. // Cities: City collection.
  2103. Cities []*City `json:"cities,omitempty"`
  2104. // Kind: Identifies what kind of resource this is. Value: the fixed
  2105. // string "dfareporting#citiesListResponse".
  2106. Kind string `json:"kind,omitempty"`
  2107. // ServerResponse contains the HTTP response code and headers from the
  2108. // server.
  2109. googleapi.ServerResponse `json:"-"`
  2110. // ForceSendFields is a list of field names (e.g. "Cities") to
  2111. // unconditionally include in API requests. By default, fields with
  2112. // empty values are omitted from API requests. However, any non-pointer,
  2113. // non-interface field appearing in ForceSendFields will be sent to the
  2114. // server regardless of whether the field is empty or not. This may be
  2115. // used to include empty fields in Patch requests.
  2116. ForceSendFields []string `json:"-"`
  2117. // NullFields is a list of field names (e.g. "Cities") to include in API
  2118. // requests with the JSON null value. By default, fields with empty
  2119. // values are omitted from API requests. However, any field with an
  2120. // empty value appearing in NullFields will be sent to the server as
  2121. // null. It is an error if a field in this list has a non-empty value.
  2122. // This may be used to include null fields in Patch requests.
  2123. NullFields []string `json:"-"`
  2124. }
  2125. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2126. type NoMethod CitiesListResponse
  2127. raw := NoMethod(*s)
  2128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2129. }
  2130. // City: Contains information about a city that can be targeted by ads.
  2131. type City struct {
  2132. // CountryCode: Country code of the country to which this city belongs.
  2133. CountryCode string `json:"countryCode,omitempty"`
  2134. // CountryDartId: DART ID of the country to which this city belongs.
  2135. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2136. // DartId: DART ID of this city. This is the ID used for targeting and
  2137. // generating reports.
  2138. DartId int64 `json:"dartId,omitempty,string"`
  2139. // Kind: Identifies what kind of resource this is. Value: the fixed
  2140. // string "dfareporting#city".
  2141. Kind string `json:"kind,omitempty"`
  2142. // MetroCode: Metro region code of the metro region (DMA) to which this
  2143. // city belongs.
  2144. MetroCode string `json:"metroCode,omitempty"`
  2145. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2146. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2147. // Name: Name of this city.
  2148. Name string `json:"name,omitempty"`
  2149. // RegionCode: Region code of the region to which this city belongs.
  2150. RegionCode string `json:"regionCode,omitempty"`
  2151. // RegionDartId: DART ID of the region to which this city belongs.
  2152. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2153. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2154. // unconditionally include in API requests. By default, fields with
  2155. // empty values are omitted from API requests. However, any non-pointer,
  2156. // non-interface field appearing in ForceSendFields will be sent to the
  2157. // server regardless of whether the field is empty or not. This may be
  2158. // used to include empty fields in Patch requests.
  2159. ForceSendFields []string `json:"-"`
  2160. // NullFields is a list of field names (e.g. "CountryCode") to include
  2161. // in API requests with the JSON null value. By default, fields with
  2162. // empty values are omitted from API requests. However, any field with
  2163. // an empty value appearing in NullFields will be sent to the server as
  2164. // null. It is an error if a field in this list has a non-empty value.
  2165. // This may be used to include null fields in Patch requests.
  2166. NullFields []string `json:"-"`
  2167. }
  2168. func (s *City) MarshalJSON() ([]byte, error) {
  2169. type NoMethod City
  2170. raw := NoMethod(*s)
  2171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2172. }
  2173. // ClickTag: Creative Click Tag.
  2174. type ClickTag struct {
  2175. // EventName: Advertiser event name associated with the click tag. This
  2176. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2177. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2178. EventName string `json:"eventName,omitempty"`
  2179. // Name: Parameter name for the specified click tag. For
  2180. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2181. // value of the creative asset's creativeAssetId.name field.
  2182. Name string `json:"name,omitempty"`
  2183. // Value: Parameter value for the specified click tag. This field
  2184. // contains a click-through url.
  2185. Value string `json:"value,omitempty"`
  2186. // ForceSendFields is a list of field names (e.g. "EventName") to
  2187. // unconditionally include in API requests. By default, fields with
  2188. // empty values are omitted from API requests. However, any non-pointer,
  2189. // non-interface field appearing in ForceSendFields will be sent to the
  2190. // server regardless of whether the field is empty or not. This may be
  2191. // used to include empty fields in Patch requests.
  2192. ForceSendFields []string `json:"-"`
  2193. // NullFields is a list of field names (e.g. "EventName") to include in
  2194. // API requests with the JSON null value. By default, fields with empty
  2195. // values are omitted from API requests. However, any field with an
  2196. // empty value appearing in NullFields will be sent to the server as
  2197. // null. It is an error if a field in this list has a non-empty value.
  2198. // This may be used to include null fields in Patch requests.
  2199. NullFields []string `json:"-"`
  2200. }
  2201. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2202. type NoMethod ClickTag
  2203. raw := NoMethod(*s)
  2204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2205. }
  2206. // ClickThroughUrl: Click-through URL
  2207. type ClickThroughUrl struct {
  2208. // ComputedClickThroughUrl: Read-only convenience field representing the
  2209. // actual URL that will be used for this click-through. The URL is
  2210. // computed as follows:
  2211. // - If defaultLandingPage is enabled then the campaign's default
  2212. // landing page URL is assigned to this field.
  2213. // - If defaultLandingPage is not enabled and a landingPageId is
  2214. // specified then that landing page's URL is assigned to this field.
  2215. // - If neither of the above cases apply, then the customClickThroughUrl
  2216. // is assigned to this field.
  2217. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2218. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2219. // defaultLandingPage field is set to false and the landingPageId field
  2220. // is left unset.
  2221. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2222. // DefaultLandingPage: Whether the campaign default landing page is
  2223. // used.
  2224. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2225. // LandingPageId: ID of the landing page for the click-through URL.
  2226. // Applicable if the defaultLandingPage field is set to false.
  2227. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2228. // ForceSendFields is a list of field names (e.g.
  2229. // "ComputedClickThroughUrl") to unconditionally include in API
  2230. // requests. By default, fields with empty values are omitted from API
  2231. // requests. However, any non-pointer, non-interface field appearing in
  2232. // ForceSendFields will be sent to the server regardless of whether the
  2233. // field is empty or not. This may be used to include empty fields in
  2234. // Patch requests.
  2235. ForceSendFields []string `json:"-"`
  2236. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2237. // to include in API requests with the JSON null value. By default,
  2238. // fields with empty values are omitted from API requests. However, any
  2239. // field with an empty value appearing in NullFields will be sent to the
  2240. // server as null. It is an error if a field in this list has a
  2241. // non-empty value. This may be used to include null fields in Patch
  2242. // requests.
  2243. NullFields []string `json:"-"`
  2244. }
  2245. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2246. type NoMethod ClickThroughUrl
  2247. raw := NoMethod(*s)
  2248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2249. }
  2250. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2251. type ClickThroughUrlSuffixProperties struct {
  2252. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2253. // in this entity's scope. Must be less than 128 characters long.
  2254. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2255. // OverrideInheritedSuffix: Whether this entity should override the
  2256. // inherited click-through URL suffix with its own defined value.
  2257. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2258. // ForceSendFields is a list of field names (e.g.
  2259. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2260. // By default, fields with empty values are omitted from API requests.
  2261. // However, any non-pointer, non-interface field appearing in
  2262. // ForceSendFields will be sent to the server regardless of whether the
  2263. // field is empty or not. This may be used to include empty fields in
  2264. // Patch requests.
  2265. ForceSendFields []string `json:"-"`
  2266. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2267. // include in API requests with the JSON null value. By default, fields
  2268. // with empty values are omitted from API requests. However, any field
  2269. // with an empty value appearing in NullFields will be sent to the
  2270. // server as null. It is an error if a field in this list has a
  2271. // non-empty value. This may be used to include null fields in Patch
  2272. // requests.
  2273. NullFields []string `json:"-"`
  2274. }
  2275. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2276. type NoMethod ClickThroughUrlSuffixProperties
  2277. raw := NoMethod(*s)
  2278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2279. }
  2280. // CompanionClickThroughOverride: Companion Click-through override.
  2281. type CompanionClickThroughOverride struct {
  2282. // ClickThroughUrl: Click-through URL of this companion click-through
  2283. // override.
  2284. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2285. // CreativeId: ID of the creative for this companion click-through
  2286. // override.
  2287. CreativeId int64 `json:"creativeId,omitempty,string"`
  2288. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2289. // unconditionally include in API requests. By default, fields with
  2290. // empty values are omitted from API requests. However, any non-pointer,
  2291. // non-interface field appearing in ForceSendFields will be sent to the
  2292. // server regardless of whether the field is empty or not. This may be
  2293. // used to include empty fields in Patch requests.
  2294. ForceSendFields []string `json:"-"`
  2295. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2296. // include in API requests with the JSON null value. By default, fields
  2297. // with empty values are omitted from API requests. However, any field
  2298. // with an empty value appearing in NullFields will be sent to the
  2299. // server as null. It is an error if a field in this list has a
  2300. // non-empty value. This may be used to include null fields in Patch
  2301. // requests.
  2302. NullFields []string `json:"-"`
  2303. }
  2304. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2305. type NoMethod CompanionClickThroughOverride
  2306. raw := NoMethod(*s)
  2307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2308. }
  2309. // CompanionSetting: Companion Settings
  2310. type CompanionSetting struct {
  2311. // CompanionsDisabled: Whether companions are disabled for this
  2312. // placement.
  2313. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2314. // EnabledSizes: Whitelist of companion sizes to be served to this
  2315. // placement. Set this list to null or empty to serve all companion
  2316. // sizes.
  2317. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2318. // ImageOnly: Whether to serve only static images as companions.
  2319. ImageOnly bool `json:"imageOnly,omitempty"`
  2320. // Kind: Identifies what kind of resource this is. Value: the fixed
  2321. // string "dfareporting#companionSetting".
  2322. Kind string `json:"kind,omitempty"`
  2323. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2324. // to unconditionally include in API requests. By default, fields with
  2325. // empty values are omitted from API requests. However, any non-pointer,
  2326. // non-interface field appearing in ForceSendFields will be sent to the
  2327. // server regardless of whether the field is empty or not. This may be
  2328. // used to include empty fields in Patch requests.
  2329. ForceSendFields []string `json:"-"`
  2330. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2331. // include in API requests with the JSON null value. By default, fields
  2332. // with empty values are omitted from API requests. However, any field
  2333. // with an empty value appearing in NullFields will be sent to the
  2334. // server as null. It is an error if a field in this list has a
  2335. // non-empty value. This may be used to include null fields in Patch
  2336. // requests.
  2337. NullFields []string `json:"-"`
  2338. }
  2339. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2340. type NoMethod CompanionSetting
  2341. raw := NoMethod(*s)
  2342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2343. }
  2344. // CompatibleFields: Represents a response to the queryCompatibleFields
  2345. // method.
  2346. type CompatibleFields struct {
  2347. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2348. // compatible to be selected for a report of type
  2349. // "CROSS_DIMENSION_REACH".
  2350. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2351. // FloodlightReportCompatibleFields: Contains items that are compatible
  2352. // to be selected for a report of type "FLOODLIGHT".
  2353. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2354. // Kind: The kind of resource this is, in this case
  2355. // dfareporting#compatibleFields.
  2356. Kind string `json:"kind,omitempty"`
  2357. // PathToConversionReportCompatibleFields: Contains items that are
  2358. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2359. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2360. // ReachReportCompatibleFields: Contains items that are compatible to be
  2361. // selected for a report of type "REACH".
  2362. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2363. // ReportCompatibleFields: Contains items that are compatible to be
  2364. // selected for a report of type "STANDARD".
  2365. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2366. // ServerResponse contains the HTTP response code and headers from the
  2367. // server.
  2368. googleapi.ServerResponse `json:"-"`
  2369. // ForceSendFields is a list of field names (e.g.
  2370. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2371. // include in API requests. By default, fields with empty values are
  2372. // omitted from API requests. However, any non-pointer, non-interface
  2373. // field appearing in ForceSendFields will be sent to the server
  2374. // regardless of whether the field is empty or not. This may be used to
  2375. // include empty fields in Patch requests.
  2376. ForceSendFields []string `json:"-"`
  2377. // NullFields is a list of field names (e.g.
  2378. // "CrossDimensionReachReportCompatibleFields") to include in API
  2379. // requests with the JSON null value. By default, fields with empty
  2380. // values are omitted from API requests. However, any field with an
  2381. // empty value appearing in NullFields will be sent to the server as
  2382. // null. It is an error if a field in this list has a non-empty value.
  2383. // This may be used to include null fields in Patch requests.
  2384. NullFields []string `json:"-"`
  2385. }
  2386. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2387. type NoMethod CompatibleFields
  2388. raw := NoMethod(*s)
  2389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2390. }
  2391. // ConnectionType: Contains information about an internet connection
  2392. // type that can be targeted by ads. Clients can use the connection type
  2393. // to target mobile vs. broadband users.
  2394. type ConnectionType struct {
  2395. // Id: ID of this connection type.
  2396. Id int64 `json:"id,omitempty,string"`
  2397. // Kind: Identifies what kind of resource this is. Value: the fixed
  2398. // string "dfareporting#connectionType".
  2399. Kind string `json:"kind,omitempty"`
  2400. // Name: Name of this connection type.
  2401. Name string `json:"name,omitempty"`
  2402. // ServerResponse contains the HTTP response code and headers from the
  2403. // server.
  2404. googleapi.ServerResponse `json:"-"`
  2405. // ForceSendFields is a list of field names (e.g. "Id") to
  2406. // unconditionally include in API requests. By default, fields with
  2407. // empty values are omitted from API requests. However, any non-pointer,
  2408. // non-interface field appearing in ForceSendFields will be sent to the
  2409. // server regardless of whether the field is empty or not. This may be
  2410. // used to include empty fields in Patch requests.
  2411. ForceSendFields []string `json:"-"`
  2412. // NullFields is a list of field names (e.g. "Id") to include in API
  2413. // requests with the JSON null value. By default, fields with empty
  2414. // values are omitted from API requests. However, any field with an
  2415. // empty value appearing in NullFields will be sent to the server as
  2416. // null. It is an error if a field in this list has a non-empty value.
  2417. // This may be used to include null fields in Patch requests.
  2418. NullFields []string `json:"-"`
  2419. }
  2420. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2421. type NoMethod ConnectionType
  2422. raw := NoMethod(*s)
  2423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2424. }
  2425. // ConnectionTypesListResponse: Connection Type List Response
  2426. type ConnectionTypesListResponse struct {
  2427. // ConnectionTypes: Collection of connection types such as broadband and
  2428. // mobile.
  2429. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2430. // Kind: Identifies what kind of resource this is. Value: the fixed
  2431. // string "dfareporting#connectionTypesListResponse".
  2432. Kind string `json:"kind,omitempty"`
  2433. // ServerResponse contains the HTTP response code and headers from the
  2434. // server.
  2435. googleapi.ServerResponse `json:"-"`
  2436. // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to
  2437. // unconditionally include in API requests. By default, fields with
  2438. // empty values are omitted from API requests. However, any non-pointer,
  2439. // non-interface field appearing in ForceSendFields will be sent to the
  2440. // server regardless of whether the field is empty or not. This may be
  2441. // used to include empty fields in Patch requests.
  2442. ForceSendFields []string `json:"-"`
  2443. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2444. // include in API requests with the JSON null value. By default, fields
  2445. // with empty values are omitted from API requests. However, any field
  2446. // with an empty value appearing in NullFields will be sent to the
  2447. // server as null. It is an error if a field in this list has a
  2448. // non-empty value. This may be used to include null fields in Patch
  2449. // requests.
  2450. NullFields []string `json:"-"`
  2451. }
  2452. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2453. type NoMethod ConnectionTypesListResponse
  2454. raw := NoMethod(*s)
  2455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2456. }
  2457. // ContentCategoriesListResponse: Content Category List Response
  2458. type ContentCategoriesListResponse struct {
  2459. // ContentCategories: Content category collection.
  2460. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2461. // Kind: Identifies what kind of resource this is. Value: the fixed
  2462. // string "dfareporting#contentCategoriesListResponse".
  2463. Kind string `json:"kind,omitempty"`
  2464. // NextPageToken: Pagination token to be used for the next list
  2465. // operation.
  2466. NextPageToken string `json:"nextPageToken,omitempty"`
  2467. // ServerResponse contains the HTTP response code and headers from the
  2468. // server.
  2469. googleapi.ServerResponse `json:"-"`
  2470. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2471. // to unconditionally include in API requests. By default, fields with
  2472. // empty values are omitted from API requests. However, any non-pointer,
  2473. // non-interface field appearing in ForceSendFields will be sent to the
  2474. // server regardless of whether the field is empty or not. This may be
  2475. // used to include empty fields in Patch requests.
  2476. ForceSendFields []string `json:"-"`
  2477. // NullFields is a list of field names (e.g. "ContentCategories") to
  2478. // include in API requests with the JSON null value. By default, fields
  2479. // with empty values are omitted from API requests. However, any field
  2480. // with an empty value appearing in NullFields will be sent to the
  2481. // server as null. It is an error if a field in this list has a
  2482. // non-empty value. This may be used to include null fields in Patch
  2483. // requests.
  2484. NullFields []string `json:"-"`
  2485. }
  2486. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2487. type NoMethod ContentCategoriesListResponse
  2488. raw := NoMethod(*s)
  2489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2490. }
  2491. // ContentCategory: Organizes placements according to the contents of
  2492. // their associated webpages.
  2493. type ContentCategory struct {
  2494. // AccountId: Account ID of this content category. This is a read-only
  2495. // field that can be left blank.
  2496. AccountId int64 `json:"accountId,omitempty,string"`
  2497. // Id: ID of this content category. This is a read-only, auto-generated
  2498. // field.
  2499. Id int64 `json:"id,omitempty,string"`
  2500. // Kind: Identifies what kind of resource this is. Value: the fixed
  2501. // string "dfareporting#contentCategory".
  2502. Kind string `json:"kind,omitempty"`
  2503. // Name: Name of this content category. This is a required field and
  2504. // must be less than 256 characters long and unique among content
  2505. // categories of the same account.
  2506. Name string `json:"name,omitempty"`
  2507. // ServerResponse contains the HTTP response code and headers from the
  2508. // server.
  2509. googleapi.ServerResponse `json:"-"`
  2510. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2511. // unconditionally include in API requests. By default, fields with
  2512. // empty values are omitted from API requests. However, any non-pointer,
  2513. // non-interface field appearing in ForceSendFields will be sent to the
  2514. // server regardless of whether the field is empty or not. This may be
  2515. // used to include empty fields in Patch requests.
  2516. ForceSendFields []string `json:"-"`
  2517. // NullFields is a list of field names (e.g. "AccountId") to include in
  2518. // API requests with the JSON null value. By default, fields with empty
  2519. // values are omitted from API requests. However, any field with an
  2520. // empty value appearing in NullFields will be sent to the server as
  2521. // null. It is an error if a field in this list has a non-empty value.
  2522. // This may be used to include null fields in Patch requests.
  2523. NullFields []string `json:"-"`
  2524. }
  2525. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2526. type NoMethod ContentCategory
  2527. raw := NoMethod(*s)
  2528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2529. }
  2530. // Conversion: A Conversion represents when a user successfully performs
  2531. // a desired action after seeing an ad.
  2532. type Conversion struct {
  2533. // ChildDirectedTreatment: Whether the conversion was directed toward
  2534. // children.
  2535. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2536. // CustomVariables: Custom floodlight variables.
  2537. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2538. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2539. // encryptionInfo should also be specified. This field is mutually
  2540. // exclusive with encryptedUserIdCandidates[] and mobileDeviceId. This
  2541. // or encryptedUserIdCandidates[] or mobileDeviceId is a required field.
  2542. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2543. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2544. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2545. // be used in the inserted conversion. If no such user ID is found then
  2546. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2547. // When set, encryptionInfo should also be specified. This field should
  2548. // only be used when calling conversions.batchinsert. This field is
  2549. // mutually exclusive with encryptedUserId and mobileDeviceId. This or
  2550. // encryptedUserId or mobileDeviceId is a required field.
  2551. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2552. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2553. // is a required field.
  2554. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2555. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2556. // conversion. This is a required field.
  2557. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2558. // Kind: Identifies what kind of resource this is. Value: the fixed
  2559. // string "dfareporting#conversion".
  2560. Kind string `json:"kind,omitempty"`
  2561. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2562. // true, the conversion will be used for reporting but not targeting.
  2563. // This will prevent remarketing.
  2564. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2565. // MobileDeviceId: The mobile device ID. This field is mutually
  2566. // exclusive with encryptedUserId and encryptedUserIdCandidates[]. This
  2567. // or encryptedUserId or encryptedUserIdCandidates[] is a required
  2568. // field.
  2569. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2570. // Ordinal: The ordinal of the conversion. Use this field to control how
  2571. // conversions of the same user and day are de-duplicated. This is a
  2572. // required field.
  2573. Ordinal string `json:"ordinal,omitempty"`
  2574. // Quantity: The quantity of the conversion.
  2575. Quantity int64 `json:"quantity,omitempty,string"`
  2576. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2577. // This is a required field.
  2578. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2579. // Value: The value of the conversion.
  2580. Value float64 `json:"value,omitempty"`
  2581. // ForceSendFields is a list of field names (e.g.
  2582. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2583. // By default, fields with empty values are omitted from API requests.
  2584. // However, any non-pointer, non-interface field appearing in
  2585. // ForceSendFields will be sent to the server regardless of whether the
  2586. // field is empty or not. This may be used to include empty fields in
  2587. // Patch requests.
  2588. ForceSendFields []string `json:"-"`
  2589. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2590. // to include in API requests with the JSON null value. By default,
  2591. // fields with empty values are omitted from API requests. However, any
  2592. // field with an empty value appearing in NullFields will be sent to the
  2593. // server as null. It is an error if a field in this list has a
  2594. // non-empty value. This may be used to include null fields in Patch
  2595. // requests.
  2596. NullFields []string `json:"-"`
  2597. }
  2598. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2599. type NoMethod Conversion
  2600. raw := NoMethod(*s)
  2601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2602. }
  2603. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2604. type NoMethod Conversion
  2605. var s1 struct {
  2606. Value gensupport.JSONFloat64 `json:"value"`
  2607. *NoMethod
  2608. }
  2609. s1.NoMethod = (*NoMethod)(s)
  2610. if err := json.Unmarshal(data, &s1); err != nil {
  2611. return err
  2612. }
  2613. s.Value = float64(s1.Value)
  2614. return nil
  2615. }
  2616. // ConversionError: The error code and description for a conversion that
  2617. // failed to insert or update.
  2618. type ConversionError struct {
  2619. // Code: The error code.
  2620. //
  2621. // Possible values:
  2622. // "INTERNAL"
  2623. // "INVALID_ARGUMENT"
  2624. // "NOT_FOUND"
  2625. // "PERMISSION_DENIED"
  2626. Code string `json:"code,omitempty"`
  2627. // Kind: Identifies what kind of resource this is. Value: the fixed
  2628. // string "dfareporting#conversionError".
  2629. Kind string `json:"kind,omitempty"`
  2630. // Message: A description of the error.
  2631. Message string `json:"message,omitempty"`
  2632. // ForceSendFields is a list of field names (e.g. "Code") to
  2633. // unconditionally include in API requests. By default, fields with
  2634. // empty values are omitted from API requests. However, any non-pointer,
  2635. // non-interface field appearing in ForceSendFields will be sent to the
  2636. // server regardless of whether the field is empty or not. This may be
  2637. // used to include empty fields in Patch requests.
  2638. ForceSendFields []string `json:"-"`
  2639. // NullFields is a list of field names (e.g. "Code") to include in API
  2640. // requests with the JSON null value. By default, fields with empty
  2641. // values are omitted from API requests. However, any field with an
  2642. // empty value appearing in NullFields will be sent to the server as
  2643. // null. It is an error if a field in this list has a non-empty value.
  2644. // This may be used to include null fields in Patch requests.
  2645. NullFields []string `json:"-"`
  2646. }
  2647. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2648. type NoMethod ConversionError
  2649. raw := NoMethod(*s)
  2650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2651. }
  2652. // ConversionStatus: The original conversion that was inserted or
  2653. // updated and whether there were any errors.
  2654. type ConversionStatus struct {
  2655. // Conversion: The original conversion that was inserted or updated.
  2656. Conversion *Conversion `json:"conversion,omitempty"`
  2657. // Errors: A list of errors related to this conversion.
  2658. Errors []*ConversionError `json:"errors,omitempty"`
  2659. // Kind: Identifies what kind of resource this is. Value: the fixed
  2660. // string "dfareporting#conversionStatus".
  2661. Kind string `json:"kind,omitempty"`
  2662. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2663. // unconditionally include in API requests. By default, fields with
  2664. // empty values are omitted from API requests. However, any non-pointer,
  2665. // non-interface field appearing in ForceSendFields will be sent to the
  2666. // server regardless of whether the field is empty or not. This may be
  2667. // used to include empty fields in Patch requests.
  2668. ForceSendFields []string `json:"-"`
  2669. // NullFields is a list of field names (e.g. "Conversion") to include in
  2670. // API requests with the JSON null value. By default, fields with empty
  2671. // values are omitted from API requests. However, any field with an
  2672. // empty value appearing in NullFields will be sent to the server as
  2673. // null. It is an error if a field in this list has a non-empty value.
  2674. // This may be used to include null fields in Patch requests.
  2675. NullFields []string `json:"-"`
  2676. }
  2677. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2678. type NoMethod ConversionStatus
  2679. raw := NoMethod(*s)
  2680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2681. }
  2682. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2683. type ConversionsBatchInsertRequest struct {
  2684. // Conversions: The set of conversions to insert.
  2685. Conversions []*Conversion `json:"conversions,omitempty"`
  2686. // EncryptionInfo: Describes how encryptedUserId or
  2687. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2688. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2689. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2690. // Kind: Identifies what kind of resource this is. Value: the fixed
  2691. // string "dfareporting#conversionsBatchInsertRequest".
  2692. Kind string `json:"kind,omitempty"`
  2693. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2694. // unconditionally include in API requests. By default, fields with
  2695. // empty values are omitted from API requests. However, any non-pointer,
  2696. // non-interface field appearing in ForceSendFields will be sent to the
  2697. // server regardless of whether the field is empty or not. This may be
  2698. // used to include empty fields in Patch requests.
  2699. ForceSendFields []string `json:"-"`
  2700. // NullFields is a list of field names (e.g. "Conversions") to include
  2701. // in API requests with the JSON null value. By default, fields with
  2702. // empty values are omitted from API requests. However, any field with
  2703. // an empty value appearing in NullFields will be sent to the server as
  2704. // null. It is an error if a field in this list has a non-empty value.
  2705. // This may be used to include null fields in Patch requests.
  2706. NullFields []string `json:"-"`
  2707. }
  2708. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2709. type NoMethod ConversionsBatchInsertRequest
  2710. raw := NoMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2712. }
  2713. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2714. type ConversionsBatchInsertResponse struct {
  2715. // HasFailures: Indicates that some or all conversions failed to insert.
  2716. HasFailures bool `json:"hasFailures,omitempty"`
  2717. // Kind: Identifies what kind of resource this is. Value: the fixed
  2718. // string "dfareporting#conversionsBatchInsertResponse".
  2719. Kind string `json:"kind,omitempty"`
  2720. // Status: The insert status of each conversion. Statuses are returned
  2721. // in the same order that conversions are inserted.
  2722. Status []*ConversionStatus `json:"status,omitempty"`
  2723. // ServerResponse contains the HTTP response code and headers from the
  2724. // server.
  2725. googleapi.ServerResponse `json:"-"`
  2726. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2727. // unconditionally include in API requests. By default, fields with
  2728. // empty values are omitted from API requests. However, any non-pointer,
  2729. // non-interface field appearing in ForceSendFields will be sent to the
  2730. // server regardless of whether the field is empty or not. This may be
  2731. // used to include empty fields in Patch requests.
  2732. ForceSendFields []string `json:"-"`
  2733. // NullFields is a list of field names (e.g. "HasFailures") to include
  2734. // in API requests with the JSON null value. By default, fields with
  2735. // empty values are omitted from API requests. However, any field with
  2736. // an empty value appearing in NullFields will be sent to the server as
  2737. // null. It is an error if a field in this list has a non-empty value.
  2738. // This may be used to include null fields in Patch requests.
  2739. NullFields []string `json:"-"`
  2740. }
  2741. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2742. type NoMethod ConversionsBatchInsertResponse
  2743. raw := NoMethod(*s)
  2744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2745. }
  2746. // CountriesListResponse: Country List Response
  2747. type CountriesListResponse struct {
  2748. // Countries: Country collection.
  2749. Countries []*Country `json:"countries,omitempty"`
  2750. // Kind: Identifies what kind of resource this is. Value: the fixed
  2751. // string "dfareporting#countriesListResponse".
  2752. Kind string `json:"kind,omitempty"`
  2753. // ServerResponse contains the HTTP response code and headers from the
  2754. // server.
  2755. googleapi.ServerResponse `json:"-"`
  2756. // ForceSendFields is a list of field names (e.g. "Countries") to
  2757. // unconditionally include in API requests. By default, fields with
  2758. // empty values are omitted from API requests. However, any non-pointer,
  2759. // non-interface field appearing in ForceSendFields will be sent to the
  2760. // server regardless of whether the field is empty or not. This may be
  2761. // used to include empty fields in Patch requests.
  2762. ForceSendFields []string `json:"-"`
  2763. // NullFields is a list of field names (e.g. "Countries") to include in
  2764. // API requests with the JSON null value. By default, fields with empty
  2765. // values are omitted from API requests. However, any field with an
  2766. // empty value appearing in NullFields will be sent to the server as
  2767. // null. It is an error if a field in this list has a non-empty value.
  2768. // This may be used to include null fields in Patch requests.
  2769. NullFields []string `json:"-"`
  2770. }
  2771. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2772. type NoMethod CountriesListResponse
  2773. raw := NoMethod(*s)
  2774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2775. }
  2776. // Country: Contains information about a country that can be targeted by
  2777. // ads.
  2778. type Country struct {
  2779. // CountryCode: Country code.
  2780. CountryCode string `json:"countryCode,omitempty"`
  2781. // DartId: DART ID of this country. This is the ID used for targeting
  2782. // and generating reports.
  2783. DartId int64 `json:"dartId,omitempty,string"`
  2784. // Kind: Identifies what kind of resource this is. Value: the fixed
  2785. // string "dfareporting#country".
  2786. Kind string `json:"kind,omitempty"`
  2787. // Name: Name of this country.
  2788. Name string `json:"name,omitempty"`
  2789. // SslEnabled: Whether ad serving supports secure servers in this
  2790. // country.
  2791. SslEnabled bool `json:"sslEnabled,omitempty"`
  2792. // ServerResponse contains the HTTP response code and headers from the
  2793. // server.
  2794. googleapi.ServerResponse `json:"-"`
  2795. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2796. // unconditionally include in API requests. By default, fields with
  2797. // empty values are omitted from API requests. However, any non-pointer,
  2798. // non-interface field appearing in ForceSendFields will be sent to the
  2799. // server regardless of whether the field is empty or not. This may be
  2800. // used to include empty fields in Patch requests.
  2801. ForceSendFields []string `json:"-"`
  2802. // NullFields is a list of field names (e.g. "CountryCode") to include
  2803. // in API requests with the JSON null value. By default, fields with
  2804. // empty values are omitted from API requests. However, any field with
  2805. // an empty value appearing in NullFields will be sent to the server as
  2806. // null. It is an error if a field in this list has a non-empty value.
  2807. // This may be used to include null fields in Patch requests.
  2808. NullFields []string `json:"-"`
  2809. }
  2810. func (s *Country) MarshalJSON() ([]byte, error) {
  2811. type NoMethod Country
  2812. raw := NoMethod(*s)
  2813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2814. }
  2815. // Creative: Contains properties of a Creative.
  2816. type Creative struct {
  2817. // AccountId: Account ID of this creative. This field, if left unset,
  2818. // will be auto-generated for both insert and update operations.
  2819. // Applicable to all creative types.
  2820. AccountId int64 `json:"accountId,omitempty,string"`
  2821. // Active: Whether the creative is active. Applicable to all creative
  2822. // types.
  2823. Active bool `json:"active,omitempty"`
  2824. // AdParameters: Ad parameters user for VPAID creative. This is a
  2825. // read-only field. Applicable to the following creative types: all
  2826. // VPAID.
  2827. AdParameters string `json:"adParameters,omitempty"`
  2828. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  2829. // customize the creative settings of a Rich Media ad running on your
  2830. // site without having to contact the advertiser. You can use keywords
  2831. // to dynamically change the look or functionality of a creative.
  2832. // Applicable to the following creative types: all RICH_MEDIA, and all
  2833. // VPAID.
  2834. AdTagKeys []string `json:"adTagKeys,omitempty"`
  2835. // AdvertiserId: Advertiser ID of this creative. This is a required
  2836. // field. Applicable to all creative types.
  2837. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  2838. // AllowScriptAccess: Whether script access is allowed for this
  2839. // creative. This is a read-only and deprecated field which will
  2840. // automatically be set to true on update. Applicable to the following
  2841. // creative types: FLASH_INPAGE.
  2842. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  2843. // Archived: Whether the creative is archived. Applicable to all
  2844. // creative types.
  2845. Archived bool `json:"archived,omitempty"`
  2846. // ArtworkType: Type of artwork used for the creative. This is a
  2847. // read-only field. Applicable to the following creative types: all
  2848. // RICH_MEDIA, and all VPAID.
  2849. //
  2850. // Possible values:
  2851. // "ARTWORK_TYPE_FLASH"
  2852. // "ARTWORK_TYPE_HTML5"
  2853. // "ARTWORK_TYPE_IMAGE"
  2854. // "ARTWORK_TYPE_MIXED"
  2855. ArtworkType string `json:"artworkType,omitempty"`
  2856. // AuthoringSource: Source application where creative was authored.
  2857. // Presently, only DBM authored creatives will have this field set.
  2858. // Applicable to all creative types.
  2859. //
  2860. // Possible values:
  2861. // "CREATIVE_AUTHORING_SOURCE_DBM"
  2862. // "CREATIVE_AUTHORING_SOURCE_DCM"
  2863. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  2864. AuthoringSource string `json:"authoringSource,omitempty"`
  2865. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  2866. // read-only field. Applicable to the following creative types:
  2867. // HTML5_BANNER.
  2868. //
  2869. // Possible values:
  2870. // "NINJA"
  2871. // "SWIFFY"
  2872. AuthoringTool string `json:"authoringTool,omitempty"`
  2873. // AutoAdvanceImages: Whether images are automatically advanced for
  2874. // image gallery creatives. Applicable to the following creative types:
  2875. // DISPLAY_IMAGE_GALLERY.
  2876. AutoAdvanceImages bool `json:"auto_advance_images,omitempty"`
  2877. // BackgroundColor: The 6-character HTML color code, beginning with #,
  2878. // for the background of the window area where the Flash file is
  2879. // displayed. Default is white. Applicable to the following creative
  2880. // types: FLASH_INPAGE.
  2881. BackgroundColor string `json:"backgroundColor,omitempty"`
  2882. // BackupImageClickThroughUrl: Click-through URL for backup image.
  2883. // Applicable to the following creative types: FLASH_INPAGE, and
  2884. // HTML5_BANNER. Applicable to DISPLAY when the primary asset type is
  2885. // not HTML_IMAGE.
  2886. BackupImageClickThroughUrl string `json:"backupImageClickThroughUrl,omitempty"`
  2887. // BackupImageFeatures: List of feature dependencies that will cause a
  2888. // backup image to be served if the browser that serves the ad does not
  2889. // support them. Feature dependencies are features that a browser must
  2890. // be able to support in order to render your HTML5 creative asset
  2891. // correctly. This field is initially auto-generated to contain all
  2892. // features detected by DCM for all the assets of this creative and can
  2893. // then be modified by the client. To reset this field, copy over all
  2894. // the creativeAssets' detected features. Applicable to the following
  2895. // creative types: HTML5_BANNER. Applicable to DISPLAY when the primary
  2896. // asset type is not HTML_IMAGE.
  2897. //
  2898. // Possible values:
  2899. // "APPLICATION_CACHE"
  2900. // "AUDIO"
  2901. // "CANVAS"
  2902. // "CANVAS_TEXT"
  2903. // "CSS_ANIMATIONS"
  2904. // "CSS_BACKGROUND_SIZE"
  2905. // "CSS_BORDER_IMAGE"
  2906. // "CSS_BORDER_RADIUS"
  2907. // "CSS_BOX_SHADOW"
  2908. // "CSS_COLUMNS"
  2909. // "CSS_FLEX_BOX"
  2910. // "CSS_FONT_FACE"
  2911. // "CSS_GENERATED_CONTENT"
  2912. // "CSS_GRADIENTS"
  2913. // "CSS_HSLA"
  2914. // "CSS_MULTIPLE_BGS"
  2915. // "CSS_OPACITY"
  2916. // "CSS_REFLECTIONS"
  2917. // "CSS_RGBA"
  2918. // "CSS_TEXT_SHADOW"
  2919. // "CSS_TRANSFORMS"
  2920. // "CSS_TRANSFORMS3D"
  2921. // "CSS_TRANSITIONS"
  2922. // "DRAG_AND_DROP"
  2923. // "GEO_LOCATION"
  2924. // "HASH_CHANGE"
  2925. // "HISTORY"
  2926. // "INDEXED_DB"
  2927. // "INLINE_SVG"
  2928. // "INPUT_ATTR_AUTOCOMPLETE"
  2929. // "INPUT_ATTR_AUTOFOCUS"
  2930. // "INPUT_ATTR_LIST"
  2931. // "INPUT_ATTR_MAX"
  2932. // "INPUT_ATTR_MIN"
  2933. // "INPUT_ATTR_MULTIPLE"
  2934. // "INPUT_ATTR_PATTERN"
  2935. // "INPUT_ATTR_PLACEHOLDER"
  2936. // "INPUT_ATTR_REQUIRED"
  2937. // "INPUT_ATTR_STEP"
  2938. // "INPUT_TYPE_COLOR"
  2939. // "INPUT_TYPE_DATE"
  2940. // "INPUT_TYPE_DATETIME"
  2941. // "INPUT_TYPE_DATETIME_LOCAL"
  2942. // "INPUT_TYPE_EMAIL"
  2943. // "INPUT_TYPE_MONTH"
  2944. // "INPUT_TYPE_NUMBER"
  2945. // "INPUT_TYPE_RANGE"
  2946. // "INPUT_TYPE_SEARCH"
  2947. // "INPUT_TYPE_TEL"
  2948. // "INPUT_TYPE_TIME"
  2949. // "INPUT_TYPE_URL"
  2950. // "INPUT_TYPE_WEEK"
  2951. // "LOCAL_STORAGE"
  2952. // "POST_MESSAGE"
  2953. // "SESSION_STORAGE"
  2954. // "SMIL"
  2955. // "SVG_CLIP_PATHS"
  2956. // "SVG_FE_IMAGE"
  2957. // "SVG_FILTERS"
  2958. // "SVG_HREF"
  2959. // "TOUCH"
  2960. // "VIDEO"
  2961. // "WEBGL"
  2962. // "WEB_SOCKETS"
  2963. // "WEB_SQL_DATABASE"
  2964. // "WEB_WORKERS"
  2965. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  2966. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  2967. // backup image. Applicable to the following creative types: DISPLAY
  2968. // when the primary asset type is not HTML_IMAGE.
  2969. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  2970. // BackupImageTargetWindow: Target window for backup image. Applicable
  2971. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  2972. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2973. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  2974. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  2975. // HTML5_BANNER creatives, this is a subset of detected click tags for
  2976. // the assets associated with this creative. After creating a flash
  2977. // asset, detected click tags will be returned in the
  2978. // creativeAssetMetadata. When inserting the creative, populate the
  2979. // creative clickTags field using the creativeAssetMetadata.clickTags
  2980. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  2981. // one entry in this list for each image creative asset. A click tag is
  2982. // matched with a corresponding creative asset by matching the
  2983. // clickTag.name field with the creativeAsset.assetIdentifier.name
  2984. // field. Applicable to the following creative types:
  2985. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  2986. // DISPLAY when the primary asset type is not HTML_IMAGE.
  2987. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  2988. // CommercialId: Industry standard ID assigned to creative for reach and
  2989. // frequency. Applicable to the following creative types: all
  2990. // INSTREAM_VIDEO and all VPAID.
  2991. CommercialId string `json:"commercialId,omitempty"`
  2992. // CompanionCreatives: List of companion creatives assigned to an
  2993. // in-Stream videocreative. Acceptable values include IDs of existing
  2994. // flash and image creatives. Applicable to the following creative
  2995. // types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection
  2996. // set to false.
  2997. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  2998. // Compatibility: Compatibilities associated with this creative. This is
  2999. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3000. // rendering either on desktop or on mobile devices or in mobile apps
  3001. // for regular or interstitial ads, respectively. APP and
  3002. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3003. // creatives may have these compatibilities since new creatives will
  3004. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3005. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3006. // with the VAST standard. Applicable to all creative types.
  3007. //
  3008. // Acceptable values are:
  3009. // - "APP"
  3010. // - "APP_INTERSTITIAL"
  3011. // - "IN_STREAM_VIDEO"
  3012. // - "DISPLAY"
  3013. // - "DISPLAY_INTERSTITIAL"
  3014. //
  3015. // Possible values:
  3016. // "APP"
  3017. // "APP_INTERSTITIAL"
  3018. // "DISPLAY"
  3019. // "DISPLAY_INTERSTITIAL"
  3020. // "IN_STREAM_VIDEO"
  3021. Compatibility []string `json:"compatibility,omitempty"`
  3022. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3023. // creative need to be automatically converted to HTML5. This flag is
  3024. // enabled by default and users can choose to disable it if they don't
  3025. // want the system to generate and use HTML5 asset for this creative.
  3026. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3027. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3028. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3029. // CounterCustomEvents: List of counter events configured for the
  3030. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3031. // and auto-generated from clickTags. Applicable to the following
  3032. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3033. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3034. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3035. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3036. // CreativeAssets: Assets associated with a creative. Applicable to all
  3037. // but the following creative types: INTERNAL_REDIRECT,
  3038. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3039. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3040. // CreativeFieldAssignments: Creative field assignments for this
  3041. // creative. Applicable to all creative types.
  3042. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3043. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3044. // Key-values let you customize the creative settings of a Rich Media ad
  3045. // running on your site without having to contact the advertiser. You
  3046. // can use key-values to dynamically change the look or functionality of
  3047. // a creative. Applicable to the following creative types: all
  3048. // RICH_MEDIA, and all VPAID.
  3049. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3050. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3051. // target individual assets in this creative. When set to true
  3052. // creativeAssetSelection must be set. This also controls asset-level
  3053. // companions. When this is true, companion creatives should be assigned
  3054. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3055. // creatives.
  3056. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3057. // ExitCustomEvents: List of exit events configured for the creative.
  3058. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3059. // and auto-generated from clickTags, For DISPLAY, an event is also
  3060. // created from the backupImageReportingLabel. Applicable to the
  3061. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3062. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3063. // HTML_IMAGE.
  3064. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3065. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3066. // file communicate with either Flash Player or the program hosting
  3067. // Flash Player, such as a web browser. This is only triggered if
  3068. // allowScriptAccess field is true. Applicable to the following creative
  3069. // types: FLASH_INPAGE.
  3070. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3071. // HtmlCode: HTML code for the creative. This is a required field when
  3072. // applicable. This field is ignored if htmlCodeLocked is true.
  3073. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3074. // and HTML5_BANNER, and all RICH_MEDIA.
  3075. HtmlCode string `json:"htmlCode,omitempty"`
  3076. // HtmlCodeLocked: Whether HTML code is DCM-generated or manually
  3077. // entered. Set to true to ignore changes to htmlCode. Applicable to the
  3078. // following creative types: FLASH_INPAGE and HTML5_BANNER.
  3079. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3080. // Id: ID of this creative. This is a read-only, auto-generated field.
  3081. // Applicable to all creative types.
  3082. Id int64 `json:"id,omitempty,string"`
  3083. // IdDimensionValue: Dimension value for the ID of this creative. This
  3084. // is a read-only field. Applicable to all creative types.
  3085. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3086. // Kind: Identifies what kind of resource this is. Value: the fixed
  3087. // string "dfareporting#creative".
  3088. Kind string `json:"kind,omitempty"`
  3089. // LastModifiedInfo: Creative last modification information. This is a
  3090. // read-only field. Applicable to all creative types.
  3091. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3092. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3093. // associated with rich media and VPAID creatives. This is a read-only
  3094. // field. Applicable to the following creative types: all RICH_MEDIA,
  3095. // and all VPAID.
  3096. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3097. // Name: Name of the creative. This is a required field and must be less
  3098. // than 256 characters long. Applicable to all creative types.
  3099. Name string `json:"name,omitempty"`
  3100. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3101. // to the following creative types: all RICH_MEDIA.
  3102. OverrideCss string `json:"overrideCss,omitempty"`
  3103. // ProgressOffset: Amount of time to play the video before counting a
  3104. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3105. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3106. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3107. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3108. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3109. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3110. // This is a required field when applicable. Applicable to the following
  3111. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3112. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3113. RedirectUrl string `json:"redirectUrl,omitempty"`
  3114. // RenderingId: ID of current rendering version. This is a read-only
  3115. // field. Applicable to all creative types.
  3116. RenderingId int64 `json:"renderingId,omitempty,string"`
  3117. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3118. // this creative. This is a read-only field. Applicable to all creative
  3119. // types.
  3120. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3121. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3122. // for this creative. For example, 11.2.202.235. This is a read-only
  3123. // field. Applicable to the following creative types: all RICH_MEDIA,
  3124. // and all VPAID.
  3125. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3126. // RequiredFlashVersion: The internal Flash version for this creative as
  3127. // calculated by DoubleClick Studio. This is a read-only field.
  3128. // Applicable to the following creative types: FLASH_INPAGE all
  3129. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3130. // asset type is not HTML_IMAGE.
  3131. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3132. // Size: Size associated with this creative. When inserting or updating
  3133. // a creative either the size ID field or size width and height fields
  3134. // can be used. This is a required field when applicable; however for
  3135. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3136. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3137. // automatically set using the actual size of the associated image
  3138. // assets. Applicable to the following creative types: DISPLAY,
  3139. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3140. // RICH_MEDIA.
  3141. Size *Size `json:"size,omitempty"`
  3142. // SkipOffset: Amount of time to play the video before the skip button
  3143. // appears. Applicable to the following creative types: all
  3144. // INSTREAM_VIDEO.
  3145. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3146. // Skippable: Whether the user can choose to skip the creative.
  3147. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3148. // all VPAID.
  3149. Skippable bool `json:"skippable,omitempty"`
  3150. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3151. // read-only field. Applicable to all creative types.
  3152. SslCompliant bool `json:"sslCompliant,omitempty"`
  3153. // SslOverride: Whether creative should be treated as SSL compliant even
  3154. // if the system scan shows it's not. Applicable to all creative types.
  3155. SslOverride bool `json:"sslOverride,omitempty"`
  3156. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3157. // and VPAID creatives. This is a read-only field. Applicable to the
  3158. // following creative types: all RICH_MEDIA, and all VPAID.
  3159. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3160. // StudioCreativeId: Studio creative ID associated with rich media and
  3161. // VPAID creatives. This is a read-only field. Applicable to the
  3162. // following creative types: all RICH_MEDIA, and all VPAID.
  3163. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3164. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3165. // with rich media and VPAID creatives. This is a read-only field.
  3166. // Applicable to the following creative types: all RICH_MEDIA, and all
  3167. // VPAID.
  3168. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3169. // SubaccountId: Subaccount ID of this creative. This field, if left
  3170. // unset, will be auto-generated for both insert and update operations.
  3171. // Applicable to all creative types.
  3172. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3173. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3174. // backup image impressions. Applicable to the following creative types:
  3175. // all RICH_MEDIA.
  3176. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3177. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3178. // rich media impressions. Applicable to the following creative types:
  3179. // all RICH_MEDIA.
  3180. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3181. // ThirdPartyUrls: Third-party URLs for tracking in-stream video
  3182. // creative events. Applicable to the following creative types: all
  3183. // INSTREAM_VIDEO and all VPAID.
  3184. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3185. // TimerCustomEvents: List of timer events configured for the creative.
  3186. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3187. // auto-generated from clickTags. Applicable to the following creative
  3188. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3189. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3190. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3191. // TotalFileSize: Combined size of all creative assets. This is a
  3192. // read-only field. Applicable to the following creative types: all
  3193. // RICH_MEDIA, and all VPAID.
  3194. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3195. // Type: Type of this creative. This is a required field. Applicable to
  3196. // all creative types.
  3197. //
  3198. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3199. // existing creatives. New creatives should use DISPLAY as a replacement
  3200. // for these types.
  3201. //
  3202. // Possible values:
  3203. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3204. // "CUSTOM_DISPLAY"
  3205. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3206. // "DISPLAY"
  3207. // "DISPLAY_IMAGE_GALLERY"
  3208. // "DISPLAY_REDIRECT"
  3209. // "FLASH_INPAGE"
  3210. // "HTML5_BANNER"
  3211. // "IMAGE"
  3212. // "INSTREAM_VIDEO"
  3213. // "INSTREAM_VIDEO_REDIRECT"
  3214. // "INTERNAL_REDIRECT"
  3215. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3216. // "RICH_MEDIA_DISPLAY_BANNER"
  3217. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3218. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3219. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3220. // "RICH_MEDIA_IM_EXPAND"
  3221. // "RICH_MEDIA_INPAGE_FLOATING"
  3222. // "RICH_MEDIA_MOBILE_IN_APP"
  3223. // "RICH_MEDIA_PEEL_DOWN"
  3224. // "TRACKING_TEXT"
  3225. // "VPAID_LINEAR_VIDEO"
  3226. // "VPAID_NON_LINEAR_VIDEO"
  3227. Type string `json:"type,omitempty"`
  3228. // Version: The version number helps you keep track of multiple versions
  3229. // of your creative in your reports. The version number will always be
  3230. // auto-generated during insert operations to start at 1. For tracking
  3231. // creatives the version cannot be incremented and will always remain at
  3232. // 1. For all other creative types the version can be incremented only
  3233. // by 1 during update operations. In addition, the version will be
  3234. // automatically incremented by 1 when undergoing Rich Media creative
  3235. // merging. Applicable to all creative types.
  3236. Version int64 `json:"version,omitempty"`
  3237. // VideoDescription: Description of the video ad. Applicable to the
  3238. // following creative types: all INSTREAM_VIDEO and all VPAID.
  3239. VideoDescription string `json:"videoDescription,omitempty"`
  3240. // VideoDuration: Creative video duration in seconds. This is a
  3241. // read-only field. Applicable to the following creative types:
  3242. // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.
  3243. VideoDuration float64 `json:"videoDuration,omitempty"`
  3244. // ServerResponse contains the HTTP response code and headers from the
  3245. // server.
  3246. googleapi.ServerResponse `json:"-"`
  3247. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3248. // unconditionally include in API requests. By default, fields with
  3249. // empty values are omitted from API requests. However, any non-pointer,
  3250. // non-interface field appearing in ForceSendFields will be sent to the
  3251. // server regardless of whether the field is empty or not. This may be
  3252. // used to include empty fields in Patch requests.
  3253. ForceSendFields []string `json:"-"`
  3254. // NullFields is a list of field names (e.g. "AccountId") to include in
  3255. // API requests with the JSON null value. By default, fields with empty
  3256. // values are omitted from API requests. However, any field with an
  3257. // empty value appearing in NullFields will be sent to the server as
  3258. // null. It is an error if a field in this list has a non-empty value.
  3259. // This may be used to include null fields in Patch requests.
  3260. NullFields []string `json:"-"`
  3261. }
  3262. func (s *Creative) MarshalJSON() ([]byte, error) {
  3263. type NoMethod Creative
  3264. raw := NoMethod(*s)
  3265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3266. }
  3267. func (s *Creative) UnmarshalJSON(data []byte) error {
  3268. type NoMethod Creative
  3269. var s1 struct {
  3270. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3271. *NoMethod
  3272. }
  3273. s1.NoMethod = (*NoMethod)(s)
  3274. if err := json.Unmarshal(data, &s1); err != nil {
  3275. return err
  3276. }
  3277. s.VideoDuration = float64(s1.VideoDuration)
  3278. return nil
  3279. }
  3280. // CreativeAsset: Creative Asset.
  3281. type CreativeAsset struct {
  3282. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3283. // This is a read-only field. Applicable to the following creative type:
  3284. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3285. // not HTML_IMAGE.
  3286. ActionScript3 bool `json:"actionScript3,omitempty"`
  3287. // Active: Whether the video asset is active. This is a read-only field
  3288. // for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following
  3289. // creative types: INSTREAM_VIDEO and all VPAID.
  3290. Active bool `json:"active,omitempty"`
  3291. // Alignment: Possible alignments for an asset. This is a read-only
  3292. // field. Applicable to the following creative types:
  3293. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3294. //
  3295. // Possible values:
  3296. // "ALIGNMENT_BOTTOM"
  3297. // "ALIGNMENT_LEFT"
  3298. // "ALIGNMENT_RIGHT"
  3299. // "ALIGNMENT_TOP"
  3300. Alignment string `json:"alignment,omitempty"`
  3301. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3302. // field. Applicable to the following creative types: all RICH_MEDIA.
  3303. //
  3304. // Possible values:
  3305. // "ARTWORK_TYPE_FLASH"
  3306. // "ARTWORK_TYPE_HTML5"
  3307. // "ARTWORK_TYPE_IMAGE"
  3308. // "ARTWORK_TYPE_MIXED"
  3309. ArtworkType string `json:"artworkType,omitempty"`
  3310. // AssetIdentifier: Identifier of this asset. This is the same
  3311. // identifier returned during creative asset insert operation. This is a
  3312. // required field. Applicable to all but the following creative types:
  3313. // all REDIRECT and TRACKING_TEXT.
  3314. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3315. // BackupImageExit: Exit event configured for the backup image.
  3316. // Applicable to the following creative types: all RICH_MEDIA.
  3317. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3318. // BitRate: Detected bit-rate for video asset. This is a read-only
  3319. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3320. // all VPAID.
  3321. BitRate int64 `json:"bitRate,omitempty"`
  3322. // ChildAssetType: Rich media child asset type. This is a read-only
  3323. // field. Applicable to the following creative types: all VPAID.
  3324. //
  3325. // Possible values:
  3326. // "CHILD_ASSET_TYPE_DATA"
  3327. // "CHILD_ASSET_TYPE_FLASH"
  3328. // "CHILD_ASSET_TYPE_IMAGE"
  3329. // "CHILD_ASSET_TYPE_VIDEO"
  3330. ChildAssetType string `json:"childAssetType,omitempty"`
  3331. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3332. // field. Applicable to the following creative types: all RICH_MEDIA and
  3333. // all VPAID. Additionally, applicable to assets whose displayType is
  3334. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3335. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3336. // CompanionCreativeIds: List of companion creatives assigned to an
  3337. // in-stream video creative asset. Acceptable values include IDs of
  3338. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3339. // creative type with dynamicAssetSelection set to true.
  3340. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3341. // CustomStartTimeValue: Custom start time in seconds for making the
  3342. // asset visible. Applicable to the following creative types: all
  3343. // RICH_MEDIA. Value must be greater than or equal to 0.
  3344. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3345. // DetectedFeatures: List of feature dependencies for the creative asset
  3346. // that are detected by DCM. Feature dependencies are features that a
  3347. // browser must be able to support in order to render your HTML5
  3348. // creative correctly. This is a read-only, auto-generated field.
  3349. // Applicable to the following creative types: HTML5_BANNER. Applicable
  3350. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3351. //
  3352. // Possible values:
  3353. // "APPLICATION_CACHE"
  3354. // "AUDIO"
  3355. // "CANVAS"
  3356. // "CANVAS_TEXT"
  3357. // "CSS_ANIMATIONS"
  3358. // "CSS_BACKGROUND_SIZE"
  3359. // "CSS_BORDER_IMAGE"
  3360. // "CSS_BORDER_RADIUS"
  3361. // "CSS_BOX_SHADOW"
  3362. // "CSS_COLUMNS"
  3363. // "CSS_FLEX_BOX"
  3364. // "CSS_FONT_FACE"
  3365. // "CSS_GENERATED_CONTENT"
  3366. // "CSS_GRADIENTS"
  3367. // "CSS_HSLA"
  3368. // "CSS_MULTIPLE_BGS"
  3369. // "CSS_OPACITY"
  3370. // "CSS_REFLECTIONS"
  3371. // "CSS_RGBA"
  3372. // "CSS_TEXT_SHADOW"
  3373. // "CSS_TRANSFORMS"
  3374. // "CSS_TRANSFORMS3D"
  3375. // "CSS_TRANSITIONS"
  3376. // "DRAG_AND_DROP"
  3377. // "GEO_LOCATION"
  3378. // "HASH_CHANGE"
  3379. // "HISTORY"
  3380. // "INDEXED_DB"
  3381. // "INLINE_SVG"
  3382. // "INPUT_ATTR_AUTOCOMPLETE"
  3383. // "INPUT_ATTR_AUTOFOCUS"
  3384. // "INPUT_ATTR_LIST"
  3385. // "INPUT_ATTR_MAX"
  3386. // "INPUT_ATTR_MIN"
  3387. // "INPUT_ATTR_MULTIPLE"
  3388. // "INPUT_ATTR_PATTERN"
  3389. // "INPUT_ATTR_PLACEHOLDER"
  3390. // "INPUT_ATTR_REQUIRED"
  3391. // "INPUT_ATTR_STEP"
  3392. // "INPUT_TYPE_COLOR"
  3393. // "INPUT_TYPE_DATE"
  3394. // "INPUT_TYPE_DATETIME"
  3395. // "INPUT_TYPE_DATETIME_LOCAL"
  3396. // "INPUT_TYPE_EMAIL"
  3397. // "INPUT_TYPE_MONTH"
  3398. // "INPUT_TYPE_NUMBER"
  3399. // "INPUT_TYPE_RANGE"
  3400. // "INPUT_TYPE_SEARCH"
  3401. // "INPUT_TYPE_TEL"
  3402. // "INPUT_TYPE_TIME"
  3403. // "INPUT_TYPE_URL"
  3404. // "INPUT_TYPE_WEEK"
  3405. // "LOCAL_STORAGE"
  3406. // "POST_MESSAGE"
  3407. // "SESSION_STORAGE"
  3408. // "SMIL"
  3409. // "SVG_CLIP_PATHS"
  3410. // "SVG_FE_IMAGE"
  3411. // "SVG_FILTERS"
  3412. // "SVG_HREF"
  3413. // "TOUCH"
  3414. // "VIDEO"
  3415. // "WEBGL"
  3416. // "WEB_SOCKETS"
  3417. // "WEB_SQL_DATABASE"
  3418. // "WEB_WORKERS"
  3419. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3420. // DisplayType: Type of rich media asset. This is a read-only field.
  3421. // Applicable to the following creative types: all RICH_MEDIA.
  3422. //
  3423. // Possible values:
  3424. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3425. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3426. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3427. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3428. // "ASSET_DISPLAY_TYPE_FLOATING"
  3429. // "ASSET_DISPLAY_TYPE_INPAGE"
  3430. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3431. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3432. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3433. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3434. DisplayType string `json:"displayType,omitempty"`
  3435. // Duration: Duration in seconds for which an asset will be displayed.
  3436. // Applicable to the following creative types: INSTREAM_VIDEO and
  3437. // VPAID_LINEAR_VIDEO. Value must be greater than or equal to 1.
  3438. Duration int64 `json:"duration,omitempty"`
  3439. // DurationType: Duration type for which an asset will be displayed.
  3440. // Applicable to the following creative types: all RICH_MEDIA.
  3441. //
  3442. // Possible values:
  3443. // "ASSET_DURATION_TYPE_AUTO"
  3444. // "ASSET_DURATION_TYPE_CUSTOM"
  3445. // "ASSET_DURATION_TYPE_NONE"
  3446. DurationType string `json:"durationType,omitempty"`
  3447. // ExpandedDimension: Detected expanded dimension for video asset. This
  3448. // is a read-only field. Applicable to the following creative types:
  3449. // INSTREAM_VIDEO and all VPAID.
  3450. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3451. // FileSize: File size associated with this creative asset. This is a
  3452. // read-only field. Applicable to all but the following creative types:
  3453. // all REDIRECT and TRACKING_TEXT.
  3454. FileSize int64 `json:"fileSize,omitempty,string"`
  3455. // FlashVersion: Flash version of the asset. This is a read-only field.
  3456. // Applicable to the following creative types: FLASH_INPAGE, all
  3457. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3458. // asset type is not HTML_IMAGE.
  3459. FlashVersion int64 `json:"flashVersion,omitempty"`
  3460. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3461. // Applicable to the following creative types: all RICH_MEDIA.
  3462. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3463. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3464. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3465. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3466. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3467. // a read-only field. Applicable to the following creative types: all
  3468. // RICH_MEDIA.
  3469. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3470. // Id: Numeric ID of this creative asset. This is a required field and
  3471. // should not be modified. Applicable to all but the following creative
  3472. // types: all REDIRECT and TRACKING_TEXT.
  3473. Id int64 `json:"id,omitempty,string"`
  3474. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3475. // read-only, auto-generated field.
  3476. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3477. // MimeType: Detected MIME type for video asset. This is a read-only
  3478. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3479. // all VPAID.
  3480. MimeType string `json:"mimeType,omitempty"`
  3481. // Offset: Offset position for an asset in collapsed mode. This is a
  3482. // read-only field. Applicable to the following creative types: all
  3483. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3484. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3485. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3486. Offset *OffsetPosition `json:"offset,omitempty"`
  3487. // OriginalBackup: Whether the backup asset is original or changed by
  3488. // the user in DCM. Applicable to the following creative types: all
  3489. // RICH_MEDIA.
  3490. OriginalBackup bool `json:"originalBackup,omitempty"`
  3491. // Position: Offset position for an asset. Applicable to the following
  3492. // creative types: all RICH_MEDIA.
  3493. Position *OffsetPosition `json:"position,omitempty"`
  3494. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3495. // field. Applicable to the following creative types: all RICH_MEDIA.
  3496. //
  3497. // Possible values:
  3498. // "OFFSET_UNIT_PERCENT"
  3499. // "OFFSET_UNIT_PIXEL"
  3500. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3501. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3502. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3503. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3504. // Applicable to the following creative types: all RICH_MEDIA.
  3505. //
  3506. // Possible values:
  3507. // "OFFSET_UNIT_PERCENT"
  3508. // "OFFSET_UNIT_PIXEL"
  3509. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3510. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3511. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3512. // read-only field. Applicable to the following creative types:
  3513. // INSTREAM_VIDEO and all VPAID.
  3514. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3515. // Pushdown: Whether the asset pushes down other content. Applicable to
  3516. // the following creative types: all RICH_MEDIA. Additionally, only
  3517. // applicable when the asset offsets are 0, the collapsedSize.width
  3518. // matches size.width, and the collapsedSize.height is less than
  3519. // size.height.
  3520. Pushdown bool `json:"pushdown,omitempty"`
  3521. // PushdownDuration: Pushdown duration in seconds for an asset.
  3522. // Applicable to the following creative types: all
  3523. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3524. // field is true, the offsets are 0, the collapsedSize.width matches
  3525. // size.width, and the collapsedSize.height is less than size.height.
  3526. // Acceptable values are 0 to 9.99, inclusive.
  3527. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3528. // Role: Role of the asset in relation to creative. Applicable to all
  3529. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3530. // This is a required field.
  3531. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3532. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3533. // primary assets), and all VPAID creatives.
  3534. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3535. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3536. // type is not HTML_IMAGE.
  3537. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3538. // creatives.
  3539. // OTHER refers to assets from sources other than DCM, such as Studio
  3540. // uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3541. // creatives.
  3542. // PARENT_VIDEO refers to videos uploaded by the user in DCM and is
  3543. // applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3544. // creatives.
  3545. // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO
  3546. // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3547. // creatives.
  3548. // ALTERNATE_VIDEO refers to the DCM representation of child asset
  3549. // videos from Studio, and is applicable to VPAID_LINEAR_VIDEO
  3550. // creatives. These cannot be added or removed within DCM.
  3551. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3552. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3553. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3554. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3555. // creative.
  3556. //
  3557. // Possible values:
  3558. // "ADDITIONAL_FLASH"
  3559. // "ADDITIONAL_IMAGE"
  3560. // "ALTERNATE_VIDEO"
  3561. // "BACKUP_IMAGE"
  3562. // "OTHER"
  3563. // "PARENT_VIDEO"
  3564. // "PRIMARY"
  3565. // "TRANSCODED_VIDEO"
  3566. Role string `json:"role,omitempty"`
  3567. // Size: Size associated with this creative asset. This is a required
  3568. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3569. // if left blank, this field will be automatically set using the actual
  3570. // size of the associated image asset. Applicable to the following
  3571. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3572. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3573. // asset type is not HTML_IMAGE.
  3574. Size *Size `json:"size,omitempty"`
  3575. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3576. // field. Applicable to all but the following creative types: all
  3577. // REDIRECT and TRACKING_TEXT.
  3578. SslCompliant bool `json:"sslCompliant,omitempty"`
  3579. // StartTimeType: Initial wait time type before making the asset
  3580. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3581. //
  3582. // Possible values:
  3583. // "ASSET_START_TIME_TYPE_CUSTOM"
  3584. // "ASSET_START_TIME_TYPE_NONE"
  3585. StartTimeType string `json:"startTimeType,omitempty"`
  3586. // StreamingServingUrl: Streaming URL for video asset. This is a
  3587. // read-only field. Applicable to the following creative types:
  3588. // INSTREAM_VIDEO and all VPAID.
  3589. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3590. // Transparency: Whether the asset is transparent. Applicable to the
  3591. // following creative types: all RICH_MEDIA. Additionally, only
  3592. // applicable to HTML5 assets.
  3593. Transparency bool `json:"transparency,omitempty"`
  3594. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3595. // read-only field. Applicable to the following creative types: all
  3596. // RICH_MEDIA.
  3597. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3598. // VideoDuration: Detected video duration for video asset. This is a
  3599. // read-only field. Applicable to the following creative types:
  3600. // INSTREAM_VIDEO and all VPAID.
  3601. VideoDuration float64 `json:"videoDuration,omitempty"`
  3602. // WindowMode: Window mode options for flash assets. Applicable to the
  3603. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3604. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3605. // RICH_MEDIA_INPAGE_FLOATING.
  3606. //
  3607. // Possible values:
  3608. // "OPAQUE"
  3609. // "TRANSPARENT"
  3610. // "WINDOW"
  3611. WindowMode string `json:"windowMode,omitempty"`
  3612. // ZIndex: zIndex value of an asset. Applicable to the following
  3613. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3614. // assets whose displayType is NOT one of the following types:
  3615. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3616. // values are -999999999 to 999999999, inclusive.
  3617. ZIndex int64 `json:"zIndex,omitempty"`
  3618. // ZipFilename: File name of zip file. This is a read-only field.
  3619. // Applicable to the following creative types: HTML5_BANNER.
  3620. ZipFilename string `json:"zipFilename,omitempty"`
  3621. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3622. // to the following creative types: HTML5_BANNER.
  3623. ZipFilesize string `json:"zipFilesize,omitempty"`
  3624. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3625. // unconditionally include in API requests. By default, fields with
  3626. // empty values are omitted from API requests. However, any non-pointer,
  3627. // non-interface field appearing in ForceSendFields will be sent to the
  3628. // server regardless of whether the field is empty or not. This may be
  3629. // used to include empty fields in Patch requests.
  3630. ForceSendFields []string `json:"-"`
  3631. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3632. // in API requests with the JSON null value. By default, fields with
  3633. // empty values are omitted from API requests. However, any field with
  3634. // an empty value appearing in NullFields will be sent to the server as
  3635. // null. It is an error if a field in this list has a non-empty value.
  3636. // This may be used to include null fields in Patch requests.
  3637. NullFields []string `json:"-"`
  3638. }
  3639. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3640. type NoMethod CreativeAsset
  3641. raw := NoMethod(*s)
  3642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3643. }
  3644. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3645. type NoMethod CreativeAsset
  3646. var s1 struct {
  3647. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3648. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3649. *NoMethod
  3650. }
  3651. s1.NoMethod = (*NoMethod)(s)
  3652. if err := json.Unmarshal(data, &s1); err != nil {
  3653. return err
  3654. }
  3655. s.PushdownDuration = float64(s1.PushdownDuration)
  3656. s.VideoDuration = float64(s1.VideoDuration)
  3657. return nil
  3658. }
  3659. // CreativeAssetId: Creative Asset ID.
  3660. type CreativeAssetId struct {
  3661. // Name: Name of the creative asset. This is a required field while
  3662. // inserting an asset. After insertion, this assetIdentifier is used to
  3663. // identify the uploaded asset. Characters in the name must be
  3664. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3665. Name string `json:"name,omitempty"`
  3666. // Type: Type of asset to upload. This is a required field. FLASH and
  3667. // IMAGE are no longer supported for new uploads. All image assets
  3668. // should use HTML_IMAGE.
  3669. //
  3670. // Possible values:
  3671. // "FLASH"
  3672. // "HTML"
  3673. // "HTML_IMAGE"
  3674. // "IMAGE"
  3675. // "VIDEO"
  3676. Type string `json:"type,omitempty"`
  3677. // ForceSendFields is a list of field names (e.g. "Name") to
  3678. // unconditionally include in API requests. By default, fields with
  3679. // empty values are omitted from API requests. However, any non-pointer,
  3680. // non-interface field appearing in ForceSendFields will be sent to the
  3681. // server regardless of whether the field is empty or not. This may be
  3682. // used to include empty fields in Patch requests.
  3683. ForceSendFields []string `json:"-"`
  3684. // NullFields is a list of field names (e.g. "Name") to include in API
  3685. // requests with the JSON null value. By default, fields with empty
  3686. // values are omitted from API requests. However, any field with an
  3687. // empty value appearing in NullFields will be sent to the server as
  3688. // null. It is an error if a field in this list has a non-empty value.
  3689. // This may be used to include null fields in Patch requests.
  3690. NullFields []string `json:"-"`
  3691. }
  3692. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3693. type NoMethod CreativeAssetId
  3694. raw := NoMethod(*s)
  3695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3696. }
  3697. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3698. // creative asset file which will be uploaded or has already been
  3699. // uploaded. Refer to the creative sample code for how to upload assets
  3700. // and insert a creative.
  3701. type CreativeAssetMetadata struct {
  3702. // AssetIdentifier: ID of the creative asset. This is a required field.
  3703. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3704. // ClickTags: List of detected click tags for assets. This is a
  3705. // read-only auto-generated field.
  3706. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3707. // DetectedFeatures: List of feature dependencies for the creative asset
  3708. // that are detected by DCM. Feature dependencies are features that a
  3709. // browser must be able to support in order to render your HTML5
  3710. // creative correctly. This is a read-only, auto-generated field.
  3711. //
  3712. // Possible values:
  3713. // "APPLICATION_CACHE"
  3714. // "AUDIO"
  3715. // "CANVAS"
  3716. // "CANVAS_TEXT"
  3717. // "CSS_ANIMATIONS"
  3718. // "CSS_BACKGROUND_SIZE"
  3719. // "CSS_BORDER_IMAGE"
  3720. // "CSS_BORDER_RADIUS"
  3721. // "CSS_BOX_SHADOW"
  3722. // "CSS_COLUMNS"
  3723. // "CSS_FLEX_BOX"
  3724. // "CSS_FONT_FACE"
  3725. // "CSS_GENERATED_CONTENT"
  3726. // "CSS_GRADIENTS"
  3727. // "CSS_HSLA"
  3728. // "CSS_MULTIPLE_BGS"
  3729. // "CSS_OPACITY"
  3730. // "CSS_REFLECTIONS"
  3731. // "CSS_RGBA"
  3732. // "CSS_TEXT_SHADOW"
  3733. // "CSS_TRANSFORMS"
  3734. // "CSS_TRANSFORMS3D"
  3735. // "CSS_TRANSITIONS"
  3736. // "DRAG_AND_DROP"
  3737. // "GEO_LOCATION"
  3738. // "HASH_CHANGE"
  3739. // "HISTORY"
  3740. // "INDEXED_DB"
  3741. // "INLINE_SVG"
  3742. // "INPUT_ATTR_AUTOCOMPLETE"
  3743. // "INPUT_ATTR_AUTOFOCUS"
  3744. // "INPUT_ATTR_LIST"
  3745. // "INPUT_ATTR_MAX"
  3746. // "INPUT_ATTR_MIN"
  3747. // "INPUT_ATTR_MULTIPLE"
  3748. // "INPUT_ATTR_PATTERN"
  3749. // "INPUT_ATTR_PLACEHOLDER"
  3750. // "INPUT_ATTR_REQUIRED"
  3751. // "INPUT_ATTR_STEP"
  3752. // "INPUT_TYPE_COLOR"
  3753. // "INPUT_TYPE_DATE"
  3754. // "INPUT_TYPE_DATETIME"
  3755. // "INPUT_TYPE_DATETIME_LOCAL"
  3756. // "INPUT_TYPE_EMAIL"
  3757. // "INPUT_TYPE_MONTH"
  3758. // "INPUT_TYPE_NUMBER"
  3759. // "INPUT_TYPE_RANGE"
  3760. // "INPUT_TYPE_SEARCH"
  3761. // "INPUT_TYPE_TEL"
  3762. // "INPUT_TYPE_TIME"
  3763. // "INPUT_TYPE_URL"
  3764. // "INPUT_TYPE_WEEK"
  3765. // "LOCAL_STORAGE"
  3766. // "POST_MESSAGE"
  3767. // "SESSION_STORAGE"
  3768. // "SMIL"
  3769. // "SVG_CLIP_PATHS"
  3770. // "SVG_FE_IMAGE"
  3771. // "SVG_FILTERS"
  3772. // "SVG_HREF"
  3773. // "TOUCH"
  3774. // "VIDEO"
  3775. // "WEBGL"
  3776. // "WEB_SOCKETS"
  3777. // "WEB_SQL_DATABASE"
  3778. // "WEB_WORKERS"
  3779. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3780. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  3781. // field.
  3782. Id int64 `json:"id,omitempty,string"`
  3783. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  3784. // This is a read-only, auto-generated field.
  3785. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3786. // Kind: Identifies what kind of resource this is. Value: the fixed
  3787. // string "dfareporting#creativeAssetMetadata".
  3788. Kind string `json:"kind,omitempty"`
  3789. // WarnedValidationRules: Rules validated during code generation that
  3790. // generated a warning. This is a read-only, auto-generated
  3791. // field.
  3792. //
  3793. // Possible values are:
  3794. // - "ADMOB_REFERENCED"
  3795. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  3796. // - "ASSET_INVALID"
  3797. // - "CLICK_TAG_HARD_CODED"
  3798. // - "CLICK_TAG_INVALID"
  3799. // - "CLICK_TAG_IN_GWD"
  3800. // - "CLICK_TAG_MISSING"
  3801. // - "CLICK_TAG_MORE_THAN_ONE"
  3802. // - "CLICK_TAG_NON_TOP_LEVEL"
  3803. // - "COMPONENT_UNSUPPORTED_DCM"
  3804. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  3805. // - "EXTERNAL_FILE_REFERENCED"
  3806. // - "FILE_DETAIL_EMPTY"
  3807. // - "FILE_TYPE_INVALID"
  3808. // - "GWD_PROPERTIES_INVALID"
  3809. // - "HTML5_FEATURE_UNSUPPORTED"
  3810. // - "LINKED_FILE_NOT_FOUND"
  3811. // - "MAX_FLASH_VERSION_11"
  3812. // - "MRAID_REFERENCED"
  3813. // - "NOT_SSL_COMPLIANT"
  3814. // - "ORPHANED_ASSET"
  3815. // - "PRIMARY_HTML_MISSING"
  3816. // - "SVG_INVALID"
  3817. // - "ZIP_INVALID"
  3818. //
  3819. // Possible values:
  3820. // "ADMOB_REFERENCED"
  3821. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  3822. // "ASSET_INVALID"
  3823. // "CLICK_TAG_HARD_CODED"
  3824. // "CLICK_TAG_INVALID"
  3825. // "CLICK_TAG_IN_GWD"
  3826. // "CLICK_TAG_MISSING"
  3827. // "CLICK_TAG_MORE_THAN_ONE"
  3828. // "CLICK_TAG_NON_TOP_LEVEL"
  3829. // "COMPONENT_UNSUPPORTED_DCM"
  3830. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  3831. // "EXTERNAL_FILE_REFERENCED"
  3832. // "FILE_DETAIL_EMPTY"
  3833. // "FILE_TYPE_INVALID"
  3834. // "GWD_PROPERTIES_INVALID"
  3835. // "HTML5_FEATURE_UNSUPPORTED"
  3836. // "LINKED_FILE_NOT_FOUND"
  3837. // "MAX_FLASH_VERSION_11"
  3838. // "MRAID_REFERENCED"
  3839. // "NOT_SSL_COMPLIANT"
  3840. // "ORPHANED_ASSET"
  3841. // "PRIMARY_HTML_MISSING"
  3842. // "SVG_INVALID"
  3843. // "ZIP_INVALID"
  3844. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  3845. // ServerResponse contains the HTTP response code and headers from the
  3846. // server.
  3847. googleapi.ServerResponse `json:"-"`
  3848. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  3849. // unconditionally include in API requests. By default, fields with
  3850. // empty values are omitted from API requests. However, any non-pointer,
  3851. // non-interface field appearing in ForceSendFields will be sent to the
  3852. // server regardless of whether the field is empty or not. This may be
  3853. // used to include empty fields in Patch requests.
  3854. ForceSendFields []string `json:"-"`
  3855. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  3856. // include in API requests with the JSON null value. By default, fields
  3857. // with empty values are omitted from API requests. However, any field
  3858. // with an empty value appearing in NullFields will be sent to the
  3859. // server as null. It is an error if a field in this list has a
  3860. // non-empty value. This may be used to include null fields in Patch
  3861. // requests.
  3862. NullFields []string `json:"-"`
  3863. }
  3864. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  3865. type NoMethod CreativeAssetMetadata
  3866. raw := NoMethod(*s)
  3867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3868. }
  3869. // CreativeAssetSelection: Encapsulates the list of rules for asset
  3870. // selection and a default asset in case none of the rules match.
  3871. // Applicable to INSTREAM_VIDEO creatives.
  3872. type CreativeAssetSelection struct {
  3873. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  3874. // the parent assets in this creative, and will be served if none of the
  3875. // rules match. This is a required field.
  3876. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  3877. // Rules: Rules determine which asset will be served to a viewer. Rules
  3878. // will be evaluated in the order in which they are stored in this list.
  3879. // This list must contain at least one rule. Applicable to
  3880. // INSTREAM_VIDEO creatives.
  3881. Rules []*Rule `json:"rules,omitempty"`
  3882. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  3883. // unconditionally include in API requests. By default, fields with
  3884. // empty values are omitted from API requests. However, any non-pointer,
  3885. // non-interface field appearing in ForceSendFields will be sent to the
  3886. // server regardless of whether the field is empty or not. This may be
  3887. // used to include empty fields in Patch requests.
  3888. ForceSendFields []string `json:"-"`
  3889. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  3890. // include in API requests with the JSON null value. By default, fields
  3891. // with empty values are omitted from API requests. However, any field
  3892. // with an empty value appearing in NullFields will be sent to the
  3893. // server as null. It is an error if a field in this list has a
  3894. // non-empty value. This may be used to include null fields in Patch
  3895. // requests.
  3896. NullFields []string `json:"-"`
  3897. }
  3898. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  3899. type NoMethod CreativeAssetSelection
  3900. raw := NoMethod(*s)
  3901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3902. }
  3903. // CreativeAssignment: Creative Assignment.
  3904. type CreativeAssignment struct {
  3905. // Active: Whether this creative assignment is active. When true, the
  3906. // creative will be included in the ad's rotation.
  3907. Active bool `json:"active,omitempty"`
  3908. // ApplyEventTags: Whether applicable event tags should fire when this
  3909. // creative assignment is rendered. If this value is unset when the ad
  3910. // is inserted or updated, it will default to true for all creative
  3911. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  3912. // and INSTREAM_VIDEO.
  3913. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  3914. // ClickThroughUrl: Click-through URL of the creative assignment.
  3915. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  3916. // CompanionCreativeOverrides: Companion creative overrides for this
  3917. // creative assignment. Applicable to video ads.
  3918. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  3919. // CreativeGroupAssignments: Creative group assignments for this
  3920. // creative assignment. Only one assignment per creative group number is
  3921. // allowed for a maximum of two assignments.
  3922. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  3923. // CreativeId: ID of the creative to be assigned. This is a required
  3924. // field.
  3925. CreativeId int64 `json:"creativeId,omitempty,string"`
  3926. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  3927. // This is a read-only, auto-generated field.
  3928. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  3929. // EndTime: Date and time that the assigned creative should stop
  3930. // serving. Must be later than the start time.
  3931. EndTime string `json:"endTime,omitempty"`
  3932. // RichMediaExitOverrides: Rich media exit overrides for this creative
  3933. // assignment.
  3934. // Applicable when the creative type is any of the following:
  3935. // - DISPLAY
  3936. // - RICH_MEDIA_INPAGE
  3937. // - RICH_MEDIA_INPAGE_FLOATING
  3938. // - RICH_MEDIA_IM_EXPAND
  3939. // - RICH_MEDIA_EXPANDING
  3940. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  3941. // - RICH_MEDIA_MOBILE_IN_APP
  3942. // - RICH_MEDIA_MULTI_FLOATING
  3943. // - RICH_MEDIA_PEEL_DOWN
  3944. // - VPAID_LINEAR
  3945. // - VPAID_NON_LINEAR
  3946. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  3947. // Sequence: Sequence number of the creative assignment, applicable when
  3948. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  3949. // values are 1 to 65535, inclusive.
  3950. Sequence int64 `json:"sequence,omitempty"`
  3951. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  3952. // This is a read-only field that is auto-generated when the ad is
  3953. // inserted or updated.
  3954. SslCompliant bool `json:"sslCompliant,omitempty"`
  3955. // StartTime: Date and time that the assigned creative should start
  3956. // serving.
  3957. StartTime string `json:"startTime,omitempty"`
  3958. // Weight: Weight of the creative assignment, applicable when the
  3959. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  3960. // than or equal to 1.
  3961. Weight int64 `json:"weight,omitempty"`
  3962. // ForceSendFields is a list of field names (e.g. "Active") to
  3963. // unconditionally include in API requests. By default, fields with
  3964. // empty values are omitted from API requests. However, any non-pointer,
  3965. // non-interface field appearing in ForceSendFields will be sent to the
  3966. // server regardless of whether the field is empty or not. This may be
  3967. // used to include empty fields in Patch requests.
  3968. ForceSendFields []string `json:"-"`
  3969. // NullFields is a list of field names (e.g. "Active") to include in API
  3970. // requests with the JSON null value. By default, fields with empty
  3971. // values are omitted from API requests. However, any field with an
  3972. // empty value appearing in NullFields will be sent to the server as
  3973. // null. It is an error if a field in this list has a non-empty value.
  3974. // This may be used to include null fields in Patch requests.
  3975. NullFields []string `json:"-"`
  3976. }
  3977. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  3978. type NoMethod CreativeAssignment
  3979. raw := NoMethod(*s)
  3980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3981. }
  3982. // CreativeCustomEvent: Creative Custom Event.
  3983. type CreativeCustomEvent struct {
  3984. // AdvertiserCustomEventId: Unique ID of this event used by DDM
  3985. // Reporting and Data Transfer. This is a read-only field.
  3986. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  3987. // AdvertiserCustomEventName: User-entered name for the event.
  3988. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  3989. // AdvertiserCustomEventType: Type of the event. This is a read-only
  3990. // field.
  3991. //
  3992. // Possible values:
  3993. // "ADVERTISER_EVENT_COUNTER"
  3994. // "ADVERTISER_EVENT_EXIT"
  3995. // "ADVERTISER_EVENT_TIMER"
  3996. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  3997. // ArtworkLabel: Artwork label column, used to link events in DCM back
  3998. // to events in Studio. This is a required field and should not be
  3999. // modified after insertion.
  4000. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4001. // ArtworkType: Artwork type used by the creative.This is a read-only
  4002. // field.
  4003. //
  4004. // Possible values:
  4005. // "ARTWORK_TYPE_FLASH"
  4006. // "ARTWORK_TYPE_HTML5"
  4007. // "ARTWORK_TYPE_IMAGE"
  4008. // "ARTWORK_TYPE_MIXED"
  4009. ArtworkType string `json:"artworkType,omitempty"`
  4010. // ExitUrl: Exit URL of the event. This field is used only for exit
  4011. // events.
  4012. ExitUrl string `json:"exitUrl,omitempty"`
  4013. // Id: ID of this event. This is a required field and should not be
  4014. // modified after insertion.
  4015. Id int64 `json:"id,omitempty,string"`
  4016. // PopupWindowProperties: Properties for rich media popup windows. This
  4017. // field is used only for exit events.
  4018. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4019. // TargetType: Target type used by the event.
  4020. //
  4021. // Possible values:
  4022. // "TARGET_BLANK"
  4023. // "TARGET_PARENT"
  4024. // "TARGET_POPUP"
  4025. // "TARGET_SELF"
  4026. // "TARGET_TOP"
  4027. TargetType string `json:"targetType,omitempty"`
  4028. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4029. // videos in a single creative. This is a read-only field.
  4030. VideoReportingId string `json:"videoReportingId,omitempty"`
  4031. // ForceSendFields is a list of field names (e.g.
  4032. // "AdvertiserCustomEventId") to unconditionally include in API
  4033. // requests. By default, fields with empty values are omitted from API
  4034. // requests. However, any non-pointer, non-interface field appearing in
  4035. // ForceSendFields will be sent to the server regardless of whether the
  4036. // field is empty or not. This may be used to include empty fields in
  4037. // Patch requests.
  4038. ForceSendFields []string `json:"-"`
  4039. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4040. // to include in API requests with the JSON null value. By default,
  4041. // fields with empty values are omitted from API requests. However, any
  4042. // field with an empty value appearing in NullFields will be sent to the
  4043. // server as null. It is an error if a field in this list has a
  4044. // non-empty value. This may be used to include null fields in Patch
  4045. // requests.
  4046. NullFields []string `json:"-"`
  4047. }
  4048. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4049. type NoMethod CreativeCustomEvent
  4050. raw := NoMethod(*s)
  4051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4052. }
  4053. // CreativeField: Contains properties of a creative field.
  4054. type CreativeField struct {
  4055. // AccountId: Account ID of this creative field. This is a read-only
  4056. // field that can be left blank.
  4057. AccountId int64 `json:"accountId,omitempty,string"`
  4058. // AdvertiserId: Advertiser ID of this creative field. This is a
  4059. // required field on insertion.
  4060. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4061. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4062. // advertiser. This is a read-only, auto-generated field.
  4063. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4064. // Id: ID of this creative field. This is a read-only, auto-generated
  4065. // field.
  4066. Id int64 `json:"id,omitempty,string"`
  4067. // Kind: Identifies what kind of resource this is. Value: the fixed
  4068. // string "dfareporting#creativeField".
  4069. Kind string `json:"kind,omitempty"`
  4070. // Name: Name of this creative field. This is a required field and must
  4071. // be less than 256 characters long and unique among creative fields of
  4072. // the same advertiser.
  4073. Name string `json:"name,omitempty"`
  4074. // SubaccountId: Subaccount ID of this creative field. This is a
  4075. // read-only field that can be left blank.
  4076. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4077. // ServerResponse contains the HTTP response code and headers from the
  4078. // server.
  4079. googleapi.ServerResponse `json:"-"`
  4080. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4081. // unconditionally include in API requests. By default, fields with
  4082. // empty values are omitted from API requests. However, any non-pointer,
  4083. // non-interface field appearing in ForceSendFields will be sent to the
  4084. // server regardless of whether the field is empty or not. This may be
  4085. // used to include empty fields in Patch requests.
  4086. ForceSendFields []string `json:"-"`
  4087. // NullFields is a list of field names (e.g. "AccountId") to include in
  4088. // API requests with the JSON null value. By default, fields with empty
  4089. // values are omitted from API requests. However, any field with an
  4090. // empty value appearing in NullFields will be sent to the server as
  4091. // null. It is an error if a field in this list has a non-empty value.
  4092. // This may be used to include null fields in Patch requests.
  4093. NullFields []string `json:"-"`
  4094. }
  4095. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4096. type NoMethod CreativeField
  4097. raw := NoMethod(*s)
  4098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4099. }
  4100. // CreativeFieldAssignment: Creative Field Assignment.
  4101. type CreativeFieldAssignment struct {
  4102. // CreativeFieldId: ID of the creative field.
  4103. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4104. // CreativeFieldValueId: ID of the creative field value.
  4105. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4106. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4107. // unconditionally include in API requests. By default, fields with
  4108. // empty values are omitted from API requests. However, any non-pointer,
  4109. // non-interface field appearing in ForceSendFields will be sent to the
  4110. // server regardless of whether the field is empty or not. This may be
  4111. // used to include empty fields in Patch requests.
  4112. ForceSendFields []string `json:"-"`
  4113. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4114. // include in API requests with the JSON null value. By default, fields
  4115. // with empty values are omitted from API requests. However, any field
  4116. // with an empty value appearing in NullFields will be sent to the
  4117. // server as null. It is an error if a field in this list has a
  4118. // non-empty value. This may be used to include null fields in Patch
  4119. // requests.
  4120. NullFields []string `json:"-"`
  4121. }
  4122. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4123. type NoMethod CreativeFieldAssignment
  4124. raw := NoMethod(*s)
  4125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4126. }
  4127. // CreativeFieldValue: Contains properties of a creative field value.
  4128. type CreativeFieldValue struct {
  4129. // Id: ID of this creative field value. This is a read-only,
  4130. // auto-generated field.
  4131. Id int64 `json:"id,omitempty,string"`
  4132. // Kind: Identifies what kind of resource this is. Value: the fixed
  4133. // string "dfareporting#creativeFieldValue".
  4134. Kind string `json:"kind,omitempty"`
  4135. // Value: Value of this creative field value. It needs to be less than
  4136. // 256 characters in length and unique per creative field.
  4137. Value string `json:"value,omitempty"`
  4138. // ServerResponse contains the HTTP response code and headers from the
  4139. // server.
  4140. googleapi.ServerResponse `json:"-"`
  4141. // ForceSendFields is a list of field names (e.g. "Id") to
  4142. // unconditionally include in API requests. By default, fields with
  4143. // empty values are omitted from API requests. However, any non-pointer,
  4144. // non-interface field appearing in ForceSendFields will be sent to the
  4145. // server regardless of whether the field is empty or not. This may be
  4146. // used to include empty fields in Patch requests.
  4147. ForceSendFields []string `json:"-"`
  4148. // NullFields is a list of field names (e.g. "Id") to include in API
  4149. // requests with the JSON null value. By default, fields with empty
  4150. // values are omitted from API requests. However, any field with an
  4151. // empty value appearing in NullFields will be sent to the server as
  4152. // null. It is an error if a field in this list has a non-empty value.
  4153. // This may be used to include null fields in Patch requests.
  4154. NullFields []string `json:"-"`
  4155. }
  4156. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4157. type NoMethod CreativeFieldValue
  4158. raw := NoMethod(*s)
  4159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4160. }
  4161. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4162. type CreativeFieldValuesListResponse struct {
  4163. // CreativeFieldValues: Creative field value collection.
  4164. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4165. // Kind: Identifies what kind of resource this is. Value: the fixed
  4166. // string "dfareporting#creativeFieldValuesListResponse".
  4167. Kind string `json:"kind,omitempty"`
  4168. // NextPageToken: Pagination token to be used for the next list
  4169. // operation.
  4170. NextPageToken string `json:"nextPageToken,omitempty"`
  4171. // ServerResponse contains the HTTP response code and headers from the
  4172. // server.
  4173. googleapi.ServerResponse `json:"-"`
  4174. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4175. // to unconditionally include in API requests. By default, fields with
  4176. // empty values are omitted from API requests. However, any non-pointer,
  4177. // non-interface field appearing in ForceSendFields will be sent to the
  4178. // server regardless of whether the field is empty or not. This may be
  4179. // used to include empty fields in Patch requests.
  4180. ForceSendFields []string `json:"-"`
  4181. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4182. // include in API requests with the JSON null value. By default, fields
  4183. // with empty values are omitted from API requests. However, any field
  4184. // with an empty value appearing in NullFields will be sent to the
  4185. // server as null. It is an error if a field in this list has a
  4186. // non-empty value. This may be used to include null fields in Patch
  4187. // requests.
  4188. NullFields []string `json:"-"`
  4189. }
  4190. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4191. type NoMethod CreativeFieldValuesListResponse
  4192. raw := NoMethod(*s)
  4193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4194. }
  4195. // CreativeFieldsListResponse: Creative Field List Response
  4196. type CreativeFieldsListResponse struct {
  4197. // CreativeFields: Creative field collection.
  4198. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4199. // Kind: Identifies what kind of resource this is. Value: the fixed
  4200. // string "dfareporting#creativeFieldsListResponse".
  4201. Kind string `json:"kind,omitempty"`
  4202. // NextPageToken: Pagination token to be used for the next list
  4203. // operation.
  4204. NextPageToken string `json:"nextPageToken,omitempty"`
  4205. // ServerResponse contains the HTTP response code and headers from the
  4206. // server.
  4207. googleapi.ServerResponse `json:"-"`
  4208. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4209. // unconditionally include in API requests. By default, fields with
  4210. // empty values are omitted from API requests. However, any non-pointer,
  4211. // non-interface field appearing in ForceSendFields will be sent to the
  4212. // server regardless of whether the field is empty or not. This may be
  4213. // used to include empty fields in Patch requests.
  4214. ForceSendFields []string `json:"-"`
  4215. // NullFields is a list of field names (e.g. "CreativeFields") to
  4216. // include in API requests with the JSON null value. By default, fields
  4217. // with empty values are omitted from API requests. However, any field
  4218. // with an empty value appearing in NullFields will be sent to the
  4219. // server as null. It is an error if a field in this list has a
  4220. // non-empty value. This may be used to include null fields in Patch
  4221. // requests.
  4222. NullFields []string `json:"-"`
  4223. }
  4224. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4225. type NoMethod CreativeFieldsListResponse
  4226. raw := NoMethod(*s)
  4227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4228. }
  4229. // CreativeGroup: Contains properties of a creative group.
  4230. type CreativeGroup struct {
  4231. // AccountId: Account ID of this creative group. This is a read-only
  4232. // field that can be left blank.
  4233. AccountId int64 `json:"accountId,omitempty,string"`
  4234. // AdvertiserId: Advertiser ID of this creative group. This is a
  4235. // required field on insertion.
  4236. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4237. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4238. // advertiser. This is a read-only, auto-generated field.
  4239. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4240. // GroupNumber: Subgroup of the creative group. Assign your creative
  4241. // groups to a subgroup in order to filter or manage them more easily.
  4242. // This field is required on insertion and is read-only after insertion.
  4243. // Acceptable values are 1 to 2, inclusive.
  4244. GroupNumber int64 `json:"groupNumber,omitempty"`
  4245. // Id: ID of this creative group. This is a read-only, auto-generated
  4246. // field.
  4247. Id int64 `json:"id,omitempty,string"`
  4248. // Kind: Identifies what kind of resource this is. Value: the fixed
  4249. // string "dfareporting#creativeGroup".
  4250. Kind string `json:"kind,omitempty"`
  4251. // Name: Name of this creative group. This is a required field and must
  4252. // be less than 256 characters long and unique among creative groups of
  4253. // the same advertiser.
  4254. Name string `json:"name,omitempty"`
  4255. // SubaccountId: Subaccount ID of this creative group. This is a
  4256. // read-only field that can be left blank.
  4257. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4258. // ServerResponse contains the HTTP response code and headers from the
  4259. // server.
  4260. googleapi.ServerResponse `json:"-"`
  4261. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4262. // unconditionally include in API requests. By default, fields with
  4263. // empty values are omitted from API requests. However, any non-pointer,
  4264. // non-interface field appearing in ForceSendFields will be sent to the
  4265. // server regardless of whether the field is empty or not. This may be
  4266. // used to include empty fields in Patch requests.
  4267. ForceSendFields []string `json:"-"`
  4268. // NullFields is a list of field names (e.g. "AccountId") to include in
  4269. // API requests with the JSON null value. By default, fields with empty
  4270. // values are omitted from API requests. However, any field with an
  4271. // empty value appearing in NullFields will be sent to the server as
  4272. // null. It is an error if a field in this list has a non-empty value.
  4273. // This may be used to include null fields in Patch requests.
  4274. NullFields []string `json:"-"`
  4275. }
  4276. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4277. type NoMethod CreativeGroup
  4278. raw := NoMethod(*s)
  4279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4280. }
  4281. // CreativeGroupAssignment: Creative Group Assignment.
  4282. type CreativeGroupAssignment struct {
  4283. // CreativeGroupId: ID of the creative group to be assigned.
  4284. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4285. // CreativeGroupNumber: Creative group number of the creative group
  4286. // assignment.
  4287. //
  4288. // Possible values:
  4289. // "CREATIVE_GROUP_ONE"
  4290. // "CREATIVE_GROUP_TWO"
  4291. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4292. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4293. // unconditionally include in API requests. By default, fields with
  4294. // empty values are omitted from API requests. However, any non-pointer,
  4295. // non-interface field appearing in ForceSendFields will be sent to the
  4296. // server regardless of whether the field is empty or not. This may be
  4297. // used to include empty fields in Patch requests.
  4298. ForceSendFields []string `json:"-"`
  4299. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4300. // include in API requests with the JSON null value. By default, fields
  4301. // with empty values are omitted from API requests. However, any field
  4302. // with an empty value appearing in NullFields will be sent to the
  4303. // server as null. It is an error if a field in this list has a
  4304. // non-empty value. This may be used to include null fields in Patch
  4305. // requests.
  4306. NullFields []string `json:"-"`
  4307. }
  4308. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4309. type NoMethod CreativeGroupAssignment
  4310. raw := NoMethod(*s)
  4311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4312. }
  4313. // CreativeGroupsListResponse: Creative Group List Response
  4314. type CreativeGroupsListResponse struct {
  4315. // CreativeGroups: Creative group collection.
  4316. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4317. // Kind: Identifies what kind of resource this is. Value: the fixed
  4318. // string "dfareporting#creativeGroupsListResponse".
  4319. Kind string `json:"kind,omitempty"`
  4320. // NextPageToken: Pagination token to be used for the next list
  4321. // operation.
  4322. NextPageToken string `json:"nextPageToken,omitempty"`
  4323. // ServerResponse contains the HTTP response code and headers from the
  4324. // server.
  4325. googleapi.ServerResponse `json:"-"`
  4326. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4327. // unconditionally include in API requests. By default, fields with
  4328. // empty values are omitted from API requests. However, any non-pointer,
  4329. // non-interface field appearing in ForceSendFields will be sent to the
  4330. // server regardless of whether the field is empty or not. This may be
  4331. // used to include empty fields in Patch requests.
  4332. ForceSendFields []string `json:"-"`
  4333. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4334. // include in API requests with the JSON null value. By default, fields
  4335. // with empty values are omitted from API requests. However, any field
  4336. // with an empty value appearing in NullFields will be sent to the
  4337. // server as null. It is an error if a field in this list has a
  4338. // non-empty value. This may be used to include null fields in Patch
  4339. // requests.
  4340. NullFields []string `json:"-"`
  4341. }
  4342. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4343. type NoMethod CreativeGroupsListResponse
  4344. raw := NoMethod(*s)
  4345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4346. }
  4347. // CreativeOptimizationConfiguration: Creative optimization settings.
  4348. type CreativeOptimizationConfiguration struct {
  4349. // Id: ID of this creative optimization config. This field is
  4350. // auto-generated when the campaign is inserted or updated. It can be
  4351. // null for existing campaigns.
  4352. Id int64 `json:"id,omitempty,string"`
  4353. // Name: Name of this creative optimization config. This is a required
  4354. // field and must be less than 129 characters long.
  4355. Name string `json:"name,omitempty"`
  4356. // OptimizationActivitys: List of optimization activities associated
  4357. // with this configuration.
  4358. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4359. // OptimizationModel: Optimization model for this configuration.
  4360. //
  4361. // Possible values:
  4362. // "CLICK"
  4363. // "POST_CLICK"
  4364. // "POST_CLICK_AND_IMPRESSION"
  4365. // "POST_IMPRESSION"
  4366. // "VIDEO_COMPLETION"
  4367. OptimizationModel string `json:"optimizationModel,omitempty"`
  4368. // ForceSendFields is a list of field names (e.g. "Id") to
  4369. // unconditionally include in API requests. By default, fields with
  4370. // empty values are omitted from API requests. However, any non-pointer,
  4371. // non-interface field appearing in ForceSendFields will be sent to the
  4372. // server regardless of whether the field is empty or not. This may be
  4373. // used to include empty fields in Patch requests.
  4374. ForceSendFields []string `json:"-"`
  4375. // NullFields is a list of field names (e.g. "Id") to include in API
  4376. // requests with the JSON null value. By default, fields with empty
  4377. // values are omitted from API requests. However, any field with an
  4378. // empty value appearing in NullFields will be sent to the server as
  4379. // null. It is an error if a field in this list has a non-empty value.
  4380. // This may be used to include null fields in Patch requests.
  4381. NullFields []string `json:"-"`
  4382. }
  4383. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4384. type NoMethod CreativeOptimizationConfiguration
  4385. raw := NoMethod(*s)
  4386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4387. }
  4388. // CreativeRotation: Creative Rotation.
  4389. type CreativeRotation struct {
  4390. // CreativeAssignments: Creative assignments in this creative rotation.
  4391. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4392. // CreativeOptimizationConfigurationId: Creative optimization
  4393. // configuration that is used by this ad. It should refer to one of the
  4394. // existing optimization configurations in the ad's campaign. If it is
  4395. // unset or set to 0, then the campaign's default optimization
  4396. // configuration will be used for this ad.
  4397. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4398. // Type: Type of creative rotation. Can be used to specify whether to
  4399. // use sequential or random rotation.
  4400. //
  4401. // Possible values:
  4402. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4403. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4404. Type string `json:"type,omitempty"`
  4405. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4406. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4407. //
  4408. // Possible values:
  4409. // "WEIGHT_STRATEGY_CUSTOM"
  4410. // "WEIGHT_STRATEGY_EQUAL"
  4411. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4412. // "WEIGHT_STRATEGY_OPTIMIZED"
  4413. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4414. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4415. // to unconditionally include in API requests. By default, fields with
  4416. // empty values are omitted from API requests. However, any non-pointer,
  4417. // non-interface field appearing in ForceSendFields will be sent to the
  4418. // server regardless of whether the field is empty or not. This may be
  4419. // used to include empty fields in Patch requests.
  4420. ForceSendFields []string `json:"-"`
  4421. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4422. // include in API requests with the JSON null value. By default, fields
  4423. // with empty values are omitted from API requests. However, any field
  4424. // with an empty value appearing in NullFields will be sent to the
  4425. // server as null. It is an error if a field in this list has a
  4426. // non-empty value. This may be used to include null fields in Patch
  4427. // requests.
  4428. NullFields []string `json:"-"`
  4429. }
  4430. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4431. type NoMethod CreativeRotation
  4432. raw := NoMethod(*s)
  4433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4434. }
  4435. // CreativeSettings: Creative Settings
  4436. type CreativeSettings struct {
  4437. // IFrameFooter: Header text for iFrames for this site. Must be less
  4438. // than or equal to 2000 characters long.
  4439. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4440. // IFrameHeader: Header text for iFrames for this site. Must be less
  4441. // than or equal to 2000 characters long.
  4442. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4443. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4444. // unconditionally include in API requests. By default, fields with
  4445. // empty values are omitted from API requests. However, any non-pointer,
  4446. // non-interface field appearing in ForceSendFields will be sent to the
  4447. // server regardless of whether the field is empty or not. This may be
  4448. // used to include empty fields in Patch requests.
  4449. ForceSendFields []string `json:"-"`
  4450. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4451. // in API requests with the JSON null value. By default, fields with
  4452. // empty values are omitted from API requests. However, any field with
  4453. // an empty value appearing in NullFields will be sent to the server as
  4454. // null. It is an error if a field in this list has a non-empty value.
  4455. // This may be used to include null fields in Patch requests.
  4456. NullFields []string `json:"-"`
  4457. }
  4458. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4459. type NoMethod CreativeSettings
  4460. raw := NoMethod(*s)
  4461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4462. }
  4463. // CreativesListResponse: Creative List Response
  4464. type CreativesListResponse struct {
  4465. // Creatives: Creative collection.
  4466. Creatives []*Creative `json:"creatives,omitempty"`
  4467. // Kind: Identifies what kind of resource this is. Value: the fixed
  4468. // string "dfareporting#creativesListResponse".
  4469. Kind string `json:"kind,omitempty"`
  4470. // NextPageToken: Pagination token to be used for the next list
  4471. // operation.
  4472. NextPageToken string `json:"nextPageToken,omitempty"`
  4473. // ServerResponse contains the HTTP response code and headers from the
  4474. // server.
  4475. googleapi.ServerResponse `json:"-"`
  4476. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4477. // unconditionally include in API requests. By default, fields with
  4478. // empty values are omitted from API requests. However, any non-pointer,
  4479. // non-interface field appearing in ForceSendFields will be sent to the
  4480. // server regardless of whether the field is empty or not. This may be
  4481. // used to include empty fields in Patch requests.
  4482. ForceSendFields []string `json:"-"`
  4483. // NullFields is a list of field names (e.g. "Creatives") to include in
  4484. // API requests with the JSON null value. By default, fields with empty
  4485. // values are omitted from API requests. However, any field with an
  4486. // empty value appearing in NullFields will be sent to the server as
  4487. // null. It is an error if a field in this list has a non-empty value.
  4488. // This may be used to include null fields in Patch requests.
  4489. NullFields []string `json:"-"`
  4490. }
  4491. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4492. type NoMethod CreativesListResponse
  4493. raw := NoMethod(*s)
  4494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4495. }
  4496. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4497. // compatible to be selected for a report of type
  4498. // "CROSS_DIMENSION_REACH".
  4499. type CrossDimensionReachReportCompatibleFields struct {
  4500. // Breakdown: Dimensions which are compatible to be selected in the
  4501. // "breakdown" section of the report.
  4502. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4503. // DimensionFilters: Dimensions which are compatible to be selected in
  4504. // the "dimensionFilters" section of the report.
  4505. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4506. // Kind: The kind of resource this is, in this case
  4507. // dfareporting#crossDimensionReachReportCompatibleFields.
  4508. Kind string `json:"kind,omitempty"`
  4509. // Metrics: Metrics which are compatible to be selected in the
  4510. // "metricNames" section of the report.
  4511. Metrics []*Metric `json:"metrics,omitempty"`
  4512. // OverlapMetrics: Metrics which are compatible to be selected in the
  4513. // "overlapMetricNames" section of the report.
  4514. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4515. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4516. // unconditionally include in API requests. By default, fields with
  4517. // empty values are omitted from API requests. However, any non-pointer,
  4518. // non-interface field appearing in ForceSendFields will be sent to the
  4519. // server regardless of whether the field is empty or not. This may be
  4520. // used to include empty fields in Patch requests.
  4521. ForceSendFields []string `json:"-"`
  4522. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4523. // API requests with the JSON null value. By default, fields with empty
  4524. // values are omitted from API requests. However, any field with an
  4525. // empty value appearing in NullFields will be sent to the server as
  4526. // null. It is an error if a field in this list has a non-empty value.
  4527. // This may be used to include null fields in Patch requests.
  4528. NullFields []string `json:"-"`
  4529. }
  4530. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4531. type NoMethod CrossDimensionReachReportCompatibleFields
  4532. raw := NoMethod(*s)
  4533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4534. }
  4535. // CustomFloodlightVariable: A custom floodlight variable.
  4536. type CustomFloodlightVariable struct {
  4537. // Kind: Identifies what kind of resource this is. Value: the fixed
  4538. // string "dfareporting#customFloodlightVariable".
  4539. Kind string `json:"kind,omitempty"`
  4540. // Type: The type of custom floodlight variable to supply a value for.
  4541. // These map to the "u[1-20]=" in the tags.
  4542. //
  4543. // Possible values:
  4544. // "U1"
  4545. // "U10"
  4546. // "U100"
  4547. // "U11"
  4548. // "U12"
  4549. // "U13"
  4550. // "U14"
  4551. // "U15"
  4552. // "U16"
  4553. // "U17"
  4554. // "U18"
  4555. // "U19"
  4556. // "U2"
  4557. // "U20"
  4558. // "U21"
  4559. // "U22"
  4560. // "U23"
  4561. // "U24"
  4562. // "U25"
  4563. // "U26"
  4564. // "U27"
  4565. // "U28"
  4566. // "U29"
  4567. // "U3"
  4568. // "U30"
  4569. // "U31"
  4570. // "U32"
  4571. // "U33"
  4572. // "U34"
  4573. // "U35"
  4574. // "U36"
  4575. // "U37"
  4576. // "U38"
  4577. // "U39"
  4578. // "U4"
  4579. // "U40"
  4580. // "U41"
  4581. // "U42"
  4582. // "U43"
  4583. // "U44"
  4584. // "U45"
  4585. // "U46"
  4586. // "U47"
  4587. // "U48"
  4588. // "U49"
  4589. // "U5"
  4590. // "U50"
  4591. // "U51"
  4592. // "U52"
  4593. // "U53"
  4594. // "U54"
  4595. // "U55"
  4596. // "U56"
  4597. // "U57"
  4598. // "U58"
  4599. // "U59"
  4600. // "U6"
  4601. // "U60"
  4602. // "U61"
  4603. // "U62"
  4604. // "U63"
  4605. // "U64"
  4606. // "U65"
  4607. // "U66"
  4608. // "U67"
  4609. // "U68"
  4610. // "U69"
  4611. // "U7"
  4612. // "U70"
  4613. // "U71"
  4614. // "U72"
  4615. // "U73"
  4616. // "U74"
  4617. // "U75"
  4618. // "U76"
  4619. // "U77"
  4620. // "U78"
  4621. // "U79"
  4622. // "U8"
  4623. // "U80"
  4624. // "U81"
  4625. // "U82"
  4626. // "U83"
  4627. // "U84"
  4628. // "U85"
  4629. // "U86"
  4630. // "U87"
  4631. // "U88"
  4632. // "U89"
  4633. // "U9"
  4634. // "U90"
  4635. // "U91"
  4636. // "U92"
  4637. // "U93"
  4638. // "U94"
  4639. // "U95"
  4640. // "U96"
  4641. // "U97"
  4642. // "U98"
  4643. // "U99"
  4644. Type string `json:"type,omitempty"`
  4645. // Value: The value of the custom floodlight variable. The length of
  4646. // string must not exceed 50 characters.
  4647. Value string `json:"value,omitempty"`
  4648. // ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") to include in API
  4656. // requests with the JSON null value. By default, fields with empty
  4657. // values are omitted from API requests. However, any field with an
  4658. // 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 *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4664. type NoMethod CustomFloodlightVariable
  4665. raw := NoMethod(*s)
  4666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4667. }
  4668. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4669. type CustomRichMediaEvents struct {
  4670. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4671. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4672. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4673. // Kind: The kind of resource this is, in this case
  4674. // dfareporting#customRichMediaEvents.
  4675. Kind string `json:"kind,omitempty"`
  4676. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4677. // unconditionally include in API requests. By default, fields with
  4678. // empty values are omitted from API requests. However, any non-pointer,
  4679. // non-interface field appearing in ForceSendFields will be sent to the
  4680. // server regardless of whether the field is empty or not. This may be
  4681. // used to include empty fields in Patch requests.
  4682. ForceSendFields []string `json:"-"`
  4683. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4684. // include in API requests with the JSON null value. By default, fields
  4685. // with empty values are omitted from API requests. However, any field
  4686. // with an empty value appearing in NullFields will be sent to the
  4687. // server as null. It is an error if a field in this list has a
  4688. // non-empty value. This may be used to include null fields in Patch
  4689. // requests.
  4690. NullFields []string `json:"-"`
  4691. }
  4692. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4693. type NoMethod CustomRichMediaEvents
  4694. raw := NoMethod(*s)
  4695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4696. }
  4697. // DateRange: Represents a date range.
  4698. type DateRange struct {
  4699. // EndDate: The end date of the date range, inclusive. A string of the
  4700. // format: "yyyy-MM-dd".
  4701. EndDate string `json:"endDate,omitempty"`
  4702. // Kind: The kind of resource this is, in this case
  4703. // dfareporting#dateRange.
  4704. Kind string `json:"kind,omitempty"`
  4705. // RelativeDateRange: The date range relative to the date of when the
  4706. // report is run.
  4707. //
  4708. // Possible values:
  4709. // "LAST_24_MONTHS"
  4710. // "LAST_30_DAYS"
  4711. // "LAST_365_DAYS"
  4712. // "LAST_7_DAYS"
  4713. // "LAST_90_DAYS"
  4714. // "MONTH_TO_DATE"
  4715. // "PREVIOUS_MONTH"
  4716. // "PREVIOUS_QUARTER"
  4717. // "PREVIOUS_WEEK"
  4718. // "PREVIOUS_YEAR"
  4719. // "QUARTER_TO_DATE"
  4720. // "TODAY"
  4721. // "WEEK_TO_DATE"
  4722. // "YEAR_TO_DATE"
  4723. // "YESTERDAY"
  4724. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  4725. // StartDate: The start date of the date range, inclusive. A string of
  4726. // the format: "yyyy-MM-dd".
  4727. StartDate string `json:"startDate,omitempty"`
  4728. // ForceSendFields is a list of field names (e.g. "EndDate") to
  4729. // unconditionally include in API requests. By default, fields with
  4730. // empty values are omitted from API requests. However, any non-pointer,
  4731. // non-interface field appearing in ForceSendFields will be sent to the
  4732. // server regardless of whether the field is empty or not. This may be
  4733. // used to include empty fields in Patch requests.
  4734. ForceSendFields []string `json:"-"`
  4735. // NullFields is a list of field names (e.g. "EndDate") to include in
  4736. // API requests with the JSON null value. By default, fields with empty
  4737. // values are omitted from API requests. However, any field with an
  4738. // empty value appearing in NullFields will be sent to the server as
  4739. // null. It is an error if a field in this list has a non-empty value.
  4740. // This may be used to include null fields in Patch requests.
  4741. NullFields []string `json:"-"`
  4742. }
  4743. func (s *DateRange) MarshalJSON() ([]byte, error) {
  4744. type NoMethod DateRange
  4745. raw := NoMethod(*s)
  4746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4747. }
  4748. // DayPartTargeting: Day Part Targeting.
  4749. type DayPartTargeting struct {
  4750. // DaysOfWeek: Days of the week when the ad will serve.
  4751. //
  4752. // Acceptable values are:
  4753. // - "SUNDAY"
  4754. // - "MONDAY"
  4755. // - "TUESDAY"
  4756. // - "WEDNESDAY"
  4757. // - "THURSDAY"
  4758. // - "FRIDAY"
  4759. // - "SATURDAY"
  4760. //
  4761. // Possible values:
  4762. // "FRIDAY"
  4763. // "MONDAY"
  4764. // "SATURDAY"
  4765. // "SUNDAY"
  4766. // "THURSDAY"
  4767. // "TUESDAY"
  4768. // "WEDNESDAY"
  4769. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  4770. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  4771. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  4772. // days of week, in which case the ad would serve during these hours on
  4773. // the specified days. For example if Monday, Wednesday, Friday are the
  4774. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  4775. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  4776. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  4777. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  4778. // UserLocalTime: Whether or not to use the user's local time. If false,
  4779. // the America/New York time zone applies.
  4780. UserLocalTime bool `json:"userLocalTime,omitempty"`
  4781. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  4782. // unconditionally include in API requests. By default, fields with
  4783. // empty values are omitted from API requests. However, any non-pointer,
  4784. // non-interface field appearing in ForceSendFields will be sent to the
  4785. // server regardless of whether the field is empty or not. This may be
  4786. // used to include empty fields in Patch requests.
  4787. ForceSendFields []string `json:"-"`
  4788. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  4789. // API requests with the JSON null value. By default, fields with empty
  4790. // values are omitted from API requests. However, any field with an
  4791. // empty value appearing in NullFields will be sent to the server as
  4792. // null. It is an error if a field in this list has a non-empty value.
  4793. // This may be used to include null fields in Patch requests.
  4794. NullFields []string `json:"-"`
  4795. }
  4796. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  4797. type NoMethod DayPartTargeting
  4798. raw := NoMethod(*s)
  4799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4800. }
  4801. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  4802. // overriding the default click-through event tag. A campaign may
  4803. // override the event tag defined at the advertiser level, and an ad may
  4804. // also override the campaign's setting further.
  4805. type DefaultClickThroughEventTagProperties struct {
  4806. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  4807. // apply to all ads in this entity's scope.
  4808. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  4809. // OverrideInheritedEventTag: Whether this entity should override the
  4810. // inherited default click-through event tag with its own defined value.
  4811. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  4812. // ForceSendFields is a list of field names (e.g.
  4813. // "DefaultClickThroughEventTagId") to unconditionally include in API
  4814. // requests. By default, fields with empty values are omitted from API
  4815. // requests. However, any non-pointer, non-interface field appearing in
  4816. // ForceSendFields will be sent to the server regardless of whether the
  4817. // field is empty or not. This may be used to include empty fields in
  4818. // Patch requests.
  4819. ForceSendFields []string `json:"-"`
  4820. // NullFields is a list of field names (e.g.
  4821. // "DefaultClickThroughEventTagId") to include in API requests with the
  4822. // JSON null value. By default, fields with empty values are omitted
  4823. // from API requests. However, any field with an empty value appearing
  4824. // in NullFields will be sent to the server as null. It is an error if a
  4825. // field in this list has a non-empty value. This may be used to include
  4826. // null fields in Patch requests.
  4827. NullFields []string `json:"-"`
  4828. }
  4829. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  4830. type NoMethod DefaultClickThroughEventTagProperties
  4831. raw := NoMethod(*s)
  4832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4833. }
  4834. // DeliverySchedule: Delivery Schedule.
  4835. type DeliverySchedule struct {
  4836. // FrequencyCap: Limit on the number of times an individual user can be
  4837. // served the ad within a specified period of time.
  4838. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  4839. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  4840. // will not serve after the end date and time. Otherwise the ad will
  4841. // continue to be served until it has reached its delivery goals.
  4842. HardCutoff bool `json:"hardCutoff,omitempty"`
  4843. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  4844. // how often each ad is served relative to the others. For example, if
  4845. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  4846. // 3, then DCM will serve ad B three times as often as ad A. Acceptable
  4847. // values are 1 to 10, inclusive.
  4848. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  4849. // Priority: Serving priority of an ad, with respect to other ads. The
  4850. // lower the priority number, the greater the priority with which it is
  4851. // served.
  4852. //
  4853. // Possible values:
  4854. // "AD_PRIORITY_01"
  4855. // "AD_PRIORITY_02"
  4856. // "AD_PRIORITY_03"
  4857. // "AD_PRIORITY_04"
  4858. // "AD_PRIORITY_05"
  4859. // "AD_PRIORITY_06"
  4860. // "AD_PRIORITY_07"
  4861. // "AD_PRIORITY_08"
  4862. // "AD_PRIORITY_09"
  4863. // "AD_PRIORITY_10"
  4864. // "AD_PRIORITY_11"
  4865. // "AD_PRIORITY_12"
  4866. // "AD_PRIORITY_13"
  4867. // "AD_PRIORITY_14"
  4868. // "AD_PRIORITY_15"
  4869. // "AD_PRIORITY_16"
  4870. Priority string `json:"priority,omitempty"`
  4871. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  4872. // unconditionally include in API requests. By default, fields with
  4873. // empty values are omitted from API requests. However, any non-pointer,
  4874. // non-interface field appearing in ForceSendFields will be sent to the
  4875. // server regardless of whether the field is empty or not. This may be
  4876. // used to include empty fields in Patch requests.
  4877. ForceSendFields []string `json:"-"`
  4878. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  4879. // in API requests with the JSON null value. By default, fields with
  4880. // empty values are omitted from API requests. However, any field with
  4881. // an empty value appearing in NullFields will be sent to the server as
  4882. // null. It is an error if a field in this list has a non-empty value.
  4883. // This may be used to include null fields in Patch requests.
  4884. NullFields []string `json:"-"`
  4885. }
  4886. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  4887. type NoMethod DeliverySchedule
  4888. raw := NoMethod(*s)
  4889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4890. }
  4891. // DfpSettings: DFP Settings
  4892. type DfpSettings struct {
  4893. // DfpNetworkCode: DFP network code for this directory site.
  4894. DfpNetworkCode string `json:"dfp_network_code,omitempty"`
  4895. // DfpNetworkName: DFP network name for this directory site.
  4896. DfpNetworkName string `json:"dfp_network_name,omitempty"`
  4897. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  4898. // programmatic placements.
  4899. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  4900. // PubPaidPlacementAccepted: Whether this directory site accepts
  4901. // publisher-paid tags.
  4902. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  4903. // PublisherPortalOnly: Whether this directory site is available only
  4904. // via DoubleClick Publisher Portal.
  4905. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  4906. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  4907. // unconditionally include in API requests. By default, fields with
  4908. // empty values are omitted from API requests. However, any non-pointer,
  4909. // non-interface field appearing in ForceSendFields will be sent to the
  4910. // server regardless of whether the field is empty or not. This may be
  4911. // used to include empty fields in Patch requests.
  4912. ForceSendFields []string `json:"-"`
  4913. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  4914. // include in API requests with the JSON null value. By default, fields
  4915. // with empty values are omitted from API requests. However, any field
  4916. // with an empty value appearing in NullFields will be sent to the
  4917. // server as null. It is an error if a field in this list has a
  4918. // non-empty value. This may be used to include null fields in Patch
  4919. // requests.
  4920. NullFields []string `json:"-"`
  4921. }
  4922. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  4923. type NoMethod DfpSettings
  4924. raw := NoMethod(*s)
  4925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4926. }
  4927. // Dimension: Represents a dimension.
  4928. type Dimension struct {
  4929. // Kind: The kind of resource this is, in this case
  4930. // dfareporting#dimension.
  4931. Kind string `json:"kind,omitempty"`
  4932. // Name: The dimension name, e.g. dfa:advertiser
  4933. Name string `json:"name,omitempty"`
  4934. // ForceSendFields is a list of field names (e.g. "Kind") to
  4935. // unconditionally include in API requests. By default, fields with
  4936. // empty values are omitted from API requests. However, any non-pointer,
  4937. // non-interface field appearing in ForceSendFields will be sent to the
  4938. // server regardless of whether the field is empty or not. This may be
  4939. // used to include empty fields in Patch requests.
  4940. ForceSendFields []string `json:"-"`
  4941. // NullFields is a list of field names (e.g. "Kind") to include in API
  4942. // requests with the JSON null value. By default, fields with empty
  4943. // values are omitted from API requests. However, any field with an
  4944. // empty value appearing in NullFields will be sent to the server as
  4945. // null. It is an error if a field in this list has a non-empty value.
  4946. // This may be used to include null fields in Patch requests.
  4947. NullFields []string `json:"-"`
  4948. }
  4949. func (s *Dimension) MarshalJSON() ([]byte, error) {
  4950. type NoMethod Dimension
  4951. raw := NoMethod(*s)
  4952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4953. }
  4954. // DimensionFilter: Represents a dimension filter.
  4955. type DimensionFilter struct {
  4956. // DimensionName: The name of the dimension to filter.
  4957. DimensionName string `json:"dimensionName,omitempty"`
  4958. // Kind: The kind of resource this is, in this case
  4959. // dfareporting#dimensionFilter.
  4960. Kind string `json:"kind,omitempty"`
  4961. // Value: The value of the dimension to filter.
  4962. Value string `json:"value,omitempty"`
  4963. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  4964. // unconditionally include in API requests. By default, fields with
  4965. // empty values are omitted from API requests. However, any non-pointer,
  4966. // non-interface field appearing in ForceSendFields will be sent to the
  4967. // server regardless of whether the field is empty or not. This may be
  4968. // used to include empty fields in Patch requests.
  4969. ForceSendFields []string `json:"-"`
  4970. // NullFields is a list of field names (e.g. "DimensionName") to include
  4971. // in API requests with the JSON null value. By default, fields with
  4972. // empty values are omitted from API requests. However, any field with
  4973. // an empty value appearing in NullFields will be sent to the server as
  4974. // null. It is an error if a field in this list has a non-empty value.
  4975. // This may be used to include null fields in Patch requests.
  4976. NullFields []string `json:"-"`
  4977. }
  4978. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  4979. type NoMethod DimensionFilter
  4980. raw := NoMethod(*s)
  4981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4982. }
  4983. // DimensionValue: Represents a DimensionValue resource.
  4984. type DimensionValue struct {
  4985. // DimensionName: The name of the dimension.
  4986. DimensionName string `json:"dimensionName,omitempty"`
  4987. // Etag: The eTag of this response for caching purposes.
  4988. Etag string `json:"etag,omitempty"`
  4989. // Id: The ID associated with the value if available.
  4990. Id string `json:"id,omitempty"`
  4991. // Kind: The kind of resource this is, in this case
  4992. // dfareporting#dimensionValue.
  4993. Kind string `json:"kind,omitempty"`
  4994. // MatchType: Determines how the 'value' field is matched when
  4995. // filtering. If not specified, defaults to EXACT. If set to
  4996. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  4997. // length character sequences, and it can be escaped with a backslash.
  4998. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  4999. // matchType other than EXACT.
  5000. //
  5001. // Possible values:
  5002. // "BEGINS_WITH"
  5003. // "CONTAINS"
  5004. // "EXACT"
  5005. // "WILDCARD_EXPRESSION"
  5006. MatchType string `json:"matchType,omitempty"`
  5007. // Value: The value of the dimension.
  5008. Value string `json:"value,omitempty"`
  5009. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5010. // unconditionally include in API requests. By default, fields with
  5011. // empty values are omitted from API requests. However, any non-pointer,
  5012. // non-interface field appearing in ForceSendFields will be sent to the
  5013. // server regardless of whether the field is empty or not. This may be
  5014. // used to include empty fields in Patch requests.
  5015. ForceSendFields []string `json:"-"`
  5016. // NullFields is a list of field names (e.g. "DimensionName") to include
  5017. // in API requests with the JSON null value. By default, fields with
  5018. // empty values are omitted from API requests. However, any field with
  5019. // an empty value appearing in NullFields will be sent to the server as
  5020. // null. It is an error if a field in this list has a non-empty value.
  5021. // This may be used to include null fields in Patch requests.
  5022. NullFields []string `json:"-"`
  5023. }
  5024. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5025. type NoMethod DimensionValue
  5026. raw := NoMethod(*s)
  5027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5028. }
  5029. // DimensionValueList: Represents the list of DimensionValue resources.
  5030. type DimensionValueList struct {
  5031. // Etag: The eTag of this response for caching purposes.
  5032. Etag string `json:"etag,omitempty"`
  5033. // Items: The dimension values returned in this response.
  5034. Items []*DimensionValue `json:"items,omitempty"`
  5035. // Kind: The kind of list this is, in this case
  5036. // dfareporting#dimensionValueList.
  5037. Kind string `json:"kind,omitempty"`
  5038. // NextPageToken: Continuation token used to page through dimension
  5039. // values. To retrieve the next page of results, set the next request's
  5040. // "pageToken" to the value of this field. The page token is only valid
  5041. // for a limited amount of time and should not be persisted.
  5042. NextPageToken string `json:"nextPageToken,omitempty"`
  5043. // ServerResponse contains the HTTP response code and headers from the
  5044. // server.
  5045. googleapi.ServerResponse `json:"-"`
  5046. // ForceSendFields is a list of field names (e.g. "Etag") to
  5047. // unconditionally include in API requests. By default, fields with
  5048. // empty values are omitted from API requests. However, any non-pointer,
  5049. // non-interface field appearing in ForceSendFields will be sent to the
  5050. // server regardless of whether the field is empty or not. This may be
  5051. // used to include empty fields in Patch requests.
  5052. ForceSendFields []string `json:"-"`
  5053. // NullFields is a list of field names (e.g. "Etag") to include in API
  5054. // requests with the JSON null value. By default, fields with empty
  5055. // values are omitted from API requests. However, any field with an
  5056. // empty value appearing in NullFields will be sent to the server as
  5057. // null. It is an error if a field in this list has a non-empty value.
  5058. // This may be used to include null fields in Patch requests.
  5059. NullFields []string `json:"-"`
  5060. }
  5061. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5062. type NoMethod DimensionValueList
  5063. raw := NoMethod(*s)
  5064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5065. }
  5066. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5067. type DimensionValueRequest struct {
  5068. // DimensionName: The name of the dimension for which values should be
  5069. // requested.
  5070. DimensionName string `json:"dimensionName,omitempty"`
  5071. // EndDate: The end date of the date range for which to retrieve
  5072. // dimension values. A string of the format "yyyy-MM-dd".
  5073. EndDate string `json:"endDate,omitempty"`
  5074. // Filters: The list of filters by which to filter values. The filters
  5075. // are ANDed.
  5076. Filters []*DimensionFilter `json:"filters,omitempty"`
  5077. // Kind: The kind of request this is, in this case
  5078. // dfareporting#dimensionValueRequest.
  5079. Kind string `json:"kind,omitempty"`
  5080. // StartDate: The start date of the date range for which to retrieve
  5081. // dimension values. A string of the format "yyyy-MM-dd".
  5082. StartDate string `json:"startDate,omitempty"`
  5083. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5084. // unconditionally include in API requests. By default, fields with
  5085. // empty values are omitted from API requests. However, any non-pointer,
  5086. // non-interface field appearing in ForceSendFields will be sent to the
  5087. // server regardless of whether the field is empty or not. This may be
  5088. // used to include empty fields in Patch requests.
  5089. ForceSendFields []string `json:"-"`
  5090. // NullFields is a list of field names (e.g. "DimensionName") to include
  5091. // in API requests with the JSON null value. By default, fields with
  5092. // empty values are omitted from API requests. However, any field with
  5093. // an empty value appearing in NullFields will be sent to the server as
  5094. // null. It is an error if a field in this list has a non-empty value.
  5095. // This may be used to include null fields in Patch requests.
  5096. NullFields []string `json:"-"`
  5097. }
  5098. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5099. type NoMethod DimensionValueRequest
  5100. raw := NoMethod(*s)
  5101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5102. }
  5103. // DirectorySite: DirectorySites contains properties of a website from
  5104. // the Site Directory. Sites need to be added to an account via the
  5105. // Sites resource before they can be assigned to a placement.
  5106. type DirectorySite struct {
  5107. // Active: Whether this directory site is active.
  5108. Active bool `json:"active,omitempty"`
  5109. // ContactAssignments: Directory site contacts.
  5110. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5111. // CountryId: Country ID of this directory site. This is a read-only
  5112. // field.
  5113. CountryId int64 `json:"countryId,omitempty,string"`
  5114. // CurrencyId: Currency ID of this directory site. This is a read-only
  5115. // field.
  5116. // Possible values are:
  5117. // - "1" for USD
  5118. // - "2" for GBP
  5119. // - "3" for ESP
  5120. // - "4" for SEK
  5121. // - "5" for CAD
  5122. // - "6" for JPY
  5123. // - "7" for DEM
  5124. // - "8" for AUD
  5125. // - "9" for FRF
  5126. // - "10" for ITL
  5127. // - "11" for DKK
  5128. // - "12" for NOK
  5129. // - "13" for FIM
  5130. // - "14" for ZAR
  5131. // - "15" for IEP
  5132. // - "16" for NLG
  5133. // - "17" for EUR
  5134. // - "18" for KRW
  5135. // - "19" for TWD
  5136. // - "20" for SGD
  5137. // - "21" for CNY
  5138. // - "22" for HKD
  5139. // - "23" for NZD
  5140. // - "24" for MYR
  5141. // - "25" for BRL
  5142. // - "26" for PTE
  5143. // - "27" for MXP
  5144. // - "28" for CLP
  5145. // - "29" for TRY
  5146. // - "30" for ARS
  5147. // - "31" for PEN
  5148. // - "32" for ILS
  5149. // - "33" for CHF
  5150. // - "34" for VEF
  5151. // - "35" for COP
  5152. // - "36" for GTQ
  5153. // - "37" for PLN
  5154. // - "39" for INR
  5155. // - "40" for THB
  5156. // - "41" for IDR
  5157. // - "42" for CZK
  5158. // - "43" for RON
  5159. // - "44" for HUF
  5160. // - "45" for RUB
  5161. // - "46" for AED
  5162. // - "47" for BGN
  5163. // - "48" for HRK
  5164. // - "49" for MXN
  5165. // - "50" for NGN
  5166. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5167. // Description: Description of this directory site. This is a read-only
  5168. // field.
  5169. Description string `json:"description,omitempty"`
  5170. // Id: ID of this directory site. This is a read-only, auto-generated
  5171. // field.
  5172. Id int64 `json:"id,omitempty,string"`
  5173. // IdDimensionValue: Dimension value for the ID of this directory site.
  5174. // This is a read-only, auto-generated field.
  5175. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5176. // InpageTagFormats: Tag types for regular placements.
  5177. //
  5178. // Acceptable values are:
  5179. // - "STANDARD"
  5180. // - "IFRAME_JAVASCRIPT_INPAGE"
  5181. // - "INTERNAL_REDIRECT_INPAGE"
  5182. // - "JAVASCRIPT_INPAGE"
  5183. //
  5184. // Possible values:
  5185. // "IFRAME_JAVASCRIPT_INPAGE"
  5186. // "INTERNAL_REDIRECT_INPAGE"
  5187. // "JAVASCRIPT_INPAGE"
  5188. // "STANDARD"
  5189. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5190. // InterstitialTagFormats: Tag types for interstitial
  5191. // placements.
  5192. //
  5193. // Acceptable values are:
  5194. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5195. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5196. // - "JAVASCRIPT_INTERSTITIAL"
  5197. //
  5198. // Possible values:
  5199. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5200. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5201. // "JAVASCRIPT_INTERSTITIAL"
  5202. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5203. // Kind: Identifies what kind of resource this is. Value: the fixed
  5204. // string "dfareporting#directorySite".
  5205. Kind string `json:"kind,omitempty"`
  5206. // Name: Name of this directory site.
  5207. Name string `json:"name,omitempty"`
  5208. // ParentId: Parent directory site ID.
  5209. ParentId int64 `json:"parentId,omitempty,string"`
  5210. // Settings: Directory site settings.
  5211. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5212. // Url: URL of this directory site.
  5213. Url string `json:"url,omitempty"`
  5214. // ServerResponse contains the HTTP response code and headers from the
  5215. // server.
  5216. googleapi.ServerResponse `json:"-"`
  5217. // ForceSendFields is a list of field names (e.g. "Active") to
  5218. // unconditionally include in API requests. By default, fields with
  5219. // empty values are omitted from API requests. However, any non-pointer,
  5220. // non-interface field appearing in ForceSendFields will be sent to the
  5221. // server regardless of whether the field is empty or not. This may be
  5222. // used to include empty fields in Patch requests.
  5223. ForceSendFields []string `json:"-"`
  5224. // NullFields is a list of field names (e.g. "Active") to include in API
  5225. // requests with the JSON null value. By default, fields with empty
  5226. // values are omitted from API requests. However, any field with an
  5227. // empty value appearing in NullFields will be sent to the server as
  5228. // null. It is an error if a field in this list has a non-empty value.
  5229. // This may be used to include null fields in Patch requests.
  5230. NullFields []string `json:"-"`
  5231. }
  5232. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5233. type NoMethod DirectorySite
  5234. raw := NoMethod(*s)
  5235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5236. }
  5237. // DirectorySiteContact: Contains properties of a Site Directory
  5238. // contact.
  5239. type DirectorySiteContact struct {
  5240. // Address: Address of this directory site contact.
  5241. Address string `json:"address,omitempty"`
  5242. // Email: Email address of this directory site contact.
  5243. Email string `json:"email,omitempty"`
  5244. // FirstName: First name of this directory site contact.
  5245. FirstName string `json:"firstName,omitempty"`
  5246. // Id: ID of this directory site contact. This is a read-only,
  5247. // auto-generated field.
  5248. Id int64 `json:"id,omitempty,string"`
  5249. // Kind: Identifies what kind of resource this is. Value: the fixed
  5250. // string "dfareporting#directorySiteContact".
  5251. Kind string `json:"kind,omitempty"`
  5252. // LastName: Last name of this directory site contact.
  5253. LastName string `json:"lastName,omitempty"`
  5254. // Phone: Phone number of this directory site contact.
  5255. Phone string `json:"phone,omitempty"`
  5256. // Role: Directory site contact role.
  5257. //
  5258. // Possible values:
  5259. // "ADMIN"
  5260. // "EDIT"
  5261. // "VIEW"
  5262. Role string `json:"role,omitempty"`
  5263. // Title: Title or designation of this directory site contact.
  5264. Title string `json:"title,omitempty"`
  5265. // Type: Directory site contact type.
  5266. //
  5267. // Possible values:
  5268. // "BILLING"
  5269. // "OTHER"
  5270. // "SALES"
  5271. // "TECHNICAL"
  5272. Type string `json:"type,omitempty"`
  5273. // ServerResponse contains the HTTP response code and headers from the
  5274. // server.
  5275. googleapi.ServerResponse `json:"-"`
  5276. // ForceSendFields is a list of field names (e.g. "Address") to
  5277. // unconditionally include in API requests. By default, fields with
  5278. // empty values are omitted from API requests. However, any non-pointer,
  5279. // non-interface field appearing in ForceSendFields will be sent to the
  5280. // server regardless of whether the field is empty or not. This may be
  5281. // used to include empty fields in Patch requests.
  5282. ForceSendFields []string `json:"-"`
  5283. // NullFields is a list of field names (e.g. "Address") to include in
  5284. // API requests with the JSON null value. By default, fields with empty
  5285. // values are omitted from API requests. However, any field with an
  5286. // empty value appearing in NullFields will be sent to the server as
  5287. // null. It is an error if a field in this list has a non-empty value.
  5288. // This may be used to include null fields in Patch requests.
  5289. NullFields []string `json:"-"`
  5290. }
  5291. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5292. type NoMethod DirectorySiteContact
  5293. raw := NoMethod(*s)
  5294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5295. }
  5296. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5297. type DirectorySiteContactAssignment struct {
  5298. // ContactId: ID of this directory site contact. This is a read-only,
  5299. // auto-generated field.
  5300. ContactId int64 `json:"contactId,omitempty,string"`
  5301. // Visibility: Visibility of this directory site contact assignment.
  5302. // When set to PUBLIC this contact assignment is visible to all account
  5303. // and agency users; when set to PRIVATE it is visible only to the site.
  5304. //
  5305. // Possible values:
  5306. // "PRIVATE"
  5307. // "PUBLIC"
  5308. Visibility string `json:"visibility,omitempty"`
  5309. // ForceSendFields is a list of field names (e.g. "ContactId") to
  5310. // unconditionally include in API requests. By default, fields with
  5311. // empty values are omitted from API requests. However, any non-pointer,
  5312. // non-interface field appearing in ForceSendFields will be sent to the
  5313. // server regardless of whether the field is empty or not. This may be
  5314. // used to include empty fields in Patch requests.
  5315. ForceSendFields []string `json:"-"`
  5316. // NullFields is a list of field names (e.g. "ContactId") to include in
  5317. // API requests with the JSON null value. By default, fields with empty
  5318. // values are omitted from API requests. However, any field with an
  5319. // empty value appearing in NullFields will be sent to the server as
  5320. // null. It is an error if a field in this list has a non-empty value.
  5321. // This may be used to include null fields in Patch requests.
  5322. NullFields []string `json:"-"`
  5323. }
  5324. func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5325. type NoMethod DirectorySiteContactAssignment
  5326. raw := NoMethod(*s)
  5327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5328. }
  5329. // DirectorySiteContactsListResponse: Directory Site Contact List
  5330. // Response
  5331. type DirectorySiteContactsListResponse struct {
  5332. // DirectorySiteContacts: Directory site contact collection
  5333. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5334. // Kind: Identifies what kind of resource this is. Value: the fixed
  5335. // string "dfareporting#directorySiteContactsListResponse".
  5336. Kind string `json:"kind,omitempty"`
  5337. // NextPageToken: Pagination token to be used for the next list
  5338. // operation.
  5339. NextPageToken string `json:"nextPageToken,omitempty"`
  5340. // ServerResponse contains the HTTP response code and headers from the
  5341. // server.
  5342. googleapi.ServerResponse `json:"-"`
  5343. // ForceSendFields is a list of field names (e.g.
  5344. // "DirectorySiteContacts") to unconditionally include in API requests.
  5345. // By default, fields with empty values are omitted from API requests.
  5346. // However, any non-pointer, non-interface field appearing in
  5347. // ForceSendFields will be sent to the server regardless of whether the
  5348. // field is empty or not. This may be used to include empty fields in
  5349. // Patch requests.
  5350. ForceSendFields []string `json:"-"`
  5351. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5352. // include in API requests with the JSON null value. By default, fields
  5353. // with empty values are omitted from API requests. However, any field
  5354. // with an empty value appearing in NullFields will be sent to the
  5355. // server as null. It is an error if a field in this list has a
  5356. // non-empty value. This may be used to include null fields in Patch
  5357. // requests.
  5358. NullFields []string `json:"-"`
  5359. }
  5360. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5361. type NoMethod DirectorySiteContactsListResponse
  5362. raw := NoMethod(*s)
  5363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5364. }
  5365. // DirectorySiteSettings: Directory Site Settings
  5366. type DirectorySiteSettings struct {
  5367. // ActiveViewOptOut: Whether this directory site has disabled active
  5368. // view creatives.
  5369. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5370. // DfpSettings: Directory site DFP settings.
  5371. DfpSettings *DfpSettings `json:"dfp_settings,omitempty"`
  5372. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5373. // video ads.
  5374. InstreamVideoPlacementAccepted bool `json:"instream_video_placement_accepted,omitempty"`
  5375. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5376. // ads.
  5377. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5378. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5379. // OCR reach ratings.
  5380. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5381. // VerificationTagOptOut: Whether this directory site has disabled
  5382. // generation of Verification ins tags.
  5383. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5384. // VideoActiveViewOptOut: Whether this directory site has disabled
  5385. // active view for in-stream video creatives. This is a read-only field.
  5386. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5387. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5388. // unconditionally include in API requests. By default, fields with
  5389. // empty values are omitted from API requests. However, any non-pointer,
  5390. // non-interface field appearing in ForceSendFields will be sent to the
  5391. // server regardless of whether the field is empty or not. This may be
  5392. // used to include empty fields in Patch requests.
  5393. ForceSendFields []string `json:"-"`
  5394. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5395. // include in API requests with the JSON null value. By default, fields
  5396. // with empty values are omitted from API requests. However, any field
  5397. // with an empty value appearing in NullFields will be sent to the
  5398. // server as null. It is an error if a field in this list has a
  5399. // non-empty value. This may be used to include null fields in Patch
  5400. // requests.
  5401. NullFields []string `json:"-"`
  5402. }
  5403. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5404. type NoMethod DirectorySiteSettings
  5405. raw := NoMethod(*s)
  5406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5407. }
  5408. // DirectorySitesListResponse: Directory Site List Response
  5409. type DirectorySitesListResponse struct {
  5410. // DirectorySites: Directory site collection.
  5411. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5412. // Kind: Identifies what kind of resource this is. Value: the fixed
  5413. // string "dfareporting#directorySitesListResponse".
  5414. Kind string `json:"kind,omitempty"`
  5415. // NextPageToken: Pagination token to be used for the next list
  5416. // operation.
  5417. NextPageToken string `json:"nextPageToken,omitempty"`
  5418. // ServerResponse contains the HTTP response code and headers from the
  5419. // server.
  5420. googleapi.ServerResponse `json:"-"`
  5421. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5422. // unconditionally include in API requests. By default, fields with
  5423. // empty values are omitted from API requests. However, any non-pointer,
  5424. // non-interface field appearing in ForceSendFields will be sent to the
  5425. // server regardless of whether the field is empty or not. This may be
  5426. // used to include empty fields in Patch requests.
  5427. ForceSendFields []string `json:"-"`
  5428. // NullFields is a list of field names (e.g. "DirectorySites") to
  5429. // include in API requests with the JSON null value. By default, fields
  5430. // with empty values are omitted from API requests. However, any field
  5431. // with an empty value appearing in NullFields will be sent to the
  5432. // server as null. It is an error if a field in this list has a
  5433. // non-empty value. This may be used to include null fields in Patch
  5434. // requests.
  5435. NullFields []string `json:"-"`
  5436. }
  5437. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5438. type NoMethod DirectorySitesListResponse
  5439. raw := NoMethod(*s)
  5440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5441. }
  5442. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5443. // Dynamic targeting keys are unique, user-friendly labels, created at
  5444. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5445. // and placements and used for targeting with DoubleClick Studio dynamic
  5446. // creatives. Use these labels instead of numeric DCM IDs (such as
  5447. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5448. type DynamicTargetingKey struct {
  5449. // Kind: Identifies what kind of resource this is. Value: the fixed
  5450. // string "dfareporting#dynamicTargetingKey".
  5451. Kind string `json:"kind,omitempty"`
  5452. // Name: Name of this dynamic targeting key. This is a required field.
  5453. // Must be less than 256 characters long and cannot contain commas. All
  5454. // characters are converted to lowercase.
  5455. Name string `json:"name,omitempty"`
  5456. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5457. // required field.
  5458. ObjectId int64 `json:"objectId,omitempty,string"`
  5459. // ObjectType: Type of the object of this dynamic targeting key. This is
  5460. // a required field.
  5461. //
  5462. // Possible values:
  5463. // "OBJECT_AD"
  5464. // "OBJECT_ADVERTISER"
  5465. // "OBJECT_CREATIVE"
  5466. // "OBJECT_PLACEMENT"
  5467. ObjectType string `json:"objectType,omitempty"`
  5468. // ServerResponse contains the HTTP response code and headers from the
  5469. // server.
  5470. googleapi.ServerResponse `json:"-"`
  5471. // ForceSendFields is a list of field names (e.g. "Kind") to
  5472. // unconditionally include in API requests. By default, fields with
  5473. // empty values are omitted from API requests. However, any non-pointer,
  5474. // non-interface field appearing in ForceSendFields will be sent to the
  5475. // server regardless of whether the field is empty or not. This may be
  5476. // used to include empty fields in Patch requests.
  5477. ForceSendFields []string `json:"-"`
  5478. // NullFields is a list of field names (e.g. "Kind") to include in API
  5479. // requests with the JSON null value. By default, fields with empty
  5480. // values are omitted from API requests. However, any field with an
  5481. // empty value appearing in NullFields will be sent to the server as
  5482. // null. It is an error if a field in this list has a non-empty value.
  5483. // This may be used to include null fields in Patch requests.
  5484. NullFields []string `json:"-"`
  5485. }
  5486. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5487. type NoMethod DynamicTargetingKey
  5488. raw := NoMethod(*s)
  5489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5490. }
  5491. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5492. type DynamicTargetingKeysListResponse struct {
  5493. // DynamicTargetingKeys: Dynamic targeting key collection.
  5494. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5495. // Kind: Identifies what kind of resource this is. Value: the fixed
  5496. // string "dfareporting#dynamicTargetingKeysListResponse".
  5497. Kind string `json:"kind,omitempty"`
  5498. // ServerResponse contains the HTTP response code and headers from the
  5499. // server.
  5500. googleapi.ServerResponse `json:"-"`
  5501. // ForceSendFields is a list of field names (e.g.
  5502. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5503. // By default, fields with empty values are omitted from API requests.
  5504. // However, any non-pointer, non-interface field appearing in
  5505. // ForceSendFields will be sent to the server regardless of whether the
  5506. // field is empty or not. This may be used to include empty fields in
  5507. // Patch requests.
  5508. ForceSendFields []string `json:"-"`
  5509. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5510. // include in API requests with the JSON null value. By default, fields
  5511. // with empty values are omitted from API requests. However, any field
  5512. // with an empty value appearing in NullFields will be sent to the
  5513. // server as null. It is an error if a field in this list has a
  5514. // non-empty value. This may be used to include null fields in Patch
  5515. // requests.
  5516. NullFields []string `json:"-"`
  5517. }
  5518. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5519. type NoMethod DynamicTargetingKeysListResponse
  5520. raw := NoMethod(*s)
  5521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5522. }
  5523. // EncryptionInfo: A description of how user IDs are encrypted.
  5524. type EncryptionInfo struct {
  5525. // EncryptionEntityId: The encryption entity ID. This should match the
  5526. // encryption configuration for ad serving or Data Transfer.
  5527. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5528. // EncryptionEntityType: The encryption entity type. This should match
  5529. // the encryption configuration for ad serving or Data Transfer.
  5530. //
  5531. // Possible values:
  5532. // "ADWORDS_CUSTOMER"
  5533. // "DBM_ADVERTISER"
  5534. // "DBM_PARTNER"
  5535. // "DCM_ACCOUNT"
  5536. // "DCM_ADVERTISER"
  5537. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5538. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5539. // EncryptionSource: Describes whether the encrypted cookie was received
  5540. // from ad serving (the %m macro) or from Data Transfer.
  5541. //
  5542. // Possible values:
  5543. // "AD_SERVING"
  5544. // "DATA_TRANSFER"
  5545. // "ENCRYPTION_SCOPE_UNKNOWN"
  5546. EncryptionSource string `json:"encryptionSource,omitempty"`
  5547. // Kind: Identifies what kind of resource this is. Value: the fixed
  5548. // string "dfareporting#encryptionInfo".
  5549. Kind string `json:"kind,omitempty"`
  5550. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5551. // to unconditionally include in API requests. By default, fields with
  5552. // empty values are omitted from API requests. However, any non-pointer,
  5553. // non-interface field appearing in ForceSendFields will be sent to the
  5554. // server regardless of whether the field is empty or not. This may be
  5555. // used to include empty fields in Patch requests.
  5556. ForceSendFields []string `json:"-"`
  5557. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5558. // include in API requests with the JSON null value. By default, fields
  5559. // with empty values are omitted from API requests. However, any field
  5560. // with an empty value appearing in NullFields will be sent to the
  5561. // server as null. It is an error if a field in this list has a
  5562. // non-empty value. This may be used to include null fields in Patch
  5563. // requests.
  5564. NullFields []string `json:"-"`
  5565. }
  5566. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5567. type NoMethod EncryptionInfo
  5568. raw := NoMethod(*s)
  5569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5570. }
  5571. // EventTag: Contains properties of an event tag.
  5572. type EventTag struct {
  5573. // AccountId: Account ID of this event tag. This is a read-only field
  5574. // that can be left blank.
  5575. AccountId int64 `json:"accountId,omitempty,string"`
  5576. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5577. // campaignId field is required on insertion.
  5578. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5579. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5580. // advertiser. This is a read-only, auto-generated field.
  5581. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5582. // CampaignId: Campaign ID of this event tag. This field or the
  5583. // advertiserId field is required on insertion.
  5584. CampaignId int64 `json:"campaignId,omitempty,string"`
  5585. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5586. // This is a read-only, auto-generated field.
  5587. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5588. // EnabledByDefault: Whether this event tag should be automatically
  5589. // enabled for all of the advertiser's campaigns and ads.
  5590. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5591. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5592. // that are trafficked through DoubleClick Bid Manager to Ad Exchange.
  5593. // This may be useful if the event tag uses a pixel that is unapproved
  5594. // for Ad Exchange bids on one or more networks, such as the Google
  5595. // Display Network.
  5596. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5597. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5598. Id int64 `json:"id,omitempty,string"`
  5599. // Kind: Identifies what kind of resource this is. Value: the fixed
  5600. // string "dfareporting#eventTag".
  5601. Kind string `json:"kind,omitempty"`
  5602. // Name: Name of this event tag. This is a required field and must be
  5603. // less than 256 characters long.
  5604. Name string `json:"name,omitempty"`
  5605. // SiteFilterType: Site filter type for this event tag. If no type is
  5606. // specified then the event tag will be applied to all sites.
  5607. //
  5608. // Possible values:
  5609. // "BLACKLIST"
  5610. // "WHITELIST"
  5611. SiteFilterType string `json:"siteFilterType,omitempty"`
  5612. // SiteIds: Filter list of site IDs associated with this event tag. The
  5613. // siteFilterType determines whether this is a whitelist or blacklist
  5614. // filter.
  5615. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5616. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5617. // read-only field.
  5618. SslCompliant bool `json:"sslCompliant,omitempty"`
  5619. // Status: Status of this event tag. Must be ENABLED for this event tag
  5620. // to fire. This is a required field.
  5621. //
  5622. // Possible values:
  5623. // "DISABLED"
  5624. // "ENABLED"
  5625. Status string `json:"status,omitempty"`
  5626. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5627. // field that can be left blank.
  5628. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5629. // Type: Event tag type. Can be used to specify whether to use a
  5630. // third-party pixel, a third-party JavaScript URL, or a third-party
  5631. // click-through URL for either impression or click tracking. This is a
  5632. // required field.
  5633. //
  5634. // Possible values:
  5635. // "CLICK_THROUGH_EVENT_TAG"
  5636. // "IMPRESSION_IMAGE_EVENT_TAG"
  5637. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5638. Type string `json:"type,omitempty"`
  5639. // Url: Payload URL for this event tag. The URL on a click-through event
  5640. // tag should have a landing page URL appended to the end of it. This
  5641. // field is required on insertion.
  5642. Url string `json:"url,omitempty"`
  5643. // UrlEscapeLevels: Number of times the landing page URL should be
  5644. // URL-escaped before being appended to the click-through event tag URL.
  5645. // Only applies to click-through event tags as specified by the event
  5646. // tag type.
  5647. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5648. // ServerResponse contains the HTTP response code and headers from the
  5649. // server.
  5650. googleapi.ServerResponse `json:"-"`
  5651. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5652. // unconditionally include in API requests. By default, fields with
  5653. // empty values are omitted from API requests. However, any non-pointer,
  5654. // non-interface field appearing in ForceSendFields will be sent to the
  5655. // server regardless of whether the field is empty or not. This may be
  5656. // used to include empty fields in Patch requests.
  5657. ForceSendFields []string `json:"-"`
  5658. // NullFields is a list of field names (e.g. "AccountId") to include in
  5659. // API requests with the JSON null value. By default, fields with empty
  5660. // values are omitted from API requests. However, any field with an
  5661. // empty value appearing in NullFields will be sent to the server as
  5662. // null. It is an error if a field in this list has a non-empty value.
  5663. // This may be used to include null fields in Patch requests.
  5664. NullFields []string `json:"-"`
  5665. }
  5666. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5667. type NoMethod EventTag
  5668. raw := NoMethod(*s)
  5669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5670. }
  5671. // EventTagOverride: Event tag override information.
  5672. type EventTagOverride struct {
  5673. // Enabled: Whether this override is enabled.
  5674. Enabled bool `json:"enabled,omitempty"`
  5675. // Id: ID of this event tag override. This is a read-only,
  5676. // auto-generated field.
  5677. Id int64 `json:"id,omitempty,string"`
  5678. // ForceSendFields is a list of field names (e.g. "Enabled") 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. "Enabled") to include in
  5686. // API 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 *EventTagOverride) MarshalJSON() ([]byte, error) {
  5694. type NoMethod EventTagOverride
  5695. raw := NoMethod(*s)
  5696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5697. }
  5698. // EventTagsListResponse: Event Tag List Response
  5699. type EventTagsListResponse struct {
  5700. // EventTags: Event tag collection.
  5701. EventTags []*EventTag `json:"eventTags,omitempty"`
  5702. // Kind: Identifies what kind of resource this is. Value: the fixed
  5703. // string "dfareporting#eventTagsListResponse".
  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. "EventTags") to
  5709. // unconditionally include in API requests. By default, fields with
  5710. // empty values are omitted from API requests. However, any non-pointer,
  5711. // non-interface field appearing in ForceSendFields will be sent to the
  5712. // server regardless of whether the field is empty or not. This may be
  5713. // used to include empty fields in Patch requests.
  5714. ForceSendFields []string `json:"-"`
  5715. // NullFields is a list of field names (e.g. "EventTags") to include in
  5716. // API requests with the JSON null value. By default, fields with empty
  5717. // values are omitted from API requests. However, any field with an
  5718. // empty value appearing in NullFields will be sent to the server as
  5719. // null. It is an error if a field in this list has a non-empty value.
  5720. // This may be used to include null fields in Patch requests.
  5721. NullFields []string `json:"-"`
  5722. }
  5723. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  5724. type NoMethod EventTagsListResponse
  5725. raw := NoMethod(*s)
  5726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5727. }
  5728. // File: Represents a File resource. A file contains the metadata for a
  5729. // report run. It shows the status of the run and holds the URLs to the
  5730. // generated report data if the run is finished and the status is
  5731. // "REPORT_AVAILABLE".
  5732. type File struct {
  5733. // DateRange: The date range for which the file has report data. The
  5734. // date range will always be the absolute date range for which the
  5735. // report is run.
  5736. DateRange *DateRange `json:"dateRange,omitempty"`
  5737. // Etag: The eTag of this response for caching purposes.
  5738. Etag string `json:"etag,omitempty"`
  5739. // FileName: The filename of the file.
  5740. FileName string `json:"fileName,omitempty"`
  5741. // Format: The output format of the report. Only available once the file
  5742. // is available.
  5743. //
  5744. // Possible values:
  5745. // "CSV"
  5746. // "EXCEL"
  5747. Format string `json:"format,omitempty"`
  5748. // Id: The unique ID of this report file.
  5749. Id int64 `json:"id,omitempty,string"`
  5750. // Kind: The kind of resource this is, in this case dfareporting#file.
  5751. Kind string `json:"kind,omitempty"`
  5752. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  5753. // file was last modified.
  5754. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  5755. // ReportId: The ID of the report this file was generated from.
  5756. ReportId int64 `json:"reportId,omitempty,string"`
  5757. // Status: The status of the report file.
  5758. //
  5759. // Possible values:
  5760. // "CANCELLED"
  5761. // "FAILED"
  5762. // "PROCESSING"
  5763. // "REPORT_AVAILABLE"
  5764. Status string `json:"status,omitempty"`
  5765. // Urls: The URLs where the completed report file can be downloaded.
  5766. Urls *FileUrls `json:"urls,omitempty"`
  5767. // ServerResponse contains the HTTP response code and headers from the
  5768. // server.
  5769. googleapi.ServerResponse `json:"-"`
  5770. // ForceSendFields is a list of field names (e.g. "DateRange") to
  5771. // unconditionally include in API requests. By default, fields with
  5772. // empty values are omitted from API requests. However, any non-pointer,
  5773. // non-interface field appearing in ForceSendFields will be sent to the
  5774. // server regardless of whether the field is empty or not. This may be
  5775. // used to include empty fields in Patch requests.
  5776. ForceSendFields []string `json:"-"`
  5777. // NullFields is a list of field names (e.g. "DateRange") to include in
  5778. // API requests with the JSON null value. By default, fields with empty
  5779. // values are omitted from API requests. However, any field with an
  5780. // empty value appearing in NullFields will be sent to the server as
  5781. // null. It is an error if a field in this list has a non-empty value.
  5782. // This may be used to include null fields in Patch requests.
  5783. NullFields []string `json:"-"`
  5784. }
  5785. func (s *File) MarshalJSON() ([]byte, error) {
  5786. type NoMethod File
  5787. raw := NoMethod(*s)
  5788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5789. }
  5790. // FileUrls: The URLs where the completed report file can be downloaded.
  5791. type FileUrls struct {
  5792. // ApiUrl: The URL for downloading the report data through the API.
  5793. ApiUrl string `json:"apiUrl,omitempty"`
  5794. // BrowserUrl: The URL for downloading the report data through a
  5795. // browser.
  5796. BrowserUrl string `json:"browserUrl,omitempty"`
  5797. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  5798. // unconditionally include in API requests. By default, fields with
  5799. // empty values are omitted from API requests. However, any non-pointer,
  5800. // non-interface field appearing in ForceSendFields will be sent to the
  5801. // server regardless of whether the field is empty or not. This may be
  5802. // used to include empty fields in Patch requests.
  5803. ForceSendFields []string `json:"-"`
  5804. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  5805. // requests with the JSON null value. By default, fields with empty
  5806. // values are omitted from API requests. However, any field with an
  5807. // empty value appearing in NullFields will be sent to the server as
  5808. // null. It is an error if a field in this list has a non-empty value.
  5809. // This may be used to include null fields in Patch requests.
  5810. NullFields []string `json:"-"`
  5811. }
  5812. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  5813. type NoMethod FileUrls
  5814. raw := NoMethod(*s)
  5815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5816. }
  5817. // FileList: Represents the list of File resources.
  5818. type FileList struct {
  5819. // Etag: The eTag of this response for caching purposes.
  5820. Etag string `json:"etag,omitempty"`
  5821. // Items: The files returned in this response.
  5822. Items []*File `json:"items,omitempty"`
  5823. // Kind: The kind of list this is, in this case dfareporting#fileList.
  5824. Kind string `json:"kind,omitempty"`
  5825. // NextPageToken: Continuation token used to page through files. To
  5826. // retrieve the next page of results, set the next request's "pageToken"
  5827. // to the value of this field. The page token is only valid for a
  5828. // limited amount of time and should not be persisted.
  5829. NextPageToken string `json:"nextPageToken,omitempty"`
  5830. // ServerResponse contains the HTTP response code and headers from the
  5831. // server.
  5832. googleapi.ServerResponse `json:"-"`
  5833. // ForceSendFields is a list of field names (e.g. "Etag") to
  5834. // unconditionally include in API requests. By default, fields with
  5835. // empty values are omitted from API requests. However, any non-pointer,
  5836. // non-interface field appearing in ForceSendFields will be sent to the
  5837. // server regardless of whether the field is empty or not. This may be
  5838. // used to include empty fields in Patch requests.
  5839. ForceSendFields []string `json:"-"`
  5840. // NullFields is a list of field names (e.g. "Etag") to include in API
  5841. // requests with the JSON null value. By default, fields with empty
  5842. // values are omitted from API requests. However, any field with an
  5843. // empty value appearing in NullFields will be sent to the server as
  5844. // null. It is an error if a field in this list has a non-empty value.
  5845. // This may be used to include null fields in Patch requests.
  5846. NullFields []string `json:"-"`
  5847. }
  5848. func (s *FileList) MarshalJSON() ([]byte, error) {
  5849. type NoMethod FileList
  5850. raw := NoMethod(*s)
  5851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5852. }
  5853. // Flight: Flight
  5854. type Flight struct {
  5855. // EndDate: Inventory item flight end date.
  5856. EndDate string `json:"endDate,omitempty"`
  5857. // RateOrCost: Rate or cost of this flight.
  5858. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  5859. // StartDate: Inventory item flight start date.
  5860. StartDate string `json:"startDate,omitempty"`
  5861. // Units: Units of this flight.
  5862. Units int64 `json:"units,omitempty,string"`
  5863. // ForceSendFields is a list of field names (e.g. "EndDate") to
  5864. // unconditionally include in API requests. By default, fields with
  5865. // empty values are omitted from API requests. However, any non-pointer,
  5866. // non-interface field appearing in ForceSendFields will be sent to the
  5867. // server regardless of whether the field is empty or not. This may be
  5868. // used to include empty fields in Patch requests.
  5869. ForceSendFields []string `json:"-"`
  5870. // NullFields is a list of field names (e.g. "EndDate") to include in
  5871. // API requests with the JSON null value. By default, fields with empty
  5872. // values are omitted from API requests. However, any field with an
  5873. // empty value appearing in NullFields will be sent to the server as
  5874. // null. It is an error if a field in this list has a non-empty value.
  5875. // This may be used to include null fields in Patch requests.
  5876. NullFields []string `json:"-"`
  5877. }
  5878. func (s *Flight) MarshalJSON() ([]byte, error) {
  5879. type NoMethod Flight
  5880. raw := NoMethod(*s)
  5881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5882. }
  5883. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  5884. // GenerateTag Response
  5885. type FloodlightActivitiesGenerateTagResponse struct {
  5886. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  5887. // For global site tags, this is the event snippet.
  5888. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  5889. // Kind: Identifies what kind of resource this is. Value: the fixed
  5890. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  5891. Kind string `json:"kind,omitempty"`
  5892. // ServerResponse contains the HTTP response code and headers from the
  5893. // server.
  5894. googleapi.ServerResponse `json:"-"`
  5895. // ForceSendFields is a list of field names (e.g.
  5896. // "FloodlightActivityTag") to unconditionally include in API requests.
  5897. // By default, fields with empty values are omitted from API requests.
  5898. // However, any non-pointer, non-interface field appearing in
  5899. // ForceSendFields will be sent to the server regardless of whether the
  5900. // field is empty or not. This may be used to include empty fields in
  5901. // Patch requests.
  5902. ForceSendFields []string `json:"-"`
  5903. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  5904. // include in API requests with the JSON null value. By default, fields
  5905. // with empty values are omitted from API requests. However, any field
  5906. // with an empty value appearing in NullFields will be sent to the
  5907. // server as null. It is an error if a field in this list has a
  5908. // non-empty value. This may be used to include null fields in Patch
  5909. // requests.
  5910. NullFields []string `json:"-"`
  5911. }
  5912. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  5913. type NoMethod FloodlightActivitiesGenerateTagResponse
  5914. raw := NoMethod(*s)
  5915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5916. }
  5917. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  5918. type FloodlightActivitiesListResponse struct {
  5919. // FloodlightActivities: Floodlight activity collection.
  5920. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  5921. // Kind: Identifies what kind of resource this is. Value: the fixed
  5922. // string "dfareporting#floodlightActivitiesListResponse".
  5923. Kind string `json:"kind,omitempty"`
  5924. // NextPageToken: Pagination token to be used for the next list
  5925. // operation.
  5926. NextPageToken string `json:"nextPageToken,omitempty"`
  5927. // ServerResponse contains the HTTP response code and headers from the
  5928. // server.
  5929. googleapi.ServerResponse `json:"-"`
  5930. // ForceSendFields is a list of field names (e.g.
  5931. // "FloodlightActivities") to unconditionally include in API requests.
  5932. // By default, fields with empty values are omitted from API requests.
  5933. // However, any non-pointer, non-interface field appearing in
  5934. // ForceSendFields will be sent to the server regardless of whether the
  5935. // field is empty or not. This may be used to include empty fields in
  5936. // Patch requests.
  5937. ForceSendFields []string `json:"-"`
  5938. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  5939. // include in API requests with the JSON null value. By default, fields
  5940. // with empty values are omitted from API requests. However, any field
  5941. // with an empty value appearing in NullFields will be sent to the
  5942. // server as null. It is an error if a field in this list has a
  5943. // non-empty value. This may be used to include null fields in Patch
  5944. // requests.
  5945. NullFields []string `json:"-"`
  5946. }
  5947. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  5948. type NoMethod FloodlightActivitiesListResponse
  5949. raw := NoMethod(*s)
  5950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5951. }
  5952. // FloodlightActivity: Contains properties of a Floodlight activity.
  5953. type FloodlightActivity struct {
  5954. // AccountId: Account ID of this floodlight activity. This is a
  5955. // read-only field that can be left blank.
  5956. AccountId int64 `json:"accountId,omitempty,string"`
  5957. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  5958. // field is left blank, the value will be copied over either from the
  5959. // activity group's advertiser or the existing activity's advertiser.
  5960. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5961. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5962. // advertiser. This is a read-only, auto-generated field.
  5963. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5964. // CacheBustingType: Code type used for cache busting in the generated
  5965. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  5966. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  5967. //
  5968. // Possible values:
  5969. // "ACTIVE_SERVER_PAGE"
  5970. // "COLD_FUSION"
  5971. // "JAVASCRIPT"
  5972. // "JSP"
  5973. // "PHP"
  5974. CacheBustingType string `json:"cacheBustingType,omitempty"`
  5975. // CountingMethod: Counting method for conversions for this floodlight
  5976. // activity. This is a required field.
  5977. //
  5978. // Possible values:
  5979. // "ITEMS_SOLD_COUNTING"
  5980. // "SESSION_COUNTING"
  5981. // "STANDARD_COUNTING"
  5982. // "TRANSACTIONS_COUNTING"
  5983. // "UNIQUE_COUNTING"
  5984. CountingMethod string `json:"countingMethod,omitempty"`
  5985. // DefaultTags: Dynamic floodlight tags.
  5986. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  5987. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  5988. // be less than 256 characters long.
  5989. ExpectedUrl string `json:"expectedUrl,omitempty"`
  5990. // FloodlightActivityGroupId: Floodlight activity group ID of this
  5991. // floodlight activity. This is a required field.
  5992. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  5993. // FloodlightActivityGroupName: Name of the associated floodlight
  5994. // activity group. This is a read-only field.
  5995. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  5996. // FloodlightActivityGroupTagString: Tag string of the associated
  5997. // floodlight activity group. This is a read-only field.
  5998. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  5999. // FloodlightActivityGroupType: Type of the associated floodlight
  6000. // activity group. This is a read-only field.
  6001. //
  6002. // Possible values:
  6003. // "COUNTER"
  6004. // "SALE"
  6005. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6006. // FloodlightConfigurationId: Floodlight configuration ID of this
  6007. // floodlight activity. If this field is left blank, the value will be
  6008. // copied over either from the activity group's floodlight configuration
  6009. // or from the existing activity's floodlight configuration.
  6010. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6011. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6012. // of the floodlight configuration. This is a read-only, auto-generated
  6013. // field.
  6014. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6015. // Hidden: Whether this activity is archived.
  6016. Hidden bool `json:"hidden,omitempty"`
  6017. // Id: ID of this floodlight activity. This is a read-only,
  6018. // auto-generated field.
  6019. Id int64 `json:"id,omitempty,string"`
  6020. // IdDimensionValue: Dimension value for the ID of this floodlight
  6021. // activity. This is a read-only, auto-generated field.
  6022. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6023. // ImageTagEnabled: Whether the image tag is enabled for this activity.
  6024. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  6025. // Kind: Identifies what kind of resource this is. Value: the fixed
  6026. // string "dfareporting#floodlightActivity".
  6027. Kind string `json:"kind,omitempty"`
  6028. // Name: Name of this floodlight activity. This is a required field.
  6029. // Must be less than 129 characters long and cannot contain quotes.
  6030. Name string `json:"name,omitempty"`
  6031. // Notes: General notes or implementation instructions for the tag.
  6032. Notes string `json:"notes,omitempty"`
  6033. // PublisherTags: Publisher dynamic floodlight tags.
  6034. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6035. // Secure: Whether this tag should use SSL.
  6036. Secure bool `json:"secure,omitempty"`
  6037. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6038. // is a read-only field, its value detected by the system from the
  6039. // floodlight tags.
  6040. SslCompliant bool `json:"sslCompliant,omitempty"`
  6041. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6042. SslRequired bool `json:"sslRequired,omitempty"`
  6043. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6044. // read-only field that can be left blank.
  6045. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6046. // TagFormat: Tag format type for the floodlight activity. If left
  6047. // blank, the tag format will default to HTML.
  6048. //
  6049. // Possible values:
  6050. // "HTML"
  6051. // "XHTML"
  6052. TagFormat string `json:"tagFormat,omitempty"`
  6053. // TagString: Value of the cat= parameter in the floodlight tag, which
  6054. // the ad servers use to identify the activity. This is optional: if
  6055. // empty, a new tag string will be generated for you. This string must
  6056. // be 1 to 8 characters long, with valid characters being
  6057. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6058. // activities of the same activity group. This field is read-only after
  6059. // insertion.
  6060. TagString string `json:"tagString,omitempty"`
  6061. // UserDefinedVariableTypes: List of the user-defined variables used by
  6062. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6063. // of these can have a user defined type.
  6064. // Acceptable values are U1 to U100, inclusive.
  6065. //
  6066. // Possible values:
  6067. // "U1"
  6068. // "U10"
  6069. // "U100"
  6070. // "U11"
  6071. // "U12"
  6072. // "U13"
  6073. // "U14"
  6074. // "U15"
  6075. // "U16"
  6076. // "U17"
  6077. // "U18"
  6078. // "U19"
  6079. // "U2"
  6080. // "U20"
  6081. // "U21"
  6082. // "U22"
  6083. // "U23"
  6084. // "U24"
  6085. // "U25"
  6086. // "U26"
  6087. // "U27"
  6088. // "U28"
  6089. // "U29"
  6090. // "U3"
  6091. // "U30"
  6092. // "U31"
  6093. // "U32"
  6094. // "U33"
  6095. // "U34"
  6096. // "U35"
  6097. // "U36"
  6098. // "U37"
  6099. // "U38"
  6100. // "U39"
  6101. // "U4"
  6102. // "U40"
  6103. // "U41"
  6104. // "U42"
  6105. // "U43"
  6106. // "U44"
  6107. // "U45"
  6108. // "U46"
  6109. // "U47"
  6110. // "U48"
  6111. // "U49"
  6112. // "U5"
  6113. // "U50"
  6114. // "U51"
  6115. // "U52"
  6116. // "U53"
  6117. // "U54"
  6118. // "U55"
  6119. // "U56"
  6120. // "U57"
  6121. // "U58"
  6122. // "U59"
  6123. // "U6"
  6124. // "U60"
  6125. // "U61"
  6126. // "U62"
  6127. // "U63"
  6128. // "U64"
  6129. // "U65"
  6130. // "U66"
  6131. // "U67"
  6132. // "U68"
  6133. // "U69"
  6134. // "U7"
  6135. // "U70"
  6136. // "U71"
  6137. // "U72"
  6138. // "U73"
  6139. // "U74"
  6140. // "U75"
  6141. // "U76"
  6142. // "U77"
  6143. // "U78"
  6144. // "U79"
  6145. // "U8"
  6146. // "U80"
  6147. // "U81"
  6148. // "U82"
  6149. // "U83"
  6150. // "U84"
  6151. // "U85"
  6152. // "U86"
  6153. // "U87"
  6154. // "U88"
  6155. // "U89"
  6156. // "U9"
  6157. // "U90"
  6158. // "U91"
  6159. // "U92"
  6160. // "U93"
  6161. // "U94"
  6162. // "U95"
  6163. // "U96"
  6164. // "U97"
  6165. // "U98"
  6166. // "U99"
  6167. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6168. // ServerResponse contains the HTTP response code and headers from the
  6169. // server.
  6170. googleapi.ServerResponse `json:"-"`
  6171. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6172. // unconditionally include in API requests. By default, fields with
  6173. // empty values are omitted from API requests. However, any non-pointer,
  6174. // non-interface field appearing in ForceSendFields will be sent to the
  6175. // server regardless of whether the field is empty or not. This may be
  6176. // used to include empty fields in Patch requests.
  6177. ForceSendFields []string `json:"-"`
  6178. // NullFields is a list of field names (e.g. "AccountId") to include in
  6179. // API requests with the JSON null value. By default, fields with empty
  6180. // values are omitted from API requests. However, any field with an
  6181. // empty value appearing in NullFields will be sent to the server as
  6182. // null. It is an error if a field in this list has a non-empty value.
  6183. // This may be used to include null fields in Patch requests.
  6184. NullFields []string `json:"-"`
  6185. }
  6186. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6187. type NoMethod FloodlightActivity
  6188. raw := NoMethod(*s)
  6189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6190. }
  6191. // FloodlightActivityDynamicTag: Dynamic Tag
  6192. type FloodlightActivityDynamicTag struct {
  6193. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6194. // field.
  6195. Id int64 `json:"id,omitempty,string"`
  6196. // Name: Name of this tag.
  6197. Name string `json:"name,omitempty"`
  6198. // Tag: Tag code.
  6199. Tag string `json:"tag,omitempty"`
  6200. // ForceSendFields is a list of field names (e.g. "Id") to
  6201. // unconditionally include in API requests. By default, fields with
  6202. // empty values are omitted from API requests. However, any non-pointer,
  6203. // non-interface field appearing in ForceSendFields will be sent to the
  6204. // server regardless of whether the field is empty or not. This may be
  6205. // used to include empty fields in Patch requests.
  6206. ForceSendFields []string `json:"-"`
  6207. // NullFields is a list of field names (e.g. "Id") to include in API
  6208. // requests with the JSON null value. By default, fields with empty
  6209. // values are omitted from API requests. However, any field with an
  6210. // empty value appearing in NullFields will be sent to the server as
  6211. // null. It is an error if a field in this list has a non-empty value.
  6212. // This may be used to include null fields in Patch requests.
  6213. NullFields []string `json:"-"`
  6214. }
  6215. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6216. type NoMethod FloodlightActivityDynamicTag
  6217. raw := NoMethod(*s)
  6218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6219. }
  6220. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6221. // group.
  6222. type FloodlightActivityGroup struct {
  6223. // AccountId: Account ID of this floodlight activity group. This is a
  6224. // read-only field that can be left blank.
  6225. AccountId int64 `json:"accountId,omitempty,string"`
  6226. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6227. // this field is left blank, the value will be copied over either from
  6228. // the floodlight configuration's advertiser or from the existing
  6229. // activity group's advertiser.
  6230. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6231. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6232. // advertiser. This is a read-only, auto-generated field.
  6233. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6234. // FloodlightConfigurationId: Floodlight configuration ID of this
  6235. // floodlight activity group. This is a required field.
  6236. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6237. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6238. // of the floodlight configuration. This is a read-only, auto-generated
  6239. // field.
  6240. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6241. // Id: ID of this floodlight activity group. This is a read-only,
  6242. // auto-generated field.
  6243. Id int64 `json:"id,omitempty,string"`
  6244. // IdDimensionValue: Dimension value for the ID of this floodlight
  6245. // activity group. This is a read-only, auto-generated field.
  6246. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6247. // Kind: Identifies what kind of resource this is. Value: the fixed
  6248. // string "dfareporting#floodlightActivityGroup".
  6249. Kind string `json:"kind,omitempty"`
  6250. // Name: Name of this floodlight activity group. This is a required
  6251. // field. Must be less than 65 characters long and cannot contain
  6252. // quotes.
  6253. Name string `json:"name,omitempty"`
  6254. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6255. // is a read-only field that can be left blank.
  6256. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6257. // TagString: Value of the type= parameter in the floodlight tag, which
  6258. // the ad servers use to identify the activity group that the activity
  6259. // belongs to. This is optional: if empty, a new tag string will be
  6260. // generated for you. This string must be 1 to 8 characters long, with
  6261. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6262. // also be unique among activity groups of the same floodlight
  6263. // configuration. This field is read-only after insertion.
  6264. TagString string `json:"tagString,omitempty"`
  6265. // Type: Type of the floodlight activity group. This is a required field
  6266. // that is read-only after insertion.
  6267. //
  6268. // Possible values:
  6269. // "COUNTER"
  6270. // "SALE"
  6271. Type string `json:"type,omitempty"`
  6272. // ServerResponse contains the HTTP response code and headers from the
  6273. // server.
  6274. googleapi.ServerResponse `json:"-"`
  6275. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6276. // unconditionally include in API requests. By default, fields with
  6277. // empty values are omitted from API requests. However, any non-pointer,
  6278. // non-interface field appearing in ForceSendFields will be sent to the
  6279. // server regardless of whether the field is empty or not. This may be
  6280. // used to include empty fields in Patch requests.
  6281. ForceSendFields []string `json:"-"`
  6282. // NullFields is a list of field names (e.g. "AccountId") to include in
  6283. // API requests with the JSON null value. By default, fields with empty
  6284. // values are omitted from API requests. However, any field with an
  6285. // empty value appearing in NullFields will be sent to the server as
  6286. // null. It is an error if a field in this list has a non-empty value.
  6287. // This may be used to include null fields in Patch requests.
  6288. NullFields []string `json:"-"`
  6289. }
  6290. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6291. type NoMethod FloodlightActivityGroup
  6292. raw := NoMethod(*s)
  6293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6294. }
  6295. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6296. // Response
  6297. type FloodlightActivityGroupsListResponse struct {
  6298. // FloodlightActivityGroups: Floodlight activity group collection.
  6299. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6300. // Kind: Identifies what kind of resource this is. Value: the fixed
  6301. // string "dfareporting#floodlightActivityGroupsListResponse".
  6302. Kind string `json:"kind,omitempty"`
  6303. // NextPageToken: Pagination token to be used for the next list
  6304. // operation.
  6305. NextPageToken string `json:"nextPageToken,omitempty"`
  6306. // ServerResponse contains the HTTP response code and headers from the
  6307. // server.
  6308. googleapi.ServerResponse `json:"-"`
  6309. // ForceSendFields is a list of field names (e.g.
  6310. // "FloodlightActivityGroups") to unconditionally include in API
  6311. // requests. By default, fields with empty values are omitted from API
  6312. // requests. However, any non-pointer, non-interface field appearing in
  6313. // ForceSendFields will be sent to the server regardless of whether the
  6314. // field is empty or not. This may be used to include empty fields in
  6315. // Patch requests.
  6316. ForceSendFields []string `json:"-"`
  6317. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6318. // to include in API requests with the JSON null value. By default,
  6319. // fields with empty values are omitted from API requests. However, any
  6320. // field with an empty value appearing in NullFields will be sent to the
  6321. // server as null. It is an error if a field in this list has a
  6322. // non-empty value. This may be used to include null fields in Patch
  6323. // requests.
  6324. NullFields []string `json:"-"`
  6325. }
  6326. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6327. type NoMethod FloodlightActivityGroupsListResponse
  6328. raw := NoMethod(*s)
  6329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6330. }
  6331. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6332. type FloodlightActivityPublisherDynamicTag struct {
  6333. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6334. ClickThrough bool `json:"clickThrough,omitempty"`
  6335. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6336. // write-only field that can be used as an alternative to the siteId
  6337. // field. When this resource is retrieved, only the siteId field will be
  6338. // populated.
  6339. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6340. // DynamicTag: Dynamic floodlight tag.
  6341. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6342. // SiteId: Site ID of this dynamic tag.
  6343. SiteId int64 `json:"siteId,omitempty,string"`
  6344. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6345. // a read-only, auto-generated field.
  6346. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6347. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6348. ViewThrough bool `json:"viewThrough,omitempty"`
  6349. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6350. // unconditionally include in API requests. By default, fields with
  6351. // empty values are omitted from API requests. However, any non-pointer,
  6352. // non-interface field appearing in ForceSendFields will be sent to the
  6353. // server regardless of whether the field is empty or not. This may be
  6354. // used to include empty fields in Patch requests.
  6355. ForceSendFields []string `json:"-"`
  6356. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6357. // in API requests with the JSON null value. By default, fields with
  6358. // empty values are omitted from API requests. However, any field with
  6359. // an empty value appearing in NullFields will be sent to the server as
  6360. // null. It is an error if a field in this list has a non-empty value.
  6361. // This may be used to include null fields in Patch requests.
  6362. NullFields []string `json:"-"`
  6363. }
  6364. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6365. type NoMethod FloodlightActivityPublisherDynamicTag
  6366. raw := NoMethod(*s)
  6367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6368. }
  6369. // FloodlightConfiguration: Contains properties of a Floodlight
  6370. // configuration.
  6371. type FloodlightConfiguration struct {
  6372. // AccountId: Account ID of this floodlight configuration. This is a
  6373. // read-only field that can be left blank.
  6374. AccountId int64 `json:"accountId,omitempty,string"`
  6375. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6376. // floodlight configuration.
  6377. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6378. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6379. // advertiser. This is a read-only, auto-generated field.
  6380. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6381. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6382. // Google Analytics.
  6383. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6384. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6385. // report is enabled. This report shows detailed pathway information on
  6386. // up to 10 of the most recent ad exposures seen by a user before
  6387. // converting.
  6388. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6389. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6390. // in reports. This is a required field.
  6391. //
  6392. // Possible values:
  6393. // "MONDAY"
  6394. // "SUNDAY"
  6395. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6396. // Id: ID of this floodlight configuration. This is a read-only,
  6397. // auto-generated field.
  6398. Id int64 `json:"id,omitempty,string"`
  6399. // IdDimensionValue: Dimension value for the ID of this floodlight
  6400. // configuration. This is a read-only, auto-generated field.
  6401. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6402. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6403. // is enabled.
  6404. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6405. // Kind: Identifies what kind of resource this is. Value: the fixed
  6406. // string "dfareporting#floodlightConfiguration".
  6407. Kind string `json:"kind,omitempty"`
  6408. // LookbackConfiguration: Lookback window settings for this floodlight
  6409. // configuration.
  6410. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6411. // NaturalSearchConversionAttributionOption: Types of attribution
  6412. // options for natural search conversions.
  6413. //
  6414. // Possible values:
  6415. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6416. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6417. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6418. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6419. // OmnitureSettings: Settings for DCM Omniture integration.
  6420. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6421. // StandardVariableTypes: List of standard variables enabled for this
  6422. // configuration.
  6423. //
  6424. // Acceptable values are:
  6425. // - "ORD"
  6426. // - "NUM"
  6427. //
  6428. // Possible values:
  6429. // "NUM"
  6430. // "ORD"
  6431. // "TRAN"
  6432. // "U"
  6433. StandardVariableTypes []string `json:"standardVariableTypes,omitempty"`
  6434. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6435. // a read-only field that can be left blank.
  6436. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6437. // TagSettings: Configuration settings for dynamic and image floodlight
  6438. // tags.
  6439. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6440. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6441. // tokens enabled for this configuration.
  6442. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6443. // UserDefinedVariableConfigurations: List of user defined variables
  6444. // enabled for this configuration.
  6445. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6446. // ServerResponse contains the HTTP response code and headers from the
  6447. // server.
  6448. googleapi.ServerResponse `json:"-"`
  6449. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6450. // unconditionally include in API requests. By default, fields with
  6451. // empty values are omitted from API requests. However, any non-pointer,
  6452. // non-interface field appearing in ForceSendFields will be sent to the
  6453. // server regardless of whether the field is empty or not. This may be
  6454. // used to include empty fields in Patch requests.
  6455. ForceSendFields []string `json:"-"`
  6456. // NullFields is a list of field names (e.g. "AccountId") to include in
  6457. // API requests with the JSON null value. By default, fields with empty
  6458. // values are omitted from API requests. However, any field with an
  6459. // empty value appearing in NullFields will be sent to the server as
  6460. // null. It is an error if a field in this list has a non-empty value.
  6461. // This may be used to include null fields in Patch requests.
  6462. NullFields []string `json:"-"`
  6463. }
  6464. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6465. type NoMethod FloodlightConfiguration
  6466. raw := NoMethod(*s)
  6467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6468. }
  6469. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6470. // Response
  6471. type FloodlightConfigurationsListResponse struct {
  6472. // FloodlightConfigurations: Floodlight configuration collection.
  6473. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6474. // Kind: Identifies what kind of resource this is. Value: the fixed
  6475. // string "dfareporting#floodlightConfigurationsListResponse".
  6476. Kind string `json:"kind,omitempty"`
  6477. // ServerResponse contains the HTTP response code and headers from the
  6478. // server.
  6479. googleapi.ServerResponse `json:"-"`
  6480. // ForceSendFields is a list of field names (e.g.
  6481. // "FloodlightConfigurations") to unconditionally include in API
  6482. // requests. By default, fields with empty values are omitted from API
  6483. // requests. However, any non-pointer, non-interface field appearing in
  6484. // ForceSendFields will be sent to the server regardless of whether the
  6485. // field is empty or not. This may be used to include empty fields in
  6486. // Patch requests.
  6487. ForceSendFields []string `json:"-"`
  6488. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6489. // to include in API requests with the JSON null value. By default,
  6490. // fields with empty values are omitted from API requests. However, any
  6491. // field with an empty value appearing in NullFields will be sent to the
  6492. // server as null. It is an error if a field in this list has a
  6493. // non-empty value. This may be used to include null fields in Patch
  6494. // requests.
  6495. NullFields []string `json:"-"`
  6496. }
  6497. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6498. type NoMethod FloodlightConfigurationsListResponse
  6499. raw := NoMethod(*s)
  6500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6501. }
  6502. // FloodlightReportCompatibleFields: Represents fields that are
  6503. // compatible to be selected for a report of type "FlOODLIGHT".
  6504. type FloodlightReportCompatibleFields struct {
  6505. // DimensionFilters: Dimensions which are compatible to be selected in
  6506. // the "dimensionFilters" section of the report.
  6507. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6508. // Dimensions: Dimensions which are compatible to be selected in the
  6509. // "dimensions" section of the report.
  6510. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6511. // Kind: The kind of resource this is, in this case
  6512. // dfareporting#floodlightReportCompatibleFields.
  6513. Kind string `json:"kind,omitempty"`
  6514. // Metrics: Metrics which are compatible to be selected in the
  6515. // "metricNames" section of the report.
  6516. Metrics []*Metric `json:"metrics,omitempty"`
  6517. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6518. // unconditionally include in API requests. By default, fields with
  6519. // empty values are omitted from API requests. However, any non-pointer,
  6520. // non-interface field appearing in ForceSendFields will be sent to the
  6521. // server regardless of whether the field is empty or not. This may be
  6522. // used to include empty fields in Patch requests.
  6523. ForceSendFields []string `json:"-"`
  6524. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6525. // include in API requests with the JSON null value. By default, fields
  6526. // with empty values are omitted from API requests. However, any field
  6527. // with an empty value appearing in NullFields will be sent to the
  6528. // server as null. It is an error if a field in this list has a
  6529. // non-empty value. This may be used to include null fields in Patch
  6530. // requests.
  6531. NullFields []string `json:"-"`
  6532. }
  6533. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6534. type NoMethod FloodlightReportCompatibleFields
  6535. raw := NoMethod(*s)
  6536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6537. }
  6538. // FrequencyCap: Frequency Cap.
  6539. type FrequencyCap struct {
  6540. // Duration: Duration of time, in seconds, for this frequency cap. The
  6541. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6542. // inclusive.
  6543. Duration int64 `json:"duration,omitempty,string"`
  6544. // Impressions: Number of times an individual user can be served the ad
  6545. // within the specified duration. Acceptable values are 1 to 15,
  6546. // inclusive.
  6547. Impressions int64 `json:"impressions,omitempty,string"`
  6548. // ForceSendFields is a list of field names (e.g. "Duration") to
  6549. // unconditionally include in API requests. By default, fields with
  6550. // empty values are omitted from API requests. However, any non-pointer,
  6551. // non-interface field appearing in ForceSendFields will be sent to the
  6552. // server regardless of whether the field is empty or not. This may be
  6553. // used to include empty fields in Patch requests.
  6554. ForceSendFields []string `json:"-"`
  6555. // NullFields is a list of field names (e.g. "Duration") to include in
  6556. // API requests with the JSON null value. By default, fields with empty
  6557. // values are omitted from API requests. However, any field with an
  6558. // empty value appearing in NullFields will be sent to the server as
  6559. // null. It is an error if a field in this list has a non-empty value.
  6560. // This may be used to include null fields in Patch requests.
  6561. NullFields []string `json:"-"`
  6562. }
  6563. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6564. type NoMethod FrequencyCap
  6565. raw := NoMethod(*s)
  6566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6567. }
  6568. // FsCommand: FsCommand.
  6569. type FsCommand struct {
  6570. // Left: Distance from the left of the browser.Applicable when
  6571. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6572. Left int64 `json:"left,omitempty"`
  6573. // PositionOption: Position in the browser where the window will open.
  6574. //
  6575. // Possible values:
  6576. // "CENTERED"
  6577. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6578. PositionOption string `json:"positionOption,omitempty"`
  6579. // Top: Distance from the top of the browser. Applicable when
  6580. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6581. Top int64 `json:"top,omitempty"`
  6582. // WindowHeight: Height of the window.
  6583. WindowHeight int64 `json:"windowHeight,omitempty"`
  6584. // WindowWidth: Width of the window.
  6585. WindowWidth int64 `json:"windowWidth,omitempty"`
  6586. // ForceSendFields is a list of field names (e.g. "Left") to
  6587. // unconditionally include in API requests. By default, fields with
  6588. // empty values are omitted from API requests. However, any non-pointer,
  6589. // non-interface field appearing in ForceSendFields will be sent to the
  6590. // server regardless of whether the field is empty or not. This may be
  6591. // used to include empty fields in Patch requests.
  6592. ForceSendFields []string `json:"-"`
  6593. // NullFields is a list of field names (e.g. "Left") to include in API
  6594. // requests with the JSON null value. By default, fields with empty
  6595. // values are omitted from API requests. However, any field with an
  6596. // empty value appearing in NullFields will be sent to the server as
  6597. // null. It is an error if a field in this list has a non-empty value.
  6598. // This may be used to include null fields in Patch requests.
  6599. NullFields []string `json:"-"`
  6600. }
  6601. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6602. type NoMethod FsCommand
  6603. raw := NoMethod(*s)
  6604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6605. }
  6606. // GeoTargeting: Geographical Targeting.
  6607. type GeoTargeting struct {
  6608. // Cities: Cities to be targeted. For each city only dartId is required.
  6609. // The other fields are populated automatically when the ad is inserted
  6610. // or updated. If targeting a city, do not target or exclude the country
  6611. // of the city, and do not target the metro or region of the city.
  6612. Cities []*City `json:"cities,omitempty"`
  6613. // Countries: Countries to be targeted or excluded from targeting,
  6614. // depending on the setting of the excludeCountries field. For each
  6615. // country only dartId is required. The other fields are populated
  6616. // automatically when the ad is inserted or updated. If targeting or
  6617. // excluding a country, do not target regions, cities, metros, or postal
  6618. // codes in the same country.
  6619. Countries []*Country `json:"countries,omitempty"`
  6620. // ExcludeCountries: Whether or not to exclude the countries in the
  6621. // countries field from targeting. If false, the countries field refers
  6622. // to countries which will be targeted by the ad.
  6623. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6624. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6625. // The other fields are populated automatically when the ad is inserted
  6626. // or updated. If targeting a metro, do not target or exclude the
  6627. // country of the metro.
  6628. Metros []*Metro `json:"metros,omitempty"`
  6629. // PostalCodes: Postal codes to be targeted. For each postal code only
  6630. // id is required. The other fields are populated automatically when the
  6631. // ad is inserted or updated. If targeting a postal code, do not target
  6632. // or exclude the country of the postal code.
  6633. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6634. // Regions: Regions to be targeted. For each region only dartId is
  6635. // required. The other fields are populated automatically when the ad is
  6636. // inserted or updated. If targeting a region, do not target or exclude
  6637. // the country of the region.
  6638. Regions []*Region `json:"regions,omitempty"`
  6639. // ForceSendFields is a list of field names (e.g. "Cities") to
  6640. // unconditionally include in API requests. By default, fields with
  6641. // empty values are omitted from API requests. However, any non-pointer,
  6642. // non-interface field appearing in ForceSendFields will be sent to the
  6643. // server regardless of whether the field is empty or not. This may be
  6644. // used to include empty fields in Patch requests.
  6645. ForceSendFields []string `json:"-"`
  6646. // NullFields is a list of field names (e.g. "Cities") to include in API
  6647. // requests with the JSON null value. By default, fields with empty
  6648. // values are omitted from API requests. However, any field with an
  6649. // empty value appearing in NullFields will be sent to the server as
  6650. // null. It is an error if a field in this list has a non-empty value.
  6651. // This may be used to include null fields in Patch requests.
  6652. NullFields []string `json:"-"`
  6653. }
  6654. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6655. type NoMethod GeoTargeting
  6656. raw := NoMethod(*s)
  6657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6658. }
  6659. // InventoryItem: Represents a buy from the DoubleClick Planning
  6660. // inventory store.
  6661. type InventoryItem struct {
  6662. // AccountId: Account ID of this inventory item.
  6663. AccountId int64 `json:"accountId,omitempty,string"`
  6664. // AdSlots: Ad slots of this inventory item. If this inventory item
  6665. // represents a standalone placement, there will be exactly one ad slot.
  6666. // If this inventory item represents a placement group, there will be
  6667. // more than one ad slot, each representing one child placement in that
  6668. // placement group.
  6669. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6670. // AdvertiserId: Advertiser ID of this inventory item.
  6671. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6672. // ContentCategoryId: Content category ID of this inventory item.
  6673. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6674. // EstimatedClickThroughRate: Estimated click-through rate of this
  6675. // inventory item.
  6676. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6677. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6678. // item.
  6679. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  6680. // Id: ID of this inventory item.
  6681. Id int64 `json:"id,omitempty,string"`
  6682. // InPlan: Whether this inventory item is in plan.
  6683. InPlan bool `json:"inPlan,omitempty"`
  6684. // Kind: Identifies what kind of resource this is. Value: the fixed
  6685. // string "dfareporting#inventoryItem".
  6686. Kind string `json:"kind,omitempty"`
  6687. // LastModifiedInfo: Information about the most recent modification of
  6688. // this inventory item.
  6689. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  6690. // Name: Name of this inventory item. For standalone inventory items,
  6691. // this is the same name as that of its only ad slot. For group
  6692. // inventory items, this can differ from the name of any of its ad
  6693. // slots.
  6694. Name string `json:"name,omitempty"`
  6695. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  6696. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  6697. // OrderId: Order ID of this inventory item.
  6698. OrderId int64 `json:"orderId,omitempty,string"`
  6699. // PlacementStrategyId: Placement strategy ID of this inventory item.
  6700. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  6701. // Pricing: Pricing of this inventory item.
  6702. Pricing *Pricing `json:"pricing,omitempty"`
  6703. // ProjectId: Project ID of this inventory item.
  6704. ProjectId int64 `json:"projectId,omitempty,string"`
  6705. // RfpId: RFP ID of this inventory item.
  6706. RfpId int64 `json:"rfpId,omitempty,string"`
  6707. // SiteId: ID of the site this inventory item is associated with.
  6708. SiteId int64 `json:"siteId,omitempty,string"`
  6709. // SubaccountId: Subaccount ID of this inventory item.
  6710. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6711. // Type: Type of inventory item.
  6712. //
  6713. // Possible values:
  6714. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  6715. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  6716. Type string `json:"type,omitempty"`
  6717. // ServerResponse contains the HTTP response code and headers from the
  6718. // server.
  6719. googleapi.ServerResponse `json:"-"`
  6720. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6721. // unconditionally include in API requests. By default, fields with
  6722. // empty values are omitted from API requests. However, any non-pointer,
  6723. // non-interface field appearing in ForceSendFields will be sent to the
  6724. // server regardless of whether the field is empty or not. This may be
  6725. // used to include empty fields in Patch requests.
  6726. ForceSendFields []string `json:"-"`
  6727. // NullFields is a list of field names (e.g. "AccountId") to include in
  6728. // API requests with the JSON null value. By default, fields with empty
  6729. // values are omitted from API requests. However, any field with an
  6730. // empty value appearing in NullFields will be sent to the server as
  6731. // null. It is an error if a field in this list has a non-empty value.
  6732. // This may be used to include null fields in Patch requests.
  6733. NullFields []string `json:"-"`
  6734. }
  6735. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  6736. type NoMethod InventoryItem
  6737. raw := NoMethod(*s)
  6738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6739. }
  6740. // InventoryItemsListResponse: Inventory item List Response
  6741. type InventoryItemsListResponse struct {
  6742. // InventoryItems: Inventory item collection
  6743. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  6744. // Kind: Identifies what kind of resource this is. Value: the fixed
  6745. // string "dfareporting#inventoryItemsListResponse".
  6746. Kind string `json:"kind,omitempty"`
  6747. // NextPageToken: Pagination token to be used for the next list
  6748. // operation.
  6749. NextPageToken string `json:"nextPageToken,omitempty"`
  6750. // ServerResponse contains the HTTP response code and headers from the
  6751. // server.
  6752. googleapi.ServerResponse `json:"-"`
  6753. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  6754. // unconditionally include in API requests. By default, fields with
  6755. // empty values are omitted from API requests. However, any non-pointer,
  6756. // non-interface field appearing in ForceSendFields will be sent to the
  6757. // server regardless of whether the field is empty or not. This may be
  6758. // used to include empty fields in Patch requests.
  6759. ForceSendFields []string `json:"-"`
  6760. // NullFields is a list of field names (e.g. "InventoryItems") to
  6761. // include in API requests with the JSON null value. By default, fields
  6762. // with empty values are omitted from API requests. However, any field
  6763. // with an empty value appearing in NullFields will be sent to the
  6764. // server as null. It is an error if a field in this list has a
  6765. // non-empty value. This may be used to include null fields in Patch
  6766. // requests.
  6767. NullFields []string `json:"-"`
  6768. }
  6769. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  6770. type NoMethod InventoryItemsListResponse
  6771. raw := NoMethod(*s)
  6772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6773. }
  6774. // KeyValueTargetingExpression: Key Value Targeting Expression.
  6775. type KeyValueTargetingExpression struct {
  6776. // Expression: Keyword expression being targeted by the ad.
  6777. Expression string `json:"expression,omitempty"`
  6778. // ForceSendFields is a list of field names (e.g. "Expression") to
  6779. // unconditionally include in API requests. By default, fields with
  6780. // empty values are omitted from API requests. However, any non-pointer,
  6781. // non-interface field appearing in ForceSendFields will be sent to the
  6782. // server regardless of whether the field is empty or not. This may be
  6783. // used to include empty fields in Patch requests.
  6784. ForceSendFields []string `json:"-"`
  6785. // NullFields is a list of field names (e.g. "Expression") to include in
  6786. // API requests with the JSON null value. By default, fields with empty
  6787. // values are omitted from API requests. However, any field with an
  6788. // empty value appearing in NullFields will be sent to the server as
  6789. // null. It is an error if a field in this list has a non-empty value.
  6790. // This may be used to include null fields in Patch requests.
  6791. NullFields []string `json:"-"`
  6792. }
  6793. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  6794. type NoMethod KeyValueTargetingExpression
  6795. raw := NoMethod(*s)
  6796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6797. }
  6798. // LandingPage: Contains information about where a user's browser is
  6799. // taken after the user clicks an ad.
  6800. type LandingPage struct {
  6801. // Default: Whether or not this landing page will be assigned to any ads
  6802. // or creatives that do not have a landing page assigned explicitly.
  6803. // Only one default landing page is allowed per campaign.
  6804. Default bool `json:"default,omitempty"`
  6805. // Id: ID of this landing page. This is a read-only, auto-generated
  6806. // field.
  6807. Id int64 `json:"id,omitempty,string"`
  6808. // Kind: Identifies what kind of resource this is. Value: the fixed
  6809. // string "dfareporting#landingPage".
  6810. Kind string `json:"kind,omitempty"`
  6811. // Name: Name of this landing page. This is a required field. It must be
  6812. // less than 256 characters long, and must be unique among landing pages
  6813. // of the same campaign.
  6814. Name string `json:"name,omitempty"`
  6815. // Url: URL of this landing page. This is a required field.
  6816. Url string `json:"url,omitempty"`
  6817. // ServerResponse contains the HTTP response code and headers from the
  6818. // server.
  6819. googleapi.ServerResponse `json:"-"`
  6820. // ForceSendFields is a list of field names (e.g. "Default") to
  6821. // unconditionally include in API requests. By default, fields with
  6822. // empty values are omitted from API requests. However, any non-pointer,
  6823. // non-interface field appearing in ForceSendFields will be sent to the
  6824. // server regardless of whether the field is empty or not. This may be
  6825. // used to include empty fields in Patch requests.
  6826. ForceSendFields []string `json:"-"`
  6827. // NullFields is a list of field names (e.g. "Default") to include in
  6828. // API requests with the JSON null value. By default, fields with empty
  6829. // values are omitted from API requests. However, any field with an
  6830. // empty value appearing in NullFields will be sent to the server as
  6831. // null. It is an error if a field in this list has a non-empty value.
  6832. // This may be used to include null fields in Patch requests.
  6833. NullFields []string `json:"-"`
  6834. }
  6835. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  6836. type NoMethod LandingPage
  6837. raw := NoMethod(*s)
  6838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6839. }
  6840. // LandingPagesListResponse: Landing Page List Response
  6841. type LandingPagesListResponse struct {
  6842. // Kind: Identifies what kind of resource this is. Value: the fixed
  6843. // string "dfareporting#landingPagesListResponse".
  6844. Kind string `json:"kind,omitempty"`
  6845. // LandingPages: Landing page collection
  6846. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  6847. // ServerResponse contains the HTTP response code and headers from the
  6848. // server.
  6849. googleapi.ServerResponse `json:"-"`
  6850. // ForceSendFields is a list of field names (e.g. "Kind") to
  6851. // unconditionally include in API requests. By default, fields with
  6852. // empty values are omitted from API requests. However, any non-pointer,
  6853. // non-interface field appearing in ForceSendFields will be sent to the
  6854. // server regardless of whether the field is empty or not. This may be
  6855. // used to include empty fields in Patch requests.
  6856. ForceSendFields []string `json:"-"`
  6857. // NullFields is a list of field names (e.g. "Kind") to include in API
  6858. // requests with the JSON null value. By default, fields with empty
  6859. // values are omitted from API requests. However, any field with an
  6860. // empty value appearing in NullFields will be sent to the server as
  6861. // null. It is an error if a field in this list has a non-empty value.
  6862. // This may be used to include null fields in Patch requests.
  6863. NullFields []string `json:"-"`
  6864. }
  6865. func (s *LandingPagesListResponse) MarshalJSON() ([]byte, error) {
  6866. type NoMethod LandingPagesListResponse
  6867. raw := NoMethod(*s)
  6868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6869. }
  6870. // Language: Contains information about a language that can be targeted
  6871. // by ads.
  6872. type Language struct {
  6873. // Id: Language ID of this language. This is the ID used for targeting
  6874. // and generating reports.
  6875. Id int64 `json:"id,omitempty,string"`
  6876. // Kind: Identifies what kind of resource this is. Value: the fixed
  6877. // string "dfareporting#language".
  6878. Kind string `json:"kind,omitempty"`
  6879. // LanguageCode: Format of language code is an ISO 639 two-letter
  6880. // language code optionally followed by an underscore followed by an ISO
  6881. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  6882. // Chinese.
  6883. LanguageCode string `json:"languageCode,omitempty"`
  6884. // Name: Name of this language.
  6885. Name string `json:"name,omitempty"`
  6886. // ForceSendFields is a list of field names (e.g. "Id") to
  6887. // unconditionally include in API requests. By default, fields with
  6888. // empty values are omitted from API requests. However, any non-pointer,
  6889. // non-interface field appearing in ForceSendFields will be sent to the
  6890. // server regardless of whether the field is empty or not. This may be
  6891. // used to include empty fields in Patch requests.
  6892. ForceSendFields []string `json:"-"`
  6893. // NullFields is a list of field names (e.g. "Id") to include in API
  6894. // requests with the JSON null value. By default, fields with empty
  6895. // values are omitted from API requests. However, any field with an
  6896. // empty value appearing in NullFields will be sent to the server as
  6897. // null. It is an error if a field in this list has a non-empty value.
  6898. // This may be used to include null fields in Patch requests.
  6899. NullFields []string `json:"-"`
  6900. }
  6901. func (s *Language) MarshalJSON() ([]byte, error) {
  6902. type NoMethod Language
  6903. raw := NoMethod(*s)
  6904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6905. }
  6906. // LanguageTargeting: Language Targeting.
  6907. type LanguageTargeting struct {
  6908. // Languages: Languages that this ad targets. For each language only
  6909. // languageId is required. The other fields are populated automatically
  6910. // when the ad is inserted or updated.
  6911. Languages []*Language `json:"languages,omitempty"`
  6912. // ForceSendFields is a list of field names (e.g. "Languages") to
  6913. // unconditionally include in API requests. By default, fields with
  6914. // empty values are omitted from API requests. However, any non-pointer,
  6915. // non-interface field appearing in ForceSendFields will be sent to the
  6916. // server regardless of whether the field is empty or not. This may be
  6917. // used to include empty fields in Patch requests.
  6918. ForceSendFields []string `json:"-"`
  6919. // NullFields is a list of field names (e.g. "Languages") to include in
  6920. // API requests with the JSON null value. By default, fields with empty
  6921. // values are omitted from API requests. However, any field with an
  6922. // empty value appearing in NullFields will be sent to the server as
  6923. // null. It is an error if a field in this list has a non-empty value.
  6924. // This may be used to include null fields in Patch requests.
  6925. NullFields []string `json:"-"`
  6926. }
  6927. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  6928. type NoMethod LanguageTargeting
  6929. raw := NoMethod(*s)
  6930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6931. }
  6932. // LanguagesListResponse: Language List Response
  6933. type LanguagesListResponse struct {
  6934. // Kind: Identifies what kind of resource this is. Value: the fixed
  6935. // string "dfareporting#languagesListResponse".
  6936. Kind string `json:"kind,omitempty"`
  6937. // Languages: Language collection.
  6938. Languages []*Language `json:"languages,omitempty"`
  6939. // ServerResponse contains the HTTP response code and headers from the
  6940. // server.
  6941. googleapi.ServerResponse `json:"-"`
  6942. // ForceSendFields is a list of field names (e.g. "Kind") to
  6943. // unconditionally include in API requests. By default, fields with
  6944. // empty values are omitted from API requests. However, any non-pointer,
  6945. // non-interface field appearing in ForceSendFields will be sent to the
  6946. // server regardless of whether the field is empty or not. This may be
  6947. // used to include empty fields in Patch requests.
  6948. ForceSendFields []string `json:"-"`
  6949. // NullFields is a list of field names (e.g. "Kind") to include in API
  6950. // requests with the JSON null value. By default, fields with empty
  6951. // values are omitted from API requests. However, any field with an
  6952. // empty value appearing in NullFields will be sent to the server as
  6953. // null. It is an error if a field in this list has a non-empty value.
  6954. // This may be used to include null fields in Patch requests.
  6955. NullFields []string `json:"-"`
  6956. }
  6957. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  6958. type NoMethod LanguagesListResponse
  6959. raw := NoMethod(*s)
  6960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6961. }
  6962. // LastModifiedInfo: Modification timestamp.
  6963. type LastModifiedInfo struct {
  6964. // Time: Timestamp of the last change in milliseconds since epoch.
  6965. Time int64 `json:"time,omitempty,string"`
  6966. // ForceSendFields is a list of field names (e.g. "Time") to
  6967. // unconditionally include in API requests. By default, fields with
  6968. // empty values are omitted from API requests. However, any non-pointer,
  6969. // non-interface field appearing in ForceSendFields will be sent to the
  6970. // server regardless of whether the field is empty or not. This may be
  6971. // used to include empty fields in Patch requests.
  6972. ForceSendFields []string `json:"-"`
  6973. // NullFields is a list of field names (e.g. "Time") to include in API
  6974. // requests with the JSON null value. By default, fields with empty
  6975. // values are omitted from API requests. However, any field with an
  6976. // empty value appearing in NullFields will be sent to the server as
  6977. // null. It is an error if a field in this list has a non-empty value.
  6978. // This may be used to include null fields in Patch requests.
  6979. NullFields []string `json:"-"`
  6980. }
  6981. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  6982. type NoMethod LastModifiedInfo
  6983. raw := NoMethod(*s)
  6984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6985. }
  6986. // ListPopulationClause: A group clause made up of list population terms
  6987. // representing constraints joined by ORs.
  6988. type ListPopulationClause struct {
  6989. // Terms: Terms of this list population clause. Each clause is made up
  6990. // of list population terms representing constraints and are joined by
  6991. // ORs.
  6992. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  6993. // ForceSendFields is a list of field names (e.g. "Terms") to
  6994. // unconditionally include in API requests. By default, fields with
  6995. // empty values are omitted from API requests. However, any non-pointer,
  6996. // non-interface field appearing in ForceSendFields will be sent to the
  6997. // server regardless of whether the field is empty or not. This may be
  6998. // used to include empty fields in Patch requests.
  6999. ForceSendFields []string `json:"-"`
  7000. // NullFields is a list of field names (e.g. "Terms") to include in API
  7001. // requests with the JSON null value. By default, fields with empty
  7002. // values are omitted from API requests. However, any field with an
  7003. // empty value appearing in NullFields will be sent to the server as
  7004. // null. It is an error if a field in this list has a non-empty value.
  7005. // This may be used to include null fields in Patch requests.
  7006. NullFields []string `json:"-"`
  7007. }
  7008. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7009. type NoMethod ListPopulationClause
  7010. raw := NoMethod(*s)
  7011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7012. }
  7013. // ListPopulationRule: Remarketing List Population Rule.
  7014. type ListPopulationRule struct {
  7015. // FloodlightActivityId: Floodlight activity ID associated with this
  7016. // rule. This field can be left blank.
  7017. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7018. // FloodlightActivityName: Name of floodlight activity associated with
  7019. // this rule. This is a read-only, auto-generated field.
  7020. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7021. // ListPopulationClauses: Clauses that make up this list population
  7022. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7023. // up of list population terms which are joined by ORs.
  7024. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7025. // ForceSendFields is a list of field names (e.g.
  7026. // "FloodlightActivityId") to unconditionally include in API requests.
  7027. // By default, fields with empty values are omitted from API requests.
  7028. // However, any non-pointer, non-interface field appearing in
  7029. // ForceSendFields will be sent to the server regardless of whether the
  7030. // field is empty or not. This may be used to include empty fields in
  7031. // Patch requests.
  7032. ForceSendFields []string `json:"-"`
  7033. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7034. // include in API requests with the JSON null value. By default, fields
  7035. // with empty values are omitted from API requests. However, any field
  7036. // with an empty value appearing in NullFields will be sent to the
  7037. // server as null. It is an error if a field in this list has a
  7038. // non-empty value. This may be used to include null fields in Patch
  7039. // requests.
  7040. NullFields []string `json:"-"`
  7041. }
  7042. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7043. type NoMethod ListPopulationRule
  7044. raw := NoMethod(*s)
  7045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7046. }
  7047. // ListPopulationTerm: Remarketing List Population Rule Term.
  7048. type ListPopulationTerm struct {
  7049. // Contains: Will be true if the term should check if the user is in the
  7050. // list and false if the term should check if the user is not in the
  7051. // list. This field is only relevant when type is set to
  7052. // LIST_MEMBERSHIP_TERM. False by default.
  7053. Contains bool `json:"contains,omitempty"`
  7054. // Negation: Whether to negate the comparison result of this term during
  7055. // rule evaluation. This field is only relevant when type is left unset
  7056. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7057. Negation bool `json:"negation,omitempty"`
  7058. // Operator: Comparison operator of this term. This field is only
  7059. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7060. // REFERRER_TERM.
  7061. //
  7062. // Possible values:
  7063. // "NUM_EQUALS"
  7064. // "NUM_GREATER_THAN"
  7065. // "NUM_GREATER_THAN_EQUAL"
  7066. // "NUM_LESS_THAN"
  7067. // "NUM_LESS_THAN_EQUAL"
  7068. // "STRING_CONTAINS"
  7069. // "STRING_EQUALS"
  7070. Operator string `json:"operator,omitempty"`
  7071. // RemarketingListId: ID of the list in question. This field is only
  7072. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7073. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7074. // Type: List population term type determines the applicable fields in
  7075. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7076. // variableName, variableFriendlyName, operator, value, and negation are
  7077. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7078. // contains are applicable. If set to REFERRER_TERM then operator,
  7079. // value, and negation are applicable.
  7080. //
  7081. // Possible values:
  7082. // "CUSTOM_VARIABLE_TERM"
  7083. // "LIST_MEMBERSHIP_TERM"
  7084. // "REFERRER_TERM"
  7085. Type string `json:"type,omitempty"`
  7086. // Value: Literal to compare the variable to. This field is only
  7087. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7088. // REFERRER_TERM.
  7089. Value string `json:"value,omitempty"`
  7090. // VariableFriendlyName: Friendly name of this term's variable. This is
  7091. // a read-only, auto-generated field. This field is only relevant when
  7092. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7093. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7094. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7095. // this term. This field is only relevant when type is set to null,
  7096. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7097. VariableName string `json:"variableName,omitempty"`
  7098. // ForceSendFields is a list of field names (e.g. "Contains") to
  7099. // unconditionally include in API requests. By default, fields with
  7100. // empty values are omitted from API requests. However, any non-pointer,
  7101. // non-interface field appearing in ForceSendFields will be sent to the
  7102. // server regardless of whether the field is empty or not. This may be
  7103. // used to include empty fields in Patch requests.
  7104. ForceSendFields []string `json:"-"`
  7105. // NullFields is a list of field names (e.g. "Contains") to include in
  7106. // API requests with the JSON null value. By default, fields with empty
  7107. // values are omitted from API requests. However, any field with an
  7108. // empty value appearing in NullFields will be sent to the server as
  7109. // null. It is an error if a field in this list has a non-empty value.
  7110. // This may be used to include null fields in Patch requests.
  7111. NullFields []string `json:"-"`
  7112. }
  7113. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7114. type NoMethod ListPopulationTerm
  7115. raw := NoMethod(*s)
  7116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7117. }
  7118. // ListTargetingExpression: Remarketing List Targeting Expression.
  7119. type ListTargetingExpression struct {
  7120. // Expression: Expression describing which lists are being targeted by
  7121. // the ad.
  7122. Expression string `json:"expression,omitempty"`
  7123. // ForceSendFields is a list of field names (e.g. "Expression") to
  7124. // unconditionally include in API requests. By default, fields with
  7125. // empty values are omitted from API requests. However, any non-pointer,
  7126. // non-interface field appearing in ForceSendFields will be sent to the
  7127. // server regardless of whether the field is empty or not. This may be
  7128. // used to include empty fields in Patch requests.
  7129. ForceSendFields []string `json:"-"`
  7130. // NullFields is a list of field names (e.g. "Expression") to include in
  7131. // API requests with the JSON null value. By default, fields with empty
  7132. // values are omitted from API requests. However, any field with an
  7133. // empty value appearing in NullFields will be sent to the server as
  7134. // null. It is an error if a field in this list has a non-empty value.
  7135. // This may be used to include null fields in Patch requests.
  7136. NullFields []string `json:"-"`
  7137. }
  7138. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7139. type NoMethod ListTargetingExpression
  7140. raw := NoMethod(*s)
  7141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7142. }
  7143. // LookbackConfiguration: Lookback configuration settings.
  7144. type LookbackConfiguration struct {
  7145. // ClickDuration: Lookback window, in days, from the last time a given
  7146. // user clicked on one of your ads. If you enter 0, clicks will not be
  7147. // considered as triggering events for floodlight tracking. If you leave
  7148. // this field blank, the default value for your account will be used.
  7149. // Acceptable values are 0 to 90, inclusive.
  7150. ClickDuration int64 `json:"clickDuration,omitempty"`
  7151. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7152. // last time a given user viewed one of your ads. If you enter 0,
  7153. // impressions will not be considered as triggering events for
  7154. // floodlight tracking. If you leave this field blank, the default value
  7155. // for your account will be used. Acceptable values are 0 to 90,
  7156. // inclusive.
  7157. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7158. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7159. // unconditionally include in API requests. By default, fields with
  7160. // empty values are omitted from API requests. However, any non-pointer,
  7161. // non-interface field appearing in ForceSendFields will be sent to the
  7162. // server regardless of whether the field is empty or not. This may be
  7163. // used to include empty fields in Patch requests.
  7164. ForceSendFields []string `json:"-"`
  7165. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7166. // in API requests with the JSON null value. By default, fields with
  7167. // empty values are omitted from API requests. However, any field with
  7168. // an empty value appearing in NullFields will be sent to the server as
  7169. // null. It is an error if a field in this list has a non-empty value.
  7170. // This may be used to include null fields in Patch requests.
  7171. NullFields []string `json:"-"`
  7172. }
  7173. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7174. type NoMethod LookbackConfiguration
  7175. raw := NoMethod(*s)
  7176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7177. }
  7178. // Metric: Represents a metric.
  7179. type Metric struct {
  7180. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7181. Kind string `json:"kind,omitempty"`
  7182. // Name: The metric name, e.g. dfa:impressions
  7183. Name string `json:"name,omitempty"`
  7184. // ForceSendFields is a list of field names (e.g. "Kind") to
  7185. // unconditionally include in API requests. By default, fields with
  7186. // empty values are omitted from API requests. However, any non-pointer,
  7187. // non-interface field appearing in ForceSendFields will be sent to the
  7188. // server regardless of whether the field is empty or not. This may be
  7189. // used to include empty fields in Patch requests.
  7190. ForceSendFields []string `json:"-"`
  7191. // NullFields is a list of field names (e.g. "Kind") to include in API
  7192. // requests with the JSON null value. By default, fields with empty
  7193. // values are omitted from API requests. However, any field with an
  7194. // empty value appearing in NullFields will be sent to the server as
  7195. // null. It is an error if a field in this list has a non-empty value.
  7196. // This may be used to include null fields in Patch requests.
  7197. NullFields []string `json:"-"`
  7198. }
  7199. func (s *Metric) MarshalJSON() ([]byte, error) {
  7200. type NoMethod Metric
  7201. raw := NoMethod(*s)
  7202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7203. }
  7204. // Metro: Contains information about a metro region that can be targeted
  7205. // by ads.
  7206. type Metro struct {
  7207. // CountryCode: Country code of the country to which this metro region
  7208. // belongs.
  7209. CountryCode string `json:"countryCode,omitempty"`
  7210. // CountryDartId: DART ID of the country to which this metro region
  7211. // belongs.
  7212. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7213. // DartId: DART ID of this metro region.
  7214. DartId int64 `json:"dartId,omitempty,string"`
  7215. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7216. // and generating reports, and is equivalent to metro_code.
  7217. DmaId int64 `json:"dmaId,omitempty,string"`
  7218. // Kind: Identifies what kind of resource this is. Value: the fixed
  7219. // string "dfareporting#metro".
  7220. Kind string `json:"kind,omitempty"`
  7221. // MetroCode: Metro code of this metro region. This is equivalent to
  7222. // dma_id.
  7223. MetroCode string `json:"metroCode,omitempty"`
  7224. // Name: Name of this metro region.
  7225. Name string `json:"name,omitempty"`
  7226. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7227. // unconditionally include in API requests. By default, fields with
  7228. // empty values are omitted from API requests. However, any non-pointer,
  7229. // non-interface field appearing in ForceSendFields will be sent to the
  7230. // server regardless of whether the field is empty or not. This may be
  7231. // used to include empty fields in Patch requests.
  7232. ForceSendFields []string `json:"-"`
  7233. // NullFields is a list of field names (e.g. "CountryCode") to include
  7234. // in API requests with the JSON null value. By default, fields with
  7235. // empty values are omitted from API requests. However, any field with
  7236. // an empty value appearing in NullFields will be sent to the server as
  7237. // null. It is an error if a field in this list has a non-empty value.
  7238. // This may be used to include null fields in Patch requests.
  7239. NullFields []string `json:"-"`
  7240. }
  7241. func (s *Metro) MarshalJSON() ([]byte, error) {
  7242. type NoMethod Metro
  7243. raw := NoMethod(*s)
  7244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7245. }
  7246. // MetrosListResponse: Metro List Response
  7247. type MetrosListResponse struct {
  7248. // Kind: Identifies what kind of resource this is. Value: the fixed
  7249. // string "dfareporting#metrosListResponse".
  7250. Kind string `json:"kind,omitempty"`
  7251. // Metros: Metro collection.
  7252. Metros []*Metro `json:"metros,omitempty"`
  7253. // ServerResponse contains the HTTP response code and headers from the
  7254. // server.
  7255. googleapi.ServerResponse `json:"-"`
  7256. // ForceSendFields is a list of field names (e.g. "Kind") to
  7257. // unconditionally include in API requests. By default, fields with
  7258. // empty values are omitted from API requests. However, any non-pointer,
  7259. // non-interface field appearing in ForceSendFields will be sent to the
  7260. // server regardless of whether the field is empty or not. This may be
  7261. // used to include empty fields in Patch requests.
  7262. ForceSendFields []string `json:"-"`
  7263. // NullFields is a list of field names (e.g. "Kind") to include in API
  7264. // requests with the JSON null value. By default, fields with empty
  7265. // values are omitted from API requests. However, any field with an
  7266. // empty value appearing in NullFields will be sent to the server as
  7267. // null. It is an error if a field in this list has a non-empty value.
  7268. // This may be used to include null fields in Patch requests.
  7269. NullFields []string `json:"-"`
  7270. }
  7271. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7272. type NoMethod MetrosListResponse
  7273. raw := NoMethod(*s)
  7274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7275. }
  7276. // MobileCarrier: Contains information about a mobile carrier that can
  7277. // be targeted by ads.
  7278. type MobileCarrier struct {
  7279. // CountryCode: Country code of the country to which this mobile carrier
  7280. // belongs.
  7281. CountryCode string `json:"countryCode,omitempty"`
  7282. // CountryDartId: DART ID of the country to which this mobile carrier
  7283. // belongs.
  7284. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7285. // Id: ID of this mobile carrier.
  7286. Id int64 `json:"id,omitempty,string"`
  7287. // Kind: Identifies what kind of resource this is. Value: the fixed
  7288. // string "dfareporting#mobileCarrier".
  7289. Kind string `json:"kind,omitempty"`
  7290. // Name: Name of this mobile carrier.
  7291. Name string `json:"name,omitempty"`
  7292. // ServerResponse contains the HTTP response code and headers from the
  7293. // server.
  7294. googleapi.ServerResponse `json:"-"`
  7295. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7296. // unconditionally include in API requests. By default, fields with
  7297. // empty values are omitted from API requests. However, any non-pointer,
  7298. // non-interface field appearing in ForceSendFields will be sent to the
  7299. // server regardless of whether the field is empty or not. This may be
  7300. // used to include empty fields in Patch requests.
  7301. ForceSendFields []string `json:"-"`
  7302. // NullFields is a list of field names (e.g. "CountryCode") to include
  7303. // in API requests with the JSON null value. By default, fields with
  7304. // empty values are omitted from API requests. However, any field with
  7305. // an empty value appearing in NullFields will be sent to the server as
  7306. // null. It is an error if a field in this list has a non-empty value.
  7307. // This may be used to include null fields in Patch requests.
  7308. NullFields []string `json:"-"`
  7309. }
  7310. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7311. type NoMethod MobileCarrier
  7312. raw := NoMethod(*s)
  7313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7314. }
  7315. // MobileCarriersListResponse: Mobile Carrier List Response
  7316. type MobileCarriersListResponse struct {
  7317. // Kind: Identifies what kind of resource this is. Value: the fixed
  7318. // string "dfareporting#mobileCarriersListResponse".
  7319. Kind string `json:"kind,omitempty"`
  7320. // MobileCarriers: Mobile carrier collection.
  7321. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7322. // ServerResponse contains the HTTP response code and headers from the
  7323. // server.
  7324. googleapi.ServerResponse `json:"-"`
  7325. // ForceSendFields is a list of field names (e.g. "Kind") to
  7326. // unconditionally include in API requests. By default, fields with
  7327. // empty values are omitted from API requests. However, any non-pointer,
  7328. // non-interface field appearing in ForceSendFields will be sent to the
  7329. // server regardless of whether the field is empty or not. This may be
  7330. // used to include empty fields in Patch requests.
  7331. ForceSendFields []string `json:"-"`
  7332. // NullFields is a list of field names (e.g. "Kind") to include in API
  7333. // requests with the JSON null value. By default, fields with empty
  7334. // values are omitted from API requests. However, any field with an
  7335. // empty value appearing in NullFields will be sent to the server as
  7336. // null. It is an error if a field in this list has a non-empty value.
  7337. // This may be used to include null fields in Patch requests.
  7338. NullFields []string `json:"-"`
  7339. }
  7340. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7341. type NoMethod MobileCarriersListResponse
  7342. raw := NoMethod(*s)
  7343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7344. }
  7345. // ObjectFilter: Object Filter.
  7346. type ObjectFilter struct {
  7347. // Kind: Identifies what kind of resource this is. Value: the fixed
  7348. // string "dfareporting#objectFilter".
  7349. Kind string `json:"kind,omitempty"`
  7350. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7351. // objects with these object IDs.
  7352. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7353. // Status: Status of the filter. NONE means the user has access to none
  7354. // of the objects. ALL means the user has access to all objects.
  7355. // ASSIGNED means the user has access to the objects with IDs in the
  7356. // objectIds list.
  7357. //
  7358. // Possible values:
  7359. // "ALL"
  7360. // "ASSIGNED"
  7361. // "NONE"
  7362. Status string `json:"status,omitempty"`
  7363. // ForceSendFields is a list of field names (e.g. "Kind") to
  7364. // unconditionally include in API requests. By default, fields with
  7365. // empty values are omitted from API requests. However, any non-pointer,
  7366. // non-interface field appearing in ForceSendFields will be sent to the
  7367. // server regardless of whether the field is empty or not. This may be
  7368. // used to include empty fields in Patch requests.
  7369. ForceSendFields []string `json:"-"`
  7370. // NullFields is a list of field names (e.g. "Kind") to include in API
  7371. // requests with the JSON null value. By default, fields with empty
  7372. // values are omitted from API requests. However, any field with an
  7373. // empty value appearing in NullFields will be sent to the server as
  7374. // null. It is an error if a field in this list has a non-empty value.
  7375. // This may be used to include null fields in Patch requests.
  7376. NullFields []string `json:"-"`
  7377. }
  7378. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7379. type NoMethod ObjectFilter
  7380. raw := NoMethod(*s)
  7381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7382. }
  7383. // OffsetPosition: Offset Position.
  7384. type OffsetPosition struct {
  7385. // Left: Offset distance from left side of an asset or a window.
  7386. Left int64 `json:"left,omitempty"`
  7387. // Top: Offset distance from top side of an asset or a window.
  7388. Top int64 `json:"top,omitempty"`
  7389. // ForceSendFields is a list of field names (e.g. "Left") to
  7390. // unconditionally include in API requests. By default, fields with
  7391. // empty values are omitted from API requests. However, any non-pointer,
  7392. // non-interface field appearing in ForceSendFields will be sent to the
  7393. // server regardless of whether the field is empty or not. This may be
  7394. // used to include empty fields in Patch requests.
  7395. ForceSendFields []string `json:"-"`
  7396. // NullFields is a list of field names (e.g. "Left") to include in API
  7397. // requests with the JSON null value. By default, fields with empty
  7398. // values are omitted from API requests. However, any field with an
  7399. // empty value appearing in NullFields will be sent to the server as
  7400. // null. It is an error if a field in this list has a non-empty value.
  7401. // This may be used to include null fields in Patch requests.
  7402. NullFields []string `json:"-"`
  7403. }
  7404. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7405. type NoMethod OffsetPosition
  7406. raw := NoMethod(*s)
  7407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7408. }
  7409. // OmnitureSettings: Omniture Integration Settings.
  7410. type OmnitureSettings struct {
  7411. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7412. // Omniture. This property can be enabled only if
  7413. // omnitureIntegrationEnabled is true.
  7414. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7415. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7416. // This property can be enabled only when the "Advanced Ad Serving"
  7417. // account setting is enabled.
  7418. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7419. // ForceSendFields is a list of field names (e.g.
  7420. // "OmnitureCostDataEnabled") to unconditionally include in API
  7421. // requests. By default, fields with empty values are omitted from API
  7422. // requests. However, any non-pointer, non-interface field appearing in
  7423. // ForceSendFields will be sent to the server regardless of whether the
  7424. // field is empty or not. This may be used to include empty fields in
  7425. // Patch requests.
  7426. ForceSendFields []string `json:"-"`
  7427. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7428. // to include in API requests with the JSON null value. By default,
  7429. // fields with empty values are omitted from API requests. However, any
  7430. // field with an empty value appearing in NullFields will be sent to the
  7431. // server as null. It is an error if a field in this list has a
  7432. // non-empty value. This may be used to include null fields in Patch
  7433. // requests.
  7434. NullFields []string `json:"-"`
  7435. }
  7436. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7437. type NoMethod OmnitureSettings
  7438. raw := NoMethod(*s)
  7439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7440. }
  7441. // OperatingSystem: Contains information about an operating system that
  7442. // can be targeted by ads.
  7443. type OperatingSystem struct {
  7444. // DartId: DART ID of this operating system. This is the ID used for
  7445. // targeting.
  7446. DartId int64 `json:"dartId,omitempty,string"`
  7447. // Desktop: Whether this operating system is for desktop.
  7448. Desktop bool `json:"desktop,omitempty"`
  7449. // Kind: Identifies what kind of resource this is. Value: the fixed
  7450. // string "dfareporting#operatingSystem".
  7451. Kind string `json:"kind,omitempty"`
  7452. // Mobile: Whether this operating system is for mobile.
  7453. Mobile bool `json:"mobile,omitempty"`
  7454. // Name: Name of this operating system.
  7455. Name string `json:"name,omitempty"`
  7456. // ServerResponse contains the HTTP response code and headers from the
  7457. // server.
  7458. googleapi.ServerResponse `json:"-"`
  7459. // ForceSendFields is a list of field names (e.g. "DartId") to
  7460. // unconditionally include in API requests. By default, fields with
  7461. // empty values are omitted from API requests. However, any non-pointer,
  7462. // non-interface field appearing in ForceSendFields will be sent to the
  7463. // server regardless of whether the field is empty or not. This may be
  7464. // used to include empty fields in Patch requests.
  7465. ForceSendFields []string `json:"-"`
  7466. // NullFields is a list of field names (e.g. "DartId") to include in API
  7467. // requests with the JSON null value. By default, fields with empty
  7468. // values are omitted from API requests. However, any field with an
  7469. // empty value appearing in NullFields will be sent to the server as
  7470. // null. It is an error if a field in this list has a non-empty value.
  7471. // This may be used to include null fields in Patch requests.
  7472. NullFields []string `json:"-"`
  7473. }
  7474. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7475. type NoMethod OperatingSystem
  7476. raw := NoMethod(*s)
  7477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7478. }
  7479. // OperatingSystemVersion: Contains information about a particular
  7480. // version of an operating system that can be targeted by ads.
  7481. type OperatingSystemVersion struct {
  7482. // Id: ID of this operating system version.
  7483. Id int64 `json:"id,omitempty,string"`
  7484. // Kind: Identifies what kind of resource this is. Value: the fixed
  7485. // string "dfareporting#operatingSystemVersion".
  7486. Kind string `json:"kind,omitempty"`
  7487. // MajorVersion: Major version (leftmost number) of this operating
  7488. // system version.
  7489. MajorVersion string `json:"majorVersion,omitempty"`
  7490. // MinorVersion: Minor version (number after the first dot) of this
  7491. // operating system version.
  7492. MinorVersion string `json:"minorVersion,omitempty"`
  7493. // Name: Name of this operating system version.
  7494. Name string `json:"name,omitempty"`
  7495. // OperatingSystem: Operating system of this operating system version.
  7496. OperatingSystem *OperatingSystem `json:"operatingSystem,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. "Id") 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. "Id") 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 *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7516. type NoMethod OperatingSystemVersion
  7517. raw := NoMethod(*s)
  7518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7519. }
  7520. // OperatingSystemVersionsListResponse: Operating System Version List
  7521. // Response
  7522. type OperatingSystemVersionsListResponse struct {
  7523. // Kind: Identifies what kind of resource this is. Value: the fixed
  7524. // string "dfareporting#operatingSystemVersionsListResponse".
  7525. Kind string `json:"kind,omitempty"`
  7526. // OperatingSystemVersions: Operating system version collection.
  7527. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7528. // ServerResponse contains the HTTP response code and headers from the
  7529. // server.
  7530. googleapi.ServerResponse `json:"-"`
  7531. // ForceSendFields is a list of field names (e.g. "Kind") to
  7532. // unconditionally include in API requests. By default, fields with
  7533. // empty values are omitted from API requests. However, any non-pointer,
  7534. // non-interface field appearing in ForceSendFields will be sent to the
  7535. // server regardless of whether the field is empty or not. This may be
  7536. // used to include empty fields in Patch requests.
  7537. ForceSendFields []string `json:"-"`
  7538. // NullFields is a list of field names (e.g. "Kind") to include in API
  7539. // requests with the JSON null value. By default, fields with empty
  7540. // values are omitted from API requests. However, any field with an
  7541. // empty value appearing in NullFields will be sent to the server as
  7542. // null. It is an error if a field in this list has a non-empty value.
  7543. // This may be used to include null fields in Patch requests.
  7544. NullFields []string `json:"-"`
  7545. }
  7546. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7547. type NoMethod OperatingSystemVersionsListResponse
  7548. raw := NoMethod(*s)
  7549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7550. }
  7551. // OperatingSystemsListResponse: Operating System List Response
  7552. type OperatingSystemsListResponse struct {
  7553. // Kind: Identifies what kind of resource this is. Value: the fixed
  7554. // string "dfareporting#operatingSystemsListResponse".
  7555. Kind string `json:"kind,omitempty"`
  7556. // OperatingSystems: Operating system collection.
  7557. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7558. // ServerResponse contains the HTTP response code and headers from the
  7559. // server.
  7560. googleapi.ServerResponse `json:"-"`
  7561. // ForceSendFields is a list of field names (e.g. "Kind") to
  7562. // unconditionally include in API requests. By default, fields with
  7563. // empty values are omitted from API requests. However, any non-pointer,
  7564. // non-interface field appearing in ForceSendFields will be sent to the
  7565. // server regardless of whether the field is empty or not. This may be
  7566. // used to include empty fields in Patch requests.
  7567. ForceSendFields []string `json:"-"`
  7568. // NullFields is a list of field names (e.g. "Kind") to include in API
  7569. // requests with the JSON null value. By default, fields with empty
  7570. // values are omitted from API requests. However, any field with an
  7571. // empty value appearing in NullFields will be sent to the server as
  7572. // null. It is an error if a field in this list has a non-empty value.
  7573. // This may be used to include null fields in Patch requests.
  7574. NullFields []string `json:"-"`
  7575. }
  7576. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7577. type NoMethod OperatingSystemsListResponse
  7578. raw := NoMethod(*s)
  7579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7580. }
  7581. // OptimizationActivity: Creative optimization activity.
  7582. type OptimizationActivity struct {
  7583. // FloodlightActivityId: Floodlight activity ID of this optimization
  7584. // activity. This is a required field.
  7585. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7586. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7587. // floodlight activity. This is a read-only, auto-generated field.
  7588. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7589. // Weight: Weight associated with this optimization. The weight assigned
  7590. // will be understood in proportion to the weights assigned to the other
  7591. // optimization activities. Value must be greater than or equal to 1.
  7592. Weight int64 `json:"weight,omitempty"`
  7593. // ForceSendFields is a list of field names (e.g.
  7594. // "FloodlightActivityId") to unconditionally include in API requests.
  7595. // By default, fields with empty values are omitted from API requests.
  7596. // However, any non-pointer, non-interface field appearing in
  7597. // ForceSendFields will be sent to the server regardless of whether the
  7598. // field is empty or not. This may be used to include empty fields in
  7599. // Patch requests.
  7600. ForceSendFields []string `json:"-"`
  7601. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7602. // include in API requests with the JSON null value. By default, fields
  7603. // with empty values are omitted from API requests. However, any field
  7604. // with an empty value appearing in NullFields will be sent to the
  7605. // server as null. It is an error if a field in this list has a
  7606. // non-empty value. This may be used to include null fields in Patch
  7607. // requests.
  7608. NullFields []string `json:"-"`
  7609. }
  7610. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7611. type NoMethod OptimizationActivity
  7612. raw := NoMethod(*s)
  7613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7614. }
  7615. // Order: Describes properties of a DoubleClick Planning order.
  7616. type Order struct {
  7617. // AccountId: Account ID of this order.
  7618. AccountId int64 `json:"accountId,omitempty,string"`
  7619. // AdvertiserId: Advertiser ID of this order.
  7620. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7621. // ApproverUserProfileIds: IDs for users that have to approve documents
  7622. // created for this order.
  7623. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7624. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7625. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7626. // BuyerOrganizationName: Name of the buyer organization.
  7627. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7628. // Comments: Comments in this order.
  7629. Comments string `json:"comments,omitempty"`
  7630. // Contacts: Contacts for this order.
  7631. Contacts []*OrderContact `json:"contacts,omitempty"`
  7632. // Id: ID of this order. This is a read-only, auto-generated field.
  7633. Id int64 `json:"id,omitempty,string"`
  7634. // Kind: Identifies what kind of resource this is. Value: the fixed
  7635. // string "dfareporting#order".
  7636. Kind string `json:"kind,omitempty"`
  7637. // LastModifiedInfo: Information about the most recent modification of
  7638. // this order.
  7639. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7640. // Name: Name of this order.
  7641. Name string `json:"name,omitempty"`
  7642. // Notes: Notes of this order.
  7643. Notes string `json:"notes,omitempty"`
  7644. // PlanningTermId: ID of the terms and conditions template used in this
  7645. // order.
  7646. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  7647. // ProjectId: Project ID of this order.
  7648. ProjectId int64 `json:"projectId,omitempty,string"`
  7649. // SellerOrderId: Seller order ID associated with this order.
  7650. SellerOrderId string `json:"sellerOrderId,omitempty"`
  7651. // SellerOrganizationName: Name of the seller organization.
  7652. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  7653. // SiteId: Site IDs this order is associated with.
  7654. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  7655. // SiteNames: Free-form site names this order is associated with.
  7656. SiteNames []string `json:"siteNames,omitempty"`
  7657. // SubaccountId: Subaccount ID of this order.
  7658. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7659. // TermsAndConditions: Terms and conditions of this order.
  7660. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  7661. // ServerResponse contains the HTTP response code and headers from the
  7662. // server.
  7663. googleapi.ServerResponse `json:"-"`
  7664. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7665. // unconditionally include in API requests. By default, fields with
  7666. // empty values are omitted from API requests. However, any non-pointer,
  7667. // non-interface field appearing in ForceSendFields will be sent to the
  7668. // server regardless of whether the field is empty or not. This may be
  7669. // used to include empty fields in Patch requests.
  7670. ForceSendFields []string `json:"-"`
  7671. // NullFields is a list of field names (e.g. "AccountId") to include in
  7672. // API requests with the JSON null value. By default, fields with empty
  7673. // values are omitted from API requests. However, any field with an
  7674. // empty value appearing in NullFields will be sent to the server as
  7675. // null. It is an error if a field in this list has a non-empty value.
  7676. // This may be used to include null fields in Patch requests.
  7677. NullFields []string `json:"-"`
  7678. }
  7679. func (s *Order) MarshalJSON() ([]byte, error) {
  7680. type NoMethod Order
  7681. raw := NoMethod(*s)
  7682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7683. }
  7684. // OrderContact: Contact of an order.
  7685. type OrderContact struct {
  7686. // ContactInfo: Free-form information about this contact. It could be
  7687. // any information related to this contact in addition to type, title,
  7688. // name, and signature user profile ID.
  7689. ContactInfo string `json:"contactInfo,omitempty"`
  7690. // ContactName: Name of this contact.
  7691. ContactName string `json:"contactName,omitempty"`
  7692. // ContactTitle: Title of this contact.
  7693. ContactTitle string `json:"contactTitle,omitempty"`
  7694. // ContactType: Type of this contact.
  7695. //
  7696. // Possible values:
  7697. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  7698. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  7699. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  7700. ContactType string `json:"contactType,omitempty"`
  7701. // SignatureUserProfileId: ID of the user profile containing the
  7702. // signature that will be embedded into order documents.
  7703. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  7704. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  7705. // unconditionally include in API requests. By default, fields with
  7706. // empty values are omitted from API requests. However, any non-pointer,
  7707. // non-interface field appearing in ForceSendFields will be sent to the
  7708. // server regardless of whether the field is empty or not. This may be
  7709. // used to include empty fields in Patch requests.
  7710. ForceSendFields []string `json:"-"`
  7711. // NullFields is a list of field names (e.g. "ContactInfo") to include
  7712. // in API requests with the JSON null value. By default, fields with
  7713. // empty values are omitted from API requests. However, any field with
  7714. // an empty value appearing in NullFields will be sent to the server as
  7715. // null. It is an error if a field in this list has a non-empty value.
  7716. // This may be used to include null fields in Patch requests.
  7717. NullFields []string `json:"-"`
  7718. }
  7719. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  7720. type NoMethod OrderContact
  7721. raw := NoMethod(*s)
  7722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7723. }
  7724. // OrderDocument: Contains properties of a DoubleClick Planning order
  7725. // document.
  7726. type OrderDocument struct {
  7727. // AccountId: Account ID of this order document.
  7728. AccountId int64 `json:"accountId,omitempty,string"`
  7729. // AdvertiserId: Advertiser ID of this order document.
  7730. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7731. // AmendedOrderDocumentId: The amended order document ID of this order
  7732. // document. An order document can be created by optionally amending
  7733. // another order document so that the change history can be preserved.
  7734. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  7735. // ApprovedByUserProfileIds: IDs of users who have approved this order
  7736. // document.
  7737. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  7738. // Cancelled: Whether this order document is cancelled.
  7739. Cancelled bool `json:"cancelled,omitempty"`
  7740. // CreatedInfo: Information about the creation of this order document.
  7741. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  7742. // EffectiveDate: Effective date of this order document.
  7743. EffectiveDate string `json:"effectiveDate,omitempty"`
  7744. // Id: ID of this order document.
  7745. Id int64 `json:"id,omitempty,string"`
  7746. // Kind: Identifies what kind of resource this is. Value: the fixed
  7747. // string "dfareporting#orderDocument".
  7748. Kind string `json:"kind,omitempty"`
  7749. // LastSentRecipients: List of email addresses that received the last
  7750. // sent document.
  7751. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  7752. // LastSentTime: Timestamp of the last email sent with this order
  7753. // document.
  7754. LastSentTime string `json:"lastSentTime,omitempty"`
  7755. // OrderId: ID of the order from which this order document is created.
  7756. OrderId int64 `json:"orderId,omitempty,string"`
  7757. // ProjectId: Project ID of this order document.
  7758. ProjectId int64 `json:"projectId,omitempty,string"`
  7759. // Signed: Whether this order document has been signed.
  7760. Signed bool `json:"signed,omitempty"`
  7761. // SubaccountId: Subaccount ID of this order document.
  7762. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7763. // Title: Title of this order document.
  7764. Title string `json:"title,omitempty"`
  7765. // Type: Type of this order document
  7766. //
  7767. // Possible values:
  7768. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  7769. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  7770. Type string `json:"type,omitempty"`
  7771. // ServerResponse contains the HTTP response code and headers from the
  7772. // server.
  7773. googleapi.ServerResponse `json:"-"`
  7774. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7775. // unconditionally include in API requests. By default, fields with
  7776. // empty values are omitted from API requests. However, any non-pointer,
  7777. // non-interface field appearing in ForceSendFields will be sent to the
  7778. // server regardless of whether the field is empty or not. This may be
  7779. // used to include empty fields in Patch requests.
  7780. ForceSendFields []string `json:"-"`
  7781. // NullFields is a list of field names (e.g. "AccountId") to include in
  7782. // API requests with the JSON null value. By default, fields with empty
  7783. // values are omitted from API requests. However, any field with an
  7784. // empty value appearing in NullFields will be sent to the server as
  7785. // null. It is an error if a field in this list has a non-empty value.
  7786. // This may be used to include null fields in Patch requests.
  7787. NullFields []string `json:"-"`
  7788. }
  7789. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  7790. type NoMethod OrderDocument
  7791. raw := NoMethod(*s)
  7792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7793. }
  7794. // OrderDocumentsListResponse: Order document List Response
  7795. type OrderDocumentsListResponse struct {
  7796. // Kind: Identifies what kind of resource this is. Value: the fixed
  7797. // string "dfareporting#orderDocumentsListResponse".
  7798. Kind string `json:"kind,omitempty"`
  7799. // NextPageToken: Pagination token to be used for the next list
  7800. // operation.
  7801. NextPageToken string `json:"nextPageToken,omitempty"`
  7802. // OrderDocuments: Order document collection
  7803. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  7804. // ServerResponse contains the HTTP response code and headers from the
  7805. // server.
  7806. googleapi.ServerResponse `json:"-"`
  7807. // ForceSendFields is a list of field names (e.g. "Kind") to
  7808. // unconditionally include in API requests. By default, fields with
  7809. // empty values are omitted from API requests. However, any non-pointer,
  7810. // non-interface field appearing in ForceSendFields will be sent to the
  7811. // server regardless of whether the field is empty or not. This may be
  7812. // used to include empty fields in Patch requests.
  7813. ForceSendFields []string `json:"-"`
  7814. // NullFields is a list of field names (e.g. "Kind") to include in API
  7815. // requests with the JSON null value. By default, fields with empty
  7816. // values are omitted from API requests. However, any field with an
  7817. // empty value appearing in NullFields will be sent to the server as
  7818. // null. It is an error if a field in this list has a non-empty value.
  7819. // This may be used to include null fields in Patch requests.
  7820. NullFields []string `json:"-"`
  7821. }
  7822. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  7823. type NoMethod OrderDocumentsListResponse
  7824. raw := NoMethod(*s)
  7825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7826. }
  7827. // OrdersListResponse: Order List Response
  7828. type OrdersListResponse struct {
  7829. // Kind: Identifies what kind of resource this is. Value: the fixed
  7830. // string "dfareporting#ordersListResponse".
  7831. Kind string `json:"kind,omitempty"`
  7832. // NextPageToken: Pagination token to be used for the next list
  7833. // operation.
  7834. NextPageToken string `json:"nextPageToken,omitempty"`
  7835. // Orders: Order collection.
  7836. Orders []*Order `json:"orders,omitempty"`
  7837. // ServerResponse contains the HTTP response code and headers from the
  7838. // server.
  7839. googleapi.ServerResponse `json:"-"`
  7840. // ForceSendFields is a list of field names (e.g. "Kind") to
  7841. // unconditionally include in API requests. By default, fields with
  7842. // empty values are omitted from API requests. However, any non-pointer,
  7843. // non-interface field appearing in ForceSendFields will be sent to the
  7844. // server regardless of whether the field is empty or not. This may be
  7845. // used to include empty fields in Patch requests.
  7846. ForceSendFields []string `json:"-"`
  7847. // NullFields is a list of field names (e.g. "Kind") to include in API
  7848. // requests with the JSON null value. By default, fields with empty
  7849. // values are omitted from API requests. However, any field with an
  7850. // empty value appearing in NullFields will be sent to the server as
  7851. // null. It is an error if a field in this list has a non-empty value.
  7852. // This may be used to include null fields in Patch requests.
  7853. NullFields []string `json:"-"`
  7854. }
  7855. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  7856. type NoMethod OrdersListResponse
  7857. raw := NoMethod(*s)
  7858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7859. }
  7860. // PathToConversionReportCompatibleFields: Represents fields that are
  7861. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  7862. type PathToConversionReportCompatibleFields struct {
  7863. // ConversionDimensions: Conversion dimensions which are compatible to
  7864. // be selected in the "conversionDimensions" section of the report.
  7865. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  7866. // CustomFloodlightVariables: Custom floodlight variables which are
  7867. // compatible to be selected in the "customFloodlightVariables" section
  7868. // of the report.
  7869. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  7870. // Kind: The kind of resource this is, in this case
  7871. // dfareporting#pathToConversionReportCompatibleFields.
  7872. Kind string `json:"kind,omitempty"`
  7873. // Metrics: Metrics which are compatible to be selected in the
  7874. // "metricNames" section of the report.
  7875. Metrics []*Metric `json:"metrics,omitempty"`
  7876. // PerInteractionDimensions: Per-interaction dimensions which are
  7877. // compatible to be selected in the "perInteractionDimensions" section
  7878. // of the report.
  7879. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  7880. // ForceSendFields is a list of field names (e.g.
  7881. // "ConversionDimensions") to unconditionally include in API requests.
  7882. // By default, fields with empty values are omitted from API requests.
  7883. // However, any non-pointer, non-interface field appearing in
  7884. // ForceSendFields will be sent to the server regardless of whether the
  7885. // field is empty or not. This may be used to include empty fields in
  7886. // Patch requests.
  7887. ForceSendFields []string `json:"-"`
  7888. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  7889. // include in API requests with the JSON null value. By default, fields
  7890. // with empty values are omitted from API requests. However, any field
  7891. // with an empty value appearing in NullFields will be sent to the
  7892. // server as null. It is an error if a field in this list has a
  7893. // non-empty value. This may be used to include null fields in Patch
  7894. // requests.
  7895. NullFields []string `json:"-"`
  7896. }
  7897. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  7898. type NoMethod PathToConversionReportCompatibleFields
  7899. raw := NoMethod(*s)
  7900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7901. }
  7902. // Placement: Contains properties of a placement.
  7903. type Placement struct {
  7904. // AccountId: Account ID of this placement. This field can be left
  7905. // blank.
  7906. AccountId int64 `json:"accountId,omitempty,string"`
  7907. // AdvertiserId: Advertiser ID of this placement. This field can be left
  7908. // blank.
  7909. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7910. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  7911. // advertiser. This is a read-only, auto-generated field.
  7912. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  7913. // Archived: Whether this placement is archived.
  7914. Archived bool `json:"archived,omitempty"`
  7915. // CampaignId: Campaign ID of this placement. This field is a required
  7916. // field on insertion.
  7917. CampaignId int64 `json:"campaignId,omitempty,string"`
  7918. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  7919. // This is a read-only, auto-generated field.
  7920. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  7921. // Comment: Comments for this placement.
  7922. Comment string `json:"comment,omitempty"`
  7923. // Compatibility: Placement compatibility. DISPLAY and
  7924. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  7925. // or in mobile apps for regular or interstitial ads respectively. APP
  7926. // and APP_INTERSTITIAL are no longer allowed for new placement
  7927. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  7928. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  7929. // with the VAST standard. This field is required on insertion.
  7930. //
  7931. // Possible values:
  7932. // "APP"
  7933. // "APP_INTERSTITIAL"
  7934. // "DISPLAY"
  7935. // "DISPLAY_INTERSTITIAL"
  7936. // "IN_STREAM_VIDEO"
  7937. Compatibility string `json:"compatibility,omitempty"`
  7938. // ContentCategoryId: ID of the content category assigned to this
  7939. // placement.
  7940. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  7941. // CreateInfo: Information about the creation of this placement. This is
  7942. // a read-only field.
  7943. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  7944. // DirectorySiteId: Directory site ID of this placement. On insert, you
  7945. // must set either this field or the siteId field to specify the site
  7946. // associated with this placement. This is a required field that is
  7947. // read-only after insertion.
  7948. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  7949. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  7950. // directory site. This is a read-only, auto-generated field.
  7951. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  7952. // ExternalId: External ID for this placement.
  7953. ExternalId string `json:"externalId,omitempty"`
  7954. // Id: ID of this placement. This is a read-only, auto-generated field.
  7955. Id int64 `json:"id,omitempty,string"`
  7956. // IdDimensionValue: Dimension value for the ID of this placement. This
  7957. // is a read-only, auto-generated field.
  7958. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  7959. // KeyName: Key name of this placement. This is a read-only,
  7960. // auto-generated field.
  7961. KeyName string `json:"keyName,omitempty"`
  7962. // Kind: Identifies what kind of resource this is. Value: the fixed
  7963. // string "dfareporting#placement".
  7964. Kind string `json:"kind,omitempty"`
  7965. // LastModifiedInfo: Information about the most recent modification of
  7966. // this placement. This is a read-only field.
  7967. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7968. // LookbackConfiguration: Lookback window settings for this placement.
  7969. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  7970. // Name: Name of this placement.This is a required field and must be
  7971. // less than 256 characters long.
  7972. Name string `json:"name,omitempty"`
  7973. // PaymentApproved: Whether payment was approved for this placement.
  7974. // This is a read-only field relevant only to publisher-paid placements.
  7975. PaymentApproved bool `json:"paymentApproved,omitempty"`
  7976. // PaymentSource: Payment source for this placement. This is a required
  7977. // field that is read-only after insertion.
  7978. //
  7979. // Possible values:
  7980. // "PLACEMENT_AGENCY_PAID"
  7981. // "PLACEMENT_PUBLISHER_PAID"
  7982. PaymentSource string `json:"paymentSource,omitempty"`
  7983. // PlacementGroupId: ID of this placement's group, if applicable.
  7984. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  7985. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  7986. // placement group. This is a read-only, auto-generated field.
  7987. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  7988. // PlacementStrategyId: ID of the placement strategy assigned to this
  7989. // placement.
  7990. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  7991. // PricingSchedule: Pricing schedule of this placement. This field is
  7992. // required on insertion, specifically subfields startDate, endDate and
  7993. // pricingType.
  7994. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  7995. // Primary: Whether this placement is the primary placement of a
  7996. // roadblock (placement group). You cannot change this field from true
  7997. // to false. Setting this field to true will automatically set the
  7998. // primary field on the original primary placement of the roadblock to
  7999. // false, and it will automatically set the roadblock's
  8000. // primaryPlacementId field to the ID of this placement.
  8001. Primary bool `json:"primary,omitempty"`
  8002. // PublisherUpdateInfo: Information about the last publisher update.
  8003. // This is a read-only field.
  8004. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8005. // SiteId: Site ID associated with this placement. On insert, you must
  8006. // set either this field or the directorySiteId field to specify the
  8007. // site associated with this placement. This is a required field that is
  8008. // read-only after insertion.
  8009. SiteId int64 `json:"siteId,omitempty,string"`
  8010. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8011. // a read-only, auto-generated field.
  8012. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8013. // Size: Size associated with this placement. When inserting or updating
  8014. // a placement, only the size ID field is used. This field is required
  8015. // on insertion.
  8016. Size *Size `json:"size,omitempty"`
  8017. // SslRequired: Whether creatives assigned to this placement must be
  8018. // SSL-compliant.
  8019. SslRequired bool `json:"sslRequired,omitempty"`
  8020. // Status: Third-party placement status.
  8021. //
  8022. // Possible values:
  8023. // "ACKNOWLEDGE_ACCEPTANCE"
  8024. // "ACKNOWLEDGE_REJECTION"
  8025. // "DRAFT"
  8026. // "PAYMENT_ACCEPTED"
  8027. // "PAYMENT_REJECTED"
  8028. // "PENDING_REVIEW"
  8029. Status string `json:"status,omitempty"`
  8030. // SubaccountId: Subaccount ID of this placement. This field can be left
  8031. // blank.
  8032. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8033. // TagFormats: Tag formats to generate for this placement. This field is
  8034. // required on insertion.
  8035. // Acceptable values are:
  8036. // - "PLACEMENT_TAG_STANDARD"
  8037. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8038. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8039. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8040. // - "PLACEMENT_TAG_JAVASCRIPT"
  8041. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8042. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8043. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8044. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8045. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8046. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8047. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8048. // - "PLACEMENT_TAG_TRACKING"
  8049. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8050. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8051. //
  8052. // Possible values:
  8053. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8054. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8055. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8056. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8057. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8058. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8059. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8060. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8061. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8062. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8063. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8064. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8065. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8066. // "PLACEMENT_TAG_JAVASCRIPT"
  8067. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8068. // "PLACEMENT_TAG_STANDARD"
  8069. // "PLACEMENT_TAG_TRACKING"
  8070. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8071. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8072. TagFormats []string `json:"tagFormats,omitempty"`
  8073. // TagSetting: Tag settings for this placement.
  8074. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8075. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8076. // disabled for in-stream video creatives for this placement. The same
  8077. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8078. // occurs if either of these settings are true. These settings are
  8079. // distinct from DirectorySites.settings.activeViewOptOut or
  8080. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8081. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8082. // well as display ads, from Verification and ActiveView.
  8083. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8084. // VideoSettings: A collection of settings which affect video creatives
  8085. // served through this placement. Applicable to placements with
  8086. // IN_STREAM_VIDEO compatibility.
  8087. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8088. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8089. // Controls which VPAID format the measurement adapter will use for
  8090. // in-stream video creatives assigned to this placement.
  8091. //
  8092. // Note: Flash is no longer supported. This field now defaults to HTML5
  8093. // when the following values are provided: FLASH, BOTH.
  8094. //
  8095. // Possible values:
  8096. // "BOTH"
  8097. // "DEFAULT"
  8098. // "FLASH"
  8099. // "HTML5"
  8100. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8101. // ServerResponse contains the HTTP response code and headers from the
  8102. // server.
  8103. googleapi.ServerResponse `json:"-"`
  8104. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8105. // unconditionally include in API requests. By default, fields with
  8106. // empty values are omitted from API requests. However, any non-pointer,
  8107. // non-interface field appearing in ForceSendFields will be sent to the
  8108. // server regardless of whether the field is empty or not. This may be
  8109. // used to include empty fields in Patch requests.
  8110. ForceSendFields []string `json:"-"`
  8111. // NullFields is a list of field names (e.g. "AccountId") to include in
  8112. // API requests with the JSON null value. By default, fields with empty
  8113. // values are omitted from API requests. However, any field with an
  8114. // empty value appearing in NullFields will be sent to the server as
  8115. // null. It is an error if a field in this list has a non-empty value.
  8116. // This may be used to include null fields in Patch requests.
  8117. NullFields []string `json:"-"`
  8118. }
  8119. func (s *Placement) MarshalJSON() ([]byte, error) {
  8120. type NoMethod Placement
  8121. raw := NoMethod(*s)
  8122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8123. }
  8124. // PlacementAssignment: Placement Assignment.
  8125. type PlacementAssignment struct {
  8126. // Active: Whether this placement assignment is active. When true, the
  8127. // placement will be included in the ad's rotation.
  8128. Active bool `json:"active,omitempty"`
  8129. // PlacementId: ID of the placement to be assigned. This is a required
  8130. // field.
  8131. PlacementId int64 `json:"placementId,omitempty,string"`
  8132. // PlacementIdDimensionValue: Dimension value for the ID of the
  8133. // placement. This is a read-only, auto-generated field.
  8134. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8135. // SslRequired: Whether the placement to be assigned requires SSL. This
  8136. // is a read-only field that is auto-generated when the ad is inserted
  8137. // or updated.
  8138. SslRequired bool `json:"sslRequired,omitempty"`
  8139. // ForceSendFields is a list of field names (e.g. "Active") to
  8140. // unconditionally include in API requests. By default, fields with
  8141. // empty values are omitted from API requests. However, any non-pointer,
  8142. // non-interface field appearing in ForceSendFields will be sent to the
  8143. // server regardless of whether the field is empty or not. This may be
  8144. // used to include empty fields in Patch requests.
  8145. ForceSendFields []string `json:"-"`
  8146. // NullFields is a list of field names (e.g. "Active") to include in API
  8147. // requests with the JSON null value. By default, fields with empty
  8148. // values are omitted from API requests. However, any field with an
  8149. // empty value appearing in NullFields will be sent to the server as
  8150. // null. It is an error if a field in this list has a non-empty value.
  8151. // This may be used to include null fields in Patch requests.
  8152. NullFields []string `json:"-"`
  8153. }
  8154. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8155. type NoMethod PlacementAssignment
  8156. raw := NoMethod(*s)
  8157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8158. }
  8159. // PlacementGroup: Contains properties of a package or roadblock.
  8160. type PlacementGroup struct {
  8161. // AccountId: Account ID of this placement group. This is a read-only
  8162. // field that can be left blank.
  8163. AccountId int64 `json:"accountId,omitempty,string"`
  8164. // AdvertiserId: Advertiser ID of this placement group. This is a
  8165. // required field on insertion.
  8166. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8167. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8168. // advertiser. This is a read-only, auto-generated field.
  8169. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8170. // Archived: Whether this placement group is archived.
  8171. Archived bool `json:"archived,omitempty"`
  8172. // CampaignId: Campaign ID of this placement group. This field is
  8173. // required on insertion.
  8174. CampaignId int64 `json:"campaignId,omitempty,string"`
  8175. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8176. // This is a read-only, auto-generated field.
  8177. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8178. // ChildPlacementIds: IDs of placements which are assigned to this
  8179. // placement group. This is a read-only, auto-generated field.
  8180. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8181. // Comment: Comments for this placement group.
  8182. Comment string `json:"comment,omitempty"`
  8183. // ContentCategoryId: ID of the content category assigned to this
  8184. // placement group.
  8185. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8186. // CreateInfo: Information about the creation of this placement group.
  8187. // This is a read-only field.
  8188. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8189. // DirectorySiteId: Directory site ID associated with this placement
  8190. // group. On insert, you must set either this field or the site_id field
  8191. // to specify the site associated with this placement group. This is a
  8192. // required field that is read-only after insertion.
  8193. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8194. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8195. // directory site. This is a read-only, auto-generated field.
  8196. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8197. // ExternalId: External ID for this placement.
  8198. ExternalId string `json:"externalId,omitempty"`
  8199. // Id: ID of this placement group. This is a read-only, auto-generated
  8200. // field.
  8201. Id int64 `json:"id,omitempty,string"`
  8202. // IdDimensionValue: Dimension value for the ID of this placement group.
  8203. // This is a read-only, auto-generated field.
  8204. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8205. // Kind: Identifies what kind of resource this is. Value: the fixed
  8206. // string "dfareporting#placementGroup".
  8207. Kind string `json:"kind,omitempty"`
  8208. // LastModifiedInfo: Information about the most recent modification of
  8209. // this placement group. This is a read-only field.
  8210. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8211. // Name: Name of this placement group. This is a required field and must
  8212. // be less than 256 characters long.
  8213. Name string `json:"name,omitempty"`
  8214. // PlacementGroupType: Type of this placement group. A package is a
  8215. // simple group of placements that acts as a single pricing point for a
  8216. // group of tags. A roadblock is a group of placements that not only
  8217. // acts as a single pricing point, but also assumes that all the tags in
  8218. // it will be served at the same time. A roadblock requires one of its
  8219. // assigned placements to be marked as primary for reporting. This field
  8220. // is required on insertion.
  8221. //
  8222. // Possible values:
  8223. // "PLACEMENT_PACKAGE"
  8224. // "PLACEMENT_ROADBLOCK"
  8225. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8226. // PlacementStrategyId: ID of the placement strategy assigned to this
  8227. // placement group.
  8228. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8229. // PricingSchedule: Pricing schedule of this placement group. This field
  8230. // is required on insertion.
  8231. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8232. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8233. // the media cost of a roadblock (placement group). Modifying this field
  8234. // will automatically modify the primary field on all affected roadblock
  8235. // child placements.
  8236. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8237. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8238. // primary placement. This is a read-only, auto-generated field.
  8239. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8240. // SiteId: Site ID associated with this placement group. On insert, you
  8241. // must set either this field or the directorySiteId field to specify
  8242. // the site associated with this placement group. This is a required
  8243. // field that is read-only after insertion.
  8244. SiteId int64 `json:"siteId,omitempty,string"`
  8245. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8246. // a read-only, auto-generated field.
  8247. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8248. // SubaccountId: Subaccount ID of this placement group. This is a
  8249. // read-only field that can be left blank.
  8250. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8251. // ServerResponse contains the HTTP response code and headers from the
  8252. // server.
  8253. googleapi.ServerResponse `json:"-"`
  8254. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8255. // unconditionally include in API requests. By default, fields with
  8256. // empty values are omitted from API requests. However, any non-pointer,
  8257. // non-interface field appearing in ForceSendFields will be sent to the
  8258. // server regardless of whether the field is empty or not. This may be
  8259. // used to include empty fields in Patch requests.
  8260. ForceSendFields []string `json:"-"`
  8261. // NullFields is a list of field names (e.g. "AccountId") to include in
  8262. // API requests with the JSON null value. By default, fields with empty
  8263. // values are omitted from API requests. However, any field with an
  8264. // empty value appearing in NullFields will be sent to the server as
  8265. // null. It is an error if a field in this list has a non-empty value.
  8266. // This may be used to include null fields in Patch requests.
  8267. NullFields []string `json:"-"`
  8268. }
  8269. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8270. type NoMethod PlacementGroup
  8271. raw := NoMethod(*s)
  8272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8273. }
  8274. // PlacementGroupsListResponse: Placement Group List Response
  8275. type PlacementGroupsListResponse struct {
  8276. // Kind: Identifies what kind of resource this is. Value: the fixed
  8277. // string "dfareporting#placementGroupsListResponse".
  8278. Kind string `json:"kind,omitempty"`
  8279. // NextPageToken: Pagination token to be used for the next list
  8280. // operation.
  8281. NextPageToken string `json:"nextPageToken,omitempty"`
  8282. // PlacementGroups: Placement group collection.
  8283. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8284. // ServerResponse contains the HTTP response code and headers from the
  8285. // server.
  8286. googleapi.ServerResponse `json:"-"`
  8287. // ForceSendFields is a list of field names (e.g. "Kind") to
  8288. // unconditionally include in API requests. By default, fields with
  8289. // empty values are omitted from API requests. However, any non-pointer,
  8290. // non-interface field appearing in ForceSendFields will be sent to the
  8291. // server regardless of whether the field is empty or not. This may be
  8292. // used to include empty fields in Patch requests.
  8293. ForceSendFields []string `json:"-"`
  8294. // NullFields is a list of field names (e.g. "Kind") to include in API
  8295. // requests with the JSON null value. By default, fields with empty
  8296. // values are omitted from API requests. However, any field with an
  8297. // empty value appearing in NullFields will be sent to the server as
  8298. // null. It is an error if a field in this list has a non-empty value.
  8299. // This may be used to include null fields in Patch requests.
  8300. NullFields []string `json:"-"`
  8301. }
  8302. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8303. type NoMethod PlacementGroupsListResponse
  8304. raw := NoMethod(*s)
  8305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8306. }
  8307. // PlacementStrategiesListResponse: Placement Strategy List Response
  8308. type PlacementStrategiesListResponse struct {
  8309. // Kind: Identifies what kind of resource this is. Value: the fixed
  8310. // string "dfareporting#placementStrategiesListResponse".
  8311. Kind string `json:"kind,omitempty"`
  8312. // NextPageToken: Pagination token to be used for the next list
  8313. // operation.
  8314. NextPageToken string `json:"nextPageToken,omitempty"`
  8315. // PlacementStrategies: Placement strategy collection.
  8316. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8317. // ServerResponse contains the HTTP response code and headers from the
  8318. // server.
  8319. googleapi.ServerResponse `json:"-"`
  8320. // ForceSendFields is a list of field names (e.g. "Kind") to
  8321. // unconditionally include in API requests. By default, fields with
  8322. // empty values are omitted from API requests. However, any non-pointer,
  8323. // non-interface field appearing in ForceSendFields will be sent to the
  8324. // server regardless of whether the field is empty or not. This may be
  8325. // used to include empty fields in Patch requests.
  8326. ForceSendFields []string `json:"-"`
  8327. // NullFields is a list of field names (e.g. "Kind") to include in API
  8328. // requests with the JSON null value. By default, fields with empty
  8329. // values are omitted from API requests. However, any field with an
  8330. // empty value appearing in NullFields will be sent to the server as
  8331. // null. It is an error if a field in this list has a non-empty value.
  8332. // This may be used to include null fields in Patch requests.
  8333. NullFields []string `json:"-"`
  8334. }
  8335. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8336. type NoMethod PlacementStrategiesListResponse
  8337. raw := NoMethod(*s)
  8338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8339. }
  8340. // PlacementStrategy: Contains properties of a placement strategy.
  8341. type PlacementStrategy struct {
  8342. // AccountId: Account ID of this placement strategy.This is a read-only
  8343. // field that can be left blank.
  8344. AccountId int64 `json:"accountId,omitempty,string"`
  8345. // Id: ID of this placement strategy. This is a read-only,
  8346. // auto-generated field.
  8347. Id int64 `json:"id,omitempty,string"`
  8348. // Kind: Identifies what kind of resource this is. Value: the fixed
  8349. // string "dfareporting#placementStrategy".
  8350. Kind string `json:"kind,omitempty"`
  8351. // Name: Name of this placement strategy. This is a required field. It
  8352. // must be less than 256 characters long and unique among placement
  8353. // strategies of the same account.
  8354. Name string `json:"name,omitempty"`
  8355. // ServerResponse contains the HTTP response code and headers from the
  8356. // server.
  8357. googleapi.ServerResponse `json:"-"`
  8358. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8359. // unconditionally include in API requests. By default, fields with
  8360. // empty values are omitted from API requests. However, any non-pointer,
  8361. // non-interface field appearing in ForceSendFields will be sent to the
  8362. // server regardless of whether the field is empty or not. This may be
  8363. // used to include empty fields in Patch requests.
  8364. ForceSendFields []string `json:"-"`
  8365. // NullFields is a list of field names (e.g. "AccountId") to include in
  8366. // API requests with the JSON null value. By default, fields with empty
  8367. // values are omitted from API requests. However, any field with an
  8368. // empty value appearing in NullFields will be sent to the server as
  8369. // null. It is an error if a field in this list has a non-empty value.
  8370. // This may be used to include null fields in Patch requests.
  8371. NullFields []string `json:"-"`
  8372. }
  8373. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8374. type NoMethod PlacementStrategy
  8375. raw := NoMethod(*s)
  8376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8377. }
  8378. // PlacementTag: Placement Tag
  8379. type PlacementTag struct {
  8380. // PlacementId: Placement ID
  8381. PlacementId int64 `json:"placementId,omitempty,string"`
  8382. // TagDatas: Tags generated for this placement.
  8383. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8384. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8385. // unconditionally include in API requests. By default, fields with
  8386. // empty values are omitted from API requests. However, any non-pointer,
  8387. // non-interface field appearing in ForceSendFields will be sent to the
  8388. // server regardless of whether the field is empty or not. This may be
  8389. // used to include empty fields in Patch requests.
  8390. ForceSendFields []string `json:"-"`
  8391. // NullFields is a list of field names (e.g. "PlacementId") to include
  8392. // in API requests with the JSON null value. By default, fields with
  8393. // empty values are omitted from API requests. However, any field with
  8394. // an empty value appearing in NullFields will be sent to the server as
  8395. // null. It is an error if a field in this list has a non-empty value.
  8396. // This may be used to include null fields in Patch requests.
  8397. NullFields []string `json:"-"`
  8398. }
  8399. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8400. type NoMethod PlacementTag
  8401. raw := NoMethod(*s)
  8402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8403. }
  8404. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8405. type PlacementsGenerateTagsResponse struct {
  8406. // Kind: Identifies what kind of resource this is. Value: the fixed
  8407. // string "dfareporting#placementsGenerateTagsResponse".
  8408. Kind string `json:"kind,omitempty"`
  8409. // PlacementTags: Set of generated tags for the specified placements.
  8410. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8411. // ServerResponse contains the HTTP response code and headers from the
  8412. // server.
  8413. googleapi.ServerResponse `json:"-"`
  8414. // ForceSendFields is a list of field names (e.g. "Kind") to
  8415. // unconditionally include in API requests. By default, fields with
  8416. // empty values are omitted from API requests. However, any non-pointer,
  8417. // non-interface field appearing in ForceSendFields will be sent to the
  8418. // server regardless of whether the field is empty or not. This may be
  8419. // used to include empty fields in Patch requests.
  8420. ForceSendFields []string `json:"-"`
  8421. // NullFields is a list of field names (e.g. "Kind") to include in API
  8422. // requests with the JSON null value. By default, fields with empty
  8423. // values are omitted from API requests. However, any field with an
  8424. // empty value appearing in NullFields will be sent to the server as
  8425. // null. It is an error if a field in this list has a non-empty value.
  8426. // This may be used to include null fields in Patch requests.
  8427. NullFields []string `json:"-"`
  8428. }
  8429. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8430. type NoMethod PlacementsGenerateTagsResponse
  8431. raw := NoMethod(*s)
  8432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8433. }
  8434. // PlacementsListResponse: Placement List Response
  8435. type PlacementsListResponse struct {
  8436. // Kind: Identifies what kind of resource this is. Value: the fixed
  8437. // string "dfareporting#placementsListResponse".
  8438. Kind string `json:"kind,omitempty"`
  8439. // NextPageToken: Pagination token to be used for the next list
  8440. // operation.
  8441. NextPageToken string `json:"nextPageToken,omitempty"`
  8442. // Placements: Placement collection.
  8443. Placements []*Placement `json:"placements,omitempty"`
  8444. // ServerResponse contains the HTTP response code and headers from the
  8445. // server.
  8446. googleapi.ServerResponse `json:"-"`
  8447. // ForceSendFields is a list of field names (e.g. "Kind") to
  8448. // unconditionally include in API requests. By default, fields with
  8449. // empty values are omitted from API requests. However, any non-pointer,
  8450. // non-interface field appearing in ForceSendFields will be sent to the
  8451. // server regardless of whether the field is empty or not. This may be
  8452. // used to include empty fields in Patch requests.
  8453. ForceSendFields []string `json:"-"`
  8454. // NullFields is a list of field names (e.g. "Kind") to include in API
  8455. // requests with the JSON null value. By default, fields with empty
  8456. // values are omitted from API requests. However, any field with an
  8457. // empty value appearing in NullFields will be sent to the server as
  8458. // null. It is an error if a field in this list has a non-empty value.
  8459. // This may be used to include null fields in Patch requests.
  8460. NullFields []string `json:"-"`
  8461. }
  8462. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8463. type NoMethod PlacementsListResponse
  8464. raw := NoMethod(*s)
  8465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8466. }
  8467. // PlatformType: Contains information about a platform type that can be
  8468. // targeted by ads.
  8469. type PlatformType struct {
  8470. // Id: ID of this platform type.
  8471. Id int64 `json:"id,omitempty,string"`
  8472. // Kind: Identifies what kind of resource this is. Value: the fixed
  8473. // string "dfareporting#platformType".
  8474. Kind string `json:"kind,omitempty"`
  8475. // Name: Name of this platform type.
  8476. Name string `json:"name,omitempty"`
  8477. // ServerResponse contains the HTTP response code and headers from the
  8478. // server.
  8479. googleapi.ServerResponse `json:"-"`
  8480. // ForceSendFields is a list of field names (e.g. "Id") to
  8481. // unconditionally include in API requests. By default, fields with
  8482. // empty values are omitted from API requests. However, any non-pointer,
  8483. // non-interface field appearing in ForceSendFields will be sent to the
  8484. // server regardless of whether the field is empty or not. This may be
  8485. // used to include empty fields in Patch requests.
  8486. ForceSendFields []string `json:"-"`
  8487. // NullFields is a list of field names (e.g. "Id") to include in API
  8488. // requests with the JSON null value. By default, fields with empty
  8489. // values are omitted from API requests. However, any field with an
  8490. // empty value appearing in NullFields will be sent to the server as
  8491. // null. It is an error if a field in this list has a non-empty value.
  8492. // This may be used to include null fields in Patch requests.
  8493. NullFields []string `json:"-"`
  8494. }
  8495. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8496. type NoMethod PlatformType
  8497. raw := NoMethod(*s)
  8498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8499. }
  8500. // PlatformTypesListResponse: Platform Type List Response
  8501. type PlatformTypesListResponse struct {
  8502. // Kind: Identifies what kind of resource this is. Value: the fixed
  8503. // string "dfareporting#platformTypesListResponse".
  8504. Kind string `json:"kind,omitempty"`
  8505. // PlatformTypes: Platform type collection.
  8506. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8507. // ServerResponse contains the HTTP response code and headers from the
  8508. // server.
  8509. googleapi.ServerResponse `json:"-"`
  8510. // ForceSendFields is a list of field names (e.g. "Kind") to
  8511. // unconditionally include in API requests. By default, fields with
  8512. // empty values are omitted from API requests. However, any non-pointer,
  8513. // non-interface field appearing in ForceSendFields will be sent to the
  8514. // server regardless of whether the field is empty or not. This may be
  8515. // used to include empty fields in Patch requests.
  8516. ForceSendFields []string `json:"-"`
  8517. // NullFields is a list of field names (e.g. "Kind") to include in API
  8518. // requests with the JSON null value. By default, fields with empty
  8519. // values are omitted from API requests. However, any field with an
  8520. // empty value appearing in NullFields will be sent to the server as
  8521. // null. It is an error if a field in this list has a non-empty value.
  8522. // This may be used to include null fields in Patch requests.
  8523. NullFields []string `json:"-"`
  8524. }
  8525. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8526. type NoMethod PlatformTypesListResponse
  8527. raw := NoMethod(*s)
  8528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8529. }
  8530. // PopupWindowProperties: Popup Window Properties.
  8531. type PopupWindowProperties struct {
  8532. // Dimension: Popup dimension for a creative. This is a read-only field.
  8533. // Applicable to the following creative types: all RICH_MEDIA and all
  8534. // VPAID
  8535. Dimension *Size `json:"dimension,omitempty"`
  8536. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8537. // if positionType is COORDINATES.
  8538. Offset *OffsetPosition `json:"offset,omitempty"`
  8539. // PositionType: Popup window position either centered or at specific
  8540. // coordinate.
  8541. //
  8542. // Possible values:
  8543. // "CENTER"
  8544. // "COORDINATES"
  8545. PositionType string `json:"positionType,omitempty"`
  8546. // ShowAddressBar: Whether to display the browser address bar.
  8547. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8548. // ShowMenuBar: Whether to display the browser menu bar.
  8549. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8550. // ShowScrollBar: Whether to display the browser scroll bar.
  8551. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8552. // ShowStatusBar: Whether to display the browser status bar.
  8553. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8554. // ShowToolBar: Whether to display the browser tool bar.
  8555. ShowToolBar bool `json:"showToolBar,omitempty"`
  8556. // Title: Title of popup window.
  8557. Title string `json:"title,omitempty"`
  8558. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8559. // unconditionally include in API requests. By default, fields with
  8560. // empty values are omitted from API requests. However, any non-pointer,
  8561. // non-interface field appearing in ForceSendFields will be sent to the
  8562. // server regardless of whether the field is empty or not. This may be
  8563. // used to include empty fields in Patch requests.
  8564. ForceSendFields []string `json:"-"`
  8565. // NullFields is a list of field names (e.g. "Dimension") to include in
  8566. // API requests with the JSON null value. By default, fields with empty
  8567. // values are omitted from API requests. However, any field with an
  8568. // empty value appearing in NullFields will be sent to the server as
  8569. // null. It is an error if a field in this list has a non-empty value.
  8570. // This may be used to include null fields in Patch requests.
  8571. NullFields []string `json:"-"`
  8572. }
  8573. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8574. type NoMethod PopupWindowProperties
  8575. raw := NoMethod(*s)
  8576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8577. }
  8578. // PostalCode: Contains information about a postal code that can be
  8579. // targeted by ads.
  8580. type PostalCode struct {
  8581. // Code: Postal code. This is equivalent to the id field.
  8582. Code string `json:"code,omitempty"`
  8583. // CountryCode: Country code of the country to which this postal code
  8584. // belongs.
  8585. CountryCode string `json:"countryCode,omitempty"`
  8586. // CountryDartId: DART ID of the country to which this postal code
  8587. // belongs.
  8588. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8589. // Id: ID of this postal code.
  8590. Id string `json:"id,omitempty"`
  8591. // Kind: Identifies what kind of resource this is. Value: the fixed
  8592. // string "dfareporting#postalCode".
  8593. Kind string `json:"kind,omitempty"`
  8594. // ServerResponse contains the HTTP response code and headers from the
  8595. // server.
  8596. googleapi.ServerResponse `json:"-"`
  8597. // ForceSendFields is a list of field names (e.g. "Code") to
  8598. // unconditionally include in API requests. By default, fields with
  8599. // empty values are omitted from API requests. However, any non-pointer,
  8600. // non-interface field appearing in ForceSendFields will be sent to the
  8601. // server regardless of whether the field is empty or not. This may be
  8602. // used to include empty fields in Patch requests.
  8603. ForceSendFields []string `json:"-"`
  8604. // NullFields is a list of field names (e.g. "Code") to include in API
  8605. // requests with the JSON null value. By default, fields with empty
  8606. // values are omitted from API requests. However, any field with an
  8607. // empty value appearing in NullFields will be sent to the server as
  8608. // null. It is an error if a field in this list has a non-empty value.
  8609. // This may be used to include null fields in Patch requests.
  8610. NullFields []string `json:"-"`
  8611. }
  8612. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8613. type NoMethod PostalCode
  8614. raw := NoMethod(*s)
  8615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8616. }
  8617. // PostalCodesListResponse: Postal Code List Response
  8618. type PostalCodesListResponse struct {
  8619. // Kind: Identifies what kind of resource this is. Value: the fixed
  8620. // string "dfareporting#postalCodesListResponse".
  8621. Kind string `json:"kind,omitempty"`
  8622. // PostalCodes: Postal code collection.
  8623. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8624. // ServerResponse contains the HTTP response code and headers from the
  8625. // server.
  8626. googleapi.ServerResponse `json:"-"`
  8627. // ForceSendFields is a list of field names (e.g. "Kind") to
  8628. // unconditionally include in API requests. By default, fields with
  8629. // empty values are omitted from API requests. However, any non-pointer,
  8630. // non-interface field appearing in ForceSendFields will be sent to the
  8631. // server regardless of whether the field is empty or not. This may be
  8632. // used to include empty fields in Patch requests.
  8633. ForceSendFields []string `json:"-"`
  8634. // NullFields is a list of field names (e.g. "Kind") to include in API
  8635. // requests with the JSON null value. By default, fields with empty
  8636. // values are omitted from API requests. However, any field with an
  8637. // empty value appearing in NullFields will be sent to the server as
  8638. // null. It is an error if a field in this list has a non-empty value.
  8639. // This may be used to include null fields in Patch requests.
  8640. NullFields []string `json:"-"`
  8641. }
  8642. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  8643. type NoMethod PostalCodesListResponse
  8644. raw := NoMethod(*s)
  8645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8646. }
  8647. // Pricing: Pricing Information
  8648. type Pricing struct {
  8649. // CapCostType: Cap cost type of this inventory item.
  8650. //
  8651. // Possible values:
  8652. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  8653. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  8654. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  8655. CapCostType string `json:"capCostType,omitempty"`
  8656. // EndDate: End date of this inventory item.
  8657. EndDate string `json:"endDate,omitempty"`
  8658. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  8659. // period) represents the inventory item pricing information for a
  8660. // specific period of time.
  8661. Flights []*Flight `json:"flights,omitempty"`
  8662. // GroupType: Group type of this inventory item if it represents a
  8663. // placement group. Is null otherwise. There are two type of placement
  8664. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  8665. // inventory items that acts as a single pricing point for a group of
  8666. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  8667. // items that not only acts as a single pricing point, but also assumes
  8668. // that all the tags in it will be served at the same time. A roadblock
  8669. // requires one of its assigned inventory items to be marked as primary.
  8670. //
  8671. // Possible values:
  8672. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  8673. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  8674. GroupType string `json:"groupType,omitempty"`
  8675. // PricingType: Pricing type of this inventory item.
  8676. //
  8677. // Possible values:
  8678. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  8679. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  8680. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  8681. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  8682. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  8683. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  8684. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8685. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  8686. PricingType string `json:"pricingType,omitempty"`
  8687. // StartDate: Start date of this inventory item.
  8688. StartDate string `json:"startDate,omitempty"`
  8689. // ForceSendFields is a list of field names (e.g. "CapCostType") 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. "CapCostType") to include
  8697. // in API requests with the JSON null value. By default, fields with
  8698. // empty values are omitted from API requests. However, any field with
  8699. // an 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 *Pricing) MarshalJSON() ([]byte, error) {
  8705. type NoMethod Pricing
  8706. raw := NoMethod(*s)
  8707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8708. }
  8709. // PricingSchedule: Pricing Schedule
  8710. type PricingSchedule struct {
  8711. // CapCostOption: Placement cap cost option.
  8712. //
  8713. // Possible values:
  8714. // "CAP_COST_CUMULATIVE"
  8715. // "CAP_COST_MONTHLY"
  8716. // "CAP_COST_NONE"
  8717. CapCostOption string `json:"capCostOption,omitempty"`
  8718. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  8719. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  8720. // EndDate: Placement end date. This date must be later than, or the
  8721. // same day as, the placement start date, but not later than the
  8722. // campaign end date. If, for example, you set 6/25/2015 as both the
  8723. // start and end dates, the effective placement date is just that day
  8724. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  8725. // should not be set, as doing so will result in an error. This field is
  8726. // required on insertion.
  8727. EndDate string `json:"endDate,omitempty"`
  8728. // Flighted: Whether this placement is flighted. If true, pricing
  8729. // periods will be computed automatically.
  8730. Flighted bool `json:"flighted,omitempty"`
  8731. // FloodlightActivityId: Floodlight activity ID associated with this
  8732. // placement. This field should be set when placement pricing type is
  8733. // set to PRICING_TYPE_CPA.
  8734. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  8735. // PricingPeriods: Pricing periods for this placement.
  8736. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  8737. // PricingType: Placement pricing type. This field is required on
  8738. // insertion.
  8739. //
  8740. // Possible values:
  8741. // "PRICING_TYPE_CPA"
  8742. // "PRICING_TYPE_CPC"
  8743. // "PRICING_TYPE_CPM"
  8744. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  8745. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  8746. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8747. PricingType string `json:"pricingType,omitempty"`
  8748. // StartDate: Placement start date. This date must be later than, or the
  8749. // same day as, the campaign start date. The hours, minutes, and seconds
  8750. // of the start date should not be set, as doing so will result in an
  8751. // error. This field is required on insertion.
  8752. StartDate string `json:"startDate,omitempty"`
  8753. // TestingStartDate: Testing start date of this placement. The hours,
  8754. // minutes, and seconds of the start date should not be set, as doing so
  8755. // will result in an error.
  8756. TestingStartDate string `json:"testingStartDate,omitempty"`
  8757. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  8758. // unconditionally include in API requests. By default, fields with
  8759. // empty values are omitted from API requests. However, any non-pointer,
  8760. // non-interface field appearing in ForceSendFields will be sent to the
  8761. // server regardless of whether the field is empty or not. This may be
  8762. // used to include empty fields in Patch requests.
  8763. ForceSendFields []string `json:"-"`
  8764. // NullFields is a list of field names (e.g. "CapCostOption") to include
  8765. // in API requests with the JSON null value. By default, fields with
  8766. // empty values are omitted from API requests. However, any field with
  8767. // an empty value appearing in NullFields will be sent to the server as
  8768. // null. It is an error if a field in this list has a non-empty value.
  8769. // This may be used to include null fields in Patch requests.
  8770. NullFields []string `json:"-"`
  8771. }
  8772. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  8773. type NoMethod PricingSchedule
  8774. raw := NoMethod(*s)
  8775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8776. }
  8777. // PricingSchedulePricingPeriod: Pricing Period
  8778. type PricingSchedulePricingPeriod struct {
  8779. // EndDate: Pricing period end date. This date must be later than, or
  8780. // the same day as, the pricing period start date, but not later than
  8781. // the placement end date. The period end date can be the same date as
  8782. // the period start date. If, for example, you set 6/25/2015 as both the
  8783. // start and end dates, the effective pricing period date is just that
  8784. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  8785. // should not be set, as doing so will result in an error.
  8786. EndDate string `json:"endDate,omitempty"`
  8787. // PricingComment: Comments for this pricing period.
  8788. PricingComment string `json:"pricingComment,omitempty"`
  8789. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  8790. // multipled by 1000000000). Acceptable values are 0 to
  8791. // 1000000000000000000, inclusive.
  8792. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  8793. // StartDate: Pricing period start date. This date must be later than,
  8794. // or the same day as, the placement start date. The hours, minutes, and
  8795. // seconds of the start date should not be set, as doing so will result
  8796. // in an error.
  8797. StartDate string `json:"startDate,omitempty"`
  8798. // Units: Units of this pricing period. Acceptable values are 0 to
  8799. // 10000000000, inclusive.
  8800. Units int64 `json:"units,omitempty,string"`
  8801. // ForceSendFields is a list of field names (e.g. "EndDate") to
  8802. // unconditionally include in API requests. By default, fields with
  8803. // empty values are omitted from API requests. However, any non-pointer,
  8804. // non-interface field appearing in ForceSendFields will be sent to the
  8805. // server regardless of whether the field is empty or not. This may be
  8806. // used to include empty fields in Patch requests.
  8807. ForceSendFields []string `json:"-"`
  8808. // NullFields is a list of field names (e.g. "EndDate") to include in
  8809. // API requests with the JSON null value. By default, fields with empty
  8810. // values are omitted from API requests. However, any field with an
  8811. // empty value appearing in NullFields will be sent to the server as
  8812. // null. It is an error if a field in this list has a non-empty value.
  8813. // This may be used to include null fields in Patch requests.
  8814. NullFields []string `json:"-"`
  8815. }
  8816. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  8817. type NoMethod PricingSchedulePricingPeriod
  8818. raw := NoMethod(*s)
  8819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8820. }
  8821. // Project: Contains properties of a DoubleClick Planning project.
  8822. type Project struct {
  8823. // AccountId: Account ID of this project.
  8824. AccountId int64 `json:"accountId,omitempty,string"`
  8825. // AdvertiserId: Advertiser ID of this project.
  8826. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8827. // AudienceAgeGroup: Audience age group of this project.
  8828. //
  8829. // Possible values:
  8830. // "PLANNING_AUDIENCE_AGE_18_24"
  8831. // "PLANNING_AUDIENCE_AGE_25_34"
  8832. // "PLANNING_AUDIENCE_AGE_35_44"
  8833. // "PLANNING_AUDIENCE_AGE_45_54"
  8834. // "PLANNING_AUDIENCE_AGE_55_64"
  8835. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  8836. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  8837. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  8838. // AudienceGender: Audience gender of this project.
  8839. //
  8840. // Possible values:
  8841. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  8842. // "PLANNING_AUDIENCE_GENDER_MALE"
  8843. AudienceGender string `json:"audienceGender,omitempty"`
  8844. // Budget: Budget of this project in the currency specified by the
  8845. // current account. The value stored in this field represents only the
  8846. // non-fractional amount. For example, for USD, the smallest value that
  8847. // can be represented by this field is 1 US dollar.
  8848. Budget int64 `json:"budget,omitempty,string"`
  8849. // ClientBillingCode: Client billing code of this project.
  8850. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  8851. // ClientName: Name of the project client.
  8852. ClientName string `json:"clientName,omitempty"`
  8853. // EndDate: End date of the project.
  8854. EndDate string `json:"endDate,omitempty"`
  8855. // Id: ID of this project. This is a read-only, auto-generated field.
  8856. Id int64 `json:"id,omitempty,string"`
  8857. // Kind: Identifies what kind of resource this is. Value: the fixed
  8858. // string "dfareporting#project".
  8859. Kind string `json:"kind,omitempty"`
  8860. // LastModifiedInfo: Information about the most recent modification of
  8861. // this project.
  8862. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8863. // Name: Name of this project.
  8864. Name string `json:"name,omitempty"`
  8865. // Overview: Overview of this project.
  8866. Overview string `json:"overview,omitempty"`
  8867. // StartDate: Start date of the project.
  8868. StartDate string `json:"startDate,omitempty"`
  8869. // SubaccountId: Subaccount ID of this project.
  8870. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8871. // TargetClicks: Number of clicks that the advertiser is targeting.
  8872. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  8873. // TargetConversions: Number of conversions that the advertiser is
  8874. // targeting.
  8875. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  8876. // TargetCpaNanos: CPA that the advertiser is targeting.
  8877. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  8878. // TargetCpcNanos: CPC that the advertiser is targeting.
  8879. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  8880. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  8881. // is targeting.
  8882. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  8883. // TargetCpmNanos: CPM that the advertiser is targeting.
  8884. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  8885. // TargetImpressions: Number of impressions that the advertiser is
  8886. // targeting.
  8887. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  8888. // ServerResponse contains the HTTP response code and headers from the
  8889. // server.
  8890. googleapi.ServerResponse `json:"-"`
  8891. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8892. // unconditionally include in API requests. By default, fields with
  8893. // empty values are omitted from API requests. However, any non-pointer,
  8894. // non-interface field appearing in ForceSendFields will be sent to the
  8895. // server regardless of whether the field is empty or not. This may be
  8896. // used to include empty fields in Patch requests.
  8897. ForceSendFields []string `json:"-"`
  8898. // NullFields is a list of field names (e.g. "AccountId") to include in
  8899. // API requests with the JSON null value. By default, fields with empty
  8900. // values are omitted from API requests. However, any field with an
  8901. // empty value appearing in NullFields will be sent to the server as
  8902. // null. It is an error if a field in this list has a non-empty value.
  8903. // This may be used to include null fields in Patch requests.
  8904. NullFields []string `json:"-"`
  8905. }
  8906. func (s *Project) MarshalJSON() ([]byte, error) {
  8907. type NoMethod Project
  8908. raw := NoMethod(*s)
  8909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8910. }
  8911. // ProjectsListResponse: Project List Response
  8912. type ProjectsListResponse struct {
  8913. // Kind: Identifies what kind of resource this is. Value: the fixed
  8914. // string "dfareporting#projectsListResponse".
  8915. Kind string `json:"kind,omitempty"`
  8916. // NextPageToken: Pagination token to be used for the next list
  8917. // operation.
  8918. NextPageToken string `json:"nextPageToken,omitempty"`
  8919. // Projects: Project collection.
  8920. Projects []*Project `json:"projects,omitempty"`
  8921. // ServerResponse contains the HTTP response code and headers from the
  8922. // server.
  8923. googleapi.ServerResponse `json:"-"`
  8924. // ForceSendFields is a list of field names (e.g. "Kind") to
  8925. // unconditionally include in API requests. By default, fields with
  8926. // empty values are omitted from API requests. However, any non-pointer,
  8927. // non-interface field appearing in ForceSendFields will be sent to the
  8928. // server regardless of whether the field is empty or not. This may be
  8929. // used to include empty fields in Patch requests.
  8930. ForceSendFields []string `json:"-"`
  8931. // NullFields is a list of field names (e.g. "Kind") to include in API
  8932. // requests with the JSON null value. By default, fields with empty
  8933. // values are omitted from API requests. However, any field with an
  8934. // empty value appearing in NullFields will be sent to the server as
  8935. // null. It is an error if a field in this list has a non-empty value.
  8936. // This may be used to include null fields in Patch requests.
  8937. NullFields []string `json:"-"`
  8938. }
  8939. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  8940. type NoMethod ProjectsListResponse
  8941. raw := NoMethod(*s)
  8942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8943. }
  8944. // ReachReportCompatibleFields: Represents fields that are compatible to
  8945. // be selected for a report of type "REACH".
  8946. type ReachReportCompatibleFields struct {
  8947. // DimensionFilters: Dimensions which are compatible to be selected in
  8948. // the "dimensionFilters" section of the report.
  8949. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  8950. // Dimensions: Dimensions which are compatible to be selected in the
  8951. // "dimensions" section of the report.
  8952. Dimensions []*Dimension `json:"dimensions,omitempty"`
  8953. // Kind: The kind of resource this is, in this case
  8954. // dfareporting#reachReportCompatibleFields.
  8955. Kind string `json:"kind,omitempty"`
  8956. // Metrics: Metrics which are compatible to be selected in the
  8957. // "metricNames" section of the report.
  8958. Metrics []*Metric `json:"metrics,omitempty"`
  8959. // PivotedActivityMetrics: Metrics which are compatible to be selected
  8960. // as activity metrics to pivot on in the "activities" section of the
  8961. // report.
  8962. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  8963. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  8964. // in the "reachByFrequencyMetricNames" section of the report.
  8965. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  8966. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  8967. // unconditionally include in API requests. By default, fields with
  8968. // empty values are omitted from API requests. However, any non-pointer,
  8969. // non-interface field appearing in ForceSendFields will be sent to the
  8970. // server regardless of whether the field is empty or not. This may be
  8971. // used to include empty fields in Patch requests.
  8972. ForceSendFields []string `json:"-"`
  8973. // NullFields is a list of field names (e.g. "DimensionFilters") to
  8974. // include in API requests with the JSON null value. By default, fields
  8975. // with empty values are omitted from API requests. However, any field
  8976. // with an empty value appearing in NullFields will be sent to the
  8977. // server as null. It is an error if a field in this list has a
  8978. // non-empty value. This may be used to include null fields in Patch
  8979. // requests.
  8980. NullFields []string `json:"-"`
  8981. }
  8982. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8983. type NoMethod ReachReportCompatibleFields
  8984. raw := NoMethod(*s)
  8985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8986. }
  8987. // Recipient: Represents a recipient.
  8988. type Recipient struct {
  8989. // DeliveryType: The delivery type for the recipient.
  8990. //
  8991. // Possible values:
  8992. // "ATTACHMENT"
  8993. // "LINK"
  8994. DeliveryType string `json:"deliveryType,omitempty"`
  8995. // Email: The email address of the recipient.
  8996. Email string `json:"email,omitempty"`
  8997. // Kind: The kind of resource this is, in this case
  8998. // dfareporting#recipient.
  8999. Kind string `json:"kind,omitempty"`
  9000. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9001. // unconditionally include in API requests. By default, fields with
  9002. // empty values are omitted from API requests. However, any non-pointer,
  9003. // non-interface field appearing in ForceSendFields will be sent to the
  9004. // server regardless of whether the field is empty or not. This may be
  9005. // used to include empty fields in Patch requests.
  9006. ForceSendFields []string `json:"-"`
  9007. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9008. // in API requests with the JSON null value. By default, fields with
  9009. // empty values are omitted from API requests. However, any field with
  9010. // an empty value appearing in NullFields will be sent to the server as
  9011. // null. It is an error if a field in this list has a non-empty value.
  9012. // This may be used to include null fields in Patch requests.
  9013. NullFields []string `json:"-"`
  9014. }
  9015. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9016. type NoMethod Recipient
  9017. raw := NoMethod(*s)
  9018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9019. }
  9020. // Region: Contains information about a region that can be targeted by
  9021. // ads.
  9022. type Region struct {
  9023. // CountryCode: Country code of the country to which this region
  9024. // belongs.
  9025. CountryCode string `json:"countryCode,omitempty"`
  9026. // CountryDartId: DART ID of the country to which this region belongs.
  9027. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9028. // DartId: DART ID of this region.
  9029. DartId int64 `json:"dartId,omitempty,string"`
  9030. // Kind: Identifies what kind of resource this is. Value: the fixed
  9031. // string "dfareporting#region".
  9032. Kind string `json:"kind,omitempty"`
  9033. // Name: Name of this region.
  9034. Name string `json:"name,omitempty"`
  9035. // RegionCode: Region code.
  9036. RegionCode string `json:"regionCode,omitempty"`
  9037. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9038. // unconditionally include in API requests. By default, fields with
  9039. // empty values are omitted from API requests. However, any non-pointer,
  9040. // non-interface field appearing in ForceSendFields will be sent to the
  9041. // server regardless of whether the field is empty or not. This may be
  9042. // used to include empty fields in Patch requests.
  9043. ForceSendFields []string `json:"-"`
  9044. // NullFields is a list of field names (e.g. "CountryCode") to include
  9045. // in API requests with the JSON null value. By default, fields with
  9046. // empty values are omitted from API requests. However, any field with
  9047. // an empty value appearing in NullFields will be sent to the server as
  9048. // null. It is an error if a field in this list has a non-empty value.
  9049. // This may be used to include null fields in Patch requests.
  9050. NullFields []string `json:"-"`
  9051. }
  9052. func (s *Region) MarshalJSON() ([]byte, error) {
  9053. type NoMethod Region
  9054. raw := NoMethod(*s)
  9055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9056. }
  9057. // RegionsListResponse: Region List Response
  9058. type RegionsListResponse struct {
  9059. // Kind: Identifies what kind of resource this is. Value: the fixed
  9060. // string "dfareporting#regionsListResponse".
  9061. Kind string `json:"kind,omitempty"`
  9062. // Regions: Region collection.
  9063. Regions []*Region `json:"regions,omitempty"`
  9064. // ServerResponse contains the HTTP response code and headers from the
  9065. // server.
  9066. googleapi.ServerResponse `json:"-"`
  9067. // ForceSendFields is a list of field names (e.g. "Kind") to
  9068. // unconditionally include in API requests. By default, fields with
  9069. // empty values are omitted from API requests. However, any non-pointer,
  9070. // non-interface field appearing in ForceSendFields will be sent to the
  9071. // server regardless of whether the field is empty or not. This may be
  9072. // used to include empty fields in Patch requests.
  9073. ForceSendFields []string `json:"-"`
  9074. // NullFields is a list of field names (e.g. "Kind") to include in API
  9075. // requests with the JSON null value. By default, fields with empty
  9076. // values are omitted from API requests. However, any field with an
  9077. // empty value appearing in NullFields will be sent to the server as
  9078. // null. It is an error if a field in this list has a non-empty value.
  9079. // This may be used to include null fields in Patch requests.
  9080. NullFields []string `json:"-"`
  9081. }
  9082. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9083. type NoMethod RegionsListResponse
  9084. raw := NoMethod(*s)
  9085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9086. }
  9087. // RemarketingList: Contains properties of a remarketing list.
  9088. // Remarketing enables you to create lists of users who have performed
  9089. // specific actions on a site, then target ads to members of those
  9090. // lists. This resource can be used to manage remarketing lists that are
  9091. // owned by your advertisers. To see all remarketing lists that are
  9092. // visible to your advertisers, including those that are shared to your
  9093. // advertiser or account, use the TargetableRemarketingLists resource.
  9094. type RemarketingList struct {
  9095. // AccountId: Account ID of this remarketing list. This is a read-only,
  9096. // auto-generated field that is only returned in GET requests.
  9097. AccountId int64 `json:"accountId,omitempty,string"`
  9098. // Active: Whether this remarketing list is active.
  9099. Active bool `json:"active,omitempty"`
  9100. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9101. // remarketing list. This is a required field.
  9102. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9103. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9104. // advertiser. This is a read-only, auto-generated field.
  9105. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9106. // Description: Remarketing list description.
  9107. Description string `json:"description,omitempty"`
  9108. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9109. Id int64 `json:"id,omitempty,string"`
  9110. // Kind: Identifies what kind of resource this is. Value: the fixed
  9111. // string "dfareporting#remarketingList".
  9112. Kind string `json:"kind,omitempty"`
  9113. // LifeSpan: Number of days that a user should remain in the remarketing
  9114. // list without an impression. Acceptable values are 1 to 540,
  9115. // inclusive.
  9116. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9117. // ListPopulationRule: Rule used to populate the remarketing list with
  9118. // users.
  9119. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9120. // ListSize: Number of users currently in the list. This is a read-only
  9121. // field.
  9122. ListSize int64 `json:"listSize,omitempty,string"`
  9123. // ListSource: Product from which this remarketing list was originated.
  9124. //
  9125. // Possible values:
  9126. // "REMARKETING_LIST_SOURCE_ADX"
  9127. // "REMARKETING_LIST_SOURCE_DBM"
  9128. // "REMARKETING_LIST_SOURCE_DFA"
  9129. // "REMARKETING_LIST_SOURCE_DFP"
  9130. // "REMARKETING_LIST_SOURCE_DMP"
  9131. // "REMARKETING_LIST_SOURCE_GA"
  9132. // "REMARKETING_LIST_SOURCE_GPLUS"
  9133. // "REMARKETING_LIST_SOURCE_OTHER"
  9134. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9135. // "REMARKETING_LIST_SOURCE_XFP"
  9136. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9137. ListSource string `json:"listSource,omitempty"`
  9138. // Name: Name of the remarketing list. This is a required field. Must be
  9139. // no greater than 128 characters long.
  9140. Name string `json:"name,omitempty"`
  9141. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9142. // read-only, auto-generated field that is only returned in GET
  9143. // requests.
  9144. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9145. // ServerResponse contains the HTTP response code and headers from the
  9146. // server.
  9147. googleapi.ServerResponse `json:"-"`
  9148. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9149. // unconditionally include in API requests. By default, fields with
  9150. // empty values are omitted from API requests. However, any non-pointer,
  9151. // non-interface field appearing in ForceSendFields will be sent to the
  9152. // server regardless of whether the field is empty or not. This may be
  9153. // used to include empty fields in Patch requests.
  9154. ForceSendFields []string `json:"-"`
  9155. // NullFields is a list of field names (e.g. "AccountId") to include in
  9156. // API requests with the JSON null value. By default, fields with empty
  9157. // values are omitted from API requests. However, any field with an
  9158. // empty value appearing in NullFields will be sent to the server as
  9159. // null. It is an error if a field in this list has a non-empty value.
  9160. // This may be used to include null fields in Patch requests.
  9161. NullFields []string `json:"-"`
  9162. }
  9163. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9164. type NoMethod RemarketingList
  9165. raw := NoMethod(*s)
  9166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9167. }
  9168. // RemarketingListShare: Contains properties of a remarketing list's
  9169. // sharing information. Sharing allows other accounts or advertisers to
  9170. // target to your remarketing lists. This resource can be used to manage
  9171. // remarketing list sharing to other accounts and advertisers.
  9172. type RemarketingListShare struct {
  9173. // Kind: Identifies what kind of resource this is. Value: the fixed
  9174. // string "dfareporting#remarketingListShare".
  9175. Kind string `json:"kind,omitempty"`
  9176. // RemarketingListId: Remarketing list ID. This is a read-only,
  9177. // auto-generated field.
  9178. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9179. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9180. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9181. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9182. // with.
  9183. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9184. // ServerResponse contains the HTTP response code and headers from the
  9185. // server.
  9186. googleapi.ServerResponse `json:"-"`
  9187. // ForceSendFields is a list of field names (e.g. "Kind") to
  9188. // unconditionally include in API requests. By default, fields with
  9189. // empty values are omitted from API requests. However, any non-pointer,
  9190. // non-interface field appearing in ForceSendFields will be sent to the
  9191. // server regardless of whether the field is empty or not. This may be
  9192. // used to include empty fields in Patch requests.
  9193. ForceSendFields []string `json:"-"`
  9194. // NullFields is a list of field names (e.g. "Kind") to include in API
  9195. // requests with the JSON null value. By default, fields with empty
  9196. // values are omitted from API requests. However, any field with an
  9197. // empty value appearing in NullFields will be sent to the server as
  9198. // null. It is an error if a field in this list has a non-empty value.
  9199. // This may be used to include null fields in Patch requests.
  9200. NullFields []string `json:"-"`
  9201. }
  9202. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9203. type NoMethod RemarketingListShare
  9204. raw := NoMethod(*s)
  9205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9206. }
  9207. // RemarketingListsListResponse: Remarketing list response
  9208. type RemarketingListsListResponse struct {
  9209. // Kind: Identifies what kind of resource this is. Value: the fixed
  9210. // string "dfareporting#remarketingListsListResponse".
  9211. Kind string `json:"kind,omitempty"`
  9212. // NextPageToken: Pagination token to be used for the next list
  9213. // operation.
  9214. NextPageToken string `json:"nextPageToken,omitempty"`
  9215. // RemarketingLists: Remarketing list collection.
  9216. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9217. // ServerResponse contains the HTTP response code and headers from the
  9218. // server.
  9219. googleapi.ServerResponse `json:"-"`
  9220. // ForceSendFields is a list of field names (e.g. "Kind") to
  9221. // unconditionally include in API requests. By default, fields with
  9222. // empty values are omitted from API requests. However, any non-pointer,
  9223. // non-interface field appearing in ForceSendFields will be sent to the
  9224. // server regardless of whether the field is empty or not. This may be
  9225. // used to include empty fields in Patch requests.
  9226. ForceSendFields []string `json:"-"`
  9227. // NullFields is a list of field names (e.g. "Kind") to include in API
  9228. // requests with the JSON null value. By default, fields with empty
  9229. // values are omitted from API requests. However, any field with an
  9230. // empty value appearing in NullFields will be sent to the server as
  9231. // null. It is an error if a field in this list has a non-empty value.
  9232. // This may be used to include null fields in Patch requests.
  9233. NullFields []string `json:"-"`
  9234. }
  9235. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9236. type NoMethod RemarketingListsListResponse
  9237. raw := NoMethod(*s)
  9238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9239. }
  9240. // Report: Represents a Report resource.
  9241. type Report struct {
  9242. // AccountId: The account ID to which this report belongs.
  9243. AccountId int64 `json:"accountId,omitempty,string"`
  9244. // Criteria: The report criteria for a report of type "STANDARD".
  9245. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9246. // CrossDimensionReachCriteria: The report criteria for a report of type
  9247. // "CROSS_DIMENSION_REACH".
  9248. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9249. // Delivery: The report's email delivery settings.
  9250. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9251. // Etag: The eTag of this response for caching purposes.
  9252. Etag string `json:"etag,omitempty"`
  9253. // FileName: The filename used when generating report files for this
  9254. // report.
  9255. FileName string `json:"fileName,omitempty"`
  9256. // FloodlightCriteria: The report criteria for a report of type
  9257. // "FLOODLIGHT".
  9258. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9259. // Format: The output format of the report. If not specified, default
  9260. // format is "CSV". Note that the actual format in the completed report
  9261. // file might differ if for instance the report's size exceeds the
  9262. // format's capabilities. "CSV" will then be the fallback format.
  9263. //
  9264. // Possible values:
  9265. // "CSV"
  9266. // "EXCEL"
  9267. Format string `json:"format,omitempty"`
  9268. // Id: The unique ID identifying this report resource.
  9269. Id int64 `json:"id,omitempty,string"`
  9270. // Kind: The kind of resource this is, in this case dfareporting#report.
  9271. Kind string `json:"kind,omitempty"`
  9272. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9273. // this report was last modified.
  9274. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9275. // Name: The name of the report.
  9276. Name string `json:"name,omitempty"`
  9277. // OwnerProfileId: The user profile id of the owner of this report.
  9278. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9279. // PathToConversionCriteria: The report criteria for a report of type
  9280. // "PATH_TO_CONVERSION".
  9281. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9282. // ReachCriteria: The report criteria for a report of type "REACH".
  9283. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9284. // Schedule: The report's schedule. Can only be set if the report's
  9285. // 'dateRange' is a relative date range and the relative date range is
  9286. // not "TODAY".
  9287. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9288. // SubAccountId: The subaccount ID to which this report belongs if
  9289. // applicable.
  9290. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9291. // Type: The type of the report.
  9292. //
  9293. // Possible values:
  9294. // "CROSS_DIMENSION_REACH"
  9295. // "FLOODLIGHT"
  9296. // "PATH_TO_CONVERSION"
  9297. // "REACH"
  9298. // "STANDARD"
  9299. Type string `json:"type,omitempty"`
  9300. // ServerResponse contains the HTTP response code and headers from the
  9301. // server.
  9302. googleapi.ServerResponse `json:"-"`
  9303. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9304. // unconditionally include in API requests. By default, fields with
  9305. // empty values are omitted from API requests. However, any non-pointer,
  9306. // non-interface field appearing in ForceSendFields will be sent to the
  9307. // server regardless of whether the field is empty or not. This may be
  9308. // used to include empty fields in Patch requests.
  9309. ForceSendFields []string `json:"-"`
  9310. // NullFields is a list of field names (e.g. "AccountId") to include in
  9311. // API requests with the JSON null value. By default, fields with empty
  9312. // values are omitted from API requests. However, any field with an
  9313. // empty value appearing in NullFields will be sent to the server as
  9314. // null. It is an error if a field in this list has a non-empty value.
  9315. // This may be used to include null fields in Patch requests.
  9316. NullFields []string `json:"-"`
  9317. }
  9318. func (s *Report) MarshalJSON() ([]byte, error) {
  9319. type NoMethod Report
  9320. raw := NoMethod(*s)
  9321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9322. }
  9323. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9324. type ReportCriteria struct {
  9325. // Activities: Activity group.
  9326. Activities *Activities `json:"activities,omitempty"`
  9327. // CustomRichMediaEvents: Custom Rich Media Events group.
  9328. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9329. // DateRange: The date range for which this report should be run.
  9330. DateRange *DateRange `json:"dateRange,omitempty"`
  9331. // DimensionFilters: The list of filters on which dimensions are
  9332. // filtered.
  9333. // Filters for different dimensions are ANDed, filters for the same
  9334. // dimension are grouped together and ORed.
  9335. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9336. // Dimensions: The list of standard dimensions the report should
  9337. // include.
  9338. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9339. // MetricNames: The list of names of metrics the report should include.
  9340. MetricNames []string `json:"metricNames,omitempty"`
  9341. // ForceSendFields is a list of field names (e.g. "Activities") to
  9342. // unconditionally include in API requests. By default, fields with
  9343. // empty values are omitted from API requests. However, any non-pointer,
  9344. // non-interface field appearing in ForceSendFields will be sent to the
  9345. // server regardless of whether the field is empty or not. This may be
  9346. // used to include empty fields in Patch requests.
  9347. ForceSendFields []string `json:"-"`
  9348. // NullFields is a list of field names (e.g. "Activities") to include in
  9349. // API requests with the JSON null value. By default, fields with empty
  9350. // values are omitted from API requests. However, any field with an
  9351. // empty value appearing in NullFields will be sent to the server as
  9352. // null. It is an error if a field in this list has a non-empty value.
  9353. // This may be used to include null fields in Patch requests.
  9354. NullFields []string `json:"-"`
  9355. }
  9356. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9357. type NoMethod ReportCriteria
  9358. raw := NoMethod(*s)
  9359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9360. }
  9361. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9362. // of type "CROSS_DIMENSION_REACH".
  9363. type ReportCrossDimensionReachCriteria struct {
  9364. // Breakdown: The list of dimensions the report should include.
  9365. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9366. // DateRange: The date range this report should be run for.
  9367. DateRange *DateRange `json:"dateRange,omitempty"`
  9368. // Dimension: The dimension option.
  9369. //
  9370. // Possible values:
  9371. // "ADVERTISER"
  9372. // "CAMPAIGN"
  9373. // "SITE_BY_ADVERTISER"
  9374. // "SITE_BY_CAMPAIGN"
  9375. Dimension string `json:"dimension,omitempty"`
  9376. // DimensionFilters: The list of filters on which dimensions are
  9377. // filtered.
  9378. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9379. // MetricNames: The list of names of metrics the report should include.
  9380. MetricNames []string `json:"metricNames,omitempty"`
  9381. // OverlapMetricNames: The list of names of overlap metrics the report
  9382. // should include.
  9383. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9384. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9385. Pivoted bool `json:"pivoted,omitempty"`
  9386. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9387. // unconditionally include in API requests. By default, fields with
  9388. // empty values are omitted from API requests. However, any non-pointer,
  9389. // non-interface field appearing in ForceSendFields will be sent to the
  9390. // server regardless of whether the field is empty or not. This may be
  9391. // used to include empty fields in Patch requests.
  9392. ForceSendFields []string `json:"-"`
  9393. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9394. // API requests with the JSON null value. By default, fields with empty
  9395. // values are omitted from API requests. However, any field with an
  9396. // empty value appearing in NullFields will be sent to the server as
  9397. // null. It is an error if a field in this list has a non-empty value.
  9398. // This may be used to include null fields in Patch requests.
  9399. NullFields []string `json:"-"`
  9400. }
  9401. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9402. type NoMethod ReportCrossDimensionReachCriteria
  9403. raw := NoMethod(*s)
  9404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9405. }
  9406. // ReportDelivery: The report's email delivery settings.
  9407. type ReportDelivery struct {
  9408. // EmailOwner: Whether the report should be emailed to the report owner.
  9409. EmailOwner bool `json:"emailOwner,omitempty"`
  9410. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9411. // receive, if enabled.
  9412. //
  9413. // Possible values:
  9414. // "ATTACHMENT"
  9415. // "LINK"
  9416. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9417. // Message: The message to be sent with each email.
  9418. Message string `json:"message,omitempty"`
  9419. // Recipients: The list of recipients to which to email the report.
  9420. Recipients []*Recipient `json:"recipients,omitempty"`
  9421. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9422. // unconditionally include in API requests. By default, fields with
  9423. // empty values are omitted from API requests. However, any non-pointer,
  9424. // non-interface field appearing in ForceSendFields will be sent to the
  9425. // server regardless of whether the field is empty or not. This may be
  9426. // used to include empty fields in Patch requests.
  9427. ForceSendFields []string `json:"-"`
  9428. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9429. // API requests with the JSON null value. By default, fields with empty
  9430. // values are omitted from API requests. However, any field with an
  9431. // empty value appearing in NullFields will be sent to the server as
  9432. // null. It is an error if a field in this list has a non-empty value.
  9433. // This may be used to include null fields in Patch requests.
  9434. NullFields []string `json:"-"`
  9435. }
  9436. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9437. type NoMethod ReportDelivery
  9438. raw := NoMethod(*s)
  9439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9440. }
  9441. // ReportFloodlightCriteria: The report criteria for a report of type
  9442. // "FLOODLIGHT".
  9443. type ReportFloodlightCriteria struct {
  9444. // CustomRichMediaEvents: The list of custom rich media events to
  9445. // include.
  9446. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9447. // DateRange: The date range this report should be run for.
  9448. DateRange *DateRange `json:"dateRange,omitempty"`
  9449. // DimensionFilters: The list of filters on which dimensions are
  9450. // filtered.
  9451. // Filters for different dimensions are ANDed, filters for the same
  9452. // dimension are grouped together and ORed.
  9453. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9454. // Dimensions: The list of dimensions the report should include.
  9455. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9456. // FloodlightConfigId: The floodlight ID for which to show data in this
  9457. // report. All advertisers associated with that ID will automatically be
  9458. // added. The dimension of the value needs to be
  9459. // 'dfa:floodlightConfigId'.
  9460. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9461. // MetricNames: The list of names of metrics the report should include.
  9462. MetricNames []string `json:"metricNames,omitempty"`
  9463. // ReportProperties: The properties of the report.
  9464. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9465. // ForceSendFields is a list of field names (e.g.
  9466. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9467. // By default, fields with empty values are omitted from API requests.
  9468. // However, any non-pointer, non-interface field appearing in
  9469. // ForceSendFields will be sent to the server regardless of whether the
  9470. // field is empty or not. This may be used to include empty fields in
  9471. // Patch requests.
  9472. ForceSendFields []string `json:"-"`
  9473. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9474. // include in API requests with the JSON null value. By default, fields
  9475. // with empty values are omitted from API requests. However, any field
  9476. // with an empty value appearing in NullFields will be sent to the
  9477. // server as null. It is an error if a field in this list has a
  9478. // non-empty value. This may be used to include null fields in Patch
  9479. // requests.
  9480. NullFields []string `json:"-"`
  9481. }
  9482. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9483. type NoMethod ReportFloodlightCriteria
  9484. raw := NoMethod(*s)
  9485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9486. }
  9487. // ReportFloodlightCriteriaReportProperties: The properties of the
  9488. // report.
  9489. type ReportFloodlightCriteriaReportProperties struct {
  9490. // IncludeAttributedIPConversions: Include conversions that have no
  9491. // cookie, but do have an exposure path.
  9492. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9493. // IncludeUnattributedCookieConversions: Include conversions of users
  9494. // with a DoubleClick cookie but without an exposure. That means the
  9495. // user did not click or see an ad from the advertiser within the
  9496. // Floodlight group, or that the interaction happened outside the
  9497. // lookback window.
  9498. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9499. // IncludeUnattributedIPConversions: Include conversions that have no
  9500. // associated cookies and no exposures. It’s therefore impossible to
  9501. // know how the user was exposed to your ads during the lookback window
  9502. // prior to a conversion.
  9503. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9504. // ForceSendFields is a list of field names (e.g.
  9505. // "IncludeAttributedIPConversions") to unconditionally include in API
  9506. // requests. By default, fields with empty values are omitted from API
  9507. // requests. However, any non-pointer, non-interface field appearing in
  9508. // ForceSendFields will be sent to the server regardless of whether the
  9509. // field is empty or not. This may be used to include empty fields in
  9510. // Patch requests.
  9511. ForceSendFields []string `json:"-"`
  9512. // NullFields is a list of field names (e.g.
  9513. // "IncludeAttributedIPConversions") to include in API requests with the
  9514. // JSON null value. By default, fields with empty values are omitted
  9515. // from API requests. However, any field with an empty value appearing
  9516. // in NullFields will be sent to the server as null. It is an error if a
  9517. // field in this list has a non-empty value. This may be used to include
  9518. // null fields in Patch requests.
  9519. NullFields []string `json:"-"`
  9520. }
  9521. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9522. type NoMethod ReportFloodlightCriteriaReportProperties
  9523. raw := NoMethod(*s)
  9524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9525. }
  9526. // ReportPathToConversionCriteria: The report criteria for a report of
  9527. // type "PATH_TO_CONVERSION".
  9528. type ReportPathToConversionCriteria struct {
  9529. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9530. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9531. // ConversionDimensions: The list of conversion dimensions the report
  9532. // should include.
  9533. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9534. // CustomFloodlightVariables: The list of custom floodlight variables
  9535. // the report should include.
  9536. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9537. // CustomRichMediaEvents: The list of custom rich media events to
  9538. // include.
  9539. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9540. // DateRange: The date range this report should be run for.
  9541. DateRange *DateRange `json:"dateRange,omitempty"`
  9542. // FloodlightConfigId: The floodlight ID for which to show data in this
  9543. // report. All advertisers associated with that ID will automatically be
  9544. // added. The dimension of the value needs to be
  9545. // 'dfa:floodlightConfigId'.
  9546. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9547. // MetricNames: The list of names of metrics the report should include.
  9548. MetricNames []string `json:"metricNames,omitempty"`
  9549. // PerInteractionDimensions: The list of per interaction dimensions the
  9550. // report should include.
  9551. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9552. // ReportProperties: The properties of the report.
  9553. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9554. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9555. // unconditionally include in API requests. By default, fields with
  9556. // empty values are omitted from API requests. However, any non-pointer,
  9557. // non-interface field appearing in ForceSendFields will be sent to the
  9558. // server regardless of whether the field is empty or not. This may be
  9559. // used to include empty fields in Patch requests.
  9560. ForceSendFields []string `json:"-"`
  9561. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9562. // include in API requests with the JSON null value. By default, fields
  9563. // with empty values are omitted from API requests. However, any field
  9564. // with an empty value appearing in NullFields will be sent to the
  9565. // server as null. It is an error if a field in this list has a
  9566. // non-empty value. This may be used to include null fields in Patch
  9567. // requests.
  9568. NullFields []string `json:"-"`
  9569. }
  9570. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9571. type NoMethod ReportPathToConversionCriteria
  9572. raw := NoMethod(*s)
  9573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9574. }
  9575. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9576. // report.
  9577. type ReportPathToConversionCriteriaReportProperties struct {
  9578. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9579. // occurred within the specified period of time before a conversion. By
  9580. // default the value is pulled from Floodlight or you can manually enter
  9581. // a custom value. Valid values: 1-90.
  9582. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9583. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9584. // interaction occurred within the specified period of time before a
  9585. // conversion. By default the value is pulled from Floodlight or you can
  9586. // manually enter a custom value. Valid values: 1-90.
  9587. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9588. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9589. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9590. // IncludeUnattributedCookieConversions: Include conversions of users
  9591. // with a DoubleClick cookie but without an exposure. That means the
  9592. // user did not click or see an ad from the advertiser within the
  9593. // Floodlight group, or that the interaction happened outside the
  9594. // lookback window.
  9595. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9596. // IncludeUnattributedIPConversions: Include conversions that have no
  9597. // associated cookies and no exposures. It’s therefore impossible to
  9598. // know how the user was exposed to your ads during the lookback window
  9599. // prior to a conversion.
  9600. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9601. // MaximumClickInteractions: The maximum number of click interactions to
  9602. // include in the report. Advertisers currently paying for E2C reports
  9603. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9604. // your network is paying for E2C, you can have up to 5 total exposures
  9605. // per report.
  9606. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9607. // MaximumImpressionInteractions: The maximum number of click
  9608. // interactions to include in the report. Advertisers currently paying
  9609. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9610. // another advertiser in your network is paying for E2C, you can have up
  9611. // to 5 total exposures per report.
  9612. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9613. // MaximumInteractionGap: The maximum amount of time that can take place
  9614. // between interactions (clicks or impressions) by the same user. Valid
  9615. // values: 1-90.
  9616. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9617. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9618. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9619. // ForceSendFields is a list of field names (e.g.
  9620. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9621. // By default, fields with empty values are omitted from API requests.
  9622. // However, any non-pointer, non-interface field appearing in
  9623. // ForceSendFields will be sent to the server regardless of whether the
  9624. // field is empty or not. This may be used to include empty fields in
  9625. // Patch requests.
  9626. ForceSendFields []string `json:"-"`
  9627. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  9628. // include in API requests with the JSON null value. By default, fields
  9629. // with empty values are omitted from API requests. However, any field
  9630. // with an empty value appearing in NullFields will be sent to the
  9631. // server as null. It is an error if a field in this list has a
  9632. // non-empty value. This may be used to include null fields in Patch
  9633. // requests.
  9634. NullFields []string `json:"-"`
  9635. }
  9636. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9637. type NoMethod ReportPathToConversionCriteriaReportProperties
  9638. raw := NoMethod(*s)
  9639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9640. }
  9641. // ReportReachCriteria: The report criteria for a report of type
  9642. // "REACH".
  9643. type ReportReachCriteria struct {
  9644. // Activities: Activity group.
  9645. Activities *Activities `json:"activities,omitempty"`
  9646. // CustomRichMediaEvents: Custom Rich Media Events group.
  9647. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9648. // DateRange: The date range this report should be run for.
  9649. DateRange *DateRange `json:"dateRange,omitempty"`
  9650. // DimensionFilters: The list of filters on which dimensions are
  9651. // filtered.
  9652. // Filters for different dimensions are ANDed, filters for the same
  9653. // dimension are grouped together and ORed.
  9654. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9655. // Dimensions: The list of dimensions the report should include.
  9656. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9657. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  9658. // combinations in the report. Defaults to false. If enabled, the date
  9659. // range of the report should be within the last three months.
  9660. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  9661. // MetricNames: The list of names of metrics the report should include.
  9662. MetricNames []string `json:"metricNames,omitempty"`
  9663. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  9664. // metrics the report should include.
  9665. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  9666. // ForceSendFields is a list of field names (e.g. "Activities") to
  9667. // unconditionally include in API requests. By default, fields with
  9668. // empty values are omitted from API requests. However, any non-pointer,
  9669. // non-interface field appearing in ForceSendFields will be sent to the
  9670. // server regardless of whether the field is empty or not. This may be
  9671. // used to include empty fields in Patch requests.
  9672. ForceSendFields []string `json:"-"`
  9673. // NullFields is a list of field names (e.g. "Activities") to include in
  9674. // API requests with the JSON null value. By default, fields with empty
  9675. // values are omitted from API requests. However, any field with an
  9676. // empty value appearing in NullFields will be sent to the server as
  9677. // null. It is an error if a field in this list has a non-empty value.
  9678. // This may be used to include null fields in Patch requests.
  9679. NullFields []string `json:"-"`
  9680. }
  9681. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  9682. type NoMethod ReportReachCriteria
  9683. raw := NoMethod(*s)
  9684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9685. }
  9686. // ReportSchedule: The report's schedule. Can only be set if the
  9687. // report's 'dateRange' is a relative date range and the relative date
  9688. // range is not "TODAY".
  9689. type ReportSchedule struct {
  9690. // Active: Whether the schedule is active or not. Must be set to either
  9691. // true or false.
  9692. Active bool `json:"active,omitempty"`
  9693. // Every: Defines every how many days, weeks or months the report should
  9694. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  9695. // "MONTHLY".
  9696. Every int64 `json:"every,omitempty"`
  9697. // ExpirationDate: The expiration date when the scheduled report stops
  9698. // running.
  9699. ExpirationDate string `json:"expirationDate,omitempty"`
  9700. // Repeats: The interval for which the report is repeated. Note:
  9701. // - "DAILY" also requires field "every" to be set.
  9702. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  9703. // set.
  9704. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  9705. // set.
  9706. Repeats string `json:"repeats,omitempty"`
  9707. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  9708. // reports should run.
  9709. //
  9710. // Possible values:
  9711. // "FRIDAY"
  9712. // "MONDAY"
  9713. // "SATURDAY"
  9714. // "SUNDAY"
  9715. // "THURSDAY"
  9716. // "TUESDAY"
  9717. // "WEDNESDAY"
  9718. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  9719. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  9720. // whether reports should be repeated on the same day of the month as
  9721. // "startDate" or the same day of the week of the month.
  9722. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  9723. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  9724. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  9725. // Monday of the month.
  9726. //
  9727. // Possible values:
  9728. // "DAY_OF_MONTH"
  9729. // "WEEK_OF_MONTH"
  9730. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  9731. // StartDate: Start date of date range for which scheduled reports
  9732. // should be run.
  9733. StartDate string `json:"startDate,omitempty"`
  9734. // ForceSendFields is a list of field names (e.g. "Active") to
  9735. // unconditionally include in API requests. By default, fields with
  9736. // empty values are omitted from API requests. However, any non-pointer,
  9737. // non-interface field appearing in ForceSendFields will be sent to the
  9738. // server regardless of whether the field is empty or not. This may be
  9739. // used to include empty fields in Patch requests.
  9740. ForceSendFields []string `json:"-"`
  9741. // NullFields is a list of field names (e.g. "Active") to include in API
  9742. // requests with the JSON null value. By default, fields with empty
  9743. // values are omitted from API requests. However, any field with an
  9744. // empty value appearing in NullFields will be sent to the server as
  9745. // null. It is an error if a field in this list has a non-empty value.
  9746. // This may be used to include null fields in Patch requests.
  9747. NullFields []string `json:"-"`
  9748. }
  9749. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  9750. type NoMethod ReportSchedule
  9751. raw := NoMethod(*s)
  9752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9753. }
  9754. // ReportCompatibleFields: Represents fields that are compatible to be
  9755. // selected for a report of type "STANDARD".
  9756. type ReportCompatibleFields struct {
  9757. // DimensionFilters: Dimensions which are compatible to be selected in
  9758. // the "dimensionFilters" section of the report.
  9759. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9760. // Dimensions: Dimensions which are compatible to be selected in the
  9761. // "dimensions" section of the report.
  9762. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9763. // Kind: The kind of resource this is, in this case
  9764. // dfareporting#reportCompatibleFields.
  9765. Kind string `json:"kind,omitempty"`
  9766. // Metrics: Metrics which are compatible to be selected in the
  9767. // "metricNames" section of the report.
  9768. Metrics []*Metric `json:"metrics,omitempty"`
  9769. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9770. // as activity metrics to pivot on in the "activities" section of the
  9771. // report.
  9772. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9773. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9774. // unconditionally include in API requests. By default, fields with
  9775. // empty values are omitted from API requests. However, any non-pointer,
  9776. // non-interface field appearing in ForceSendFields will be sent to the
  9777. // server regardless of whether the field is empty or not. This may be
  9778. // used to include empty fields in Patch requests.
  9779. ForceSendFields []string `json:"-"`
  9780. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9781. // include in API requests with the JSON null value. By default, fields
  9782. // with empty values are omitted from API requests. However, any field
  9783. // with an empty value appearing in NullFields will be sent to the
  9784. // server as null. It is an error if a field in this list has a
  9785. // non-empty value. This may be used to include null fields in Patch
  9786. // requests.
  9787. NullFields []string `json:"-"`
  9788. }
  9789. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9790. type NoMethod ReportCompatibleFields
  9791. raw := NoMethod(*s)
  9792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9793. }
  9794. // ReportList: Represents the list of reports.
  9795. type ReportList struct {
  9796. // Etag: The eTag of this response for caching purposes.
  9797. Etag string `json:"etag,omitempty"`
  9798. // Items: The reports returned in this response.
  9799. Items []*Report `json:"items,omitempty"`
  9800. // Kind: The kind of list this is, in this case dfareporting#reportList.
  9801. Kind string `json:"kind,omitempty"`
  9802. // NextPageToken: Continuation token used to page through reports. To
  9803. // retrieve the next page of results, set the next request's "pageToken"
  9804. // to the value of this field. The page token is only valid for a
  9805. // limited amount of time and should not be persisted.
  9806. NextPageToken string `json:"nextPageToken,omitempty"`
  9807. // ServerResponse contains the HTTP response code and headers from the
  9808. // server.
  9809. googleapi.ServerResponse `json:"-"`
  9810. // ForceSendFields is a list of field names (e.g. "Etag") to
  9811. // unconditionally include in API requests. By default, fields with
  9812. // empty values are omitted from API requests. However, any non-pointer,
  9813. // non-interface field appearing in ForceSendFields will be sent to the
  9814. // server regardless of whether the field is empty or not. This may be
  9815. // used to include empty fields in Patch requests.
  9816. ForceSendFields []string `json:"-"`
  9817. // NullFields is a list of field names (e.g. "Etag") to include in API
  9818. // requests with the JSON null value. By default, fields with empty
  9819. // values are omitted from API requests. However, any field with an
  9820. // empty value appearing in NullFields will be sent to the server as
  9821. // null. It is an error if a field in this list has a non-empty value.
  9822. // This may be used to include null fields in Patch requests.
  9823. NullFields []string `json:"-"`
  9824. }
  9825. func (s *ReportList) MarshalJSON() ([]byte, error) {
  9826. type NoMethod ReportList
  9827. raw := NoMethod(*s)
  9828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9829. }
  9830. // ReportsConfiguration: Reporting Configuration
  9831. type ReportsConfiguration struct {
  9832. // ExposureToConversionEnabled: Whether the exposure to conversion
  9833. // report is enabled. This report shows detailed pathway information on
  9834. // up to 10 of the most recent ad exposures seen by a user before
  9835. // converting.
  9836. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  9837. // LookbackConfiguration: Default lookback windows for new advertisers
  9838. // in this account.
  9839. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  9840. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  9841. // account. This is a required field that can only be changed by a
  9842. // superuser.
  9843. // Acceptable values are:
  9844. //
  9845. // - "1" for "America/New_York"
  9846. // - "2" for "Europe/London"
  9847. // - "3" for "Europe/Paris"
  9848. // - "4" for "Africa/Johannesburg"
  9849. // - "5" for "Asia/Jerusalem"
  9850. // - "6" for "Asia/Shanghai"
  9851. // - "7" for "Asia/Hong_Kong"
  9852. // - "8" for "Asia/Tokyo"
  9853. // - "9" for "Australia/Sydney"
  9854. // - "10" for "Asia/Dubai"
  9855. // - "11" for "America/Los_Angeles"
  9856. // - "12" for "Pacific/Auckland"
  9857. // - "13" for "America/Sao_Paulo"
  9858. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  9859. // ForceSendFields is a list of field names (e.g.
  9860. // "ExposureToConversionEnabled") to unconditionally include in API
  9861. // requests. By default, fields with empty values are omitted from API
  9862. // requests. However, any non-pointer, non-interface field appearing in
  9863. // ForceSendFields will be sent to the server regardless of whether the
  9864. // field is empty or not. This may be used to include empty fields in
  9865. // Patch requests.
  9866. ForceSendFields []string `json:"-"`
  9867. // NullFields is a list of field names (e.g.
  9868. // "ExposureToConversionEnabled") to include in API requests with the
  9869. // JSON null value. By default, fields with empty values are omitted
  9870. // from API requests. However, any field with an empty value appearing
  9871. // in NullFields will be sent to the server as null. It is an error if a
  9872. // field in this list has a non-empty value. This may be used to include
  9873. // null fields in Patch requests.
  9874. NullFields []string `json:"-"`
  9875. }
  9876. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  9877. type NoMethod ReportsConfiguration
  9878. raw := NoMethod(*s)
  9879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9880. }
  9881. // RichMediaExitOverride: Rich Media Exit Override.
  9882. type RichMediaExitOverride struct {
  9883. // ClickThroughUrl: Click-through URL of this rich media exit override.
  9884. // Applicable if the enabled field is set to true.
  9885. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  9886. // Enabled: Whether to use the clickThroughUrl. If false, the
  9887. // creative-level exit will be used.
  9888. Enabled bool `json:"enabled,omitempty"`
  9889. // ExitId: ID for the override to refer to a specific exit in the
  9890. // creative.
  9891. ExitId int64 `json:"exitId,omitempty,string"`
  9892. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  9893. // unconditionally include in API requests. By default, fields with
  9894. // empty values are omitted from API requests. However, any non-pointer,
  9895. // non-interface field appearing in ForceSendFields will be sent to the
  9896. // server regardless of whether the field is empty or not. This may be
  9897. // used to include empty fields in Patch requests.
  9898. ForceSendFields []string `json:"-"`
  9899. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  9900. // include in API requests with the JSON null value. By default, fields
  9901. // with empty values are omitted from API requests. However, any field
  9902. // with an empty value appearing in NullFields will be sent to the
  9903. // server as null. It is an error if a field in this list has a
  9904. // non-empty value. This may be used to include null fields in Patch
  9905. // requests.
  9906. NullFields []string `json:"-"`
  9907. }
  9908. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  9909. type NoMethod RichMediaExitOverride
  9910. raw := NoMethod(*s)
  9911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9912. }
  9913. // Rule: A rule associates an asset with a targeting template for
  9914. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  9915. type Rule struct {
  9916. // AssetId: A creativeAssets[].id. This should refer to one of the
  9917. // parent assets in this creative. This is a required field.
  9918. AssetId int64 `json:"assetId,omitempty,string"`
  9919. // Name: A user-friendly name for this rule. This is a required field.
  9920. Name string `json:"name,omitempty"`
  9921. // TargetingTemplateId: A targeting template ID. The targeting from the
  9922. // targeting template will be used to determine whether this asset
  9923. // should be served. This is a required field.
  9924. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  9925. // ForceSendFields is a list of field names (e.g. "AssetId") to
  9926. // unconditionally include in API requests. By default, fields with
  9927. // empty values are omitted from API requests. However, any non-pointer,
  9928. // non-interface field appearing in ForceSendFields will be sent to the
  9929. // server regardless of whether the field is empty or not. This may be
  9930. // used to include empty fields in Patch requests.
  9931. ForceSendFields []string `json:"-"`
  9932. // NullFields is a list of field names (e.g. "AssetId") to include in
  9933. // API requests with the JSON null value. By default, fields with empty
  9934. // values are omitted from API requests. However, any field with an
  9935. // empty value appearing in NullFields will be sent to the server as
  9936. // null. It is an error if a field in this list has a non-empty value.
  9937. // This may be used to include null fields in Patch requests.
  9938. NullFields []string `json:"-"`
  9939. }
  9940. func (s *Rule) MarshalJSON() ([]byte, error) {
  9941. type NoMethod Rule
  9942. raw := NoMethod(*s)
  9943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9944. }
  9945. // Site: Contains properties of a site.
  9946. type Site struct {
  9947. // AccountId: Account ID of this site. This is a read-only field that
  9948. // can be left blank.
  9949. AccountId int64 `json:"accountId,omitempty,string"`
  9950. // Approved: Whether this site is approved.
  9951. Approved bool `json:"approved,omitempty"`
  9952. // DirectorySiteId: Directory site associated with this site. This is a
  9953. // required field that is read-only after insertion.
  9954. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  9955. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  9956. // directory site. This is a read-only, auto-generated field.
  9957. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  9958. // Id: ID of this site. This is a read-only, auto-generated field.
  9959. Id int64 `json:"id,omitempty,string"`
  9960. // IdDimensionValue: Dimension value for the ID of this site. This is a
  9961. // read-only, auto-generated field.
  9962. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  9963. // KeyName: Key name of this site. This is a read-only, auto-generated
  9964. // field.
  9965. KeyName string `json:"keyName,omitempty"`
  9966. // Kind: Identifies what kind of resource this is. Value: the fixed
  9967. // string "dfareporting#site".
  9968. Kind string `json:"kind,omitempty"`
  9969. // Name: Name of this site.This is a required field. Must be less than
  9970. // 128 characters long. If this site is under a subaccount, the name
  9971. // must be unique among sites of the same subaccount. Otherwise, this
  9972. // site is a top-level site, and the name must be unique among top-level
  9973. // sites of the same account.
  9974. Name string `json:"name,omitempty"`
  9975. // SiteContacts: Site contacts.
  9976. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  9977. // SiteSettings: Site-wide settings.
  9978. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  9979. // SubaccountId: Subaccount ID of this site. This is a read-only field
  9980. // that can be left blank.
  9981. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9982. // ServerResponse contains the HTTP response code and headers from the
  9983. // server.
  9984. googleapi.ServerResponse `json:"-"`
  9985. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9986. // unconditionally include in API requests. By default, fields with
  9987. // empty values are omitted from API requests. However, any non-pointer,
  9988. // non-interface field appearing in ForceSendFields will be sent to the
  9989. // server regardless of whether the field is empty or not. This may be
  9990. // used to include empty fields in Patch requests.
  9991. ForceSendFields []string `json:"-"`
  9992. // NullFields is a list of field names (e.g. "AccountId") to include in
  9993. // API requests with the JSON null value. By default, fields with empty
  9994. // values are omitted from API requests. However, any field with an
  9995. // empty value appearing in NullFields will be sent to the server as
  9996. // null. It is an error if a field in this list has a non-empty value.
  9997. // This may be used to include null fields in Patch requests.
  9998. NullFields []string `json:"-"`
  9999. }
  10000. func (s *Site) MarshalJSON() ([]byte, error) {
  10001. type NoMethod Site
  10002. raw := NoMethod(*s)
  10003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10004. }
  10005. // SiteContact: Site Contact
  10006. type SiteContact struct {
  10007. // Address: Address of this site contact.
  10008. Address string `json:"address,omitempty"`
  10009. // ContactType: Site contact type.
  10010. //
  10011. // Possible values:
  10012. // "SALES_PERSON"
  10013. // "TRAFFICKER"
  10014. ContactType string `json:"contactType,omitempty"`
  10015. // Email: Email address of this site contact. This is a required field.
  10016. Email string `json:"email,omitempty"`
  10017. // FirstName: First name of this site contact.
  10018. FirstName string `json:"firstName,omitempty"`
  10019. // Id: ID of this site contact. This is a read-only, auto-generated
  10020. // field.
  10021. Id int64 `json:"id,omitempty,string"`
  10022. // LastName: Last name of this site contact.
  10023. LastName string `json:"lastName,omitempty"`
  10024. // Phone: Primary phone number of this site contact.
  10025. Phone string `json:"phone,omitempty"`
  10026. // Title: Title or designation of this site contact.
  10027. Title string `json:"title,omitempty"`
  10028. // ForceSendFields is a list of field names (e.g. "Address") to
  10029. // unconditionally include in API requests. By default, fields with
  10030. // empty values are omitted from API requests. However, any non-pointer,
  10031. // non-interface field appearing in ForceSendFields will be sent to the
  10032. // server regardless of whether the field is empty or not. This may be
  10033. // used to include empty fields in Patch requests.
  10034. ForceSendFields []string `json:"-"`
  10035. // NullFields is a list of field names (e.g. "Address") to include in
  10036. // API requests with the JSON null value. By default, fields with empty
  10037. // values are omitted from API requests. However, any field with an
  10038. // empty value appearing in NullFields will be sent to the server as
  10039. // null. It is an error if a field in this list has a non-empty value.
  10040. // This may be used to include null fields in Patch requests.
  10041. NullFields []string `json:"-"`
  10042. }
  10043. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10044. type NoMethod SiteContact
  10045. raw := NoMethod(*s)
  10046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10047. }
  10048. // SiteSettings: Site Settings
  10049. type SiteSettings struct {
  10050. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10051. // site.
  10052. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10053. // CreativeSettings: Site-wide creative settings.
  10054. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10055. // DisableBrandSafeAds: Whether brand safe ads are disabled for this
  10056. // site.
  10057. DisableBrandSafeAds bool `json:"disableBrandSafeAds,omitempty"`
  10058. // DisableNewCookie: Whether new cookies are disabled for this site.
  10059. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10060. // LookbackConfiguration: Lookback window settings for this site.
  10061. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10062. // TagSetting: Configuration settings for dynamic and image floodlight
  10063. // tags.
  10064. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10065. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10066. // for in-stream video creatives are disabled by default for new
  10067. // placements created under this site. This value will be used to
  10068. // populate the placement.videoActiveViewOptOut field, when no value is
  10069. // specified for the new placement.
  10070. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10071. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10072. // placements created under this site. This value will be used to
  10073. // populate the placements.vpaidAdapterChoice field, when no value is
  10074. // specified for the new placement. Controls which VPAID format the
  10075. // measurement adapter will use for in-stream video creatives assigned
  10076. // to the placement. The publisher's specifications will typically
  10077. // determine this setting. For VPAID creatives, the adapter format will
  10078. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10079. // adapter).
  10080. //
  10081. // Note: Flash is no longer supported. This field now defaults to HTML5
  10082. // when the following values are provided: FLASH, BOTH.
  10083. //
  10084. // Possible values:
  10085. // "BOTH"
  10086. // "DEFAULT"
  10087. // "FLASH"
  10088. // "HTML5"
  10089. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10090. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10091. // unconditionally include in API requests. By default, fields with
  10092. // empty values are omitted from API requests. However, any non-pointer,
  10093. // non-interface field appearing in ForceSendFields will be sent to the
  10094. // server regardless of whether the field is empty or not. This may be
  10095. // used to include empty fields in Patch requests.
  10096. ForceSendFields []string `json:"-"`
  10097. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10098. // include in API requests with the JSON null value. By default, fields
  10099. // with empty values are omitted from API requests. However, any field
  10100. // with an empty value appearing in NullFields will be sent to the
  10101. // server as null. It is an error if a field in this list has a
  10102. // non-empty value. This may be used to include null fields in Patch
  10103. // requests.
  10104. NullFields []string `json:"-"`
  10105. }
  10106. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10107. type NoMethod SiteSettings
  10108. raw := NoMethod(*s)
  10109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10110. }
  10111. // SitesListResponse: Site List Response
  10112. type SitesListResponse struct {
  10113. // Kind: Identifies what kind of resource this is. Value: the fixed
  10114. // string "dfareporting#sitesListResponse".
  10115. Kind string `json:"kind,omitempty"`
  10116. // NextPageToken: Pagination token to be used for the next list
  10117. // operation.
  10118. NextPageToken string `json:"nextPageToken,omitempty"`
  10119. // Sites: Site collection.
  10120. Sites []*Site `json:"sites,omitempty"`
  10121. // ServerResponse contains the HTTP response code and headers from the
  10122. // server.
  10123. googleapi.ServerResponse `json:"-"`
  10124. // ForceSendFields is a list of field names (e.g. "Kind") to
  10125. // unconditionally include in API requests. By default, fields with
  10126. // empty values are omitted from API requests. However, any non-pointer,
  10127. // non-interface field appearing in ForceSendFields will be sent to the
  10128. // server regardless of whether the field is empty or not. This may be
  10129. // used to include empty fields in Patch requests.
  10130. ForceSendFields []string `json:"-"`
  10131. // NullFields is a list of field names (e.g. "Kind") to include in API
  10132. // requests with the JSON null value. By default, fields with empty
  10133. // values are omitted from API requests. However, any field with an
  10134. // empty value appearing in NullFields will be sent to the server as
  10135. // null. It is an error if a field in this list has a non-empty value.
  10136. // This may be used to include null fields in Patch requests.
  10137. NullFields []string `json:"-"`
  10138. }
  10139. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10140. type NoMethod SitesListResponse
  10141. raw := NoMethod(*s)
  10142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10143. }
  10144. // Size: Represents the dimensions of ads, placements, creatives, or
  10145. // creative assets.
  10146. type Size struct {
  10147. // Height: Height of this size. Acceptable values are 0 to 32767,
  10148. // inclusive.
  10149. Height int64 `json:"height,omitempty"`
  10150. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10151. Iab bool `json:"iab,omitempty"`
  10152. // Id: ID of this size. This is a read-only, auto-generated field.
  10153. Id int64 `json:"id,omitempty,string"`
  10154. // Kind: Identifies what kind of resource this is. Value: the fixed
  10155. // string "dfareporting#size".
  10156. Kind string `json:"kind,omitempty"`
  10157. // Width: Width of this size. Acceptable values are 0 to 32767,
  10158. // inclusive.
  10159. Width int64 `json:"width,omitempty"`
  10160. // ServerResponse contains the HTTP response code and headers from the
  10161. // server.
  10162. googleapi.ServerResponse `json:"-"`
  10163. // ForceSendFields is a list of field names (e.g. "Height") to
  10164. // unconditionally include in API requests. By default, fields with
  10165. // empty values are omitted from API requests. However, any non-pointer,
  10166. // non-interface field appearing in ForceSendFields will be sent to the
  10167. // server regardless of whether the field is empty or not. This may be
  10168. // used to include empty fields in Patch requests.
  10169. ForceSendFields []string `json:"-"`
  10170. // NullFields is a list of field names (e.g. "Height") to include in API
  10171. // requests with the JSON null value. By default, fields with empty
  10172. // values are omitted from API requests. However, any field with an
  10173. // empty value appearing in NullFields will be sent to the server as
  10174. // null. It is an error if a field in this list has a non-empty value.
  10175. // This may be used to include null fields in Patch requests.
  10176. NullFields []string `json:"-"`
  10177. }
  10178. func (s *Size) MarshalJSON() ([]byte, error) {
  10179. type NoMethod Size
  10180. raw := NoMethod(*s)
  10181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10182. }
  10183. // SizesListResponse: Size List Response
  10184. type SizesListResponse struct {
  10185. // Kind: Identifies what kind of resource this is. Value: the fixed
  10186. // string "dfareporting#sizesListResponse".
  10187. Kind string `json:"kind,omitempty"`
  10188. // Sizes: Size collection.
  10189. Sizes []*Size `json:"sizes,omitempty"`
  10190. // ServerResponse contains the HTTP response code and headers from the
  10191. // server.
  10192. googleapi.ServerResponse `json:"-"`
  10193. // ForceSendFields is a list of field names (e.g. "Kind") to
  10194. // unconditionally include in API requests. By default, fields with
  10195. // empty values are omitted from API requests. However, any non-pointer,
  10196. // non-interface field appearing in ForceSendFields will be sent to the
  10197. // server regardless of whether the field is empty or not. This may be
  10198. // used to include empty fields in Patch requests.
  10199. ForceSendFields []string `json:"-"`
  10200. // NullFields is a list of field names (e.g. "Kind") to include in API
  10201. // requests with the JSON null value. By default, fields with empty
  10202. // values are omitted from API requests. However, any field with an
  10203. // empty value appearing in NullFields will be sent to the server as
  10204. // null. It is an error if a field in this list has a non-empty value.
  10205. // This may be used to include null fields in Patch requests.
  10206. NullFields []string `json:"-"`
  10207. }
  10208. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10209. type NoMethod SizesListResponse
  10210. raw := NoMethod(*s)
  10211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10212. }
  10213. // SkippableSetting: Skippable Settings
  10214. type SkippableSetting struct {
  10215. // Kind: Identifies what kind of resource this is. Value: the fixed
  10216. // string "dfareporting#skippableSetting".
  10217. Kind string `json:"kind,omitempty"`
  10218. // ProgressOffset: Amount of time to play videos served to this
  10219. // placement before counting a view. Applicable when skippable is true.
  10220. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10221. // SkipOffset: Amount of time to play videos served to this placement
  10222. // before the skip button should appear. Applicable when skippable is
  10223. // true.
  10224. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10225. // Skippable: Whether the user can skip creatives served to this
  10226. // placement.
  10227. Skippable bool `json:"skippable,omitempty"`
  10228. // ForceSendFields is a list of field names (e.g. "Kind") to
  10229. // unconditionally include in API requests. By default, fields with
  10230. // empty values are omitted from API requests. However, any non-pointer,
  10231. // non-interface field appearing in ForceSendFields will be sent to the
  10232. // server regardless of whether the field is empty or not. This may be
  10233. // used to include empty fields in Patch requests.
  10234. ForceSendFields []string `json:"-"`
  10235. // NullFields is a list of field names (e.g. "Kind") to include in API
  10236. // requests with the JSON null value. By default, fields with empty
  10237. // values are omitted from API requests. However, any field with an
  10238. // empty value appearing in NullFields will be sent to the server as
  10239. // null. It is an error if a field in this list has a non-empty value.
  10240. // This may be used to include null fields in Patch requests.
  10241. NullFields []string `json:"-"`
  10242. }
  10243. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10244. type NoMethod SkippableSetting
  10245. raw := NoMethod(*s)
  10246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10247. }
  10248. // SortedDimension: Represents a sorted dimension.
  10249. type SortedDimension struct {
  10250. // Kind: The kind of resource this is, in this case
  10251. // dfareporting#sortedDimension.
  10252. Kind string `json:"kind,omitempty"`
  10253. // Name: The name of the dimension.
  10254. Name string `json:"name,omitempty"`
  10255. // SortOrder: An optional sort order for the dimension column.
  10256. //
  10257. // Possible values:
  10258. // "ASCENDING"
  10259. // "DESCENDING"
  10260. SortOrder string `json:"sortOrder,omitempty"`
  10261. // ForceSendFields is a list of field names (e.g. "Kind") to
  10262. // unconditionally include in API requests. By default, fields with
  10263. // empty values are omitted from API requests. However, any non-pointer,
  10264. // non-interface field appearing in ForceSendFields will be sent to the
  10265. // server regardless of whether the field is empty or not. This may be
  10266. // used to include empty fields in Patch requests.
  10267. ForceSendFields []string `json:"-"`
  10268. // NullFields is a list of field names (e.g. "Kind") to include in API
  10269. // requests with the JSON null value. By default, fields with empty
  10270. // values are omitted from API requests. However, any field with an
  10271. // empty value appearing in NullFields will be sent to the server as
  10272. // null. It is an error if a field in this list has a non-empty value.
  10273. // This may be used to include null fields in Patch requests.
  10274. NullFields []string `json:"-"`
  10275. }
  10276. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10277. type NoMethod SortedDimension
  10278. raw := NoMethod(*s)
  10279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10280. }
  10281. // Subaccount: Contains properties of a DCM subaccount.
  10282. type Subaccount struct {
  10283. // AccountId: ID of the account that contains this subaccount. This is a
  10284. // read-only field that can be left blank.
  10285. AccountId int64 `json:"accountId,omitempty,string"`
  10286. // AvailablePermissionIds: IDs of the available user role permissions
  10287. // for this subaccount.
  10288. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10289. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10290. Id int64 `json:"id,omitempty,string"`
  10291. // Kind: Identifies what kind of resource this is. Value: the fixed
  10292. // string "dfareporting#subaccount".
  10293. Kind string `json:"kind,omitempty"`
  10294. // Name: Name of this subaccount. This is a required field. Must be less
  10295. // than 128 characters long and be unique among subaccounts of the same
  10296. // account.
  10297. Name string `json:"name,omitempty"`
  10298. // ServerResponse contains the HTTP response code and headers from the
  10299. // server.
  10300. googleapi.ServerResponse `json:"-"`
  10301. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10302. // unconditionally include in API requests. By default, fields with
  10303. // empty values are omitted from API requests. However, any non-pointer,
  10304. // non-interface field appearing in ForceSendFields will be sent to the
  10305. // server regardless of whether the field is empty or not. This may be
  10306. // used to include empty fields in Patch requests.
  10307. ForceSendFields []string `json:"-"`
  10308. // NullFields is a list of field names (e.g. "AccountId") to include in
  10309. // API requests with the JSON null value. By default, fields with empty
  10310. // values are omitted from API requests. However, any field with an
  10311. // empty value appearing in NullFields will be sent to the server as
  10312. // null. It is an error if a field in this list has a non-empty value.
  10313. // This may be used to include null fields in Patch requests.
  10314. NullFields []string `json:"-"`
  10315. }
  10316. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10317. type NoMethod Subaccount
  10318. raw := NoMethod(*s)
  10319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10320. }
  10321. // SubaccountsListResponse: Subaccount List Response
  10322. type SubaccountsListResponse struct {
  10323. // Kind: Identifies what kind of resource this is. Value: the fixed
  10324. // string "dfareporting#subaccountsListResponse".
  10325. Kind string `json:"kind,omitempty"`
  10326. // NextPageToken: Pagination token to be used for the next list
  10327. // operation.
  10328. NextPageToken string `json:"nextPageToken,omitempty"`
  10329. // Subaccounts: Subaccount collection.
  10330. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10331. // ServerResponse contains the HTTP response code and headers from the
  10332. // server.
  10333. googleapi.ServerResponse `json:"-"`
  10334. // ForceSendFields is a list of field names (e.g. "Kind") to
  10335. // unconditionally include in API requests. By default, fields with
  10336. // empty values are omitted from API requests. However, any non-pointer,
  10337. // non-interface field appearing in ForceSendFields will be sent to the
  10338. // server regardless of whether the field is empty or not. This may be
  10339. // used to include empty fields in Patch requests.
  10340. ForceSendFields []string `json:"-"`
  10341. // NullFields is a list of field names (e.g. "Kind") to include in API
  10342. // requests with the JSON null value. By default, fields with empty
  10343. // values are omitted from API requests. However, any field with an
  10344. // empty value appearing in NullFields will be sent to the server as
  10345. // null. It is an error if a field in this list has a non-empty value.
  10346. // This may be used to include null fields in Patch requests.
  10347. NullFields []string `json:"-"`
  10348. }
  10349. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10350. type NoMethod SubaccountsListResponse
  10351. raw := NoMethod(*s)
  10352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10353. }
  10354. // TagData: Placement Tag Data
  10355. type TagData struct {
  10356. // AdId: Ad associated with this placement tag. Applicable only when
  10357. // format is PLACEMENT_TAG_TRACKING.
  10358. AdId int64 `json:"adId,omitempty,string"`
  10359. // ClickTag: Tag string to record a click.
  10360. ClickTag string `json:"clickTag,omitempty"`
  10361. // CreativeId: Creative associated with this placement tag. Applicable
  10362. // only when format is PLACEMENT_TAG_TRACKING.
  10363. CreativeId int64 `json:"creativeId,omitempty,string"`
  10364. // Format: TagData tag format of this tag.
  10365. //
  10366. // Possible values:
  10367. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10368. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10369. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10370. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10371. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10372. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10373. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10374. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10375. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10376. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10377. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10378. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10379. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10380. // "PLACEMENT_TAG_JAVASCRIPT"
  10381. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10382. // "PLACEMENT_TAG_STANDARD"
  10383. // "PLACEMENT_TAG_TRACKING"
  10384. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10385. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10386. Format string `json:"format,omitempty"`
  10387. // ImpressionTag: Tag string for serving an ad.
  10388. ImpressionTag string `json:"impressionTag,omitempty"`
  10389. // ForceSendFields is a list of field names (e.g. "AdId") to
  10390. // unconditionally include in API requests. By default, fields with
  10391. // empty values are omitted from API requests. However, any non-pointer,
  10392. // non-interface field appearing in ForceSendFields will be sent to the
  10393. // server regardless of whether the field is empty or not. This may be
  10394. // used to include empty fields in Patch requests.
  10395. ForceSendFields []string `json:"-"`
  10396. // NullFields is a list of field names (e.g. "AdId") to include in API
  10397. // requests with the JSON null value. By default, fields with empty
  10398. // values are omitted from API requests. However, any field with an
  10399. // empty value appearing in NullFields will be sent to the server as
  10400. // null. It is an error if a field in this list has a non-empty value.
  10401. // This may be used to include null fields in Patch requests.
  10402. NullFields []string `json:"-"`
  10403. }
  10404. func (s *TagData) MarshalJSON() ([]byte, error) {
  10405. type NoMethod TagData
  10406. raw := NoMethod(*s)
  10407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10408. }
  10409. // TagSetting: Tag Settings
  10410. type TagSetting struct {
  10411. // AdditionalKeyValues: Additional key-values to be included in tags.
  10412. // Each key-value pair must be of the form key=value, and pairs must be
  10413. // separated by a semicolon (;). Keys and values must not contain
  10414. // commas. For example, id=2;color=red is a valid value for this field.
  10415. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10416. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10417. // included in the tags. This setting applies only to placements.
  10418. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10419. // IncludeClickTracking: Whether click-tracking string should be
  10420. // included in the tags.
  10421. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10422. // KeywordOption: Option specifying how keywords are embedded in ad
  10423. // tags. This setting can be used to specify whether keyword
  10424. // placeholders are inserted in placement tags for this site. Publishers
  10425. // can then add keywords to those placeholders.
  10426. //
  10427. // Possible values:
  10428. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10429. // "IGNORE"
  10430. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10431. KeywordOption string `json:"keywordOption,omitempty"`
  10432. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10433. // to unconditionally include in API requests. By default, fields with
  10434. // empty values are omitted from API requests. However, any non-pointer,
  10435. // non-interface field appearing in ForceSendFields will be sent to the
  10436. // server regardless of whether the field is empty or not. This may be
  10437. // used to include empty fields in Patch requests.
  10438. ForceSendFields []string `json:"-"`
  10439. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10440. // include in API requests with the JSON null value. By default, fields
  10441. // with empty values are omitted from API requests. However, any field
  10442. // with an empty value appearing in NullFields will be sent to the
  10443. // server as null. It is an error if a field in this list has a
  10444. // non-empty value. This may be used to include null fields in Patch
  10445. // requests.
  10446. NullFields []string `json:"-"`
  10447. }
  10448. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10449. type NoMethod TagSetting
  10450. raw := NoMethod(*s)
  10451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10452. }
  10453. // TagSettings: Dynamic and Image Tag Settings.
  10454. type TagSettings struct {
  10455. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10456. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10457. // ImageTagEnabled: Whether image tags are enabled.
  10458. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10459. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10460. // to unconditionally include in API requests. By default, fields with
  10461. // empty values are omitted from API requests. However, any non-pointer,
  10462. // non-interface field appearing in ForceSendFields will be sent to the
  10463. // server regardless of whether the field is empty or not. This may be
  10464. // used to include empty fields in Patch requests.
  10465. ForceSendFields []string `json:"-"`
  10466. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10467. // include in API requests with the JSON null value. By default, fields
  10468. // with empty values are omitted from API requests. However, any field
  10469. // with an empty value appearing in NullFields will be sent to the
  10470. // server as null. It is an error if a field in this list has a
  10471. // non-empty value. This may be used to include null fields in Patch
  10472. // requests.
  10473. NullFields []string `json:"-"`
  10474. }
  10475. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10476. type NoMethod TagSettings
  10477. raw := NoMethod(*s)
  10478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10479. }
  10480. // TargetWindow: Target Window.
  10481. type TargetWindow struct {
  10482. // CustomHtml: User-entered value.
  10483. CustomHtml string `json:"customHtml,omitempty"`
  10484. // TargetWindowOption: Type of browser window for which the backup image
  10485. // of the flash creative can be displayed.
  10486. //
  10487. // Possible values:
  10488. // "CURRENT_WINDOW"
  10489. // "CUSTOM"
  10490. // "NEW_WINDOW"
  10491. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10492. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10493. // unconditionally include in API requests. By default, fields with
  10494. // empty values are omitted from API requests. However, any non-pointer,
  10495. // non-interface field appearing in ForceSendFields will be sent to the
  10496. // server regardless of whether the field is empty or not. This may be
  10497. // used to include empty fields in Patch requests.
  10498. ForceSendFields []string `json:"-"`
  10499. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10500. // API requests with the JSON null value. By default, fields with empty
  10501. // values are omitted from API requests. However, any field with an
  10502. // empty value appearing in NullFields will be sent to the server as
  10503. // null. It is an error if a field in this list has a non-empty value.
  10504. // This may be used to include null fields in Patch requests.
  10505. NullFields []string `json:"-"`
  10506. }
  10507. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10508. type NoMethod TargetWindow
  10509. raw := NoMethod(*s)
  10510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10511. }
  10512. // TargetableRemarketingList: Contains properties of a targetable
  10513. // remarketing list. Remarketing enables you to create lists of users
  10514. // who have performed specific actions on a site, then target ads to
  10515. // members of those lists. This resource is a read-only view of a
  10516. // remarketing list to be used to faciliate targeting ads to specific
  10517. // lists. Remarketing lists that are owned by your advertisers and those
  10518. // that are shared to your advertisers or account are accessible via
  10519. // this resource. To manage remarketing lists that are owned by your
  10520. // advertisers, use the RemarketingLists resource.
  10521. type TargetableRemarketingList struct {
  10522. // AccountId: Account ID of this remarketing list. This is a read-only,
  10523. // auto-generated field that is only returned in GET requests.
  10524. AccountId int64 `json:"accountId,omitempty,string"`
  10525. // Active: Whether this targetable remarketing list is active.
  10526. Active bool `json:"active,omitempty"`
  10527. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10528. // targetable remarketing list.
  10529. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10530. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10531. // advertiser.
  10532. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10533. // Description: Targetable remarketing list description.
  10534. Description string `json:"description,omitempty"`
  10535. // Id: Targetable remarketing list ID.
  10536. Id int64 `json:"id,omitempty,string"`
  10537. // Kind: Identifies what kind of resource this is. Value: the fixed
  10538. // string "dfareporting#targetableRemarketingList".
  10539. Kind string `json:"kind,omitempty"`
  10540. // LifeSpan: Number of days that a user should remain in the targetable
  10541. // remarketing list without an impression.
  10542. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10543. // ListSize: Number of users currently in the list. This is a read-only
  10544. // field.
  10545. ListSize int64 `json:"listSize,omitempty,string"`
  10546. // ListSource: Product from which this targetable remarketing list was
  10547. // originated.
  10548. //
  10549. // Possible values:
  10550. // "REMARKETING_LIST_SOURCE_ADX"
  10551. // "REMARKETING_LIST_SOURCE_DBM"
  10552. // "REMARKETING_LIST_SOURCE_DFA"
  10553. // "REMARKETING_LIST_SOURCE_DFP"
  10554. // "REMARKETING_LIST_SOURCE_DMP"
  10555. // "REMARKETING_LIST_SOURCE_GA"
  10556. // "REMARKETING_LIST_SOURCE_GPLUS"
  10557. // "REMARKETING_LIST_SOURCE_OTHER"
  10558. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10559. // "REMARKETING_LIST_SOURCE_XFP"
  10560. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10561. ListSource string `json:"listSource,omitempty"`
  10562. // Name: Name of the targetable remarketing list. Is no greater than 128
  10563. // characters long.
  10564. Name string `json:"name,omitempty"`
  10565. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10566. // read-only, auto-generated field that is only returned in GET
  10567. // requests.
  10568. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10569. // ServerResponse contains the HTTP response code and headers from the
  10570. // server.
  10571. googleapi.ServerResponse `json:"-"`
  10572. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10573. // unconditionally include in API requests. By default, fields with
  10574. // empty values are omitted from API requests. However, any non-pointer,
  10575. // non-interface field appearing in ForceSendFields will be sent to the
  10576. // server regardless of whether the field is empty or not. This may be
  10577. // used to include empty fields in Patch requests.
  10578. ForceSendFields []string `json:"-"`
  10579. // NullFields is a list of field names (e.g. "AccountId") to include in
  10580. // API requests with the JSON null value. By default, fields with empty
  10581. // values are omitted from API requests. However, any field with an
  10582. // empty value appearing in NullFields will be sent to the server as
  10583. // null. It is an error if a field in this list has a non-empty value.
  10584. // This may be used to include null fields in Patch requests.
  10585. NullFields []string `json:"-"`
  10586. }
  10587. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10588. type NoMethod TargetableRemarketingList
  10589. raw := NoMethod(*s)
  10590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10591. }
  10592. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10593. // response
  10594. type TargetableRemarketingListsListResponse struct {
  10595. // Kind: Identifies what kind of resource this is. Value: the fixed
  10596. // string "dfareporting#targetableRemarketingListsListResponse".
  10597. Kind string `json:"kind,omitempty"`
  10598. // NextPageToken: Pagination token to be used for the next list
  10599. // operation.
  10600. NextPageToken string `json:"nextPageToken,omitempty"`
  10601. // TargetableRemarketingLists: Targetable remarketing list collection.
  10602. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10603. // ServerResponse contains the HTTP response code and headers from the
  10604. // server.
  10605. googleapi.ServerResponse `json:"-"`
  10606. // ForceSendFields is a list of field names (e.g. "Kind") to
  10607. // unconditionally include in API requests. By default, fields with
  10608. // empty values are omitted from API requests. However, any non-pointer,
  10609. // non-interface field appearing in ForceSendFields will be sent to the
  10610. // server regardless of whether the field is empty or not. This may be
  10611. // used to include empty fields in Patch requests.
  10612. ForceSendFields []string `json:"-"`
  10613. // NullFields is a list of field names (e.g. "Kind") to include in API
  10614. // requests with the JSON null value. By default, fields with empty
  10615. // values are omitted from API requests. However, any field with an
  10616. // empty value appearing in NullFields will be sent to the server as
  10617. // null. It is an error if a field in this list has a non-empty value.
  10618. // This may be used to include null fields in Patch requests.
  10619. NullFields []string `json:"-"`
  10620. }
  10621. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  10622. type NoMethod TargetableRemarketingListsListResponse
  10623. raw := NoMethod(*s)
  10624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10625. }
  10626. // TargetingTemplate: Contains properties of a targeting template. A
  10627. // targeting template encapsulates targeting information which can be
  10628. // reused across multiple ads.
  10629. type TargetingTemplate struct {
  10630. // AccountId: Account ID of this targeting template. This field, if left
  10631. // unset, will be auto-generated on insert and is read-only after
  10632. // insert.
  10633. AccountId int64 `json:"accountId,omitempty,string"`
  10634. // AdvertiserId: Advertiser ID of this targeting template. This is a
  10635. // required field on insert and is read-only after insert.
  10636. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10637. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10638. // advertiser. This is a read-only, auto-generated field.
  10639. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10640. // DayPartTargeting: Time and day targeting criteria.
  10641. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  10642. // GeoTargeting: Geographical targeting criteria.
  10643. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  10644. // Id: ID of this targeting template. This is a read-only,
  10645. // auto-generated field.
  10646. Id int64 `json:"id,omitempty,string"`
  10647. // KeyValueTargetingExpression: Key-value targeting criteria.
  10648. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  10649. // Kind: Identifies what kind of resource this is. Value: the fixed
  10650. // string "dfareporting#targetingTemplate".
  10651. Kind string `json:"kind,omitempty"`
  10652. // LanguageTargeting: Language targeting criteria.
  10653. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  10654. // ListTargetingExpression: Remarketing list targeting criteria.
  10655. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  10656. // Name: Name of this targeting template. This field is required. It
  10657. // must be less than 256 characters long and unique within an
  10658. // advertiser.
  10659. Name string `json:"name,omitempty"`
  10660. // SubaccountId: Subaccount ID of this targeting template. This field,
  10661. // if left unset, will be auto-generated on insert and is read-only
  10662. // after insert.
  10663. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10664. // TechnologyTargeting: Technology platform targeting criteria.
  10665. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  10666. // ServerResponse contains the HTTP response code and headers from the
  10667. // server.
  10668. googleapi.ServerResponse `json:"-"`
  10669. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10670. // unconditionally include in API requests. By default, fields with
  10671. // empty values are omitted from API requests. However, any non-pointer,
  10672. // non-interface field appearing in ForceSendFields will be sent to the
  10673. // server regardless of whether the field is empty or not. This may be
  10674. // used to include empty fields in Patch requests.
  10675. ForceSendFields []string `json:"-"`
  10676. // NullFields is a list of field names (e.g. "AccountId") to include in
  10677. // API requests with the JSON null value. By default, fields with empty
  10678. // values are omitted from API requests. However, any field with an
  10679. // empty value appearing in NullFields will be sent to the server as
  10680. // null. It is an error if a field in this list has a non-empty value.
  10681. // This may be used to include null fields in Patch requests.
  10682. NullFields []string `json:"-"`
  10683. }
  10684. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  10685. type NoMethod TargetingTemplate
  10686. raw := NoMethod(*s)
  10687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10688. }
  10689. // TargetingTemplatesListResponse: Targeting Template List Response
  10690. type TargetingTemplatesListResponse struct {
  10691. // Kind: Identifies what kind of resource this is. Value: the fixed
  10692. // string "dfareporting#targetingTemplatesListResponse".
  10693. Kind string `json:"kind,omitempty"`
  10694. // NextPageToken: Pagination token to be used for the next list
  10695. // operation.
  10696. NextPageToken string `json:"nextPageToken,omitempty"`
  10697. // TargetingTemplates: Targeting template collection.
  10698. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  10699. // ServerResponse contains the HTTP response code and headers from the
  10700. // server.
  10701. googleapi.ServerResponse `json:"-"`
  10702. // ForceSendFields is a list of field names (e.g. "Kind") to
  10703. // unconditionally include in API requests. By default, fields with
  10704. // empty values are omitted from API requests. However, any non-pointer,
  10705. // non-interface field appearing in ForceSendFields will be sent to the
  10706. // server regardless of whether the field is empty or not. This may be
  10707. // used to include empty fields in Patch requests.
  10708. ForceSendFields []string `json:"-"`
  10709. // NullFields is a list of field names (e.g. "Kind") to include in API
  10710. // requests with the JSON null value. By default, fields with empty
  10711. // values are omitted from API requests. However, any field with an
  10712. // empty value appearing in NullFields will be sent to the server as
  10713. // null. It is an error if a field in this list has a non-empty value.
  10714. // This may be used to include null fields in Patch requests.
  10715. NullFields []string `json:"-"`
  10716. }
  10717. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  10718. type NoMethod TargetingTemplatesListResponse
  10719. raw := NoMethod(*s)
  10720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10721. }
  10722. // TechnologyTargeting: Technology Targeting.
  10723. type TechnologyTargeting struct {
  10724. // Browsers: Browsers that this ad targets. For each browser either set
  10725. // browserVersionId or dartId along with the version numbers. If both
  10726. // are specified, only browserVersionId will be used. The other fields
  10727. // are populated automatically when the ad is inserted or updated.
  10728. Browsers []*Browser `json:"browsers,omitempty"`
  10729. // ConnectionTypes: Connection types that this ad targets. For each
  10730. // connection type only id is required. The other fields are populated
  10731. // automatically when the ad is inserted or updated.
  10732. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  10733. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  10734. // carrier only id is required, and the other fields are populated
  10735. // automatically when the ad is inserted or updated. If targeting a
  10736. // mobile carrier, do not set targeting for any zip codes.
  10737. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  10738. // OperatingSystemVersions: Operating system versions that this ad
  10739. // targets. To target all versions, use operatingSystems. For each
  10740. // operating system version, only id is required. The other fields are
  10741. // populated automatically when the ad is inserted or updated. If
  10742. // targeting an operating system version, do not set targeting for the
  10743. // corresponding operating system in operatingSystems.
  10744. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  10745. // OperatingSystems: Operating systems that this ad targets. To target
  10746. // specific versions, use operatingSystemVersions. For each operating
  10747. // system only dartId is required. The other fields are populated
  10748. // automatically when the ad is inserted or updated. If targeting an
  10749. // operating system, do not set targeting for operating system versions
  10750. // for the same operating system.
  10751. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  10752. // PlatformTypes: Platform types that this ad targets. For example,
  10753. // desktop, mobile, or tablet. For each platform type, only id is
  10754. // required, and the other fields are populated automatically when the
  10755. // ad is inserted or updated.
  10756. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  10757. // ForceSendFields is a list of field names (e.g. "Browsers") to
  10758. // unconditionally include in API requests. By default, fields with
  10759. // empty values are omitted from API requests. However, any non-pointer,
  10760. // non-interface field appearing in ForceSendFields will be sent to the
  10761. // server regardless of whether the field is empty or not. This may be
  10762. // used to include empty fields in Patch requests.
  10763. ForceSendFields []string `json:"-"`
  10764. // NullFields is a list of field names (e.g. "Browsers") to include in
  10765. // API requests with the JSON null value. By default, fields with empty
  10766. // values are omitted from API requests. However, any field with an
  10767. // empty value appearing in NullFields will be sent to the server as
  10768. // null. It is an error if a field in this list has a non-empty value.
  10769. // This may be used to include null fields in Patch requests.
  10770. NullFields []string `json:"-"`
  10771. }
  10772. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  10773. type NoMethod TechnologyTargeting
  10774. raw := NoMethod(*s)
  10775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10776. }
  10777. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  10778. type ThirdPartyAuthenticationToken struct {
  10779. // Name: Name of the third-party authentication token.
  10780. Name string `json:"name,omitempty"`
  10781. // Value: Value of the third-party authentication token. This is a
  10782. // read-only, auto-generated field.
  10783. Value string `json:"value,omitempty"`
  10784. // ForceSendFields is a list of field names (e.g. "Name") to
  10785. // unconditionally include in API requests. By default, fields with
  10786. // empty values are omitted from API requests. However, any non-pointer,
  10787. // non-interface field appearing in ForceSendFields will be sent to the
  10788. // server regardless of whether the field is empty or not. This may be
  10789. // used to include empty fields in Patch requests.
  10790. ForceSendFields []string `json:"-"`
  10791. // NullFields is a list of field names (e.g. "Name") to include in API
  10792. // requests with the JSON null value. By default, fields with empty
  10793. // values are omitted from API requests. However, any field with an
  10794. // empty value appearing in NullFields will be sent to the server as
  10795. // null. It is an error if a field in this list has a non-empty value.
  10796. // This may be used to include null fields in Patch requests.
  10797. NullFields []string `json:"-"`
  10798. }
  10799. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  10800. type NoMethod ThirdPartyAuthenticationToken
  10801. raw := NoMethod(*s)
  10802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10803. }
  10804. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  10805. type ThirdPartyTrackingUrl struct {
  10806. // ThirdPartyUrlType: Third-party URL type for in-stream video
  10807. // creatives.
  10808. //
  10809. // Possible values:
  10810. // "CLICK_TRACKING"
  10811. // "IMPRESSION"
  10812. // "RICH_MEDIA_BACKUP_IMPRESSION"
  10813. // "RICH_MEDIA_IMPRESSION"
  10814. // "RICH_MEDIA_RM_IMPRESSION"
  10815. // "SURVEY"
  10816. // "VIDEO_COMPLETE"
  10817. // "VIDEO_CUSTOM"
  10818. // "VIDEO_FIRST_QUARTILE"
  10819. // "VIDEO_FULLSCREEN"
  10820. // "VIDEO_MIDPOINT"
  10821. // "VIDEO_MUTE"
  10822. // "VIDEO_PAUSE"
  10823. // "VIDEO_PROGRESS"
  10824. // "VIDEO_REWIND"
  10825. // "VIDEO_SKIP"
  10826. // "VIDEO_START"
  10827. // "VIDEO_STOP"
  10828. // "VIDEO_THIRD_QUARTILE"
  10829. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  10830. // Url: URL for the specified third-party URL type.
  10831. Url string `json:"url,omitempty"`
  10832. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  10833. // to unconditionally include in API requests. By default, fields with
  10834. // empty values are omitted from API requests. However, any non-pointer,
  10835. // non-interface field appearing in ForceSendFields will be sent to the
  10836. // server regardless of whether the field is empty or not. This may be
  10837. // used to include empty fields in Patch requests.
  10838. ForceSendFields []string `json:"-"`
  10839. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  10840. // include in API requests with the JSON null value. By default, fields
  10841. // with empty values are omitted from API requests. However, any field
  10842. // with an empty value appearing in NullFields will be sent to the
  10843. // server as null. It is an error if a field in this list has a
  10844. // non-empty value. This may be used to include null fields in Patch
  10845. // requests.
  10846. NullFields []string `json:"-"`
  10847. }
  10848. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  10849. type NoMethod ThirdPartyTrackingUrl
  10850. raw := NoMethod(*s)
  10851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10852. }
  10853. // TranscodeSetting: Transcode Settings
  10854. type TranscodeSetting struct {
  10855. // EnabledVideoFormats: Whitelist of video formats to be served to this
  10856. // placement. Set this list to null or empty to serve all video formats.
  10857. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  10858. // Kind: Identifies what kind of resource this is. Value: the fixed
  10859. // string "dfareporting#transcodeSetting".
  10860. Kind string `json:"kind,omitempty"`
  10861. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  10862. // to unconditionally include in API requests. By default, fields with
  10863. // empty values are omitted from API requests. However, any non-pointer,
  10864. // non-interface field appearing in ForceSendFields will be sent to the
  10865. // server regardless of whether the field is empty or not. This may be
  10866. // used to include empty fields in Patch requests.
  10867. ForceSendFields []string `json:"-"`
  10868. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  10869. // include in API requests with the JSON null value. By default, fields
  10870. // with empty values are omitted from API requests. However, any field
  10871. // with an empty value appearing in NullFields will be sent to the
  10872. // server as null. It is an error if a field in this list has a
  10873. // non-empty value. This may be used to include null fields in Patch
  10874. // requests.
  10875. NullFields []string `json:"-"`
  10876. }
  10877. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  10878. type NoMethod TranscodeSetting
  10879. raw := NoMethod(*s)
  10880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10881. }
  10882. // UserDefinedVariableConfiguration: User Defined Variable
  10883. // configuration.
  10884. type UserDefinedVariableConfiguration struct {
  10885. // DataType: Data type for the variable. This is a required field.
  10886. //
  10887. // Possible values:
  10888. // "NUMBER"
  10889. // "STRING"
  10890. DataType string `json:"dataType,omitempty"`
  10891. // ReportName: User-friendly name for the variable which will appear in
  10892. // reports. This is a required field, must be less than 64 characters
  10893. // long, and cannot contain the following characters: ""<>".
  10894. ReportName string `json:"reportName,omitempty"`
  10895. // VariableType: Variable name in the tag. This is a required field.
  10896. //
  10897. // Possible values:
  10898. // "U1"
  10899. // "U10"
  10900. // "U100"
  10901. // "U11"
  10902. // "U12"
  10903. // "U13"
  10904. // "U14"
  10905. // "U15"
  10906. // "U16"
  10907. // "U17"
  10908. // "U18"
  10909. // "U19"
  10910. // "U2"
  10911. // "U20"
  10912. // "U21"
  10913. // "U22"
  10914. // "U23"
  10915. // "U24"
  10916. // "U25"
  10917. // "U26"
  10918. // "U27"
  10919. // "U28"
  10920. // "U29"
  10921. // "U3"
  10922. // "U30"
  10923. // "U31"
  10924. // "U32"
  10925. // "U33"
  10926. // "U34"
  10927. // "U35"
  10928. // "U36"
  10929. // "U37"
  10930. // "U38"
  10931. // "U39"
  10932. // "U4"
  10933. // "U40"
  10934. // "U41"
  10935. // "U42"
  10936. // "U43"
  10937. // "U44"
  10938. // "U45"
  10939. // "U46"
  10940. // "U47"
  10941. // "U48"
  10942. // "U49"
  10943. // "U5"
  10944. // "U50"
  10945. // "U51"
  10946. // "U52"
  10947. // "U53"
  10948. // "U54"
  10949. // "U55"
  10950. // "U56"
  10951. // "U57"
  10952. // "U58"
  10953. // "U59"
  10954. // "U6"
  10955. // "U60"
  10956. // "U61"
  10957. // "U62"
  10958. // "U63"
  10959. // "U64"
  10960. // "U65"
  10961. // "U66"
  10962. // "U67"
  10963. // "U68"
  10964. // "U69"
  10965. // "U7"
  10966. // "U70"
  10967. // "U71"
  10968. // "U72"
  10969. // "U73"
  10970. // "U74"
  10971. // "U75"
  10972. // "U76"
  10973. // "U77"
  10974. // "U78"
  10975. // "U79"
  10976. // "U8"
  10977. // "U80"
  10978. // "U81"
  10979. // "U82"
  10980. // "U83"
  10981. // "U84"
  10982. // "U85"
  10983. // "U86"
  10984. // "U87"
  10985. // "U88"
  10986. // "U89"
  10987. // "U9"
  10988. // "U90"
  10989. // "U91"
  10990. // "U92"
  10991. // "U93"
  10992. // "U94"
  10993. // "U95"
  10994. // "U96"
  10995. // "U97"
  10996. // "U98"
  10997. // "U99"
  10998. VariableType string `json:"variableType,omitempty"`
  10999. // ForceSendFields is a list of field names (e.g. "DataType") to
  11000. // unconditionally include in API requests. By default, fields with
  11001. // empty values are omitted from API requests. However, any non-pointer,
  11002. // non-interface field appearing in ForceSendFields will be sent to the
  11003. // server regardless of whether the field is empty or not. This may be
  11004. // used to include empty fields in Patch requests.
  11005. ForceSendFields []string `json:"-"`
  11006. // NullFields is a list of field names (e.g. "DataType") to include in
  11007. // API requests with the JSON null value. By default, fields with empty
  11008. // values are omitted from API requests. However, any field with an
  11009. // empty value appearing in NullFields will be sent to the server as
  11010. // null. It is an error if a field in this list has a non-empty value.
  11011. // This may be used to include null fields in Patch requests.
  11012. NullFields []string `json:"-"`
  11013. }
  11014. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11015. type NoMethod UserDefinedVariableConfiguration
  11016. raw := NoMethod(*s)
  11017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11018. }
  11019. // UserProfile: Represents a UserProfile resource.
  11020. type UserProfile struct {
  11021. // AccountId: The account ID to which this profile belongs.
  11022. AccountId int64 `json:"accountId,omitempty,string"`
  11023. // AccountName: The account name this profile belongs to.
  11024. AccountName string `json:"accountName,omitempty"`
  11025. // Etag: The eTag of this response for caching purposes.
  11026. Etag string `json:"etag,omitempty"`
  11027. // Kind: The kind of resource this is, in this case
  11028. // dfareporting#userProfile.
  11029. Kind string `json:"kind,omitempty"`
  11030. // ProfileId: The unique ID of the user profile.
  11031. ProfileId int64 `json:"profileId,omitempty,string"`
  11032. // SubAccountId: The sub account ID this profile belongs to if
  11033. // applicable.
  11034. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11035. // SubAccountName: The sub account name this profile belongs to if
  11036. // applicable.
  11037. SubAccountName string `json:"subAccountName,omitempty"`
  11038. // UserName: The user name.
  11039. UserName string `json:"userName,omitempty"`
  11040. // ServerResponse contains the HTTP response code and headers from the
  11041. // server.
  11042. googleapi.ServerResponse `json:"-"`
  11043. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11044. // unconditionally include in API requests. By default, fields with
  11045. // empty values are omitted from API requests. However, any non-pointer,
  11046. // non-interface field appearing in ForceSendFields will be sent to the
  11047. // server regardless of whether the field is empty or not. This may be
  11048. // used to include empty fields in Patch requests.
  11049. ForceSendFields []string `json:"-"`
  11050. // NullFields is a list of field names (e.g. "AccountId") to include in
  11051. // API requests with the JSON null value. By default, fields with empty
  11052. // values are omitted from API requests. However, any field with an
  11053. // empty value appearing in NullFields will be sent to the server as
  11054. // null. It is an error if a field in this list has a non-empty value.
  11055. // This may be used to include null fields in Patch requests.
  11056. NullFields []string `json:"-"`
  11057. }
  11058. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11059. type NoMethod UserProfile
  11060. raw := NoMethod(*s)
  11061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11062. }
  11063. // UserProfileList: Represents the list of user profiles.
  11064. type UserProfileList struct {
  11065. // Etag: The eTag of this response for caching purposes.
  11066. Etag string `json:"etag,omitempty"`
  11067. // Items: The user profiles returned in this response.
  11068. Items []*UserProfile `json:"items,omitempty"`
  11069. // Kind: The kind of list this is, in this case
  11070. // dfareporting#userProfileList.
  11071. Kind string `json:"kind,omitempty"`
  11072. // ServerResponse contains the HTTP response code and headers from the
  11073. // server.
  11074. googleapi.ServerResponse `json:"-"`
  11075. // ForceSendFields is a list of field names (e.g. "Etag") to
  11076. // unconditionally include in API requests. By default, fields with
  11077. // empty values are omitted from API requests. However, any non-pointer,
  11078. // non-interface field appearing in ForceSendFields will be sent to the
  11079. // server regardless of whether the field is empty or not. This may be
  11080. // used to include empty fields in Patch requests.
  11081. ForceSendFields []string `json:"-"`
  11082. // NullFields is a list of field names (e.g. "Etag") to include in API
  11083. // requests with the JSON null value. By default, fields with empty
  11084. // values are omitted from API requests. However, any field with an
  11085. // empty value appearing in NullFields will be sent to the server as
  11086. // null. It is an error if a field in this list has a non-empty value.
  11087. // This may be used to include null fields in Patch requests.
  11088. NullFields []string `json:"-"`
  11089. }
  11090. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11091. type NoMethod UserProfileList
  11092. raw := NoMethod(*s)
  11093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11094. }
  11095. // UserRole: Contains properties of auser role, which is used to manage
  11096. // user access.
  11097. type UserRole struct {
  11098. // AccountId: Account ID of this user role. This is a read-only field
  11099. // that can be left blank.
  11100. AccountId int64 `json:"accountId,omitempty,string"`
  11101. // DefaultUserRole: Whether this is a default user role. Default user
  11102. // roles are created by the system for the account/subaccount and cannot
  11103. // be modified or deleted. Each default user role comes with a basic set
  11104. // of preassigned permissions.
  11105. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11106. // Id: ID of this user role. This is a read-only, auto-generated field.
  11107. Id int64 `json:"id,omitempty,string"`
  11108. // Kind: Identifies what kind of resource this is. Value: the fixed
  11109. // string "dfareporting#userRole".
  11110. Kind string `json:"kind,omitempty"`
  11111. // Name: Name of this user role. This is a required field. Must be less
  11112. // than 256 characters long. If this user role is under a subaccount,
  11113. // the name must be unique among sites of the same subaccount.
  11114. // Otherwise, this user role is a top-level user role, and the name must
  11115. // be unique among top-level user roles of the same account.
  11116. Name string `json:"name,omitempty"`
  11117. // ParentUserRoleId: ID of the user role that this user role is based on
  11118. // or copied from. This is a required field.
  11119. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11120. // Permissions: List of permissions associated with this user role.
  11121. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11122. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11123. // field that can be left blank.
  11124. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11125. // ServerResponse contains the HTTP response code and headers from the
  11126. // server.
  11127. googleapi.ServerResponse `json:"-"`
  11128. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11129. // unconditionally include in API requests. By default, fields with
  11130. // empty values are omitted from API requests. However, any non-pointer,
  11131. // non-interface field appearing in ForceSendFields will be sent to the
  11132. // server regardless of whether the field is empty or not. This may be
  11133. // used to include empty fields in Patch requests.
  11134. ForceSendFields []string `json:"-"`
  11135. // NullFields is a list of field names (e.g. "AccountId") to include in
  11136. // API requests with the JSON null value. By default, fields with empty
  11137. // values are omitted from API requests. However, any field with an
  11138. // empty value appearing in NullFields will be sent to the server as
  11139. // null. It is an error if a field in this list has a non-empty value.
  11140. // This may be used to include null fields in Patch requests.
  11141. NullFields []string `json:"-"`
  11142. }
  11143. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11144. type NoMethod UserRole
  11145. raw := NoMethod(*s)
  11146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11147. }
  11148. // UserRolePermission: Contains properties of a user role permission.
  11149. type UserRolePermission struct {
  11150. // Availability: Levels of availability for a user role permission.
  11151. //
  11152. // Possible values:
  11153. // "ACCOUNT_ALWAYS"
  11154. // "ACCOUNT_BY_DEFAULT"
  11155. // "NOT_AVAILABLE_BY_DEFAULT"
  11156. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11157. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11158. Availability string `json:"availability,omitempty"`
  11159. // Id: ID of this user role permission.
  11160. Id int64 `json:"id,omitempty,string"`
  11161. // Kind: Identifies what kind of resource this is. Value: the fixed
  11162. // string "dfareporting#userRolePermission".
  11163. Kind string `json:"kind,omitempty"`
  11164. // Name: Name of this user role permission.
  11165. Name string `json:"name,omitempty"`
  11166. // PermissionGroupId: ID of the permission group that this user role
  11167. // permission belongs to.
  11168. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11169. // ServerResponse contains the HTTP response code and headers from the
  11170. // server.
  11171. googleapi.ServerResponse `json:"-"`
  11172. // ForceSendFields is a list of field names (e.g. "Availability") to
  11173. // unconditionally include in API requests. By default, fields with
  11174. // empty values are omitted from API requests. However, any non-pointer,
  11175. // non-interface field appearing in ForceSendFields will be sent to the
  11176. // server regardless of whether the field is empty or not. This may be
  11177. // used to include empty fields in Patch requests.
  11178. ForceSendFields []string `json:"-"`
  11179. // NullFields is a list of field names (e.g. "Availability") to include
  11180. // in API requests with the JSON null value. By default, fields with
  11181. // empty values are omitted from API requests. However, any field with
  11182. // an empty value appearing in NullFields will be sent to the server as
  11183. // null. It is an error if a field in this list has a non-empty value.
  11184. // This may be used to include null fields in Patch requests.
  11185. NullFields []string `json:"-"`
  11186. }
  11187. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11188. type NoMethod UserRolePermission
  11189. raw := NoMethod(*s)
  11190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11191. }
  11192. // UserRolePermissionGroup: Represents a grouping of related user role
  11193. // permissions.
  11194. type UserRolePermissionGroup struct {
  11195. // Id: ID of this user role permission.
  11196. Id int64 `json:"id,omitempty,string"`
  11197. // Kind: Identifies what kind of resource this is. Value: the fixed
  11198. // string "dfareporting#userRolePermissionGroup".
  11199. Kind string `json:"kind,omitempty"`
  11200. // Name: Name of this user role permission group.
  11201. Name string `json:"name,omitempty"`
  11202. // ServerResponse contains the HTTP response code and headers from the
  11203. // server.
  11204. googleapi.ServerResponse `json:"-"`
  11205. // ForceSendFields is a list of field names (e.g. "Id") to
  11206. // unconditionally include in API requests. By default, fields with
  11207. // empty values are omitted from API requests. However, any non-pointer,
  11208. // non-interface field appearing in ForceSendFields will be sent to the
  11209. // server regardless of whether the field is empty or not. This may be
  11210. // used to include empty fields in Patch requests.
  11211. ForceSendFields []string `json:"-"`
  11212. // NullFields is a list of field names (e.g. "Id") to include in API
  11213. // requests with the JSON null value. By default, fields with empty
  11214. // values are omitted from API requests. However, any field with an
  11215. // empty value appearing in NullFields will be sent to the server as
  11216. // null. It is an error if a field in this list has a non-empty value.
  11217. // This may be used to include null fields in Patch requests.
  11218. NullFields []string `json:"-"`
  11219. }
  11220. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11221. type NoMethod UserRolePermissionGroup
  11222. raw := NoMethod(*s)
  11223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11224. }
  11225. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11226. // Response
  11227. type UserRolePermissionGroupsListResponse struct {
  11228. // Kind: Identifies what kind of resource this is. Value: the fixed
  11229. // string "dfareporting#userRolePermissionGroupsListResponse".
  11230. Kind string `json:"kind,omitempty"`
  11231. // UserRolePermissionGroups: User role permission group collection.
  11232. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11233. // ServerResponse contains the HTTP response code and headers from the
  11234. // server.
  11235. googleapi.ServerResponse `json:"-"`
  11236. // ForceSendFields is a list of field names (e.g. "Kind") to
  11237. // unconditionally include in API requests. By default, fields with
  11238. // empty values are omitted from API requests. However, any non-pointer,
  11239. // non-interface field appearing in ForceSendFields will be sent to the
  11240. // server regardless of whether the field is empty or not. This may be
  11241. // used to include empty fields in Patch requests.
  11242. ForceSendFields []string `json:"-"`
  11243. // NullFields is a list of field names (e.g. "Kind") to include in API
  11244. // requests with the JSON null value. By default, fields with empty
  11245. // values are omitted from API requests. However, any field with an
  11246. // empty value appearing in NullFields will be sent to the server as
  11247. // null. It is an error if a field in this list has a non-empty value.
  11248. // This may be used to include null fields in Patch requests.
  11249. NullFields []string `json:"-"`
  11250. }
  11251. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11252. type NoMethod UserRolePermissionGroupsListResponse
  11253. raw := NoMethod(*s)
  11254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11255. }
  11256. // UserRolePermissionsListResponse: User Role Permission List Response
  11257. type UserRolePermissionsListResponse struct {
  11258. // Kind: Identifies what kind of resource this is. Value: the fixed
  11259. // string "dfareporting#userRolePermissionsListResponse".
  11260. Kind string `json:"kind,omitempty"`
  11261. // UserRolePermissions: User role permission collection.
  11262. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11263. // ServerResponse contains the HTTP response code and headers from the
  11264. // server.
  11265. googleapi.ServerResponse `json:"-"`
  11266. // ForceSendFields is a list of field names (e.g. "Kind") to
  11267. // unconditionally include in API requests. By default, fields with
  11268. // empty values are omitted from API requests. However, any non-pointer,
  11269. // non-interface field appearing in ForceSendFields will be sent to the
  11270. // server regardless of whether the field is empty or not. This may be
  11271. // used to include empty fields in Patch requests.
  11272. ForceSendFields []string `json:"-"`
  11273. // NullFields is a list of field names (e.g. "Kind") to include in API
  11274. // requests with the JSON null value. By default, fields with empty
  11275. // values are omitted from API requests. However, any field with an
  11276. // empty value appearing in NullFields will be sent to the server as
  11277. // null. It is an error if a field in this list has a non-empty value.
  11278. // This may be used to include null fields in Patch requests.
  11279. NullFields []string `json:"-"`
  11280. }
  11281. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11282. type NoMethod UserRolePermissionsListResponse
  11283. raw := NoMethod(*s)
  11284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11285. }
  11286. // UserRolesListResponse: User Role List Response
  11287. type UserRolesListResponse struct {
  11288. // Kind: Identifies what kind of resource this is. Value: the fixed
  11289. // string "dfareporting#userRolesListResponse".
  11290. Kind string `json:"kind,omitempty"`
  11291. // NextPageToken: Pagination token to be used for the next list
  11292. // operation.
  11293. NextPageToken string `json:"nextPageToken,omitempty"`
  11294. // UserRoles: User role collection.
  11295. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11296. // ServerResponse contains the HTTP response code and headers from the
  11297. // server.
  11298. googleapi.ServerResponse `json:"-"`
  11299. // ForceSendFields is a list of field names (e.g. "Kind") to
  11300. // unconditionally include in API requests. By default, fields with
  11301. // empty values are omitted from API requests. However, any non-pointer,
  11302. // non-interface field appearing in ForceSendFields will be sent to the
  11303. // server regardless of whether the field is empty or not. This may be
  11304. // used to include empty fields in Patch requests.
  11305. ForceSendFields []string `json:"-"`
  11306. // NullFields is a list of field names (e.g. "Kind") to include in API
  11307. // requests with the JSON null value. By default, fields with empty
  11308. // values are omitted from API requests. However, any field with an
  11309. // empty value appearing in NullFields will be sent to the server as
  11310. // null. It is an error if a field in this list has a non-empty value.
  11311. // This may be used to include null fields in Patch requests.
  11312. NullFields []string `json:"-"`
  11313. }
  11314. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11315. type NoMethod UserRolesListResponse
  11316. raw := NoMethod(*s)
  11317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11318. }
  11319. // VideoFormat: Contains information about supported video formats.
  11320. type VideoFormat struct {
  11321. // FileType: File type of the video format.
  11322. //
  11323. // Possible values:
  11324. // "FLV"
  11325. // "M3U8"
  11326. // "MP4"
  11327. // "THREEGPP"
  11328. // "WEBM"
  11329. FileType string `json:"fileType,omitempty"`
  11330. // Id: ID of the video format.
  11331. Id int64 `json:"id,omitempty"`
  11332. // Kind: Identifies what kind of resource this is. Value: the fixed
  11333. // string "dfareporting#videoFormat".
  11334. Kind string `json:"kind,omitempty"`
  11335. // Resolution: The resolution of this video format.
  11336. Resolution *Size `json:"resolution,omitempty"`
  11337. // TargetBitRate: The target bit rate of this video format.
  11338. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11339. // ServerResponse contains the HTTP response code and headers from the
  11340. // server.
  11341. googleapi.ServerResponse `json:"-"`
  11342. // ForceSendFields is a list of field names (e.g. "FileType") to
  11343. // unconditionally include in API requests. By default, fields with
  11344. // empty values are omitted from API requests. However, any non-pointer,
  11345. // non-interface field appearing in ForceSendFields will be sent to the
  11346. // server regardless of whether the field is empty or not. This may be
  11347. // used to include empty fields in Patch requests.
  11348. ForceSendFields []string `json:"-"`
  11349. // NullFields is a list of field names (e.g. "FileType") to include in
  11350. // API requests with the JSON null value. By default, fields with empty
  11351. // values are omitted from API requests. However, any field with an
  11352. // empty value appearing in NullFields will be sent to the server as
  11353. // null. It is an error if a field in this list has a non-empty value.
  11354. // This may be used to include null fields in Patch requests.
  11355. NullFields []string `json:"-"`
  11356. }
  11357. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11358. type NoMethod VideoFormat
  11359. raw := NoMethod(*s)
  11360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11361. }
  11362. // VideoFormatsListResponse: Video Format List Response
  11363. type VideoFormatsListResponse struct {
  11364. // Kind: Identifies what kind of resource this is. Value: the fixed
  11365. // string "dfareporting#videoFormatsListResponse".
  11366. Kind string `json:"kind,omitempty"`
  11367. // VideoFormats: Video format collection.
  11368. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11369. // ServerResponse contains the HTTP response code and headers from the
  11370. // server.
  11371. googleapi.ServerResponse `json:"-"`
  11372. // ForceSendFields is a list of field names (e.g. "Kind") to
  11373. // unconditionally include in API requests. By default, fields with
  11374. // empty values are omitted from API requests. However, any non-pointer,
  11375. // non-interface field appearing in ForceSendFields will be sent to the
  11376. // server regardless of whether the field is empty or not. This may be
  11377. // used to include empty fields in Patch requests.
  11378. ForceSendFields []string `json:"-"`
  11379. // NullFields is a list of field names (e.g. "Kind") to include in API
  11380. // requests with the JSON null value. By default, fields with empty
  11381. // values are omitted from API requests. However, any field with an
  11382. // empty value appearing in NullFields will be sent to the server as
  11383. // null. It is an error if a field in this list has a non-empty value.
  11384. // This may be used to include null fields in Patch requests.
  11385. NullFields []string `json:"-"`
  11386. }
  11387. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11388. type NoMethod VideoFormatsListResponse
  11389. raw := NoMethod(*s)
  11390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11391. }
  11392. // VideoOffset: Video Offset
  11393. type VideoOffset struct {
  11394. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11395. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11396. // inclusive.
  11397. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11398. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11399. // is set. Acceptable values are 0 to 86399, inclusive.
  11400. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11401. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11402. // unconditionally include in API requests. By default, fields with
  11403. // empty values are omitted from API requests. However, any non-pointer,
  11404. // non-interface field appearing in ForceSendFields will be sent to the
  11405. // server regardless of whether the field is empty or not. This may be
  11406. // used to include empty fields in Patch requests.
  11407. ForceSendFields []string `json:"-"`
  11408. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11409. // include in API requests with the JSON null value. By default, fields
  11410. // with empty values are omitted from API requests. However, any field
  11411. // with an empty value appearing in NullFields will be sent to the
  11412. // server as null. It is an error if a field in this list has a
  11413. // non-empty value. This may be used to include null fields in Patch
  11414. // requests.
  11415. NullFields []string `json:"-"`
  11416. }
  11417. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11418. type NoMethod VideoOffset
  11419. raw := NoMethod(*s)
  11420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11421. }
  11422. // VideoSettings: Video Settings
  11423. type VideoSettings struct {
  11424. // CompanionSettings: Settings for the companion creatives of video
  11425. // creatives served to this placement.
  11426. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11427. // Kind: Identifies what kind of resource this is. Value: the fixed
  11428. // string "dfareporting#videoSettings".
  11429. Kind string `json:"kind,omitempty"`
  11430. // SkippableSettings: Settings for the skippability of video creatives
  11431. // served to this placement. If this object is provided, the
  11432. // creative-level skippable settings will be overridden.
  11433. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11434. // TranscodeSettings: Settings for the transcodes of video creatives
  11435. // served to this placement. If this object is provided, the
  11436. // creative-level transcode settings will be overridden.
  11437. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11438. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11439. // to unconditionally include in API requests. By default, fields with
  11440. // empty values are omitted from API requests. However, any non-pointer,
  11441. // non-interface field appearing in ForceSendFields will be sent to the
  11442. // server regardless of whether the field is empty or not. This may be
  11443. // used to include empty fields in Patch requests.
  11444. ForceSendFields []string `json:"-"`
  11445. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11446. // include in API requests with the JSON null value. By default, fields
  11447. // with empty values are omitted from API requests. However, any field
  11448. // with an empty value appearing in NullFields will be sent to the
  11449. // server as null. It is an error if a field in this list has a
  11450. // non-empty value. This may be used to include null fields in Patch
  11451. // requests.
  11452. NullFields []string `json:"-"`
  11453. }
  11454. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11455. type NoMethod VideoSettings
  11456. raw := NoMethod(*s)
  11457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11458. }
  11459. // method id "dfareporting.accountActiveAdSummaries.get":
  11460. type AccountActiveAdSummariesGetCall struct {
  11461. s *Service
  11462. profileId int64
  11463. summaryAccountId int64
  11464. urlParams_ gensupport.URLParams
  11465. ifNoneMatch_ string
  11466. ctx_ context.Context
  11467. header_ http.Header
  11468. }
  11469. // Get: Gets the account's active ad summary by account ID.
  11470. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11471. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11472. c.profileId = profileId
  11473. c.summaryAccountId = summaryAccountId
  11474. return c
  11475. }
  11476. // Fields allows partial responses to be retrieved. See
  11477. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11478. // for more information.
  11479. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11480. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11481. return c
  11482. }
  11483. // IfNoneMatch sets the optional parameter which makes the operation
  11484. // fail if the object's ETag matches the given value. This is useful for
  11485. // getting updates only after the object has changed since the last
  11486. // request. Use googleapi.IsNotModified to check whether the response
  11487. // error from Do is the result of In-None-Match.
  11488. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11489. c.ifNoneMatch_ = entityTag
  11490. return c
  11491. }
  11492. // Context sets the context to be used in this call's Do method. Any
  11493. // pending HTTP request will be aborted if the provided context is
  11494. // canceled.
  11495. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11496. c.ctx_ = ctx
  11497. return c
  11498. }
  11499. // Header returns an http.Header that can be modified by the caller to
  11500. // add HTTP headers to the request.
  11501. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11502. if c.header_ == nil {
  11503. c.header_ = make(http.Header)
  11504. }
  11505. return c.header_
  11506. }
  11507. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11508. reqHeaders := make(http.Header)
  11509. for k, v := range c.header_ {
  11510. reqHeaders[k] = v
  11511. }
  11512. reqHeaders.Set("User-Agent", c.s.userAgent())
  11513. if c.ifNoneMatch_ != "" {
  11514. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11515. }
  11516. var body io.Reader = nil
  11517. c.urlParams_.Set("alt", alt)
  11518. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11519. urls += "?" + c.urlParams_.Encode()
  11520. req, _ := http.NewRequest("GET", urls, body)
  11521. req.Header = reqHeaders
  11522. googleapi.Expand(req.URL, map[string]string{
  11523. "profileId": strconv.FormatInt(c.profileId, 10),
  11524. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11525. })
  11526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11527. }
  11528. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11529. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11530. // non-2xx status code is an error. Response headers are in either
  11531. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11532. // returned at all) in error.(*googleapi.Error).Header. Use
  11533. // googleapi.IsNotModified to check whether the returned error was
  11534. // because http.StatusNotModified was returned.
  11535. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11536. gensupport.SetOptions(c.urlParams_, opts...)
  11537. res, err := c.doRequest("json")
  11538. if res != nil && res.StatusCode == http.StatusNotModified {
  11539. if res.Body != nil {
  11540. res.Body.Close()
  11541. }
  11542. return nil, &googleapi.Error{
  11543. Code: res.StatusCode,
  11544. Header: res.Header,
  11545. }
  11546. }
  11547. if err != nil {
  11548. return nil, err
  11549. }
  11550. defer googleapi.CloseBody(res)
  11551. if err := googleapi.CheckResponse(res); err != nil {
  11552. return nil, err
  11553. }
  11554. ret := &AccountActiveAdSummary{
  11555. ServerResponse: googleapi.ServerResponse{
  11556. Header: res.Header,
  11557. HTTPStatusCode: res.StatusCode,
  11558. },
  11559. }
  11560. target := &ret
  11561. if err := gensupport.DecodeResponse(target, res); err != nil {
  11562. return nil, err
  11563. }
  11564. return ret, nil
  11565. // {
  11566. // "description": "Gets the account's active ad summary by account ID.",
  11567. // "httpMethod": "GET",
  11568. // "id": "dfareporting.accountActiveAdSummaries.get",
  11569. // "parameterOrder": [
  11570. // "profileId",
  11571. // "summaryAccountId"
  11572. // ],
  11573. // "parameters": {
  11574. // "profileId": {
  11575. // "description": "User profile ID associated with this request.",
  11576. // "format": "int64",
  11577. // "location": "path",
  11578. // "required": true,
  11579. // "type": "string"
  11580. // },
  11581. // "summaryAccountId": {
  11582. // "description": "Account ID.",
  11583. // "format": "int64",
  11584. // "location": "path",
  11585. // "required": true,
  11586. // "type": "string"
  11587. // }
  11588. // },
  11589. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  11590. // "response": {
  11591. // "$ref": "AccountActiveAdSummary"
  11592. // },
  11593. // "scopes": [
  11594. // "https://www.googleapis.com/auth/dfatrafficking"
  11595. // ]
  11596. // }
  11597. }
  11598. // method id "dfareporting.accountPermissionGroups.get":
  11599. type AccountPermissionGroupsGetCall struct {
  11600. s *Service
  11601. profileId int64
  11602. id int64
  11603. urlParams_ gensupport.URLParams
  11604. ifNoneMatch_ string
  11605. ctx_ context.Context
  11606. header_ http.Header
  11607. }
  11608. // Get: Gets one account permission group by ID.
  11609. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  11610. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11611. c.profileId = profileId
  11612. c.id = id
  11613. return c
  11614. }
  11615. // Fields allows partial responses to be retrieved. See
  11616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11617. // for more information.
  11618. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  11619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11620. return c
  11621. }
  11622. // IfNoneMatch sets the optional parameter which makes the operation
  11623. // fail if the object's ETag matches the given value. This is useful for
  11624. // getting updates only after the object has changed since the last
  11625. // request. Use googleapi.IsNotModified to check whether the response
  11626. // error from Do is the result of In-None-Match.
  11627. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  11628. c.ifNoneMatch_ = entityTag
  11629. return c
  11630. }
  11631. // Context sets the context to be used in this call's Do method. Any
  11632. // pending HTTP request will be aborted if the provided context is
  11633. // canceled.
  11634. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  11635. c.ctx_ = ctx
  11636. return c
  11637. }
  11638. // Header returns an http.Header that can be modified by the caller to
  11639. // add HTTP headers to the request.
  11640. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  11641. if c.header_ == nil {
  11642. c.header_ = make(http.Header)
  11643. }
  11644. return c.header_
  11645. }
  11646. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  11647. reqHeaders := make(http.Header)
  11648. for k, v := range c.header_ {
  11649. reqHeaders[k] = v
  11650. }
  11651. reqHeaders.Set("User-Agent", c.s.userAgent())
  11652. if c.ifNoneMatch_ != "" {
  11653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11654. }
  11655. var body io.Reader = nil
  11656. c.urlParams_.Set("alt", alt)
  11657. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  11658. urls += "?" + c.urlParams_.Encode()
  11659. req, _ := http.NewRequest("GET", urls, body)
  11660. req.Header = reqHeaders
  11661. googleapi.Expand(req.URL, map[string]string{
  11662. "profileId": strconv.FormatInt(c.profileId, 10),
  11663. "id": strconv.FormatInt(c.id, 10),
  11664. })
  11665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11666. }
  11667. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  11668. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  11669. // non-2xx status code is an error. Response headers are in either
  11670. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  11671. // returned at all) in error.(*googleapi.Error).Header. Use
  11672. // googleapi.IsNotModified to check whether the returned error was
  11673. // because http.StatusNotModified was returned.
  11674. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  11675. gensupport.SetOptions(c.urlParams_, opts...)
  11676. res, err := c.doRequest("json")
  11677. if res != nil && res.StatusCode == http.StatusNotModified {
  11678. if res.Body != nil {
  11679. res.Body.Close()
  11680. }
  11681. return nil, &googleapi.Error{
  11682. Code: res.StatusCode,
  11683. Header: res.Header,
  11684. }
  11685. }
  11686. if err != nil {
  11687. return nil, err
  11688. }
  11689. defer googleapi.CloseBody(res)
  11690. if err := googleapi.CheckResponse(res); err != nil {
  11691. return nil, err
  11692. }
  11693. ret := &AccountPermissionGroup{
  11694. ServerResponse: googleapi.ServerResponse{
  11695. Header: res.Header,
  11696. HTTPStatusCode: res.StatusCode,
  11697. },
  11698. }
  11699. target := &ret
  11700. if err := gensupport.DecodeResponse(target, res); err != nil {
  11701. return nil, err
  11702. }
  11703. return ret, nil
  11704. // {
  11705. // "description": "Gets one account permission group by ID.",
  11706. // "httpMethod": "GET",
  11707. // "id": "dfareporting.accountPermissionGroups.get",
  11708. // "parameterOrder": [
  11709. // "profileId",
  11710. // "id"
  11711. // ],
  11712. // "parameters": {
  11713. // "id": {
  11714. // "description": "Account permission group ID.",
  11715. // "format": "int64",
  11716. // "location": "path",
  11717. // "required": true,
  11718. // "type": "string"
  11719. // },
  11720. // "profileId": {
  11721. // "description": "User profile ID associated with this request.",
  11722. // "format": "int64",
  11723. // "location": "path",
  11724. // "required": true,
  11725. // "type": "string"
  11726. // }
  11727. // },
  11728. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  11729. // "response": {
  11730. // "$ref": "AccountPermissionGroup"
  11731. // },
  11732. // "scopes": [
  11733. // "https://www.googleapis.com/auth/dfatrafficking"
  11734. // ]
  11735. // }
  11736. }
  11737. // method id "dfareporting.accountPermissionGroups.list":
  11738. type AccountPermissionGroupsListCall struct {
  11739. s *Service
  11740. profileId int64
  11741. urlParams_ gensupport.URLParams
  11742. ifNoneMatch_ string
  11743. ctx_ context.Context
  11744. header_ http.Header
  11745. }
  11746. // List: Retrieves the list of account permission groups.
  11747. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  11748. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11749. c.profileId = profileId
  11750. return c
  11751. }
  11752. // Fields allows partial responses to be retrieved. See
  11753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11754. // for more information.
  11755. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  11756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11757. return c
  11758. }
  11759. // IfNoneMatch sets the optional parameter which makes the operation
  11760. // fail if the object's ETag matches the given value. This is useful for
  11761. // getting updates only after the object has changed since the last
  11762. // request. Use googleapi.IsNotModified to check whether the response
  11763. // error from Do is the result of In-None-Match.
  11764. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  11765. c.ifNoneMatch_ = entityTag
  11766. return c
  11767. }
  11768. // Context sets the context to be used in this call's Do method. Any
  11769. // pending HTTP request will be aborted if the provided context is
  11770. // canceled.
  11771. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  11772. c.ctx_ = ctx
  11773. return c
  11774. }
  11775. // Header returns an http.Header that can be modified by the caller to
  11776. // add HTTP headers to the request.
  11777. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  11778. if c.header_ == nil {
  11779. c.header_ = make(http.Header)
  11780. }
  11781. return c.header_
  11782. }
  11783. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  11784. reqHeaders := make(http.Header)
  11785. for k, v := range c.header_ {
  11786. reqHeaders[k] = v
  11787. }
  11788. reqHeaders.Set("User-Agent", c.s.userAgent())
  11789. if c.ifNoneMatch_ != "" {
  11790. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11791. }
  11792. var body io.Reader = nil
  11793. c.urlParams_.Set("alt", alt)
  11794. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  11795. urls += "?" + c.urlParams_.Encode()
  11796. req, _ := http.NewRequest("GET", urls, body)
  11797. req.Header = reqHeaders
  11798. googleapi.Expand(req.URL, map[string]string{
  11799. "profileId": strconv.FormatInt(c.profileId, 10),
  11800. })
  11801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11802. }
  11803. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  11804. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  11805. // non-nil. Any non-2xx status code is an error. Response headers are in
  11806. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  11807. // (if a response was returned at all) in
  11808. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11809. // whether the returned error was because http.StatusNotModified was
  11810. // returned.
  11811. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  11812. gensupport.SetOptions(c.urlParams_, opts...)
  11813. res, err := c.doRequest("json")
  11814. if res != nil && res.StatusCode == http.StatusNotModified {
  11815. if res.Body != nil {
  11816. res.Body.Close()
  11817. }
  11818. return nil, &googleapi.Error{
  11819. Code: res.StatusCode,
  11820. Header: res.Header,
  11821. }
  11822. }
  11823. if err != nil {
  11824. return nil, err
  11825. }
  11826. defer googleapi.CloseBody(res)
  11827. if err := googleapi.CheckResponse(res); err != nil {
  11828. return nil, err
  11829. }
  11830. ret := &AccountPermissionGroupsListResponse{
  11831. ServerResponse: googleapi.ServerResponse{
  11832. Header: res.Header,
  11833. HTTPStatusCode: res.StatusCode,
  11834. },
  11835. }
  11836. target := &ret
  11837. if err := gensupport.DecodeResponse(target, res); err != nil {
  11838. return nil, err
  11839. }
  11840. return ret, nil
  11841. // {
  11842. // "description": "Retrieves the list of account permission groups.",
  11843. // "httpMethod": "GET",
  11844. // "id": "dfareporting.accountPermissionGroups.list",
  11845. // "parameterOrder": [
  11846. // "profileId"
  11847. // ],
  11848. // "parameters": {
  11849. // "profileId": {
  11850. // "description": "User profile ID associated with this request.",
  11851. // "format": "int64",
  11852. // "location": "path",
  11853. // "required": true,
  11854. // "type": "string"
  11855. // }
  11856. // },
  11857. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  11858. // "response": {
  11859. // "$ref": "AccountPermissionGroupsListResponse"
  11860. // },
  11861. // "scopes": [
  11862. // "https://www.googleapis.com/auth/dfatrafficking"
  11863. // ]
  11864. // }
  11865. }
  11866. // method id "dfareporting.accountPermissions.get":
  11867. type AccountPermissionsGetCall struct {
  11868. s *Service
  11869. profileId int64
  11870. id int64
  11871. urlParams_ gensupport.URLParams
  11872. ifNoneMatch_ string
  11873. ctx_ context.Context
  11874. header_ http.Header
  11875. }
  11876. // Get: Gets one account permission by ID.
  11877. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  11878. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11879. c.profileId = profileId
  11880. c.id = id
  11881. return c
  11882. }
  11883. // Fields allows partial responses to be retrieved. See
  11884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11885. // for more information.
  11886. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  11887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11888. return c
  11889. }
  11890. // IfNoneMatch sets the optional parameter which makes the operation
  11891. // fail if the object's ETag matches the given value. This is useful for
  11892. // getting updates only after the object has changed since the last
  11893. // request. Use googleapi.IsNotModified to check whether the response
  11894. // error from Do is the result of In-None-Match.
  11895. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  11896. c.ifNoneMatch_ = entityTag
  11897. return c
  11898. }
  11899. // Context sets the context to be used in this call's Do method. Any
  11900. // pending HTTP request will be aborted if the provided context is
  11901. // canceled.
  11902. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  11903. c.ctx_ = ctx
  11904. return c
  11905. }
  11906. // Header returns an http.Header that can be modified by the caller to
  11907. // add HTTP headers to the request.
  11908. func (c *AccountPermissionsGetCall) Header() http.Header {
  11909. if c.header_ == nil {
  11910. c.header_ = make(http.Header)
  11911. }
  11912. return c.header_
  11913. }
  11914. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  11915. reqHeaders := make(http.Header)
  11916. for k, v := range c.header_ {
  11917. reqHeaders[k] = v
  11918. }
  11919. reqHeaders.Set("User-Agent", c.s.userAgent())
  11920. if c.ifNoneMatch_ != "" {
  11921. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11922. }
  11923. var body io.Reader = nil
  11924. c.urlParams_.Set("alt", alt)
  11925. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  11926. urls += "?" + c.urlParams_.Encode()
  11927. req, _ := http.NewRequest("GET", urls, body)
  11928. req.Header = reqHeaders
  11929. googleapi.Expand(req.URL, map[string]string{
  11930. "profileId": strconv.FormatInt(c.profileId, 10),
  11931. "id": strconv.FormatInt(c.id, 10),
  11932. })
  11933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11934. }
  11935. // Do executes the "dfareporting.accountPermissions.get" call.
  11936. // Exactly one of *AccountPermission or error will be non-nil. Any
  11937. // non-2xx status code is an error. Response headers are in either
  11938. // *AccountPermission.ServerResponse.Header or (if a response was
  11939. // returned at all) in error.(*googleapi.Error).Header. Use
  11940. // googleapi.IsNotModified to check whether the returned error was
  11941. // because http.StatusNotModified was returned.
  11942. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  11943. gensupport.SetOptions(c.urlParams_, opts...)
  11944. res, err := c.doRequest("json")
  11945. if res != nil && res.StatusCode == http.StatusNotModified {
  11946. if res.Body != nil {
  11947. res.Body.Close()
  11948. }
  11949. return nil, &googleapi.Error{
  11950. Code: res.StatusCode,
  11951. Header: res.Header,
  11952. }
  11953. }
  11954. if err != nil {
  11955. return nil, err
  11956. }
  11957. defer googleapi.CloseBody(res)
  11958. if err := googleapi.CheckResponse(res); err != nil {
  11959. return nil, err
  11960. }
  11961. ret := &AccountPermission{
  11962. ServerResponse: googleapi.ServerResponse{
  11963. Header: res.Header,
  11964. HTTPStatusCode: res.StatusCode,
  11965. },
  11966. }
  11967. target := &ret
  11968. if err := gensupport.DecodeResponse(target, res); err != nil {
  11969. return nil, err
  11970. }
  11971. return ret, nil
  11972. // {
  11973. // "description": "Gets one account permission by ID.",
  11974. // "httpMethod": "GET",
  11975. // "id": "dfareporting.accountPermissions.get",
  11976. // "parameterOrder": [
  11977. // "profileId",
  11978. // "id"
  11979. // ],
  11980. // "parameters": {
  11981. // "id": {
  11982. // "description": "Account permission ID.",
  11983. // "format": "int64",
  11984. // "location": "path",
  11985. // "required": true,
  11986. // "type": "string"
  11987. // },
  11988. // "profileId": {
  11989. // "description": "User profile ID associated with this request.",
  11990. // "format": "int64",
  11991. // "location": "path",
  11992. // "required": true,
  11993. // "type": "string"
  11994. // }
  11995. // },
  11996. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  11997. // "response": {
  11998. // "$ref": "AccountPermission"
  11999. // },
  12000. // "scopes": [
  12001. // "https://www.googleapis.com/auth/dfatrafficking"
  12002. // ]
  12003. // }
  12004. }
  12005. // method id "dfareporting.accountPermissions.list":
  12006. type AccountPermissionsListCall struct {
  12007. s *Service
  12008. profileId int64
  12009. urlParams_ gensupport.URLParams
  12010. ifNoneMatch_ string
  12011. ctx_ context.Context
  12012. header_ http.Header
  12013. }
  12014. // List: Retrieves the list of account permissions.
  12015. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12016. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12017. c.profileId = profileId
  12018. return c
  12019. }
  12020. // Fields allows partial responses to be retrieved. See
  12021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12022. // for more information.
  12023. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12025. return c
  12026. }
  12027. // IfNoneMatch sets the optional parameter which makes the operation
  12028. // fail if the object's ETag matches the given value. This is useful for
  12029. // getting updates only after the object has changed since the last
  12030. // request. Use googleapi.IsNotModified to check whether the response
  12031. // error from Do is the result of In-None-Match.
  12032. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12033. c.ifNoneMatch_ = entityTag
  12034. return c
  12035. }
  12036. // Context sets the context to be used in this call's Do method. Any
  12037. // pending HTTP request will be aborted if the provided context is
  12038. // canceled.
  12039. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12040. c.ctx_ = ctx
  12041. return c
  12042. }
  12043. // Header returns an http.Header that can be modified by the caller to
  12044. // add HTTP headers to the request.
  12045. func (c *AccountPermissionsListCall) Header() http.Header {
  12046. if c.header_ == nil {
  12047. c.header_ = make(http.Header)
  12048. }
  12049. return c.header_
  12050. }
  12051. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12052. reqHeaders := make(http.Header)
  12053. for k, v := range c.header_ {
  12054. reqHeaders[k] = v
  12055. }
  12056. reqHeaders.Set("User-Agent", c.s.userAgent())
  12057. if c.ifNoneMatch_ != "" {
  12058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12059. }
  12060. var body io.Reader = nil
  12061. c.urlParams_.Set("alt", alt)
  12062. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12063. urls += "?" + c.urlParams_.Encode()
  12064. req, _ := http.NewRequest("GET", urls, body)
  12065. req.Header = reqHeaders
  12066. googleapi.Expand(req.URL, map[string]string{
  12067. "profileId": strconv.FormatInt(c.profileId, 10),
  12068. })
  12069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12070. }
  12071. // Do executes the "dfareporting.accountPermissions.list" call.
  12072. // Exactly one of *AccountPermissionsListResponse or error will be
  12073. // non-nil. Any non-2xx status code is an error. Response headers are in
  12074. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12075. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12076. // googleapi.IsNotModified to check whether the returned error was
  12077. // because http.StatusNotModified was returned.
  12078. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12079. gensupport.SetOptions(c.urlParams_, opts...)
  12080. res, err := c.doRequest("json")
  12081. if res != nil && res.StatusCode == http.StatusNotModified {
  12082. if res.Body != nil {
  12083. res.Body.Close()
  12084. }
  12085. return nil, &googleapi.Error{
  12086. Code: res.StatusCode,
  12087. Header: res.Header,
  12088. }
  12089. }
  12090. if err != nil {
  12091. return nil, err
  12092. }
  12093. defer googleapi.CloseBody(res)
  12094. if err := googleapi.CheckResponse(res); err != nil {
  12095. return nil, err
  12096. }
  12097. ret := &AccountPermissionsListResponse{
  12098. ServerResponse: googleapi.ServerResponse{
  12099. Header: res.Header,
  12100. HTTPStatusCode: res.StatusCode,
  12101. },
  12102. }
  12103. target := &ret
  12104. if err := gensupport.DecodeResponse(target, res); err != nil {
  12105. return nil, err
  12106. }
  12107. return ret, nil
  12108. // {
  12109. // "description": "Retrieves the list of account permissions.",
  12110. // "httpMethod": "GET",
  12111. // "id": "dfareporting.accountPermissions.list",
  12112. // "parameterOrder": [
  12113. // "profileId"
  12114. // ],
  12115. // "parameters": {
  12116. // "profileId": {
  12117. // "description": "User profile ID associated with this request.",
  12118. // "format": "int64",
  12119. // "location": "path",
  12120. // "required": true,
  12121. // "type": "string"
  12122. // }
  12123. // },
  12124. // "path": "userprofiles/{profileId}/accountPermissions",
  12125. // "response": {
  12126. // "$ref": "AccountPermissionsListResponse"
  12127. // },
  12128. // "scopes": [
  12129. // "https://www.googleapis.com/auth/dfatrafficking"
  12130. // ]
  12131. // }
  12132. }
  12133. // method id "dfareporting.accountUserProfiles.get":
  12134. type AccountUserProfilesGetCall struct {
  12135. s *Service
  12136. profileId int64
  12137. id int64
  12138. urlParams_ gensupport.URLParams
  12139. ifNoneMatch_ string
  12140. ctx_ context.Context
  12141. header_ http.Header
  12142. }
  12143. // Get: Gets one account user profile by ID.
  12144. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12145. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12146. c.profileId = profileId
  12147. c.id = id
  12148. return c
  12149. }
  12150. // Fields allows partial responses to be retrieved. See
  12151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12152. // for more information.
  12153. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12155. return c
  12156. }
  12157. // IfNoneMatch sets the optional parameter which makes the operation
  12158. // fail if the object's ETag matches the given value. This is useful for
  12159. // getting updates only after the object has changed since the last
  12160. // request. Use googleapi.IsNotModified to check whether the response
  12161. // error from Do is the result of In-None-Match.
  12162. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12163. c.ifNoneMatch_ = entityTag
  12164. return c
  12165. }
  12166. // Context sets the context to be used in this call's Do method. Any
  12167. // pending HTTP request will be aborted if the provided context is
  12168. // canceled.
  12169. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12170. c.ctx_ = ctx
  12171. return c
  12172. }
  12173. // Header returns an http.Header that can be modified by the caller to
  12174. // add HTTP headers to the request.
  12175. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12176. if c.header_ == nil {
  12177. c.header_ = make(http.Header)
  12178. }
  12179. return c.header_
  12180. }
  12181. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12182. reqHeaders := make(http.Header)
  12183. for k, v := range c.header_ {
  12184. reqHeaders[k] = v
  12185. }
  12186. reqHeaders.Set("User-Agent", c.s.userAgent())
  12187. if c.ifNoneMatch_ != "" {
  12188. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12189. }
  12190. var body io.Reader = nil
  12191. c.urlParams_.Set("alt", alt)
  12192. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12193. urls += "?" + c.urlParams_.Encode()
  12194. req, _ := http.NewRequest("GET", urls, body)
  12195. req.Header = reqHeaders
  12196. googleapi.Expand(req.URL, map[string]string{
  12197. "profileId": strconv.FormatInt(c.profileId, 10),
  12198. "id": strconv.FormatInt(c.id, 10),
  12199. })
  12200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12201. }
  12202. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12203. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12204. // non-2xx status code is an error. Response headers are in either
  12205. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12206. // returned at all) in error.(*googleapi.Error).Header. Use
  12207. // googleapi.IsNotModified to check whether the returned error was
  12208. // because http.StatusNotModified was returned.
  12209. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12210. gensupport.SetOptions(c.urlParams_, opts...)
  12211. res, err := c.doRequest("json")
  12212. if res != nil && res.StatusCode == http.StatusNotModified {
  12213. if res.Body != nil {
  12214. res.Body.Close()
  12215. }
  12216. return nil, &googleapi.Error{
  12217. Code: res.StatusCode,
  12218. Header: res.Header,
  12219. }
  12220. }
  12221. if err != nil {
  12222. return nil, err
  12223. }
  12224. defer googleapi.CloseBody(res)
  12225. if err := googleapi.CheckResponse(res); err != nil {
  12226. return nil, err
  12227. }
  12228. ret := &AccountUserProfile{
  12229. ServerResponse: googleapi.ServerResponse{
  12230. Header: res.Header,
  12231. HTTPStatusCode: res.StatusCode,
  12232. },
  12233. }
  12234. target := &ret
  12235. if err := gensupport.DecodeResponse(target, res); err != nil {
  12236. return nil, err
  12237. }
  12238. return ret, nil
  12239. // {
  12240. // "description": "Gets one account user profile by ID.",
  12241. // "httpMethod": "GET",
  12242. // "id": "dfareporting.accountUserProfiles.get",
  12243. // "parameterOrder": [
  12244. // "profileId",
  12245. // "id"
  12246. // ],
  12247. // "parameters": {
  12248. // "id": {
  12249. // "description": "User profile ID.",
  12250. // "format": "int64",
  12251. // "location": "path",
  12252. // "required": true,
  12253. // "type": "string"
  12254. // },
  12255. // "profileId": {
  12256. // "description": "User profile ID associated with this request.",
  12257. // "format": "int64",
  12258. // "location": "path",
  12259. // "required": true,
  12260. // "type": "string"
  12261. // }
  12262. // },
  12263. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12264. // "response": {
  12265. // "$ref": "AccountUserProfile"
  12266. // },
  12267. // "scopes": [
  12268. // "https://www.googleapis.com/auth/dfatrafficking"
  12269. // ]
  12270. // }
  12271. }
  12272. // method id "dfareporting.accountUserProfiles.insert":
  12273. type AccountUserProfilesInsertCall struct {
  12274. s *Service
  12275. profileId int64
  12276. accountuserprofile *AccountUserProfile
  12277. urlParams_ gensupport.URLParams
  12278. ctx_ context.Context
  12279. header_ http.Header
  12280. }
  12281. // Insert: Inserts a new account user profile.
  12282. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12283. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12284. c.profileId = profileId
  12285. c.accountuserprofile = accountuserprofile
  12286. return c
  12287. }
  12288. // Fields allows partial responses to be retrieved. See
  12289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12290. // for more information.
  12291. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12293. return c
  12294. }
  12295. // Context sets the context to be used in this call's Do method. Any
  12296. // pending HTTP request will be aborted if the provided context is
  12297. // canceled.
  12298. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12299. c.ctx_ = ctx
  12300. return c
  12301. }
  12302. // Header returns an http.Header that can be modified by the caller to
  12303. // add HTTP headers to the request.
  12304. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12305. if c.header_ == nil {
  12306. c.header_ = make(http.Header)
  12307. }
  12308. return c.header_
  12309. }
  12310. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12311. reqHeaders := make(http.Header)
  12312. for k, v := range c.header_ {
  12313. reqHeaders[k] = v
  12314. }
  12315. reqHeaders.Set("User-Agent", c.s.userAgent())
  12316. var body io.Reader = nil
  12317. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12318. if err != nil {
  12319. return nil, err
  12320. }
  12321. reqHeaders.Set("Content-Type", "application/json")
  12322. c.urlParams_.Set("alt", alt)
  12323. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12324. urls += "?" + c.urlParams_.Encode()
  12325. req, _ := http.NewRequest("POST", urls, body)
  12326. req.Header = reqHeaders
  12327. googleapi.Expand(req.URL, map[string]string{
  12328. "profileId": strconv.FormatInt(c.profileId, 10),
  12329. })
  12330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12331. }
  12332. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12333. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12334. // non-2xx status code is an error. Response headers are in either
  12335. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12336. // returned at all) in error.(*googleapi.Error).Header. Use
  12337. // googleapi.IsNotModified to check whether the returned error was
  12338. // because http.StatusNotModified was returned.
  12339. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12340. gensupport.SetOptions(c.urlParams_, opts...)
  12341. res, err := c.doRequest("json")
  12342. if res != nil && res.StatusCode == http.StatusNotModified {
  12343. if res.Body != nil {
  12344. res.Body.Close()
  12345. }
  12346. return nil, &googleapi.Error{
  12347. Code: res.StatusCode,
  12348. Header: res.Header,
  12349. }
  12350. }
  12351. if err != nil {
  12352. return nil, err
  12353. }
  12354. defer googleapi.CloseBody(res)
  12355. if err := googleapi.CheckResponse(res); err != nil {
  12356. return nil, err
  12357. }
  12358. ret := &AccountUserProfile{
  12359. ServerResponse: googleapi.ServerResponse{
  12360. Header: res.Header,
  12361. HTTPStatusCode: res.StatusCode,
  12362. },
  12363. }
  12364. target := &ret
  12365. if err := gensupport.DecodeResponse(target, res); err != nil {
  12366. return nil, err
  12367. }
  12368. return ret, nil
  12369. // {
  12370. // "description": "Inserts a new account user profile.",
  12371. // "httpMethod": "POST",
  12372. // "id": "dfareporting.accountUserProfiles.insert",
  12373. // "parameterOrder": [
  12374. // "profileId"
  12375. // ],
  12376. // "parameters": {
  12377. // "profileId": {
  12378. // "description": "User profile ID associated with this request.",
  12379. // "format": "int64",
  12380. // "location": "path",
  12381. // "required": true,
  12382. // "type": "string"
  12383. // }
  12384. // },
  12385. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12386. // "request": {
  12387. // "$ref": "AccountUserProfile"
  12388. // },
  12389. // "response": {
  12390. // "$ref": "AccountUserProfile"
  12391. // },
  12392. // "scopes": [
  12393. // "https://www.googleapis.com/auth/dfatrafficking"
  12394. // ]
  12395. // }
  12396. }
  12397. // method id "dfareporting.accountUserProfiles.list":
  12398. type AccountUserProfilesListCall struct {
  12399. s *Service
  12400. profileId int64
  12401. urlParams_ gensupport.URLParams
  12402. ifNoneMatch_ string
  12403. ctx_ context.Context
  12404. header_ http.Header
  12405. }
  12406. // List: Retrieves a list of account user profiles, possibly filtered.
  12407. // This method supports paging.
  12408. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12409. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12410. c.profileId = profileId
  12411. return c
  12412. }
  12413. // Active sets the optional parameter "active": Select only active user
  12414. // profiles.
  12415. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12416. c.urlParams_.Set("active", fmt.Sprint(active))
  12417. return c
  12418. }
  12419. // Ids sets the optional parameter "ids": Select only user profiles with
  12420. // these IDs.
  12421. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12422. var ids_ []string
  12423. for _, v := range ids {
  12424. ids_ = append(ids_, fmt.Sprint(v))
  12425. }
  12426. c.urlParams_.SetMulti("ids", ids_)
  12427. return c
  12428. }
  12429. // MaxResults sets the optional parameter "maxResults": Maximum number
  12430. // of results to return.
  12431. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12432. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12433. return c
  12434. }
  12435. // PageToken sets the optional parameter "pageToken": Value of the
  12436. // nextPageToken from the previous result page.
  12437. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12438. c.urlParams_.Set("pageToken", pageToken)
  12439. return c
  12440. }
  12441. // SearchString sets the optional parameter "searchString": Allows
  12442. // searching for objects by name, ID or email. Wildcards (*) are
  12443. // allowed. For example, "user profile*2015" will return objects with
  12444. // names like "user profile June 2015", "user profile April 2015", or
  12445. // simply "user profile 2015". Most of the searches also add wildcards
  12446. // implicitly at the start and the end of the search string. For
  12447. // example, a search string of "user profile" will match objects with
  12448. // name "my user profile", "user profile 2015", or simply "user
  12449. // profile".
  12450. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12451. c.urlParams_.Set("searchString", searchString)
  12452. return c
  12453. }
  12454. // SortField sets the optional parameter "sortField": Field by which to
  12455. // sort the list.
  12456. //
  12457. // Possible values:
  12458. // "ID" (default)
  12459. // "NAME"
  12460. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12461. c.urlParams_.Set("sortField", sortField)
  12462. return c
  12463. }
  12464. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12465. // results.
  12466. //
  12467. // Possible values:
  12468. // "ASCENDING" (default)
  12469. // "DESCENDING"
  12470. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12471. c.urlParams_.Set("sortOrder", sortOrder)
  12472. return c
  12473. }
  12474. // SubaccountId sets the optional parameter "subaccountId": Select only
  12475. // user profiles with the specified subaccount ID.
  12476. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12477. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12478. return c
  12479. }
  12480. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12481. // profiles with the specified user role ID.
  12482. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12483. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12484. return c
  12485. }
  12486. // Fields allows partial responses to be retrieved. See
  12487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12488. // for more information.
  12489. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12491. return c
  12492. }
  12493. // IfNoneMatch sets the optional parameter which makes the operation
  12494. // fail if the object's ETag matches the given value. This is useful for
  12495. // getting updates only after the object has changed since the last
  12496. // request. Use googleapi.IsNotModified to check whether the response
  12497. // error from Do is the result of In-None-Match.
  12498. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12499. c.ifNoneMatch_ = entityTag
  12500. return c
  12501. }
  12502. // Context sets the context to be used in this call's Do method. Any
  12503. // pending HTTP request will be aborted if the provided context is
  12504. // canceled.
  12505. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12506. c.ctx_ = ctx
  12507. return c
  12508. }
  12509. // Header returns an http.Header that can be modified by the caller to
  12510. // add HTTP headers to the request.
  12511. func (c *AccountUserProfilesListCall) Header() http.Header {
  12512. if c.header_ == nil {
  12513. c.header_ = make(http.Header)
  12514. }
  12515. return c.header_
  12516. }
  12517. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12518. reqHeaders := make(http.Header)
  12519. for k, v := range c.header_ {
  12520. reqHeaders[k] = v
  12521. }
  12522. reqHeaders.Set("User-Agent", c.s.userAgent())
  12523. if c.ifNoneMatch_ != "" {
  12524. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12525. }
  12526. var body io.Reader = nil
  12527. c.urlParams_.Set("alt", alt)
  12528. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12529. urls += "?" + c.urlParams_.Encode()
  12530. req, _ := http.NewRequest("GET", urls, body)
  12531. req.Header = reqHeaders
  12532. googleapi.Expand(req.URL, map[string]string{
  12533. "profileId": strconv.FormatInt(c.profileId, 10),
  12534. })
  12535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12536. }
  12537. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12538. // Exactly one of *AccountUserProfilesListResponse or error will be
  12539. // non-nil. Any non-2xx status code is an error. Response headers are in
  12540. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12541. // a response was returned at all) in error.(*googleapi.Error).Header.
  12542. // Use googleapi.IsNotModified to check whether the returned error was
  12543. // because http.StatusNotModified was returned.
  12544. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  12545. gensupport.SetOptions(c.urlParams_, opts...)
  12546. res, err := c.doRequest("json")
  12547. if res != nil && res.StatusCode == http.StatusNotModified {
  12548. if res.Body != nil {
  12549. res.Body.Close()
  12550. }
  12551. return nil, &googleapi.Error{
  12552. Code: res.StatusCode,
  12553. Header: res.Header,
  12554. }
  12555. }
  12556. if err != nil {
  12557. return nil, err
  12558. }
  12559. defer googleapi.CloseBody(res)
  12560. if err := googleapi.CheckResponse(res); err != nil {
  12561. return nil, err
  12562. }
  12563. ret := &AccountUserProfilesListResponse{
  12564. ServerResponse: googleapi.ServerResponse{
  12565. Header: res.Header,
  12566. HTTPStatusCode: res.StatusCode,
  12567. },
  12568. }
  12569. target := &ret
  12570. if err := gensupport.DecodeResponse(target, res); err != nil {
  12571. return nil, err
  12572. }
  12573. return ret, nil
  12574. // {
  12575. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  12576. // "httpMethod": "GET",
  12577. // "id": "dfareporting.accountUserProfiles.list",
  12578. // "parameterOrder": [
  12579. // "profileId"
  12580. // ],
  12581. // "parameters": {
  12582. // "active": {
  12583. // "description": "Select only active user profiles.",
  12584. // "location": "query",
  12585. // "type": "boolean"
  12586. // },
  12587. // "ids": {
  12588. // "description": "Select only user profiles with these IDs.",
  12589. // "format": "int64",
  12590. // "location": "query",
  12591. // "repeated": true,
  12592. // "type": "string"
  12593. // },
  12594. // "maxResults": {
  12595. // "default": "1000",
  12596. // "description": "Maximum number of results to return.",
  12597. // "format": "int32",
  12598. // "location": "query",
  12599. // "maximum": "1000",
  12600. // "minimum": "0",
  12601. // "type": "integer"
  12602. // },
  12603. // "pageToken": {
  12604. // "description": "Value of the nextPageToken from the previous result page.",
  12605. // "location": "query",
  12606. // "type": "string"
  12607. // },
  12608. // "profileId": {
  12609. // "description": "User profile ID associated with this request.",
  12610. // "format": "int64",
  12611. // "location": "path",
  12612. // "required": true,
  12613. // "type": "string"
  12614. // },
  12615. // "searchString": {
  12616. // "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\".",
  12617. // "location": "query",
  12618. // "type": "string"
  12619. // },
  12620. // "sortField": {
  12621. // "default": "ID",
  12622. // "description": "Field by which to sort the list.",
  12623. // "enum": [
  12624. // "ID",
  12625. // "NAME"
  12626. // ],
  12627. // "enumDescriptions": [
  12628. // "",
  12629. // ""
  12630. // ],
  12631. // "location": "query",
  12632. // "type": "string"
  12633. // },
  12634. // "sortOrder": {
  12635. // "default": "ASCENDING",
  12636. // "description": "Order of sorted results.",
  12637. // "enum": [
  12638. // "ASCENDING",
  12639. // "DESCENDING"
  12640. // ],
  12641. // "enumDescriptions": [
  12642. // "",
  12643. // ""
  12644. // ],
  12645. // "location": "query",
  12646. // "type": "string"
  12647. // },
  12648. // "subaccountId": {
  12649. // "description": "Select only user profiles with the specified subaccount ID.",
  12650. // "format": "int64",
  12651. // "location": "query",
  12652. // "type": "string"
  12653. // },
  12654. // "userRoleId": {
  12655. // "description": "Select only user profiles with the specified user role ID.",
  12656. // "format": "int64",
  12657. // "location": "query",
  12658. // "type": "string"
  12659. // }
  12660. // },
  12661. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12662. // "response": {
  12663. // "$ref": "AccountUserProfilesListResponse"
  12664. // },
  12665. // "scopes": [
  12666. // "https://www.googleapis.com/auth/dfatrafficking"
  12667. // ]
  12668. // }
  12669. }
  12670. // Pages invokes f for each page of results.
  12671. // A non-nil error returned from f will halt the iteration.
  12672. // The provided context supersedes any context provided to the Context method.
  12673. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  12674. c.ctx_ = ctx
  12675. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12676. for {
  12677. x, err := c.Do()
  12678. if err != nil {
  12679. return err
  12680. }
  12681. if err := f(x); err != nil {
  12682. return err
  12683. }
  12684. if x.NextPageToken == "" {
  12685. return nil
  12686. }
  12687. c.PageToken(x.NextPageToken)
  12688. }
  12689. }
  12690. // method id "dfareporting.accountUserProfiles.patch":
  12691. type AccountUserProfilesPatchCall struct {
  12692. s *Service
  12693. profileId int64
  12694. accountuserprofile *AccountUserProfile
  12695. urlParams_ gensupport.URLParams
  12696. ctx_ context.Context
  12697. header_ http.Header
  12698. }
  12699. // Patch: Updates an existing account user profile. This method supports
  12700. // patch semantics.
  12701. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  12702. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12703. c.profileId = profileId
  12704. c.urlParams_.Set("id", fmt.Sprint(id))
  12705. c.accountuserprofile = accountuserprofile
  12706. return c
  12707. }
  12708. // Fields allows partial responses to be retrieved. See
  12709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12710. // for more information.
  12711. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  12712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12713. return c
  12714. }
  12715. // Context sets the context to be used in this call's Do method. Any
  12716. // pending HTTP request will be aborted if the provided context is
  12717. // canceled.
  12718. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  12719. c.ctx_ = ctx
  12720. return c
  12721. }
  12722. // Header returns an http.Header that can be modified by the caller to
  12723. // add HTTP headers to the request.
  12724. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  12725. if c.header_ == nil {
  12726. c.header_ = make(http.Header)
  12727. }
  12728. return c.header_
  12729. }
  12730. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12731. reqHeaders := make(http.Header)
  12732. for k, v := range c.header_ {
  12733. reqHeaders[k] = v
  12734. }
  12735. reqHeaders.Set("User-Agent", c.s.userAgent())
  12736. var body io.Reader = nil
  12737. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12738. if err != nil {
  12739. return nil, err
  12740. }
  12741. reqHeaders.Set("Content-Type", "application/json")
  12742. c.urlParams_.Set("alt", alt)
  12743. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12744. urls += "?" + c.urlParams_.Encode()
  12745. req, _ := http.NewRequest("PATCH", urls, body)
  12746. req.Header = reqHeaders
  12747. googleapi.Expand(req.URL, map[string]string{
  12748. "profileId": strconv.FormatInt(c.profileId, 10),
  12749. })
  12750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12751. }
  12752. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  12753. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12754. // non-2xx status code is an error. Response headers are in either
  12755. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12756. // returned at all) in error.(*googleapi.Error).Header. Use
  12757. // googleapi.IsNotModified to check whether the returned error was
  12758. // because http.StatusNotModified was returned.
  12759. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12760. gensupport.SetOptions(c.urlParams_, opts...)
  12761. res, err := c.doRequest("json")
  12762. if res != nil && res.StatusCode == http.StatusNotModified {
  12763. if res.Body != nil {
  12764. res.Body.Close()
  12765. }
  12766. return nil, &googleapi.Error{
  12767. Code: res.StatusCode,
  12768. Header: res.Header,
  12769. }
  12770. }
  12771. if err != nil {
  12772. return nil, err
  12773. }
  12774. defer googleapi.CloseBody(res)
  12775. if err := googleapi.CheckResponse(res); err != nil {
  12776. return nil, err
  12777. }
  12778. ret := &AccountUserProfile{
  12779. ServerResponse: googleapi.ServerResponse{
  12780. Header: res.Header,
  12781. HTTPStatusCode: res.StatusCode,
  12782. },
  12783. }
  12784. target := &ret
  12785. if err := gensupport.DecodeResponse(target, res); err != nil {
  12786. return nil, err
  12787. }
  12788. return ret, nil
  12789. // {
  12790. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  12791. // "httpMethod": "PATCH",
  12792. // "id": "dfareporting.accountUserProfiles.patch",
  12793. // "parameterOrder": [
  12794. // "profileId",
  12795. // "id"
  12796. // ],
  12797. // "parameters": {
  12798. // "id": {
  12799. // "description": "User profile ID.",
  12800. // "format": "int64",
  12801. // "location": "query",
  12802. // "required": true,
  12803. // "type": "string"
  12804. // },
  12805. // "profileId": {
  12806. // "description": "User profile ID associated with this request.",
  12807. // "format": "int64",
  12808. // "location": "path",
  12809. // "required": true,
  12810. // "type": "string"
  12811. // }
  12812. // },
  12813. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12814. // "request": {
  12815. // "$ref": "AccountUserProfile"
  12816. // },
  12817. // "response": {
  12818. // "$ref": "AccountUserProfile"
  12819. // },
  12820. // "scopes": [
  12821. // "https://www.googleapis.com/auth/dfatrafficking"
  12822. // ]
  12823. // }
  12824. }
  12825. // method id "dfareporting.accountUserProfiles.update":
  12826. type AccountUserProfilesUpdateCall struct {
  12827. s *Service
  12828. profileId int64
  12829. accountuserprofile *AccountUserProfile
  12830. urlParams_ gensupport.URLParams
  12831. ctx_ context.Context
  12832. header_ http.Header
  12833. }
  12834. // Update: Updates an existing account user profile.
  12835. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  12836. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12837. c.profileId = profileId
  12838. c.accountuserprofile = accountuserprofile
  12839. return c
  12840. }
  12841. // Fields allows partial responses to be retrieved. See
  12842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12843. // for more information.
  12844. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  12845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12846. return c
  12847. }
  12848. // Context sets the context to be used in this call's Do method. Any
  12849. // pending HTTP request will be aborted if the provided context is
  12850. // canceled.
  12851. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  12852. c.ctx_ = ctx
  12853. return c
  12854. }
  12855. // Header returns an http.Header that can be modified by the caller to
  12856. // add HTTP headers to the request.
  12857. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  12858. if c.header_ == nil {
  12859. c.header_ = make(http.Header)
  12860. }
  12861. return c.header_
  12862. }
  12863. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12864. reqHeaders := make(http.Header)
  12865. for k, v := range c.header_ {
  12866. reqHeaders[k] = v
  12867. }
  12868. reqHeaders.Set("User-Agent", c.s.userAgent())
  12869. var body io.Reader = nil
  12870. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12871. if err != nil {
  12872. return nil, err
  12873. }
  12874. reqHeaders.Set("Content-Type", "application/json")
  12875. c.urlParams_.Set("alt", alt)
  12876. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12877. urls += "?" + c.urlParams_.Encode()
  12878. req, _ := http.NewRequest("PUT", urls, body)
  12879. req.Header = reqHeaders
  12880. googleapi.Expand(req.URL, map[string]string{
  12881. "profileId": strconv.FormatInt(c.profileId, 10),
  12882. })
  12883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12884. }
  12885. // Do executes the "dfareporting.accountUserProfiles.update" call.
  12886. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12887. // non-2xx status code is an error. Response headers are in either
  12888. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12889. // returned at all) in error.(*googleapi.Error).Header. Use
  12890. // googleapi.IsNotModified to check whether the returned error was
  12891. // because http.StatusNotModified was returned.
  12892. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12893. gensupport.SetOptions(c.urlParams_, opts...)
  12894. res, err := c.doRequest("json")
  12895. if res != nil && res.StatusCode == http.StatusNotModified {
  12896. if res.Body != nil {
  12897. res.Body.Close()
  12898. }
  12899. return nil, &googleapi.Error{
  12900. Code: res.StatusCode,
  12901. Header: res.Header,
  12902. }
  12903. }
  12904. if err != nil {
  12905. return nil, err
  12906. }
  12907. defer googleapi.CloseBody(res)
  12908. if err := googleapi.CheckResponse(res); err != nil {
  12909. return nil, err
  12910. }
  12911. ret := &AccountUserProfile{
  12912. ServerResponse: googleapi.ServerResponse{
  12913. Header: res.Header,
  12914. HTTPStatusCode: res.StatusCode,
  12915. },
  12916. }
  12917. target := &ret
  12918. if err := gensupport.DecodeResponse(target, res); err != nil {
  12919. return nil, err
  12920. }
  12921. return ret, nil
  12922. // {
  12923. // "description": "Updates an existing account user profile.",
  12924. // "httpMethod": "PUT",
  12925. // "id": "dfareporting.accountUserProfiles.update",
  12926. // "parameterOrder": [
  12927. // "profileId"
  12928. // ],
  12929. // "parameters": {
  12930. // "profileId": {
  12931. // "description": "User profile ID associated with this request.",
  12932. // "format": "int64",
  12933. // "location": "path",
  12934. // "required": true,
  12935. // "type": "string"
  12936. // }
  12937. // },
  12938. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12939. // "request": {
  12940. // "$ref": "AccountUserProfile"
  12941. // },
  12942. // "response": {
  12943. // "$ref": "AccountUserProfile"
  12944. // },
  12945. // "scopes": [
  12946. // "https://www.googleapis.com/auth/dfatrafficking"
  12947. // ]
  12948. // }
  12949. }
  12950. // method id "dfareporting.accounts.get":
  12951. type AccountsGetCall struct {
  12952. s *Service
  12953. profileId int64
  12954. id int64
  12955. urlParams_ gensupport.URLParams
  12956. ifNoneMatch_ string
  12957. ctx_ context.Context
  12958. header_ http.Header
  12959. }
  12960. // Get: Gets one account by ID.
  12961. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  12962. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12963. c.profileId = profileId
  12964. c.id = id
  12965. return c
  12966. }
  12967. // Fields allows partial responses to be retrieved. See
  12968. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12969. // for more information.
  12970. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  12971. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12972. return c
  12973. }
  12974. // IfNoneMatch sets the optional parameter which makes the operation
  12975. // fail if the object's ETag matches the given value. This is useful for
  12976. // getting updates only after the object has changed since the last
  12977. // request. Use googleapi.IsNotModified to check whether the response
  12978. // error from Do is the result of In-None-Match.
  12979. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  12980. c.ifNoneMatch_ = entityTag
  12981. return c
  12982. }
  12983. // Context sets the context to be used in this call's Do method. Any
  12984. // pending HTTP request will be aborted if the provided context is
  12985. // canceled.
  12986. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  12987. c.ctx_ = ctx
  12988. return c
  12989. }
  12990. // Header returns an http.Header that can be modified by the caller to
  12991. // add HTTP headers to the request.
  12992. func (c *AccountsGetCall) Header() http.Header {
  12993. if c.header_ == nil {
  12994. c.header_ = make(http.Header)
  12995. }
  12996. return c.header_
  12997. }
  12998. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  12999. reqHeaders := make(http.Header)
  13000. for k, v := range c.header_ {
  13001. reqHeaders[k] = v
  13002. }
  13003. reqHeaders.Set("User-Agent", c.s.userAgent())
  13004. if c.ifNoneMatch_ != "" {
  13005. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13006. }
  13007. var body io.Reader = nil
  13008. c.urlParams_.Set("alt", alt)
  13009. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13010. urls += "?" + c.urlParams_.Encode()
  13011. req, _ := http.NewRequest("GET", urls, body)
  13012. req.Header = reqHeaders
  13013. googleapi.Expand(req.URL, map[string]string{
  13014. "profileId": strconv.FormatInt(c.profileId, 10),
  13015. "id": strconv.FormatInt(c.id, 10),
  13016. })
  13017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13018. }
  13019. // Do executes the "dfareporting.accounts.get" call.
  13020. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13021. // code is an error. Response headers are in either
  13022. // *Account.ServerResponse.Header or (if a response was returned at all)
  13023. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13024. // check whether the returned error was because http.StatusNotModified
  13025. // was returned.
  13026. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13027. gensupport.SetOptions(c.urlParams_, opts...)
  13028. res, err := c.doRequest("json")
  13029. if res != nil && res.StatusCode == http.StatusNotModified {
  13030. if res.Body != nil {
  13031. res.Body.Close()
  13032. }
  13033. return nil, &googleapi.Error{
  13034. Code: res.StatusCode,
  13035. Header: res.Header,
  13036. }
  13037. }
  13038. if err != nil {
  13039. return nil, err
  13040. }
  13041. defer googleapi.CloseBody(res)
  13042. if err := googleapi.CheckResponse(res); err != nil {
  13043. return nil, err
  13044. }
  13045. ret := &Account{
  13046. ServerResponse: googleapi.ServerResponse{
  13047. Header: res.Header,
  13048. HTTPStatusCode: res.StatusCode,
  13049. },
  13050. }
  13051. target := &ret
  13052. if err := gensupport.DecodeResponse(target, res); err != nil {
  13053. return nil, err
  13054. }
  13055. return ret, nil
  13056. // {
  13057. // "description": "Gets one account by ID.",
  13058. // "httpMethod": "GET",
  13059. // "id": "dfareporting.accounts.get",
  13060. // "parameterOrder": [
  13061. // "profileId",
  13062. // "id"
  13063. // ],
  13064. // "parameters": {
  13065. // "id": {
  13066. // "description": "Account ID.",
  13067. // "format": "int64",
  13068. // "location": "path",
  13069. // "required": true,
  13070. // "type": "string"
  13071. // },
  13072. // "profileId": {
  13073. // "description": "User profile ID associated with this request.",
  13074. // "format": "int64",
  13075. // "location": "path",
  13076. // "required": true,
  13077. // "type": "string"
  13078. // }
  13079. // },
  13080. // "path": "userprofiles/{profileId}/accounts/{id}",
  13081. // "response": {
  13082. // "$ref": "Account"
  13083. // },
  13084. // "scopes": [
  13085. // "https://www.googleapis.com/auth/dfatrafficking"
  13086. // ]
  13087. // }
  13088. }
  13089. // method id "dfareporting.accounts.list":
  13090. type AccountsListCall struct {
  13091. s *Service
  13092. profileId int64
  13093. urlParams_ gensupport.URLParams
  13094. ifNoneMatch_ string
  13095. ctx_ context.Context
  13096. header_ http.Header
  13097. }
  13098. // List: Retrieves the list of accounts, possibly filtered. This method
  13099. // supports paging.
  13100. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13101. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13102. c.profileId = profileId
  13103. return c
  13104. }
  13105. // Active sets the optional parameter "active": Select only active
  13106. // accounts. Don't set this field to select both active and non-active
  13107. // accounts.
  13108. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13109. c.urlParams_.Set("active", fmt.Sprint(active))
  13110. return c
  13111. }
  13112. // Ids sets the optional parameter "ids": Select only accounts with
  13113. // these IDs.
  13114. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13115. var ids_ []string
  13116. for _, v := range ids {
  13117. ids_ = append(ids_, fmt.Sprint(v))
  13118. }
  13119. c.urlParams_.SetMulti("ids", ids_)
  13120. return c
  13121. }
  13122. // MaxResults sets the optional parameter "maxResults": Maximum number
  13123. // of results to return.
  13124. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13125. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13126. return c
  13127. }
  13128. // PageToken sets the optional parameter "pageToken": Value of the
  13129. // nextPageToken from the previous result page.
  13130. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13131. c.urlParams_.Set("pageToken", pageToken)
  13132. return c
  13133. }
  13134. // SearchString sets the optional parameter "searchString": Allows
  13135. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13136. // example, "account*2015" will return objects with names like "account
  13137. // June 2015", "account April 2015", or simply "account 2015". Most of
  13138. // the searches also add wildcards implicitly at the start and the end
  13139. // of the search string. For example, a search string of "account" will
  13140. // match objects with name "my account", "account 2015", or simply
  13141. // "account".
  13142. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13143. c.urlParams_.Set("searchString", searchString)
  13144. return c
  13145. }
  13146. // SortField sets the optional parameter "sortField": Field by which to
  13147. // sort the list.
  13148. //
  13149. // Possible values:
  13150. // "ID" (default)
  13151. // "NAME"
  13152. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13153. c.urlParams_.Set("sortField", sortField)
  13154. return c
  13155. }
  13156. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13157. // results.
  13158. //
  13159. // Possible values:
  13160. // "ASCENDING" (default)
  13161. // "DESCENDING"
  13162. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13163. c.urlParams_.Set("sortOrder", sortOrder)
  13164. return c
  13165. }
  13166. // Fields allows partial responses to be retrieved. See
  13167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13168. // for more information.
  13169. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13171. return c
  13172. }
  13173. // IfNoneMatch sets the optional parameter which makes the operation
  13174. // fail if the object's ETag matches the given value. This is useful for
  13175. // getting updates only after the object has changed since the last
  13176. // request. Use googleapi.IsNotModified to check whether the response
  13177. // error from Do is the result of In-None-Match.
  13178. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13179. c.ifNoneMatch_ = entityTag
  13180. return c
  13181. }
  13182. // Context sets the context to be used in this call's Do method. Any
  13183. // pending HTTP request will be aborted if the provided context is
  13184. // canceled.
  13185. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13186. c.ctx_ = ctx
  13187. return c
  13188. }
  13189. // Header returns an http.Header that can be modified by the caller to
  13190. // add HTTP headers to the request.
  13191. func (c *AccountsListCall) Header() http.Header {
  13192. if c.header_ == nil {
  13193. c.header_ = make(http.Header)
  13194. }
  13195. return c.header_
  13196. }
  13197. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13198. reqHeaders := make(http.Header)
  13199. for k, v := range c.header_ {
  13200. reqHeaders[k] = v
  13201. }
  13202. reqHeaders.Set("User-Agent", c.s.userAgent())
  13203. if c.ifNoneMatch_ != "" {
  13204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13205. }
  13206. var body io.Reader = nil
  13207. c.urlParams_.Set("alt", alt)
  13208. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13209. urls += "?" + c.urlParams_.Encode()
  13210. req, _ := http.NewRequest("GET", urls, body)
  13211. req.Header = reqHeaders
  13212. googleapi.Expand(req.URL, map[string]string{
  13213. "profileId": strconv.FormatInt(c.profileId, 10),
  13214. })
  13215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13216. }
  13217. // Do executes the "dfareporting.accounts.list" call.
  13218. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13219. // non-2xx status code is an error. Response headers are in either
  13220. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13221. // returned at all) in error.(*googleapi.Error).Header. Use
  13222. // googleapi.IsNotModified to check whether the returned error was
  13223. // because http.StatusNotModified was returned.
  13224. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13225. gensupport.SetOptions(c.urlParams_, opts...)
  13226. res, err := c.doRequest("json")
  13227. if res != nil && res.StatusCode == http.StatusNotModified {
  13228. if res.Body != nil {
  13229. res.Body.Close()
  13230. }
  13231. return nil, &googleapi.Error{
  13232. Code: res.StatusCode,
  13233. Header: res.Header,
  13234. }
  13235. }
  13236. if err != nil {
  13237. return nil, err
  13238. }
  13239. defer googleapi.CloseBody(res)
  13240. if err := googleapi.CheckResponse(res); err != nil {
  13241. return nil, err
  13242. }
  13243. ret := &AccountsListResponse{
  13244. ServerResponse: googleapi.ServerResponse{
  13245. Header: res.Header,
  13246. HTTPStatusCode: res.StatusCode,
  13247. },
  13248. }
  13249. target := &ret
  13250. if err := gensupport.DecodeResponse(target, res); err != nil {
  13251. return nil, err
  13252. }
  13253. return ret, nil
  13254. // {
  13255. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13256. // "httpMethod": "GET",
  13257. // "id": "dfareporting.accounts.list",
  13258. // "parameterOrder": [
  13259. // "profileId"
  13260. // ],
  13261. // "parameters": {
  13262. // "active": {
  13263. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13264. // "location": "query",
  13265. // "type": "boolean"
  13266. // },
  13267. // "ids": {
  13268. // "description": "Select only accounts with these IDs.",
  13269. // "format": "int64",
  13270. // "location": "query",
  13271. // "repeated": true,
  13272. // "type": "string"
  13273. // },
  13274. // "maxResults": {
  13275. // "default": "1000",
  13276. // "description": "Maximum number of results to return.",
  13277. // "format": "int32",
  13278. // "location": "query",
  13279. // "maximum": "1000",
  13280. // "minimum": "0",
  13281. // "type": "integer"
  13282. // },
  13283. // "pageToken": {
  13284. // "description": "Value of the nextPageToken from the previous result page.",
  13285. // "location": "query",
  13286. // "type": "string"
  13287. // },
  13288. // "profileId": {
  13289. // "description": "User profile ID associated with this request.",
  13290. // "format": "int64",
  13291. // "location": "path",
  13292. // "required": true,
  13293. // "type": "string"
  13294. // },
  13295. // "searchString": {
  13296. // "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\".",
  13297. // "location": "query",
  13298. // "type": "string"
  13299. // },
  13300. // "sortField": {
  13301. // "default": "ID",
  13302. // "description": "Field by which to sort the list.",
  13303. // "enum": [
  13304. // "ID",
  13305. // "NAME"
  13306. // ],
  13307. // "enumDescriptions": [
  13308. // "",
  13309. // ""
  13310. // ],
  13311. // "location": "query",
  13312. // "type": "string"
  13313. // },
  13314. // "sortOrder": {
  13315. // "default": "ASCENDING",
  13316. // "description": "Order of sorted results.",
  13317. // "enum": [
  13318. // "ASCENDING",
  13319. // "DESCENDING"
  13320. // ],
  13321. // "enumDescriptions": [
  13322. // "",
  13323. // ""
  13324. // ],
  13325. // "location": "query",
  13326. // "type": "string"
  13327. // }
  13328. // },
  13329. // "path": "userprofiles/{profileId}/accounts",
  13330. // "response": {
  13331. // "$ref": "AccountsListResponse"
  13332. // },
  13333. // "scopes": [
  13334. // "https://www.googleapis.com/auth/dfatrafficking"
  13335. // ]
  13336. // }
  13337. }
  13338. // Pages invokes f for each page of results.
  13339. // A non-nil error returned from f will halt the iteration.
  13340. // The provided context supersedes any context provided to the Context method.
  13341. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13342. c.ctx_ = ctx
  13343. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13344. for {
  13345. x, err := c.Do()
  13346. if err != nil {
  13347. return err
  13348. }
  13349. if err := f(x); err != nil {
  13350. return err
  13351. }
  13352. if x.NextPageToken == "" {
  13353. return nil
  13354. }
  13355. c.PageToken(x.NextPageToken)
  13356. }
  13357. }
  13358. // method id "dfareporting.accounts.patch":
  13359. type AccountsPatchCall struct {
  13360. s *Service
  13361. profileId int64
  13362. account *Account
  13363. urlParams_ gensupport.URLParams
  13364. ctx_ context.Context
  13365. header_ http.Header
  13366. }
  13367. // Patch: Updates an existing account. This method supports patch
  13368. // semantics.
  13369. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13370. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13371. c.profileId = profileId
  13372. c.urlParams_.Set("id", fmt.Sprint(id))
  13373. c.account = account
  13374. return c
  13375. }
  13376. // Fields allows partial responses to be retrieved. See
  13377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13378. // for more information.
  13379. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13381. return c
  13382. }
  13383. // Context sets the context to be used in this call's Do method. Any
  13384. // pending HTTP request will be aborted if the provided context is
  13385. // canceled.
  13386. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13387. c.ctx_ = ctx
  13388. return c
  13389. }
  13390. // Header returns an http.Header that can be modified by the caller to
  13391. // add HTTP headers to the request.
  13392. func (c *AccountsPatchCall) Header() http.Header {
  13393. if c.header_ == nil {
  13394. c.header_ = make(http.Header)
  13395. }
  13396. return c.header_
  13397. }
  13398. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13399. reqHeaders := make(http.Header)
  13400. for k, v := range c.header_ {
  13401. reqHeaders[k] = v
  13402. }
  13403. reqHeaders.Set("User-Agent", c.s.userAgent())
  13404. var body io.Reader = nil
  13405. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13406. if err != nil {
  13407. return nil, err
  13408. }
  13409. reqHeaders.Set("Content-Type", "application/json")
  13410. c.urlParams_.Set("alt", alt)
  13411. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13412. urls += "?" + c.urlParams_.Encode()
  13413. req, _ := http.NewRequest("PATCH", urls, body)
  13414. req.Header = reqHeaders
  13415. googleapi.Expand(req.URL, map[string]string{
  13416. "profileId": strconv.FormatInt(c.profileId, 10),
  13417. })
  13418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13419. }
  13420. // Do executes the "dfareporting.accounts.patch" call.
  13421. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13422. // code is an error. Response headers are in either
  13423. // *Account.ServerResponse.Header or (if a response was returned at all)
  13424. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13425. // check whether the returned error was because http.StatusNotModified
  13426. // was returned.
  13427. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13428. gensupport.SetOptions(c.urlParams_, opts...)
  13429. res, err := c.doRequest("json")
  13430. if res != nil && res.StatusCode == http.StatusNotModified {
  13431. if res.Body != nil {
  13432. res.Body.Close()
  13433. }
  13434. return nil, &googleapi.Error{
  13435. Code: res.StatusCode,
  13436. Header: res.Header,
  13437. }
  13438. }
  13439. if err != nil {
  13440. return nil, err
  13441. }
  13442. defer googleapi.CloseBody(res)
  13443. if err := googleapi.CheckResponse(res); err != nil {
  13444. return nil, err
  13445. }
  13446. ret := &Account{
  13447. ServerResponse: googleapi.ServerResponse{
  13448. Header: res.Header,
  13449. HTTPStatusCode: res.StatusCode,
  13450. },
  13451. }
  13452. target := &ret
  13453. if err := gensupport.DecodeResponse(target, res); err != nil {
  13454. return nil, err
  13455. }
  13456. return ret, nil
  13457. // {
  13458. // "description": "Updates an existing account. This method supports patch semantics.",
  13459. // "httpMethod": "PATCH",
  13460. // "id": "dfareporting.accounts.patch",
  13461. // "parameterOrder": [
  13462. // "profileId",
  13463. // "id"
  13464. // ],
  13465. // "parameters": {
  13466. // "id": {
  13467. // "description": "Account ID.",
  13468. // "format": "int64",
  13469. // "location": "query",
  13470. // "required": true,
  13471. // "type": "string"
  13472. // },
  13473. // "profileId": {
  13474. // "description": "User profile ID associated with this request.",
  13475. // "format": "int64",
  13476. // "location": "path",
  13477. // "required": true,
  13478. // "type": "string"
  13479. // }
  13480. // },
  13481. // "path": "userprofiles/{profileId}/accounts",
  13482. // "request": {
  13483. // "$ref": "Account"
  13484. // },
  13485. // "response": {
  13486. // "$ref": "Account"
  13487. // },
  13488. // "scopes": [
  13489. // "https://www.googleapis.com/auth/dfatrafficking"
  13490. // ]
  13491. // }
  13492. }
  13493. // method id "dfareporting.accounts.update":
  13494. type AccountsUpdateCall struct {
  13495. s *Service
  13496. profileId int64
  13497. account *Account
  13498. urlParams_ gensupport.URLParams
  13499. ctx_ context.Context
  13500. header_ http.Header
  13501. }
  13502. // Update: Updates an existing account.
  13503. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13504. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13505. c.profileId = profileId
  13506. c.account = account
  13507. return c
  13508. }
  13509. // Fields allows partial responses to be retrieved. See
  13510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13511. // for more information.
  13512. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13514. return c
  13515. }
  13516. // Context sets the context to be used in this call's Do method. Any
  13517. // pending HTTP request will be aborted if the provided context is
  13518. // canceled.
  13519. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13520. c.ctx_ = ctx
  13521. return c
  13522. }
  13523. // Header returns an http.Header that can be modified by the caller to
  13524. // add HTTP headers to the request.
  13525. func (c *AccountsUpdateCall) Header() http.Header {
  13526. if c.header_ == nil {
  13527. c.header_ = make(http.Header)
  13528. }
  13529. return c.header_
  13530. }
  13531. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13532. reqHeaders := make(http.Header)
  13533. for k, v := range c.header_ {
  13534. reqHeaders[k] = v
  13535. }
  13536. reqHeaders.Set("User-Agent", c.s.userAgent())
  13537. var body io.Reader = nil
  13538. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13539. if err != nil {
  13540. return nil, err
  13541. }
  13542. reqHeaders.Set("Content-Type", "application/json")
  13543. c.urlParams_.Set("alt", alt)
  13544. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13545. urls += "?" + c.urlParams_.Encode()
  13546. req, _ := http.NewRequest("PUT", urls, body)
  13547. req.Header = reqHeaders
  13548. googleapi.Expand(req.URL, map[string]string{
  13549. "profileId": strconv.FormatInt(c.profileId, 10),
  13550. })
  13551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13552. }
  13553. // Do executes the "dfareporting.accounts.update" call.
  13554. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13555. // code is an error. Response headers are in either
  13556. // *Account.ServerResponse.Header or (if a response was returned at all)
  13557. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13558. // check whether the returned error was because http.StatusNotModified
  13559. // was returned.
  13560. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13561. gensupport.SetOptions(c.urlParams_, opts...)
  13562. res, err := c.doRequest("json")
  13563. if res != nil && res.StatusCode == http.StatusNotModified {
  13564. if res.Body != nil {
  13565. res.Body.Close()
  13566. }
  13567. return nil, &googleapi.Error{
  13568. Code: res.StatusCode,
  13569. Header: res.Header,
  13570. }
  13571. }
  13572. if err != nil {
  13573. return nil, err
  13574. }
  13575. defer googleapi.CloseBody(res)
  13576. if err := googleapi.CheckResponse(res); err != nil {
  13577. return nil, err
  13578. }
  13579. ret := &Account{
  13580. ServerResponse: googleapi.ServerResponse{
  13581. Header: res.Header,
  13582. HTTPStatusCode: res.StatusCode,
  13583. },
  13584. }
  13585. target := &ret
  13586. if err := gensupport.DecodeResponse(target, res); err != nil {
  13587. return nil, err
  13588. }
  13589. return ret, nil
  13590. // {
  13591. // "description": "Updates an existing account.",
  13592. // "httpMethod": "PUT",
  13593. // "id": "dfareporting.accounts.update",
  13594. // "parameterOrder": [
  13595. // "profileId"
  13596. // ],
  13597. // "parameters": {
  13598. // "profileId": {
  13599. // "description": "User profile ID associated with this request.",
  13600. // "format": "int64",
  13601. // "location": "path",
  13602. // "required": true,
  13603. // "type": "string"
  13604. // }
  13605. // },
  13606. // "path": "userprofiles/{profileId}/accounts",
  13607. // "request": {
  13608. // "$ref": "Account"
  13609. // },
  13610. // "response": {
  13611. // "$ref": "Account"
  13612. // },
  13613. // "scopes": [
  13614. // "https://www.googleapis.com/auth/dfatrafficking"
  13615. // ]
  13616. // }
  13617. }
  13618. // method id "dfareporting.ads.get":
  13619. type AdsGetCall struct {
  13620. s *Service
  13621. profileId int64
  13622. id int64
  13623. urlParams_ gensupport.URLParams
  13624. ifNoneMatch_ string
  13625. ctx_ context.Context
  13626. header_ http.Header
  13627. }
  13628. // Get: Gets one ad by ID.
  13629. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  13630. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13631. c.profileId = profileId
  13632. c.id = id
  13633. return c
  13634. }
  13635. // Fields allows partial responses to be retrieved. See
  13636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13637. // for more information.
  13638. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  13639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13640. return c
  13641. }
  13642. // IfNoneMatch sets the optional parameter which makes the operation
  13643. // fail if the object's ETag matches the given value. This is useful for
  13644. // getting updates only after the object has changed since the last
  13645. // request. Use googleapi.IsNotModified to check whether the response
  13646. // error from Do is the result of In-None-Match.
  13647. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  13648. c.ifNoneMatch_ = entityTag
  13649. return c
  13650. }
  13651. // Context sets the context to be used in this call's Do method. Any
  13652. // pending HTTP request will be aborted if the provided context is
  13653. // canceled.
  13654. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  13655. c.ctx_ = ctx
  13656. return c
  13657. }
  13658. // Header returns an http.Header that can be modified by the caller to
  13659. // add HTTP headers to the request.
  13660. func (c *AdsGetCall) Header() http.Header {
  13661. if c.header_ == nil {
  13662. c.header_ = make(http.Header)
  13663. }
  13664. return c.header_
  13665. }
  13666. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  13667. reqHeaders := make(http.Header)
  13668. for k, v := range c.header_ {
  13669. reqHeaders[k] = v
  13670. }
  13671. reqHeaders.Set("User-Agent", c.s.userAgent())
  13672. if c.ifNoneMatch_ != "" {
  13673. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13674. }
  13675. var body io.Reader = nil
  13676. c.urlParams_.Set("alt", alt)
  13677. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  13678. urls += "?" + c.urlParams_.Encode()
  13679. req, _ := http.NewRequest("GET", urls, body)
  13680. req.Header = reqHeaders
  13681. googleapi.Expand(req.URL, map[string]string{
  13682. "profileId": strconv.FormatInt(c.profileId, 10),
  13683. "id": strconv.FormatInt(c.id, 10),
  13684. })
  13685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13686. }
  13687. // Do executes the "dfareporting.ads.get" call.
  13688. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  13689. // is an error. Response headers are in either *Ad.ServerResponse.Header
  13690. // or (if a response was returned at all) in
  13691. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13692. // whether the returned error was because http.StatusNotModified was
  13693. // returned.
  13694. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  13695. gensupport.SetOptions(c.urlParams_, opts...)
  13696. res, err := c.doRequest("json")
  13697. if res != nil && res.StatusCode == http.StatusNotModified {
  13698. if res.Body != nil {
  13699. res.Body.Close()
  13700. }
  13701. return nil, &googleapi.Error{
  13702. Code: res.StatusCode,
  13703. Header: res.Header,
  13704. }
  13705. }
  13706. if err != nil {
  13707. return nil, err
  13708. }
  13709. defer googleapi.CloseBody(res)
  13710. if err := googleapi.CheckResponse(res); err != nil {
  13711. return nil, err
  13712. }
  13713. ret := &Ad{
  13714. ServerResponse: googleapi.ServerResponse{
  13715. Header: res.Header,
  13716. HTTPStatusCode: res.StatusCode,
  13717. },
  13718. }
  13719. target := &ret
  13720. if err := gensupport.DecodeResponse(target, res); err != nil {
  13721. return nil, err
  13722. }
  13723. return ret, nil
  13724. // {
  13725. // "description": "Gets one ad by ID.",
  13726. // "httpMethod": "GET",
  13727. // "id": "dfareporting.ads.get",
  13728. // "parameterOrder": [
  13729. // "profileId",
  13730. // "id"
  13731. // ],
  13732. // "parameters": {
  13733. // "id": {
  13734. // "description": "Ad ID.",
  13735. // "format": "int64",
  13736. // "location": "path",
  13737. // "required": true,
  13738. // "type": "string"
  13739. // },
  13740. // "profileId": {
  13741. // "description": "User profile ID associated with this request.",
  13742. // "format": "int64",
  13743. // "location": "path",
  13744. // "required": true,
  13745. // "type": "string"
  13746. // }
  13747. // },
  13748. // "path": "userprofiles/{profileId}/ads/{id}",
  13749. // "response": {
  13750. // "$ref": "Ad"
  13751. // },
  13752. // "scopes": [
  13753. // "https://www.googleapis.com/auth/dfatrafficking"
  13754. // ]
  13755. // }
  13756. }
  13757. // method id "dfareporting.ads.insert":
  13758. type AdsInsertCall struct {
  13759. s *Service
  13760. profileId int64
  13761. ad *Ad
  13762. urlParams_ gensupport.URLParams
  13763. ctx_ context.Context
  13764. header_ http.Header
  13765. }
  13766. // Insert: Inserts a new ad.
  13767. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  13768. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13769. c.profileId = profileId
  13770. c.ad = ad
  13771. return c
  13772. }
  13773. // Fields allows partial responses to be retrieved. See
  13774. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13775. // for more information.
  13776. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  13777. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13778. return c
  13779. }
  13780. // Context sets the context to be used in this call's Do method. Any
  13781. // pending HTTP request will be aborted if the provided context is
  13782. // canceled.
  13783. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  13784. c.ctx_ = ctx
  13785. return c
  13786. }
  13787. // Header returns an http.Header that can be modified by the caller to
  13788. // add HTTP headers to the request.
  13789. func (c *AdsInsertCall) Header() http.Header {
  13790. if c.header_ == nil {
  13791. c.header_ = make(http.Header)
  13792. }
  13793. return c.header_
  13794. }
  13795. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  13796. reqHeaders := make(http.Header)
  13797. for k, v := range c.header_ {
  13798. reqHeaders[k] = v
  13799. }
  13800. reqHeaders.Set("User-Agent", c.s.userAgent())
  13801. var body io.Reader = nil
  13802. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  13803. if err != nil {
  13804. return nil, err
  13805. }
  13806. reqHeaders.Set("Content-Type", "application/json")
  13807. c.urlParams_.Set("alt", alt)
  13808. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  13809. urls += "?" + c.urlParams_.Encode()
  13810. req, _ := http.NewRequest("POST", urls, body)
  13811. req.Header = reqHeaders
  13812. googleapi.Expand(req.URL, map[string]string{
  13813. "profileId": strconv.FormatInt(c.profileId, 10),
  13814. })
  13815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13816. }
  13817. // Do executes the "dfareporting.ads.insert" call.
  13818. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  13819. // is an error. Response headers are in either *Ad.ServerResponse.Header
  13820. // or (if a response was returned at all) in
  13821. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13822. // whether the returned error was because http.StatusNotModified was
  13823. // returned.
  13824. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  13825. gensupport.SetOptions(c.urlParams_, opts...)
  13826. res, err := c.doRequest("json")
  13827. if res != nil && res.StatusCode == http.StatusNotModified {
  13828. if res.Body != nil {
  13829. res.Body.Close()
  13830. }
  13831. return nil, &googleapi.Error{
  13832. Code: res.StatusCode,
  13833. Header: res.Header,
  13834. }
  13835. }
  13836. if err != nil {
  13837. return nil, err
  13838. }
  13839. defer googleapi.CloseBody(res)
  13840. if err := googleapi.CheckResponse(res); err != nil {
  13841. return nil, err
  13842. }
  13843. ret := &Ad{
  13844. ServerResponse: googleapi.ServerResponse{
  13845. Header: res.Header,
  13846. HTTPStatusCode: res.StatusCode,
  13847. },
  13848. }
  13849. target := &ret
  13850. if err := gensupport.DecodeResponse(target, res); err != nil {
  13851. return nil, err
  13852. }
  13853. return ret, nil
  13854. // {
  13855. // "description": "Inserts a new ad.",
  13856. // "httpMethod": "POST",
  13857. // "id": "dfareporting.ads.insert",
  13858. // "parameterOrder": [
  13859. // "profileId"
  13860. // ],
  13861. // "parameters": {
  13862. // "profileId": {
  13863. // "description": "User profile ID associated with this request.",
  13864. // "format": "int64",
  13865. // "location": "path",
  13866. // "required": true,
  13867. // "type": "string"
  13868. // }
  13869. // },
  13870. // "path": "userprofiles/{profileId}/ads",
  13871. // "request": {
  13872. // "$ref": "Ad"
  13873. // },
  13874. // "response": {
  13875. // "$ref": "Ad"
  13876. // },
  13877. // "scopes": [
  13878. // "https://www.googleapis.com/auth/dfatrafficking"
  13879. // ]
  13880. // }
  13881. }
  13882. // method id "dfareporting.ads.list":
  13883. type AdsListCall struct {
  13884. s *Service
  13885. profileId int64
  13886. urlParams_ gensupport.URLParams
  13887. ifNoneMatch_ string
  13888. ctx_ context.Context
  13889. header_ http.Header
  13890. }
  13891. // List: Retrieves a list of ads, possibly filtered. This method
  13892. // supports paging.
  13893. func (r *AdsService) List(profileId int64) *AdsListCall {
  13894. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13895. c.profileId = profileId
  13896. return c
  13897. }
  13898. // Active sets the optional parameter "active": Select only active ads.
  13899. func (c *AdsListCall) Active(active bool) *AdsListCall {
  13900. c.urlParams_.Set("active", fmt.Sprint(active))
  13901. return c
  13902. }
  13903. // AdvertiserId sets the optional parameter "advertiserId": Select only
  13904. // ads with this advertiser ID.
  13905. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  13906. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  13907. return c
  13908. }
  13909. // Archived sets the optional parameter "archived": Select only archived
  13910. // ads.
  13911. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  13912. c.urlParams_.Set("archived", fmt.Sprint(archived))
  13913. return c
  13914. }
  13915. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  13916. // Select only ads with these audience segment IDs.
  13917. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  13918. var audienceSegmentIds_ []string
  13919. for _, v := range audienceSegmentIds {
  13920. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  13921. }
  13922. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  13923. return c
  13924. }
  13925. // CampaignIds sets the optional parameter "campaignIds": Select only
  13926. // ads with these campaign IDs.
  13927. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  13928. var campaignIds_ []string
  13929. for _, v := range campaignIds {
  13930. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  13931. }
  13932. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  13933. return c
  13934. }
  13935. // Compatibility sets the optional parameter "compatibility": Select
  13936. // default ads with the specified compatibility. Applicable when type is
  13937. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  13938. // rendering either on desktop or on mobile devices for regular or
  13939. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  13940. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  13941. // in-stream video ads developed with the VAST standard.
  13942. //
  13943. // Possible values:
  13944. // "APP"
  13945. // "APP_INTERSTITIAL"
  13946. // "DISPLAY"
  13947. // "DISPLAY_INTERSTITIAL"
  13948. // "IN_STREAM_VIDEO"
  13949. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  13950. c.urlParams_.Set("compatibility", compatibility)
  13951. return c
  13952. }
  13953. // CreativeIds sets the optional parameter "creativeIds": Select only
  13954. // ads with these creative IDs assigned.
  13955. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  13956. var creativeIds_ []string
  13957. for _, v := range creativeIds {
  13958. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  13959. }
  13960. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  13961. return c
  13962. }
  13963. // CreativeOptimizationConfigurationIds sets the optional parameter
  13964. // "creativeOptimizationConfigurationIds": Select only ads with these
  13965. // creative optimization configuration IDs.
  13966. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  13967. var creativeOptimizationConfigurationIds_ []string
  13968. for _, v := range creativeOptimizationConfigurationIds {
  13969. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  13970. }
  13971. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  13972. return c
  13973. }
  13974. // DynamicClickTracker sets the optional parameter
  13975. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  13976. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  13977. // trackers. If false, select static click trackers. Leave unset to
  13978. // select both.
  13979. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  13980. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  13981. return c
  13982. }
  13983. // Ids sets the optional parameter "ids": Select only ads with these
  13984. // IDs.
  13985. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  13986. var ids_ []string
  13987. for _, v := range ids {
  13988. ids_ = append(ids_, fmt.Sprint(v))
  13989. }
  13990. c.urlParams_.SetMulti("ids", ids_)
  13991. return c
  13992. }
  13993. // LandingPageIds sets the optional parameter "landingPageIds": Select
  13994. // only ads with these landing page IDs.
  13995. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  13996. var landingPageIds_ []string
  13997. for _, v := range landingPageIds {
  13998. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  13999. }
  14000. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14001. return c
  14002. }
  14003. // MaxResults sets the optional parameter "maxResults": Maximum number
  14004. // of results to return.
  14005. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14006. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14007. return c
  14008. }
  14009. // OverriddenEventTagId sets the optional parameter
  14010. // "overriddenEventTagId": Select only ads with this event tag override
  14011. // ID.
  14012. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14013. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14014. return c
  14015. }
  14016. // PageToken sets the optional parameter "pageToken": Value of the
  14017. // nextPageToken from the previous result page.
  14018. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14019. c.urlParams_.Set("pageToken", pageToken)
  14020. return c
  14021. }
  14022. // PlacementIds sets the optional parameter "placementIds": Select only
  14023. // ads with these placement IDs assigned.
  14024. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14025. var placementIds_ []string
  14026. for _, v := range placementIds {
  14027. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14028. }
  14029. c.urlParams_.SetMulti("placementIds", placementIds_)
  14030. return c
  14031. }
  14032. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14033. // Select only ads whose list targeting expression use these remarketing
  14034. // list IDs.
  14035. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14036. var remarketingListIds_ []string
  14037. for _, v := range remarketingListIds {
  14038. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14039. }
  14040. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14041. return c
  14042. }
  14043. // SearchString sets the optional parameter "searchString": Allows
  14044. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14045. // example, "ad*2015" will return objects with names like "ad June
  14046. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14047. // also add wildcards implicitly at the start and the end of the search
  14048. // string. For example, a search string of "ad" will match objects with
  14049. // name "my ad", "ad 2015", or simply "ad".
  14050. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14051. c.urlParams_.Set("searchString", searchString)
  14052. return c
  14053. }
  14054. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14055. // these size IDs.
  14056. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14057. var sizeIds_ []string
  14058. for _, v := range sizeIds {
  14059. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14060. }
  14061. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14062. return c
  14063. }
  14064. // SortField sets the optional parameter "sortField": Field by which to
  14065. // sort the list.
  14066. //
  14067. // Possible values:
  14068. // "ID" (default)
  14069. // "NAME"
  14070. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14071. c.urlParams_.Set("sortField", sortField)
  14072. return c
  14073. }
  14074. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14075. // results.
  14076. //
  14077. // Possible values:
  14078. // "ASCENDING" (default)
  14079. // "DESCENDING"
  14080. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14081. c.urlParams_.Set("sortOrder", sortOrder)
  14082. return c
  14083. }
  14084. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14085. // ads that are SSL-compliant.
  14086. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14087. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14088. return c
  14089. }
  14090. // SslRequired sets the optional parameter "sslRequired": Select only
  14091. // ads that require SSL.
  14092. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14093. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14094. return c
  14095. }
  14096. // Type sets the optional parameter "type": Select only ads with these
  14097. // types.
  14098. //
  14099. // Possible values:
  14100. // "AD_SERVING_CLICK_TRACKER"
  14101. // "AD_SERVING_DEFAULT_AD"
  14102. // "AD_SERVING_STANDARD_AD"
  14103. // "AD_SERVING_TRACKING"
  14104. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14105. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14106. return c
  14107. }
  14108. // Fields allows partial responses to be retrieved. See
  14109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14110. // for more information.
  14111. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14113. return c
  14114. }
  14115. // IfNoneMatch sets the optional parameter which makes the operation
  14116. // fail if the object's ETag matches the given value. This is useful for
  14117. // getting updates only after the object has changed since the last
  14118. // request. Use googleapi.IsNotModified to check whether the response
  14119. // error from Do is the result of In-None-Match.
  14120. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14121. c.ifNoneMatch_ = entityTag
  14122. return c
  14123. }
  14124. // Context sets the context to be used in this call's Do method. Any
  14125. // pending HTTP request will be aborted if the provided context is
  14126. // canceled.
  14127. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14128. c.ctx_ = ctx
  14129. return c
  14130. }
  14131. // Header returns an http.Header that can be modified by the caller to
  14132. // add HTTP headers to the request.
  14133. func (c *AdsListCall) Header() http.Header {
  14134. if c.header_ == nil {
  14135. c.header_ = make(http.Header)
  14136. }
  14137. return c.header_
  14138. }
  14139. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14140. reqHeaders := make(http.Header)
  14141. for k, v := range c.header_ {
  14142. reqHeaders[k] = v
  14143. }
  14144. reqHeaders.Set("User-Agent", c.s.userAgent())
  14145. if c.ifNoneMatch_ != "" {
  14146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14147. }
  14148. var body io.Reader = nil
  14149. c.urlParams_.Set("alt", alt)
  14150. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14151. urls += "?" + c.urlParams_.Encode()
  14152. req, _ := http.NewRequest("GET", urls, body)
  14153. req.Header = reqHeaders
  14154. googleapi.Expand(req.URL, map[string]string{
  14155. "profileId": strconv.FormatInt(c.profileId, 10),
  14156. })
  14157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14158. }
  14159. // Do executes the "dfareporting.ads.list" call.
  14160. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14161. // status code is an error. Response headers are in either
  14162. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14163. // at all) in error.(*googleapi.Error).Header. Use
  14164. // googleapi.IsNotModified to check whether the returned error was
  14165. // because http.StatusNotModified was returned.
  14166. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14167. gensupport.SetOptions(c.urlParams_, opts...)
  14168. res, err := c.doRequest("json")
  14169. if res != nil && res.StatusCode == http.StatusNotModified {
  14170. if res.Body != nil {
  14171. res.Body.Close()
  14172. }
  14173. return nil, &googleapi.Error{
  14174. Code: res.StatusCode,
  14175. Header: res.Header,
  14176. }
  14177. }
  14178. if err != nil {
  14179. return nil, err
  14180. }
  14181. defer googleapi.CloseBody(res)
  14182. if err := googleapi.CheckResponse(res); err != nil {
  14183. return nil, err
  14184. }
  14185. ret := &AdsListResponse{
  14186. ServerResponse: googleapi.ServerResponse{
  14187. Header: res.Header,
  14188. HTTPStatusCode: res.StatusCode,
  14189. },
  14190. }
  14191. target := &ret
  14192. if err := gensupport.DecodeResponse(target, res); err != nil {
  14193. return nil, err
  14194. }
  14195. return ret, nil
  14196. // {
  14197. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14198. // "httpMethod": "GET",
  14199. // "id": "dfareporting.ads.list",
  14200. // "parameterOrder": [
  14201. // "profileId"
  14202. // ],
  14203. // "parameters": {
  14204. // "active": {
  14205. // "description": "Select only active ads.",
  14206. // "location": "query",
  14207. // "type": "boolean"
  14208. // },
  14209. // "advertiserId": {
  14210. // "description": "Select only ads with this advertiser ID.",
  14211. // "format": "int64",
  14212. // "location": "query",
  14213. // "type": "string"
  14214. // },
  14215. // "archived": {
  14216. // "description": "Select only archived ads.",
  14217. // "location": "query",
  14218. // "type": "boolean"
  14219. // },
  14220. // "audienceSegmentIds": {
  14221. // "description": "Select only ads with these audience segment IDs.",
  14222. // "format": "int64",
  14223. // "location": "query",
  14224. // "repeated": true,
  14225. // "type": "string"
  14226. // },
  14227. // "campaignIds": {
  14228. // "description": "Select only ads with these campaign IDs.",
  14229. // "format": "int64",
  14230. // "location": "query",
  14231. // "repeated": true,
  14232. // "type": "string"
  14233. // },
  14234. // "compatibility": {
  14235. // "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.",
  14236. // "enum": [
  14237. // "APP",
  14238. // "APP_INTERSTITIAL",
  14239. // "DISPLAY",
  14240. // "DISPLAY_INTERSTITIAL",
  14241. // "IN_STREAM_VIDEO"
  14242. // ],
  14243. // "enumDescriptions": [
  14244. // "",
  14245. // "",
  14246. // "",
  14247. // "",
  14248. // ""
  14249. // ],
  14250. // "location": "query",
  14251. // "type": "string"
  14252. // },
  14253. // "creativeIds": {
  14254. // "description": "Select only ads with these creative IDs assigned.",
  14255. // "format": "int64",
  14256. // "location": "query",
  14257. // "repeated": true,
  14258. // "type": "string"
  14259. // },
  14260. // "creativeOptimizationConfigurationIds": {
  14261. // "description": "Select only ads with these creative optimization configuration IDs.",
  14262. // "format": "int64",
  14263. // "location": "query",
  14264. // "repeated": true,
  14265. // "type": "string"
  14266. // },
  14267. // "dynamicClickTracker": {
  14268. // "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.",
  14269. // "location": "query",
  14270. // "type": "boolean"
  14271. // },
  14272. // "ids": {
  14273. // "description": "Select only ads with these IDs.",
  14274. // "format": "int64",
  14275. // "location": "query",
  14276. // "repeated": true,
  14277. // "type": "string"
  14278. // },
  14279. // "landingPageIds": {
  14280. // "description": "Select only ads with these landing page IDs.",
  14281. // "format": "int64",
  14282. // "location": "query",
  14283. // "repeated": true,
  14284. // "type": "string"
  14285. // },
  14286. // "maxResults": {
  14287. // "default": "1000",
  14288. // "description": "Maximum number of results to return.",
  14289. // "format": "int32",
  14290. // "location": "query",
  14291. // "maximum": "1000",
  14292. // "minimum": "0",
  14293. // "type": "integer"
  14294. // },
  14295. // "overriddenEventTagId": {
  14296. // "description": "Select only ads with this event tag override ID.",
  14297. // "format": "int64",
  14298. // "location": "query",
  14299. // "type": "string"
  14300. // },
  14301. // "pageToken": {
  14302. // "description": "Value of the nextPageToken from the previous result page.",
  14303. // "location": "query",
  14304. // "type": "string"
  14305. // },
  14306. // "placementIds": {
  14307. // "description": "Select only ads with these placement IDs assigned.",
  14308. // "format": "int64",
  14309. // "location": "query",
  14310. // "repeated": true,
  14311. // "type": "string"
  14312. // },
  14313. // "profileId": {
  14314. // "description": "User profile ID associated with this request.",
  14315. // "format": "int64",
  14316. // "location": "path",
  14317. // "required": true,
  14318. // "type": "string"
  14319. // },
  14320. // "remarketingListIds": {
  14321. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14322. // "format": "int64",
  14323. // "location": "query",
  14324. // "repeated": true,
  14325. // "type": "string"
  14326. // },
  14327. // "searchString": {
  14328. // "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\".",
  14329. // "location": "query",
  14330. // "type": "string"
  14331. // },
  14332. // "sizeIds": {
  14333. // "description": "Select only ads with these size IDs.",
  14334. // "format": "int64",
  14335. // "location": "query",
  14336. // "repeated": true,
  14337. // "type": "string"
  14338. // },
  14339. // "sortField": {
  14340. // "default": "ID",
  14341. // "description": "Field by which to sort the list.",
  14342. // "enum": [
  14343. // "ID",
  14344. // "NAME"
  14345. // ],
  14346. // "enumDescriptions": [
  14347. // "",
  14348. // ""
  14349. // ],
  14350. // "location": "query",
  14351. // "type": "string"
  14352. // },
  14353. // "sortOrder": {
  14354. // "default": "ASCENDING",
  14355. // "description": "Order of sorted results.",
  14356. // "enum": [
  14357. // "ASCENDING",
  14358. // "DESCENDING"
  14359. // ],
  14360. // "enumDescriptions": [
  14361. // "",
  14362. // ""
  14363. // ],
  14364. // "location": "query",
  14365. // "type": "string"
  14366. // },
  14367. // "sslCompliant": {
  14368. // "description": "Select only ads that are SSL-compliant.",
  14369. // "location": "query",
  14370. // "type": "boolean"
  14371. // },
  14372. // "sslRequired": {
  14373. // "description": "Select only ads that require SSL.",
  14374. // "location": "query",
  14375. // "type": "boolean"
  14376. // },
  14377. // "type": {
  14378. // "description": "Select only ads with these types.",
  14379. // "enum": [
  14380. // "AD_SERVING_CLICK_TRACKER",
  14381. // "AD_SERVING_DEFAULT_AD",
  14382. // "AD_SERVING_STANDARD_AD",
  14383. // "AD_SERVING_TRACKING"
  14384. // ],
  14385. // "enumDescriptions": [
  14386. // "",
  14387. // "",
  14388. // "",
  14389. // ""
  14390. // ],
  14391. // "location": "query",
  14392. // "repeated": true,
  14393. // "type": "string"
  14394. // }
  14395. // },
  14396. // "path": "userprofiles/{profileId}/ads",
  14397. // "response": {
  14398. // "$ref": "AdsListResponse"
  14399. // },
  14400. // "scopes": [
  14401. // "https://www.googleapis.com/auth/dfatrafficking"
  14402. // ]
  14403. // }
  14404. }
  14405. // Pages invokes f for each page of results.
  14406. // A non-nil error returned from f will halt the iteration.
  14407. // The provided context supersedes any context provided to the Context method.
  14408. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14409. c.ctx_ = ctx
  14410. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14411. for {
  14412. x, err := c.Do()
  14413. if err != nil {
  14414. return err
  14415. }
  14416. if err := f(x); err != nil {
  14417. return err
  14418. }
  14419. if x.NextPageToken == "" {
  14420. return nil
  14421. }
  14422. c.PageToken(x.NextPageToken)
  14423. }
  14424. }
  14425. // method id "dfareporting.ads.patch":
  14426. type AdsPatchCall struct {
  14427. s *Service
  14428. profileId int64
  14429. ad *Ad
  14430. urlParams_ gensupport.URLParams
  14431. ctx_ context.Context
  14432. header_ http.Header
  14433. }
  14434. // Patch: Updates an existing ad. This method supports patch semantics.
  14435. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14436. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14437. c.profileId = profileId
  14438. c.urlParams_.Set("id", fmt.Sprint(id))
  14439. c.ad = ad
  14440. return c
  14441. }
  14442. // Fields allows partial responses to be retrieved. See
  14443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14444. // for more information.
  14445. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14447. return c
  14448. }
  14449. // Context sets the context to be used in this call's Do method. Any
  14450. // pending HTTP request will be aborted if the provided context is
  14451. // canceled.
  14452. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14453. c.ctx_ = ctx
  14454. return c
  14455. }
  14456. // Header returns an http.Header that can be modified by the caller to
  14457. // add HTTP headers to the request.
  14458. func (c *AdsPatchCall) Header() http.Header {
  14459. if c.header_ == nil {
  14460. c.header_ = make(http.Header)
  14461. }
  14462. return c.header_
  14463. }
  14464. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14465. reqHeaders := make(http.Header)
  14466. for k, v := range c.header_ {
  14467. reqHeaders[k] = v
  14468. }
  14469. reqHeaders.Set("User-Agent", c.s.userAgent())
  14470. var body io.Reader = nil
  14471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14472. if err != nil {
  14473. return nil, err
  14474. }
  14475. reqHeaders.Set("Content-Type", "application/json")
  14476. c.urlParams_.Set("alt", alt)
  14477. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14478. urls += "?" + c.urlParams_.Encode()
  14479. req, _ := http.NewRequest("PATCH", urls, body)
  14480. req.Header = reqHeaders
  14481. googleapi.Expand(req.URL, map[string]string{
  14482. "profileId": strconv.FormatInt(c.profileId, 10),
  14483. })
  14484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14485. }
  14486. // Do executes the "dfareporting.ads.patch" call.
  14487. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14488. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14489. // or (if a response was returned at all) in
  14490. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14491. // whether the returned error was because http.StatusNotModified was
  14492. // returned.
  14493. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14494. gensupport.SetOptions(c.urlParams_, opts...)
  14495. res, err := c.doRequest("json")
  14496. if res != nil && res.StatusCode == http.StatusNotModified {
  14497. if res.Body != nil {
  14498. res.Body.Close()
  14499. }
  14500. return nil, &googleapi.Error{
  14501. Code: res.StatusCode,
  14502. Header: res.Header,
  14503. }
  14504. }
  14505. if err != nil {
  14506. return nil, err
  14507. }
  14508. defer googleapi.CloseBody(res)
  14509. if err := googleapi.CheckResponse(res); err != nil {
  14510. return nil, err
  14511. }
  14512. ret := &Ad{
  14513. ServerResponse: googleapi.ServerResponse{
  14514. Header: res.Header,
  14515. HTTPStatusCode: res.StatusCode,
  14516. },
  14517. }
  14518. target := &ret
  14519. if err := gensupport.DecodeResponse(target, res); err != nil {
  14520. return nil, err
  14521. }
  14522. return ret, nil
  14523. // {
  14524. // "description": "Updates an existing ad. This method supports patch semantics.",
  14525. // "httpMethod": "PATCH",
  14526. // "id": "dfareporting.ads.patch",
  14527. // "parameterOrder": [
  14528. // "profileId",
  14529. // "id"
  14530. // ],
  14531. // "parameters": {
  14532. // "id": {
  14533. // "description": "Ad ID.",
  14534. // "format": "int64",
  14535. // "location": "query",
  14536. // "required": true,
  14537. // "type": "string"
  14538. // },
  14539. // "profileId": {
  14540. // "description": "User profile ID associated with this request.",
  14541. // "format": "int64",
  14542. // "location": "path",
  14543. // "required": true,
  14544. // "type": "string"
  14545. // }
  14546. // },
  14547. // "path": "userprofiles/{profileId}/ads",
  14548. // "request": {
  14549. // "$ref": "Ad"
  14550. // },
  14551. // "response": {
  14552. // "$ref": "Ad"
  14553. // },
  14554. // "scopes": [
  14555. // "https://www.googleapis.com/auth/dfatrafficking"
  14556. // ]
  14557. // }
  14558. }
  14559. // method id "dfareporting.ads.update":
  14560. type AdsUpdateCall struct {
  14561. s *Service
  14562. profileId int64
  14563. ad *Ad
  14564. urlParams_ gensupport.URLParams
  14565. ctx_ context.Context
  14566. header_ http.Header
  14567. }
  14568. // Update: Updates an existing ad.
  14569. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  14570. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14571. c.profileId = profileId
  14572. c.ad = ad
  14573. return c
  14574. }
  14575. // Fields allows partial responses to be retrieved. See
  14576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14577. // for more information.
  14578. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  14579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14580. return c
  14581. }
  14582. // Context sets the context to be used in this call's Do method. Any
  14583. // pending HTTP request will be aborted if the provided context is
  14584. // canceled.
  14585. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  14586. c.ctx_ = ctx
  14587. return c
  14588. }
  14589. // Header returns an http.Header that can be modified by the caller to
  14590. // add HTTP headers to the request.
  14591. func (c *AdsUpdateCall) Header() http.Header {
  14592. if c.header_ == nil {
  14593. c.header_ = make(http.Header)
  14594. }
  14595. return c.header_
  14596. }
  14597. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14598. reqHeaders := make(http.Header)
  14599. for k, v := range c.header_ {
  14600. reqHeaders[k] = v
  14601. }
  14602. reqHeaders.Set("User-Agent", c.s.userAgent())
  14603. var body io.Reader = nil
  14604. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14605. if err != nil {
  14606. return nil, err
  14607. }
  14608. reqHeaders.Set("Content-Type", "application/json")
  14609. c.urlParams_.Set("alt", alt)
  14610. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14611. urls += "?" + c.urlParams_.Encode()
  14612. req, _ := http.NewRequest("PUT", urls, body)
  14613. req.Header = reqHeaders
  14614. googleapi.Expand(req.URL, map[string]string{
  14615. "profileId": strconv.FormatInt(c.profileId, 10),
  14616. })
  14617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14618. }
  14619. // Do executes the "dfareporting.ads.update" call.
  14620. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14621. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14622. // or (if a response was returned at all) in
  14623. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14624. // whether the returned error was because http.StatusNotModified was
  14625. // returned.
  14626. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14627. gensupport.SetOptions(c.urlParams_, opts...)
  14628. res, err := c.doRequest("json")
  14629. if res != nil && res.StatusCode == http.StatusNotModified {
  14630. if res.Body != nil {
  14631. res.Body.Close()
  14632. }
  14633. return nil, &googleapi.Error{
  14634. Code: res.StatusCode,
  14635. Header: res.Header,
  14636. }
  14637. }
  14638. if err != nil {
  14639. return nil, err
  14640. }
  14641. defer googleapi.CloseBody(res)
  14642. if err := googleapi.CheckResponse(res); err != nil {
  14643. return nil, err
  14644. }
  14645. ret := &Ad{
  14646. ServerResponse: googleapi.ServerResponse{
  14647. Header: res.Header,
  14648. HTTPStatusCode: res.StatusCode,
  14649. },
  14650. }
  14651. target := &ret
  14652. if err := gensupport.DecodeResponse(target, res); err != nil {
  14653. return nil, err
  14654. }
  14655. return ret, nil
  14656. // {
  14657. // "description": "Updates an existing ad.",
  14658. // "httpMethod": "PUT",
  14659. // "id": "dfareporting.ads.update",
  14660. // "parameterOrder": [
  14661. // "profileId"
  14662. // ],
  14663. // "parameters": {
  14664. // "profileId": {
  14665. // "description": "User profile ID associated with this request.",
  14666. // "format": "int64",
  14667. // "location": "path",
  14668. // "required": true,
  14669. // "type": "string"
  14670. // }
  14671. // },
  14672. // "path": "userprofiles/{profileId}/ads",
  14673. // "request": {
  14674. // "$ref": "Ad"
  14675. // },
  14676. // "response": {
  14677. // "$ref": "Ad"
  14678. // },
  14679. // "scopes": [
  14680. // "https://www.googleapis.com/auth/dfatrafficking"
  14681. // ]
  14682. // }
  14683. }
  14684. // method id "dfareporting.advertiserGroups.delete":
  14685. type AdvertiserGroupsDeleteCall struct {
  14686. s *Service
  14687. profileId int64
  14688. id int64
  14689. urlParams_ gensupport.URLParams
  14690. ctx_ context.Context
  14691. header_ http.Header
  14692. }
  14693. // Delete: Deletes an existing advertiser group.
  14694. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  14695. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14696. c.profileId = profileId
  14697. c.id = id
  14698. return c
  14699. }
  14700. // Fields allows partial responses to be retrieved. See
  14701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14702. // for more information.
  14703. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  14704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14705. return c
  14706. }
  14707. // Context sets the context to be used in this call's Do method. Any
  14708. // pending HTTP request will be aborted if the provided context is
  14709. // canceled.
  14710. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  14711. c.ctx_ = ctx
  14712. return c
  14713. }
  14714. // Header returns an http.Header that can be modified by the caller to
  14715. // add HTTP headers to the request.
  14716. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  14717. if c.header_ == nil {
  14718. c.header_ = make(http.Header)
  14719. }
  14720. return c.header_
  14721. }
  14722. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14723. reqHeaders := make(http.Header)
  14724. for k, v := range c.header_ {
  14725. reqHeaders[k] = v
  14726. }
  14727. reqHeaders.Set("User-Agent", c.s.userAgent())
  14728. var body io.Reader = nil
  14729. c.urlParams_.Set("alt", alt)
  14730. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  14731. urls += "?" + c.urlParams_.Encode()
  14732. req, _ := http.NewRequest("DELETE", urls, body)
  14733. req.Header = reqHeaders
  14734. googleapi.Expand(req.URL, map[string]string{
  14735. "profileId": strconv.FormatInt(c.profileId, 10),
  14736. "id": strconv.FormatInt(c.id, 10),
  14737. })
  14738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14739. }
  14740. // Do executes the "dfareporting.advertiserGroups.delete" call.
  14741. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14742. gensupport.SetOptions(c.urlParams_, opts...)
  14743. res, err := c.doRequest("json")
  14744. if err != nil {
  14745. return err
  14746. }
  14747. defer googleapi.CloseBody(res)
  14748. if err := googleapi.CheckResponse(res); err != nil {
  14749. return err
  14750. }
  14751. return nil
  14752. // {
  14753. // "description": "Deletes an existing advertiser group.",
  14754. // "httpMethod": "DELETE",
  14755. // "id": "dfareporting.advertiserGroups.delete",
  14756. // "parameterOrder": [
  14757. // "profileId",
  14758. // "id"
  14759. // ],
  14760. // "parameters": {
  14761. // "id": {
  14762. // "description": "Advertiser group ID.",
  14763. // "format": "int64",
  14764. // "location": "path",
  14765. // "required": true,
  14766. // "type": "string"
  14767. // },
  14768. // "profileId": {
  14769. // "description": "User profile ID associated with this request.",
  14770. // "format": "int64",
  14771. // "location": "path",
  14772. // "required": true,
  14773. // "type": "string"
  14774. // }
  14775. // },
  14776. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  14777. // "scopes": [
  14778. // "https://www.googleapis.com/auth/dfatrafficking"
  14779. // ]
  14780. // }
  14781. }
  14782. // method id "dfareporting.advertiserGroups.get":
  14783. type AdvertiserGroupsGetCall struct {
  14784. s *Service
  14785. profileId int64
  14786. id int64
  14787. urlParams_ gensupport.URLParams
  14788. ifNoneMatch_ string
  14789. ctx_ context.Context
  14790. header_ http.Header
  14791. }
  14792. // Get: Gets one advertiser group by ID.
  14793. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  14794. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14795. c.profileId = profileId
  14796. c.id = id
  14797. return c
  14798. }
  14799. // Fields allows partial responses to be retrieved. See
  14800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14801. // for more information.
  14802. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  14803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14804. return c
  14805. }
  14806. // IfNoneMatch sets the optional parameter which makes the operation
  14807. // fail if the object's ETag matches the given value. This is useful for
  14808. // getting updates only after the object has changed since the last
  14809. // request. Use googleapi.IsNotModified to check whether the response
  14810. // error from Do is the result of In-None-Match.
  14811. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  14812. c.ifNoneMatch_ = entityTag
  14813. return c
  14814. }
  14815. // Context sets the context to be used in this call's Do method. Any
  14816. // pending HTTP request will be aborted if the provided context is
  14817. // canceled.
  14818. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  14819. c.ctx_ = ctx
  14820. return c
  14821. }
  14822. // Header returns an http.Header that can be modified by the caller to
  14823. // add HTTP headers to the request.
  14824. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  14825. if c.header_ == nil {
  14826. c.header_ = make(http.Header)
  14827. }
  14828. return c.header_
  14829. }
  14830. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  14831. reqHeaders := make(http.Header)
  14832. for k, v := range c.header_ {
  14833. reqHeaders[k] = v
  14834. }
  14835. reqHeaders.Set("User-Agent", c.s.userAgent())
  14836. if c.ifNoneMatch_ != "" {
  14837. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14838. }
  14839. var body io.Reader = nil
  14840. c.urlParams_.Set("alt", alt)
  14841. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  14842. urls += "?" + c.urlParams_.Encode()
  14843. req, _ := http.NewRequest("GET", urls, body)
  14844. req.Header = reqHeaders
  14845. googleapi.Expand(req.URL, map[string]string{
  14846. "profileId": strconv.FormatInt(c.profileId, 10),
  14847. "id": strconv.FormatInt(c.id, 10),
  14848. })
  14849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14850. }
  14851. // Do executes the "dfareporting.advertiserGroups.get" call.
  14852. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  14853. // status code is an error. Response headers are in either
  14854. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  14855. // at all) in error.(*googleapi.Error).Header. Use
  14856. // googleapi.IsNotModified to check whether the returned error was
  14857. // because http.StatusNotModified was returned.
  14858. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  14859. gensupport.SetOptions(c.urlParams_, opts...)
  14860. res, err := c.doRequest("json")
  14861. if res != nil && res.StatusCode == http.StatusNotModified {
  14862. if res.Body != nil {
  14863. res.Body.Close()
  14864. }
  14865. return nil, &googleapi.Error{
  14866. Code: res.StatusCode,
  14867. Header: res.Header,
  14868. }
  14869. }
  14870. if err != nil {
  14871. return nil, err
  14872. }
  14873. defer googleapi.CloseBody(res)
  14874. if err := googleapi.CheckResponse(res); err != nil {
  14875. return nil, err
  14876. }
  14877. ret := &AdvertiserGroup{
  14878. ServerResponse: googleapi.ServerResponse{
  14879. Header: res.Header,
  14880. HTTPStatusCode: res.StatusCode,
  14881. },
  14882. }
  14883. target := &ret
  14884. if err := gensupport.DecodeResponse(target, res); err != nil {
  14885. return nil, err
  14886. }
  14887. return ret, nil
  14888. // {
  14889. // "description": "Gets one advertiser group by ID.",
  14890. // "httpMethod": "GET",
  14891. // "id": "dfareporting.advertiserGroups.get",
  14892. // "parameterOrder": [
  14893. // "profileId",
  14894. // "id"
  14895. // ],
  14896. // "parameters": {
  14897. // "id": {
  14898. // "description": "Advertiser group ID.",
  14899. // "format": "int64",
  14900. // "location": "path",
  14901. // "required": true,
  14902. // "type": "string"
  14903. // },
  14904. // "profileId": {
  14905. // "description": "User profile ID associated with this request.",
  14906. // "format": "int64",
  14907. // "location": "path",
  14908. // "required": true,
  14909. // "type": "string"
  14910. // }
  14911. // },
  14912. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  14913. // "response": {
  14914. // "$ref": "AdvertiserGroup"
  14915. // },
  14916. // "scopes": [
  14917. // "https://www.googleapis.com/auth/dfatrafficking"
  14918. // ]
  14919. // }
  14920. }
  14921. // method id "dfareporting.advertiserGroups.insert":
  14922. type AdvertiserGroupsInsertCall struct {
  14923. s *Service
  14924. profileId int64
  14925. advertisergroup *AdvertiserGroup
  14926. urlParams_ gensupport.URLParams
  14927. ctx_ context.Context
  14928. header_ http.Header
  14929. }
  14930. // Insert: Inserts a new advertiser group.
  14931. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  14932. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14933. c.profileId = profileId
  14934. c.advertisergroup = advertisergroup
  14935. return c
  14936. }
  14937. // Fields allows partial responses to be retrieved. See
  14938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14939. // for more information.
  14940. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  14941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14942. return c
  14943. }
  14944. // Context sets the context to be used in this call's Do method. Any
  14945. // pending HTTP request will be aborted if the provided context is
  14946. // canceled.
  14947. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  14948. c.ctx_ = ctx
  14949. return c
  14950. }
  14951. // Header returns an http.Header that can be modified by the caller to
  14952. // add HTTP headers to the request.
  14953. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  14954. if c.header_ == nil {
  14955. c.header_ = make(http.Header)
  14956. }
  14957. return c.header_
  14958. }
  14959. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  14960. reqHeaders := make(http.Header)
  14961. for k, v := range c.header_ {
  14962. reqHeaders[k] = v
  14963. }
  14964. reqHeaders.Set("User-Agent", c.s.userAgent())
  14965. var body io.Reader = nil
  14966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  14967. if err != nil {
  14968. return nil, err
  14969. }
  14970. reqHeaders.Set("Content-Type", "application/json")
  14971. c.urlParams_.Set("alt", alt)
  14972. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  14973. urls += "?" + c.urlParams_.Encode()
  14974. req, _ := http.NewRequest("POST", urls, body)
  14975. req.Header = reqHeaders
  14976. googleapi.Expand(req.URL, map[string]string{
  14977. "profileId": strconv.FormatInt(c.profileId, 10),
  14978. })
  14979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14980. }
  14981. // Do executes the "dfareporting.advertiserGroups.insert" call.
  14982. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  14983. // status code is an error. Response headers are in either
  14984. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  14985. // at all) in error.(*googleapi.Error).Header. Use
  14986. // googleapi.IsNotModified to check whether the returned error was
  14987. // because http.StatusNotModified was returned.
  14988. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  14989. gensupport.SetOptions(c.urlParams_, opts...)
  14990. res, err := c.doRequest("json")
  14991. if res != nil && res.StatusCode == http.StatusNotModified {
  14992. if res.Body != nil {
  14993. res.Body.Close()
  14994. }
  14995. return nil, &googleapi.Error{
  14996. Code: res.StatusCode,
  14997. Header: res.Header,
  14998. }
  14999. }
  15000. if err != nil {
  15001. return nil, err
  15002. }
  15003. defer googleapi.CloseBody(res)
  15004. if err := googleapi.CheckResponse(res); err != nil {
  15005. return nil, err
  15006. }
  15007. ret := &AdvertiserGroup{
  15008. ServerResponse: googleapi.ServerResponse{
  15009. Header: res.Header,
  15010. HTTPStatusCode: res.StatusCode,
  15011. },
  15012. }
  15013. target := &ret
  15014. if err := gensupport.DecodeResponse(target, res); err != nil {
  15015. return nil, err
  15016. }
  15017. return ret, nil
  15018. // {
  15019. // "description": "Inserts a new advertiser group.",
  15020. // "httpMethod": "POST",
  15021. // "id": "dfareporting.advertiserGroups.insert",
  15022. // "parameterOrder": [
  15023. // "profileId"
  15024. // ],
  15025. // "parameters": {
  15026. // "profileId": {
  15027. // "description": "User profile ID associated with this request.",
  15028. // "format": "int64",
  15029. // "location": "path",
  15030. // "required": true,
  15031. // "type": "string"
  15032. // }
  15033. // },
  15034. // "path": "userprofiles/{profileId}/advertiserGroups",
  15035. // "request": {
  15036. // "$ref": "AdvertiserGroup"
  15037. // },
  15038. // "response": {
  15039. // "$ref": "AdvertiserGroup"
  15040. // },
  15041. // "scopes": [
  15042. // "https://www.googleapis.com/auth/dfatrafficking"
  15043. // ]
  15044. // }
  15045. }
  15046. // method id "dfareporting.advertiserGroups.list":
  15047. type AdvertiserGroupsListCall struct {
  15048. s *Service
  15049. profileId int64
  15050. urlParams_ gensupport.URLParams
  15051. ifNoneMatch_ string
  15052. ctx_ context.Context
  15053. header_ http.Header
  15054. }
  15055. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15056. // method supports paging.
  15057. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15058. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15059. c.profileId = profileId
  15060. return c
  15061. }
  15062. // Ids sets the optional parameter "ids": Select only advertiser groups
  15063. // with these IDs.
  15064. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15065. var ids_ []string
  15066. for _, v := range ids {
  15067. ids_ = append(ids_, fmt.Sprint(v))
  15068. }
  15069. c.urlParams_.SetMulti("ids", ids_)
  15070. return c
  15071. }
  15072. // MaxResults sets the optional parameter "maxResults": Maximum number
  15073. // of results to return.
  15074. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15075. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15076. return c
  15077. }
  15078. // PageToken sets the optional parameter "pageToken": Value of the
  15079. // nextPageToken from the previous result page.
  15080. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15081. c.urlParams_.Set("pageToken", pageToken)
  15082. return c
  15083. }
  15084. // SearchString sets the optional parameter "searchString": Allows
  15085. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15086. // example, "advertiser*2015" will return objects with names like
  15087. // "advertiser group June 2015", "advertiser group April 2015", or
  15088. // simply "advertiser group 2015". Most of the searches also add
  15089. // wildcards implicitly at the start and the end of the search string.
  15090. // For example, a search string of "advertisergroup" will match objects
  15091. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15092. // "advertisergroup".
  15093. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15094. c.urlParams_.Set("searchString", searchString)
  15095. return c
  15096. }
  15097. // SortField sets the optional parameter "sortField": Field by which to
  15098. // sort the list.
  15099. //
  15100. // Possible values:
  15101. // "ID" (default)
  15102. // "NAME"
  15103. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15104. c.urlParams_.Set("sortField", sortField)
  15105. return c
  15106. }
  15107. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15108. // results.
  15109. //
  15110. // Possible values:
  15111. // "ASCENDING" (default)
  15112. // "DESCENDING"
  15113. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15114. c.urlParams_.Set("sortOrder", sortOrder)
  15115. return c
  15116. }
  15117. // Fields allows partial responses to be retrieved. See
  15118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15119. // for more information.
  15120. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15122. return c
  15123. }
  15124. // IfNoneMatch sets the optional parameter which makes the operation
  15125. // fail if the object's ETag matches the given value. This is useful for
  15126. // getting updates only after the object has changed since the last
  15127. // request. Use googleapi.IsNotModified to check whether the response
  15128. // error from Do is the result of In-None-Match.
  15129. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15130. c.ifNoneMatch_ = entityTag
  15131. return c
  15132. }
  15133. // Context sets the context to be used in this call's Do method. Any
  15134. // pending HTTP request will be aborted if the provided context is
  15135. // canceled.
  15136. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15137. c.ctx_ = ctx
  15138. return c
  15139. }
  15140. // Header returns an http.Header that can be modified by the caller to
  15141. // add HTTP headers to the request.
  15142. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15143. if c.header_ == nil {
  15144. c.header_ = make(http.Header)
  15145. }
  15146. return c.header_
  15147. }
  15148. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15149. reqHeaders := make(http.Header)
  15150. for k, v := range c.header_ {
  15151. reqHeaders[k] = v
  15152. }
  15153. reqHeaders.Set("User-Agent", c.s.userAgent())
  15154. if c.ifNoneMatch_ != "" {
  15155. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15156. }
  15157. var body io.Reader = nil
  15158. c.urlParams_.Set("alt", alt)
  15159. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15160. urls += "?" + c.urlParams_.Encode()
  15161. req, _ := http.NewRequest("GET", urls, body)
  15162. req.Header = reqHeaders
  15163. googleapi.Expand(req.URL, map[string]string{
  15164. "profileId": strconv.FormatInt(c.profileId, 10),
  15165. })
  15166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15167. }
  15168. // Do executes the "dfareporting.advertiserGroups.list" call.
  15169. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15170. // non-nil. Any non-2xx status code is an error. Response headers are in
  15171. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15172. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15173. // googleapi.IsNotModified to check whether the returned error was
  15174. // because http.StatusNotModified was returned.
  15175. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15176. gensupport.SetOptions(c.urlParams_, opts...)
  15177. res, err := c.doRequest("json")
  15178. if res != nil && res.StatusCode == http.StatusNotModified {
  15179. if res.Body != nil {
  15180. res.Body.Close()
  15181. }
  15182. return nil, &googleapi.Error{
  15183. Code: res.StatusCode,
  15184. Header: res.Header,
  15185. }
  15186. }
  15187. if err != nil {
  15188. return nil, err
  15189. }
  15190. defer googleapi.CloseBody(res)
  15191. if err := googleapi.CheckResponse(res); err != nil {
  15192. return nil, err
  15193. }
  15194. ret := &AdvertiserGroupsListResponse{
  15195. ServerResponse: googleapi.ServerResponse{
  15196. Header: res.Header,
  15197. HTTPStatusCode: res.StatusCode,
  15198. },
  15199. }
  15200. target := &ret
  15201. if err := gensupport.DecodeResponse(target, res); err != nil {
  15202. return nil, err
  15203. }
  15204. return ret, nil
  15205. // {
  15206. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15207. // "httpMethod": "GET",
  15208. // "id": "dfareporting.advertiserGroups.list",
  15209. // "parameterOrder": [
  15210. // "profileId"
  15211. // ],
  15212. // "parameters": {
  15213. // "ids": {
  15214. // "description": "Select only advertiser groups with these IDs.",
  15215. // "format": "int64",
  15216. // "location": "query",
  15217. // "repeated": true,
  15218. // "type": "string"
  15219. // },
  15220. // "maxResults": {
  15221. // "default": "1000",
  15222. // "description": "Maximum number of results to return.",
  15223. // "format": "int32",
  15224. // "location": "query",
  15225. // "maximum": "1000",
  15226. // "minimum": "0",
  15227. // "type": "integer"
  15228. // },
  15229. // "pageToken": {
  15230. // "description": "Value of the nextPageToken from the previous result page.",
  15231. // "location": "query",
  15232. // "type": "string"
  15233. // },
  15234. // "profileId": {
  15235. // "description": "User profile ID associated with this request.",
  15236. // "format": "int64",
  15237. // "location": "path",
  15238. // "required": true,
  15239. // "type": "string"
  15240. // },
  15241. // "searchString": {
  15242. // "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\".",
  15243. // "location": "query",
  15244. // "type": "string"
  15245. // },
  15246. // "sortField": {
  15247. // "default": "ID",
  15248. // "description": "Field by which to sort the list.",
  15249. // "enum": [
  15250. // "ID",
  15251. // "NAME"
  15252. // ],
  15253. // "enumDescriptions": [
  15254. // "",
  15255. // ""
  15256. // ],
  15257. // "location": "query",
  15258. // "type": "string"
  15259. // },
  15260. // "sortOrder": {
  15261. // "default": "ASCENDING",
  15262. // "description": "Order of sorted results.",
  15263. // "enum": [
  15264. // "ASCENDING",
  15265. // "DESCENDING"
  15266. // ],
  15267. // "enumDescriptions": [
  15268. // "",
  15269. // ""
  15270. // ],
  15271. // "location": "query",
  15272. // "type": "string"
  15273. // }
  15274. // },
  15275. // "path": "userprofiles/{profileId}/advertiserGroups",
  15276. // "response": {
  15277. // "$ref": "AdvertiserGroupsListResponse"
  15278. // },
  15279. // "scopes": [
  15280. // "https://www.googleapis.com/auth/dfatrafficking"
  15281. // ]
  15282. // }
  15283. }
  15284. // Pages invokes f for each page of results.
  15285. // A non-nil error returned from f will halt the iteration.
  15286. // The provided context supersedes any context provided to the Context method.
  15287. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15288. c.ctx_ = ctx
  15289. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15290. for {
  15291. x, err := c.Do()
  15292. if err != nil {
  15293. return err
  15294. }
  15295. if err := f(x); err != nil {
  15296. return err
  15297. }
  15298. if x.NextPageToken == "" {
  15299. return nil
  15300. }
  15301. c.PageToken(x.NextPageToken)
  15302. }
  15303. }
  15304. // method id "dfareporting.advertiserGroups.patch":
  15305. type AdvertiserGroupsPatchCall struct {
  15306. s *Service
  15307. profileId int64
  15308. advertisergroup *AdvertiserGroup
  15309. urlParams_ gensupport.URLParams
  15310. ctx_ context.Context
  15311. header_ http.Header
  15312. }
  15313. // Patch: Updates an existing advertiser group. This method supports
  15314. // patch semantics.
  15315. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15316. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15317. c.profileId = profileId
  15318. c.urlParams_.Set("id", fmt.Sprint(id))
  15319. c.advertisergroup = advertisergroup
  15320. return c
  15321. }
  15322. // Fields allows partial responses to be retrieved. See
  15323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15324. // for more information.
  15325. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15327. return c
  15328. }
  15329. // Context sets the context to be used in this call's Do method. Any
  15330. // pending HTTP request will be aborted if the provided context is
  15331. // canceled.
  15332. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15333. c.ctx_ = ctx
  15334. return c
  15335. }
  15336. // Header returns an http.Header that can be modified by the caller to
  15337. // add HTTP headers to the request.
  15338. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15339. if c.header_ == nil {
  15340. c.header_ = make(http.Header)
  15341. }
  15342. return c.header_
  15343. }
  15344. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15345. reqHeaders := make(http.Header)
  15346. for k, v := range c.header_ {
  15347. reqHeaders[k] = v
  15348. }
  15349. reqHeaders.Set("User-Agent", c.s.userAgent())
  15350. var body io.Reader = nil
  15351. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15352. if err != nil {
  15353. return nil, err
  15354. }
  15355. reqHeaders.Set("Content-Type", "application/json")
  15356. c.urlParams_.Set("alt", alt)
  15357. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15358. urls += "?" + c.urlParams_.Encode()
  15359. req, _ := http.NewRequest("PATCH", urls, body)
  15360. req.Header = reqHeaders
  15361. googleapi.Expand(req.URL, map[string]string{
  15362. "profileId": strconv.FormatInt(c.profileId, 10),
  15363. })
  15364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15365. }
  15366. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15367. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15368. // status code is an error. Response headers are in either
  15369. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15370. // at all) in error.(*googleapi.Error).Header. Use
  15371. // googleapi.IsNotModified to check whether the returned error was
  15372. // because http.StatusNotModified was returned.
  15373. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15374. gensupport.SetOptions(c.urlParams_, opts...)
  15375. res, err := c.doRequest("json")
  15376. if res != nil && res.StatusCode == http.StatusNotModified {
  15377. if res.Body != nil {
  15378. res.Body.Close()
  15379. }
  15380. return nil, &googleapi.Error{
  15381. Code: res.StatusCode,
  15382. Header: res.Header,
  15383. }
  15384. }
  15385. if err != nil {
  15386. return nil, err
  15387. }
  15388. defer googleapi.CloseBody(res)
  15389. if err := googleapi.CheckResponse(res); err != nil {
  15390. return nil, err
  15391. }
  15392. ret := &AdvertiserGroup{
  15393. ServerResponse: googleapi.ServerResponse{
  15394. Header: res.Header,
  15395. HTTPStatusCode: res.StatusCode,
  15396. },
  15397. }
  15398. target := &ret
  15399. if err := gensupport.DecodeResponse(target, res); err != nil {
  15400. return nil, err
  15401. }
  15402. return ret, nil
  15403. // {
  15404. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15405. // "httpMethod": "PATCH",
  15406. // "id": "dfareporting.advertiserGroups.patch",
  15407. // "parameterOrder": [
  15408. // "profileId",
  15409. // "id"
  15410. // ],
  15411. // "parameters": {
  15412. // "id": {
  15413. // "description": "Advertiser group ID.",
  15414. // "format": "int64",
  15415. // "location": "query",
  15416. // "required": true,
  15417. // "type": "string"
  15418. // },
  15419. // "profileId": {
  15420. // "description": "User profile ID associated with this request.",
  15421. // "format": "int64",
  15422. // "location": "path",
  15423. // "required": true,
  15424. // "type": "string"
  15425. // }
  15426. // },
  15427. // "path": "userprofiles/{profileId}/advertiserGroups",
  15428. // "request": {
  15429. // "$ref": "AdvertiserGroup"
  15430. // },
  15431. // "response": {
  15432. // "$ref": "AdvertiserGroup"
  15433. // },
  15434. // "scopes": [
  15435. // "https://www.googleapis.com/auth/dfatrafficking"
  15436. // ]
  15437. // }
  15438. }
  15439. // method id "dfareporting.advertiserGroups.update":
  15440. type AdvertiserGroupsUpdateCall struct {
  15441. s *Service
  15442. profileId int64
  15443. advertisergroup *AdvertiserGroup
  15444. urlParams_ gensupport.URLParams
  15445. ctx_ context.Context
  15446. header_ http.Header
  15447. }
  15448. // Update: Updates an existing advertiser group.
  15449. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15450. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15451. c.profileId = profileId
  15452. c.advertisergroup = advertisergroup
  15453. return c
  15454. }
  15455. // Fields allows partial responses to be retrieved. See
  15456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15457. // for more information.
  15458. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15460. return c
  15461. }
  15462. // Context sets the context to be used in this call's Do method. Any
  15463. // pending HTTP request will be aborted if the provided context is
  15464. // canceled.
  15465. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15466. c.ctx_ = ctx
  15467. return c
  15468. }
  15469. // Header returns an http.Header that can be modified by the caller to
  15470. // add HTTP headers to the request.
  15471. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15472. if c.header_ == nil {
  15473. c.header_ = make(http.Header)
  15474. }
  15475. return c.header_
  15476. }
  15477. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15478. reqHeaders := make(http.Header)
  15479. for k, v := range c.header_ {
  15480. reqHeaders[k] = v
  15481. }
  15482. reqHeaders.Set("User-Agent", c.s.userAgent())
  15483. var body io.Reader = nil
  15484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15485. if err != nil {
  15486. return nil, err
  15487. }
  15488. reqHeaders.Set("Content-Type", "application/json")
  15489. c.urlParams_.Set("alt", alt)
  15490. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15491. urls += "?" + c.urlParams_.Encode()
  15492. req, _ := http.NewRequest("PUT", urls, body)
  15493. req.Header = reqHeaders
  15494. googleapi.Expand(req.URL, map[string]string{
  15495. "profileId": strconv.FormatInt(c.profileId, 10),
  15496. })
  15497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15498. }
  15499. // Do executes the "dfareporting.advertiserGroups.update" call.
  15500. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15501. // status code is an error. Response headers are in either
  15502. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15503. // at all) in error.(*googleapi.Error).Header. Use
  15504. // googleapi.IsNotModified to check whether the returned error was
  15505. // because http.StatusNotModified was returned.
  15506. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15507. gensupport.SetOptions(c.urlParams_, opts...)
  15508. res, err := c.doRequest("json")
  15509. if res != nil && res.StatusCode == http.StatusNotModified {
  15510. if res.Body != nil {
  15511. res.Body.Close()
  15512. }
  15513. return nil, &googleapi.Error{
  15514. Code: res.StatusCode,
  15515. Header: res.Header,
  15516. }
  15517. }
  15518. if err != nil {
  15519. return nil, err
  15520. }
  15521. defer googleapi.CloseBody(res)
  15522. if err := googleapi.CheckResponse(res); err != nil {
  15523. return nil, err
  15524. }
  15525. ret := &AdvertiserGroup{
  15526. ServerResponse: googleapi.ServerResponse{
  15527. Header: res.Header,
  15528. HTTPStatusCode: res.StatusCode,
  15529. },
  15530. }
  15531. target := &ret
  15532. if err := gensupport.DecodeResponse(target, res); err != nil {
  15533. return nil, err
  15534. }
  15535. return ret, nil
  15536. // {
  15537. // "description": "Updates an existing advertiser group.",
  15538. // "httpMethod": "PUT",
  15539. // "id": "dfareporting.advertiserGroups.update",
  15540. // "parameterOrder": [
  15541. // "profileId"
  15542. // ],
  15543. // "parameters": {
  15544. // "profileId": {
  15545. // "description": "User profile ID associated with this request.",
  15546. // "format": "int64",
  15547. // "location": "path",
  15548. // "required": true,
  15549. // "type": "string"
  15550. // }
  15551. // },
  15552. // "path": "userprofiles/{profileId}/advertiserGroups",
  15553. // "request": {
  15554. // "$ref": "AdvertiserGroup"
  15555. // },
  15556. // "response": {
  15557. // "$ref": "AdvertiserGroup"
  15558. // },
  15559. // "scopes": [
  15560. // "https://www.googleapis.com/auth/dfatrafficking"
  15561. // ]
  15562. // }
  15563. }
  15564. // method id "dfareporting.advertisers.get":
  15565. type AdvertisersGetCall struct {
  15566. s *Service
  15567. profileId int64
  15568. id int64
  15569. urlParams_ gensupport.URLParams
  15570. ifNoneMatch_ string
  15571. ctx_ context.Context
  15572. header_ http.Header
  15573. }
  15574. // Get: Gets one advertiser by ID.
  15575. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  15576. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15577. c.profileId = profileId
  15578. c.id = id
  15579. return c
  15580. }
  15581. // Fields allows partial responses to be retrieved. See
  15582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15583. // for more information.
  15584. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  15585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15586. return c
  15587. }
  15588. // IfNoneMatch sets the optional parameter which makes the operation
  15589. // fail if the object's ETag matches the given value. This is useful for
  15590. // getting updates only after the object has changed since the last
  15591. // request. Use googleapi.IsNotModified to check whether the response
  15592. // error from Do is the result of In-None-Match.
  15593. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  15594. c.ifNoneMatch_ = entityTag
  15595. return c
  15596. }
  15597. // Context sets the context to be used in this call's Do method. Any
  15598. // pending HTTP request will be aborted if the provided context is
  15599. // canceled.
  15600. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  15601. c.ctx_ = ctx
  15602. return c
  15603. }
  15604. // Header returns an http.Header that can be modified by the caller to
  15605. // add HTTP headers to the request.
  15606. func (c *AdvertisersGetCall) Header() http.Header {
  15607. if c.header_ == nil {
  15608. c.header_ = make(http.Header)
  15609. }
  15610. return c.header_
  15611. }
  15612. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  15613. reqHeaders := make(http.Header)
  15614. for k, v := range c.header_ {
  15615. reqHeaders[k] = v
  15616. }
  15617. reqHeaders.Set("User-Agent", c.s.userAgent())
  15618. if c.ifNoneMatch_ != "" {
  15619. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15620. }
  15621. var body io.Reader = nil
  15622. c.urlParams_.Set("alt", alt)
  15623. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  15624. urls += "?" + c.urlParams_.Encode()
  15625. req, _ := http.NewRequest("GET", urls, body)
  15626. req.Header = reqHeaders
  15627. googleapi.Expand(req.URL, map[string]string{
  15628. "profileId": strconv.FormatInt(c.profileId, 10),
  15629. "id": strconv.FormatInt(c.id, 10),
  15630. })
  15631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15632. }
  15633. // Do executes the "dfareporting.advertisers.get" call.
  15634. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  15635. // status code is an error. Response headers are in either
  15636. // *Advertiser.ServerResponse.Header or (if a response was returned at
  15637. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15638. // to check whether the returned error was because
  15639. // http.StatusNotModified was returned.
  15640. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  15641. gensupport.SetOptions(c.urlParams_, opts...)
  15642. res, err := c.doRequest("json")
  15643. if res != nil && res.StatusCode == http.StatusNotModified {
  15644. if res.Body != nil {
  15645. res.Body.Close()
  15646. }
  15647. return nil, &googleapi.Error{
  15648. Code: res.StatusCode,
  15649. Header: res.Header,
  15650. }
  15651. }
  15652. if err != nil {
  15653. return nil, err
  15654. }
  15655. defer googleapi.CloseBody(res)
  15656. if err := googleapi.CheckResponse(res); err != nil {
  15657. return nil, err
  15658. }
  15659. ret := &Advertiser{
  15660. ServerResponse: googleapi.ServerResponse{
  15661. Header: res.Header,
  15662. HTTPStatusCode: res.StatusCode,
  15663. },
  15664. }
  15665. target := &ret
  15666. if err := gensupport.DecodeResponse(target, res); err != nil {
  15667. return nil, err
  15668. }
  15669. return ret, nil
  15670. // {
  15671. // "description": "Gets one advertiser by ID.",
  15672. // "httpMethod": "GET",
  15673. // "id": "dfareporting.advertisers.get",
  15674. // "parameterOrder": [
  15675. // "profileId",
  15676. // "id"
  15677. // ],
  15678. // "parameters": {
  15679. // "id": {
  15680. // "description": "Advertiser ID.",
  15681. // "format": "int64",
  15682. // "location": "path",
  15683. // "required": true,
  15684. // "type": "string"
  15685. // },
  15686. // "profileId": {
  15687. // "description": "User profile ID associated with this request.",
  15688. // "format": "int64",
  15689. // "location": "path",
  15690. // "required": true,
  15691. // "type": "string"
  15692. // }
  15693. // },
  15694. // "path": "userprofiles/{profileId}/advertisers/{id}",
  15695. // "response": {
  15696. // "$ref": "Advertiser"
  15697. // },
  15698. // "scopes": [
  15699. // "https://www.googleapis.com/auth/dfatrafficking"
  15700. // ]
  15701. // }
  15702. }
  15703. // method id "dfareporting.advertisers.insert":
  15704. type AdvertisersInsertCall struct {
  15705. s *Service
  15706. profileId int64
  15707. advertiser *Advertiser
  15708. urlParams_ gensupport.URLParams
  15709. ctx_ context.Context
  15710. header_ http.Header
  15711. }
  15712. // Insert: Inserts a new advertiser.
  15713. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  15714. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15715. c.profileId = profileId
  15716. c.advertiser = advertiser
  15717. return c
  15718. }
  15719. // Fields allows partial responses to be retrieved. See
  15720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15721. // for more information.
  15722. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  15723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15724. return c
  15725. }
  15726. // Context sets the context to be used in this call's Do method. Any
  15727. // pending HTTP request will be aborted if the provided context is
  15728. // canceled.
  15729. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  15730. c.ctx_ = ctx
  15731. return c
  15732. }
  15733. // Header returns an http.Header that can be modified by the caller to
  15734. // add HTTP headers to the request.
  15735. func (c *AdvertisersInsertCall) Header() http.Header {
  15736. if c.header_ == nil {
  15737. c.header_ = make(http.Header)
  15738. }
  15739. return c.header_
  15740. }
  15741. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  15742. reqHeaders := make(http.Header)
  15743. for k, v := range c.header_ {
  15744. reqHeaders[k] = v
  15745. }
  15746. reqHeaders.Set("User-Agent", c.s.userAgent())
  15747. var body io.Reader = nil
  15748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  15749. if err != nil {
  15750. return nil, err
  15751. }
  15752. reqHeaders.Set("Content-Type", "application/json")
  15753. c.urlParams_.Set("alt", alt)
  15754. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  15755. urls += "?" + c.urlParams_.Encode()
  15756. req, _ := http.NewRequest("POST", urls, body)
  15757. req.Header = reqHeaders
  15758. googleapi.Expand(req.URL, map[string]string{
  15759. "profileId": strconv.FormatInt(c.profileId, 10),
  15760. })
  15761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15762. }
  15763. // Do executes the "dfareporting.advertisers.insert" call.
  15764. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  15765. // status code is an error. Response headers are in either
  15766. // *Advertiser.ServerResponse.Header or (if a response was returned at
  15767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15768. // to check whether the returned error was because
  15769. // http.StatusNotModified was returned.
  15770. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  15771. gensupport.SetOptions(c.urlParams_, opts...)
  15772. res, err := c.doRequest("json")
  15773. if res != nil && res.StatusCode == http.StatusNotModified {
  15774. if res.Body != nil {
  15775. res.Body.Close()
  15776. }
  15777. return nil, &googleapi.Error{
  15778. Code: res.StatusCode,
  15779. Header: res.Header,
  15780. }
  15781. }
  15782. if err != nil {
  15783. return nil, err
  15784. }
  15785. defer googleapi.CloseBody(res)
  15786. if err := googleapi.CheckResponse(res); err != nil {
  15787. return nil, err
  15788. }
  15789. ret := &Advertiser{
  15790. ServerResponse: googleapi.ServerResponse{
  15791. Header: res.Header,
  15792. HTTPStatusCode: res.StatusCode,
  15793. },
  15794. }
  15795. target := &ret
  15796. if err := gensupport.DecodeResponse(target, res); err != nil {
  15797. return nil, err
  15798. }
  15799. return ret, nil
  15800. // {
  15801. // "description": "Inserts a new advertiser.",
  15802. // "httpMethod": "POST",
  15803. // "id": "dfareporting.advertisers.insert",
  15804. // "parameterOrder": [
  15805. // "profileId"
  15806. // ],
  15807. // "parameters": {
  15808. // "profileId": {
  15809. // "description": "User profile ID associated with this request.",
  15810. // "format": "int64",
  15811. // "location": "path",
  15812. // "required": true,
  15813. // "type": "string"
  15814. // }
  15815. // },
  15816. // "path": "userprofiles/{profileId}/advertisers",
  15817. // "request": {
  15818. // "$ref": "Advertiser"
  15819. // },
  15820. // "response": {
  15821. // "$ref": "Advertiser"
  15822. // },
  15823. // "scopes": [
  15824. // "https://www.googleapis.com/auth/dfatrafficking"
  15825. // ]
  15826. // }
  15827. }
  15828. // method id "dfareporting.advertisers.list":
  15829. type AdvertisersListCall struct {
  15830. s *Service
  15831. profileId int64
  15832. urlParams_ gensupport.URLParams
  15833. ifNoneMatch_ string
  15834. ctx_ context.Context
  15835. header_ http.Header
  15836. }
  15837. // List: Retrieves a list of advertisers, possibly filtered. This method
  15838. // supports paging.
  15839. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  15840. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15841. c.profileId = profileId
  15842. return c
  15843. }
  15844. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  15845. // Select only advertisers with these advertiser group IDs.
  15846. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  15847. var advertiserGroupIds_ []string
  15848. for _, v := range advertiserGroupIds {
  15849. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  15850. }
  15851. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  15852. return c
  15853. }
  15854. // FloodlightConfigurationIds sets the optional parameter
  15855. // "floodlightConfigurationIds": Select only advertisers with these
  15856. // floodlight configuration IDs.
  15857. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  15858. var floodlightConfigurationIds_ []string
  15859. for _, v := range floodlightConfigurationIds {
  15860. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  15861. }
  15862. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  15863. return c
  15864. }
  15865. // Ids sets the optional parameter "ids": Select only advertisers with
  15866. // these IDs.
  15867. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  15868. var ids_ []string
  15869. for _, v := range ids {
  15870. ids_ = append(ids_, fmt.Sprint(v))
  15871. }
  15872. c.urlParams_.SetMulti("ids", ids_)
  15873. return c
  15874. }
  15875. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  15876. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  15877. // do not belong to any advertiser group.
  15878. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  15879. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  15880. return c
  15881. }
  15882. // MaxResults sets the optional parameter "maxResults": Maximum number
  15883. // of results to return.
  15884. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  15885. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15886. return c
  15887. }
  15888. // OnlyParent sets the optional parameter "onlyParent": Select only
  15889. // advertisers which use another advertiser's floodlight configuration.
  15890. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  15891. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  15892. return c
  15893. }
  15894. // PageToken sets the optional parameter "pageToken": Value of the
  15895. // nextPageToken from the previous result page.
  15896. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  15897. c.urlParams_.Set("pageToken", pageToken)
  15898. return c
  15899. }
  15900. // SearchString sets the optional parameter "searchString": Allows
  15901. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15902. // example, "advertiser*2015" will return objects with names like
  15903. // "advertiser June 2015", "advertiser April 2015", or simply
  15904. // "advertiser 2015". Most of the searches also add wildcards implicitly
  15905. // at the start and the end of the search string. For example, a search
  15906. // string of "advertiser" will match objects with name "my advertiser",
  15907. // "advertiser 2015", or simply "advertiser".
  15908. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  15909. c.urlParams_.Set("searchString", searchString)
  15910. return c
  15911. }
  15912. // SortField sets the optional parameter "sortField": Field by which to
  15913. // sort the list.
  15914. //
  15915. // Possible values:
  15916. // "ID" (default)
  15917. // "NAME"
  15918. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  15919. c.urlParams_.Set("sortField", sortField)
  15920. return c
  15921. }
  15922. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15923. // results.
  15924. //
  15925. // Possible values:
  15926. // "ASCENDING" (default)
  15927. // "DESCENDING"
  15928. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  15929. c.urlParams_.Set("sortOrder", sortOrder)
  15930. return c
  15931. }
  15932. // Status sets the optional parameter "status": Select only advertisers
  15933. // with the specified status.
  15934. //
  15935. // Possible values:
  15936. // "APPROVED"
  15937. // "ON_HOLD"
  15938. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  15939. c.urlParams_.Set("status", status)
  15940. return c
  15941. }
  15942. // SubaccountId sets the optional parameter "subaccountId": Select only
  15943. // advertisers with these subaccount IDs.
  15944. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  15945. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  15946. return c
  15947. }
  15948. // Fields allows partial responses to be retrieved. See
  15949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15950. // for more information.
  15951. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  15952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15953. return c
  15954. }
  15955. // IfNoneMatch sets the optional parameter which makes the operation
  15956. // fail if the object's ETag matches the given value. This is useful for
  15957. // getting updates only after the object has changed since the last
  15958. // request. Use googleapi.IsNotModified to check whether the response
  15959. // error from Do is the result of In-None-Match.
  15960. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  15961. c.ifNoneMatch_ = entityTag
  15962. return c
  15963. }
  15964. // Context sets the context to be used in this call's Do method. Any
  15965. // pending HTTP request will be aborted if the provided context is
  15966. // canceled.
  15967. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  15968. c.ctx_ = ctx
  15969. return c
  15970. }
  15971. // Header returns an http.Header that can be modified by the caller to
  15972. // add HTTP headers to the request.
  15973. func (c *AdvertisersListCall) Header() http.Header {
  15974. if c.header_ == nil {
  15975. c.header_ = make(http.Header)
  15976. }
  15977. return c.header_
  15978. }
  15979. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  15980. reqHeaders := make(http.Header)
  15981. for k, v := range c.header_ {
  15982. reqHeaders[k] = v
  15983. }
  15984. reqHeaders.Set("User-Agent", c.s.userAgent())
  15985. if c.ifNoneMatch_ != "" {
  15986. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15987. }
  15988. var body io.Reader = nil
  15989. c.urlParams_.Set("alt", alt)
  15990. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  15991. urls += "?" + c.urlParams_.Encode()
  15992. req, _ := http.NewRequest("GET", urls, body)
  15993. req.Header = reqHeaders
  15994. googleapi.Expand(req.URL, map[string]string{
  15995. "profileId": strconv.FormatInt(c.profileId, 10),
  15996. })
  15997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15998. }
  15999. // Do executes the "dfareporting.advertisers.list" call.
  16000. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  16001. // non-2xx status code is an error. Response headers are in either
  16002. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  16003. // returned at all) in error.(*googleapi.Error).Header. Use
  16004. // googleapi.IsNotModified to check whether the returned error was
  16005. // because http.StatusNotModified was returned.
  16006. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  16007. gensupport.SetOptions(c.urlParams_, opts...)
  16008. res, err := c.doRequest("json")
  16009. if res != nil && res.StatusCode == http.StatusNotModified {
  16010. if res.Body != nil {
  16011. res.Body.Close()
  16012. }
  16013. return nil, &googleapi.Error{
  16014. Code: res.StatusCode,
  16015. Header: res.Header,
  16016. }
  16017. }
  16018. if err != nil {
  16019. return nil, err
  16020. }
  16021. defer googleapi.CloseBody(res)
  16022. if err := googleapi.CheckResponse(res); err != nil {
  16023. return nil, err
  16024. }
  16025. ret := &AdvertisersListResponse{
  16026. ServerResponse: googleapi.ServerResponse{
  16027. Header: res.Header,
  16028. HTTPStatusCode: res.StatusCode,
  16029. },
  16030. }
  16031. target := &ret
  16032. if err := gensupport.DecodeResponse(target, res); err != nil {
  16033. return nil, err
  16034. }
  16035. return ret, nil
  16036. // {
  16037. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  16038. // "httpMethod": "GET",
  16039. // "id": "dfareporting.advertisers.list",
  16040. // "parameterOrder": [
  16041. // "profileId"
  16042. // ],
  16043. // "parameters": {
  16044. // "advertiserGroupIds": {
  16045. // "description": "Select only advertisers with these advertiser group IDs.",
  16046. // "format": "int64",
  16047. // "location": "query",
  16048. // "repeated": true,
  16049. // "type": "string"
  16050. // },
  16051. // "floodlightConfigurationIds": {
  16052. // "description": "Select only advertisers with these floodlight configuration IDs.",
  16053. // "format": "int64",
  16054. // "location": "query",
  16055. // "repeated": true,
  16056. // "type": "string"
  16057. // },
  16058. // "ids": {
  16059. // "description": "Select only advertisers with these IDs.",
  16060. // "format": "int64",
  16061. // "location": "query",
  16062. // "repeated": true,
  16063. // "type": "string"
  16064. // },
  16065. // "includeAdvertisersWithoutGroupsOnly": {
  16066. // "description": "Select only advertisers which do not belong to any advertiser group.",
  16067. // "location": "query",
  16068. // "type": "boolean"
  16069. // },
  16070. // "maxResults": {
  16071. // "default": "1000",
  16072. // "description": "Maximum number of results to return.",
  16073. // "format": "int32",
  16074. // "location": "query",
  16075. // "maximum": "1000",
  16076. // "minimum": "0",
  16077. // "type": "integer"
  16078. // },
  16079. // "onlyParent": {
  16080. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  16081. // "location": "query",
  16082. // "type": "boolean"
  16083. // },
  16084. // "pageToken": {
  16085. // "description": "Value of the nextPageToken from the previous result page.",
  16086. // "location": "query",
  16087. // "type": "string"
  16088. // },
  16089. // "profileId": {
  16090. // "description": "User profile ID associated with this request.",
  16091. // "format": "int64",
  16092. // "location": "path",
  16093. // "required": true,
  16094. // "type": "string"
  16095. // },
  16096. // "searchString": {
  16097. // "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\".",
  16098. // "location": "query",
  16099. // "type": "string"
  16100. // },
  16101. // "sortField": {
  16102. // "default": "ID",
  16103. // "description": "Field by which to sort the list.",
  16104. // "enum": [
  16105. // "ID",
  16106. // "NAME"
  16107. // ],
  16108. // "enumDescriptions": [
  16109. // "",
  16110. // ""
  16111. // ],
  16112. // "location": "query",
  16113. // "type": "string"
  16114. // },
  16115. // "sortOrder": {
  16116. // "default": "ASCENDING",
  16117. // "description": "Order of sorted results.",
  16118. // "enum": [
  16119. // "ASCENDING",
  16120. // "DESCENDING"
  16121. // ],
  16122. // "enumDescriptions": [
  16123. // "",
  16124. // ""
  16125. // ],
  16126. // "location": "query",
  16127. // "type": "string"
  16128. // },
  16129. // "status": {
  16130. // "description": "Select only advertisers with the specified status.",
  16131. // "enum": [
  16132. // "APPROVED",
  16133. // "ON_HOLD"
  16134. // ],
  16135. // "enumDescriptions": [
  16136. // "",
  16137. // ""
  16138. // ],
  16139. // "location": "query",
  16140. // "type": "string"
  16141. // },
  16142. // "subaccountId": {
  16143. // "description": "Select only advertisers with these subaccount IDs.",
  16144. // "format": "int64",
  16145. // "location": "query",
  16146. // "type": "string"
  16147. // }
  16148. // },
  16149. // "path": "userprofiles/{profileId}/advertisers",
  16150. // "response": {
  16151. // "$ref": "AdvertisersListResponse"
  16152. // },
  16153. // "scopes": [
  16154. // "https://www.googleapis.com/auth/dfatrafficking"
  16155. // ]
  16156. // }
  16157. }
  16158. // Pages invokes f for each page of results.
  16159. // A non-nil error returned from f will halt the iteration.
  16160. // The provided context supersedes any context provided to the Context method.
  16161. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  16162. c.ctx_ = ctx
  16163. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16164. for {
  16165. x, err := c.Do()
  16166. if err != nil {
  16167. return err
  16168. }
  16169. if err := f(x); err != nil {
  16170. return err
  16171. }
  16172. if x.NextPageToken == "" {
  16173. return nil
  16174. }
  16175. c.PageToken(x.NextPageToken)
  16176. }
  16177. }
  16178. // method id "dfareporting.advertisers.patch":
  16179. type AdvertisersPatchCall struct {
  16180. s *Service
  16181. profileId int64
  16182. advertiser *Advertiser
  16183. urlParams_ gensupport.URLParams
  16184. ctx_ context.Context
  16185. header_ http.Header
  16186. }
  16187. // Patch: Updates an existing advertiser. This method supports patch
  16188. // semantics.
  16189. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  16190. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16191. c.profileId = profileId
  16192. c.urlParams_.Set("id", fmt.Sprint(id))
  16193. c.advertiser = advertiser
  16194. return c
  16195. }
  16196. // Fields allows partial responses to be retrieved. See
  16197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16198. // for more information.
  16199. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  16200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16201. return c
  16202. }
  16203. // Context sets the context to be used in this call's Do method. Any
  16204. // pending HTTP request will be aborted if the provided context is
  16205. // canceled.
  16206. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  16207. c.ctx_ = ctx
  16208. return c
  16209. }
  16210. // Header returns an http.Header that can be modified by the caller to
  16211. // add HTTP headers to the request.
  16212. func (c *AdvertisersPatchCall) Header() http.Header {
  16213. if c.header_ == nil {
  16214. c.header_ = make(http.Header)
  16215. }
  16216. return c.header_
  16217. }
  16218. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  16219. reqHeaders := make(http.Header)
  16220. for k, v := range c.header_ {
  16221. reqHeaders[k] = v
  16222. }
  16223. reqHeaders.Set("User-Agent", c.s.userAgent())
  16224. var body io.Reader = nil
  16225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16226. if err != nil {
  16227. return nil, err
  16228. }
  16229. reqHeaders.Set("Content-Type", "application/json")
  16230. c.urlParams_.Set("alt", alt)
  16231. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16232. urls += "?" + c.urlParams_.Encode()
  16233. req, _ := http.NewRequest("PATCH", urls, body)
  16234. req.Header = reqHeaders
  16235. googleapi.Expand(req.URL, map[string]string{
  16236. "profileId": strconv.FormatInt(c.profileId, 10),
  16237. })
  16238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16239. }
  16240. // Do executes the "dfareporting.advertisers.patch" call.
  16241. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16242. // status code is an error. Response headers are in either
  16243. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16244. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16245. // to check whether the returned error was because
  16246. // http.StatusNotModified was returned.
  16247. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16248. gensupport.SetOptions(c.urlParams_, opts...)
  16249. res, err := c.doRequest("json")
  16250. if res != nil && res.StatusCode == http.StatusNotModified {
  16251. if res.Body != nil {
  16252. res.Body.Close()
  16253. }
  16254. return nil, &googleapi.Error{
  16255. Code: res.StatusCode,
  16256. Header: res.Header,
  16257. }
  16258. }
  16259. if err != nil {
  16260. return nil, err
  16261. }
  16262. defer googleapi.CloseBody(res)
  16263. if err := googleapi.CheckResponse(res); err != nil {
  16264. return nil, err
  16265. }
  16266. ret := &Advertiser{
  16267. ServerResponse: googleapi.ServerResponse{
  16268. Header: res.Header,
  16269. HTTPStatusCode: res.StatusCode,
  16270. },
  16271. }
  16272. target := &ret
  16273. if err := gensupport.DecodeResponse(target, res); err != nil {
  16274. return nil, err
  16275. }
  16276. return ret, nil
  16277. // {
  16278. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  16279. // "httpMethod": "PATCH",
  16280. // "id": "dfareporting.advertisers.patch",
  16281. // "parameterOrder": [
  16282. // "profileId",
  16283. // "id"
  16284. // ],
  16285. // "parameters": {
  16286. // "id": {
  16287. // "description": "Advertiser ID.",
  16288. // "format": "int64",
  16289. // "location": "query",
  16290. // "required": true,
  16291. // "type": "string"
  16292. // },
  16293. // "profileId": {
  16294. // "description": "User profile ID associated with this request.",
  16295. // "format": "int64",
  16296. // "location": "path",
  16297. // "required": true,
  16298. // "type": "string"
  16299. // }
  16300. // },
  16301. // "path": "userprofiles/{profileId}/advertisers",
  16302. // "request": {
  16303. // "$ref": "Advertiser"
  16304. // },
  16305. // "response": {
  16306. // "$ref": "Advertiser"
  16307. // },
  16308. // "scopes": [
  16309. // "https://www.googleapis.com/auth/dfatrafficking"
  16310. // ]
  16311. // }
  16312. }
  16313. // method id "dfareporting.advertisers.update":
  16314. type AdvertisersUpdateCall struct {
  16315. s *Service
  16316. profileId int64
  16317. advertiser *Advertiser
  16318. urlParams_ gensupport.URLParams
  16319. ctx_ context.Context
  16320. header_ http.Header
  16321. }
  16322. // Update: Updates an existing advertiser.
  16323. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  16324. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16325. c.profileId = profileId
  16326. c.advertiser = advertiser
  16327. return c
  16328. }
  16329. // Fields allows partial responses to be retrieved. See
  16330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16331. // for more information.
  16332. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  16333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16334. return c
  16335. }
  16336. // Context sets the context to be used in this call's Do method. Any
  16337. // pending HTTP request will be aborted if the provided context is
  16338. // canceled.
  16339. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  16340. c.ctx_ = ctx
  16341. return c
  16342. }
  16343. // Header returns an http.Header that can be modified by the caller to
  16344. // add HTTP headers to the request.
  16345. func (c *AdvertisersUpdateCall) Header() http.Header {
  16346. if c.header_ == nil {
  16347. c.header_ = make(http.Header)
  16348. }
  16349. return c.header_
  16350. }
  16351. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  16352. reqHeaders := make(http.Header)
  16353. for k, v := range c.header_ {
  16354. reqHeaders[k] = v
  16355. }
  16356. reqHeaders.Set("User-Agent", c.s.userAgent())
  16357. var body io.Reader = nil
  16358. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16359. if err != nil {
  16360. return nil, err
  16361. }
  16362. reqHeaders.Set("Content-Type", "application/json")
  16363. c.urlParams_.Set("alt", alt)
  16364. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16365. urls += "?" + c.urlParams_.Encode()
  16366. req, _ := http.NewRequest("PUT", urls, body)
  16367. req.Header = reqHeaders
  16368. googleapi.Expand(req.URL, map[string]string{
  16369. "profileId": strconv.FormatInt(c.profileId, 10),
  16370. })
  16371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16372. }
  16373. // Do executes the "dfareporting.advertisers.update" call.
  16374. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16375. // status code is an error. Response headers are in either
  16376. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16377. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16378. // to check whether the returned error was because
  16379. // http.StatusNotModified was returned.
  16380. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16381. gensupport.SetOptions(c.urlParams_, opts...)
  16382. res, err := c.doRequest("json")
  16383. if res != nil && res.StatusCode == http.StatusNotModified {
  16384. if res.Body != nil {
  16385. res.Body.Close()
  16386. }
  16387. return nil, &googleapi.Error{
  16388. Code: res.StatusCode,
  16389. Header: res.Header,
  16390. }
  16391. }
  16392. if err != nil {
  16393. return nil, err
  16394. }
  16395. defer googleapi.CloseBody(res)
  16396. if err := googleapi.CheckResponse(res); err != nil {
  16397. return nil, err
  16398. }
  16399. ret := &Advertiser{
  16400. ServerResponse: googleapi.ServerResponse{
  16401. Header: res.Header,
  16402. HTTPStatusCode: res.StatusCode,
  16403. },
  16404. }
  16405. target := &ret
  16406. if err := gensupport.DecodeResponse(target, res); err != nil {
  16407. return nil, err
  16408. }
  16409. return ret, nil
  16410. // {
  16411. // "description": "Updates an existing advertiser.",
  16412. // "httpMethod": "PUT",
  16413. // "id": "dfareporting.advertisers.update",
  16414. // "parameterOrder": [
  16415. // "profileId"
  16416. // ],
  16417. // "parameters": {
  16418. // "profileId": {
  16419. // "description": "User profile ID associated with this request.",
  16420. // "format": "int64",
  16421. // "location": "path",
  16422. // "required": true,
  16423. // "type": "string"
  16424. // }
  16425. // },
  16426. // "path": "userprofiles/{profileId}/advertisers",
  16427. // "request": {
  16428. // "$ref": "Advertiser"
  16429. // },
  16430. // "response": {
  16431. // "$ref": "Advertiser"
  16432. // },
  16433. // "scopes": [
  16434. // "https://www.googleapis.com/auth/dfatrafficking"
  16435. // ]
  16436. // }
  16437. }
  16438. // method id "dfareporting.browsers.list":
  16439. type BrowsersListCall struct {
  16440. s *Service
  16441. profileId int64
  16442. urlParams_ gensupport.URLParams
  16443. ifNoneMatch_ string
  16444. ctx_ context.Context
  16445. header_ http.Header
  16446. }
  16447. // List: Retrieves a list of browsers.
  16448. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  16449. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16450. c.profileId = profileId
  16451. return c
  16452. }
  16453. // Fields allows partial responses to be retrieved. See
  16454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16455. // for more information.
  16456. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  16457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16458. return c
  16459. }
  16460. // IfNoneMatch sets the optional parameter which makes the operation
  16461. // fail if the object's ETag matches the given value. This is useful for
  16462. // getting updates only after the object has changed since the last
  16463. // request. Use googleapi.IsNotModified to check whether the response
  16464. // error from Do is the result of In-None-Match.
  16465. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  16466. c.ifNoneMatch_ = entityTag
  16467. return c
  16468. }
  16469. // Context sets the context to be used in this call's Do method. Any
  16470. // pending HTTP request will be aborted if the provided context is
  16471. // canceled.
  16472. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  16473. c.ctx_ = ctx
  16474. return c
  16475. }
  16476. // Header returns an http.Header that can be modified by the caller to
  16477. // add HTTP headers to the request.
  16478. func (c *BrowsersListCall) Header() http.Header {
  16479. if c.header_ == nil {
  16480. c.header_ = make(http.Header)
  16481. }
  16482. return c.header_
  16483. }
  16484. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  16485. reqHeaders := make(http.Header)
  16486. for k, v := range c.header_ {
  16487. reqHeaders[k] = v
  16488. }
  16489. reqHeaders.Set("User-Agent", c.s.userAgent())
  16490. if c.ifNoneMatch_ != "" {
  16491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16492. }
  16493. var body io.Reader = nil
  16494. c.urlParams_.Set("alt", alt)
  16495. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  16496. urls += "?" + c.urlParams_.Encode()
  16497. req, _ := http.NewRequest("GET", urls, body)
  16498. req.Header = reqHeaders
  16499. googleapi.Expand(req.URL, map[string]string{
  16500. "profileId": strconv.FormatInt(c.profileId, 10),
  16501. })
  16502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16503. }
  16504. // Do executes the "dfareporting.browsers.list" call.
  16505. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  16506. // non-2xx status code is an error. Response headers are in either
  16507. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  16508. // returned at all) in error.(*googleapi.Error).Header. Use
  16509. // googleapi.IsNotModified to check whether the returned error was
  16510. // because http.StatusNotModified was returned.
  16511. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  16512. gensupport.SetOptions(c.urlParams_, opts...)
  16513. res, err := c.doRequest("json")
  16514. if res != nil && res.StatusCode == http.StatusNotModified {
  16515. if res.Body != nil {
  16516. res.Body.Close()
  16517. }
  16518. return nil, &googleapi.Error{
  16519. Code: res.StatusCode,
  16520. Header: res.Header,
  16521. }
  16522. }
  16523. if err != nil {
  16524. return nil, err
  16525. }
  16526. defer googleapi.CloseBody(res)
  16527. if err := googleapi.CheckResponse(res); err != nil {
  16528. return nil, err
  16529. }
  16530. ret := &BrowsersListResponse{
  16531. ServerResponse: googleapi.ServerResponse{
  16532. Header: res.Header,
  16533. HTTPStatusCode: res.StatusCode,
  16534. },
  16535. }
  16536. target := &ret
  16537. if err := gensupport.DecodeResponse(target, res); err != nil {
  16538. return nil, err
  16539. }
  16540. return ret, nil
  16541. // {
  16542. // "description": "Retrieves a list of browsers.",
  16543. // "httpMethod": "GET",
  16544. // "id": "dfareporting.browsers.list",
  16545. // "parameterOrder": [
  16546. // "profileId"
  16547. // ],
  16548. // "parameters": {
  16549. // "profileId": {
  16550. // "description": "User profile ID associated with this request.",
  16551. // "format": "int64",
  16552. // "location": "path",
  16553. // "required": true,
  16554. // "type": "string"
  16555. // }
  16556. // },
  16557. // "path": "userprofiles/{profileId}/browsers",
  16558. // "response": {
  16559. // "$ref": "BrowsersListResponse"
  16560. // },
  16561. // "scopes": [
  16562. // "https://www.googleapis.com/auth/dfatrafficking"
  16563. // ]
  16564. // }
  16565. }
  16566. // method id "dfareporting.campaignCreativeAssociations.insert":
  16567. type CampaignCreativeAssociationsInsertCall struct {
  16568. s *Service
  16569. profileId int64
  16570. campaignId int64
  16571. campaigncreativeassociation *CampaignCreativeAssociation
  16572. urlParams_ gensupport.URLParams
  16573. ctx_ context.Context
  16574. header_ http.Header
  16575. }
  16576. // Insert: Associates a creative with the specified campaign. This
  16577. // method creates a default ad with dimensions matching the creative in
  16578. // the campaign if such a default ad does not exist already.
  16579. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  16580. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16581. c.profileId = profileId
  16582. c.campaignId = campaignId
  16583. c.campaigncreativeassociation = campaigncreativeassociation
  16584. return c
  16585. }
  16586. // Fields allows partial responses to be retrieved. See
  16587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16588. // for more information.
  16589. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  16590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16591. return c
  16592. }
  16593. // Context sets the context to be used in this call's Do method. Any
  16594. // pending HTTP request will be aborted if the provided context is
  16595. // canceled.
  16596. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  16597. c.ctx_ = ctx
  16598. return c
  16599. }
  16600. // Header returns an http.Header that can be modified by the caller to
  16601. // add HTTP headers to the request.
  16602. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  16603. if c.header_ == nil {
  16604. c.header_ = make(http.Header)
  16605. }
  16606. return c.header_
  16607. }
  16608. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  16609. reqHeaders := make(http.Header)
  16610. for k, v := range c.header_ {
  16611. reqHeaders[k] = v
  16612. }
  16613. reqHeaders.Set("User-Agent", c.s.userAgent())
  16614. var body io.Reader = nil
  16615. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  16616. if err != nil {
  16617. return nil, err
  16618. }
  16619. reqHeaders.Set("Content-Type", "application/json")
  16620. c.urlParams_.Set("alt", alt)
  16621. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  16622. urls += "?" + c.urlParams_.Encode()
  16623. req, _ := http.NewRequest("POST", urls, body)
  16624. req.Header = reqHeaders
  16625. googleapi.Expand(req.URL, map[string]string{
  16626. "profileId": strconv.FormatInt(c.profileId, 10),
  16627. "campaignId": strconv.FormatInt(c.campaignId, 10),
  16628. })
  16629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16630. }
  16631. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  16632. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  16633. // Any non-2xx status code is an error. Response headers are in either
  16634. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  16635. // was returned at all) in error.(*googleapi.Error).Header. Use
  16636. // googleapi.IsNotModified to check whether the returned error was
  16637. // because http.StatusNotModified was returned.
  16638. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  16639. gensupport.SetOptions(c.urlParams_, opts...)
  16640. res, err := c.doRequest("json")
  16641. if res != nil && res.StatusCode == http.StatusNotModified {
  16642. if res.Body != nil {
  16643. res.Body.Close()
  16644. }
  16645. return nil, &googleapi.Error{
  16646. Code: res.StatusCode,
  16647. Header: res.Header,
  16648. }
  16649. }
  16650. if err != nil {
  16651. return nil, err
  16652. }
  16653. defer googleapi.CloseBody(res)
  16654. if err := googleapi.CheckResponse(res); err != nil {
  16655. return nil, err
  16656. }
  16657. ret := &CampaignCreativeAssociation{
  16658. ServerResponse: googleapi.ServerResponse{
  16659. Header: res.Header,
  16660. HTTPStatusCode: res.StatusCode,
  16661. },
  16662. }
  16663. target := &ret
  16664. if err := gensupport.DecodeResponse(target, res); err != nil {
  16665. return nil, err
  16666. }
  16667. return ret, nil
  16668. // {
  16669. // "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.",
  16670. // "httpMethod": "POST",
  16671. // "id": "dfareporting.campaignCreativeAssociations.insert",
  16672. // "parameterOrder": [
  16673. // "profileId",
  16674. // "campaignId"
  16675. // ],
  16676. // "parameters": {
  16677. // "campaignId": {
  16678. // "description": "Campaign ID in this association.",
  16679. // "format": "int64",
  16680. // "location": "path",
  16681. // "required": true,
  16682. // "type": "string"
  16683. // },
  16684. // "profileId": {
  16685. // "description": "User profile ID associated with this request.",
  16686. // "format": "int64",
  16687. // "location": "path",
  16688. // "required": true,
  16689. // "type": "string"
  16690. // }
  16691. // },
  16692. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  16693. // "request": {
  16694. // "$ref": "CampaignCreativeAssociation"
  16695. // },
  16696. // "response": {
  16697. // "$ref": "CampaignCreativeAssociation"
  16698. // },
  16699. // "scopes": [
  16700. // "https://www.googleapis.com/auth/dfatrafficking"
  16701. // ]
  16702. // }
  16703. }
  16704. // method id "dfareporting.campaignCreativeAssociations.list":
  16705. type CampaignCreativeAssociationsListCall struct {
  16706. s *Service
  16707. profileId int64
  16708. campaignId int64
  16709. urlParams_ gensupport.URLParams
  16710. ifNoneMatch_ string
  16711. ctx_ context.Context
  16712. header_ http.Header
  16713. }
  16714. // List: Retrieves the list of creative IDs associated with the
  16715. // specified campaign. This method supports paging.
  16716. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  16717. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16718. c.profileId = profileId
  16719. c.campaignId = campaignId
  16720. return c
  16721. }
  16722. // MaxResults sets the optional parameter "maxResults": Maximum number
  16723. // of results to return.
  16724. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  16725. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16726. return c
  16727. }
  16728. // PageToken sets the optional parameter "pageToken": Value of the
  16729. // nextPageToken from the previous result page.
  16730. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  16731. c.urlParams_.Set("pageToken", pageToken)
  16732. return c
  16733. }
  16734. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16735. // results.
  16736. //
  16737. // Possible values:
  16738. // "ASCENDING" (default)
  16739. // "DESCENDING"
  16740. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  16741. c.urlParams_.Set("sortOrder", sortOrder)
  16742. return c
  16743. }
  16744. // Fields allows partial responses to be retrieved. See
  16745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16746. // for more information.
  16747. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  16748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16749. return c
  16750. }
  16751. // IfNoneMatch sets the optional parameter which makes the operation
  16752. // fail if the object's ETag matches the given value. This is useful for
  16753. // getting updates only after the object has changed since the last
  16754. // request. Use googleapi.IsNotModified to check whether the response
  16755. // error from Do is the result of In-None-Match.
  16756. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  16757. c.ifNoneMatch_ = entityTag
  16758. return c
  16759. }
  16760. // Context sets the context to be used in this call's Do method. Any
  16761. // pending HTTP request will be aborted if the provided context is
  16762. // canceled.
  16763. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  16764. c.ctx_ = ctx
  16765. return c
  16766. }
  16767. // Header returns an http.Header that can be modified by the caller to
  16768. // add HTTP headers to the request.
  16769. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  16770. if c.header_ == nil {
  16771. c.header_ = make(http.Header)
  16772. }
  16773. return c.header_
  16774. }
  16775. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  16776. reqHeaders := make(http.Header)
  16777. for k, v := range c.header_ {
  16778. reqHeaders[k] = v
  16779. }
  16780. reqHeaders.Set("User-Agent", c.s.userAgent())
  16781. if c.ifNoneMatch_ != "" {
  16782. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16783. }
  16784. var body io.Reader = nil
  16785. c.urlParams_.Set("alt", alt)
  16786. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  16787. urls += "?" + c.urlParams_.Encode()
  16788. req, _ := http.NewRequest("GET", urls, body)
  16789. req.Header = reqHeaders
  16790. googleapi.Expand(req.URL, map[string]string{
  16791. "profileId": strconv.FormatInt(c.profileId, 10),
  16792. "campaignId": strconv.FormatInt(c.campaignId, 10),
  16793. })
  16794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16795. }
  16796. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  16797. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  16798. // will be non-nil. Any non-2xx status code is an error. Response
  16799. // headers are in either
  16800. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  16801. // (if a response was returned at all) in
  16802. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16803. // whether the returned error was because http.StatusNotModified was
  16804. // returned.
  16805. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  16806. gensupport.SetOptions(c.urlParams_, opts...)
  16807. res, err := c.doRequest("json")
  16808. if res != nil && res.StatusCode == http.StatusNotModified {
  16809. if res.Body != nil {
  16810. res.Body.Close()
  16811. }
  16812. return nil, &googleapi.Error{
  16813. Code: res.StatusCode,
  16814. Header: res.Header,
  16815. }
  16816. }
  16817. if err != nil {
  16818. return nil, err
  16819. }
  16820. defer googleapi.CloseBody(res)
  16821. if err := googleapi.CheckResponse(res); err != nil {
  16822. return nil, err
  16823. }
  16824. ret := &CampaignCreativeAssociationsListResponse{
  16825. ServerResponse: googleapi.ServerResponse{
  16826. Header: res.Header,
  16827. HTTPStatusCode: res.StatusCode,
  16828. },
  16829. }
  16830. target := &ret
  16831. if err := gensupport.DecodeResponse(target, res); err != nil {
  16832. return nil, err
  16833. }
  16834. return ret, nil
  16835. // {
  16836. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  16837. // "httpMethod": "GET",
  16838. // "id": "dfareporting.campaignCreativeAssociations.list",
  16839. // "parameterOrder": [
  16840. // "profileId",
  16841. // "campaignId"
  16842. // ],
  16843. // "parameters": {
  16844. // "campaignId": {
  16845. // "description": "Campaign ID in this association.",
  16846. // "format": "int64",
  16847. // "location": "path",
  16848. // "required": true,
  16849. // "type": "string"
  16850. // },
  16851. // "maxResults": {
  16852. // "default": "1000",
  16853. // "description": "Maximum number of results to return.",
  16854. // "format": "int32",
  16855. // "location": "query",
  16856. // "maximum": "1000",
  16857. // "minimum": "0",
  16858. // "type": "integer"
  16859. // },
  16860. // "pageToken": {
  16861. // "description": "Value of the nextPageToken from the previous result page.",
  16862. // "location": "query",
  16863. // "type": "string"
  16864. // },
  16865. // "profileId": {
  16866. // "description": "User profile ID associated with this request.",
  16867. // "format": "int64",
  16868. // "location": "path",
  16869. // "required": true,
  16870. // "type": "string"
  16871. // },
  16872. // "sortOrder": {
  16873. // "default": "ASCENDING",
  16874. // "description": "Order of sorted results.",
  16875. // "enum": [
  16876. // "ASCENDING",
  16877. // "DESCENDING"
  16878. // ],
  16879. // "enumDescriptions": [
  16880. // "",
  16881. // ""
  16882. // ],
  16883. // "location": "query",
  16884. // "type": "string"
  16885. // }
  16886. // },
  16887. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  16888. // "response": {
  16889. // "$ref": "CampaignCreativeAssociationsListResponse"
  16890. // },
  16891. // "scopes": [
  16892. // "https://www.googleapis.com/auth/dfatrafficking"
  16893. // ]
  16894. // }
  16895. }
  16896. // Pages invokes f for each page of results.
  16897. // A non-nil error returned from f will halt the iteration.
  16898. // The provided context supersedes any context provided to the Context method.
  16899. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  16900. c.ctx_ = ctx
  16901. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16902. for {
  16903. x, err := c.Do()
  16904. if err != nil {
  16905. return err
  16906. }
  16907. if err := f(x); err != nil {
  16908. return err
  16909. }
  16910. if x.NextPageToken == "" {
  16911. return nil
  16912. }
  16913. c.PageToken(x.NextPageToken)
  16914. }
  16915. }
  16916. // method id "dfareporting.campaigns.get":
  16917. type CampaignsGetCall struct {
  16918. s *Service
  16919. profileId int64
  16920. id int64
  16921. urlParams_ gensupport.URLParams
  16922. ifNoneMatch_ string
  16923. ctx_ context.Context
  16924. header_ http.Header
  16925. }
  16926. // Get: Gets one campaign by ID.
  16927. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  16928. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16929. c.profileId = profileId
  16930. c.id = id
  16931. return c
  16932. }
  16933. // Fields allows partial responses to be retrieved. See
  16934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16935. // for more information.
  16936. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  16937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16938. return c
  16939. }
  16940. // IfNoneMatch sets the optional parameter which makes the operation
  16941. // fail if the object's ETag matches the given value. This is useful for
  16942. // getting updates only after the object has changed since the last
  16943. // request. Use googleapi.IsNotModified to check whether the response
  16944. // error from Do is the result of In-None-Match.
  16945. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  16946. c.ifNoneMatch_ = entityTag
  16947. return c
  16948. }
  16949. // Context sets the context to be used in this call's Do method. Any
  16950. // pending HTTP request will be aborted if the provided context is
  16951. // canceled.
  16952. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  16953. c.ctx_ = ctx
  16954. return c
  16955. }
  16956. // Header returns an http.Header that can be modified by the caller to
  16957. // add HTTP headers to the request.
  16958. func (c *CampaignsGetCall) Header() http.Header {
  16959. if c.header_ == nil {
  16960. c.header_ = make(http.Header)
  16961. }
  16962. return c.header_
  16963. }
  16964. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  16965. reqHeaders := make(http.Header)
  16966. for k, v := range c.header_ {
  16967. reqHeaders[k] = v
  16968. }
  16969. reqHeaders.Set("User-Agent", c.s.userAgent())
  16970. if c.ifNoneMatch_ != "" {
  16971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16972. }
  16973. var body io.Reader = nil
  16974. c.urlParams_.Set("alt", alt)
  16975. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  16976. urls += "?" + c.urlParams_.Encode()
  16977. req, _ := http.NewRequest("GET", urls, body)
  16978. req.Header = reqHeaders
  16979. googleapi.Expand(req.URL, map[string]string{
  16980. "profileId": strconv.FormatInt(c.profileId, 10),
  16981. "id": strconv.FormatInt(c.id, 10),
  16982. })
  16983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16984. }
  16985. // Do executes the "dfareporting.campaigns.get" call.
  16986. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  16987. // code is an error. Response headers are in either
  16988. // *Campaign.ServerResponse.Header or (if a response was returned at
  16989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16990. // to check whether the returned error was because
  16991. // http.StatusNotModified was returned.
  16992. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  16993. gensupport.SetOptions(c.urlParams_, opts...)
  16994. res, err := c.doRequest("json")
  16995. if res != nil && res.StatusCode == http.StatusNotModified {
  16996. if res.Body != nil {
  16997. res.Body.Close()
  16998. }
  16999. return nil, &googleapi.Error{
  17000. Code: res.StatusCode,
  17001. Header: res.Header,
  17002. }
  17003. }
  17004. if err != nil {
  17005. return nil, err
  17006. }
  17007. defer googleapi.CloseBody(res)
  17008. if err := googleapi.CheckResponse(res); err != nil {
  17009. return nil, err
  17010. }
  17011. ret := &Campaign{
  17012. ServerResponse: googleapi.ServerResponse{
  17013. Header: res.Header,
  17014. HTTPStatusCode: res.StatusCode,
  17015. },
  17016. }
  17017. target := &ret
  17018. if err := gensupport.DecodeResponse(target, res); err != nil {
  17019. return nil, err
  17020. }
  17021. return ret, nil
  17022. // {
  17023. // "description": "Gets one campaign by ID.",
  17024. // "httpMethod": "GET",
  17025. // "id": "dfareporting.campaigns.get",
  17026. // "parameterOrder": [
  17027. // "profileId",
  17028. // "id"
  17029. // ],
  17030. // "parameters": {
  17031. // "id": {
  17032. // "description": "Campaign ID.",
  17033. // "format": "int64",
  17034. // "location": "path",
  17035. // "required": true,
  17036. // "type": "string"
  17037. // },
  17038. // "profileId": {
  17039. // "description": "User profile ID associated with this request.",
  17040. // "format": "int64",
  17041. // "location": "path",
  17042. // "required": true,
  17043. // "type": "string"
  17044. // }
  17045. // },
  17046. // "path": "userprofiles/{profileId}/campaigns/{id}",
  17047. // "response": {
  17048. // "$ref": "Campaign"
  17049. // },
  17050. // "scopes": [
  17051. // "https://www.googleapis.com/auth/dfatrafficking"
  17052. // ]
  17053. // }
  17054. }
  17055. // method id "dfareporting.campaigns.insert":
  17056. type CampaignsInsertCall struct {
  17057. s *Service
  17058. profileId int64
  17059. campaign *Campaign
  17060. urlParams_ gensupport.URLParams
  17061. ctx_ context.Context
  17062. header_ http.Header
  17063. }
  17064. // Insert: Inserts a new campaign.
  17065. func (r *CampaignsService) Insert(profileId int64, defaultLandingPageName string, defaultLandingPageUrl string, campaign *Campaign) *CampaignsInsertCall {
  17066. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17067. c.profileId = profileId
  17068. c.urlParams_.Set("defaultLandingPageName", defaultLandingPageName)
  17069. c.urlParams_.Set("defaultLandingPageUrl", defaultLandingPageUrl)
  17070. c.campaign = campaign
  17071. return c
  17072. }
  17073. // Fields allows partial responses to be retrieved. See
  17074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17075. // for more information.
  17076. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  17077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17078. return c
  17079. }
  17080. // Context sets the context to be used in this call's Do method. Any
  17081. // pending HTTP request will be aborted if the provided context is
  17082. // canceled.
  17083. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  17084. c.ctx_ = ctx
  17085. return c
  17086. }
  17087. // Header returns an http.Header that can be modified by the caller to
  17088. // add HTTP headers to the request.
  17089. func (c *CampaignsInsertCall) Header() http.Header {
  17090. if c.header_ == nil {
  17091. c.header_ = make(http.Header)
  17092. }
  17093. return c.header_
  17094. }
  17095. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  17096. reqHeaders := make(http.Header)
  17097. for k, v := range c.header_ {
  17098. reqHeaders[k] = v
  17099. }
  17100. reqHeaders.Set("User-Agent", c.s.userAgent())
  17101. var body io.Reader = nil
  17102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  17103. if err != nil {
  17104. return nil, err
  17105. }
  17106. reqHeaders.Set("Content-Type", "application/json")
  17107. c.urlParams_.Set("alt", alt)
  17108. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17109. urls += "?" + c.urlParams_.Encode()
  17110. req, _ := http.NewRequest("POST", urls, body)
  17111. req.Header = reqHeaders
  17112. googleapi.Expand(req.URL, map[string]string{
  17113. "profileId": strconv.FormatInt(c.profileId, 10),
  17114. })
  17115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17116. }
  17117. // Do executes the "dfareporting.campaigns.insert" call.
  17118. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  17119. // code is an error. Response headers are in either
  17120. // *Campaign.ServerResponse.Header or (if a response was returned at
  17121. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17122. // to check whether the returned error was because
  17123. // http.StatusNotModified was returned.
  17124. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  17125. gensupport.SetOptions(c.urlParams_, opts...)
  17126. res, err := c.doRequest("json")
  17127. if res != nil && res.StatusCode == http.StatusNotModified {
  17128. if res.Body != nil {
  17129. res.Body.Close()
  17130. }
  17131. return nil, &googleapi.Error{
  17132. Code: res.StatusCode,
  17133. Header: res.Header,
  17134. }
  17135. }
  17136. if err != nil {
  17137. return nil, err
  17138. }
  17139. defer googleapi.CloseBody(res)
  17140. if err := googleapi.CheckResponse(res); err != nil {
  17141. return nil, err
  17142. }
  17143. ret := &Campaign{
  17144. ServerResponse: googleapi.ServerResponse{
  17145. Header: res.Header,
  17146. HTTPStatusCode: res.StatusCode,
  17147. },
  17148. }
  17149. target := &ret
  17150. if err := gensupport.DecodeResponse(target, res); err != nil {
  17151. return nil, err
  17152. }
  17153. return ret, nil
  17154. // {
  17155. // "description": "Inserts a new campaign.",
  17156. // "httpMethod": "POST",
  17157. // "id": "dfareporting.campaigns.insert",
  17158. // "parameterOrder": [
  17159. // "profileId",
  17160. // "defaultLandingPageName",
  17161. // "defaultLandingPageUrl"
  17162. // ],
  17163. // "parameters": {
  17164. // "defaultLandingPageName": {
  17165. // "description": "Default landing page name for this new campaign. Must be less than 256 characters long.",
  17166. // "location": "query",
  17167. // "required": true,
  17168. // "type": "string"
  17169. // },
  17170. // "defaultLandingPageUrl": {
  17171. // "description": "Default landing page URL for this new campaign.",
  17172. // "location": "query",
  17173. // "required": true,
  17174. // "type": "string"
  17175. // },
  17176. // "profileId": {
  17177. // "description": "User profile ID associated with this request.",
  17178. // "format": "int64",
  17179. // "location": "path",
  17180. // "required": true,
  17181. // "type": "string"
  17182. // }
  17183. // },
  17184. // "path": "userprofiles/{profileId}/campaigns",
  17185. // "request": {
  17186. // "$ref": "Campaign"
  17187. // },
  17188. // "response": {
  17189. // "$ref": "Campaign"
  17190. // },
  17191. // "scopes": [
  17192. // "https://www.googleapis.com/auth/dfatrafficking"
  17193. // ]
  17194. // }
  17195. }
  17196. // method id "dfareporting.campaigns.list":
  17197. type CampaignsListCall struct {
  17198. s *Service
  17199. profileId int64
  17200. urlParams_ gensupport.URLParams
  17201. ifNoneMatch_ string
  17202. ctx_ context.Context
  17203. header_ http.Header
  17204. }
  17205. // List: Retrieves a list of campaigns, possibly filtered. This method
  17206. // supports paging.
  17207. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  17208. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17209. c.profileId = profileId
  17210. return c
  17211. }
  17212. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17213. // Select only campaigns whose advertisers belong to these advertiser
  17214. // groups.
  17215. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  17216. var advertiserGroupIds_ []string
  17217. for _, v := range advertiserGroupIds {
  17218. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17219. }
  17220. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17221. return c
  17222. }
  17223. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  17224. // only campaigns that belong to these advertisers.
  17225. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  17226. var advertiserIds_ []string
  17227. for _, v := range advertiserIds {
  17228. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  17229. }
  17230. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  17231. return c
  17232. }
  17233. // Archived sets the optional parameter "archived": Select only archived
  17234. // campaigns. Don't set this field to select both archived and
  17235. // non-archived campaigns.
  17236. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  17237. c.urlParams_.Set("archived", fmt.Sprint(archived))
  17238. return c
  17239. }
  17240. // AtLeastOneOptimizationActivity sets the optional parameter
  17241. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  17242. // least one optimization activity.
  17243. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  17244. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  17245. return c
  17246. }
  17247. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  17248. // campaigns with these IDs.
  17249. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  17250. var excludedIds_ []string
  17251. for _, v := range excludedIds {
  17252. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  17253. }
  17254. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  17255. return c
  17256. }
  17257. // Ids sets the optional parameter "ids": Select only campaigns with
  17258. // these IDs.
  17259. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  17260. var ids_ []string
  17261. for _, v := range ids {
  17262. ids_ = append(ids_, fmt.Sprint(v))
  17263. }
  17264. c.urlParams_.SetMulti("ids", ids_)
  17265. return c
  17266. }
  17267. // MaxResults sets the optional parameter "maxResults": Maximum number
  17268. // of results to return.
  17269. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  17270. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17271. return c
  17272. }
  17273. // OverriddenEventTagId sets the optional parameter
  17274. // "overriddenEventTagId": Select only campaigns that have overridden
  17275. // this event tag ID.
  17276. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  17277. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  17278. return c
  17279. }
  17280. // PageToken sets the optional parameter "pageToken": Value of the
  17281. // nextPageToken from the previous result page.
  17282. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  17283. c.urlParams_.Set("pageToken", pageToken)
  17284. return c
  17285. }
  17286. // SearchString sets the optional parameter "searchString": Allows
  17287. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  17288. // example, "campaign*2015" will return campaigns with names like
  17289. // "campaign June 2015", "campaign April 2015", or simply "campaign
  17290. // 2015". Most of the searches also add wildcards implicitly at the
  17291. // start and the end of the search string. For example, a search string
  17292. // of "campaign" will match campaigns with name "my campaign", "campaign
  17293. // 2015", or simply "campaign".
  17294. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  17295. c.urlParams_.Set("searchString", searchString)
  17296. return c
  17297. }
  17298. // SortField sets the optional parameter "sortField": Field by which to
  17299. // sort the list.
  17300. //
  17301. // Possible values:
  17302. // "ID" (default)
  17303. // "NAME"
  17304. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  17305. c.urlParams_.Set("sortField", sortField)
  17306. return c
  17307. }
  17308. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17309. // results.
  17310. //
  17311. // Possible values:
  17312. // "ASCENDING" (default)
  17313. // "DESCENDING"
  17314. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  17315. c.urlParams_.Set("sortOrder", sortOrder)
  17316. return c
  17317. }
  17318. // SubaccountId sets the optional parameter "subaccountId": Select only
  17319. // campaigns that belong to this subaccount.
  17320. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  17321. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17322. return c
  17323. }
  17324. // Fields allows partial responses to be retrieved. See
  17325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17326. // for more information.
  17327. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  17328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17329. return c
  17330. }
  17331. // IfNoneMatch sets the optional parameter which makes the operation
  17332. // fail if the object's ETag matches the given value. This is useful for
  17333. // getting updates only after the object has changed since the last
  17334. // request. Use googleapi.IsNotModified to check whether the response
  17335. // error from Do is the result of In-None-Match.
  17336. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  17337. c.ifNoneMatch_ = entityTag
  17338. return c
  17339. }
  17340. // Context sets the context to be used in this call's Do method. Any
  17341. // pending HTTP request will be aborted if the provided context is
  17342. // canceled.
  17343. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  17344. c.ctx_ = ctx
  17345. return c
  17346. }
  17347. // Header returns an http.Header that can be modified by the caller to
  17348. // add HTTP headers to the request.
  17349. func (c *CampaignsListCall) Header() http.Header {
  17350. if c.header_ == nil {
  17351. c.header_ = make(http.Header)
  17352. }
  17353. return c.header_
  17354. }
  17355. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  17356. reqHeaders := make(http.Header)
  17357. for k, v := range c.header_ {
  17358. reqHeaders[k] = v
  17359. }
  17360. reqHeaders.Set("User-Agent", c.s.userAgent())
  17361. if c.ifNoneMatch_ != "" {
  17362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17363. }
  17364. var body io.Reader = nil
  17365. c.urlParams_.Set("alt", alt)
  17366. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17367. urls += "?" + c.urlParams_.Encode()
  17368. req, _ := http.NewRequest("GET", urls, body)
  17369. req.Header = reqHeaders
  17370. googleapi.Expand(req.URL, map[string]string{
  17371. "profileId": strconv.FormatInt(c.profileId, 10),
  17372. })
  17373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17374. }
  17375. // Do executes the "dfareporting.campaigns.list" call.
  17376. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  17377. // non-2xx status code is an error. Response headers are in either
  17378. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  17379. // returned at all) in error.(*googleapi.Error).Header. Use
  17380. // googleapi.IsNotModified to check whether the returned error was
  17381. // because http.StatusNotModified was returned.
  17382. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  17383. gensupport.SetOptions(c.urlParams_, opts...)
  17384. res, err := c.doRequest("json")
  17385. if res != nil && res.StatusCode == http.StatusNotModified {
  17386. if res.Body != nil {
  17387. res.Body.Close()
  17388. }
  17389. return nil, &googleapi.Error{
  17390. Code: res.StatusCode,
  17391. Header: res.Header,
  17392. }
  17393. }
  17394. if err != nil {
  17395. return nil, err
  17396. }
  17397. defer googleapi.CloseBody(res)
  17398. if err := googleapi.CheckResponse(res); err != nil {
  17399. return nil, err
  17400. }
  17401. ret := &CampaignsListResponse{
  17402. ServerResponse: googleapi.ServerResponse{
  17403. Header: res.Header,
  17404. HTTPStatusCode: res.StatusCode,
  17405. },
  17406. }
  17407. target := &ret
  17408. if err := gensupport.DecodeResponse(target, res); err != nil {
  17409. return nil, err
  17410. }
  17411. return ret, nil
  17412. // {
  17413. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  17414. // "httpMethod": "GET",
  17415. // "id": "dfareporting.campaigns.list",
  17416. // "parameterOrder": [
  17417. // "profileId"
  17418. // ],
  17419. // "parameters": {
  17420. // "advertiserGroupIds": {
  17421. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  17422. // "format": "int64",
  17423. // "location": "query",
  17424. // "repeated": true,
  17425. // "type": "string"
  17426. // },
  17427. // "advertiserIds": {
  17428. // "description": "Select only campaigns that belong to these advertisers.",
  17429. // "format": "int64",
  17430. // "location": "query",
  17431. // "repeated": true,
  17432. // "type": "string"
  17433. // },
  17434. // "archived": {
  17435. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  17436. // "location": "query",
  17437. // "type": "boolean"
  17438. // },
  17439. // "atLeastOneOptimizationActivity": {
  17440. // "description": "Select only campaigns that have at least one optimization activity.",
  17441. // "location": "query",
  17442. // "type": "boolean"
  17443. // },
  17444. // "excludedIds": {
  17445. // "description": "Exclude campaigns with these IDs.",
  17446. // "format": "int64",
  17447. // "location": "query",
  17448. // "repeated": true,
  17449. // "type": "string"
  17450. // },
  17451. // "ids": {
  17452. // "description": "Select only campaigns with these IDs.",
  17453. // "format": "int64",
  17454. // "location": "query",
  17455. // "repeated": true,
  17456. // "type": "string"
  17457. // },
  17458. // "maxResults": {
  17459. // "default": "1000",
  17460. // "description": "Maximum number of results to return.",
  17461. // "format": "int32",
  17462. // "location": "query",
  17463. // "maximum": "1000",
  17464. // "minimum": "0",
  17465. // "type": "integer"
  17466. // },
  17467. // "overriddenEventTagId": {
  17468. // "description": "Select only campaigns that have overridden this event tag ID.",
  17469. // "format": "int64",
  17470. // "location": "query",
  17471. // "type": "string"
  17472. // },
  17473. // "pageToken": {
  17474. // "description": "Value of the nextPageToken from the previous result page.",
  17475. // "location": "query",
  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. // "searchString": {
  17486. // "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\".",
  17487. // "location": "query",
  17488. // "type": "string"
  17489. // },
  17490. // "sortField": {
  17491. // "default": "ID",
  17492. // "description": "Field by which to sort the list.",
  17493. // "enum": [
  17494. // "ID",
  17495. // "NAME"
  17496. // ],
  17497. // "enumDescriptions": [
  17498. // "",
  17499. // ""
  17500. // ],
  17501. // "location": "query",
  17502. // "type": "string"
  17503. // },
  17504. // "sortOrder": {
  17505. // "default": "ASCENDING",
  17506. // "description": "Order of sorted results.",
  17507. // "enum": [
  17508. // "ASCENDING",
  17509. // "DESCENDING"
  17510. // ],
  17511. // "enumDescriptions": [
  17512. // "",
  17513. // ""
  17514. // ],
  17515. // "location": "query",
  17516. // "type": "string"
  17517. // },
  17518. // "subaccountId": {
  17519. // "description": "Select only campaigns that belong to this subaccount.",
  17520. // "format": "int64",
  17521. // "location": "query",
  17522. // "type": "string"
  17523. // }
  17524. // },
  17525. // "path": "userprofiles/{profileId}/campaigns",
  17526. // "response": {
  17527. // "$ref": "CampaignsListResponse"
  17528. // },
  17529. // "scopes": [
  17530. // "https://www.googleapis.com/auth/dfatrafficking"
  17531. // ]
  17532. // }
  17533. }
  17534. // Pages invokes f for each page of results.
  17535. // A non-nil error returned from f will halt the iteration.
  17536. // The provided context supersedes any context provided to the Context method.
  17537. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  17538. c.ctx_ = ctx
  17539. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17540. for {
  17541. x, err := c.Do()
  17542. if err != nil {
  17543. return err
  17544. }
  17545. if err := f(x); err != nil {
  17546. return err
  17547. }
  17548. if x.NextPageToken == "" {
  17549. return nil
  17550. }
  17551. c.PageToken(x.NextPageToken)
  17552. }
  17553. }
  17554. // method id "dfareporting.campaigns.patch":
  17555. type CampaignsPatchCall struct {
  17556. s *Service
  17557. profileId int64
  17558. campaign *Campaign
  17559. urlParams_ gensupport.URLParams
  17560. ctx_ context.Context
  17561. header_ http.Header
  17562. }
  17563. // Patch: Updates an existing campaign. This method supports patch
  17564. // semantics.
  17565. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  17566. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17567. c.profileId = profileId
  17568. c.urlParams_.Set("id", fmt.Sprint(id))
  17569. c.campaign = campaign
  17570. return c
  17571. }
  17572. // Fields allows partial responses to be retrieved. See
  17573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17574. // for more information.
  17575. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  17576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17577. return c
  17578. }
  17579. // Context sets the context to be used in this call's Do method. Any
  17580. // pending HTTP request will be aborted if the provided context is
  17581. // canceled.
  17582. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  17583. c.ctx_ = ctx
  17584. return c
  17585. }
  17586. // Header returns an http.Header that can be modified by the caller to
  17587. // add HTTP headers to the request.
  17588. func (c *CampaignsPatchCall) Header() http.Header {
  17589. if c.header_ == nil {
  17590. c.header_ = make(http.Header)
  17591. }
  17592. return c.header_
  17593. }
  17594. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  17595. reqHeaders := make(http.Header)
  17596. for k, v := range c.header_ {
  17597. reqHeaders[k] = v
  17598. }
  17599. reqHeaders.Set("User-Agent", c.s.userAgent())
  17600. var body io.Reader = nil
  17601. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  17602. if err != nil {
  17603. return nil, err
  17604. }
  17605. reqHeaders.Set("Content-Type", "application/json")
  17606. c.urlParams_.Set("alt", alt)
  17607. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17608. urls += "?" + c.urlParams_.Encode()
  17609. req, _ := http.NewRequest("PATCH", urls, body)
  17610. req.Header = reqHeaders
  17611. googleapi.Expand(req.URL, map[string]string{
  17612. "profileId": strconv.FormatInt(c.profileId, 10),
  17613. })
  17614. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17615. }
  17616. // Do executes the "dfareporting.campaigns.patch" call.
  17617. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  17618. // code is an error. Response headers are in either
  17619. // *Campaign.ServerResponse.Header or (if a response was returned at
  17620. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17621. // to check whether the returned error was because
  17622. // http.StatusNotModified was returned.
  17623. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  17624. gensupport.SetOptions(c.urlParams_, opts...)
  17625. res, err := c.doRequest("json")
  17626. if res != nil && res.StatusCode == http.StatusNotModified {
  17627. if res.Body != nil {
  17628. res.Body.Close()
  17629. }
  17630. return nil, &googleapi.Error{
  17631. Code: res.StatusCode,
  17632. Header: res.Header,
  17633. }
  17634. }
  17635. if err != nil {
  17636. return nil, err
  17637. }
  17638. defer googleapi.CloseBody(res)
  17639. if err := googleapi.CheckResponse(res); err != nil {
  17640. return nil, err
  17641. }
  17642. ret := &Campaign{
  17643. ServerResponse: googleapi.ServerResponse{
  17644. Header: res.Header,
  17645. HTTPStatusCode: res.StatusCode,
  17646. },
  17647. }
  17648. target := &ret
  17649. if err := gensupport.DecodeResponse(target, res); err != nil {
  17650. return nil, err
  17651. }
  17652. return ret, nil
  17653. // {
  17654. // "description": "Updates an existing campaign. This method supports patch semantics.",
  17655. // "httpMethod": "PATCH",
  17656. // "id": "dfareporting.campaigns.patch",
  17657. // "parameterOrder": [
  17658. // "profileId",
  17659. // "id"
  17660. // ],
  17661. // "parameters": {
  17662. // "id": {
  17663. // "description": "Campaign ID.",
  17664. // "format": "int64",
  17665. // "location": "query",
  17666. // "required": true,
  17667. // "type": "string"
  17668. // },
  17669. // "profileId": {
  17670. // "description": "User profile ID associated with this request.",
  17671. // "format": "int64",
  17672. // "location": "path",
  17673. // "required": true,
  17674. // "type": "string"
  17675. // }
  17676. // },
  17677. // "path": "userprofiles/{profileId}/campaigns",
  17678. // "request": {
  17679. // "$ref": "Campaign"
  17680. // },
  17681. // "response": {
  17682. // "$ref": "Campaign"
  17683. // },
  17684. // "scopes": [
  17685. // "https://www.googleapis.com/auth/dfatrafficking"
  17686. // ]
  17687. // }
  17688. }
  17689. // method id "dfareporting.campaigns.update":
  17690. type CampaignsUpdateCall struct {
  17691. s *Service
  17692. profileId int64
  17693. campaign *Campaign
  17694. urlParams_ gensupport.URLParams
  17695. ctx_ context.Context
  17696. header_ http.Header
  17697. }
  17698. // Update: Updates an existing campaign.
  17699. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  17700. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17701. c.profileId = profileId
  17702. c.campaign = campaign
  17703. return c
  17704. }
  17705. // Fields allows partial responses to be retrieved. See
  17706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17707. // for more information.
  17708. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  17709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17710. return c
  17711. }
  17712. // Context sets the context to be used in this call's Do method. Any
  17713. // pending HTTP request will be aborted if the provided context is
  17714. // canceled.
  17715. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  17716. c.ctx_ = ctx
  17717. return c
  17718. }
  17719. // Header returns an http.Header that can be modified by the caller to
  17720. // add HTTP headers to the request.
  17721. func (c *CampaignsUpdateCall) Header() http.Header {
  17722. if c.header_ == nil {
  17723. c.header_ = make(http.Header)
  17724. }
  17725. return c.header_
  17726. }
  17727. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  17728. reqHeaders := make(http.Header)
  17729. for k, v := range c.header_ {
  17730. reqHeaders[k] = v
  17731. }
  17732. reqHeaders.Set("User-Agent", c.s.userAgent())
  17733. var body io.Reader = nil
  17734. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  17735. if err != nil {
  17736. return nil, err
  17737. }
  17738. reqHeaders.Set("Content-Type", "application/json")
  17739. c.urlParams_.Set("alt", alt)
  17740. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17741. urls += "?" + c.urlParams_.Encode()
  17742. req, _ := http.NewRequest("PUT", urls, body)
  17743. req.Header = reqHeaders
  17744. googleapi.Expand(req.URL, map[string]string{
  17745. "profileId": strconv.FormatInt(c.profileId, 10),
  17746. })
  17747. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17748. }
  17749. // Do executes the "dfareporting.campaigns.update" call.
  17750. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  17751. // code is an error. Response headers are in either
  17752. // *Campaign.ServerResponse.Header or (if a response was returned at
  17753. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17754. // to check whether the returned error was because
  17755. // http.StatusNotModified was returned.
  17756. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  17757. gensupport.SetOptions(c.urlParams_, opts...)
  17758. res, err := c.doRequest("json")
  17759. if res != nil && res.StatusCode == http.StatusNotModified {
  17760. if res.Body != nil {
  17761. res.Body.Close()
  17762. }
  17763. return nil, &googleapi.Error{
  17764. Code: res.StatusCode,
  17765. Header: res.Header,
  17766. }
  17767. }
  17768. if err != nil {
  17769. return nil, err
  17770. }
  17771. defer googleapi.CloseBody(res)
  17772. if err := googleapi.CheckResponse(res); err != nil {
  17773. return nil, err
  17774. }
  17775. ret := &Campaign{
  17776. ServerResponse: googleapi.ServerResponse{
  17777. Header: res.Header,
  17778. HTTPStatusCode: res.StatusCode,
  17779. },
  17780. }
  17781. target := &ret
  17782. if err := gensupport.DecodeResponse(target, res); err != nil {
  17783. return nil, err
  17784. }
  17785. return ret, nil
  17786. // {
  17787. // "description": "Updates an existing campaign.",
  17788. // "httpMethod": "PUT",
  17789. // "id": "dfareporting.campaigns.update",
  17790. // "parameterOrder": [
  17791. // "profileId"
  17792. // ],
  17793. // "parameters": {
  17794. // "profileId": {
  17795. // "description": "User profile ID associated with this request.",
  17796. // "format": "int64",
  17797. // "location": "path",
  17798. // "required": true,
  17799. // "type": "string"
  17800. // }
  17801. // },
  17802. // "path": "userprofiles/{profileId}/campaigns",
  17803. // "request": {
  17804. // "$ref": "Campaign"
  17805. // },
  17806. // "response": {
  17807. // "$ref": "Campaign"
  17808. // },
  17809. // "scopes": [
  17810. // "https://www.googleapis.com/auth/dfatrafficking"
  17811. // ]
  17812. // }
  17813. }
  17814. // method id "dfareporting.changeLogs.get":
  17815. type ChangeLogsGetCall struct {
  17816. s *Service
  17817. profileId int64
  17818. id int64
  17819. urlParams_ gensupport.URLParams
  17820. ifNoneMatch_ string
  17821. ctx_ context.Context
  17822. header_ http.Header
  17823. }
  17824. // Get: Gets one change log by ID.
  17825. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  17826. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17827. c.profileId = profileId
  17828. c.id = id
  17829. return c
  17830. }
  17831. // Fields allows partial responses to be retrieved. See
  17832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17833. // for more information.
  17834. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  17835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17836. return c
  17837. }
  17838. // IfNoneMatch sets the optional parameter which makes the operation
  17839. // fail if the object's ETag matches the given value. This is useful for
  17840. // getting updates only after the object has changed since the last
  17841. // request. Use googleapi.IsNotModified to check whether the response
  17842. // error from Do is the result of In-None-Match.
  17843. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  17844. c.ifNoneMatch_ = entityTag
  17845. return c
  17846. }
  17847. // Context sets the context to be used in this call's Do method. Any
  17848. // pending HTTP request will be aborted if the provided context is
  17849. // canceled.
  17850. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  17851. c.ctx_ = ctx
  17852. return c
  17853. }
  17854. // Header returns an http.Header that can be modified by the caller to
  17855. // add HTTP headers to the request.
  17856. func (c *ChangeLogsGetCall) Header() http.Header {
  17857. if c.header_ == nil {
  17858. c.header_ = make(http.Header)
  17859. }
  17860. return c.header_
  17861. }
  17862. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  17863. reqHeaders := make(http.Header)
  17864. for k, v := range c.header_ {
  17865. reqHeaders[k] = v
  17866. }
  17867. reqHeaders.Set("User-Agent", c.s.userAgent())
  17868. if c.ifNoneMatch_ != "" {
  17869. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17870. }
  17871. var body io.Reader = nil
  17872. c.urlParams_.Set("alt", alt)
  17873. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  17874. urls += "?" + c.urlParams_.Encode()
  17875. req, _ := http.NewRequest("GET", urls, body)
  17876. req.Header = reqHeaders
  17877. googleapi.Expand(req.URL, map[string]string{
  17878. "profileId": strconv.FormatInt(c.profileId, 10),
  17879. "id": strconv.FormatInt(c.id, 10),
  17880. })
  17881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17882. }
  17883. // Do executes the "dfareporting.changeLogs.get" call.
  17884. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  17885. // status code is an error. Response headers are in either
  17886. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  17887. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17888. // to check whether the returned error was because
  17889. // http.StatusNotModified was returned.
  17890. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  17891. gensupport.SetOptions(c.urlParams_, opts...)
  17892. res, err := c.doRequest("json")
  17893. if res != nil && res.StatusCode == http.StatusNotModified {
  17894. if res.Body != nil {
  17895. res.Body.Close()
  17896. }
  17897. return nil, &googleapi.Error{
  17898. Code: res.StatusCode,
  17899. Header: res.Header,
  17900. }
  17901. }
  17902. if err != nil {
  17903. return nil, err
  17904. }
  17905. defer googleapi.CloseBody(res)
  17906. if err := googleapi.CheckResponse(res); err != nil {
  17907. return nil, err
  17908. }
  17909. ret := &ChangeLog{
  17910. ServerResponse: googleapi.ServerResponse{
  17911. Header: res.Header,
  17912. HTTPStatusCode: res.StatusCode,
  17913. },
  17914. }
  17915. target := &ret
  17916. if err := gensupport.DecodeResponse(target, res); err != nil {
  17917. return nil, err
  17918. }
  17919. return ret, nil
  17920. // {
  17921. // "description": "Gets one change log by ID.",
  17922. // "httpMethod": "GET",
  17923. // "id": "dfareporting.changeLogs.get",
  17924. // "parameterOrder": [
  17925. // "profileId",
  17926. // "id"
  17927. // ],
  17928. // "parameters": {
  17929. // "id": {
  17930. // "description": "Change log ID.",
  17931. // "format": "int64",
  17932. // "location": "path",
  17933. // "required": true,
  17934. // "type": "string"
  17935. // },
  17936. // "profileId": {
  17937. // "description": "User profile ID associated with this request.",
  17938. // "format": "int64",
  17939. // "location": "path",
  17940. // "required": true,
  17941. // "type": "string"
  17942. // }
  17943. // },
  17944. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  17945. // "response": {
  17946. // "$ref": "ChangeLog"
  17947. // },
  17948. // "scopes": [
  17949. // "https://www.googleapis.com/auth/dfatrafficking"
  17950. // ]
  17951. // }
  17952. }
  17953. // method id "dfareporting.changeLogs.list":
  17954. type ChangeLogsListCall struct {
  17955. s *Service
  17956. profileId int64
  17957. urlParams_ gensupport.URLParams
  17958. ifNoneMatch_ string
  17959. ctx_ context.Context
  17960. header_ http.Header
  17961. }
  17962. // List: Retrieves a list of change logs. This method supports paging.
  17963. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  17964. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17965. c.profileId = profileId
  17966. return c
  17967. }
  17968. // Action sets the optional parameter "action": Select only change logs
  17969. // with the specified action.
  17970. //
  17971. // Possible values:
  17972. // "ACTION_ADD"
  17973. // "ACTION_ASSIGN"
  17974. // "ACTION_ASSOCIATE"
  17975. // "ACTION_CREATE"
  17976. // "ACTION_DELETE"
  17977. // "ACTION_DISABLE"
  17978. // "ACTION_EMAIL_TAGS"
  17979. // "ACTION_ENABLE"
  17980. // "ACTION_LINK"
  17981. // "ACTION_MARK_AS_DEFAULT"
  17982. // "ACTION_PUSH"
  17983. // "ACTION_REMOVE"
  17984. // "ACTION_SEND"
  17985. // "ACTION_SHARE"
  17986. // "ACTION_UNASSIGN"
  17987. // "ACTION_UNLINK"
  17988. // "ACTION_UPDATE"
  17989. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  17990. c.urlParams_.Set("action", action)
  17991. return c
  17992. }
  17993. // Ids sets the optional parameter "ids": Select only change logs with
  17994. // these IDs.
  17995. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  17996. var ids_ []string
  17997. for _, v := range ids {
  17998. ids_ = append(ids_, fmt.Sprint(v))
  17999. }
  18000. c.urlParams_.SetMulti("ids", ids_)
  18001. return c
  18002. }
  18003. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  18004. // only change logs whose change time is before the specified
  18005. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  18006. // string. For example, for 10:54 PM on July 18th, 2015, in the
  18007. // America/New York time zone, the format is
  18008. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  18009. // the letter T, the hour (24-hour clock system), minute, second, and
  18010. // then the time zone offset.
  18011. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  18012. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  18013. return c
  18014. }
  18015. // MaxResults sets the optional parameter "maxResults": Maximum number
  18016. // of results to return.
  18017. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  18018. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18019. return c
  18020. }
  18021. // MinChangeTime sets the optional parameter "minChangeTime": Select
  18022. // only change logs whose change time is before the specified
  18023. // minChangeTime.The time should be formatted as an RFC3339 date/time
  18024. // string. For example, for 10:54 PM on July 18th, 2015, in the
  18025. // America/New York time zone, the format is
  18026. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  18027. // the letter T, the hour (24-hour clock system), minute, second, and
  18028. // then the time zone offset.
  18029. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  18030. c.urlParams_.Set("minChangeTime", minChangeTime)
  18031. return c
  18032. }
  18033. // ObjectIds sets the optional parameter "objectIds": Select only change
  18034. // logs with these object IDs.
  18035. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  18036. var objectIds_ []string
  18037. for _, v := range objectIds {
  18038. objectIds_ = append(objectIds_, fmt.Sprint(v))
  18039. }
  18040. c.urlParams_.SetMulti("objectIds", objectIds_)
  18041. return c
  18042. }
  18043. // ObjectType sets the optional parameter "objectType": Select only
  18044. // change logs with the specified object type.
  18045. //
  18046. // Possible values:
  18047. // "OBJECT_ACCOUNT"
  18048. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  18049. // "OBJECT_AD"
  18050. // "OBJECT_ADVERTISER"
  18051. // "OBJECT_ADVERTISER_GROUP"
  18052. // "OBJECT_BILLING_ACCOUNT_GROUP"
  18053. // "OBJECT_BILLING_FEATURE"
  18054. // "OBJECT_BILLING_MINIMUM_FEE"
  18055. // "OBJECT_BILLING_PROFILE"
  18056. // "OBJECT_CAMPAIGN"
  18057. // "OBJECT_CONTENT_CATEGORY"
  18058. // "OBJECT_CREATIVE"
  18059. // "OBJECT_CREATIVE_ASSET"
  18060. // "OBJECT_CREATIVE_BUNDLE"
  18061. // "OBJECT_CREATIVE_FIELD"
  18062. // "OBJECT_CREATIVE_GROUP"
  18063. // "OBJECT_DFA_SITE"
  18064. // "OBJECT_EVENT_TAG"
  18065. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  18066. // "OBJECT_FLOODLIGHT_ACTVITY"
  18067. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  18068. // "OBJECT_INSTREAM_CREATIVE"
  18069. // "OBJECT_LANDING_PAGE"
  18070. // "OBJECT_MEDIA_ORDER"
  18071. // "OBJECT_PLACEMENT"
  18072. // "OBJECT_PLACEMENT_STRATEGY"
  18073. // "OBJECT_PLAYSTORE_LINK"
  18074. // "OBJECT_PROVIDED_LIST_CLIENT"
  18075. // "OBJECT_RATE_CARD"
  18076. // "OBJECT_REMARKETING_LIST"
  18077. // "OBJECT_RICHMEDIA_CREATIVE"
  18078. // "OBJECT_SD_SITE"
  18079. // "OBJECT_SEARCH_LIFT_STUDY"
  18080. // "OBJECT_SIZE"
  18081. // "OBJECT_SUBACCOUNT"
  18082. // "OBJECT_TARGETING_TEMPLATE"
  18083. // "OBJECT_USER_PROFILE"
  18084. // "OBJECT_USER_PROFILE_FILTER"
  18085. // "OBJECT_USER_ROLE"
  18086. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  18087. c.urlParams_.Set("objectType", objectType)
  18088. return c
  18089. }
  18090. // PageToken sets the optional parameter "pageToken": Value of the
  18091. // nextPageToken from the previous result page.
  18092. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  18093. c.urlParams_.Set("pageToken", pageToken)
  18094. return c
  18095. }
  18096. // SearchString sets the optional parameter "searchString": Select only
  18097. // change logs whose object ID, user name, old or new values match the
  18098. // search string.
  18099. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  18100. c.urlParams_.Set("searchString", searchString)
  18101. return c
  18102. }
  18103. // UserProfileIds sets the optional parameter "userProfileIds": Select
  18104. // only change logs with these user profile IDs.
  18105. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  18106. var userProfileIds_ []string
  18107. for _, v := range userProfileIds {
  18108. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  18109. }
  18110. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  18111. return c
  18112. }
  18113. // Fields allows partial responses to be retrieved. See
  18114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18115. // for more information.
  18116. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  18117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18118. return c
  18119. }
  18120. // IfNoneMatch sets the optional parameter which makes the operation
  18121. // fail if the object's ETag matches the given value. This is useful for
  18122. // getting updates only after the object has changed since the last
  18123. // request. Use googleapi.IsNotModified to check whether the response
  18124. // error from Do is the result of In-None-Match.
  18125. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  18126. c.ifNoneMatch_ = entityTag
  18127. return c
  18128. }
  18129. // Context sets the context to be used in this call's Do method. Any
  18130. // pending HTTP request will be aborted if the provided context is
  18131. // canceled.
  18132. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  18133. c.ctx_ = ctx
  18134. return c
  18135. }
  18136. // Header returns an http.Header that can be modified by the caller to
  18137. // add HTTP headers to the request.
  18138. func (c *ChangeLogsListCall) Header() http.Header {
  18139. if c.header_ == nil {
  18140. c.header_ = make(http.Header)
  18141. }
  18142. return c.header_
  18143. }
  18144. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  18145. reqHeaders := make(http.Header)
  18146. for k, v := range c.header_ {
  18147. reqHeaders[k] = v
  18148. }
  18149. reqHeaders.Set("User-Agent", c.s.userAgent())
  18150. if c.ifNoneMatch_ != "" {
  18151. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18152. }
  18153. var body io.Reader = nil
  18154. c.urlParams_.Set("alt", alt)
  18155. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  18156. urls += "?" + c.urlParams_.Encode()
  18157. req, _ := http.NewRequest("GET", urls, body)
  18158. req.Header = reqHeaders
  18159. googleapi.Expand(req.URL, map[string]string{
  18160. "profileId": strconv.FormatInt(c.profileId, 10),
  18161. })
  18162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18163. }
  18164. // Do executes the "dfareporting.changeLogs.list" call.
  18165. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  18166. // non-2xx status code is an error. Response headers are in either
  18167. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  18168. // returned at all) in error.(*googleapi.Error).Header. Use
  18169. // googleapi.IsNotModified to check whether the returned error was
  18170. // because http.StatusNotModified was returned.
  18171. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  18172. gensupport.SetOptions(c.urlParams_, opts...)
  18173. res, err := c.doRequest("json")
  18174. if res != nil && res.StatusCode == http.StatusNotModified {
  18175. if res.Body != nil {
  18176. res.Body.Close()
  18177. }
  18178. return nil, &googleapi.Error{
  18179. Code: res.StatusCode,
  18180. Header: res.Header,
  18181. }
  18182. }
  18183. if err != nil {
  18184. return nil, err
  18185. }
  18186. defer googleapi.CloseBody(res)
  18187. if err := googleapi.CheckResponse(res); err != nil {
  18188. return nil, err
  18189. }
  18190. ret := &ChangeLogsListResponse{
  18191. ServerResponse: googleapi.ServerResponse{
  18192. Header: res.Header,
  18193. HTTPStatusCode: res.StatusCode,
  18194. },
  18195. }
  18196. target := &ret
  18197. if err := gensupport.DecodeResponse(target, res); err != nil {
  18198. return nil, err
  18199. }
  18200. return ret, nil
  18201. // {
  18202. // "description": "Retrieves a list of change logs. This method supports paging.",
  18203. // "httpMethod": "GET",
  18204. // "id": "dfareporting.changeLogs.list",
  18205. // "parameterOrder": [
  18206. // "profileId"
  18207. // ],
  18208. // "parameters": {
  18209. // "action": {
  18210. // "description": "Select only change logs with the specified action.",
  18211. // "enum": [
  18212. // "ACTION_ADD",
  18213. // "ACTION_ASSIGN",
  18214. // "ACTION_ASSOCIATE",
  18215. // "ACTION_CREATE",
  18216. // "ACTION_DELETE",
  18217. // "ACTION_DISABLE",
  18218. // "ACTION_EMAIL_TAGS",
  18219. // "ACTION_ENABLE",
  18220. // "ACTION_LINK",
  18221. // "ACTION_MARK_AS_DEFAULT",
  18222. // "ACTION_PUSH",
  18223. // "ACTION_REMOVE",
  18224. // "ACTION_SEND",
  18225. // "ACTION_SHARE",
  18226. // "ACTION_UNASSIGN",
  18227. // "ACTION_UNLINK",
  18228. // "ACTION_UPDATE"
  18229. // ],
  18230. // "enumDescriptions": [
  18231. // "",
  18232. // "",
  18233. // "",
  18234. // "",
  18235. // "",
  18236. // "",
  18237. // "",
  18238. // "",
  18239. // "",
  18240. // "",
  18241. // "",
  18242. // "",
  18243. // "",
  18244. // "",
  18245. // "",
  18246. // "",
  18247. // ""
  18248. // ],
  18249. // "location": "query",
  18250. // "type": "string"
  18251. // },
  18252. // "ids": {
  18253. // "description": "Select only change logs with these IDs.",
  18254. // "format": "int64",
  18255. // "location": "query",
  18256. // "repeated": true,
  18257. // "type": "string"
  18258. // },
  18259. // "maxChangeTime": {
  18260. // "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.",
  18261. // "location": "query",
  18262. // "type": "string"
  18263. // },
  18264. // "maxResults": {
  18265. // "default": "1000",
  18266. // "description": "Maximum number of results to return.",
  18267. // "format": "int32",
  18268. // "location": "query",
  18269. // "maximum": "1000",
  18270. // "minimum": "0",
  18271. // "type": "integer"
  18272. // },
  18273. // "minChangeTime": {
  18274. // "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.",
  18275. // "location": "query",
  18276. // "type": "string"
  18277. // },
  18278. // "objectIds": {
  18279. // "description": "Select only change logs with these object IDs.",
  18280. // "format": "int64",
  18281. // "location": "query",
  18282. // "repeated": true,
  18283. // "type": "string"
  18284. // },
  18285. // "objectType": {
  18286. // "description": "Select only change logs with the specified object type.",
  18287. // "enum": [
  18288. // "OBJECT_ACCOUNT",
  18289. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  18290. // "OBJECT_AD",
  18291. // "OBJECT_ADVERTISER",
  18292. // "OBJECT_ADVERTISER_GROUP",
  18293. // "OBJECT_BILLING_ACCOUNT_GROUP",
  18294. // "OBJECT_BILLING_FEATURE",
  18295. // "OBJECT_BILLING_MINIMUM_FEE",
  18296. // "OBJECT_BILLING_PROFILE",
  18297. // "OBJECT_CAMPAIGN",
  18298. // "OBJECT_CONTENT_CATEGORY",
  18299. // "OBJECT_CREATIVE",
  18300. // "OBJECT_CREATIVE_ASSET",
  18301. // "OBJECT_CREATIVE_BUNDLE",
  18302. // "OBJECT_CREATIVE_FIELD",
  18303. // "OBJECT_CREATIVE_GROUP",
  18304. // "OBJECT_DFA_SITE",
  18305. // "OBJECT_EVENT_TAG",
  18306. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  18307. // "OBJECT_FLOODLIGHT_ACTVITY",
  18308. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  18309. // "OBJECT_INSTREAM_CREATIVE",
  18310. // "OBJECT_LANDING_PAGE",
  18311. // "OBJECT_MEDIA_ORDER",
  18312. // "OBJECT_PLACEMENT",
  18313. // "OBJECT_PLACEMENT_STRATEGY",
  18314. // "OBJECT_PLAYSTORE_LINK",
  18315. // "OBJECT_PROVIDED_LIST_CLIENT",
  18316. // "OBJECT_RATE_CARD",
  18317. // "OBJECT_REMARKETING_LIST",
  18318. // "OBJECT_RICHMEDIA_CREATIVE",
  18319. // "OBJECT_SD_SITE",
  18320. // "OBJECT_SEARCH_LIFT_STUDY",
  18321. // "OBJECT_SIZE",
  18322. // "OBJECT_SUBACCOUNT",
  18323. // "OBJECT_TARGETING_TEMPLATE",
  18324. // "OBJECT_USER_PROFILE",
  18325. // "OBJECT_USER_PROFILE_FILTER",
  18326. // "OBJECT_USER_ROLE"
  18327. // ],
  18328. // "enumDescriptions": [
  18329. // "",
  18330. // "",
  18331. // "",
  18332. // "",
  18333. // "",
  18334. // "",
  18335. // "",
  18336. // "",
  18337. // "",
  18338. // "",
  18339. // "",
  18340. // "",
  18341. // "",
  18342. // "",
  18343. // "",
  18344. // "",
  18345. // "",
  18346. // "",
  18347. // "",
  18348. // "",
  18349. // "",
  18350. // "",
  18351. // "",
  18352. // "",
  18353. // "",
  18354. // "",
  18355. // "",
  18356. // "",
  18357. // "",
  18358. // "",
  18359. // "",
  18360. // "",
  18361. // "",
  18362. // "",
  18363. // "",
  18364. // "",
  18365. // "",
  18366. // "",
  18367. // ""
  18368. // ],
  18369. // "location": "query",
  18370. // "type": "string"
  18371. // },
  18372. // "pageToken": {
  18373. // "description": "Value of the nextPageToken from the previous result page.",
  18374. // "location": "query",
  18375. // "type": "string"
  18376. // },
  18377. // "profileId": {
  18378. // "description": "User profile ID associated with this request.",
  18379. // "format": "int64",
  18380. // "location": "path",
  18381. // "required": true,
  18382. // "type": "string"
  18383. // },
  18384. // "searchString": {
  18385. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  18386. // "location": "query",
  18387. // "type": "string"
  18388. // },
  18389. // "userProfileIds": {
  18390. // "description": "Select only change logs with these user profile IDs.",
  18391. // "format": "int64",
  18392. // "location": "query",
  18393. // "repeated": true,
  18394. // "type": "string"
  18395. // }
  18396. // },
  18397. // "path": "userprofiles/{profileId}/changeLogs",
  18398. // "response": {
  18399. // "$ref": "ChangeLogsListResponse"
  18400. // },
  18401. // "scopes": [
  18402. // "https://www.googleapis.com/auth/dfatrafficking"
  18403. // ]
  18404. // }
  18405. }
  18406. // Pages invokes f for each page of results.
  18407. // A non-nil error returned from f will halt the iteration.
  18408. // The provided context supersedes any context provided to the Context method.
  18409. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  18410. c.ctx_ = ctx
  18411. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18412. for {
  18413. x, err := c.Do()
  18414. if err != nil {
  18415. return err
  18416. }
  18417. if err := f(x); err != nil {
  18418. return err
  18419. }
  18420. if x.NextPageToken == "" {
  18421. return nil
  18422. }
  18423. c.PageToken(x.NextPageToken)
  18424. }
  18425. }
  18426. // method id "dfareporting.cities.list":
  18427. type CitiesListCall struct {
  18428. s *Service
  18429. profileId int64
  18430. urlParams_ gensupport.URLParams
  18431. ifNoneMatch_ string
  18432. ctx_ context.Context
  18433. header_ http.Header
  18434. }
  18435. // List: Retrieves a list of cities, possibly filtered.
  18436. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  18437. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18438. c.profileId = profileId
  18439. return c
  18440. }
  18441. // CountryDartIds sets the optional parameter "countryDartIds": Select
  18442. // only cities from these countries.
  18443. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  18444. var countryDartIds_ []string
  18445. for _, v := range countryDartIds {
  18446. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  18447. }
  18448. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  18449. return c
  18450. }
  18451. // DartIds sets the optional parameter "dartIds": Select only cities
  18452. // with these DART IDs.
  18453. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  18454. var dartIds_ []string
  18455. for _, v := range dartIds {
  18456. dartIds_ = append(dartIds_, fmt.Sprint(v))
  18457. }
  18458. c.urlParams_.SetMulti("dartIds", dartIds_)
  18459. return c
  18460. }
  18461. // NamePrefix sets the optional parameter "namePrefix": Select only
  18462. // cities with names starting with this prefix.
  18463. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  18464. c.urlParams_.Set("namePrefix", namePrefix)
  18465. return c
  18466. }
  18467. // RegionDartIds sets the optional parameter "regionDartIds": Select
  18468. // only cities from these regions.
  18469. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  18470. var regionDartIds_ []string
  18471. for _, v := range regionDartIds {
  18472. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  18473. }
  18474. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  18475. return c
  18476. }
  18477. // Fields allows partial responses to be retrieved. See
  18478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18479. // for more information.
  18480. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  18481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18482. return c
  18483. }
  18484. // IfNoneMatch sets the optional parameter which makes the operation
  18485. // fail if the object's ETag matches the given value. This is useful for
  18486. // getting updates only after the object has changed since the last
  18487. // request. Use googleapi.IsNotModified to check whether the response
  18488. // error from Do is the result of In-None-Match.
  18489. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  18490. c.ifNoneMatch_ = entityTag
  18491. return c
  18492. }
  18493. // Context sets the context to be used in this call's Do method. Any
  18494. // pending HTTP request will be aborted if the provided context is
  18495. // canceled.
  18496. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  18497. c.ctx_ = ctx
  18498. return c
  18499. }
  18500. // Header returns an http.Header that can be modified by the caller to
  18501. // add HTTP headers to the request.
  18502. func (c *CitiesListCall) Header() http.Header {
  18503. if c.header_ == nil {
  18504. c.header_ = make(http.Header)
  18505. }
  18506. return c.header_
  18507. }
  18508. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  18509. reqHeaders := make(http.Header)
  18510. for k, v := range c.header_ {
  18511. reqHeaders[k] = v
  18512. }
  18513. reqHeaders.Set("User-Agent", c.s.userAgent())
  18514. if c.ifNoneMatch_ != "" {
  18515. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18516. }
  18517. var body io.Reader = nil
  18518. c.urlParams_.Set("alt", alt)
  18519. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  18520. urls += "?" + c.urlParams_.Encode()
  18521. req, _ := http.NewRequest("GET", urls, body)
  18522. req.Header = reqHeaders
  18523. googleapi.Expand(req.URL, map[string]string{
  18524. "profileId": strconv.FormatInt(c.profileId, 10),
  18525. })
  18526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18527. }
  18528. // Do executes the "dfareporting.cities.list" call.
  18529. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  18530. // non-2xx status code is an error. Response headers are in either
  18531. // *CitiesListResponse.ServerResponse.Header or (if a response was
  18532. // returned at all) in error.(*googleapi.Error).Header. Use
  18533. // googleapi.IsNotModified to check whether the returned error was
  18534. // because http.StatusNotModified was returned.
  18535. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  18536. gensupport.SetOptions(c.urlParams_, opts...)
  18537. res, err := c.doRequest("json")
  18538. if res != nil && res.StatusCode == http.StatusNotModified {
  18539. if res.Body != nil {
  18540. res.Body.Close()
  18541. }
  18542. return nil, &googleapi.Error{
  18543. Code: res.StatusCode,
  18544. Header: res.Header,
  18545. }
  18546. }
  18547. if err != nil {
  18548. return nil, err
  18549. }
  18550. defer googleapi.CloseBody(res)
  18551. if err := googleapi.CheckResponse(res); err != nil {
  18552. return nil, err
  18553. }
  18554. ret := &CitiesListResponse{
  18555. ServerResponse: googleapi.ServerResponse{
  18556. Header: res.Header,
  18557. HTTPStatusCode: res.StatusCode,
  18558. },
  18559. }
  18560. target := &ret
  18561. if err := gensupport.DecodeResponse(target, res); err != nil {
  18562. return nil, err
  18563. }
  18564. return ret, nil
  18565. // {
  18566. // "description": "Retrieves a list of cities, possibly filtered.",
  18567. // "httpMethod": "GET",
  18568. // "id": "dfareporting.cities.list",
  18569. // "parameterOrder": [
  18570. // "profileId"
  18571. // ],
  18572. // "parameters": {
  18573. // "countryDartIds": {
  18574. // "description": "Select only cities from these countries.",
  18575. // "format": "int64",
  18576. // "location": "query",
  18577. // "repeated": true,
  18578. // "type": "string"
  18579. // },
  18580. // "dartIds": {
  18581. // "description": "Select only cities with these DART IDs.",
  18582. // "format": "int64",
  18583. // "location": "query",
  18584. // "repeated": true,
  18585. // "type": "string"
  18586. // },
  18587. // "namePrefix": {
  18588. // "description": "Select only cities with names starting with this prefix.",
  18589. // "location": "query",
  18590. // "type": "string"
  18591. // },
  18592. // "profileId": {
  18593. // "description": "User profile ID associated with this request.",
  18594. // "format": "int64",
  18595. // "location": "path",
  18596. // "required": true,
  18597. // "type": "string"
  18598. // },
  18599. // "regionDartIds": {
  18600. // "description": "Select only cities from these regions.",
  18601. // "format": "int64",
  18602. // "location": "query",
  18603. // "repeated": true,
  18604. // "type": "string"
  18605. // }
  18606. // },
  18607. // "path": "userprofiles/{profileId}/cities",
  18608. // "response": {
  18609. // "$ref": "CitiesListResponse"
  18610. // },
  18611. // "scopes": [
  18612. // "https://www.googleapis.com/auth/dfatrafficking"
  18613. // ]
  18614. // }
  18615. }
  18616. // method id "dfareporting.connectionTypes.get":
  18617. type ConnectionTypesGetCall struct {
  18618. s *Service
  18619. profileId int64
  18620. id int64
  18621. urlParams_ gensupport.URLParams
  18622. ifNoneMatch_ string
  18623. ctx_ context.Context
  18624. header_ http.Header
  18625. }
  18626. // Get: Gets one connection type by ID.
  18627. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  18628. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18629. c.profileId = profileId
  18630. c.id = id
  18631. return c
  18632. }
  18633. // Fields allows partial responses to be retrieved. See
  18634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18635. // for more information.
  18636. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  18637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18638. return c
  18639. }
  18640. // IfNoneMatch sets the optional parameter which makes the operation
  18641. // fail if the object's ETag matches the given value. This is useful for
  18642. // getting updates only after the object has changed since the last
  18643. // request. Use googleapi.IsNotModified to check whether the response
  18644. // error from Do is the result of In-None-Match.
  18645. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  18646. c.ifNoneMatch_ = entityTag
  18647. return c
  18648. }
  18649. // Context sets the context to be used in this call's Do method. Any
  18650. // pending HTTP request will be aborted if the provided context is
  18651. // canceled.
  18652. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  18653. c.ctx_ = ctx
  18654. return c
  18655. }
  18656. // Header returns an http.Header that can be modified by the caller to
  18657. // add HTTP headers to the request.
  18658. func (c *ConnectionTypesGetCall) Header() http.Header {
  18659. if c.header_ == nil {
  18660. c.header_ = make(http.Header)
  18661. }
  18662. return c.header_
  18663. }
  18664. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  18665. reqHeaders := make(http.Header)
  18666. for k, v := range c.header_ {
  18667. reqHeaders[k] = v
  18668. }
  18669. reqHeaders.Set("User-Agent", c.s.userAgent())
  18670. if c.ifNoneMatch_ != "" {
  18671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18672. }
  18673. var body io.Reader = nil
  18674. c.urlParams_.Set("alt", alt)
  18675. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  18676. urls += "?" + c.urlParams_.Encode()
  18677. req, _ := http.NewRequest("GET", urls, body)
  18678. req.Header = reqHeaders
  18679. googleapi.Expand(req.URL, map[string]string{
  18680. "profileId": strconv.FormatInt(c.profileId, 10),
  18681. "id": strconv.FormatInt(c.id, 10),
  18682. })
  18683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18684. }
  18685. // Do executes the "dfareporting.connectionTypes.get" call.
  18686. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  18687. // status code is an error. Response headers are in either
  18688. // *ConnectionType.ServerResponse.Header or (if a response was returned
  18689. // at all) in error.(*googleapi.Error).Header. Use
  18690. // googleapi.IsNotModified to check whether the returned error was
  18691. // because http.StatusNotModified was returned.
  18692. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  18693. gensupport.SetOptions(c.urlParams_, opts...)
  18694. res, err := c.doRequest("json")
  18695. if res != nil && res.StatusCode == http.StatusNotModified {
  18696. if res.Body != nil {
  18697. res.Body.Close()
  18698. }
  18699. return nil, &googleapi.Error{
  18700. Code: res.StatusCode,
  18701. Header: res.Header,
  18702. }
  18703. }
  18704. if err != nil {
  18705. return nil, err
  18706. }
  18707. defer googleapi.CloseBody(res)
  18708. if err := googleapi.CheckResponse(res); err != nil {
  18709. return nil, err
  18710. }
  18711. ret := &ConnectionType{
  18712. ServerResponse: googleapi.ServerResponse{
  18713. Header: res.Header,
  18714. HTTPStatusCode: res.StatusCode,
  18715. },
  18716. }
  18717. target := &ret
  18718. if err := gensupport.DecodeResponse(target, res); err != nil {
  18719. return nil, err
  18720. }
  18721. return ret, nil
  18722. // {
  18723. // "description": "Gets one connection type by ID.",
  18724. // "httpMethod": "GET",
  18725. // "id": "dfareporting.connectionTypes.get",
  18726. // "parameterOrder": [
  18727. // "profileId",
  18728. // "id"
  18729. // ],
  18730. // "parameters": {
  18731. // "id": {
  18732. // "description": "Connection type ID.",
  18733. // "format": "int64",
  18734. // "location": "path",
  18735. // "required": true,
  18736. // "type": "string"
  18737. // },
  18738. // "profileId": {
  18739. // "description": "User profile ID associated with this request.",
  18740. // "format": "int64",
  18741. // "location": "path",
  18742. // "required": true,
  18743. // "type": "string"
  18744. // }
  18745. // },
  18746. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  18747. // "response": {
  18748. // "$ref": "ConnectionType"
  18749. // },
  18750. // "scopes": [
  18751. // "https://www.googleapis.com/auth/dfatrafficking"
  18752. // ]
  18753. // }
  18754. }
  18755. // method id "dfareporting.connectionTypes.list":
  18756. type ConnectionTypesListCall struct {
  18757. s *Service
  18758. profileId int64
  18759. urlParams_ gensupport.URLParams
  18760. ifNoneMatch_ string
  18761. ctx_ context.Context
  18762. header_ http.Header
  18763. }
  18764. // List: Retrieves a list of connection types.
  18765. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  18766. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18767. c.profileId = profileId
  18768. return c
  18769. }
  18770. // Fields allows partial responses to be retrieved. See
  18771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18772. // for more information.
  18773. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  18774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18775. return c
  18776. }
  18777. // IfNoneMatch sets the optional parameter which makes the operation
  18778. // fail if the object's ETag matches the given value. This is useful for
  18779. // getting updates only after the object has changed since the last
  18780. // request. Use googleapi.IsNotModified to check whether the response
  18781. // error from Do is the result of In-None-Match.
  18782. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  18783. c.ifNoneMatch_ = entityTag
  18784. return c
  18785. }
  18786. // Context sets the context to be used in this call's Do method. Any
  18787. // pending HTTP request will be aborted if the provided context is
  18788. // canceled.
  18789. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  18790. c.ctx_ = ctx
  18791. return c
  18792. }
  18793. // Header returns an http.Header that can be modified by the caller to
  18794. // add HTTP headers to the request.
  18795. func (c *ConnectionTypesListCall) Header() http.Header {
  18796. if c.header_ == nil {
  18797. c.header_ = make(http.Header)
  18798. }
  18799. return c.header_
  18800. }
  18801. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  18802. reqHeaders := make(http.Header)
  18803. for k, v := range c.header_ {
  18804. reqHeaders[k] = v
  18805. }
  18806. reqHeaders.Set("User-Agent", c.s.userAgent())
  18807. if c.ifNoneMatch_ != "" {
  18808. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18809. }
  18810. var body io.Reader = nil
  18811. c.urlParams_.Set("alt", alt)
  18812. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  18813. urls += "?" + c.urlParams_.Encode()
  18814. req, _ := http.NewRequest("GET", urls, body)
  18815. req.Header = reqHeaders
  18816. googleapi.Expand(req.URL, map[string]string{
  18817. "profileId": strconv.FormatInt(c.profileId, 10),
  18818. })
  18819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18820. }
  18821. // Do executes the "dfareporting.connectionTypes.list" call.
  18822. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  18823. // Any non-2xx status code is an error. Response headers are in either
  18824. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  18825. // was returned at all) in error.(*googleapi.Error).Header. Use
  18826. // googleapi.IsNotModified to check whether the returned error was
  18827. // because http.StatusNotModified was returned.
  18828. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  18829. gensupport.SetOptions(c.urlParams_, opts...)
  18830. res, err := c.doRequest("json")
  18831. if res != nil && res.StatusCode == http.StatusNotModified {
  18832. if res.Body != nil {
  18833. res.Body.Close()
  18834. }
  18835. return nil, &googleapi.Error{
  18836. Code: res.StatusCode,
  18837. Header: res.Header,
  18838. }
  18839. }
  18840. if err != nil {
  18841. return nil, err
  18842. }
  18843. defer googleapi.CloseBody(res)
  18844. if err := googleapi.CheckResponse(res); err != nil {
  18845. return nil, err
  18846. }
  18847. ret := &ConnectionTypesListResponse{
  18848. ServerResponse: googleapi.ServerResponse{
  18849. Header: res.Header,
  18850. HTTPStatusCode: res.StatusCode,
  18851. },
  18852. }
  18853. target := &ret
  18854. if err := gensupport.DecodeResponse(target, res); err != nil {
  18855. return nil, err
  18856. }
  18857. return ret, nil
  18858. // {
  18859. // "description": "Retrieves a list of connection types.",
  18860. // "httpMethod": "GET",
  18861. // "id": "dfareporting.connectionTypes.list",
  18862. // "parameterOrder": [
  18863. // "profileId"
  18864. // ],
  18865. // "parameters": {
  18866. // "profileId": {
  18867. // "description": "User profile ID associated with this request.",
  18868. // "format": "int64",
  18869. // "location": "path",
  18870. // "required": true,
  18871. // "type": "string"
  18872. // }
  18873. // },
  18874. // "path": "userprofiles/{profileId}/connectionTypes",
  18875. // "response": {
  18876. // "$ref": "ConnectionTypesListResponse"
  18877. // },
  18878. // "scopes": [
  18879. // "https://www.googleapis.com/auth/dfatrafficking"
  18880. // ]
  18881. // }
  18882. }
  18883. // method id "dfareporting.contentCategories.delete":
  18884. type ContentCategoriesDeleteCall struct {
  18885. s *Service
  18886. profileId int64
  18887. id int64
  18888. urlParams_ gensupport.URLParams
  18889. ctx_ context.Context
  18890. header_ http.Header
  18891. }
  18892. // Delete: Deletes an existing content category.
  18893. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  18894. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18895. c.profileId = profileId
  18896. c.id = id
  18897. return c
  18898. }
  18899. // Fields allows partial responses to be retrieved. See
  18900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18901. // for more information.
  18902. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  18903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18904. return c
  18905. }
  18906. // Context sets the context to be used in this call's Do method. Any
  18907. // pending HTTP request will be aborted if the provided context is
  18908. // canceled.
  18909. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  18910. c.ctx_ = ctx
  18911. return c
  18912. }
  18913. // Header returns an http.Header that can be modified by the caller to
  18914. // add HTTP headers to the request.
  18915. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  18916. if c.header_ == nil {
  18917. c.header_ = make(http.Header)
  18918. }
  18919. return c.header_
  18920. }
  18921. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  18922. reqHeaders := make(http.Header)
  18923. for k, v := range c.header_ {
  18924. reqHeaders[k] = v
  18925. }
  18926. reqHeaders.Set("User-Agent", c.s.userAgent())
  18927. var body io.Reader = nil
  18928. c.urlParams_.Set("alt", alt)
  18929. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  18930. urls += "?" + c.urlParams_.Encode()
  18931. req, _ := http.NewRequest("DELETE", urls, body)
  18932. req.Header = reqHeaders
  18933. googleapi.Expand(req.URL, map[string]string{
  18934. "profileId": strconv.FormatInt(c.profileId, 10),
  18935. "id": strconv.FormatInt(c.id, 10),
  18936. })
  18937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18938. }
  18939. // Do executes the "dfareporting.contentCategories.delete" call.
  18940. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  18941. gensupport.SetOptions(c.urlParams_, opts...)
  18942. res, err := c.doRequest("json")
  18943. if err != nil {
  18944. return err
  18945. }
  18946. defer googleapi.CloseBody(res)
  18947. if err := googleapi.CheckResponse(res); err != nil {
  18948. return err
  18949. }
  18950. return nil
  18951. // {
  18952. // "description": "Deletes an existing content category.",
  18953. // "httpMethod": "DELETE",
  18954. // "id": "dfareporting.contentCategories.delete",
  18955. // "parameterOrder": [
  18956. // "profileId",
  18957. // "id"
  18958. // ],
  18959. // "parameters": {
  18960. // "id": {
  18961. // "description": "Content category ID.",
  18962. // "format": "int64",
  18963. // "location": "path",
  18964. // "required": true,
  18965. // "type": "string"
  18966. // },
  18967. // "profileId": {
  18968. // "description": "User profile ID associated with this request.",
  18969. // "format": "int64",
  18970. // "location": "path",
  18971. // "required": true,
  18972. // "type": "string"
  18973. // }
  18974. // },
  18975. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  18976. // "scopes": [
  18977. // "https://www.googleapis.com/auth/dfatrafficking"
  18978. // ]
  18979. // }
  18980. }
  18981. // method id "dfareporting.contentCategories.get":
  18982. type ContentCategoriesGetCall struct {
  18983. s *Service
  18984. profileId int64
  18985. id int64
  18986. urlParams_ gensupport.URLParams
  18987. ifNoneMatch_ string
  18988. ctx_ context.Context
  18989. header_ http.Header
  18990. }
  18991. // Get: Gets one content category by ID.
  18992. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  18993. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18994. c.profileId = profileId
  18995. c.id = id
  18996. return c
  18997. }
  18998. // Fields allows partial responses to be retrieved. See
  18999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19000. // for more information.
  19001. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  19002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19003. return c
  19004. }
  19005. // IfNoneMatch sets the optional parameter which makes the operation
  19006. // fail if the object's ETag matches the given value. This is useful for
  19007. // getting updates only after the object has changed since the last
  19008. // request. Use googleapi.IsNotModified to check whether the response
  19009. // error from Do is the result of In-None-Match.
  19010. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  19011. c.ifNoneMatch_ = entityTag
  19012. return c
  19013. }
  19014. // Context sets the context to be used in this call's Do method. Any
  19015. // pending HTTP request will be aborted if the provided context is
  19016. // canceled.
  19017. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  19018. c.ctx_ = ctx
  19019. return c
  19020. }
  19021. // Header returns an http.Header that can be modified by the caller to
  19022. // add HTTP headers to the request.
  19023. func (c *ContentCategoriesGetCall) Header() http.Header {
  19024. if c.header_ == nil {
  19025. c.header_ = make(http.Header)
  19026. }
  19027. return c.header_
  19028. }
  19029. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  19030. reqHeaders := make(http.Header)
  19031. for k, v := range c.header_ {
  19032. reqHeaders[k] = v
  19033. }
  19034. reqHeaders.Set("User-Agent", c.s.userAgent())
  19035. if c.ifNoneMatch_ != "" {
  19036. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19037. }
  19038. var body io.Reader = nil
  19039. c.urlParams_.Set("alt", alt)
  19040. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  19041. urls += "?" + c.urlParams_.Encode()
  19042. req, _ := http.NewRequest("GET", urls, body)
  19043. req.Header = reqHeaders
  19044. googleapi.Expand(req.URL, map[string]string{
  19045. "profileId": strconv.FormatInt(c.profileId, 10),
  19046. "id": strconv.FormatInt(c.id, 10),
  19047. })
  19048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19049. }
  19050. // Do executes the "dfareporting.contentCategories.get" call.
  19051. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19052. // status code is an error. Response headers are in either
  19053. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19054. // at all) in error.(*googleapi.Error).Header. Use
  19055. // googleapi.IsNotModified to check whether the returned error was
  19056. // because http.StatusNotModified was returned.
  19057. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19058. gensupport.SetOptions(c.urlParams_, opts...)
  19059. res, err := c.doRequest("json")
  19060. if res != nil && res.StatusCode == http.StatusNotModified {
  19061. if res.Body != nil {
  19062. res.Body.Close()
  19063. }
  19064. return nil, &googleapi.Error{
  19065. Code: res.StatusCode,
  19066. Header: res.Header,
  19067. }
  19068. }
  19069. if err != nil {
  19070. return nil, err
  19071. }
  19072. defer googleapi.CloseBody(res)
  19073. if err := googleapi.CheckResponse(res); err != nil {
  19074. return nil, err
  19075. }
  19076. ret := &ContentCategory{
  19077. ServerResponse: googleapi.ServerResponse{
  19078. Header: res.Header,
  19079. HTTPStatusCode: res.StatusCode,
  19080. },
  19081. }
  19082. target := &ret
  19083. if err := gensupport.DecodeResponse(target, res); err != nil {
  19084. return nil, err
  19085. }
  19086. return ret, nil
  19087. // {
  19088. // "description": "Gets one content category by ID.",
  19089. // "httpMethod": "GET",
  19090. // "id": "dfareporting.contentCategories.get",
  19091. // "parameterOrder": [
  19092. // "profileId",
  19093. // "id"
  19094. // ],
  19095. // "parameters": {
  19096. // "id": {
  19097. // "description": "Content category ID.",
  19098. // "format": "int64",
  19099. // "location": "path",
  19100. // "required": true,
  19101. // "type": "string"
  19102. // },
  19103. // "profileId": {
  19104. // "description": "User profile ID associated with this request.",
  19105. // "format": "int64",
  19106. // "location": "path",
  19107. // "required": true,
  19108. // "type": "string"
  19109. // }
  19110. // },
  19111. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  19112. // "response": {
  19113. // "$ref": "ContentCategory"
  19114. // },
  19115. // "scopes": [
  19116. // "https://www.googleapis.com/auth/dfatrafficking"
  19117. // ]
  19118. // }
  19119. }
  19120. // method id "dfareporting.contentCategories.insert":
  19121. type ContentCategoriesInsertCall struct {
  19122. s *Service
  19123. profileId int64
  19124. contentcategory *ContentCategory
  19125. urlParams_ gensupport.URLParams
  19126. ctx_ context.Context
  19127. header_ http.Header
  19128. }
  19129. // Insert: Inserts a new content category.
  19130. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  19131. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19132. c.profileId = profileId
  19133. c.contentcategory = contentcategory
  19134. return c
  19135. }
  19136. // Fields allows partial responses to be retrieved. See
  19137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19138. // for more information.
  19139. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  19140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19141. return c
  19142. }
  19143. // Context sets the context to be used in this call's Do method. Any
  19144. // pending HTTP request will be aborted if the provided context is
  19145. // canceled.
  19146. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  19147. c.ctx_ = ctx
  19148. return c
  19149. }
  19150. // Header returns an http.Header that can be modified by the caller to
  19151. // add HTTP headers to the request.
  19152. func (c *ContentCategoriesInsertCall) Header() http.Header {
  19153. if c.header_ == nil {
  19154. c.header_ = make(http.Header)
  19155. }
  19156. return c.header_
  19157. }
  19158. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  19159. reqHeaders := make(http.Header)
  19160. for k, v := range c.header_ {
  19161. reqHeaders[k] = v
  19162. }
  19163. reqHeaders.Set("User-Agent", c.s.userAgent())
  19164. var body io.Reader = nil
  19165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  19166. if err != nil {
  19167. return nil, err
  19168. }
  19169. reqHeaders.Set("Content-Type", "application/json")
  19170. c.urlParams_.Set("alt", alt)
  19171. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19172. urls += "?" + c.urlParams_.Encode()
  19173. req, _ := http.NewRequest("POST", urls, body)
  19174. req.Header = reqHeaders
  19175. googleapi.Expand(req.URL, map[string]string{
  19176. "profileId": strconv.FormatInt(c.profileId, 10),
  19177. })
  19178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19179. }
  19180. // Do executes the "dfareporting.contentCategories.insert" call.
  19181. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19182. // status code is an error. Response headers are in either
  19183. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19184. // at all) in error.(*googleapi.Error).Header. Use
  19185. // googleapi.IsNotModified to check whether the returned error was
  19186. // because http.StatusNotModified was returned.
  19187. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19188. gensupport.SetOptions(c.urlParams_, opts...)
  19189. res, err := c.doRequest("json")
  19190. if res != nil && res.StatusCode == http.StatusNotModified {
  19191. if res.Body != nil {
  19192. res.Body.Close()
  19193. }
  19194. return nil, &googleapi.Error{
  19195. Code: res.StatusCode,
  19196. Header: res.Header,
  19197. }
  19198. }
  19199. if err != nil {
  19200. return nil, err
  19201. }
  19202. defer googleapi.CloseBody(res)
  19203. if err := googleapi.CheckResponse(res); err != nil {
  19204. return nil, err
  19205. }
  19206. ret := &ContentCategory{
  19207. ServerResponse: googleapi.ServerResponse{
  19208. Header: res.Header,
  19209. HTTPStatusCode: res.StatusCode,
  19210. },
  19211. }
  19212. target := &ret
  19213. if err := gensupport.DecodeResponse(target, res); err != nil {
  19214. return nil, err
  19215. }
  19216. return ret, nil
  19217. // {
  19218. // "description": "Inserts a new content category.",
  19219. // "httpMethod": "POST",
  19220. // "id": "dfareporting.contentCategories.insert",
  19221. // "parameterOrder": [
  19222. // "profileId"
  19223. // ],
  19224. // "parameters": {
  19225. // "profileId": {
  19226. // "description": "User profile ID associated with this request.",
  19227. // "format": "int64",
  19228. // "location": "path",
  19229. // "required": true,
  19230. // "type": "string"
  19231. // }
  19232. // },
  19233. // "path": "userprofiles/{profileId}/contentCategories",
  19234. // "request": {
  19235. // "$ref": "ContentCategory"
  19236. // },
  19237. // "response": {
  19238. // "$ref": "ContentCategory"
  19239. // },
  19240. // "scopes": [
  19241. // "https://www.googleapis.com/auth/dfatrafficking"
  19242. // ]
  19243. // }
  19244. }
  19245. // method id "dfareporting.contentCategories.list":
  19246. type ContentCategoriesListCall struct {
  19247. s *Service
  19248. profileId int64
  19249. urlParams_ gensupport.URLParams
  19250. ifNoneMatch_ string
  19251. ctx_ context.Context
  19252. header_ http.Header
  19253. }
  19254. // List: Retrieves a list of content categories, possibly filtered. This
  19255. // method supports paging.
  19256. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  19257. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19258. c.profileId = profileId
  19259. return c
  19260. }
  19261. // Ids sets the optional parameter "ids": Select only content categories
  19262. // with these IDs.
  19263. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  19264. var ids_ []string
  19265. for _, v := range ids {
  19266. ids_ = append(ids_, fmt.Sprint(v))
  19267. }
  19268. c.urlParams_.SetMulti("ids", ids_)
  19269. return c
  19270. }
  19271. // MaxResults sets the optional parameter "maxResults": Maximum number
  19272. // of results to return.
  19273. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  19274. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19275. return c
  19276. }
  19277. // PageToken sets the optional parameter "pageToken": Value of the
  19278. // nextPageToken from the previous result page.
  19279. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  19280. c.urlParams_.Set("pageToken", pageToken)
  19281. return c
  19282. }
  19283. // SearchString sets the optional parameter "searchString": Allows
  19284. // searching for objects by name or ID. Wildcards (*) are allowed. For
  19285. // example, "contentcategory*2015" will return objects with names like
  19286. // "contentcategory June 2015", "contentcategory April 2015", or simply
  19287. // "contentcategory 2015". Most of the searches also add wildcards
  19288. // implicitly at the start and the end of the search string. For
  19289. // example, a search string of "contentcategory" will match objects with
  19290. // name "my contentcategory", "contentcategory 2015", or simply
  19291. // "contentcategory".
  19292. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  19293. c.urlParams_.Set("searchString", searchString)
  19294. return c
  19295. }
  19296. // SortField sets the optional parameter "sortField": Field by which to
  19297. // sort the list.
  19298. //
  19299. // Possible values:
  19300. // "ID" (default)
  19301. // "NAME"
  19302. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  19303. c.urlParams_.Set("sortField", sortField)
  19304. return c
  19305. }
  19306. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  19307. // results.
  19308. //
  19309. // Possible values:
  19310. // "ASCENDING" (default)
  19311. // "DESCENDING"
  19312. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  19313. c.urlParams_.Set("sortOrder", sortOrder)
  19314. return c
  19315. }
  19316. // Fields allows partial responses to be retrieved. See
  19317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19318. // for more information.
  19319. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  19320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19321. return c
  19322. }
  19323. // IfNoneMatch sets the optional parameter which makes the operation
  19324. // fail if the object's ETag matches the given value. This is useful for
  19325. // getting updates only after the object has changed since the last
  19326. // request. Use googleapi.IsNotModified to check whether the response
  19327. // error from Do is the result of In-None-Match.
  19328. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  19329. c.ifNoneMatch_ = entityTag
  19330. return c
  19331. }
  19332. // Context sets the context to be used in this call's Do method. Any
  19333. // pending HTTP request will be aborted if the provided context is
  19334. // canceled.
  19335. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  19336. c.ctx_ = ctx
  19337. return c
  19338. }
  19339. // Header returns an http.Header that can be modified by the caller to
  19340. // add HTTP headers to the request.
  19341. func (c *ContentCategoriesListCall) Header() http.Header {
  19342. if c.header_ == nil {
  19343. c.header_ = make(http.Header)
  19344. }
  19345. return c.header_
  19346. }
  19347. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  19348. reqHeaders := make(http.Header)
  19349. for k, v := range c.header_ {
  19350. reqHeaders[k] = v
  19351. }
  19352. reqHeaders.Set("User-Agent", c.s.userAgent())
  19353. if c.ifNoneMatch_ != "" {
  19354. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19355. }
  19356. var body io.Reader = nil
  19357. c.urlParams_.Set("alt", alt)
  19358. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19359. urls += "?" + c.urlParams_.Encode()
  19360. req, _ := http.NewRequest("GET", urls, body)
  19361. req.Header = reqHeaders
  19362. googleapi.Expand(req.URL, map[string]string{
  19363. "profileId": strconv.FormatInt(c.profileId, 10),
  19364. })
  19365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19366. }
  19367. // Do executes the "dfareporting.contentCategories.list" call.
  19368. // Exactly one of *ContentCategoriesListResponse or error will be
  19369. // non-nil. Any non-2xx status code is an error. Response headers are in
  19370. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  19371. // response was returned at all) in error.(*googleapi.Error).Header. Use
  19372. // googleapi.IsNotModified to check whether the returned error was
  19373. // because http.StatusNotModified was returned.
  19374. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  19375. gensupport.SetOptions(c.urlParams_, opts...)
  19376. res, err := c.doRequest("json")
  19377. if res != nil && res.StatusCode == http.StatusNotModified {
  19378. if res.Body != nil {
  19379. res.Body.Close()
  19380. }
  19381. return nil, &googleapi.Error{
  19382. Code: res.StatusCode,
  19383. Header: res.Header,
  19384. }
  19385. }
  19386. if err != nil {
  19387. return nil, err
  19388. }
  19389. defer googleapi.CloseBody(res)
  19390. if err := googleapi.CheckResponse(res); err != nil {
  19391. return nil, err
  19392. }
  19393. ret := &ContentCategoriesListResponse{
  19394. ServerResponse: googleapi.ServerResponse{
  19395. Header: res.Header,
  19396. HTTPStatusCode: res.StatusCode,
  19397. },
  19398. }
  19399. target := &ret
  19400. if err := gensupport.DecodeResponse(target, res); err != nil {
  19401. return nil, err
  19402. }
  19403. return ret, nil
  19404. // {
  19405. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  19406. // "httpMethod": "GET",
  19407. // "id": "dfareporting.contentCategories.list",
  19408. // "parameterOrder": [
  19409. // "profileId"
  19410. // ],
  19411. // "parameters": {
  19412. // "ids": {
  19413. // "description": "Select only content categories with these IDs.",
  19414. // "format": "int64",
  19415. // "location": "query",
  19416. // "repeated": true,
  19417. // "type": "string"
  19418. // },
  19419. // "maxResults": {
  19420. // "default": "1000",
  19421. // "description": "Maximum number of results to return.",
  19422. // "format": "int32",
  19423. // "location": "query",
  19424. // "maximum": "1000",
  19425. // "minimum": "0",
  19426. // "type": "integer"
  19427. // },
  19428. // "pageToken": {
  19429. // "description": "Value of the nextPageToken from the previous result page.",
  19430. // "location": "query",
  19431. // "type": "string"
  19432. // },
  19433. // "profileId": {
  19434. // "description": "User profile ID associated with this request.",
  19435. // "format": "int64",
  19436. // "location": "path",
  19437. // "required": true,
  19438. // "type": "string"
  19439. // },
  19440. // "searchString": {
  19441. // "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\".",
  19442. // "location": "query",
  19443. // "type": "string"
  19444. // },
  19445. // "sortField": {
  19446. // "default": "ID",
  19447. // "description": "Field by which to sort the list.",
  19448. // "enum": [
  19449. // "ID",
  19450. // "NAME"
  19451. // ],
  19452. // "enumDescriptions": [
  19453. // "",
  19454. // ""
  19455. // ],
  19456. // "location": "query",
  19457. // "type": "string"
  19458. // },
  19459. // "sortOrder": {
  19460. // "default": "ASCENDING",
  19461. // "description": "Order of sorted results.",
  19462. // "enum": [
  19463. // "ASCENDING",
  19464. // "DESCENDING"
  19465. // ],
  19466. // "enumDescriptions": [
  19467. // "",
  19468. // ""
  19469. // ],
  19470. // "location": "query",
  19471. // "type": "string"
  19472. // }
  19473. // },
  19474. // "path": "userprofiles/{profileId}/contentCategories",
  19475. // "response": {
  19476. // "$ref": "ContentCategoriesListResponse"
  19477. // },
  19478. // "scopes": [
  19479. // "https://www.googleapis.com/auth/dfatrafficking"
  19480. // ]
  19481. // }
  19482. }
  19483. // Pages invokes f for each page of results.
  19484. // A non-nil error returned from f will halt the iteration.
  19485. // The provided context supersedes any context provided to the Context method.
  19486. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  19487. c.ctx_ = ctx
  19488. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19489. for {
  19490. x, err := c.Do()
  19491. if err != nil {
  19492. return err
  19493. }
  19494. if err := f(x); err != nil {
  19495. return err
  19496. }
  19497. if x.NextPageToken == "" {
  19498. return nil
  19499. }
  19500. c.PageToken(x.NextPageToken)
  19501. }
  19502. }
  19503. // method id "dfareporting.contentCategories.patch":
  19504. type ContentCategoriesPatchCall struct {
  19505. s *Service
  19506. profileId int64
  19507. contentcategory *ContentCategory
  19508. urlParams_ gensupport.URLParams
  19509. ctx_ context.Context
  19510. header_ http.Header
  19511. }
  19512. // Patch: Updates an existing content category. This method supports
  19513. // patch semantics.
  19514. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  19515. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19516. c.profileId = profileId
  19517. c.urlParams_.Set("id", fmt.Sprint(id))
  19518. c.contentcategory = contentcategory
  19519. return c
  19520. }
  19521. // Fields allows partial responses to be retrieved. See
  19522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19523. // for more information.
  19524. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  19525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19526. return c
  19527. }
  19528. // Context sets the context to be used in this call's Do method. Any
  19529. // pending HTTP request will be aborted if the provided context is
  19530. // canceled.
  19531. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  19532. c.ctx_ = ctx
  19533. return c
  19534. }
  19535. // Header returns an http.Header that can be modified by the caller to
  19536. // add HTTP headers to the request.
  19537. func (c *ContentCategoriesPatchCall) Header() http.Header {
  19538. if c.header_ == nil {
  19539. c.header_ = make(http.Header)
  19540. }
  19541. return c.header_
  19542. }
  19543. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  19544. reqHeaders := make(http.Header)
  19545. for k, v := range c.header_ {
  19546. reqHeaders[k] = v
  19547. }
  19548. reqHeaders.Set("User-Agent", c.s.userAgent())
  19549. var body io.Reader = nil
  19550. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  19551. if err != nil {
  19552. return nil, err
  19553. }
  19554. reqHeaders.Set("Content-Type", "application/json")
  19555. c.urlParams_.Set("alt", alt)
  19556. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19557. urls += "?" + c.urlParams_.Encode()
  19558. req, _ := http.NewRequest("PATCH", urls, body)
  19559. req.Header = reqHeaders
  19560. googleapi.Expand(req.URL, map[string]string{
  19561. "profileId": strconv.FormatInt(c.profileId, 10),
  19562. })
  19563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19564. }
  19565. // Do executes the "dfareporting.contentCategories.patch" call.
  19566. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19567. // status code is an error. Response headers are in either
  19568. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19569. // at all) in error.(*googleapi.Error).Header. Use
  19570. // googleapi.IsNotModified to check whether the returned error was
  19571. // because http.StatusNotModified was returned.
  19572. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19573. gensupport.SetOptions(c.urlParams_, opts...)
  19574. res, err := c.doRequest("json")
  19575. if res != nil && res.StatusCode == http.StatusNotModified {
  19576. if res.Body != nil {
  19577. res.Body.Close()
  19578. }
  19579. return nil, &googleapi.Error{
  19580. Code: res.StatusCode,
  19581. Header: res.Header,
  19582. }
  19583. }
  19584. if err != nil {
  19585. return nil, err
  19586. }
  19587. defer googleapi.CloseBody(res)
  19588. if err := googleapi.CheckResponse(res); err != nil {
  19589. return nil, err
  19590. }
  19591. ret := &ContentCategory{
  19592. ServerResponse: googleapi.ServerResponse{
  19593. Header: res.Header,
  19594. HTTPStatusCode: res.StatusCode,
  19595. },
  19596. }
  19597. target := &ret
  19598. if err := gensupport.DecodeResponse(target, res); err != nil {
  19599. return nil, err
  19600. }
  19601. return ret, nil
  19602. // {
  19603. // "description": "Updates an existing content category. This method supports patch semantics.",
  19604. // "httpMethod": "PATCH",
  19605. // "id": "dfareporting.contentCategories.patch",
  19606. // "parameterOrder": [
  19607. // "profileId",
  19608. // "id"
  19609. // ],
  19610. // "parameters": {
  19611. // "id": {
  19612. // "description": "Content category ID.",
  19613. // "format": "int64",
  19614. // "location": "query",
  19615. // "required": true,
  19616. // "type": "string"
  19617. // },
  19618. // "profileId": {
  19619. // "description": "User profile ID associated with this request.",
  19620. // "format": "int64",
  19621. // "location": "path",
  19622. // "required": true,
  19623. // "type": "string"
  19624. // }
  19625. // },
  19626. // "path": "userprofiles/{profileId}/contentCategories",
  19627. // "request": {
  19628. // "$ref": "ContentCategory"
  19629. // },
  19630. // "response": {
  19631. // "$ref": "ContentCategory"
  19632. // },
  19633. // "scopes": [
  19634. // "https://www.googleapis.com/auth/dfatrafficking"
  19635. // ]
  19636. // }
  19637. }
  19638. // method id "dfareporting.contentCategories.update":
  19639. type ContentCategoriesUpdateCall struct {
  19640. s *Service
  19641. profileId int64
  19642. contentcategory *ContentCategory
  19643. urlParams_ gensupport.URLParams
  19644. ctx_ context.Context
  19645. header_ http.Header
  19646. }
  19647. // Update: Updates an existing content category.
  19648. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  19649. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19650. c.profileId = profileId
  19651. c.contentcategory = contentcategory
  19652. return c
  19653. }
  19654. // Fields allows partial responses to be retrieved. See
  19655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19656. // for more information.
  19657. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  19658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19659. return c
  19660. }
  19661. // Context sets the context to be used in this call's Do method. Any
  19662. // pending HTTP request will be aborted if the provided context is
  19663. // canceled.
  19664. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  19665. c.ctx_ = ctx
  19666. return c
  19667. }
  19668. // Header returns an http.Header that can be modified by the caller to
  19669. // add HTTP headers to the request.
  19670. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  19671. if c.header_ == nil {
  19672. c.header_ = make(http.Header)
  19673. }
  19674. return c.header_
  19675. }
  19676. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  19677. reqHeaders := make(http.Header)
  19678. for k, v := range c.header_ {
  19679. reqHeaders[k] = v
  19680. }
  19681. reqHeaders.Set("User-Agent", c.s.userAgent())
  19682. var body io.Reader = nil
  19683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  19684. if err != nil {
  19685. return nil, err
  19686. }
  19687. reqHeaders.Set("Content-Type", "application/json")
  19688. c.urlParams_.Set("alt", alt)
  19689. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19690. urls += "?" + c.urlParams_.Encode()
  19691. req, _ := http.NewRequest("PUT", urls, body)
  19692. req.Header = reqHeaders
  19693. googleapi.Expand(req.URL, map[string]string{
  19694. "profileId": strconv.FormatInt(c.profileId, 10),
  19695. })
  19696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19697. }
  19698. // Do executes the "dfareporting.contentCategories.update" call.
  19699. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19700. // status code is an error. Response headers are in either
  19701. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19702. // at all) in error.(*googleapi.Error).Header. Use
  19703. // googleapi.IsNotModified to check whether the returned error was
  19704. // because http.StatusNotModified was returned.
  19705. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19706. gensupport.SetOptions(c.urlParams_, opts...)
  19707. res, err := c.doRequest("json")
  19708. if res != nil && res.StatusCode == http.StatusNotModified {
  19709. if res.Body != nil {
  19710. res.Body.Close()
  19711. }
  19712. return nil, &googleapi.Error{
  19713. Code: res.StatusCode,
  19714. Header: res.Header,
  19715. }
  19716. }
  19717. if err != nil {
  19718. return nil, err
  19719. }
  19720. defer googleapi.CloseBody(res)
  19721. if err := googleapi.CheckResponse(res); err != nil {
  19722. return nil, err
  19723. }
  19724. ret := &ContentCategory{
  19725. ServerResponse: googleapi.ServerResponse{
  19726. Header: res.Header,
  19727. HTTPStatusCode: res.StatusCode,
  19728. },
  19729. }
  19730. target := &ret
  19731. if err := gensupport.DecodeResponse(target, res); err != nil {
  19732. return nil, err
  19733. }
  19734. return ret, nil
  19735. // {
  19736. // "description": "Updates an existing content category.",
  19737. // "httpMethod": "PUT",
  19738. // "id": "dfareporting.contentCategories.update",
  19739. // "parameterOrder": [
  19740. // "profileId"
  19741. // ],
  19742. // "parameters": {
  19743. // "profileId": {
  19744. // "description": "User profile ID associated with this request.",
  19745. // "format": "int64",
  19746. // "location": "path",
  19747. // "required": true,
  19748. // "type": "string"
  19749. // }
  19750. // },
  19751. // "path": "userprofiles/{profileId}/contentCategories",
  19752. // "request": {
  19753. // "$ref": "ContentCategory"
  19754. // },
  19755. // "response": {
  19756. // "$ref": "ContentCategory"
  19757. // },
  19758. // "scopes": [
  19759. // "https://www.googleapis.com/auth/dfatrafficking"
  19760. // ]
  19761. // }
  19762. }
  19763. // method id "dfareporting.conversions.batchinsert":
  19764. type ConversionsBatchinsertCall struct {
  19765. s *Service
  19766. profileId int64
  19767. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  19768. urlParams_ gensupport.URLParams
  19769. ctx_ context.Context
  19770. header_ http.Header
  19771. }
  19772. // Batchinsert: Inserts conversions.
  19773. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  19774. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19775. c.profileId = profileId
  19776. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  19777. return c
  19778. }
  19779. // Fields allows partial responses to be retrieved. See
  19780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19781. // for more information.
  19782. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  19783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19784. return c
  19785. }
  19786. // Context sets the context to be used in this call's Do method. Any
  19787. // pending HTTP request will be aborted if the provided context is
  19788. // canceled.
  19789. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  19790. c.ctx_ = ctx
  19791. return c
  19792. }
  19793. // Header returns an http.Header that can be modified by the caller to
  19794. // add HTTP headers to the request.
  19795. func (c *ConversionsBatchinsertCall) Header() http.Header {
  19796. if c.header_ == nil {
  19797. c.header_ = make(http.Header)
  19798. }
  19799. return c.header_
  19800. }
  19801. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  19802. reqHeaders := make(http.Header)
  19803. for k, v := range c.header_ {
  19804. reqHeaders[k] = v
  19805. }
  19806. reqHeaders.Set("User-Agent", c.s.userAgent())
  19807. var body io.Reader = nil
  19808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  19809. if err != nil {
  19810. return nil, err
  19811. }
  19812. reqHeaders.Set("Content-Type", "application/json")
  19813. c.urlParams_.Set("alt", alt)
  19814. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  19815. urls += "?" + c.urlParams_.Encode()
  19816. req, _ := http.NewRequest("POST", urls, body)
  19817. req.Header = reqHeaders
  19818. googleapi.Expand(req.URL, map[string]string{
  19819. "profileId": strconv.FormatInt(c.profileId, 10),
  19820. })
  19821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19822. }
  19823. // Do executes the "dfareporting.conversions.batchinsert" call.
  19824. // Exactly one of *ConversionsBatchInsertResponse or error will be
  19825. // non-nil. Any non-2xx status code is an error. Response headers are in
  19826. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  19827. // response was returned at all) in error.(*googleapi.Error).Header. Use
  19828. // googleapi.IsNotModified to check whether the returned error was
  19829. // because http.StatusNotModified was returned.
  19830. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  19831. gensupport.SetOptions(c.urlParams_, opts...)
  19832. res, err := c.doRequest("json")
  19833. if res != nil && res.StatusCode == http.StatusNotModified {
  19834. if res.Body != nil {
  19835. res.Body.Close()
  19836. }
  19837. return nil, &googleapi.Error{
  19838. Code: res.StatusCode,
  19839. Header: res.Header,
  19840. }
  19841. }
  19842. if err != nil {
  19843. return nil, err
  19844. }
  19845. defer googleapi.CloseBody(res)
  19846. if err := googleapi.CheckResponse(res); err != nil {
  19847. return nil, err
  19848. }
  19849. ret := &ConversionsBatchInsertResponse{
  19850. ServerResponse: googleapi.ServerResponse{
  19851. Header: res.Header,
  19852. HTTPStatusCode: res.StatusCode,
  19853. },
  19854. }
  19855. target := &ret
  19856. if err := gensupport.DecodeResponse(target, res); err != nil {
  19857. return nil, err
  19858. }
  19859. return ret, nil
  19860. // {
  19861. // "description": "Inserts conversions.",
  19862. // "httpMethod": "POST",
  19863. // "id": "dfareporting.conversions.batchinsert",
  19864. // "parameterOrder": [
  19865. // "profileId"
  19866. // ],
  19867. // "parameters": {
  19868. // "profileId": {
  19869. // "description": "User profile ID associated with this request.",
  19870. // "format": "int64",
  19871. // "location": "path",
  19872. // "required": true,
  19873. // "type": "string"
  19874. // }
  19875. // },
  19876. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  19877. // "request": {
  19878. // "$ref": "ConversionsBatchInsertRequest"
  19879. // },
  19880. // "response": {
  19881. // "$ref": "ConversionsBatchInsertResponse"
  19882. // },
  19883. // "scopes": [
  19884. // "https://www.googleapis.com/auth/ddmconversions"
  19885. // ]
  19886. // }
  19887. }
  19888. // method id "dfareporting.countries.get":
  19889. type CountriesGetCall struct {
  19890. s *Service
  19891. profileId int64
  19892. dartId int64
  19893. urlParams_ gensupport.URLParams
  19894. ifNoneMatch_ string
  19895. ctx_ context.Context
  19896. header_ http.Header
  19897. }
  19898. // Get: Gets one country by ID.
  19899. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  19900. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19901. c.profileId = profileId
  19902. c.dartId = dartId
  19903. return c
  19904. }
  19905. // Fields allows partial responses to be retrieved. See
  19906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19907. // for more information.
  19908. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  19909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19910. return c
  19911. }
  19912. // IfNoneMatch sets the optional parameter which makes the operation
  19913. // fail if the object's ETag matches the given value. This is useful for
  19914. // getting updates only after the object has changed since the last
  19915. // request. Use googleapi.IsNotModified to check whether the response
  19916. // error from Do is the result of In-None-Match.
  19917. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  19918. c.ifNoneMatch_ = entityTag
  19919. return c
  19920. }
  19921. // Context sets the context to be used in this call's Do method. Any
  19922. // pending HTTP request will be aborted if the provided context is
  19923. // canceled.
  19924. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  19925. c.ctx_ = ctx
  19926. return c
  19927. }
  19928. // Header returns an http.Header that can be modified by the caller to
  19929. // add HTTP headers to the request.
  19930. func (c *CountriesGetCall) Header() http.Header {
  19931. if c.header_ == nil {
  19932. c.header_ = make(http.Header)
  19933. }
  19934. return c.header_
  19935. }
  19936. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  19937. reqHeaders := make(http.Header)
  19938. for k, v := range c.header_ {
  19939. reqHeaders[k] = v
  19940. }
  19941. reqHeaders.Set("User-Agent", c.s.userAgent())
  19942. if c.ifNoneMatch_ != "" {
  19943. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19944. }
  19945. var body io.Reader = nil
  19946. c.urlParams_.Set("alt", alt)
  19947. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  19948. urls += "?" + c.urlParams_.Encode()
  19949. req, _ := http.NewRequest("GET", urls, body)
  19950. req.Header = reqHeaders
  19951. googleapi.Expand(req.URL, map[string]string{
  19952. "profileId": strconv.FormatInt(c.profileId, 10),
  19953. "dartId": strconv.FormatInt(c.dartId, 10),
  19954. })
  19955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19956. }
  19957. // Do executes the "dfareporting.countries.get" call.
  19958. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  19959. // code is an error. Response headers are in either
  19960. // *Country.ServerResponse.Header or (if a response was returned at all)
  19961. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  19962. // check whether the returned error was because http.StatusNotModified
  19963. // was returned.
  19964. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  19965. gensupport.SetOptions(c.urlParams_, opts...)
  19966. res, err := c.doRequest("json")
  19967. if res != nil && res.StatusCode == http.StatusNotModified {
  19968. if res.Body != nil {
  19969. res.Body.Close()
  19970. }
  19971. return nil, &googleapi.Error{
  19972. Code: res.StatusCode,
  19973. Header: res.Header,
  19974. }
  19975. }
  19976. if err != nil {
  19977. return nil, err
  19978. }
  19979. defer googleapi.CloseBody(res)
  19980. if err := googleapi.CheckResponse(res); err != nil {
  19981. return nil, err
  19982. }
  19983. ret := &Country{
  19984. ServerResponse: googleapi.ServerResponse{
  19985. Header: res.Header,
  19986. HTTPStatusCode: res.StatusCode,
  19987. },
  19988. }
  19989. target := &ret
  19990. if err := gensupport.DecodeResponse(target, res); err != nil {
  19991. return nil, err
  19992. }
  19993. return ret, nil
  19994. // {
  19995. // "description": "Gets one country by ID.",
  19996. // "httpMethod": "GET",
  19997. // "id": "dfareporting.countries.get",
  19998. // "parameterOrder": [
  19999. // "profileId",
  20000. // "dartId"
  20001. // ],
  20002. // "parameters": {
  20003. // "dartId": {
  20004. // "description": "Country DART ID.",
  20005. // "format": "int64",
  20006. // "location": "path",
  20007. // "required": true,
  20008. // "type": "string"
  20009. // },
  20010. // "profileId": {
  20011. // "description": "User profile ID associated with this request.",
  20012. // "format": "int64",
  20013. // "location": "path",
  20014. // "required": true,
  20015. // "type": "string"
  20016. // }
  20017. // },
  20018. // "path": "userprofiles/{profileId}/countries/{dartId}",
  20019. // "response": {
  20020. // "$ref": "Country"
  20021. // },
  20022. // "scopes": [
  20023. // "https://www.googleapis.com/auth/dfatrafficking"
  20024. // ]
  20025. // }
  20026. }
  20027. // method id "dfareporting.countries.list":
  20028. type CountriesListCall struct {
  20029. s *Service
  20030. profileId int64
  20031. urlParams_ gensupport.URLParams
  20032. ifNoneMatch_ string
  20033. ctx_ context.Context
  20034. header_ http.Header
  20035. }
  20036. // List: Retrieves a list of countries.
  20037. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  20038. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20039. c.profileId = profileId
  20040. return c
  20041. }
  20042. // Fields allows partial responses to be retrieved. See
  20043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20044. // for more information.
  20045. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  20046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20047. return c
  20048. }
  20049. // IfNoneMatch sets the optional parameter which makes the operation
  20050. // fail if the object's ETag matches the given value. This is useful for
  20051. // getting updates only after the object has changed since the last
  20052. // request. Use googleapi.IsNotModified to check whether the response
  20053. // error from Do is the result of In-None-Match.
  20054. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  20055. c.ifNoneMatch_ = entityTag
  20056. return c
  20057. }
  20058. // Context sets the context to be used in this call's Do method. Any
  20059. // pending HTTP request will be aborted if the provided context is
  20060. // canceled.
  20061. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  20062. c.ctx_ = ctx
  20063. return c
  20064. }
  20065. // Header returns an http.Header that can be modified by the caller to
  20066. // add HTTP headers to the request.
  20067. func (c *CountriesListCall) Header() http.Header {
  20068. if c.header_ == nil {
  20069. c.header_ = make(http.Header)
  20070. }
  20071. return c.header_
  20072. }
  20073. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  20074. reqHeaders := make(http.Header)
  20075. for k, v := range c.header_ {
  20076. reqHeaders[k] = v
  20077. }
  20078. reqHeaders.Set("User-Agent", c.s.userAgent())
  20079. if c.ifNoneMatch_ != "" {
  20080. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20081. }
  20082. var body io.Reader = nil
  20083. c.urlParams_.Set("alt", alt)
  20084. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  20085. urls += "?" + c.urlParams_.Encode()
  20086. req, _ := http.NewRequest("GET", urls, body)
  20087. req.Header = reqHeaders
  20088. googleapi.Expand(req.URL, map[string]string{
  20089. "profileId": strconv.FormatInt(c.profileId, 10),
  20090. })
  20091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20092. }
  20093. // Do executes the "dfareporting.countries.list" call.
  20094. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  20095. // non-2xx status code is an error. Response headers are in either
  20096. // *CountriesListResponse.ServerResponse.Header or (if a response was
  20097. // returned at all) in error.(*googleapi.Error).Header. Use
  20098. // googleapi.IsNotModified to check whether the returned error was
  20099. // because http.StatusNotModified was returned.
  20100. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  20101. gensupport.SetOptions(c.urlParams_, opts...)
  20102. res, err := c.doRequest("json")
  20103. if res != nil && res.StatusCode == http.StatusNotModified {
  20104. if res.Body != nil {
  20105. res.Body.Close()
  20106. }
  20107. return nil, &googleapi.Error{
  20108. Code: res.StatusCode,
  20109. Header: res.Header,
  20110. }
  20111. }
  20112. if err != nil {
  20113. return nil, err
  20114. }
  20115. defer googleapi.CloseBody(res)
  20116. if err := googleapi.CheckResponse(res); err != nil {
  20117. return nil, err
  20118. }
  20119. ret := &CountriesListResponse{
  20120. ServerResponse: googleapi.ServerResponse{
  20121. Header: res.Header,
  20122. HTTPStatusCode: res.StatusCode,
  20123. },
  20124. }
  20125. target := &ret
  20126. if err := gensupport.DecodeResponse(target, res); err != nil {
  20127. return nil, err
  20128. }
  20129. return ret, nil
  20130. // {
  20131. // "description": "Retrieves a list of countries.",
  20132. // "httpMethod": "GET",
  20133. // "id": "dfareporting.countries.list",
  20134. // "parameterOrder": [
  20135. // "profileId"
  20136. // ],
  20137. // "parameters": {
  20138. // "profileId": {
  20139. // "description": "User profile ID associated with this request.",
  20140. // "format": "int64",
  20141. // "location": "path",
  20142. // "required": true,
  20143. // "type": "string"
  20144. // }
  20145. // },
  20146. // "path": "userprofiles/{profileId}/countries",
  20147. // "response": {
  20148. // "$ref": "CountriesListResponse"
  20149. // },
  20150. // "scopes": [
  20151. // "https://www.googleapis.com/auth/dfatrafficking"
  20152. // ]
  20153. // }
  20154. }
  20155. // method id "dfareporting.creativeAssets.insert":
  20156. type CreativeAssetsInsertCall struct {
  20157. s *Service
  20158. profileId int64
  20159. advertiserId int64
  20160. creativeassetmetadata *CreativeAssetMetadata
  20161. urlParams_ gensupport.URLParams
  20162. mediaInfo_ *gensupport.MediaInfo
  20163. ctx_ context.Context
  20164. header_ http.Header
  20165. }
  20166. // Insert: Inserts a new creative asset.
  20167. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  20168. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20169. c.profileId = profileId
  20170. c.advertiserId = advertiserId
  20171. c.creativeassetmetadata = creativeassetmetadata
  20172. return c
  20173. }
  20174. // Media specifies the media to upload in one or more chunks. The chunk
  20175. // size may be controlled by supplying a MediaOption generated by
  20176. // googleapi.ChunkSize. The chunk size defaults to
  20177. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  20178. // upload request will be determined by sniffing the contents of r,
  20179. // unless a MediaOption generated by googleapi.ContentType is
  20180. // supplied.
  20181. // At most one of Media and ResumableMedia may be set.
  20182. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  20183. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  20184. return c
  20185. }
  20186. // ResumableMedia specifies the media to upload in chunks and can be
  20187. // canceled with ctx.
  20188. //
  20189. // Deprecated: use Media instead.
  20190. //
  20191. // At most one of Media and ResumableMedia may be set. mediaType
  20192. // identifies the MIME media type of the upload, such as "image/png". If
  20193. // mediaType is "", it will be auto-detected. The provided ctx will
  20194. // supersede any context previously provided to the Context method.
  20195. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  20196. c.ctx_ = ctx
  20197. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  20198. return c
  20199. }
  20200. // ProgressUpdater provides a callback function that will be called
  20201. // after every chunk. It should be a low-latency function in order to
  20202. // not slow down the upload operation. This should only be called when
  20203. // using ResumableMedia (as opposed to Media).
  20204. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  20205. c.mediaInfo_.SetProgressUpdater(pu)
  20206. return c
  20207. }
  20208. // Fields allows partial responses to be retrieved. See
  20209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20210. // for more information.
  20211. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  20212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20213. return c
  20214. }
  20215. // Context sets the context to be used in this call's Do method. Any
  20216. // pending HTTP request will be aborted if the provided context is
  20217. // canceled.
  20218. // This context will supersede any context previously provided to the
  20219. // ResumableMedia method.
  20220. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  20221. c.ctx_ = ctx
  20222. return c
  20223. }
  20224. // Header returns an http.Header that can be modified by the caller to
  20225. // add HTTP headers to the request.
  20226. func (c *CreativeAssetsInsertCall) Header() http.Header {
  20227. if c.header_ == nil {
  20228. c.header_ = make(http.Header)
  20229. }
  20230. return c.header_
  20231. }
  20232. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  20233. reqHeaders := make(http.Header)
  20234. for k, v := range c.header_ {
  20235. reqHeaders[k] = v
  20236. }
  20237. reqHeaders.Set("User-Agent", c.s.userAgent())
  20238. var body io.Reader = nil
  20239. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  20240. if err != nil {
  20241. return nil, err
  20242. }
  20243. reqHeaders.Set("Content-Type", "application/json")
  20244. c.urlParams_.Set("alt", alt)
  20245. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  20246. if c.mediaInfo_ != nil {
  20247. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  20248. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  20249. }
  20250. if body == nil {
  20251. body = new(bytes.Buffer)
  20252. reqHeaders.Set("Content-Type", "application/json")
  20253. }
  20254. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  20255. defer cleanup()
  20256. urls += "?" + c.urlParams_.Encode()
  20257. req, _ := http.NewRequest("POST", urls, body)
  20258. req.Header = reqHeaders
  20259. gensupport.SetGetBody(req, getBody)
  20260. googleapi.Expand(req.URL, map[string]string{
  20261. "profileId": strconv.FormatInt(c.profileId, 10),
  20262. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  20263. })
  20264. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20265. }
  20266. // Do executes the "dfareporting.creativeAssets.insert" call.
  20267. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  20268. // non-2xx status code is an error. Response headers are in either
  20269. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  20270. // returned at all) in error.(*googleapi.Error).Header. Use
  20271. // googleapi.IsNotModified to check whether the returned error was
  20272. // because http.StatusNotModified was returned.
  20273. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  20274. gensupport.SetOptions(c.urlParams_, opts...)
  20275. res, err := c.doRequest("json")
  20276. if res != nil && res.StatusCode == http.StatusNotModified {
  20277. if res.Body != nil {
  20278. res.Body.Close()
  20279. }
  20280. return nil, &googleapi.Error{
  20281. Code: res.StatusCode,
  20282. Header: res.Header,
  20283. }
  20284. }
  20285. if err != nil {
  20286. return nil, err
  20287. }
  20288. defer googleapi.CloseBody(res)
  20289. if err := googleapi.CheckResponse(res); err != nil {
  20290. return nil, err
  20291. }
  20292. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  20293. if rx != nil {
  20294. rx.Client = c.s.client
  20295. rx.UserAgent = c.s.userAgent()
  20296. ctx := c.ctx_
  20297. if ctx == nil {
  20298. ctx = context.TODO()
  20299. }
  20300. res, err = rx.Upload(ctx)
  20301. if err != nil {
  20302. return nil, err
  20303. }
  20304. defer res.Body.Close()
  20305. if err := googleapi.CheckResponse(res); err != nil {
  20306. return nil, err
  20307. }
  20308. }
  20309. ret := &CreativeAssetMetadata{
  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": "Inserts a new creative asset.",
  20322. // "httpMethod": "POST",
  20323. // "id": "dfareporting.creativeAssets.insert",
  20324. // "mediaUpload": {
  20325. // "accept": [
  20326. // "*/*"
  20327. // ],
  20328. // "maxSize": "1024MB",
  20329. // "protocols": {
  20330. // "resumable": {
  20331. // "multipart": true,
  20332. // "path": "/resumable/upload/dfareporting/v2.7/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  20333. // },
  20334. // "simple": {
  20335. // "multipart": true,
  20336. // "path": "/upload/dfareporting/v2.7/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  20337. // }
  20338. // }
  20339. // },
  20340. // "parameterOrder": [
  20341. // "profileId",
  20342. // "advertiserId"
  20343. // ],
  20344. // "parameters": {
  20345. // "advertiserId": {
  20346. // "description": "Advertiser ID of this creative. This is a required field.",
  20347. // "format": "int64",
  20348. // "location": "path",
  20349. // "required": true,
  20350. // "type": "string"
  20351. // },
  20352. // "profileId": {
  20353. // "description": "User profile ID associated with this request.",
  20354. // "format": "int64",
  20355. // "location": "path",
  20356. // "required": true,
  20357. // "type": "string"
  20358. // }
  20359. // },
  20360. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  20361. // "request": {
  20362. // "$ref": "CreativeAssetMetadata"
  20363. // },
  20364. // "response": {
  20365. // "$ref": "CreativeAssetMetadata"
  20366. // },
  20367. // "scopes": [
  20368. // "https://www.googleapis.com/auth/dfatrafficking"
  20369. // ],
  20370. // "supportsMediaUpload": true
  20371. // }
  20372. }
  20373. // method id "dfareporting.creativeFieldValues.delete":
  20374. type CreativeFieldValuesDeleteCall struct {
  20375. s *Service
  20376. profileId int64
  20377. creativeFieldId int64
  20378. id int64
  20379. urlParams_ gensupport.URLParams
  20380. ctx_ context.Context
  20381. header_ http.Header
  20382. }
  20383. // Delete: Deletes an existing creative field value.
  20384. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  20385. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20386. c.profileId = profileId
  20387. c.creativeFieldId = creativeFieldId
  20388. c.id = id
  20389. return c
  20390. }
  20391. // Fields allows partial responses to be retrieved. See
  20392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20393. // for more information.
  20394. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  20395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20396. return c
  20397. }
  20398. // Context sets the context to be used in this call's Do method. Any
  20399. // pending HTTP request will be aborted if the provided context is
  20400. // canceled.
  20401. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  20402. c.ctx_ = ctx
  20403. return c
  20404. }
  20405. // Header returns an http.Header that can be modified by the caller to
  20406. // add HTTP headers to the request.
  20407. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  20408. if c.header_ == nil {
  20409. c.header_ = make(http.Header)
  20410. }
  20411. return c.header_
  20412. }
  20413. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20414. reqHeaders := make(http.Header)
  20415. for k, v := range c.header_ {
  20416. reqHeaders[k] = v
  20417. }
  20418. reqHeaders.Set("User-Agent", c.s.userAgent())
  20419. var body io.Reader = nil
  20420. c.urlParams_.Set("alt", alt)
  20421. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  20422. urls += "?" + c.urlParams_.Encode()
  20423. req, _ := http.NewRequest("DELETE", urls, body)
  20424. req.Header = reqHeaders
  20425. googleapi.Expand(req.URL, map[string]string{
  20426. "profileId": strconv.FormatInt(c.profileId, 10),
  20427. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20428. "id": strconv.FormatInt(c.id, 10),
  20429. })
  20430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20431. }
  20432. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  20433. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20434. gensupport.SetOptions(c.urlParams_, opts...)
  20435. res, err := c.doRequest("json")
  20436. if err != nil {
  20437. return err
  20438. }
  20439. defer googleapi.CloseBody(res)
  20440. if err := googleapi.CheckResponse(res); err != nil {
  20441. return err
  20442. }
  20443. return nil
  20444. // {
  20445. // "description": "Deletes an existing creative field value.",
  20446. // "httpMethod": "DELETE",
  20447. // "id": "dfareporting.creativeFieldValues.delete",
  20448. // "parameterOrder": [
  20449. // "profileId",
  20450. // "creativeFieldId",
  20451. // "id"
  20452. // ],
  20453. // "parameters": {
  20454. // "creativeFieldId": {
  20455. // "description": "Creative field ID for this creative field value.",
  20456. // "format": "int64",
  20457. // "location": "path",
  20458. // "required": true,
  20459. // "type": "string"
  20460. // },
  20461. // "id": {
  20462. // "description": "Creative Field Value ID",
  20463. // "format": "int64",
  20464. // "location": "path",
  20465. // "required": true,
  20466. // "type": "string"
  20467. // },
  20468. // "profileId": {
  20469. // "description": "User profile ID associated with this request.",
  20470. // "format": "int64",
  20471. // "location": "path",
  20472. // "required": true,
  20473. // "type": "string"
  20474. // }
  20475. // },
  20476. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  20477. // "scopes": [
  20478. // "https://www.googleapis.com/auth/dfatrafficking"
  20479. // ]
  20480. // }
  20481. }
  20482. // method id "dfareporting.creativeFieldValues.get":
  20483. type CreativeFieldValuesGetCall struct {
  20484. s *Service
  20485. profileId int64
  20486. creativeFieldId int64
  20487. id int64
  20488. urlParams_ gensupport.URLParams
  20489. ifNoneMatch_ string
  20490. ctx_ context.Context
  20491. header_ http.Header
  20492. }
  20493. // Get: Gets one creative field value by ID.
  20494. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  20495. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20496. c.profileId = profileId
  20497. c.creativeFieldId = creativeFieldId
  20498. c.id = id
  20499. return c
  20500. }
  20501. // Fields allows partial responses to be retrieved. See
  20502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20503. // for more information.
  20504. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  20505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20506. return c
  20507. }
  20508. // IfNoneMatch sets the optional parameter which makes the operation
  20509. // fail if the object's ETag matches the given value. This is useful for
  20510. // getting updates only after the object has changed since the last
  20511. // request. Use googleapi.IsNotModified to check whether the response
  20512. // error from Do is the result of In-None-Match.
  20513. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  20514. c.ifNoneMatch_ = entityTag
  20515. return c
  20516. }
  20517. // Context sets the context to be used in this call's Do method. Any
  20518. // pending HTTP request will be aborted if the provided context is
  20519. // canceled.
  20520. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  20521. c.ctx_ = ctx
  20522. return c
  20523. }
  20524. // Header returns an http.Header that can be modified by the caller to
  20525. // add HTTP headers to the request.
  20526. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  20527. if c.header_ == nil {
  20528. c.header_ = make(http.Header)
  20529. }
  20530. return c.header_
  20531. }
  20532. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  20533. reqHeaders := make(http.Header)
  20534. for k, v := range c.header_ {
  20535. reqHeaders[k] = v
  20536. }
  20537. reqHeaders.Set("User-Agent", c.s.userAgent())
  20538. if c.ifNoneMatch_ != "" {
  20539. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20540. }
  20541. var body io.Reader = nil
  20542. c.urlParams_.Set("alt", alt)
  20543. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  20544. urls += "?" + c.urlParams_.Encode()
  20545. req, _ := http.NewRequest("GET", urls, body)
  20546. req.Header = reqHeaders
  20547. googleapi.Expand(req.URL, map[string]string{
  20548. "profileId": strconv.FormatInt(c.profileId, 10),
  20549. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20550. "id": strconv.FormatInt(c.id, 10),
  20551. })
  20552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20553. }
  20554. // Do executes the "dfareporting.creativeFieldValues.get" call.
  20555. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  20556. // non-2xx status code is an error. Response headers are in either
  20557. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  20558. // returned at all) in error.(*googleapi.Error).Header. Use
  20559. // googleapi.IsNotModified to check whether the returned error was
  20560. // because http.StatusNotModified was returned.
  20561. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  20562. gensupport.SetOptions(c.urlParams_, opts...)
  20563. res, err := c.doRequest("json")
  20564. if res != nil && res.StatusCode == http.StatusNotModified {
  20565. if res.Body != nil {
  20566. res.Body.Close()
  20567. }
  20568. return nil, &googleapi.Error{
  20569. Code: res.StatusCode,
  20570. Header: res.Header,
  20571. }
  20572. }
  20573. if err != nil {
  20574. return nil, err
  20575. }
  20576. defer googleapi.CloseBody(res)
  20577. if err := googleapi.CheckResponse(res); err != nil {
  20578. return nil, err
  20579. }
  20580. ret := &CreativeFieldValue{
  20581. ServerResponse: googleapi.ServerResponse{
  20582. Header: res.Header,
  20583. HTTPStatusCode: res.StatusCode,
  20584. },
  20585. }
  20586. target := &ret
  20587. if err := gensupport.DecodeResponse(target, res); err != nil {
  20588. return nil, err
  20589. }
  20590. return ret, nil
  20591. // {
  20592. // "description": "Gets one creative field value by ID.",
  20593. // "httpMethod": "GET",
  20594. // "id": "dfareporting.creativeFieldValues.get",
  20595. // "parameterOrder": [
  20596. // "profileId",
  20597. // "creativeFieldId",
  20598. // "id"
  20599. // ],
  20600. // "parameters": {
  20601. // "creativeFieldId": {
  20602. // "description": "Creative field ID for this creative field value.",
  20603. // "format": "int64",
  20604. // "location": "path",
  20605. // "required": true,
  20606. // "type": "string"
  20607. // },
  20608. // "id": {
  20609. // "description": "Creative Field Value ID",
  20610. // "format": "int64",
  20611. // "location": "path",
  20612. // "required": true,
  20613. // "type": "string"
  20614. // },
  20615. // "profileId": {
  20616. // "description": "User profile ID associated with this request.",
  20617. // "format": "int64",
  20618. // "location": "path",
  20619. // "required": true,
  20620. // "type": "string"
  20621. // }
  20622. // },
  20623. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  20624. // "response": {
  20625. // "$ref": "CreativeFieldValue"
  20626. // },
  20627. // "scopes": [
  20628. // "https://www.googleapis.com/auth/dfatrafficking"
  20629. // ]
  20630. // }
  20631. }
  20632. // method id "dfareporting.creativeFieldValues.insert":
  20633. type CreativeFieldValuesInsertCall struct {
  20634. s *Service
  20635. profileId int64
  20636. creativeFieldId int64
  20637. creativefieldvalue *CreativeFieldValue
  20638. urlParams_ gensupport.URLParams
  20639. ctx_ context.Context
  20640. header_ http.Header
  20641. }
  20642. // Insert: Inserts a new creative field value.
  20643. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  20644. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20645. c.profileId = profileId
  20646. c.creativeFieldId = creativeFieldId
  20647. c.creativefieldvalue = creativefieldvalue
  20648. return c
  20649. }
  20650. // Fields allows partial responses to be retrieved. See
  20651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20652. // for more information.
  20653. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  20654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20655. return c
  20656. }
  20657. // Context sets the context to be used in this call's Do method. Any
  20658. // pending HTTP request will be aborted if the provided context is
  20659. // canceled.
  20660. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  20661. c.ctx_ = ctx
  20662. return c
  20663. }
  20664. // Header returns an http.Header that can be modified by the caller to
  20665. // add HTTP headers to the request.
  20666. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  20667. if c.header_ == nil {
  20668. c.header_ = make(http.Header)
  20669. }
  20670. return c.header_
  20671. }
  20672. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  20673. reqHeaders := make(http.Header)
  20674. for k, v := range c.header_ {
  20675. reqHeaders[k] = v
  20676. }
  20677. reqHeaders.Set("User-Agent", c.s.userAgent())
  20678. var body io.Reader = nil
  20679. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  20680. if err != nil {
  20681. return nil, err
  20682. }
  20683. reqHeaders.Set("Content-Type", "application/json")
  20684. c.urlParams_.Set("alt", alt)
  20685. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  20686. urls += "?" + c.urlParams_.Encode()
  20687. req, _ := http.NewRequest("POST", urls, body)
  20688. req.Header = reqHeaders
  20689. googleapi.Expand(req.URL, map[string]string{
  20690. "profileId": strconv.FormatInt(c.profileId, 10),
  20691. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20692. })
  20693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20694. }
  20695. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  20696. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  20697. // non-2xx status code is an error. Response headers are in either
  20698. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  20699. // returned at all) in error.(*googleapi.Error).Header. Use
  20700. // googleapi.IsNotModified to check whether the returned error was
  20701. // because http.StatusNotModified was returned.
  20702. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  20703. gensupport.SetOptions(c.urlParams_, opts...)
  20704. res, err := c.doRequest("json")
  20705. if res != nil && res.StatusCode == http.StatusNotModified {
  20706. if res.Body != nil {
  20707. res.Body.Close()
  20708. }
  20709. return nil, &googleapi.Error{
  20710. Code: res.StatusCode,
  20711. Header: res.Header,
  20712. }
  20713. }
  20714. if err != nil {
  20715. return nil, err
  20716. }
  20717. defer googleapi.CloseBody(res)
  20718. if err := googleapi.CheckResponse(res); err != nil {
  20719. return nil, err
  20720. }
  20721. ret := &CreativeFieldValue{
  20722. ServerResponse: googleapi.ServerResponse{
  20723. Header: res.Header,
  20724. HTTPStatusCode: res.StatusCode,
  20725. },
  20726. }
  20727. target := &ret
  20728. if err := gensupport.DecodeResponse(target, res); err != nil {
  20729. return nil, err
  20730. }
  20731. return ret, nil
  20732. // {
  20733. // "description": "Inserts a new creative field value.",
  20734. // "httpMethod": "POST",
  20735. // "id": "dfareporting.creativeFieldValues.insert",
  20736. // "parameterOrder": [
  20737. // "profileId",
  20738. // "creativeFieldId"
  20739. // ],
  20740. // "parameters": {
  20741. // "creativeFieldId": {
  20742. // "description": "Creative field ID for this creative field value.",
  20743. // "format": "int64",
  20744. // "location": "path",
  20745. // "required": true,
  20746. // "type": "string"
  20747. // },
  20748. // "profileId": {
  20749. // "description": "User profile ID associated with this request.",
  20750. // "format": "int64",
  20751. // "location": "path",
  20752. // "required": true,
  20753. // "type": "string"
  20754. // }
  20755. // },
  20756. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  20757. // "request": {
  20758. // "$ref": "CreativeFieldValue"
  20759. // },
  20760. // "response": {
  20761. // "$ref": "CreativeFieldValue"
  20762. // },
  20763. // "scopes": [
  20764. // "https://www.googleapis.com/auth/dfatrafficking"
  20765. // ]
  20766. // }
  20767. }
  20768. // method id "dfareporting.creativeFieldValues.list":
  20769. type CreativeFieldValuesListCall struct {
  20770. s *Service
  20771. profileId int64
  20772. creativeFieldId int64
  20773. urlParams_ gensupport.URLParams
  20774. ifNoneMatch_ string
  20775. ctx_ context.Context
  20776. header_ http.Header
  20777. }
  20778. // List: Retrieves a list of creative field values, possibly filtered.
  20779. // This method supports paging.
  20780. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  20781. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20782. c.profileId = profileId
  20783. c.creativeFieldId = creativeFieldId
  20784. return c
  20785. }
  20786. // Ids sets the optional parameter "ids": Select only creative field
  20787. // values with these IDs.
  20788. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  20789. var ids_ []string
  20790. for _, v := range ids {
  20791. ids_ = append(ids_, fmt.Sprint(v))
  20792. }
  20793. c.urlParams_.SetMulti("ids", ids_)
  20794. return c
  20795. }
  20796. // MaxResults sets the optional parameter "maxResults": Maximum number
  20797. // of results to return.
  20798. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  20799. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20800. return c
  20801. }
  20802. // PageToken sets the optional parameter "pageToken": Value of the
  20803. // nextPageToken from the previous result page.
  20804. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  20805. c.urlParams_.Set("pageToken", pageToken)
  20806. return c
  20807. }
  20808. // SearchString sets the optional parameter "searchString": Allows
  20809. // searching for creative field values by their values. Wildcards (e.g.
  20810. // *) are not allowed.
  20811. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  20812. c.urlParams_.Set("searchString", searchString)
  20813. return c
  20814. }
  20815. // SortField sets the optional parameter "sortField": Field by which to
  20816. // sort the list.
  20817. //
  20818. // Possible values:
  20819. // "ID" (default)
  20820. // "VALUE"
  20821. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  20822. c.urlParams_.Set("sortField", sortField)
  20823. return c
  20824. }
  20825. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20826. // results.
  20827. //
  20828. // Possible values:
  20829. // "ASCENDING" (default)
  20830. // "DESCENDING"
  20831. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  20832. c.urlParams_.Set("sortOrder", sortOrder)
  20833. return c
  20834. }
  20835. // Fields allows partial responses to be retrieved. See
  20836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20837. // for more information.
  20838. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  20839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20840. return c
  20841. }
  20842. // IfNoneMatch sets the optional parameter which makes the operation
  20843. // fail if the object's ETag matches the given value. This is useful for
  20844. // getting updates only after the object has changed since the last
  20845. // request. Use googleapi.IsNotModified to check whether the response
  20846. // error from Do is the result of In-None-Match.
  20847. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  20848. c.ifNoneMatch_ = entityTag
  20849. return c
  20850. }
  20851. // Context sets the context to be used in this call's Do method. Any
  20852. // pending HTTP request will be aborted if the provided context is
  20853. // canceled.
  20854. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  20855. c.ctx_ = ctx
  20856. return c
  20857. }
  20858. // Header returns an http.Header that can be modified by the caller to
  20859. // add HTTP headers to the request.
  20860. func (c *CreativeFieldValuesListCall) Header() http.Header {
  20861. if c.header_ == nil {
  20862. c.header_ = make(http.Header)
  20863. }
  20864. return c.header_
  20865. }
  20866. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  20867. reqHeaders := make(http.Header)
  20868. for k, v := range c.header_ {
  20869. reqHeaders[k] = v
  20870. }
  20871. reqHeaders.Set("User-Agent", c.s.userAgent())
  20872. if c.ifNoneMatch_ != "" {
  20873. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20874. }
  20875. var body io.Reader = nil
  20876. c.urlParams_.Set("alt", alt)
  20877. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  20878. urls += "?" + c.urlParams_.Encode()
  20879. req, _ := http.NewRequest("GET", urls, body)
  20880. req.Header = reqHeaders
  20881. googleapi.Expand(req.URL, map[string]string{
  20882. "profileId": strconv.FormatInt(c.profileId, 10),
  20883. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20884. })
  20885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20886. }
  20887. // Do executes the "dfareporting.creativeFieldValues.list" call.
  20888. // Exactly one of *CreativeFieldValuesListResponse or error will be
  20889. // non-nil. Any non-2xx status code is an error. Response headers are in
  20890. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  20891. // a response was returned at all) in error.(*googleapi.Error).Header.
  20892. // Use googleapi.IsNotModified to check whether the returned error was
  20893. // because http.StatusNotModified was returned.
  20894. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  20895. gensupport.SetOptions(c.urlParams_, opts...)
  20896. res, err := c.doRequest("json")
  20897. if res != nil && res.StatusCode == http.StatusNotModified {
  20898. if res.Body != nil {
  20899. res.Body.Close()
  20900. }
  20901. return nil, &googleapi.Error{
  20902. Code: res.StatusCode,
  20903. Header: res.Header,
  20904. }
  20905. }
  20906. if err != nil {
  20907. return nil, err
  20908. }
  20909. defer googleapi.CloseBody(res)
  20910. if err := googleapi.CheckResponse(res); err != nil {
  20911. return nil, err
  20912. }
  20913. ret := &CreativeFieldValuesListResponse{
  20914. ServerResponse: googleapi.ServerResponse{
  20915. Header: res.Header,
  20916. HTTPStatusCode: res.StatusCode,
  20917. },
  20918. }
  20919. target := &ret
  20920. if err := gensupport.DecodeResponse(target, res); err != nil {
  20921. return nil, err
  20922. }
  20923. return ret, nil
  20924. // {
  20925. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  20926. // "httpMethod": "GET",
  20927. // "id": "dfareporting.creativeFieldValues.list",
  20928. // "parameterOrder": [
  20929. // "profileId",
  20930. // "creativeFieldId"
  20931. // ],
  20932. // "parameters": {
  20933. // "creativeFieldId": {
  20934. // "description": "Creative field ID for this creative field value.",
  20935. // "format": "int64",
  20936. // "location": "path",
  20937. // "required": true,
  20938. // "type": "string"
  20939. // },
  20940. // "ids": {
  20941. // "description": "Select only creative field values with these IDs.",
  20942. // "format": "int64",
  20943. // "location": "query",
  20944. // "repeated": true,
  20945. // "type": "string"
  20946. // },
  20947. // "maxResults": {
  20948. // "default": "1000",
  20949. // "description": "Maximum number of results to return.",
  20950. // "format": "int32",
  20951. // "location": "query",
  20952. // "maximum": "1000",
  20953. // "minimum": "0",
  20954. // "type": "integer"
  20955. // },
  20956. // "pageToken": {
  20957. // "description": "Value of the nextPageToken from the previous result page.",
  20958. // "location": "query",
  20959. // "type": "string"
  20960. // },
  20961. // "profileId": {
  20962. // "description": "User profile ID associated with this request.",
  20963. // "format": "int64",
  20964. // "location": "path",
  20965. // "required": true,
  20966. // "type": "string"
  20967. // },
  20968. // "searchString": {
  20969. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  20970. // "location": "query",
  20971. // "type": "string"
  20972. // },
  20973. // "sortField": {
  20974. // "default": "ID",
  20975. // "description": "Field by which to sort the list.",
  20976. // "enum": [
  20977. // "ID",
  20978. // "VALUE"
  20979. // ],
  20980. // "enumDescriptions": [
  20981. // "",
  20982. // ""
  20983. // ],
  20984. // "location": "query",
  20985. // "type": "string"
  20986. // },
  20987. // "sortOrder": {
  20988. // "default": "ASCENDING",
  20989. // "description": "Order of sorted results.",
  20990. // "enum": [
  20991. // "ASCENDING",
  20992. // "DESCENDING"
  20993. // ],
  20994. // "enumDescriptions": [
  20995. // "",
  20996. // ""
  20997. // ],
  20998. // "location": "query",
  20999. // "type": "string"
  21000. // }
  21001. // },
  21002. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21003. // "response": {
  21004. // "$ref": "CreativeFieldValuesListResponse"
  21005. // },
  21006. // "scopes": [
  21007. // "https://www.googleapis.com/auth/dfatrafficking"
  21008. // ]
  21009. // }
  21010. }
  21011. // Pages invokes f for each page of results.
  21012. // A non-nil error returned from f will halt the iteration.
  21013. // The provided context supersedes any context provided to the Context method.
  21014. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  21015. c.ctx_ = ctx
  21016. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21017. for {
  21018. x, err := c.Do()
  21019. if err != nil {
  21020. return err
  21021. }
  21022. if err := f(x); err != nil {
  21023. return err
  21024. }
  21025. if x.NextPageToken == "" {
  21026. return nil
  21027. }
  21028. c.PageToken(x.NextPageToken)
  21029. }
  21030. }
  21031. // method id "dfareporting.creativeFieldValues.patch":
  21032. type CreativeFieldValuesPatchCall struct {
  21033. s *Service
  21034. profileId int64
  21035. creativeFieldId int64
  21036. creativefieldvalue *CreativeFieldValue
  21037. urlParams_ gensupport.URLParams
  21038. ctx_ context.Context
  21039. header_ http.Header
  21040. }
  21041. // Patch: Updates an existing creative field value. This method supports
  21042. // patch semantics.
  21043. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  21044. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21045. c.profileId = profileId
  21046. c.creativeFieldId = creativeFieldId
  21047. c.urlParams_.Set("id", fmt.Sprint(id))
  21048. c.creativefieldvalue = creativefieldvalue
  21049. return c
  21050. }
  21051. // Fields allows partial responses to be retrieved. See
  21052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21053. // for more information.
  21054. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  21055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21056. return c
  21057. }
  21058. // Context sets the context to be used in this call's Do method. Any
  21059. // pending HTTP request will be aborted if the provided context is
  21060. // canceled.
  21061. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  21062. c.ctx_ = ctx
  21063. return c
  21064. }
  21065. // Header returns an http.Header that can be modified by the caller to
  21066. // add HTTP headers to the request.
  21067. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  21068. if c.header_ == nil {
  21069. c.header_ = make(http.Header)
  21070. }
  21071. return c.header_
  21072. }
  21073. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  21074. reqHeaders := make(http.Header)
  21075. for k, v := range c.header_ {
  21076. reqHeaders[k] = v
  21077. }
  21078. reqHeaders.Set("User-Agent", c.s.userAgent())
  21079. var body io.Reader = nil
  21080. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  21081. if err != nil {
  21082. return nil, err
  21083. }
  21084. reqHeaders.Set("Content-Type", "application/json")
  21085. c.urlParams_.Set("alt", alt)
  21086. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  21087. urls += "?" + c.urlParams_.Encode()
  21088. req, _ := http.NewRequest("PATCH", urls, body)
  21089. req.Header = reqHeaders
  21090. googleapi.Expand(req.URL, map[string]string{
  21091. "profileId": strconv.FormatInt(c.profileId, 10),
  21092. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21093. })
  21094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21095. }
  21096. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  21097. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21098. // non-2xx status code is an error. Response headers are in either
  21099. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21100. // returned at all) in error.(*googleapi.Error).Header. Use
  21101. // googleapi.IsNotModified to check whether the returned error was
  21102. // because http.StatusNotModified was returned.
  21103. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21104. gensupport.SetOptions(c.urlParams_, opts...)
  21105. res, err := c.doRequest("json")
  21106. if res != nil && res.StatusCode == http.StatusNotModified {
  21107. if res.Body != nil {
  21108. res.Body.Close()
  21109. }
  21110. return nil, &googleapi.Error{
  21111. Code: res.StatusCode,
  21112. Header: res.Header,
  21113. }
  21114. }
  21115. if err != nil {
  21116. return nil, err
  21117. }
  21118. defer googleapi.CloseBody(res)
  21119. if err := googleapi.CheckResponse(res); err != nil {
  21120. return nil, err
  21121. }
  21122. ret := &CreativeFieldValue{
  21123. ServerResponse: googleapi.ServerResponse{
  21124. Header: res.Header,
  21125. HTTPStatusCode: res.StatusCode,
  21126. },
  21127. }
  21128. target := &ret
  21129. if err := gensupport.DecodeResponse(target, res); err != nil {
  21130. return nil, err
  21131. }
  21132. return ret, nil
  21133. // {
  21134. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  21135. // "httpMethod": "PATCH",
  21136. // "id": "dfareporting.creativeFieldValues.patch",
  21137. // "parameterOrder": [
  21138. // "profileId",
  21139. // "creativeFieldId",
  21140. // "id"
  21141. // ],
  21142. // "parameters": {
  21143. // "creativeFieldId": {
  21144. // "description": "Creative field ID for this creative field value.",
  21145. // "format": "int64",
  21146. // "location": "path",
  21147. // "required": true,
  21148. // "type": "string"
  21149. // },
  21150. // "id": {
  21151. // "description": "Creative Field Value ID",
  21152. // "format": "int64",
  21153. // "location": "query",
  21154. // "required": true,
  21155. // "type": "string"
  21156. // },
  21157. // "profileId": {
  21158. // "description": "User profile ID associated with this request.",
  21159. // "format": "int64",
  21160. // "location": "path",
  21161. // "required": true,
  21162. // "type": "string"
  21163. // }
  21164. // },
  21165. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21166. // "request": {
  21167. // "$ref": "CreativeFieldValue"
  21168. // },
  21169. // "response": {
  21170. // "$ref": "CreativeFieldValue"
  21171. // },
  21172. // "scopes": [
  21173. // "https://www.googleapis.com/auth/dfatrafficking"
  21174. // ]
  21175. // }
  21176. }
  21177. // method id "dfareporting.creativeFieldValues.update":
  21178. type CreativeFieldValuesUpdateCall struct {
  21179. s *Service
  21180. profileId int64
  21181. creativeFieldId int64
  21182. creativefieldvalue *CreativeFieldValue
  21183. urlParams_ gensupport.URLParams
  21184. ctx_ context.Context
  21185. header_ http.Header
  21186. }
  21187. // Update: Updates an existing creative field value.
  21188. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  21189. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21190. c.profileId = profileId
  21191. c.creativeFieldId = creativeFieldId
  21192. c.creativefieldvalue = creativefieldvalue
  21193. return c
  21194. }
  21195. // Fields allows partial responses to be retrieved. See
  21196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21197. // for more information.
  21198. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  21199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21200. return c
  21201. }
  21202. // Context sets the context to be used in this call's Do method. Any
  21203. // pending HTTP request will be aborted if the provided context is
  21204. // canceled.
  21205. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  21206. c.ctx_ = ctx
  21207. return c
  21208. }
  21209. // Header returns an http.Header that can be modified by the caller to
  21210. // add HTTP headers to the request.
  21211. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  21212. if c.header_ == nil {
  21213. c.header_ = make(http.Header)
  21214. }
  21215. return c.header_
  21216. }
  21217. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  21218. reqHeaders := make(http.Header)
  21219. for k, v := range c.header_ {
  21220. reqHeaders[k] = v
  21221. }
  21222. reqHeaders.Set("User-Agent", c.s.userAgent())
  21223. var body io.Reader = nil
  21224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  21225. if err != nil {
  21226. return nil, err
  21227. }
  21228. reqHeaders.Set("Content-Type", "application/json")
  21229. c.urlParams_.Set("alt", alt)
  21230. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  21231. urls += "?" + c.urlParams_.Encode()
  21232. req, _ := http.NewRequest("PUT", urls, body)
  21233. req.Header = reqHeaders
  21234. googleapi.Expand(req.URL, map[string]string{
  21235. "profileId": strconv.FormatInt(c.profileId, 10),
  21236. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21237. })
  21238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21239. }
  21240. // Do executes the "dfareporting.creativeFieldValues.update" call.
  21241. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21242. // non-2xx status code is an error. Response headers are in either
  21243. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21244. // returned at all) in error.(*googleapi.Error).Header. Use
  21245. // googleapi.IsNotModified to check whether the returned error was
  21246. // because http.StatusNotModified was returned.
  21247. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21248. gensupport.SetOptions(c.urlParams_, opts...)
  21249. res, err := c.doRequest("json")
  21250. if res != nil && res.StatusCode == http.StatusNotModified {
  21251. if res.Body != nil {
  21252. res.Body.Close()
  21253. }
  21254. return nil, &googleapi.Error{
  21255. Code: res.StatusCode,
  21256. Header: res.Header,
  21257. }
  21258. }
  21259. if err != nil {
  21260. return nil, err
  21261. }
  21262. defer googleapi.CloseBody(res)
  21263. if err := googleapi.CheckResponse(res); err != nil {
  21264. return nil, err
  21265. }
  21266. ret := &CreativeFieldValue{
  21267. ServerResponse: googleapi.ServerResponse{
  21268. Header: res.Header,
  21269. HTTPStatusCode: res.StatusCode,
  21270. },
  21271. }
  21272. target := &ret
  21273. if err := gensupport.DecodeResponse(target, res); err != nil {
  21274. return nil, err
  21275. }
  21276. return ret, nil
  21277. // {
  21278. // "description": "Updates an existing creative field value.",
  21279. // "httpMethod": "PUT",
  21280. // "id": "dfareporting.creativeFieldValues.update",
  21281. // "parameterOrder": [
  21282. // "profileId",
  21283. // "creativeFieldId"
  21284. // ],
  21285. // "parameters": {
  21286. // "creativeFieldId": {
  21287. // "description": "Creative field ID for this creative field value.",
  21288. // "format": "int64",
  21289. // "location": "path",
  21290. // "required": true,
  21291. // "type": "string"
  21292. // },
  21293. // "profileId": {
  21294. // "description": "User profile ID associated with this request.",
  21295. // "format": "int64",
  21296. // "location": "path",
  21297. // "required": true,
  21298. // "type": "string"
  21299. // }
  21300. // },
  21301. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21302. // "request": {
  21303. // "$ref": "CreativeFieldValue"
  21304. // },
  21305. // "response": {
  21306. // "$ref": "CreativeFieldValue"
  21307. // },
  21308. // "scopes": [
  21309. // "https://www.googleapis.com/auth/dfatrafficking"
  21310. // ]
  21311. // }
  21312. }
  21313. // method id "dfareporting.creativeFields.delete":
  21314. type CreativeFieldsDeleteCall struct {
  21315. s *Service
  21316. profileId int64
  21317. id int64
  21318. urlParams_ gensupport.URLParams
  21319. ctx_ context.Context
  21320. header_ http.Header
  21321. }
  21322. // Delete: Deletes an existing creative field.
  21323. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  21324. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21325. c.profileId = profileId
  21326. c.id = id
  21327. return c
  21328. }
  21329. // Fields allows partial responses to be retrieved. See
  21330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21331. // for more information.
  21332. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  21333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21334. return c
  21335. }
  21336. // Context sets the context to be used in this call's Do method. Any
  21337. // pending HTTP request will be aborted if the provided context is
  21338. // canceled.
  21339. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  21340. c.ctx_ = ctx
  21341. return c
  21342. }
  21343. // Header returns an http.Header that can be modified by the caller to
  21344. // add HTTP headers to the request.
  21345. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  21346. if c.header_ == nil {
  21347. c.header_ = make(http.Header)
  21348. }
  21349. return c.header_
  21350. }
  21351. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  21352. reqHeaders := make(http.Header)
  21353. for k, v := range c.header_ {
  21354. reqHeaders[k] = v
  21355. }
  21356. reqHeaders.Set("User-Agent", c.s.userAgent())
  21357. var body io.Reader = nil
  21358. c.urlParams_.Set("alt", alt)
  21359. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  21360. urls += "?" + c.urlParams_.Encode()
  21361. req, _ := http.NewRequest("DELETE", urls, body)
  21362. req.Header = reqHeaders
  21363. googleapi.Expand(req.URL, map[string]string{
  21364. "profileId": strconv.FormatInt(c.profileId, 10),
  21365. "id": strconv.FormatInt(c.id, 10),
  21366. })
  21367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21368. }
  21369. // Do executes the "dfareporting.creativeFields.delete" call.
  21370. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  21371. gensupport.SetOptions(c.urlParams_, opts...)
  21372. res, err := c.doRequest("json")
  21373. if err != nil {
  21374. return err
  21375. }
  21376. defer googleapi.CloseBody(res)
  21377. if err := googleapi.CheckResponse(res); err != nil {
  21378. return err
  21379. }
  21380. return nil
  21381. // {
  21382. // "description": "Deletes an existing creative field.",
  21383. // "httpMethod": "DELETE",
  21384. // "id": "dfareporting.creativeFields.delete",
  21385. // "parameterOrder": [
  21386. // "profileId",
  21387. // "id"
  21388. // ],
  21389. // "parameters": {
  21390. // "id": {
  21391. // "description": "Creative Field ID",
  21392. // "format": "int64",
  21393. // "location": "path",
  21394. // "required": true,
  21395. // "type": "string"
  21396. // },
  21397. // "profileId": {
  21398. // "description": "User profile ID associated with this request.",
  21399. // "format": "int64",
  21400. // "location": "path",
  21401. // "required": true,
  21402. // "type": "string"
  21403. // }
  21404. // },
  21405. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  21406. // "scopes": [
  21407. // "https://www.googleapis.com/auth/dfatrafficking"
  21408. // ]
  21409. // }
  21410. }
  21411. // method id "dfareporting.creativeFields.get":
  21412. type CreativeFieldsGetCall struct {
  21413. s *Service
  21414. profileId int64
  21415. id int64
  21416. urlParams_ gensupport.URLParams
  21417. ifNoneMatch_ string
  21418. ctx_ context.Context
  21419. header_ http.Header
  21420. }
  21421. // Get: Gets one creative field by ID.
  21422. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  21423. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21424. c.profileId = profileId
  21425. c.id = id
  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 *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  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 *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  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 *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  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 *CreativeFieldsGetCall) Header() http.Header {
  21454. if c.header_ == nil {
  21455. c.header_ = make(http.Header)
  21456. }
  21457. return c.header_
  21458. }
  21459. func (c *CreativeFieldsGetCall) 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. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  21471. urls += "?" + c.urlParams_.Encode()
  21472. req, _ := http.NewRequest("GET", urls, body)
  21473. req.Header = reqHeaders
  21474. googleapi.Expand(req.URL, map[string]string{
  21475. "profileId": strconv.FormatInt(c.profileId, 10),
  21476. "id": strconv.FormatInt(c.id, 10),
  21477. })
  21478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21479. }
  21480. // Do executes the "dfareporting.creativeFields.get" call.
  21481. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  21482. // status code is an error. Response headers are in either
  21483. // *CreativeField.ServerResponse.Header or (if a response was returned
  21484. // at all) in error.(*googleapi.Error).Header. Use
  21485. // googleapi.IsNotModified to check whether the returned error was
  21486. // because http.StatusNotModified was returned.
  21487. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  21488. gensupport.SetOptions(c.urlParams_, opts...)
  21489. res, err := c.doRequest("json")
  21490. if res != nil && res.StatusCode == http.StatusNotModified {
  21491. if res.Body != nil {
  21492. res.Body.Close()
  21493. }
  21494. return nil, &googleapi.Error{
  21495. Code: res.StatusCode,
  21496. Header: res.Header,
  21497. }
  21498. }
  21499. if err != nil {
  21500. return nil, err
  21501. }
  21502. defer googleapi.CloseBody(res)
  21503. if err := googleapi.CheckResponse(res); err != nil {
  21504. return nil, err
  21505. }
  21506. ret := &CreativeField{
  21507. ServerResponse: googleapi.ServerResponse{
  21508. Header: res.Header,
  21509. HTTPStatusCode: res.StatusCode,
  21510. },
  21511. }
  21512. target := &ret
  21513. if err := gensupport.DecodeResponse(target, res); err != nil {
  21514. return nil, err
  21515. }
  21516. return ret, nil
  21517. // {
  21518. // "description": "Gets one creative field by ID.",
  21519. // "httpMethod": "GET",
  21520. // "id": "dfareporting.creativeFields.get",
  21521. // "parameterOrder": [
  21522. // "profileId",
  21523. // "id"
  21524. // ],
  21525. // "parameters": {
  21526. // "id": {
  21527. // "description": "Creative Field ID",
  21528. // "format": "int64",
  21529. // "location": "path",
  21530. // "required": true,
  21531. // "type": "string"
  21532. // },
  21533. // "profileId": {
  21534. // "description": "User profile ID associated with this request.",
  21535. // "format": "int64",
  21536. // "location": "path",
  21537. // "required": true,
  21538. // "type": "string"
  21539. // }
  21540. // },
  21541. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  21542. // "response": {
  21543. // "$ref": "CreativeField"
  21544. // },
  21545. // "scopes": [
  21546. // "https://www.googleapis.com/auth/dfatrafficking"
  21547. // ]
  21548. // }
  21549. }
  21550. // method id "dfareporting.creativeFields.insert":
  21551. type CreativeFieldsInsertCall struct {
  21552. s *Service
  21553. profileId int64
  21554. creativefield *CreativeField
  21555. urlParams_ gensupport.URLParams
  21556. ctx_ context.Context
  21557. header_ http.Header
  21558. }
  21559. // Insert: Inserts a new creative field.
  21560. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  21561. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21562. c.profileId = profileId
  21563. c.creativefield = creativefield
  21564. return c
  21565. }
  21566. // Fields allows partial responses to be retrieved. See
  21567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21568. // for more information.
  21569. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  21570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21571. return c
  21572. }
  21573. // Context sets the context to be used in this call's Do method. Any
  21574. // pending HTTP request will be aborted if the provided context is
  21575. // canceled.
  21576. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  21577. c.ctx_ = ctx
  21578. return c
  21579. }
  21580. // Header returns an http.Header that can be modified by the caller to
  21581. // add HTTP headers to the request.
  21582. func (c *CreativeFieldsInsertCall) Header() http.Header {
  21583. if c.header_ == nil {
  21584. c.header_ = make(http.Header)
  21585. }
  21586. return c.header_
  21587. }
  21588. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  21589. reqHeaders := make(http.Header)
  21590. for k, v := range c.header_ {
  21591. reqHeaders[k] = v
  21592. }
  21593. reqHeaders.Set("User-Agent", c.s.userAgent())
  21594. var body io.Reader = nil
  21595. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  21596. if err != nil {
  21597. return nil, err
  21598. }
  21599. reqHeaders.Set("Content-Type", "application/json")
  21600. c.urlParams_.Set("alt", alt)
  21601. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  21602. urls += "?" + c.urlParams_.Encode()
  21603. req, _ := http.NewRequest("POST", urls, body)
  21604. req.Header = reqHeaders
  21605. googleapi.Expand(req.URL, map[string]string{
  21606. "profileId": strconv.FormatInt(c.profileId, 10),
  21607. })
  21608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21609. }
  21610. // Do executes the "dfareporting.creativeFields.insert" call.
  21611. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  21612. // status code is an error. Response headers are in either
  21613. // *CreativeField.ServerResponse.Header or (if a response was returned
  21614. // at all) in error.(*googleapi.Error).Header. Use
  21615. // googleapi.IsNotModified to check whether the returned error was
  21616. // because http.StatusNotModified was returned.
  21617. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  21618. gensupport.SetOptions(c.urlParams_, opts...)
  21619. res, err := c.doRequest("json")
  21620. if res != nil && res.StatusCode == http.StatusNotModified {
  21621. if res.Body != nil {
  21622. res.Body.Close()
  21623. }
  21624. return nil, &googleapi.Error{
  21625. Code: res.StatusCode,
  21626. Header: res.Header,
  21627. }
  21628. }
  21629. if err != nil {
  21630. return nil, err
  21631. }
  21632. defer googleapi.CloseBody(res)
  21633. if err := googleapi.CheckResponse(res); err != nil {
  21634. return nil, err
  21635. }
  21636. ret := &CreativeField{
  21637. ServerResponse: googleapi.ServerResponse{
  21638. Header: res.Header,
  21639. HTTPStatusCode: res.StatusCode,
  21640. },
  21641. }
  21642. target := &ret
  21643. if err := gensupport.DecodeResponse(target, res); err != nil {
  21644. return nil, err
  21645. }
  21646. return ret, nil
  21647. // {
  21648. // "description": "Inserts a new creative field.",
  21649. // "httpMethod": "POST",
  21650. // "id": "dfareporting.creativeFields.insert",
  21651. // "parameterOrder": [
  21652. // "profileId"
  21653. // ],
  21654. // "parameters": {
  21655. // "profileId": {
  21656. // "description": "User profile ID associated with this request.",
  21657. // "format": "int64",
  21658. // "location": "path",
  21659. // "required": true,
  21660. // "type": "string"
  21661. // }
  21662. // },
  21663. // "path": "userprofiles/{profileId}/creativeFields",
  21664. // "request": {
  21665. // "$ref": "CreativeField"
  21666. // },
  21667. // "response": {
  21668. // "$ref": "CreativeField"
  21669. // },
  21670. // "scopes": [
  21671. // "https://www.googleapis.com/auth/dfatrafficking"
  21672. // ]
  21673. // }
  21674. }
  21675. // method id "dfareporting.creativeFields.list":
  21676. type CreativeFieldsListCall struct {
  21677. s *Service
  21678. profileId int64
  21679. urlParams_ gensupport.URLParams
  21680. ifNoneMatch_ string
  21681. ctx_ context.Context
  21682. header_ http.Header
  21683. }
  21684. // List: Retrieves a list of creative fields, possibly filtered. This
  21685. // method supports paging.
  21686. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  21687. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21688. c.profileId = profileId
  21689. return c
  21690. }
  21691. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  21692. // only creative fields that belong to these advertisers.
  21693. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  21694. var advertiserIds_ []string
  21695. for _, v := range advertiserIds {
  21696. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  21697. }
  21698. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  21699. return c
  21700. }
  21701. // Ids sets the optional parameter "ids": Select only creative fields
  21702. // with these IDs.
  21703. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  21704. var ids_ []string
  21705. for _, v := range ids {
  21706. ids_ = append(ids_, fmt.Sprint(v))
  21707. }
  21708. c.urlParams_.SetMulti("ids", ids_)
  21709. return c
  21710. }
  21711. // MaxResults sets the optional parameter "maxResults": Maximum number
  21712. // of results to return.
  21713. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  21714. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21715. return c
  21716. }
  21717. // PageToken sets the optional parameter "pageToken": Value of the
  21718. // nextPageToken from the previous result page.
  21719. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  21720. c.urlParams_.Set("pageToken", pageToken)
  21721. return c
  21722. }
  21723. // SearchString sets the optional parameter "searchString": Allows
  21724. // searching for creative fields by name or ID. Wildcards (*) are
  21725. // allowed. For example, "creativefield*2015" will return creative
  21726. // fields with names like "creativefield June 2015", "creativefield
  21727. // April 2015", or simply "creativefield 2015". Most of the searches
  21728. // also add wild-cards implicitly at the start and the end of the search
  21729. // string. For example, a search string of "creativefield" will match
  21730. // creative fields with the name "my creativefield", "creativefield
  21731. // 2015", or simply "creativefield".
  21732. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  21733. c.urlParams_.Set("searchString", searchString)
  21734. return c
  21735. }
  21736. // SortField sets the optional parameter "sortField": Field by which to
  21737. // sort the list.
  21738. //
  21739. // Possible values:
  21740. // "ID" (default)
  21741. // "NAME"
  21742. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  21743. c.urlParams_.Set("sortField", sortField)
  21744. return c
  21745. }
  21746. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  21747. // results.
  21748. //
  21749. // Possible values:
  21750. // "ASCENDING" (default)
  21751. // "DESCENDING"
  21752. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  21753. c.urlParams_.Set("sortOrder", sortOrder)
  21754. return c
  21755. }
  21756. // Fields allows partial responses to be retrieved. See
  21757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21758. // for more information.
  21759. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  21760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21761. return c
  21762. }
  21763. // IfNoneMatch sets the optional parameter which makes the operation
  21764. // fail if the object's ETag matches the given value. This is useful for
  21765. // getting updates only after the object has changed since the last
  21766. // request. Use googleapi.IsNotModified to check whether the response
  21767. // error from Do is the result of In-None-Match.
  21768. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  21769. c.ifNoneMatch_ = entityTag
  21770. return c
  21771. }
  21772. // Context sets the context to be used in this call's Do method. Any
  21773. // pending HTTP request will be aborted if the provided context is
  21774. // canceled.
  21775. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  21776. c.ctx_ = ctx
  21777. return c
  21778. }
  21779. // Header returns an http.Header that can be modified by the caller to
  21780. // add HTTP headers to the request.
  21781. func (c *CreativeFieldsListCall) Header() http.Header {
  21782. if c.header_ == nil {
  21783. c.header_ = make(http.Header)
  21784. }
  21785. return c.header_
  21786. }
  21787. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  21788. reqHeaders := make(http.Header)
  21789. for k, v := range c.header_ {
  21790. reqHeaders[k] = v
  21791. }
  21792. reqHeaders.Set("User-Agent", c.s.userAgent())
  21793. if c.ifNoneMatch_ != "" {
  21794. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21795. }
  21796. var body io.Reader = nil
  21797. c.urlParams_.Set("alt", alt)
  21798. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  21799. urls += "?" + c.urlParams_.Encode()
  21800. req, _ := http.NewRequest("GET", urls, body)
  21801. req.Header = reqHeaders
  21802. googleapi.Expand(req.URL, map[string]string{
  21803. "profileId": strconv.FormatInt(c.profileId, 10),
  21804. })
  21805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21806. }
  21807. // Do executes the "dfareporting.creativeFields.list" call.
  21808. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  21809. // Any non-2xx status code is an error. Response headers are in either
  21810. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  21811. // was returned at all) in error.(*googleapi.Error).Header. Use
  21812. // googleapi.IsNotModified to check whether the returned error was
  21813. // because http.StatusNotModified was returned.
  21814. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  21815. gensupport.SetOptions(c.urlParams_, opts...)
  21816. res, err := c.doRequest("json")
  21817. if res != nil && res.StatusCode == http.StatusNotModified {
  21818. if res.Body != nil {
  21819. res.Body.Close()
  21820. }
  21821. return nil, &googleapi.Error{
  21822. Code: res.StatusCode,
  21823. Header: res.Header,
  21824. }
  21825. }
  21826. if err != nil {
  21827. return nil, err
  21828. }
  21829. defer googleapi.CloseBody(res)
  21830. if err := googleapi.CheckResponse(res); err != nil {
  21831. return nil, err
  21832. }
  21833. ret := &CreativeFieldsListResponse{
  21834. ServerResponse: googleapi.ServerResponse{
  21835. Header: res.Header,
  21836. HTTPStatusCode: res.StatusCode,
  21837. },
  21838. }
  21839. target := &ret
  21840. if err := gensupport.DecodeResponse(target, res); err != nil {
  21841. return nil, err
  21842. }
  21843. return ret, nil
  21844. // {
  21845. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  21846. // "httpMethod": "GET",
  21847. // "id": "dfareporting.creativeFields.list",
  21848. // "parameterOrder": [
  21849. // "profileId"
  21850. // ],
  21851. // "parameters": {
  21852. // "advertiserIds": {
  21853. // "description": "Select only creative fields that belong to these advertisers.",
  21854. // "format": "int64",
  21855. // "location": "query",
  21856. // "repeated": true,
  21857. // "type": "string"
  21858. // },
  21859. // "ids": {
  21860. // "description": "Select only creative fields with these IDs.",
  21861. // "format": "int64",
  21862. // "location": "query",
  21863. // "repeated": true,
  21864. // "type": "string"
  21865. // },
  21866. // "maxResults": {
  21867. // "default": "1000",
  21868. // "description": "Maximum number of results to return.",
  21869. // "format": "int32",
  21870. // "location": "query",
  21871. // "maximum": "1000",
  21872. // "minimum": "0",
  21873. // "type": "integer"
  21874. // },
  21875. // "pageToken": {
  21876. // "description": "Value of the nextPageToken from the previous result page.",
  21877. // "location": "query",
  21878. // "type": "string"
  21879. // },
  21880. // "profileId": {
  21881. // "description": "User profile ID associated with this request.",
  21882. // "format": "int64",
  21883. // "location": "path",
  21884. // "required": true,
  21885. // "type": "string"
  21886. // },
  21887. // "searchString": {
  21888. // "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\".",
  21889. // "location": "query",
  21890. // "type": "string"
  21891. // },
  21892. // "sortField": {
  21893. // "default": "ID",
  21894. // "description": "Field by which to sort the list.",
  21895. // "enum": [
  21896. // "ID",
  21897. // "NAME"
  21898. // ],
  21899. // "enumDescriptions": [
  21900. // "",
  21901. // ""
  21902. // ],
  21903. // "location": "query",
  21904. // "type": "string"
  21905. // },
  21906. // "sortOrder": {
  21907. // "default": "ASCENDING",
  21908. // "description": "Order of sorted results.",
  21909. // "enum": [
  21910. // "ASCENDING",
  21911. // "DESCENDING"
  21912. // ],
  21913. // "enumDescriptions": [
  21914. // "",
  21915. // ""
  21916. // ],
  21917. // "location": "query",
  21918. // "type": "string"
  21919. // }
  21920. // },
  21921. // "path": "userprofiles/{profileId}/creativeFields",
  21922. // "response": {
  21923. // "$ref": "CreativeFieldsListResponse"
  21924. // },
  21925. // "scopes": [
  21926. // "https://www.googleapis.com/auth/dfatrafficking"
  21927. // ]
  21928. // }
  21929. }
  21930. // Pages invokes f for each page of results.
  21931. // A non-nil error returned from f will halt the iteration.
  21932. // The provided context supersedes any context provided to the Context method.
  21933. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  21934. c.ctx_ = ctx
  21935. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21936. for {
  21937. x, err := c.Do()
  21938. if err != nil {
  21939. return err
  21940. }
  21941. if err := f(x); err != nil {
  21942. return err
  21943. }
  21944. if x.NextPageToken == "" {
  21945. return nil
  21946. }
  21947. c.PageToken(x.NextPageToken)
  21948. }
  21949. }
  21950. // method id "dfareporting.creativeFields.patch":
  21951. type CreativeFieldsPatchCall struct {
  21952. s *Service
  21953. profileId int64
  21954. creativefield *CreativeField
  21955. urlParams_ gensupport.URLParams
  21956. ctx_ context.Context
  21957. header_ http.Header
  21958. }
  21959. // Patch: Updates an existing creative field. This method supports patch
  21960. // semantics.
  21961. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  21962. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21963. c.profileId = profileId
  21964. c.urlParams_.Set("id", fmt.Sprint(id))
  21965. c.creativefield = creativefield
  21966. return c
  21967. }
  21968. // Fields allows partial responses to be retrieved. See
  21969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21970. // for more information.
  21971. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  21972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21973. return c
  21974. }
  21975. // Context sets the context to be used in this call's Do method. Any
  21976. // pending HTTP request will be aborted if the provided context is
  21977. // canceled.
  21978. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  21979. c.ctx_ = ctx
  21980. return c
  21981. }
  21982. // Header returns an http.Header that can be modified by the caller to
  21983. // add HTTP headers to the request.
  21984. func (c *CreativeFieldsPatchCall) Header() http.Header {
  21985. if c.header_ == nil {
  21986. c.header_ = make(http.Header)
  21987. }
  21988. return c.header_
  21989. }
  21990. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  21991. reqHeaders := make(http.Header)
  21992. for k, v := range c.header_ {
  21993. reqHeaders[k] = v
  21994. }
  21995. reqHeaders.Set("User-Agent", c.s.userAgent())
  21996. var body io.Reader = nil
  21997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  21998. if err != nil {
  21999. return nil, err
  22000. }
  22001. reqHeaders.Set("Content-Type", "application/json")
  22002. c.urlParams_.Set("alt", alt)
  22003. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22004. urls += "?" + c.urlParams_.Encode()
  22005. req, _ := http.NewRequest("PATCH", urls, body)
  22006. req.Header = reqHeaders
  22007. googleapi.Expand(req.URL, map[string]string{
  22008. "profileId": strconv.FormatInt(c.profileId, 10),
  22009. })
  22010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22011. }
  22012. // Do executes the "dfareporting.creativeFields.patch" call.
  22013. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22014. // status code is an error. Response headers are in either
  22015. // *CreativeField.ServerResponse.Header or (if a response was returned
  22016. // at all) in error.(*googleapi.Error).Header. Use
  22017. // googleapi.IsNotModified to check whether the returned error was
  22018. // because http.StatusNotModified was returned.
  22019. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22020. gensupport.SetOptions(c.urlParams_, opts...)
  22021. res, err := c.doRequest("json")
  22022. if res != nil && res.StatusCode == http.StatusNotModified {
  22023. if res.Body != nil {
  22024. res.Body.Close()
  22025. }
  22026. return nil, &googleapi.Error{
  22027. Code: res.StatusCode,
  22028. Header: res.Header,
  22029. }
  22030. }
  22031. if err != nil {
  22032. return nil, err
  22033. }
  22034. defer googleapi.CloseBody(res)
  22035. if err := googleapi.CheckResponse(res); err != nil {
  22036. return nil, err
  22037. }
  22038. ret := &CreativeField{
  22039. ServerResponse: googleapi.ServerResponse{
  22040. Header: res.Header,
  22041. HTTPStatusCode: res.StatusCode,
  22042. },
  22043. }
  22044. target := &ret
  22045. if err := gensupport.DecodeResponse(target, res); err != nil {
  22046. return nil, err
  22047. }
  22048. return ret, nil
  22049. // {
  22050. // "description": "Updates an existing creative field. This method supports patch semantics.",
  22051. // "httpMethod": "PATCH",
  22052. // "id": "dfareporting.creativeFields.patch",
  22053. // "parameterOrder": [
  22054. // "profileId",
  22055. // "id"
  22056. // ],
  22057. // "parameters": {
  22058. // "id": {
  22059. // "description": "Creative Field ID",
  22060. // "format": "int64",
  22061. // "location": "query",
  22062. // "required": true,
  22063. // "type": "string"
  22064. // },
  22065. // "profileId": {
  22066. // "description": "User profile ID associated with this request.",
  22067. // "format": "int64",
  22068. // "location": "path",
  22069. // "required": true,
  22070. // "type": "string"
  22071. // }
  22072. // },
  22073. // "path": "userprofiles/{profileId}/creativeFields",
  22074. // "request": {
  22075. // "$ref": "CreativeField"
  22076. // },
  22077. // "response": {
  22078. // "$ref": "CreativeField"
  22079. // },
  22080. // "scopes": [
  22081. // "https://www.googleapis.com/auth/dfatrafficking"
  22082. // ]
  22083. // }
  22084. }
  22085. // method id "dfareporting.creativeFields.update":
  22086. type CreativeFieldsUpdateCall struct {
  22087. s *Service
  22088. profileId int64
  22089. creativefield *CreativeField
  22090. urlParams_ gensupport.URLParams
  22091. ctx_ context.Context
  22092. header_ http.Header
  22093. }
  22094. // Update: Updates an existing creative field.
  22095. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  22096. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22097. c.profileId = profileId
  22098. c.creativefield = creativefield
  22099. return c
  22100. }
  22101. // Fields allows partial responses to be retrieved. See
  22102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22103. // for more information.
  22104. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  22105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22106. return c
  22107. }
  22108. // Context sets the context to be used in this call's Do method. Any
  22109. // pending HTTP request will be aborted if the provided context is
  22110. // canceled.
  22111. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  22112. c.ctx_ = ctx
  22113. return c
  22114. }
  22115. // Header returns an http.Header that can be modified by the caller to
  22116. // add HTTP headers to the request.
  22117. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  22118. if c.header_ == nil {
  22119. c.header_ = make(http.Header)
  22120. }
  22121. return c.header_
  22122. }
  22123. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  22124. reqHeaders := make(http.Header)
  22125. for k, v := range c.header_ {
  22126. reqHeaders[k] = v
  22127. }
  22128. reqHeaders.Set("User-Agent", c.s.userAgent())
  22129. var body io.Reader = nil
  22130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  22131. if err != nil {
  22132. return nil, err
  22133. }
  22134. reqHeaders.Set("Content-Type", "application/json")
  22135. c.urlParams_.Set("alt", alt)
  22136. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22137. urls += "?" + c.urlParams_.Encode()
  22138. req, _ := http.NewRequest("PUT", urls, body)
  22139. req.Header = reqHeaders
  22140. googleapi.Expand(req.URL, map[string]string{
  22141. "profileId": strconv.FormatInt(c.profileId, 10),
  22142. })
  22143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22144. }
  22145. // Do executes the "dfareporting.creativeFields.update" call.
  22146. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22147. // status code is an error. Response headers are in either
  22148. // *CreativeField.ServerResponse.Header or (if a response was returned
  22149. // at all) in error.(*googleapi.Error).Header. Use
  22150. // googleapi.IsNotModified to check whether the returned error was
  22151. // because http.StatusNotModified was returned.
  22152. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22153. gensupport.SetOptions(c.urlParams_, opts...)
  22154. res, err := c.doRequest("json")
  22155. if res != nil && res.StatusCode == http.StatusNotModified {
  22156. if res.Body != nil {
  22157. res.Body.Close()
  22158. }
  22159. return nil, &googleapi.Error{
  22160. Code: res.StatusCode,
  22161. Header: res.Header,
  22162. }
  22163. }
  22164. if err != nil {
  22165. return nil, err
  22166. }
  22167. defer googleapi.CloseBody(res)
  22168. if err := googleapi.CheckResponse(res); err != nil {
  22169. return nil, err
  22170. }
  22171. ret := &CreativeField{
  22172. ServerResponse: googleapi.ServerResponse{
  22173. Header: res.Header,
  22174. HTTPStatusCode: res.StatusCode,
  22175. },
  22176. }
  22177. target := &ret
  22178. if err := gensupport.DecodeResponse(target, res); err != nil {
  22179. return nil, err
  22180. }
  22181. return ret, nil
  22182. // {
  22183. // "description": "Updates an existing creative field.",
  22184. // "httpMethod": "PUT",
  22185. // "id": "dfareporting.creativeFields.update",
  22186. // "parameterOrder": [
  22187. // "profileId"
  22188. // ],
  22189. // "parameters": {
  22190. // "profileId": {
  22191. // "description": "User profile ID associated with this request.",
  22192. // "format": "int64",
  22193. // "location": "path",
  22194. // "required": true,
  22195. // "type": "string"
  22196. // }
  22197. // },
  22198. // "path": "userprofiles/{profileId}/creativeFields",
  22199. // "request": {
  22200. // "$ref": "CreativeField"
  22201. // },
  22202. // "response": {
  22203. // "$ref": "CreativeField"
  22204. // },
  22205. // "scopes": [
  22206. // "https://www.googleapis.com/auth/dfatrafficking"
  22207. // ]
  22208. // }
  22209. }
  22210. // method id "dfareporting.creativeGroups.get":
  22211. type CreativeGroupsGetCall struct {
  22212. s *Service
  22213. profileId int64
  22214. id int64
  22215. urlParams_ gensupport.URLParams
  22216. ifNoneMatch_ string
  22217. ctx_ context.Context
  22218. header_ http.Header
  22219. }
  22220. // Get: Gets one creative group by ID.
  22221. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  22222. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22223. c.profileId = profileId
  22224. c.id = id
  22225. return c
  22226. }
  22227. // Fields allows partial responses to be retrieved. See
  22228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22229. // for more information.
  22230. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  22231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22232. return c
  22233. }
  22234. // IfNoneMatch sets the optional parameter which makes the operation
  22235. // fail if the object's ETag matches the given value. This is useful for
  22236. // getting updates only after the object has changed since the last
  22237. // request. Use googleapi.IsNotModified to check whether the response
  22238. // error from Do is the result of In-None-Match.
  22239. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  22240. c.ifNoneMatch_ = entityTag
  22241. return c
  22242. }
  22243. // Context sets the context to be used in this call's Do method. Any
  22244. // pending HTTP request will be aborted if the provided context is
  22245. // canceled.
  22246. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  22247. c.ctx_ = ctx
  22248. return c
  22249. }
  22250. // Header returns an http.Header that can be modified by the caller to
  22251. // add HTTP headers to the request.
  22252. func (c *CreativeGroupsGetCall) Header() http.Header {
  22253. if c.header_ == nil {
  22254. c.header_ = make(http.Header)
  22255. }
  22256. return c.header_
  22257. }
  22258. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  22259. reqHeaders := make(http.Header)
  22260. for k, v := range c.header_ {
  22261. reqHeaders[k] = v
  22262. }
  22263. reqHeaders.Set("User-Agent", c.s.userAgent())
  22264. if c.ifNoneMatch_ != "" {
  22265. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22266. }
  22267. var body io.Reader = nil
  22268. c.urlParams_.Set("alt", alt)
  22269. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  22270. urls += "?" + c.urlParams_.Encode()
  22271. req, _ := http.NewRequest("GET", urls, body)
  22272. req.Header = reqHeaders
  22273. googleapi.Expand(req.URL, map[string]string{
  22274. "profileId": strconv.FormatInt(c.profileId, 10),
  22275. "id": strconv.FormatInt(c.id, 10),
  22276. })
  22277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22278. }
  22279. // Do executes the "dfareporting.creativeGroups.get" call.
  22280. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22281. // status code is an error. Response headers are in either
  22282. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22283. // at all) in error.(*googleapi.Error).Header. Use
  22284. // googleapi.IsNotModified to check whether the returned error was
  22285. // because http.StatusNotModified was returned.
  22286. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22287. gensupport.SetOptions(c.urlParams_, opts...)
  22288. res, err := c.doRequest("json")
  22289. if res != nil && res.StatusCode == http.StatusNotModified {
  22290. if res.Body != nil {
  22291. res.Body.Close()
  22292. }
  22293. return nil, &googleapi.Error{
  22294. Code: res.StatusCode,
  22295. Header: res.Header,
  22296. }
  22297. }
  22298. if err != nil {
  22299. return nil, err
  22300. }
  22301. defer googleapi.CloseBody(res)
  22302. if err := googleapi.CheckResponse(res); err != nil {
  22303. return nil, err
  22304. }
  22305. ret := &CreativeGroup{
  22306. ServerResponse: googleapi.ServerResponse{
  22307. Header: res.Header,
  22308. HTTPStatusCode: res.StatusCode,
  22309. },
  22310. }
  22311. target := &ret
  22312. if err := gensupport.DecodeResponse(target, res); err != nil {
  22313. return nil, err
  22314. }
  22315. return ret, nil
  22316. // {
  22317. // "description": "Gets one creative group by ID.",
  22318. // "httpMethod": "GET",
  22319. // "id": "dfareporting.creativeGroups.get",
  22320. // "parameterOrder": [
  22321. // "profileId",
  22322. // "id"
  22323. // ],
  22324. // "parameters": {
  22325. // "id": {
  22326. // "description": "Creative group ID.",
  22327. // "format": "int64",
  22328. // "location": "path",
  22329. // "required": true,
  22330. // "type": "string"
  22331. // },
  22332. // "profileId": {
  22333. // "description": "User profile ID associated with this request.",
  22334. // "format": "int64",
  22335. // "location": "path",
  22336. // "required": true,
  22337. // "type": "string"
  22338. // }
  22339. // },
  22340. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  22341. // "response": {
  22342. // "$ref": "CreativeGroup"
  22343. // },
  22344. // "scopes": [
  22345. // "https://www.googleapis.com/auth/dfatrafficking"
  22346. // ]
  22347. // }
  22348. }
  22349. // method id "dfareporting.creativeGroups.insert":
  22350. type CreativeGroupsInsertCall struct {
  22351. s *Service
  22352. profileId int64
  22353. creativegroup *CreativeGroup
  22354. urlParams_ gensupport.URLParams
  22355. ctx_ context.Context
  22356. header_ http.Header
  22357. }
  22358. // Insert: Inserts a new creative group.
  22359. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  22360. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22361. c.profileId = profileId
  22362. c.creativegroup = creativegroup
  22363. return c
  22364. }
  22365. // Fields allows partial responses to be retrieved. See
  22366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22367. // for more information.
  22368. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  22369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22370. return c
  22371. }
  22372. // Context sets the context to be used in this call's Do method. Any
  22373. // pending HTTP request will be aborted if the provided context is
  22374. // canceled.
  22375. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  22376. c.ctx_ = ctx
  22377. return c
  22378. }
  22379. // Header returns an http.Header that can be modified by the caller to
  22380. // add HTTP headers to the request.
  22381. func (c *CreativeGroupsInsertCall) Header() http.Header {
  22382. if c.header_ == nil {
  22383. c.header_ = make(http.Header)
  22384. }
  22385. return c.header_
  22386. }
  22387. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  22388. reqHeaders := make(http.Header)
  22389. for k, v := range c.header_ {
  22390. reqHeaders[k] = v
  22391. }
  22392. reqHeaders.Set("User-Agent", c.s.userAgent())
  22393. var body io.Reader = nil
  22394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  22395. if err != nil {
  22396. return nil, err
  22397. }
  22398. reqHeaders.Set("Content-Type", "application/json")
  22399. c.urlParams_.Set("alt", alt)
  22400. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22401. urls += "?" + c.urlParams_.Encode()
  22402. req, _ := http.NewRequest("POST", urls, body)
  22403. req.Header = reqHeaders
  22404. googleapi.Expand(req.URL, map[string]string{
  22405. "profileId": strconv.FormatInt(c.profileId, 10),
  22406. })
  22407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22408. }
  22409. // Do executes the "dfareporting.creativeGroups.insert" call.
  22410. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22411. // status code is an error. Response headers are in either
  22412. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22413. // at all) in error.(*googleapi.Error).Header. Use
  22414. // googleapi.IsNotModified to check whether the returned error was
  22415. // because http.StatusNotModified was returned.
  22416. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22417. gensupport.SetOptions(c.urlParams_, opts...)
  22418. res, err := c.doRequest("json")
  22419. if res != nil && res.StatusCode == http.StatusNotModified {
  22420. if res.Body != nil {
  22421. res.Body.Close()
  22422. }
  22423. return nil, &googleapi.Error{
  22424. Code: res.StatusCode,
  22425. Header: res.Header,
  22426. }
  22427. }
  22428. if err != nil {
  22429. return nil, err
  22430. }
  22431. defer googleapi.CloseBody(res)
  22432. if err := googleapi.CheckResponse(res); err != nil {
  22433. return nil, err
  22434. }
  22435. ret := &CreativeGroup{
  22436. ServerResponse: googleapi.ServerResponse{
  22437. Header: res.Header,
  22438. HTTPStatusCode: res.StatusCode,
  22439. },
  22440. }
  22441. target := &ret
  22442. if err := gensupport.DecodeResponse(target, res); err != nil {
  22443. return nil, err
  22444. }
  22445. return ret, nil
  22446. // {
  22447. // "description": "Inserts a new creative group.",
  22448. // "httpMethod": "POST",
  22449. // "id": "dfareporting.creativeGroups.insert",
  22450. // "parameterOrder": [
  22451. // "profileId"
  22452. // ],
  22453. // "parameters": {
  22454. // "profileId": {
  22455. // "description": "User profile ID associated with this request.",
  22456. // "format": "int64",
  22457. // "location": "path",
  22458. // "required": true,
  22459. // "type": "string"
  22460. // }
  22461. // },
  22462. // "path": "userprofiles/{profileId}/creativeGroups",
  22463. // "request": {
  22464. // "$ref": "CreativeGroup"
  22465. // },
  22466. // "response": {
  22467. // "$ref": "CreativeGroup"
  22468. // },
  22469. // "scopes": [
  22470. // "https://www.googleapis.com/auth/dfatrafficking"
  22471. // ]
  22472. // }
  22473. }
  22474. // method id "dfareporting.creativeGroups.list":
  22475. type CreativeGroupsListCall struct {
  22476. s *Service
  22477. profileId int64
  22478. urlParams_ gensupport.URLParams
  22479. ifNoneMatch_ string
  22480. ctx_ context.Context
  22481. header_ http.Header
  22482. }
  22483. // List: Retrieves a list of creative groups, possibly filtered. This
  22484. // method supports paging.
  22485. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  22486. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22487. c.profileId = profileId
  22488. return c
  22489. }
  22490. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  22491. // only creative groups that belong to these advertisers.
  22492. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  22493. var advertiserIds_ []string
  22494. for _, v := range advertiserIds {
  22495. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  22496. }
  22497. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  22498. return c
  22499. }
  22500. // GroupNumber sets the optional parameter "groupNumber": Select only
  22501. // creative groups that belong to this subgroup.
  22502. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  22503. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  22504. return c
  22505. }
  22506. // Ids sets the optional parameter "ids": Select only creative groups
  22507. // with these IDs.
  22508. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  22509. var ids_ []string
  22510. for _, v := range ids {
  22511. ids_ = append(ids_, fmt.Sprint(v))
  22512. }
  22513. c.urlParams_.SetMulti("ids", ids_)
  22514. return c
  22515. }
  22516. // MaxResults sets the optional parameter "maxResults": Maximum number
  22517. // of results to return.
  22518. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  22519. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22520. return c
  22521. }
  22522. // PageToken sets the optional parameter "pageToken": Value of the
  22523. // nextPageToken from the previous result page.
  22524. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  22525. c.urlParams_.Set("pageToken", pageToken)
  22526. return c
  22527. }
  22528. // SearchString sets the optional parameter "searchString": Allows
  22529. // searching for creative groups by name or ID. Wildcards (*) are
  22530. // allowed. For example, "creativegroup*2015" will return creative
  22531. // groups with names like "creativegroup June 2015", "creativegroup
  22532. // April 2015", or simply "creativegroup 2015". Most of the searches
  22533. // also add wild-cards implicitly at the start and the end of the search
  22534. // string. For example, a search string of "creativegroup" will match
  22535. // creative groups with the name "my creativegroup", "creativegroup
  22536. // 2015", or simply "creativegroup".
  22537. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  22538. c.urlParams_.Set("searchString", searchString)
  22539. return c
  22540. }
  22541. // SortField sets the optional parameter "sortField": Field by which to
  22542. // sort the list.
  22543. //
  22544. // Possible values:
  22545. // "ID" (default)
  22546. // "NAME"
  22547. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  22548. c.urlParams_.Set("sortField", sortField)
  22549. return c
  22550. }
  22551. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22552. // results.
  22553. //
  22554. // Possible values:
  22555. // "ASCENDING" (default)
  22556. // "DESCENDING"
  22557. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  22558. c.urlParams_.Set("sortOrder", sortOrder)
  22559. return c
  22560. }
  22561. // Fields allows partial responses to be retrieved. See
  22562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22563. // for more information.
  22564. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  22565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22566. return c
  22567. }
  22568. // IfNoneMatch sets the optional parameter which makes the operation
  22569. // fail if the object's ETag matches the given value. This is useful for
  22570. // getting updates only after the object has changed since the last
  22571. // request. Use googleapi.IsNotModified to check whether the response
  22572. // error from Do is the result of In-None-Match.
  22573. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  22574. c.ifNoneMatch_ = entityTag
  22575. return c
  22576. }
  22577. // Context sets the context to be used in this call's Do method. Any
  22578. // pending HTTP request will be aborted if the provided context is
  22579. // canceled.
  22580. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  22581. c.ctx_ = ctx
  22582. return c
  22583. }
  22584. // Header returns an http.Header that can be modified by the caller to
  22585. // add HTTP headers to the request.
  22586. func (c *CreativeGroupsListCall) Header() http.Header {
  22587. if c.header_ == nil {
  22588. c.header_ = make(http.Header)
  22589. }
  22590. return c.header_
  22591. }
  22592. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  22593. reqHeaders := make(http.Header)
  22594. for k, v := range c.header_ {
  22595. reqHeaders[k] = v
  22596. }
  22597. reqHeaders.Set("User-Agent", c.s.userAgent())
  22598. if c.ifNoneMatch_ != "" {
  22599. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22600. }
  22601. var body io.Reader = nil
  22602. c.urlParams_.Set("alt", alt)
  22603. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22604. urls += "?" + c.urlParams_.Encode()
  22605. req, _ := http.NewRequest("GET", urls, body)
  22606. req.Header = reqHeaders
  22607. googleapi.Expand(req.URL, map[string]string{
  22608. "profileId": strconv.FormatInt(c.profileId, 10),
  22609. })
  22610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22611. }
  22612. // Do executes the "dfareporting.creativeGroups.list" call.
  22613. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  22614. // Any non-2xx status code is an error. Response headers are in either
  22615. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  22616. // was returned at all) in error.(*googleapi.Error).Header. Use
  22617. // googleapi.IsNotModified to check whether the returned error was
  22618. // because http.StatusNotModified was returned.
  22619. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  22620. gensupport.SetOptions(c.urlParams_, opts...)
  22621. res, err := c.doRequest("json")
  22622. if res != nil && res.StatusCode == http.StatusNotModified {
  22623. if res.Body != nil {
  22624. res.Body.Close()
  22625. }
  22626. return nil, &googleapi.Error{
  22627. Code: res.StatusCode,
  22628. Header: res.Header,
  22629. }
  22630. }
  22631. if err != nil {
  22632. return nil, err
  22633. }
  22634. defer googleapi.CloseBody(res)
  22635. if err := googleapi.CheckResponse(res); err != nil {
  22636. return nil, err
  22637. }
  22638. ret := &CreativeGroupsListResponse{
  22639. ServerResponse: googleapi.ServerResponse{
  22640. Header: res.Header,
  22641. HTTPStatusCode: res.StatusCode,
  22642. },
  22643. }
  22644. target := &ret
  22645. if err := gensupport.DecodeResponse(target, res); err != nil {
  22646. return nil, err
  22647. }
  22648. return ret, nil
  22649. // {
  22650. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  22651. // "httpMethod": "GET",
  22652. // "id": "dfareporting.creativeGroups.list",
  22653. // "parameterOrder": [
  22654. // "profileId"
  22655. // ],
  22656. // "parameters": {
  22657. // "advertiserIds": {
  22658. // "description": "Select only creative groups that belong to these advertisers.",
  22659. // "format": "int64",
  22660. // "location": "query",
  22661. // "repeated": true,
  22662. // "type": "string"
  22663. // },
  22664. // "groupNumber": {
  22665. // "description": "Select only creative groups that belong to this subgroup.",
  22666. // "format": "int32",
  22667. // "location": "query",
  22668. // "maximum": "2",
  22669. // "minimum": "1",
  22670. // "type": "integer"
  22671. // },
  22672. // "ids": {
  22673. // "description": "Select only creative groups with these IDs.",
  22674. // "format": "int64",
  22675. // "location": "query",
  22676. // "repeated": true,
  22677. // "type": "string"
  22678. // },
  22679. // "maxResults": {
  22680. // "default": "1000",
  22681. // "description": "Maximum number of results to return.",
  22682. // "format": "int32",
  22683. // "location": "query",
  22684. // "maximum": "1000",
  22685. // "minimum": "0",
  22686. // "type": "integer"
  22687. // },
  22688. // "pageToken": {
  22689. // "description": "Value of the nextPageToken from the previous result page.",
  22690. // "location": "query",
  22691. // "type": "string"
  22692. // },
  22693. // "profileId": {
  22694. // "description": "User profile ID associated with this request.",
  22695. // "format": "int64",
  22696. // "location": "path",
  22697. // "required": true,
  22698. // "type": "string"
  22699. // },
  22700. // "searchString": {
  22701. // "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\".",
  22702. // "location": "query",
  22703. // "type": "string"
  22704. // },
  22705. // "sortField": {
  22706. // "default": "ID",
  22707. // "description": "Field by which to sort the list.",
  22708. // "enum": [
  22709. // "ID",
  22710. // "NAME"
  22711. // ],
  22712. // "enumDescriptions": [
  22713. // "",
  22714. // ""
  22715. // ],
  22716. // "location": "query",
  22717. // "type": "string"
  22718. // },
  22719. // "sortOrder": {
  22720. // "default": "ASCENDING",
  22721. // "description": "Order of sorted results.",
  22722. // "enum": [
  22723. // "ASCENDING",
  22724. // "DESCENDING"
  22725. // ],
  22726. // "enumDescriptions": [
  22727. // "",
  22728. // ""
  22729. // ],
  22730. // "location": "query",
  22731. // "type": "string"
  22732. // }
  22733. // },
  22734. // "path": "userprofiles/{profileId}/creativeGroups",
  22735. // "response": {
  22736. // "$ref": "CreativeGroupsListResponse"
  22737. // },
  22738. // "scopes": [
  22739. // "https://www.googleapis.com/auth/dfatrafficking"
  22740. // ]
  22741. // }
  22742. }
  22743. // Pages invokes f for each page of results.
  22744. // A non-nil error returned from f will halt the iteration.
  22745. // The provided context supersedes any context provided to the Context method.
  22746. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  22747. c.ctx_ = ctx
  22748. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22749. for {
  22750. x, err := c.Do()
  22751. if err != nil {
  22752. return err
  22753. }
  22754. if err := f(x); err != nil {
  22755. return err
  22756. }
  22757. if x.NextPageToken == "" {
  22758. return nil
  22759. }
  22760. c.PageToken(x.NextPageToken)
  22761. }
  22762. }
  22763. // method id "dfareporting.creativeGroups.patch":
  22764. type CreativeGroupsPatchCall struct {
  22765. s *Service
  22766. profileId int64
  22767. creativegroup *CreativeGroup
  22768. urlParams_ gensupport.URLParams
  22769. ctx_ context.Context
  22770. header_ http.Header
  22771. }
  22772. // Patch: Updates an existing creative group. This method supports patch
  22773. // semantics.
  22774. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  22775. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22776. c.profileId = profileId
  22777. c.urlParams_.Set("id", fmt.Sprint(id))
  22778. c.creativegroup = creativegroup
  22779. return c
  22780. }
  22781. // Fields allows partial responses to be retrieved. See
  22782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22783. // for more information.
  22784. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  22785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22786. return c
  22787. }
  22788. // Context sets the context to be used in this call's Do method. Any
  22789. // pending HTTP request will be aborted if the provided context is
  22790. // canceled.
  22791. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  22792. c.ctx_ = ctx
  22793. return c
  22794. }
  22795. // Header returns an http.Header that can be modified by the caller to
  22796. // add HTTP headers to the request.
  22797. func (c *CreativeGroupsPatchCall) Header() http.Header {
  22798. if c.header_ == nil {
  22799. c.header_ = make(http.Header)
  22800. }
  22801. return c.header_
  22802. }
  22803. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  22804. reqHeaders := make(http.Header)
  22805. for k, v := range c.header_ {
  22806. reqHeaders[k] = v
  22807. }
  22808. reqHeaders.Set("User-Agent", c.s.userAgent())
  22809. var body io.Reader = nil
  22810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  22811. if err != nil {
  22812. return nil, err
  22813. }
  22814. reqHeaders.Set("Content-Type", "application/json")
  22815. c.urlParams_.Set("alt", alt)
  22816. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22817. urls += "?" + c.urlParams_.Encode()
  22818. req, _ := http.NewRequest("PATCH", urls, body)
  22819. req.Header = reqHeaders
  22820. googleapi.Expand(req.URL, map[string]string{
  22821. "profileId": strconv.FormatInt(c.profileId, 10),
  22822. })
  22823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22824. }
  22825. // Do executes the "dfareporting.creativeGroups.patch" call.
  22826. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22827. // status code is an error. Response headers are in either
  22828. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22829. // at all) in error.(*googleapi.Error).Header. Use
  22830. // googleapi.IsNotModified to check whether the returned error was
  22831. // because http.StatusNotModified was returned.
  22832. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22833. gensupport.SetOptions(c.urlParams_, opts...)
  22834. res, err := c.doRequest("json")
  22835. if res != nil && res.StatusCode == http.StatusNotModified {
  22836. if res.Body != nil {
  22837. res.Body.Close()
  22838. }
  22839. return nil, &googleapi.Error{
  22840. Code: res.StatusCode,
  22841. Header: res.Header,
  22842. }
  22843. }
  22844. if err != nil {
  22845. return nil, err
  22846. }
  22847. defer googleapi.CloseBody(res)
  22848. if err := googleapi.CheckResponse(res); err != nil {
  22849. return nil, err
  22850. }
  22851. ret := &CreativeGroup{
  22852. ServerResponse: googleapi.ServerResponse{
  22853. Header: res.Header,
  22854. HTTPStatusCode: res.StatusCode,
  22855. },
  22856. }
  22857. target := &ret
  22858. if err := gensupport.DecodeResponse(target, res); err != nil {
  22859. return nil, err
  22860. }
  22861. return ret, nil
  22862. // {
  22863. // "description": "Updates an existing creative group. This method supports patch semantics.",
  22864. // "httpMethod": "PATCH",
  22865. // "id": "dfareporting.creativeGroups.patch",
  22866. // "parameterOrder": [
  22867. // "profileId",
  22868. // "id"
  22869. // ],
  22870. // "parameters": {
  22871. // "id": {
  22872. // "description": "Creative group ID.",
  22873. // "format": "int64",
  22874. // "location": "query",
  22875. // "required": true,
  22876. // "type": "string"
  22877. // },
  22878. // "profileId": {
  22879. // "description": "User profile ID associated with this request.",
  22880. // "format": "int64",
  22881. // "location": "path",
  22882. // "required": true,
  22883. // "type": "string"
  22884. // }
  22885. // },
  22886. // "path": "userprofiles/{profileId}/creativeGroups",
  22887. // "request": {
  22888. // "$ref": "CreativeGroup"
  22889. // },
  22890. // "response": {
  22891. // "$ref": "CreativeGroup"
  22892. // },
  22893. // "scopes": [
  22894. // "https://www.googleapis.com/auth/dfatrafficking"
  22895. // ]
  22896. // }
  22897. }
  22898. // method id "dfareporting.creativeGroups.update":
  22899. type CreativeGroupsUpdateCall struct {
  22900. s *Service
  22901. profileId int64
  22902. creativegroup *CreativeGroup
  22903. urlParams_ gensupport.URLParams
  22904. ctx_ context.Context
  22905. header_ http.Header
  22906. }
  22907. // Update: Updates an existing creative group.
  22908. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  22909. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22910. c.profileId = profileId
  22911. c.creativegroup = creativegroup
  22912. return c
  22913. }
  22914. // Fields allows partial responses to be retrieved. See
  22915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22916. // for more information.
  22917. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  22918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22919. return c
  22920. }
  22921. // Context sets the context to be used in this call's Do method. Any
  22922. // pending HTTP request will be aborted if the provided context is
  22923. // canceled.
  22924. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  22925. c.ctx_ = ctx
  22926. return c
  22927. }
  22928. // Header returns an http.Header that can be modified by the caller to
  22929. // add HTTP headers to the request.
  22930. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  22931. if c.header_ == nil {
  22932. c.header_ = make(http.Header)
  22933. }
  22934. return c.header_
  22935. }
  22936. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  22937. reqHeaders := make(http.Header)
  22938. for k, v := range c.header_ {
  22939. reqHeaders[k] = v
  22940. }
  22941. reqHeaders.Set("User-Agent", c.s.userAgent())
  22942. var body io.Reader = nil
  22943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  22944. if err != nil {
  22945. return nil, err
  22946. }
  22947. reqHeaders.Set("Content-Type", "application/json")
  22948. c.urlParams_.Set("alt", alt)
  22949. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22950. urls += "?" + c.urlParams_.Encode()
  22951. req, _ := http.NewRequest("PUT", urls, body)
  22952. req.Header = reqHeaders
  22953. googleapi.Expand(req.URL, map[string]string{
  22954. "profileId": strconv.FormatInt(c.profileId, 10),
  22955. })
  22956. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22957. }
  22958. // Do executes the "dfareporting.creativeGroups.update" call.
  22959. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22960. // status code is an error. Response headers are in either
  22961. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22962. // at all) in error.(*googleapi.Error).Header. Use
  22963. // googleapi.IsNotModified to check whether the returned error was
  22964. // because http.StatusNotModified was returned.
  22965. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22966. gensupport.SetOptions(c.urlParams_, opts...)
  22967. res, err := c.doRequest("json")
  22968. if res != nil && res.StatusCode == http.StatusNotModified {
  22969. if res.Body != nil {
  22970. res.Body.Close()
  22971. }
  22972. return nil, &googleapi.Error{
  22973. Code: res.StatusCode,
  22974. Header: res.Header,
  22975. }
  22976. }
  22977. if err != nil {
  22978. return nil, err
  22979. }
  22980. defer googleapi.CloseBody(res)
  22981. if err := googleapi.CheckResponse(res); err != nil {
  22982. return nil, err
  22983. }
  22984. ret := &CreativeGroup{
  22985. ServerResponse: googleapi.ServerResponse{
  22986. Header: res.Header,
  22987. HTTPStatusCode: res.StatusCode,
  22988. },
  22989. }
  22990. target := &ret
  22991. if err := gensupport.DecodeResponse(target, res); err != nil {
  22992. return nil, err
  22993. }
  22994. return ret, nil
  22995. // {
  22996. // "description": "Updates an existing creative group.",
  22997. // "httpMethod": "PUT",
  22998. // "id": "dfareporting.creativeGroups.update",
  22999. // "parameterOrder": [
  23000. // "profileId"
  23001. // ],
  23002. // "parameters": {
  23003. // "profileId": {
  23004. // "description": "User profile ID associated with this request.",
  23005. // "format": "int64",
  23006. // "location": "path",
  23007. // "required": true,
  23008. // "type": "string"
  23009. // }
  23010. // },
  23011. // "path": "userprofiles/{profileId}/creativeGroups",
  23012. // "request": {
  23013. // "$ref": "CreativeGroup"
  23014. // },
  23015. // "response": {
  23016. // "$ref": "CreativeGroup"
  23017. // },
  23018. // "scopes": [
  23019. // "https://www.googleapis.com/auth/dfatrafficking"
  23020. // ]
  23021. // }
  23022. }
  23023. // method id "dfareporting.creatives.get":
  23024. type CreativesGetCall struct {
  23025. s *Service
  23026. profileId int64
  23027. id int64
  23028. urlParams_ gensupport.URLParams
  23029. ifNoneMatch_ string
  23030. ctx_ context.Context
  23031. header_ http.Header
  23032. }
  23033. // Get: Gets one creative by ID.
  23034. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  23035. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23036. c.profileId = profileId
  23037. c.id = id
  23038. return c
  23039. }
  23040. // Fields allows partial responses to be retrieved. See
  23041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23042. // for more information.
  23043. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  23044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23045. return c
  23046. }
  23047. // IfNoneMatch sets the optional parameter which makes the operation
  23048. // fail if the object's ETag matches the given value. This is useful for
  23049. // getting updates only after the object has changed since the last
  23050. // request. Use googleapi.IsNotModified to check whether the response
  23051. // error from Do is the result of In-None-Match.
  23052. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  23053. c.ifNoneMatch_ = entityTag
  23054. return c
  23055. }
  23056. // Context sets the context to be used in this call's Do method. Any
  23057. // pending HTTP request will be aborted if the provided context is
  23058. // canceled.
  23059. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  23060. c.ctx_ = ctx
  23061. return c
  23062. }
  23063. // Header returns an http.Header that can be modified by the caller to
  23064. // add HTTP headers to the request.
  23065. func (c *CreativesGetCall) Header() http.Header {
  23066. if c.header_ == nil {
  23067. c.header_ = make(http.Header)
  23068. }
  23069. return c.header_
  23070. }
  23071. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  23072. reqHeaders := make(http.Header)
  23073. for k, v := range c.header_ {
  23074. reqHeaders[k] = v
  23075. }
  23076. reqHeaders.Set("User-Agent", c.s.userAgent())
  23077. if c.ifNoneMatch_ != "" {
  23078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23079. }
  23080. var body io.Reader = nil
  23081. c.urlParams_.Set("alt", alt)
  23082. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  23083. urls += "?" + c.urlParams_.Encode()
  23084. req, _ := http.NewRequest("GET", urls, body)
  23085. req.Header = reqHeaders
  23086. googleapi.Expand(req.URL, map[string]string{
  23087. "profileId": strconv.FormatInt(c.profileId, 10),
  23088. "id": strconv.FormatInt(c.id, 10),
  23089. })
  23090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23091. }
  23092. // Do executes the "dfareporting.creatives.get" call.
  23093. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23094. // code is an error. Response headers are in either
  23095. // *Creative.ServerResponse.Header or (if a response was returned at
  23096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23097. // to check whether the returned error was because
  23098. // http.StatusNotModified was returned.
  23099. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23100. gensupport.SetOptions(c.urlParams_, opts...)
  23101. res, err := c.doRequest("json")
  23102. if res != nil && res.StatusCode == http.StatusNotModified {
  23103. if res.Body != nil {
  23104. res.Body.Close()
  23105. }
  23106. return nil, &googleapi.Error{
  23107. Code: res.StatusCode,
  23108. Header: res.Header,
  23109. }
  23110. }
  23111. if err != nil {
  23112. return nil, err
  23113. }
  23114. defer googleapi.CloseBody(res)
  23115. if err := googleapi.CheckResponse(res); err != nil {
  23116. return nil, err
  23117. }
  23118. ret := &Creative{
  23119. ServerResponse: googleapi.ServerResponse{
  23120. Header: res.Header,
  23121. HTTPStatusCode: res.StatusCode,
  23122. },
  23123. }
  23124. target := &ret
  23125. if err := gensupport.DecodeResponse(target, res); err != nil {
  23126. return nil, err
  23127. }
  23128. return ret, nil
  23129. // {
  23130. // "description": "Gets one creative by ID.",
  23131. // "httpMethod": "GET",
  23132. // "id": "dfareporting.creatives.get",
  23133. // "parameterOrder": [
  23134. // "profileId",
  23135. // "id"
  23136. // ],
  23137. // "parameters": {
  23138. // "id": {
  23139. // "description": "Creative ID.",
  23140. // "format": "int64",
  23141. // "location": "path",
  23142. // "required": true,
  23143. // "type": "string"
  23144. // },
  23145. // "profileId": {
  23146. // "description": "User profile ID associated with this request.",
  23147. // "format": "int64",
  23148. // "location": "path",
  23149. // "required": true,
  23150. // "type": "string"
  23151. // }
  23152. // },
  23153. // "path": "userprofiles/{profileId}/creatives/{id}",
  23154. // "response": {
  23155. // "$ref": "Creative"
  23156. // },
  23157. // "scopes": [
  23158. // "https://www.googleapis.com/auth/dfatrafficking"
  23159. // ]
  23160. // }
  23161. }
  23162. // method id "dfareporting.creatives.insert":
  23163. type CreativesInsertCall struct {
  23164. s *Service
  23165. profileId int64
  23166. creative *Creative
  23167. urlParams_ gensupport.URLParams
  23168. ctx_ context.Context
  23169. header_ http.Header
  23170. }
  23171. // Insert: Inserts a new creative.
  23172. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  23173. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23174. c.profileId = profileId
  23175. c.creative = creative
  23176. return c
  23177. }
  23178. // Fields allows partial responses to be retrieved. See
  23179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23180. // for more information.
  23181. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  23182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23183. return c
  23184. }
  23185. // Context sets the context to be used in this call's Do method. Any
  23186. // pending HTTP request will be aborted if the provided context is
  23187. // canceled.
  23188. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  23189. c.ctx_ = ctx
  23190. return c
  23191. }
  23192. // Header returns an http.Header that can be modified by the caller to
  23193. // add HTTP headers to the request.
  23194. func (c *CreativesInsertCall) Header() http.Header {
  23195. if c.header_ == nil {
  23196. c.header_ = make(http.Header)
  23197. }
  23198. return c.header_
  23199. }
  23200. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  23201. reqHeaders := make(http.Header)
  23202. for k, v := range c.header_ {
  23203. reqHeaders[k] = v
  23204. }
  23205. reqHeaders.Set("User-Agent", c.s.userAgent())
  23206. var body io.Reader = nil
  23207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  23208. if err != nil {
  23209. return nil, err
  23210. }
  23211. reqHeaders.Set("Content-Type", "application/json")
  23212. c.urlParams_.Set("alt", alt)
  23213. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23214. urls += "?" + c.urlParams_.Encode()
  23215. req, _ := http.NewRequest("POST", urls, body)
  23216. req.Header = reqHeaders
  23217. googleapi.Expand(req.URL, map[string]string{
  23218. "profileId": strconv.FormatInt(c.profileId, 10),
  23219. })
  23220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23221. }
  23222. // Do executes the "dfareporting.creatives.insert" call.
  23223. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23224. // code is an error. Response headers are in either
  23225. // *Creative.ServerResponse.Header or (if a response was returned at
  23226. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23227. // to check whether the returned error was because
  23228. // http.StatusNotModified was returned.
  23229. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23230. gensupport.SetOptions(c.urlParams_, opts...)
  23231. res, err := c.doRequest("json")
  23232. if res != nil && res.StatusCode == http.StatusNotModified {
  23233. if res.Body != nil {
  23234. res.Body.Close()
  23235. }
  23236. return nil, &googleapi.Error{
  23237. Code: res.StatusCode,
  23238. Header: res.Header,
  23239. }
  23240. }
  23241. if err != nil {
  23242. return nil, err
  23243. }
  23244. defer googleapi.CloseBody(res)
  23245. if err := googleapi.CheckResponse(res); err != nil {
  23246. return nil, err
  23247. }
  23248. ret := &Creative{
  23249. ServerResponse: googleapi.ServerResponse{
  23250. Header: res.Header,
  23251. HTTPStatusCode: res.StatusCode,
  23252. },
  23253. }
  23254. target := &ret
  23255. if err := gensupport.DecodeResponse(target, res); err != nil {
  23256. return nil, err
  23257. }
  23258. return ret, nil
  23259. // {
  23260. // "description": "Inserts a new creative.",
  23261. // "httpMethod": "POST",
  23262. // "id": "dfareporting.creatives.insert",
  23263. // "parameterOrder": [
  23264. // "profileId"
  23265. // ],
  23266. // "parameters": {
  23267. // "profileId": {
  23268. // "description": "User profile ID associated with this request.",
  23269. // "format": "int64",
  23270. // "location": "path",
  23271. // "required": true,
  23272. // "type": "string"
  23273. // }
  23274. // },
  23275. // "path": "userprofiles/{profileId}/creatives",
  23276. // "request": {
  23277. // "$ref": "Creative"
  23278. // },
  23279. // "response": {
  23280. // "$ref": "Creative"
  23281. // },
  23282. // "scopes": [
  23283. // "https://www.googleapis.com/auth/dfatrafficking"
  23284. // ]
  23285. // }
  23286. }
  23287. // method id "dfareporting.creatives.list":
  23288. type CreativesListCall struct {
  23289. s *Service
  23290. profileId int64
  23291. urlParams_ gensupport.URLParams
  23292. ifNoneMatch_ string
  23293. ctx_ context.Context
  23294. header_ http.Header
  23295. }
  23296. // List: Retrieves a list of creatives, possibly filtered. This method
  23297. // supports paging.
  23298. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  23299. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23300. c.profileId = profileId
  23301. return c
  23302. }
  23303. // Active sets the optional parameter "active": Select only active
  23304. // creatives. Leave blank to select active and inactive creatives.
  23305. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  23306. c.urlParams_.Set("active", fmt.Sprint(active))
  23307. return c
  23308. }
  23309. // AdvertiserId sets the optional parameter "advertiserId": Select only
  23310. // creatives with this advertiser ID.
  23311. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  23312. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  23313. return c
  23314. }
  23315. // Archived sets the optional parameter "archived": Select only archived
  23316. // creatives. Leave blank to select archived and unarchived creatives.
  23317. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  23318. c.urlParams_.Set("archived", fmt.Sprint(archived))
  23319. return c
  23320. }
  23321. // CampaignId sets the optional parameter "campaignId": Select only
  23322. // creatives with this campaign ID.
  23323. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  23324. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  23325. return c
  23326. }
  23327. // CompanionCreativeIds sets the optional parameter
  23328. // "companionCreativeIds": Select only in-stream video creatives with
  23329. // these companion IDs.
  23330. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  23331. var companionCreativeIds_ []string
  23332. for _, v := range companionCreativeIds {
  23333. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  23334. }
  23335. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  23336. return c
  23337. }
  23338. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  23339. // Select only creatives with these creative field IDs.
  23340. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  23341. var creativeFieldIds_ []string
  23342. for _, v := range creativeFieldIds {
  23343. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  23344. }
  23345. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  23346. return c
  23347. }
  23348. // Ids sets the optional parameter "ids": Select only creatives with
  23349. // these IDs.
  23350. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  23351. var ids_ []string
  23352. for _, v := range ids {
  23353. ids_ = append(ids_, fmt.Sprint(v))
  23354. }
  23355. c.urlParams_.SetMulti("ids", ids_)
  23356. return c
  23357. }
  23358. // MaxResults sets the optional parameter "maxResults": Maximum number
  23359. // of results to return.
  23360. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  23361. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23362. return c
  23363. }
  23364. // PageToken sets the optional parameter "pageToken": Value of the
  23365. // nextPageToken from the previous result page.
  23366. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  23367. c.urlParams_.Set("pageToken", pageToken)
  23368. return c
  23369. }
  23370. // RenderingIds sets the optional parameter "renderingIds": Select only
  23371. // creatives with these rendering IDs.
  23372. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  23373. var renderingIds_ []string
  23374. for _, v := range renderingIds {
  23375. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  23376. }
  23377. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  23378. return c
  23379. }
  23380. // SearchString sets the optional parameter "searchString": Allows
  23381. // searching for objects by name or ID. Wildcards (*) are allowed. For
  23382. // example, "creative*2015" will return objects with names like
  23383. // "creative June 2015", "creative April 2015", or simply "creative
  23384. // 2015". Most of the searches also add wildcards implicitly at the
  23385. // start and the end of the search string. For example, a search string
  23386. // of "creative" will match objects with name "my creative", "creative
  23387. // 2015", or simply "creative".
  23388. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  23389. c.urlParams_.Set("searchString", searchString)
  23390. return c
  23391. }
  23392. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  23393. // with these size IDs.
  23394. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  23395. var sizeIds_ []string
  23396. for _, v := range sizeIds {
  23397. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  23398. }
  23399. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  23400. return c
  23401. }
  23402. // SortField sets the optional parameter "sortField": Field by which to
  23403. // sort the list.
  23404. //
  23405. // Possible values:
  23406. // "ID" (default)
  23407. // "NAME"
  23408. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  23409. c.urlParams_.Set("sortField", sortField)
  23410. return c
  23411. }
  23412. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23413. // results.
  23414. //
  23415. // Possible values:
  23416. // "ASCENDING" (default)
  23417. // "DESCENDING"
  23418. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  23419. c.urlParams_.Set("sortOrder", sortOrder)
  23420. return c
  23421. }
  23422. // StudioCreativeId sets the optional parameter "studioCreativeId":
  23423. // Select only creatives corresponding to this Studio creative ID.
  23424. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  23425. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  23426. return c
  23427. }
  23428. // Types sets the optional parameter "types": Select only creatives with
  23429. // these creative types.
  23430. //
  23431. // Possible values:
  23432. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  23433. // "CUSTOM_DISPLAY"
  23434. // "CUSTOM_DISPLAY_INTERSTITIAL"
  23435. // "DISPLAY"
  23436. // "DISPLAY_IMAGE_GALLERY"
  23437. // "DISPLAY_REDIRECT"
  23438. // "FLASH_INPAGE"
  23439. // "HTML5_BANNER"
  23440. // "IMAGE"
  23441. // "INSTREAM_VIDEO"
  23442. // "INSTREAM_VIDEO_REDIRECT"
  23443. // "INTERNAL_REDIRECT"
  23444. // "INTERSTITIAL_INTERNAL_REDIRECT"
  23445. // "RICH_MEDIA_DISPLAY_BANNER"
  23446. // "RICH_MEDIA_DISPLAY_EXPANDING"
  23447. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  23448. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  23449. // "RICH_MEDIA_IM_EXPAND"
  23450. // "RICH_MEDIA_INPAGE_FLOATING"
  23451. // "RICH_MEDIA_MOBILE_IN_APP"
  23452. // "RICH_MEDIA_PEEL_DOWN"
  23453. // "TRACKING_TEXT"
  23454. // "VPAID_LINEAR_VIDEO"
  23455. // "VPAID_NON_LINEAR_VIDEO"
  23456. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  23457. c.urlParams_.SetMulti("types", append([]string{}, types...))
  23458. return c
  23459. }
  23460. // Fields allows partial responses to be retrieved. See
  23461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23462. // for more information.
  23463. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  23464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23465. return c
  23466. }
  23467. // IfNoneMatch sets the optional parameter which makes the operation
  23468. // fail if the object's ETag matches the given value. This is useful for
  23469. // getting updates only after the object has changed since the last
  23470. // request. Use googleapi.IsNotModified to check whether the response
  23471. // error from Do is the result of In-None-Match.
  23472. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  23473. c.ifNoneMatch_ = entityTag
  23474. return c
  23475. }
  23476. // Context sets the context to be used in this call's Do method. Any
  23477. // pending HTTP request will be aborted if the provided context is
  23478. // canceled.
  23479. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  23480. c.ctx_ = ctx
  23481. return c
  23482. }
  23483. // Header returns an http.Header that can be modified by the caller to
  23484. // add HTTP headers to the request.
  23485. func (c *CreativesListCall) Header() http.Header {
  23486. if c.header_ == nil {
  23487. c.header_ = make(http.Header)
  23488. }
  23489. return c.header_
  23490. }
  23491. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  23492. reqHeaders := make(http.Header)
  23493. for k, v := range c.header_ {
  23494. reqHeaders[k] = v
  23495. }
  23496. reqHeaders.Set("User-Agent", c.s.userAgent())
  23497. if c.ifNoneMatch_ != "" {
  23498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23499. }
  23500. var body io.Reader = nil
  23501. c.urlParams_.Set("alt", alt)
  23502. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23503. urls += "?" + c.urlParams_.Encode()
  23504. req, _ := http.NewRequest("GET", urls, body)
  23505. req.Header = reqHeaders
  23506. googleapi.Expand(req.URL, map[string]string{
  23507. "profileId": strconv.FormatInt(c.profileId, 10),
  23508. })
  23509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23510. }
  23511. // Do executes the "dfareporting.creatives.list" call.
  23512. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  23513. // non-2xx status code is an error. Response headers are in either
  23514. // *CreativesListResponse.ServerResponse.Header or (if a response was
  23515. // returned at all) in error.(*googleapi.Error).Header. Use
  23516. // googleapi.IsNotModified to check whether the returned error was
  23517. // because http.StatusNotModified was returned.
  23518. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  23519. gensupport.SetOptions(c.urlParams_, opts...)
  23520. res, err := c.doRequest("json")
  23521. if res != nil && res.StatusCode == http.StatusNotModified {
  23522. if res.Body != nil {
  23523. res.Body.Close()
  23524. }
  23525. return nil, &googleapi.Error{
  23526. Code: res.StatusCode,
  23527. Header: res.Header,
  23528. }
  23529. }
  23530. if err != nil {
  23531. return nil, err
  23532. }
  23533. defer googleapi.CloseBody(res)
  23534. if err := googleapi.CheckResponse(res); err != nil {
  23535. return nil, err
  23536. }
  23537. ret := &CreativesListResponse{
  23538. ServerResponse: googleapi.ServerResponse{
  23539. Header: res.Header,
  23540. HTTPStatusCode: res.StatusCode,
  23541. },
  23542. }
  23543. target := &ret
  23544. if err := gensupport.DecodeResponse(target, res); err != nil {
  23545. return nil, err
  23546. }
  23547. return ret, nil
  23548. // {
  23549. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  23550. // "httpMethod": "GET",
  23551. // "id": "dfareporting.creatives.list",
  23552. // "parameterOrder": [
  23553. // "profileId"
  23554. // ],
  23555. // "parameters": {
  23556. // "active": {
  23557. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  23558. // "location": "query",
  23559. // "type": "boolean"
  23560. // },
  23561. // "advertiserId": {
  23562. // "description": "Select only creatives with this advertiser ID.",
  23563. // "format": "int64",
  23564. // "location": "query",
  23565. // "type": "string"
  23566. // },
  23567. // "archived": {
  23568. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  23569. // "location": "query",
  23570. // "type": "boolean"
  23571. // },
  23572. // "campaignId": {
  23573. // "description": "Select only creatives with this campaign ID.",
  23574. // "format": "int64",
  23575. // "location": "query",
  23576. // "type": "string"
  23577. // },
  23578. // "companionCreativeIds": {
  23579. // "description": "Select only in-stream video creatives with these companion IDs.",
  23580. // "format": "int64",
  23581. // "location": "query",
  23582. // "repeated": true,
  23583. // "type": "string"
  23584. // },
  23585. // "creativeFieldIds": {
  23586. // "description": "Select only creatives with these creative field IDs.",
  23587. // "format": "int64",
  23588. // "location": "query",
  23589. // "repeated": true,
  23590. // "type": "string"
  23591. // },
  23592. // "ids": {
  23593. // "description": "Select only creatives with these IDs.",
  23594. // "format": "int64",
  23595. // "location": "query",
  23596. // "repeated": true,
  23597. // "type": "string"
  23598. // },
  23599. // "maxResults": {
  23600. // "default": "1000",
  23601. // "description": "Maximum number of results to return.",
  23602. // "format": "int32",
  23603. // "location": "query",
  23604. // "maximum": "1000",
  23605. // "minimum": "0",
  23606. // "type": "integer"
  23607. // },
  23608. // "pageToken": {
  23609. // "description": "Value of the nextPageToken from the previous result page.",
  23610. // "location": "query",
  23611. // "type": "string"
  23612. // },
  23613. // "profileId": {
  23614. // "description": "User profile ID associated with this request.",
  23615. // "format": "int64",
  23616. // "location": "path",
  23617. // "required": true,
  23618. // "type": "string"
  23619. // },
  23620. // "renderingIds": {
  23621. // "description": "Select only creatives with these rendering IDs.",
  23622. // "format": "int64",
  23623. // "location": "query",
  23624. // "repeated": true,
  23625. // "type": "string"
  23626. // },
  23627. // "searchString": {
  23628. // "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\".",
  23629. // "location": "query",
  23630. // "type": "string"
  23631. // },
  23632. // "sizeIds": {
  23633. // "description": "Select only creatives with these size IDs.",
  23634. // "format": "int64",
  23635. // "location": "query",
  23636. // "repeated": true,
  23637. // "type": "string"
  23638. // },
  23639. // "sortField": {
  23640. // "default": "ID",
  23641. // "description": "Field by which to sort the list.",
  23642. // "enum": [
  23643. // "ID",
  23644. // "NAME"
  23645. // ],
  23646. // "enumDescriptions": [
  23647. // "",
  23648. // ""
  23649. // ],
  23650. // "location": "query",
  23651. // "type": "string"
  23652. // },
  23653. // "sortOrder": {
  23654. // "default": "ASCENDING",
  23655. // "description": "Order of sorted results.",
  23656. // "enum": [
  23657. // "ASCENDING",
  23658. // "DESCENDING"
  23659. // ],
  23660. // "enumDescriptions": [
  23661. // "",
  23662. // ""
  23663. // ],
  23664. // "location": "query",
  23665. // "type": "string"
  23666. // },
  23667. // "studioCreativeId": {
  23668. // "description": "Select only creatives corresponding to this Studio creative ID.",
  23669. // "format": "int64",
  23670. // "location": "query",
  23671. // "type": "string"
  23672. // },
  23673. // "types": {
  23674. // "description": "Select only creatives with these creative types.",
  23675. // "enum": [
  23676. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  23677. // "CUSTOM_DISPLAY",
  23678. // "CUSTOM_DISPLAY_INTERSTITIAL",
  23679. // "DISPLAY",
  23680. // "DISPLAY_IMAGE_GALLERY",
  23681. // "DISPLAY_REDIRECT",
  23682. // "FLASH_INPAGE",
  23683. // "HTML5_BANNER",
  23684. // "IMAGE",
  23685. // "INSTREAM_VIDEO",
  23686. // "INSTREAM_VIDEO_REDIRECT",
  23687. // "INTERNAL_REDIRECT",
  23688. // "INTERSTITIAL_INTERNAL_REDIRECT",
  23689. // "RICH_MEDIA_DISPLAY_BANNER",
  23690. // "RICH_MEDIA_DISPLAY_EXPANDING",
  23691. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  23692. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  23693. // "RICH_MEDIA_IM_EXPAND",
  23694. // "RICH_MEDIA_INPAGE_FLOATING",
  23695. // "RICH_MEDIA_MOBILE_IN_APP",
  23696. // "RICH_MEDIA_PEEL_DOWN",
  23697. // "TRACKING_TEXT",
  23698. // "VPAID_LINEAR_VIDEO",
  23699. // "VPAID_NON_LINEAR_VIDEO"
  23700. // ],
  23701. // "enumDescriptions": [
  23702. // "",
  23703. // "",
  23704. // "",
  23705. // "",
  23706. // "",
  23707. // "",
  23708. // "",
  23709. // "",
  23710. // "",
  23711. // "",
  23712. // "",
  23713. // "",
  23714. // "",
  23715. // "",
  23716. // "",
  23717. // "",
  23718. // "",
  23719. // "",
  23720. // "",
  23721. // "",
  23722. // "",
  23723. // "",
  23724. // "",
  23725. // ""
  23726. // ],
  23727. // "location": "query",
  23728. // "repeated": true,
  23729. // "type": "string"
  23730. // }
  23731. // },
  23732. // "path": "userprofiles/{profileId}/creatives",
  23733. // "response": {
  23734. // "$ref": "CreativesListResponse"
  23735. // },
  23736. // "scopes": [
  23737. // "https://www.googleapis.com/auth/dfatrafficking"
  23738. // ]
  23739. // }
  23740. }
  23741. // Pages invokes f for each page of results.
  23742. // A non-nil error returned from f will halt the iteration.
  23743. // The provided context supersedes any context provided to the Context method.
  23744. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  23745. c.ctx_ = ctx
  23746. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23747. for {
  23748. x, err := c.Do()
  23749. if err != nil {
  23750. return err
  23751. }
  23752. if err := f(x); err != nil {
  23753. return err
  23754. }
  23755. if x.NextPageToken == "" {
  23756. return nil
  23757. }
  23758. c.PageToken(x.NextPageToken)
  23759. }
  23760. }
  23761. // method id "dfareporting.creatives.patch":
  23762. type CreativesPatchCall struct {
  23763. s *Service
  23764. profileId int64
  23765. creative *Creative
  23766. urlParams_ gensupport.URLParams
  23767. ctx_ context.Context
  23768. header_ http.Header
  23769. }
  23770. // Patch: Updates an existing creative. This method supports patch
  23771. // semantics.
  23772. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  23773. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23774. c.profileId = profileId
  23775. c.urlParams_.Set("id", fmt.Sprint(id))
  23776. c.creative = creative
  23777. return c
  23778. }
  23779. // Fields allows partial responses to be retrieved. See
  23780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23781. // for more information.
  23782. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  23783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23784. return c
  23785. }
  23786. // Context sets the context to be used in this call's Do method. Any
  23787. // pending HTTP request will be aborted if the provided context is
  23788. // canceled.
  23789. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  23790. c.ctx_ = ctx
  23791. return c
  23792. }
  23793. // Header returns an http.Header that can be modified by the caller to
  23794. // add HTTP headers to the request.
  23795. func (c *CreativesPatchCall) Header() http.Header {
  23796. if c.header_ == nil {
  23797. c.header_ = make(http.Header)
  23798. }
  23799. return c.header_
  23800. }
  23801. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  23802. reqHeaders := make(http.Header)
  23803. for k, v := range c.header_ {
  23804. reqHeaders[k] = v
  23805. }
  23806. reqHeaders.Set("User-Agent", c.s.userAgent())
  23807. var body io.Reader = nil
  23808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  23809. if err != nil {
  23810. return nil, err
  23811. }
  23812. reqHeaders.Set("Content-Type", "application/json")
  23813. c.urlParams_.Set("alt", alt)
  23814. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23815. urls += "?" + c.urlParams_.Encode()
  23816. req, _ := http.NewRequest("PATCH", urls, body)
  23817. req.Header = reqHeaders
  23818. googleapi.Expand(req.URL, map[string]string{
  23819. "profileId": strconv.FormatInt(c.profileId, 10),
  23820. })
  23821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23822. }
  23823. // Do executes the "dfareporting.creatives.patch" call.
  23824. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23825. // code is an error. Response headers are in either
  23826. // *Creative.ServerResponse.Header or (if a response was returned at
  23827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23828. // to check whether the returned error was because
  23829. // http.StatusNotModified was returned.
  23830. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23831. gensupport.SetOptions(c.urlParams_, opts...)
  23832. res, err := c.doRequest("json")
  23833. if res != nil && res.StatusCode == http.StatusNotModified {
  23834. if res.Body != nil {
  23835. res.Body.Close()
  23836. }
  23837. return nil, &googleapi.Error{
  23838. Code: res.StatusCode,
  23839. Header: res.Header,
  23840. }
  23841. }
  23842. if err != nil {
  23843. return nil, err
  23844. }
  23845. defer googleapi.CloseBody(res)
  23846. if err := googleapi.CheckResponse(res); err != nil {
  23847. return nil, err
  23848. }
  23849. ret := &Creative{
  23850. ServerResponse: googleapi.ServerResponse{
  23851. Header: res.Header,
  23852. HTTPStatusCode: res.StatusCode,
  23853. },
  23854. }
  23855. target := &ret
  23856. if err := gensupport.DecodeResponse(target, res); err != nil {
  23857. return nil, err
  23858. }
  23859. return ret, nil
  23860. // {
  23861. // "description": "Updates an existing creative. This method supports patch semantics.",
  23862. // "httpMethod": "PATCH",
  23863. // "id": "dfareporting.creatives.patch",
  23864. // "parameterOrder": [
  23865. // "profileId",
  23866. // "id"
  23867. // ],
  23868. // "parameters": {
  23869. // "id": {
  23870. // "description": "Creative ID.",
  23871. // "format": "int64",
  23872. // "location": "query",
  23873. // "required": true,
  23874. // "type": "string"
  23875. // },
  23876. // "profileId": {
  23877. // "description": "User profile ID associated with this request.",
  23878. // "format": "int64",
  23879. // "location": "path",
  23880. // "required": true,
  23881. // "type": "string"
  23882. // }
  23883. // },
  23884. // "path": "userprofiles/{profileId}/creatives",
  23885. // "request": {
  23886. // "$ref": "Creative"
  23887. // },
  23888. // "response": {
  23889. // "$ref": "Creative"
  23890. // },
  23891. // "scopes": [
  23892. // "https://www.googleapis.com/auth/dfatrafficking"
  23893. // ]
  23894. // }
  23895. }
  23896. // method id "dfareporting.creatives.update":
  23897. type CreativesUpdateCall struct {
  23898. s *Service
  23899. profileId int64
  23900. creative *Creative
  23901. urlParams_ gensupport.URLParams
  23902. ctx_ context.Context
  23903. header_ http.Header
  23904. }
  23905. // Update: Updates an existing creative.
  23906. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  23907. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23908. c.profileId = profileId
  23909. c.creative = creative
  23910. return c
  23911. }
  23912. // Fields allows partial responses to be retrieved. See
  23913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23914. // for more information.
  23915. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  23916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23917. return c
  23918. }
  23919. // Context sets the context to be used in this call's Do method. Any
  23920. // pending HTTP request will be aborted if the provided context is
  23921. // canceled.
  23922. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  23923. c.ctx_ = ctx
  23924. return c
  23925. }
  23926. // Header returns an http.Header that can be modified by the caller to
  23927. // add HTTP headers to the request.
  23928. func (c *CreativesUpdateCall) Header() http.Header {
  23929. if c.header_ == nil {
  23930. c.header_ = make(http.Header)
  23931. }
  23932. return c.header_
  23933. }
  23934. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  23935. reqHeaders := make(http.Header)
  23936. for k, v := range c.header_ {
  23937. reqHeaders[k] = v
  23938. }
  23939. reqHeaders.Set("User-Agent", c.s.userAgent())
  23940. var body io.Reader = nil
  23941. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  23942. if err != nil {
  23943. return nil, err
  23944. }
  23945. reqHeaders.Set("Content-Type", "application/json")
  23946. c.urlParams_.Set("alt", alt)
  23947. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23948. urls += "?" + c.urlParams_.Encode()
  23949. req, _ := http.NewRequest("PUT", urls, body)
  23950. req.Header = reqHeaders
  23951. googleapi.Expand(req.URL, map[string]string{
  23952. "profileId": strconv.FormatInt(c.profileId, 10),
  23953. })
  23954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23955. }
  23956. // Do executes the "dfareporting.creatives.update" call.
  23957. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23958. // code is an error. Response headers are in either
  23959. // *Creative.ServerResponse.Header or (if a response was returned at
  23960. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23961. // to check whether the returned error was because
  23962. // http.StatusNotModified was returned.
  23963. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23964. gensupport.SetOptions(c.urlParams_, opts...)
  23965. res, err := c.doRequest("json")
  23966. if res != nil && res.StatusCode == http.StatusNotModified {
  23967. if res.Body != nil {
  23968. res.Body.Close()
  23969. }
  23970. return nil, &googleapi.Error{
  23971. Code: res.StatusCode,
  23972. Header: res.Header,
  23973. }
  23974. }
  23975. if err != nil {
  23976. return nil, err
  23977. }
  23978. defer googleapi.CloseBody(res)
  23979. if err := googleapi.CheckResponse(res); err != nil {
  23980. return nil, err
  23981. }
  23982. ret := &Creative{
  23983. ServerResponse: googleapi.ServerResponse{
  23984. Header: res.Header,
  23985. HTTPStatusCode: res.StatusCode,
  23986. },
  23987. }
  23988. target := &ret
  23989. if err := gensupport.DecodeResponse(target, res); err != nil {
  23990. return nil, err
  23991. }
  23992. return ret, nil
  23993. // {
  23994. // "description": "Updates an existing creative.",
  23995. // "httpMethod": "PUT",
  23996. // "id": "dfareporting.creatives.update",
  23997. // "parameterOrder": [
  23998. // "profileId"
  23999. // ],
  24000. // "parameters": {
  24001. // "profileId": {
  24002. // "description": "User profile ID associated with this request.",
  24003. // "format": "int64",
  24004. // "location": "path",
  24005. // "required": true,
  24006. // "type": "string"
  24007. // }
  24008. // },
  24009. // "path": "userprofiles/{profileId}/creatives",
  24010. // "request": {
  24011. // "$ref": "Creative"
  24012. // },
  24013. // "response": {
  24014. // "$ref": "Creative"
  24015. // },
  24016. // "scopes": [
  24017. // "https://www.googleapis.com/auth/dfatrafficking"
  24018. // ]
  24019. // }
  24020. }
  24021. // method id "dfareporting.dimensionValues.query":
  24022. type DimensionValuesQueryCall struct {
  24023. s *Service
  24024. profileId int64
  24025. dimensionvaluerequest *DimensionValueRequest
  24026. urlParams_ gensupport.URLParams
  24027. ctx_ context.Context
  24028. header_ http.Header
  24029. }
  24030. // Query: Retrieves list of report dimension values for a list of
  24031. // filters.
  24032. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  24033. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24034. c.profileId = profileId
  24035. c.dimensionvaluerequest = dimensionvaluerequest
  24036. return c
  24037. }
  24038. // MaxResults sets the optional parameter "maxResults": Maximum number
  24039. // of results to return.
  24040. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  24041. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24042. return c
  24043. }
  24044. // PageToken sets the optional parameter "pageToken": The value of the
  24045. // nextToken from the previous result page.
  24046. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  24047. c.urlParams_.Set("pageToken", pageToken)
  24048. return c
  24049. }
  24050. // Fields allows partial responses to be retrieved. See
  24051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24052. // for more information.
  24053. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  24054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24055. return c
  24056. }
  24057. // Context sets the context to be used in this call's Do method. Any
  24058. // pending HTTP request will be aborted if the provided context is
  24059. // canceled.
  24060. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  24061. c.ctx_ = ctx
  24062. return c
  24063. }
  24064. // Header returns an http.Header that can be modified by the caller to
  24065. // add HTTP headers to the request.
  24066. func (c *DimensionValuesQueryCall) Header() http.Header {
  24067. if c.header_ == nil {
  24068. c.header_ = make(http.Header)
  24069. }
  24070. return c.header_
  24071. }
  24072. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  24073. reqHeaders := make(http.Header)
  24074. for k, v := range c.header_ {
  24075. reqHeaders[k] = v
  24076. }
  24077. reqHeaders.Set("User-Agent", c.s.userAgent())
  24078. var body io.Reader = nil
  24079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  24080. if err != nil {
  24081. return nil, err
  24082. }
  24083. reqHeaders.Set("Content-Type", "application/json")
  24084. c.urlParams_.Set("alt", alt)
  24085. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  24086. urls += "?" + c.urlParams_.Encode()
  24087. req, _ := http.NewRequest("POST", urls, body)
  24088. req.Header = reqHeaders
  24089. googleapi.Expand(req.URL, map[string]string{
  24090. "profileId": strconv.FormatInt(c.profileId, 10),
  24091. })
  24092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24093. }
  24094. // Do executes the "dfareporting.dimensionValues.query" call.
  24095. // Exactly one of *DimensionValueList or error will be non-nil. Any
  24096. // non-2xx status code is an error. Response headers are in either
  24097. // *DimensionValueList.ServerResponse.Header or (if a response was
  24098. // returned at all) in error.(*googleapi.Error).Header. Use
  24099. // googleapi.IsNotModified to check whether the returned error was
  24100. // because http.StatusNotModified was returned.
  24101. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  24102. gensupport.SetOptions(c.urlParams_, opts...)
  24103. res, err := c.doRequest("json")
  24104. if res != nil && res.StatusCode == http.StatusNotModified {
  24105. if res.Body != nil {
  24106. res.Body.Close()
  24107. }
  24108. return nil, &googleapi.Error{
  24109. Code: res.StatusCode,
  24110. Header: res.Header,
  24111. }
  24112. }
  24113. if err != nil {
  24114. return nil, err
  24115. }
  24116. defer googleapi.CloseBody(res)
  24117. if err := googleapi.CheckResponse(res); err != nil {
  24118. return nil, err
  24119. }
  24120. ret := &DimensionValueList{
  24121. ServerResponse: googleapi.ServerResponse{
  24122. Header: res.Header,
  24123. HTTPStatusCode: res.StatusCode,
  24124. },
  24125. }
  24126. target := &ret
  24127. if err := gensupport.DecodeResponse(target, res); err != nil {
  24128. return nil, err
  24129. }
  24130. return ret, nil
  24131. // {
  24132. // "description": "Retrieves list of report dimension values for a list of filters.",
  24133. // "httpMethod": "POST",
  24134. // "id": "dfareporting.dimensionValues.query",
  24135. // "parameterOrder": [
  24136. // "profileId"
  24137. // ],
  24138. // "parameters": {
  24139. // "maxResults": {
  24140. // "default": "100",
  24141. // "description": "Maximum number of results to return.",
  24142. // "format": "int32",
  24143. // "location": "query",
  24144. // "maximum": "100",
  24145. // "minimum": "0",
  24146. // "type": "integer"
  24147. // },
  24148. // "pageToken": {
  24149. // "description": "The value of the nextToken from the previous result page.",
  24150. // "location": "query",
  24151. // "type": "string"
  24152. // },
  24153. // "profileId": {
  24154. // "description": "The DFA user profile ID.",
  24155. // "format": "int64",
  24156. // "location": "path",
  24157. // "required": true,
  24158. // "type": "string"
  24159. // }
  24160. // },
  24161. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  24162. // "request": {
  24163. // "$ref": "DimensionValueRequest"
  24164. // },
  24165. // "response": {
  24166. // "$ref": "DimensionValueList"
  24167. // },
  24168. // "scopes": [
  24169. // "https://www.googleapis.com/auth/dfareporting"
  24170. // ]
  24171. // }
  24172. }
  24173. // Pages invokes f for each page of results.
  24174. // A non-nil error returned from f will halt the iteration.
  24175. // The provided context supersedes any context provided to the Context method.
  24176. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  24177. c.ctx_ = ctx
  24178. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24179. for {
  24180. x, err := c.Do()
  24181. if err != nil {
  24182. return err
  24183. }
  24184. if err := f(x); err != nil {
  24185. return err
  24186. }
  24187. if x.NextPageToken == "" {
  24188. return nil
  24189. }
  24190. c.PageToken(x.NextPageToken)
  24191. }
  24192. }
  24193. // method id "dfareporting.directorySiteContacts.get":
  24194. type DirectorySiteContactsGetCall struct {
  24195. s *Service
  24196. profileId int64
  24197. id int64
  24198. urlParams_ gensupport.URLParams
  24199. ifNoneMatch_ string
  24200. ctx_ context.Context
  24201. header_ http.Header
  24202. }
  24203. // Get: Gets one directory site contact by ID.
  24204. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  24205. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24206. c.profileId = profileId
  24207. c.id = id
  24208. return c
  24209. }
  24210. // Fields allows partial responses to be retrieved. See
  24211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24212. // for more information.
  24213. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  24214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24215. return c
  24216. }
  24217. // IfNoneMatch sets the optional parameter which makes the operation
  24218. // fail if the object's ETag matches the given value. This is useful for
  24219. // getting updates only after the object has changed since the last
  24220. // request. Use googleapi.IsNotModified to check whether the response
  24221. // error from Do is the result of In-None-Match.
  24222. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  24223. c.ifNoneMatch_ = entityTag
  24224. return c
  24225. }
  24226. // Context sets the context to be used in this call's Do method. Any
  24227. // pending HTTP request will be aborted if the provided context is
  24228. // canceled.
  24229. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  24230. c.ctx_ = ctx
  24231. return c
  24232. }
  24233. // Header returns an http.Header that can be modified by the caller to
  24234. // add HTTP headers to the request.
  24235. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  24236. if c.header_ == nil {
  24237. c.header_ = make(http.Header)
  24238. }
  24239. return c.header_
  24240. }
  24241. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  24242. reqHeaders := make(http.Header)
  24243. for k, v := range c.header_ {
  24244. reqHeaders[k] = v
  24245. }
  24246. reqHeaders.Set("User-Agent", c.s.userAgent())
  24247. if c.ifNoneMatch_ != "" {
  24248. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24249. }
  24250. var body io.Reader = nil
  24251. c.urlParams_.Set("alt", alt)
  24252. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  24253. urls += "?" + c.urlParams_.Encode()
  24254. req, _ := http.NewRequest("GET", urls, body)
  24255. req.Header = reqHeaders
  24256. googleapi.Expand(req.URL, map[string]string{
  24257. "profileId": strconv.FormatInt(c.profileId, 10),
  24258. "id": strconv.FormatInt(c.id, 10),
  24259. })
  24260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24261. }
  24262. // Do executes the "dfareporting.directorySiteContacts.get" call.
  24263. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  24264. // non-2xx status code is an error. Response headers are in either
  24265. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  24266. // returned at all) in error.(*googleapi.Error).Header. Use
  24267. // googleapi.IsNotModified to check whether the returned error was
  24268. // because http.StatusNotModified was returned.
  24269. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  24270. gensupport.SetOptions(c.urlParams_, opts...)
  24271. res, err := c.doRequest("json")
  24272. if res != nil && res.StatusCode == http.StatusNotModified {
  24273. if res.Body != nil {
  24274. res.Body.Close()
  24275. }
  24276. return nil, &googleapi.Error{
  24277. Code: res.StatusCode,
  24278. Header: res.Header,
  24279. }
  24280. }
  24281. if err != nil {
  24282. return nil, err
  24283. }
  24284. defer googleapi.CloseBody(res)
  24285. if err := googleapi.CheckResponse(res); err != nil {
  24286. return nil, err
  24287. }
  24288. ret := &DirectorySiteContact{
  24289. ServerResponse: googleapi.ServerResponse{
  24290. Header: res.Header,
  24291. HTTPStatusCode: res.StatusCode,
  24292. },
  24293. }
  24294. target := &ret
  24295. if err := gensupport.DecodeResponse(target, res); err != nil {
  24296. return nil, err
  24297. }
  24298. return ret, nil
  24299. // {
  24300. // "description": "Gets one directory site contact by ID.",
  24301. // "httpMethod": "GET",
  24302. // "id": "dfareporting.directorySiteContacts.get",
  24303. // "parameterOrder": [
  24304. // "profileId",
  24305. // "id"
  24306. // ],
  24307. // "parameters": {
  24308. // "id": {
  24309. // "description": "Directory site contact ID.",
  24310. // "format": "int64",
  24311. // "location": "path",
  24312. // "required": true,
  24313. // "type": "string"
  24314. // },
  24315. // "profileId": {
  24316. // "description": "User profile ID associated with this request.",
  24317. // "format": "int64",
  24318. // "location": "path",
  24319. // "required": true,
  24320. // "type": "string"
  24321. // }
  24322. // },
  24323. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  24324. // "response": {
  24325. // "$ref": "DirectorySiteContact"
  24326. // },
  24327. // "scopes": [
  24328. // "https://www.googleapis.com/auth/dfatrafficking"
  24329. // ]
  24330. // }
  24331. }
  24332. // method id "dfareporting.directorySiteContacts.list":
  24333. type DirectorySiteContactsListCall struct {
  24334. s *Service
  24335. profileId int64
  24336. urlParams_ gensupport.URLParams
  24337. ifNoneMatch_ string
  24338. ctx_ context.Context
  24339. header_ http.Header
  24340. }
  24341. // List: Retrieves a list of directory site contacts, possibly filtered.
  24342. // This method supports paging.
  24343. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  24344. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24345. c.profileId = profileId
  24346. return c
  24347. }
  24348. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  24349. // Select only directory site contacts with these directory site IDs.
  24350. // This is a required field.
  24351. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  24352. var directorySiteIds_ []string
  24353. for _, v := range directorySiteIds {
  24354. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  24355. }
  24356. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  24357. return c
  24358. }
  24359. // Ids sets the optional parameter "ids": Select only directory site
  24360. // contacts with these IDs.
  24361. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  24362. var ids_ []string
  24363. for _, v := range ids {
  24364. ids_ = append(ids_, fmt.Sprint(v))
  24365. }
  24366. c.urlParams_.SetMulti("ids", ids_)
  24367. return c
  24368. }
  24369. // MaxResults sets the optional parameter "maxResults": Maximum number
  24370. // of results to return.
  24371. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  24372. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24373. return c
  24374. }
  24375. // PageToken sets the optional parameter "pageToken": Value of the
  24376. // nextPageToken from the previous result page.
  24377. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  24378. c.urlParams_.Set("pageToken", pageToken)
  24379. return c
  24380. }
  24381. // SearchString sets the optional parameter "searchString": Allows
  24382. // searching for objects by name, ID or email. Wildcards (*) are
  24383. // allowed. For example, "directory site contact*2015" will return
  24384. // objects with names like "directory site contact June 2015",
  24385. // "directory site contact April 2015", or simply "directory site
  24386. // contact 2015". Most of the searches also add wildcards implicitly at
  24387. // the start and the end of the search string. For example, a search
  24388. // string of "directory site contact" will match objects with name "my
  24389. // directory site contact", "directory site contact 2015", or simply
  24390. // "directory site contact".
  24391. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  24392. c.urlParams_.Set("searchString", searchString)
  24393. return c
  24394. }
  24395. // SortField sets the optional parameter "sortField": Field by which to
  24396. // sort the list.
  24397. //
  24398. // Possible values:
  24399. // "ID" (default)
  24400. // "NAME"
  24401. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  24402. c.urlParams_.Set("sortField", sortField)
  24403. return c
  24404. }
  24405. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24406. // results.
  24407. //
  24408. // Possible values:
  24409. // "ASCENDING" (default)
  24410. // "DESCENDING"
  24411. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  24412. c.urlParams_.Set("sortOrder", sortOrder)
  24413. return c
  24414. }
  24415. // Fields allows partial responses to be retrieved. See
  24416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24417. // for more information.
  24418. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  24419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24420. return c
  24421. }
  24422. // IfNoneMatch sets the optional parameter which makes the operation
  24423. // fail if the object's ETag matches the given value. This is useful for
  24424. // getting updates only after the object has changed since the last
  24425. // request. Use googleapi.IsNotModified to check whether the response
  24426. // error from Do is the result of In-None-Match.
  24427. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  24428. c.ifNoneMatch_ = entityTag
  24429. return c
  24430. }
  24431. // Context sets the context to be used in this call's Do method. Any
  24432. // pending HTTP request will be aborted if the provided context is
  24433. // canceled.
  24434. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  24435. c.ctx_ = ctx
  24436. return c
  24437. }
  24438. // Header returns an http.Header that can be modified by the caller to
  24439. // add HTTP headers to the request.
  24440. func (c *DirectorySiteContactsListCall) Header() http.Header {
  24441. if c.header_ == nil {
  24442. c.header_ = make(http.Header)
  24443. }
  24444. return c.header_
  24445. }
  24446. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  24447. reqHeaders := make(http.Header)
  24448. for k, v := range c.header_ {
  24449. reqHeaders[k] = v
  24450. }
  24451. reqHeaders.Set("User-Agent", c.s.userAgent())
  24452. if c.ifNoneMatch_ != "" {
  24453. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24454. }
  24455. var body io.Reader = nil
  24456. c.urlParams_.Set("alt", alt)
  24457. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  24458. urls += "?" + c.urlParams_.Encode()
  24459. req, _ := http.NewRequest("GET", urls, body)
  24460. req.Header = reqHeaders
  24461. googleapi.Expand(req.URL, map[string]string{
  24462. "profileId": strconv.FormatInt(c.profileId, 10),
  24463. })
  24464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24465. }
  24466. // Do executes the "dfareporting.directorySiteContacts.list" call.
  24467. // Exactly one of *DirectorySiteContactsListResponse or error will be
  24468. // non-nil. Any non-2xx status code is an error. Response headers are in
  24469. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  24470. // (if a response was returned at all) in
  24471. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  24472. // whether the returned error was because http.StatusNotModified was
  24473. // returned.
  24474. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  24475. gensupport.SetOptions(c.urlParams_, opts...)
  24476. res, err := c.doRequest("json")
  24477. if res != nil && res.StatusCode == http.StatusNotModified {
  24478. if res.Body != nil {
  24479. res.Body.Close()
  24480. }
  24481. return nil, &googleapi.Error{
  24482. Code: res.StatusCode,
  24483. Header: res.Header,
  24484. }
  24485. }
  24486. if err != nil {
  24487. return nil, err
  24488. }
  24489. defer googleapi.CloseBody(res)
  24490. if err := googleapi.CheckResponse(res); err != nil {
  24491. return nil, err
  24492. }
  24493. ret := &DirectorySiteContactsListResponse{
  24494. ServerResponse: googleapi.ServerResponse{
  24495. Header: res.Header,
  24496. HTTPStatusCode: res.StatusCode,
  24497. },
  24498. }
  24499. target := &ret
  24500. if err := gensupport.DecodeResponse(target, res); err != nil {
  24501. return nil, err
  24502. }
  24503. return ret, nil
  24504. // {
  24505. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  24506. // "httpMethod": "GET",
  24507. // "id": "dfareporting.directorySiteContacts.list",
  24508. // "parameterOrder": [
  24509. // "profileId"
  24510. // ],
  24511. // "parameters": {
  24512. // "directorySiteIds": {
  24513. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  24514. // "format": "int64",
  24515. // "location": "query",
  24516. // "repeated": true,
  24517. // "type": "string"
  24518. // },
  24519. // "ids": {
  24520. // "description": "Select only directory site contacts with these IDs.",
  24521. // "format": "int64",
  24522. // "location": "query",
  24523. // "repeated": true,
  24524. // "type": "string"
  24525. // },
  24526. // "maxResults": {
  24527. // "default": "1000",
  24528. // "description": "Maximum number of results to return.",
  24529. // "format": "int32",
  24530. // "location": "query",
  24531. // "maximum": "1000",
  24532. // "minimum": "0",
  24533. // "type": "integer"
  24534. // },
  24535. // "pageToken": {
  24536. // "description": "Value of the nextPageToken from the previous result page.",
  24537. // "location": "query",
  24538. // "type": "string"
  24539. // },
  24540. // "profileId": {
  24541. // "description": "User profile ID associated with this request.",
  24542. // "format": "int64",
  24543. // "location": "path",
  24544. // "required": true,
  24545. // "type": "string"
  24546. // },
  24547. // "searchString": {
  24548. // "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\".",
  24549. // "location": "query",
  24550. // "type": "string"
  24551. // },
  24552. // "sortField": {
  24553. // "default": "ID",
  24554. // "description": "Field by which to sort the list.",
  24555. // "enum": [
  24556. // "ID",
  24557. // "NAME"
  24558. // ],
  24559. // "enumDescriptions": [
  24560. // "",
  24561. // ""
  24562. // ],
  24563. // "location": "query",
  24564. // "type": "string"
  24565. // },
  24566. // "sortOrder": {
  24567. // "default": "ASCENDING",
  24568. // "description": "Order of sorted results.",
  24569. // "enum": [
  24570. // "ASCENDING",
  24571. // "DESCENDING"
  24572. // ],
  24573. // "enumDescriptions": [
  24574. // "",
  24575. // ""
  24576. // ],
  24577. // "location": "query",
  24578. // "type": "string"
  24579. // }
  24580. // },
  24581. // "path": "userprofiles/{profileId}/directorySiteContacts",
  24582. // "response": {
  24583. // "$ref": "DirectorySiteContactsListResponse"
  24584. // },
  24585. // "scopes": [
  24586. // "https://www.googleapis.com/auth/dfatrafficking"
  24587. // ]
  24588. // }
  24589. }
  24590. // Pages invokes f for each page of results.
  24591. // A non-nil error returned from f will halt the iteration.
  24592. // The provided context supersedes any context provided to the Context method.
  24593. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  24594. c.ctx_ = ctx
  24595. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24596. for {
  24597. x, err := c.Do()
  24598. if err != nil {
  24599. return err
  24600. }
  24601. if err := f(x); err != nil {
  24602. return err
  24603. }
  24604. if x.NextPageToken == "" {
  24605. return nil
  24606. }
  24607. c.PageToken(x.NextPageToken)
  24608. }
  24609. }
  24610. // method id "dfareporting.directorySites.get":
  24611. type DirectorySitesGetCall struct {
  24612. s *Service
  24613. profileId int64
  24614. id int64
  24615. urlParams_ gensupport.URLParams
  24616. ifNoneMatch_ string
  24617. ctx_ context.Context
  24618. header_ http.Header
  24619. }
  24620. // Get: Gets one directory site by ID.
  24621. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  24622. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24623. c.profileId = profileId
  24624. c.id = id
  24625. return c
  24626. }
  24627. // Fields allows partial responses to be retrieved. See
  24628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24629. // for more information.
  24630. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  24631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24632. return c
  24633. }
  24634. // IfNoneMatch sets the optional parameter which makes the operation
  24635. // fail if the object's ETag matches the given value. This is useful for
  24636. // getting updates only after the object has changed since the last
  24637. // request. Use googleapi.IsNotModified to check whether the response
  24638. // error from Do is the result of In-None-Match.
  24639. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  24640. c.ifNoneMatch_ = entityTag
  24641. return c
  24642. }
  24643. // Context sets the context to be used in this call's Do method. Any
  24644. // pending HTTP request will be aborted if the provided context is
  24645. // canceled.
  24646. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  24647. c.ctx_ = ctx
  24648. return c
  24649. }
  24650. // Header returns an http.Header that can be modified by the caller to
  24651. // add HTTP headers to the request.
  24652. func (c *DirectorySitesGetCall) Header() http.Header {
  24653. if c.header_ == nil {
  24654. c.header_ = make(http.Header)
  24655. }
  24656. return c.header_
  24657. }
  24658. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  24659. reqHeaders := make(http.Header)
  24660. for k, v := range c.header_ {
  24661. reqHeaders[k] = v
  24662. }
  24663. reqHeaders.Set("User-Agent", c.s.userAgent())
  24664. if c.ifNoneMatch_ != "" {
  24665. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24666. }
  24667. var body io.Reader = nil
  24668. c.urlParams_.Set("alt", alt)
  24669. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  24670. urls += "?" + c.urlParams_.Encode()
  24671. req, _ := http.NewRequest("GET", urls, body)
  24672. req.Header = reqHeaders
  24673. googleapi.Expand(req.URL, map[string]string{
  24674. "profileId": strconv.FormatInt(c.profileId, 10),
  24675. "id": strconv.FormatInt(c.id, 10),
  24676. })
  24677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24678. }
  24679. // Do executes the "dfareporting.directorySites.get" call.
  24680. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  24681. // status code is an error. Response headers are in either
  24682. // *DirectorySite.ServerResponse.Header or (if a response was returned
  24683. // at all) in error.(*googleapi.Error).Header. Use
  24684. // googleapi.IsNotModified to check whether the returned error was
  24685. // because http.StatusNotModified was returned.
  24686. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  24687. gensupport.SetOptions(c.urlParams_, opts...)
  24688. res, err := c.doRequest("json")
  24689. if res != nil && res.StatusCode == http.StatusNotModified {
  24690. if res.Body != nil {
  24691. res.Body.Close()
  24692. }
  24693. return nil, &googleapi.Error{
  24694. Code: res.StatusCode,
  24695. Header: res.Header,
  24696. }
  24697. }
  24698. if err != nil {
  24699. return nil, err
  24700. }
  24701. defer googleapi.CloseBody(res)
  24702. if err := googleapi.CheckResponse(res); err != nil {
  24703. return nil, err
  24704. }
  24705. ret := &DirectorySite{
  24706. ServerResponse: googleapi.ServerResponse{
  24707. Header: res.Header,
  24708. HTTPStatusCode: res.StatusCode,
  24709. },
  24710. }
  24711. target := &ret
  24712. if err := gensupport.DecodeResponse(target, res); err != nil {
  24713. return nil, err
  24714. }
  24715. return ret, nil
  24716. // {
  24717. // "description": "Gets one directory site by ID.",
  24718. // "httpMethod": "GET",
  24719. // "id": "dfareporting.directorySites.get",
  24720. // "parameterOrder": [
  24721. // "profileId",
  24722. // "id"
  24723. // ],
  24724. // "parameters": {
  24725. // "id": {
  24726. // "description": "Directory site ID.",
  24727. // "format": "int64",
  24728. // "location": "path",
  24729. // "required": true,
  24730. // "type": "string"
  24731. // },
  24732. // "profileId": {
  24733. // "description": "User profile ID associated with this request.",
  24734. // "format": "int64",
  24735. // "location": "path",
  24736. // "required": true,
  24737. // "type": "string"
  24738. // }
  24739. // },
  24740. // "path": "userprofiles/{profileId}/directorySites/{id}",
  24741. // "response": {
  24742. // "$ref": "DirectorySite"
  24743. // },
  24744. // "scopes": [
  24745. // "https://www.googleapis.com/auth/dfatrafficking"
  24746. // ]
  24747. // }
  24748. }
  24749. // method id "dfareporting.directorySites.insert":
  24750. type DirectorySitesInsertCall struct {
  24751. s *Service
  24752. profileId int64
  24753. directorysite *DirectorySite
  24754. urlParams_ gensupport.URLParams
  24755. ctx_ context.Context
  24756. header_ http.Header
  24757. }
  24758. // Insert: Inserts a new directory site.
  24759. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  24760. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24761. c.profileId = profileId
  24762. c.directorysite = directorysite
  24763. return c
  24764. }
  24765. // Fields allows partial responses to be retrieved. See
  24766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24767. // for more information.
  24768. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  24769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24770. return c
  24771. }
  24772. // Context sets the context to be used in this call's Do method. Any
  24773. // pending HTTP request will be aborted if the provided context is
  24774. // canceled.
  24775. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  24776. c.ctx_ = ctx
  24777. return c
  24778. }
  24779. // Header returns an http.Header that can be modified by the caller to
  24780. // add HTTP headers to the request.
  24781. func (c *DirectorySitesInsertCall) Header() http.Header {
  24782. if c.header_ == nil {
  24783. c.header_ = make(http.Header)
  24784. }
  24785. return c.header_
  24786. }
  24787. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  24788. reqHeaders := make(http.Header)
  24789. for k, v := range c.header_ {
  24790. reqHeaders[k] = v
  24791. }
  24792. reqHeaders.Set("User-Agent", c.s.userAgent())
  24793. var body io.Reader = nil
  24794. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  24795. if err != nil {
  24796. return nil, err
  24797. }
  24798. reqHeaders.Set("Content-Type", "application/json")
  24799. c.urlParams_.Set("alt", alt)
  24800. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  24801. urls += "?" + c.urlParams_.Encode()
  24802. req, _ := http.NewRequest("POST", urls, body)
  24803. req.Header = reqHeaders
  24804. googleapi.Expand(req.URL, map[string]string{
  24805. "profileId": strconv.FormatInt(c.profileId, 10),
  24806. })
  24807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24808. }
  24809. // Do executes the "dfareporting.directorySites.insert" call.
  24810. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  24811. // status code is an error. Response headers are in either
  24812. // *DirectorySite.ServerResponse.Header or (if a response was returned
  24813. // at all) in error.(*googleapi.Error).Header. Use
  24814. // googleapi.IsNotModified to check whether the returned error was
  24815. // because http.StatusNotModified was returned.
  24816. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  24817. gensupport.SetOptions(c.urlParams_, opts...)
  24818. res, err := c.doRequest("json")
  24819. if res != nil && res.StatusCode == http.StatusNotModified {
  24820. if res.Body != nil {
  24821. res.Body.Close()
  24822. }
  24823. return nil, &googleapi.Error{
  24824. Code: res.StatusCode,
  24825. Header: res.Header,
  24826. }
  24827. }
  24828. if err != nil {
  24829. return nil, err
  24830. }
  24831. defer googleapi.CloseBody(res)
  24832. if err := googleapi.CheckResponse(res); err != nil {
  24833. return nil, err
  24834. }
  24835. ret := &DirectorySite{
  24836. ServerResponse: googleapi.ServerResponse{
  24837. Header: res.Header,
  24838. HTTPStatusCode: res.StatusCode,
  24839. },
  24840. }
  24841. target := &ret
  24842. if err := gensupport.DecodeResponse(target, res); err != nil {
  24843. return nil, err
  24844. }
  24845. return ret, nil
  24846. // {
  24847. // "description": "Inserts a new directory site.",
  24848. // "httpMethod": "POST",
  24849. // "id": "dfareporting.directorySites.insert",
  24850. // "parameterOrder": [
  24851. // "profileId"
  24852. // ],
  24853. // "parameters": {
  24854. // "profileId": {
  24855. // "description": "User profile ID associated with this request.",
  24856. // "format": "int64",
  24857. // "location": "path",
  24858. // "required": true,
  24859. // "type": "string"
  24860. // }
  24861. // },
  24862. // "path": "userprofiles/{profileId}/directorySites",
  24863. // "request": {
  24864. // "$ref": "DirectorySite"
  24865. // },
  24866. // "response": {
  24867. // "$ref": "DirectorySite"
  24868. // },
  24869. // "scopes": [
  24870. // "https://www.googleapis.com/auth/dfatrafficking"
  24871. // ]
  24872. // }
  24873. }
  24874. // method id "dfareporting.directorySites.list":
  24875. type DirectorySitesListCall struct {
  24876. s *Service
  24877. profileId int64
  24878. urlParams_ gensupport.URLParams
  24879. ifNoneMatch_ string
  24880. ctx_ context.Context
  24881. header_ http.Header
  24882. }
  24883. // List: Retrieves a list of directory sites, possibly filtered. This
  24884. // method supports paging.
  24885. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  24886. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24887. c.profileId = profileId
  24888. return c
  24889. }
  24890. // AcceptsInStreamVideoPlacements sets the optional parameter
  24891. // "acceptsInStreamVideoPlacements": This search filter is no longer
  24892. // supported and will have no effect on the results returned.
  24893. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  24894. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  24895. return c
  24896. }
  24897. // AcceptsInterstitialPlacements sets the optional parameter
  24898. // "acceptsInterstitialPlacements": This search filter is no longer
  24899. // supported and will have no effect on the results returned.
  24900. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  24901. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  24902. return c
  24903. }
  24904. // AcceptsPublisherPaidPlacements sets the optional parameter
  24905. // "acceptsPublisherPaidPlacements": Select only directory sites that
  24906. // accept publisher paid placements. This field can be left blank.
  24907. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  24908. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  24909. return c
  24910. }
  24911. // Active sets the optional parameter "active": Select only active
  24912. // directory sites. Leave blank to retrieve both active and inactive
  24913. // directory sites.
  24914. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  24915. c.urlParams_.Set("active", fmt.Sprint(active))
  24916. return c
  24917. }
  24918. // CountryId sets the optional parameter "countryId": Select only
  24919. // directory sites with this country ID.
  24920. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  24921. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  24922. return c
  24923. }
  24924. // DfpNetworkCode sets the optional parameter "dfp_network_code": Select
  24925. // only directory sites with this DFP network code.
  24926. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  24927. c.urlParams_.Set("dfp_network_code", dfpNetworkCode)
  24928. return c
  24929. }
  24930. // Ids sets the optional parameter "ids": Select only directory sites
  24931. // with these IDs.
  24932. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  24933. var ids_ []string
  24934. for _, v := range ids {
  24935. ids_ = append(ids_, fmt.Sprint(v))
  24936. }
  24937. c.urlParams_.SetMulti("ids", ids_)
  24938. return c
  24939. }
  24940. // MaxResults sets the optional parameter "maxResults": Maximum number
  24941. // of results to return.
  24942. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  24943. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24944. return c
  24945. }
  24946. // PageToken sets the optional parameter "pageToken": Value of the
  24947. // nextPageToken from the previous result page.
  24948. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  24949. c.urlParams_.Set("pageToken", pageToken)
  24950. return c
  24951. }
  24952. // ParentId sets the optional parameter "parentId": Select only
  24953. // directory sites with this parent ID.
  24954. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  24955. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  24956. return c
  24957. }
  24958. // SearchString sets the optional parameter "searchString": Allows
  24959. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  24960. // For example, "directory site*2015" will return objects with names
  24961. // like "directory site June 2015", "directory site April 2015", or
  24962. // simply "directory site 2015". Most of the searches also add wildcards
  24963. // implicitly at the start and the end of the search string. For
  24964. // example, a search string of "directory site" will match objects with
  24965. // name "my directory site", "directory site 2015" or simply, "directory
  24966. // site".
  24967. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  24968. c.urlParams_.Set("searchString", searchString)
  24969. return c
  24970. }
  24971. // SortField sets the optional parameter "sortField": Field by which to
  24972. // sort the list.
  24973. //
  24974. // Possible values:
  24975. // "ID" (default)
  24976. // "NAME"
  24977. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  24978. c.urlParams_.Set("sortField", sortField)
  24979. return c
  24980. }
  24981. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24982. // results.
  24983. //
  24984. // Possible values:
  24985. // "ASCENDING" (default)
  24986. // "DESCENDING"
  24987. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  24988. c.urlParams_.Set("sortOrder", sortOrder)
  24989. return c
  24990. }
  24991. // Fields allows partial responses to be retrieved. See
  24992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24993. // for more information.
  24994. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  24995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24996. return c
  24997. }
  24998. // IfNoneMatch sets the optional parameter which makes the operation
  24999. // fail if the object's ETag matches the given value. This is useful for
  25000. // getting updates only after the object has changed since the last
  25001. // request. Use googleapi.IsNotModified to check whether the response
  25002. // error from Do is the result of In-None-Match.
  25003. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  25004. c.ifNoneMatch_ = entityTag
  25005. return c
  25006. }
  25007. // Context sets the context to be used in this call's Do method. Any
  25008. // pending HTTP request will be aborted if the provided context is
  25009. // canceled.
  25010. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  25011. c.ctx_ = ctx
  25012. return c
  25013. }
  25014. // Header returns an http.Header that can be modified by the caller to
  25015. // add HTTP headers to the request.
  25016. func (c *DirectorySitesListCall) Header() http.Header {
  25017. if c.header_ == nil {
  25018. c.header_ = make(http.Header)
  25019. }
  25020. return c.header_
  25021. }
  25022. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  25023. reqHeaders := make(http.Header)
  25024. for k, v := range c.header_ {
  25025. reqHeaders[k] = v
  25026. }
  25027. reqHeaders.Set("User-Agent", c.s.userAgent())
  25028. if c.ifNoneMatch_ != "" {
  25029. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25030. }
  25031. var body io.Reader = nil
  25032. c.urlParams_.Set("alt", alt)
  25033. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  25034. urls += "?" + c.urlParams_.Encode()
  25035. req, _ := http.NewRequest("GET", urls, body)
  25036. req.Header = reqHeaders
  25037. googleapi.Expand(req.URL, map[string]string{
  25038. "profileId": strconv.FormatInt(c.profileId, 10),
  25039. })
  25040. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25041. }
  25042. // Do executes the "dfareporting.directorySites.list" call.
  25043. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  25044. // Any non-2xx status code is an error. Response headers are in either
  25045. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  25046. // was returned at all) in error.(*googleapi.Error).Header. Use
  25047. // googleapi.IsNotModified to check whether the returned error was
  25048. // because http.StatusNotModified was returned.
  25049. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  25050. gensupport.SetOptions(c.urlParams_, opts...)
  25051. res, err := c.doRequest("json")
  25052. if res != nil && res.StatusCode == http.StatusNotModified {
  25053. if res.Body != nil {
  25054. res.Body.Close()
  25055. }
  25056. return nil, &googleapi.Error{
  25057. Code: res.StatusCode,
  25058. Header: res.Header,
  25059. }
  25060. }
  25061. if err != nil {
  25062. return nil, err
  25063. }
  25064. defer googleapi.CloseBody(res)
  25065. if err := googleapi.CheckResponse(res); err != nil {
  25066. return nil, err
  25067. }
  25068. ret := &DirectorySitesListResponse{
  25069. ServerResponse: googleapi.ServerResponse{
  25070. Header: res.Header,
  25071. HTTPStatusCode: res.StatusCode,
  25072. },
  25073. }
  25074. target := &ret
  25075. if err := gensupport.DecodeResponse(target, res); err != nil {
  25076. return nil, err
  25077. }
  25078. return ret, nil
  25079. // {
  25080. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  25081. // "httpMethod": "GET",
  25082. // "id": "dfareporting.directorySites.list",
  25083. // "parameterOrder": [
  25084. // "profileId"
  25085. // ],
  25086. // "parameters": {
  25087. // "acceptsInStreamVideoPlacements": {
  25088. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  25089. // "location": "query",
  25090. // "type": "boolean"
  25091. // },
  25092. // "acceptsInterstitialPlacements": {
  25093. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  25094. // "location": "query",
  25095. // "type": "boolean"
  25096. // },
  25097. // "acceptsPublisherPaidPlacements": {
  25098. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  25099. // "location": "query",
  25100. // "type": "boolean"
  25101. // },
  25102. // "active": {
  25103. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  25104. // "location": "query",
  25105. // "type": "boolean"
  25106. // },
  25107. // "countryId": {
  25108. // "description": "Select only directory sites with this country ID.",
  25109. // "format": "int64",
  25110. // "location": "query",
  25111. // "type": "string"
  25112. // },
  25113. // "dfp_network_code": {
  25114. // "description": "Select only directory sites with this DFP network code.",
  25115. // "location": "query",
  25116. // "type": "string"
  25117. // },
  25118. // "ids": {
  25119. // "description": "Select only directory sites with these IDs.",
  25120. // "format": "int64",
  25121. // "location": "query",
  25122. // "repeated": true,
  25123. // "type": "string"
  25124. // },
  25125. // "maxResults": {
  25126. // "default": "1000",
  25127. // "description": "Maximum number of results to return.",
  25128. // "format": "int32",
  25129. // "location": "query",
  25130. // "maximum": "1000",
  25131. // "minimum": "0",
  25132. // "type": "integer"
  25133. // },
  25134. // "pageToken": {
  25135. // "description": "Value of the nextPageToken from the previous result page.",
  25136. // "location": "query",
  25137. // "type": "string"
  25138. // },
  25139. // "parentId": {
  25140. // "description": "Select only directory sites with this parent ID.",
  25141. // "format": "int64",
  25142. // "location": "query",
  25143. // "type": "string"
  25144. // },
  25145. // "profileId": {
  25146. // "description": "User profile ID associated with this request.",
  25147. // "format": "int64",
  25148. // "location": "path",
  25149. // "required": true,
  25150. // "type": "string"
  25151. // },
  25152. // "searchString": {
  25153. // "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\".",
  25154. // "location": "query",
  25155. // "type": "string"
  25156. // },
  25157. // "sortField": {
  25158. // "default": "ID",
  25159. // "description": "Field by which to sort the list.",
  25160. // "enum": [
  25161. // "ID",
  25162. // "NAME"
  25163. // ],
  25164. // "enumDescriptions": [
  25165. // "",
  25166. // ""
  25167. // ],
  25168. // "location": "query",
  25169. // "type": "string"
  25170. // },
  25171. // "sortOrder": {
  25172. // "default": "ASCENDING",
  25173. // "description": "Order of sorted results.",
  25174. // "enum": [
  25175. // "ASCENDING",
  25176. // "DESCENDING"
  25177. // ],
  25178. // "enumDescriptions": [
  25179. // "",
  25180. // ""
  25181. // ],
  25182. // "location": "query",
  25183. // "type": "string"
  25184. // }
  25185. // },
  25186. // "path": "userprofiles/{profileId}/directorySites",
  25187. // "response": {
  25188. // "$ref": "DirectorySitesListResponse"
  25189. // },
  25190. // "scopes": [
  25191. // "https://www.googleapis.com/auth/dfatrafficking"
  25192. // ]
  25193. // }
  25194. }
  25195. // Pages invokes f for each page of results.
  25196. // A non-nil error returned from f will halt the iteration.
  25197. // The provided context supersedes any context provided to the Context method.
  25198. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  25199. c.ctx_ = ctx
  25200. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25201. for {
  25202. x, err := c.Do()
  25203. if err != nil {
  25204. return err
  25205. }
  25206. if err := f(x); err != nil {
  25207. return err
  25208. }
  25209. if x.NextPageToken == "" {
  25210. return nil
  25211. }
  25212. c.PageToken(x.NextPageToken)
  25213. }
  25214. }
  25215. // method id "dfareporting.dynamicTargetingKeys.delete":
  25216. type DynamicTargetingKeysDeleteCall struct {
  25217. s *Service
  25218. profileId int64
  25219. objectId int64
  25220. urlParams_ gensupport.URLParams
  25221. ctx_ context.Context
  25222. header_ http.Header
  25223. }
  25224. // Delete: Deletes an existing dynamic targeting key.
  25225. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  25226. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25227. c.profileId = profileId
  25228. c.objectId = objectId
  25229. c.urlParams_.Set("name", name)
  25230. c.urlParams_.Set("objectType", objectType)
  25231. return c
  25232. }
  25233. // Fields allows partial responses to be retrieved. See
  25234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25235. // for more information.
  25236. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  25237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25238. return c
  25239. }
  25240. // Context sets the context to be used in this call's Do method. Any
  25241. // pending HTTP request will be aborted if the provided context is
  25242. // canceled.
  25243. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  25244. c.ctx_ = ctx
  25245. return c
  25246. }
  25247. // Header returns an http.Header that can be modified by the caller to
  25248. // add HTTP headers to the request.
  25249. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  25250. if c.header_ == nil {
  25251. c.header_ = make(http.Header)
  25252. }
  25253. return c.header_
  25254. }
  25255. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  25256. reqHeaders := make(http.Header)
  25257. for k, v := range c.header_ {
  25258. reqHeaders[k] = v
  25259. }
  25260. reqHeaders.Set("User-Agent", c.s.userAgent())
  25261. var body io.Reader = nil
  25262. c.urlParams_.Set("alt", alt)
  25263. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  25264. urls += "?" + c.urlParams_.Encode()
  25265. req, _ := http.NewRequest("DELETE", urls, body)
  25266. req.Header = reqHeaders
  25267. googleapi.Expand(req.URL, map[string]string{
  25268. "profileId": strconv.FormatInt(c.profileId, 10),
  25269. "objectId": strconv.FormatInt(c.objectId, 10),
  25270. })
  25271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25272. }
  25273. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  25274. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  25275. gensupport.SetOptions(c.urlParams_, opts...)
  25276. res, err := c.doRequest("json")
  25277. if err != nil {
  25278. return err
  25279. }
  25280. defer googleapi.CloseBody(res)
  25281. if err := googleapi.CheckResponse(res); err != nil {
  25282. return err
  25283. }
  25284. return nil
  25285. // {
  25286. // "description": "Deletes an existing dynamic targeting key.",
  25287. // "httpMethod": "DELETE",
  25288. // "id": "dfareporting.dynamicTargetingKeys.delete",
  25289. // "parameterOrder": [
  25290. // "profileId",
  25291. // "objectId",
  25292. // "name",
  25293. // "objectType"
  25294. // ],
  25295. // "parameters": {
  25296. // "name": {
  25297. // "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.",
  25298. // "location": "query",
  25299. // "required": true,
  25300. // "type": "string"
  25301. // },
  25302. // "objectId": {
  25303. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  25304. // "format": "int64",
  25305. // "location": "path",
  25306. // "required": true,
  25307. // "type": "string"
  25308. // },
  25309. // "objectType": {
  25310. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  25311. // "enum": [
  25312. // "OBJECT_AD",
  25313. // "OBJECT_ADVERTISER",
  25314. // "OBJECT_CREATIVE",
  25315. // "OBJECT_PLACEMENT"
  25316. // ],
  25317. // "enumDescriptions": [
  25318. // "",
  25319. // "",
  25320. // "",
  25321. // ""
  25322. // ],
  25323. // "location": "query",
  25324. // "required": true,
  25325. // "type": "string"
  25326. // },
  25327. // "profileId": {
  25328. // "description": "User profile ID associated with this request.",
  25329. // "format": "int64",
  25330. // "location": "path",
  25331. // "required": true,
  25332. // "type": "string"
  25333. // }
  25334. // },
  25335. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  25336. // "scopes": [
  25337. // "https://www.googleapis.com/auth/dfatrafficking"
  25338. // ]
  25339. // }
  25340. }
  25341. // method id "dfareporting.dynamicTargetingKeys.insert":
  25342. type DynamicTargetingKeysInsertCall struct {
  25343. s *Service
  25344. profileId int64
  25345. dynamictargetingkey *DynamicTargetingKey
  25346. urlParams_ gensupport.URLParams
  25347. ctx_ context.Context
  25348. header_ http.Header
  25349. }
  25350. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  25351. // the advertiser level before being assigned to the advertiser's ads,
  25352. // creatives, or placements. There is a maximum of 1000 keys per
  25353. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  25354. // creative, or placement.
  25355. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  25356. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25357. c.profileId = profileId
  25358. c.dynamictargetingkey = dynamictargetingkey
  25359. return c
  25360. }
  25361. // Fields allows partial responses to be retrieved. See
  25362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25363. // for more information.
  25364. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  25365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25366. return c
  25367. }
  25368. // Context sets the context to be used in this call's Do method. Any
  25369. // pending HTTP request will be aborted if the provided context is
  25370. // canceled.
  25371. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  25372. c.ctx_ = ctx
  25373. return c
  25374. }
  25375. // Header returns an http.Header that can be modified by the caller to
  25376. // add HTTP headers to the request.
  25377. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  25378. if c.header_ == nil {
  25379. c.header_ = make(http.Header)
  25380. }
  25381. return c.header_
  25382. }
  25383. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  25384. reqHeaders := make(http.Header)
  25385. for k, v := range c.header_ {
  25386. reqHeaders[k] = v
  25387. }
  25388. reqHeaders.Set("User-Agent", c.s.userAgent())
  25389. var body io.Reader = nil
  25390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  25391. if err != nil {
  25392. return nil, err
  25393. }
  25394. reqHeaders.Set("Content-Type", "application/json")
  25395. c.urlParams_.Set("alt", alt)
  25396. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  25397. urls += "?" + c.urlParams_.Encode()
  25398. req, _ := http.NewRequest("POST", urls, body)
  25399. req.Header = reqHeaders
  25400. googleapi.Expand(req.URL, map[string]string{
  25401. "profileId": strconv.FormatInt(c.profileId, 10),
  25402. })
  25403. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25404. }
  25405. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  25406. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  25407. // non-2xx status code is an error. Response headers are in either
  25408. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  25409. // returned at all) in error.(*googleapi.Error).Header. Use
  25410. // googleapi.IsNotModified to check whether the returned error was
  25411. // because http.StatusNotModified was returned.
  25412. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  25413. gensupport.SetOptions(c.urlParams_, opts...)
  25414. res, err := c.doRequest("json")
  25415. if res != nil && res.StatusCode == http.StatusNotModified {
  25416. if res.Body != nil {
  25417. res.Body.Close()
  25418. }
  25419. return nil, &googleapi.Error{
  25420. Code: res.StatusCode,
  25421. Header: res.Header,
  25422. }
  25423. }
  25424. if err != nil {
  25425. return nil, err
  25426. }
  25427. defer googleapi.CloseBody(res)
  25428. if err := googleapi.CheckResponse(res); err != nil {
  25429. return nil, err
  25430. }
  25431. ret := &DynamicTargetingKey{
  25432. ServerResponse: googleapi.ServerResponse{
  25433. Header: res.Header,
  25434. HTTPStatusCode: res.StatusCode,
  25435. },
  25436. }
  25437. target := &ret
  25438. if err := gensupport.DecodeResponse(target, res); err != nil {
  25439. return nil, err
  25440. }
  25441. return ret, nil
  25442. // {
  25443. // "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.",
  25444. // "httpMethod": "POST",
  25445. // "id": "dfareporting.dynamicTargetingKeys.insert",
  25446. // "parameterOrder": [
  25447. // "profileId"
  25448. // ],
  25449. // "parameters": {
  25450. // "profileId": {
  25451. // "description": "User profile ID associated with this request.",
  25452. // "format": "int64",
  25453. // "location": "path",
  25454. // "required": true,
  25455. // "type": "string"
  25456. // }
  25457. // },
  25458. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  25459. // "request": {
  25460. // "$ref": "DynamicTargetingKey"
  25461. // },
  25462. // "response": {
  25463. // "$ref": "DynamicTargetingKey"
  25464. // },
  25465. // "scopes": [
  25466. // "https://www.googleapis.com/auth/dfatrafficking"
  25467. // ]
  25468. // }
  25469. }
  25470. // method id "dfareporting.dynamicTargetingKeys.list":
  25471. type DynamicTargetingKeysListCall struct {
  25472. s *Service
  25473. profileId int64
  25474. urlParams_ gensupport.URLParams
  25475. ifNoneMatch_ string
  25476. ctx_ context.Context
  25477. header_ http.Header
  25478. }
  25479. // List: Retrieves a list of dynamic targeting keys.
  25480. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  25481. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25482. c.profileId = profileId
  25483. return c
  25484. }
  25485. // AdvertiserId sets the optional parameter "advertiserId": Select only
  25486. // dynamic targeting keys whose object has this advertiser ID.
  25487. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  25488. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  25489. return c
  25490. }
  25491. // Names sets the optional parameter "names": Select only dynamic
  25492. // targeting keys exactly matching these names.
  25493. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  25494. c.urlParams_.SetMulti("names", append([]string{}, names...))
  25495. return c
  25496. }
  25497. // ObjectId sets the optional parameter "objectId": Select only dynamic
  25498. // targeting keys with this object ID.
  25499. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  25500. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  25501. return c
  25502. }
  25503. // ObjectType sets the optional parameter "objectType": Select only
  25504. // dynamic targeting keys with this object type.
  25505. //
  25506. // Possible values:
  25507. // "OBJECT_AD"
  25508. // "OBJECT_ADVERTISER"
  25509. // "OBJECT_CREATIVE"
  25510. // "OBJECT_PLACEMENT"
  25511. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  25512. c.urlParams_.Set("objectType", objectType)
  25513. return c
  25514. }
  25515. // Fields allows partial responses to be retrieved. See
  25516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25517. // for more information.
  25518. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  25519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25520. return c
  25521. }
  25522. // IfNoneMatch sets the optional parameter which makes the operation
  25523. // fail if the object's ETag matches the given value. This is useful for
  25524. // getting updates only after the object has changed since the last
  25525. // request. Use googleapi.IsNotModified to check whether the response
  25526. // error from Do is the result of In-None-Match.
  25527. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  25528. c.ifNoneMatch_ = entityTag
  25529. return c
  25530. }
  25531. // Context sets the context to be used in this call's Do method. Any
  25532. // pending HTTP request will be aborted if the provided context is
  25533. // canceled.
  25534. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  25535. c.ctx_ = ctx
  25536. return c
  25537. }
  25538. // Header returns an http.Header that can be modified by the caller to
  25539. // add HTTP headers to the request.
  25540. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  25541. if c.header_ == nil {
  25542. c.header_ = make(http.Header)
  25543. }
  25544. return c.header_
  25545. }
  25546. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  25547. reqHeaders := make(http.Header)
  25548. for k, v := range c.header_ {
  25549. reqHeaders[k] = v
  25550. }
  25551. reqHeaders.Set("User-Agent", c.s.userAgent())
  25552. if c.ifNoneMatch_ != "" {
  25553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25554. }
  25555. var body io.Reader = nil
  25556. c.urlParams_.Set("alt", alt)
  25557. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  25558. urls += "?" + c.urlParams_.Encode()
  25559. req, _ := http.NewRequest("GET", urls, body)
  25560. req.Header = reqHeaders
  25561. googleapi.Expand(req.URL, map[string]string{
  25562. "profileId": strconv.FormatInt(c.profileId, 10),
  25563. })
  25564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25565. }
  25566. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  25567. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  25568. // non-nil. Any non-2xx status code is an error. Response headers are in
  25569. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  25570. // a response was returned at all) in error.(*googleapi.Error).Header.
  25571. // Use googleapi.IsNotModified to check whether the returned error was
  25572. // because http.StatusNotModified was returned.
  25573. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  25574. gensupport.SetOptions(c.urlParams_, opts...)
  25575. res, err := c.doRequest("json")
  25576. if res != nil && res.StatusCode == http.StatusNotModified {
  25577. if res.Body != nil {
  25578. res.Body.Close()
  25579. }
  25580. return nil, &googleapi.Error{
  25581. Code: res.StatusCode,
  25582. Header: res.Header,
  25583. }
  25584. }
  25585. if err != nil {
  25586. return nil, err
  25587. }
  25588. defer googleapi.CloseBody(res)
  25589. if err := googleapi.CheckResponse(res); err != nil {
  25590. return nil, err
  25591. }
  25592. ret := &DynamicTargetingKeysListResponse{
  25593. ServerResponse: googleapi.ServerResponse{
  25594. Header: res.Header,
  25595. HTTPStatusCode: res.StatusCode,
  25596. },
  25597. }
  25598. target := &ret
  25599. if err := gensupport.DecodeResponse(target, res); err != nil {
  25600. return nil, err
  25601. }
  25602. return ret, nil
  25603. // {
  25604. // "description": "Retrieves a list of dynamic targeting keys.",
  25605. // "httpMethod": "GET",
  25606. // "id": "dfareporting.dynamicTargetingKeys.list",
  25607. // "parameterOrder": [
  25608. // "profileId"
  25609. // ],
  25610. // "parameters": {
  25611. // "advertiserId": {
  25612. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  25613. // "format": "int64",
  25614. // "location": "query",
  25615. // "type": "string"
  25616. // },
  25617. // "names": {
  25618. // "description": "Select only dynamic targeting keys exactly matching these names.",
  25619. // "location": "query",
  25620. // "repeated": true,
  25621. // "type": "string"
  25622. // },
  25623. // "objectId": {
  25624. // "description": "Select only dynamic targeting keys with this object ID.",
  25625. // "format": "int64",
  25626. // "location": "query",
  25627. // "type": "string"
  25628. // },
  25629. // "objectType": {
  25630. // "description": "Select only dynamic targeting keys with this object type.",
  25631. // "enum": [
  25632. // "OBJECT_AD",
  25633. // "OBJECT_ADVERTISER",
  25634. // "OBJECT_CREATIVE",
  25635. // "OBJECT_PLACEMENT"
  25636. // ],
  25637. // "enumDescriptions": [
  25638. // "",
  25639. // "",
  25640. // "",
  25641. // ""
  25642. // ],
  25643. // "location": "query",
  25644. // "type": "string"
  25645. // },
  25646. // "profileId": {
  25647. // "description": "User profile ID associated with this request.",
  25648. // "format": "int64",
  25649. // "location": "path",
  25650. // "required": true,
  25651. // "type": "string"
  25652. // }
  25653. // },
  25654. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  25655. // "response": {
  25656. // "$ref": "DynamicTargetingKeysListResponse"
  25657. // },
  25658. // "scopes": [
  25659. // "https://www.googleapis.com/auth/dfatrafficking"
  25660. // ]
  25661. // }
  25662. }
  25663. // method id "dfareporting.eventTags.delete":
  25664. type EventTagsDeleteCall struct {
  25665. s *Service
  25666. profileId int64
  25667. id int64
  25668. urlParams_ gensupport.URLParams
  25669. ctx_ context.Context
  25670. header_ http.Header
  25671. }
  25672. // Delete: Deletes an existing event tag.
  25673. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  25674. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25675. c.profileId = profileId
  25676. c.id = id
  25677. return c
  25678. }
  25679. // Fields allows partial responses to be retrieved. See
  25680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25681. // for more information.
  25682. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  25683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25684. return c
  25685. }
  25686. // Context sets the context to be used in this call's Do method. Any
  25687. // pending HTTP request will be aborted if the provided context is
  25688. // canceled.
  25689. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  25690. c.ctx_ = ctx
  25691. return c
  25692. }
  25693. // Header returns an http.Header that can be modified by the caller to
  25694. // add HTTP headers to the request.
  25695. func (c *EventTagsDeleteCall) Header() http.Header {
  25696. if c.header_ == nil {
  25697. c.header_ = make(http.Header)
  25698. }
  25699. return c.header_
  25700. }
  25701. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  25702. reqHeaders := make(http.Header)
  25703. for k, v := range c.header_ {
  25704. reqHeaders[k] = v
  25705. }
  25706. reqHeaders.Set("User-Agent", c.s.userAgent())
  25707. var body io.Reader = nil
  25708. c.urlParams_.Set("alt", alt)
  25709. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  25710. urls += "?" + c.urlParams_.Encode()
  25711. req, _ := http.NewRequest("DELETE", urls, body)
  25712. req.Header = reqHeaders
  25713. googleapi.Expand(req.URL, map[string]string{
  25714. "profileId": strconv.FormatInt(c.profileId, 10),
  25715. "id": strconv.FormatInt(c.id, 10),
  25716. })
  25717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25718. }
  25719. // Do executes the "dfareporting.eventTags.delete" call.
  25720. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  25721. gensupport.SetOptions(c.urlParams_, opts...)
  25722. res, err := c.doRequest("json")
  25723. if err != nil {
  25724. return err
  25725. }
  25726. defer googleapi.CloseBody(res)
  25727. if err := googleapi.CheckResponse(res); err != nil {
  25728. return err
  25729. }
  25730. return nil
  25731. // {
  25732. // "description": "Deletes an existing event tag.",
  25733. // "httpMethod": "DELETE",
  25734. // "id": "dfareporting.eventTags.delete",
  25735. // "parameterOrder": [
  25736. // "profileId",
  25737. // "id"
  25738. // ],
  25739. // "parameters": {
  25740. // "id": {
  25741. // "description": "Event tag ID.",
  25742. // "format": "int64",
  25743. // "location": "path",
  25744. // "required": true,
  25745. // "type": "string"
  25746. // },
  25747. // "profileId": {
  25748. // "description": "User profile ID associated with this request.",
  25749. // "format": "int64",
  25750. // "location": "path",
  25751. // "required": true,
  25752. // "type": "string"
  25753. // }
  25754. // },
  25755. // "path": "userprofiles/{profileId}/eventTags/{id}",
  25756. // "scopes": [
  25757. // "https://www.googleapis.com/auth/dfatrafficking"
  25758. // ]
  25759. // }
  25760. }
  25761. // method id "dfareporting.eventTags.get":
  25762. type EventTagsGetCall struct {
  25763. s *Service
  25764. profileId int64
  25765. id int64
  25766. urlParams_ gensupport.URLParams
  25767. ifNoneMatch_ string
  25768. ctx_ context.Context
  25769. header_ http.Header
  25770. }
  25771. // Get: Gets one event tag by ID.
  25772. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  25773. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25774. c.profileId = profileId
  25775. c.id = id
  25776. return c
  25777. }
  25778. // Fields allows partial responses to be retrieved. See
  25779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25780. // for more information.
  25781. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  25782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25783. return c
  25784. }
  25785. // IfNoneMatch sets the optional parameter which makes the operation
  25786. // fail if the object's ETag matches the given value. This is useful for
  25787. // getting updates only after the object has changed since the last
  25788. // request. Use googleapi.IsNotModified to check whether the response
  25789. // error from Do is the result of In-None-Match.
  25790. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  25791. c.ifNoneMatch_ = entityTag
  25792. return c
  25793. }
  25794. // Context sets the context to be used in this call's Do method. Any
  25795. // pending HTTP request will be aborted if the provided context is
  25796. // canceled.
  25797. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  25798. c.ctx_ = ctx
  25799. return c
  25800. }
  25801. // Header returns an http.Header that can be modified by the caller to
  25802. // add HTTP headers to the request.
  25803. func (c *EventTagsGetCall) Header() http.Header {
  25804. if c.header_ == nil {
  25805. c.header_ = make(http.Header)
  25806. }
  25807. return c.header_
  25808. }
  25809. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  25810. reqHeaders := make(http.Header)
  25811. for k, v := range c.header_ {
  25812. reqHeaders[k] = v
  25813. }
  25814. reqHeaders.Set("User-Agent", c.s.userAgent())
  25815. if c.ifNoneMatch_ != "" {
  25816. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25817. }
  25818. var body io.Reader = nil
  25819. c.urlParams_.Set("alt", alt)
  25820. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  25821. urls += "?" + c.urlParams_.Encode()
  25822. req, _ := http.NewRequest("GET", urls, body)
  25823. req.Header = reqHeaders
  25824. googleapi.Expand(req.URL, map[string]string{
  25825. "profileId": strconv.FormatInt(c.profileId, 10),
  25826. "id": strconv.FormatInt(c.id, 10),
  25827. })
  25828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25829. }
  25830. // Do executes the "dfareporting.eventTags.get" call.
  25831. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  25832. // code is an error. Response headers are in either
  25833. // *EventTag.ServerResponse.Header or (if a response was returned at
  25834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25835. // to check whether the returned error was because
  25836. // http.StatusNotModified was returned.
  25837. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  25838. gensupport.SetOptions(c.urlParams_, opts...)
  25839. res, err := c.doRequest("json")
  25840. if res != nil && res.StatusCode == http.StatusNotModified {
  25841. if res.Body != nil {
  25842. res.Body.Close()
  25843. }
  25844. return nil, &googleapi.Error{
  25845. Code: res.StatusCode,
  25846. Header: res.Header,
  25847. }
  25848. }
  25849. if err != nil {
  25850. return nil, err
  25851. }
  25852. defer googleapi.CloseBody(res)
  25853. if err := googleapi.CheckResponse(res); err != nil {
  25854. return nil, err
  25855. }
  25856. ret := &EventTag{
  25857. ServerResponse: googleapi.ServerResponse{
  25858. Header: res.Header,
  25859. HTTPStatusCode: res.StatusCode,
  25860. },
  25861. }
  25862. target := &ret
  25863. if err := gensupport.DecodeResponse(target, res); err != nil {
  25864. return nil, err
  25865. }
  25866. return ret, nil
  25867. // {
  25868. // "description": "Gets one event tag by ID.",
  25869. // "httpMethod": "GET",
  25870. // "id": "dfareporting.eventTags.get",
  25871. // "parameterOrder": [
  25872. // "profileId",
  25873. // "id"
  25874. // ],
  25875. // "parameters": {
  25876. // "id": {
  25877. // "description": "Event tag ID.",
  25878. // "format": "int64",
  25879. // "location": "path",
  25880. // "required": true,
  25881. // "type": "string"
  25882. // },
  25883. // "profileId": {
  25884. // "description": "User profile ID associated with this request.",
  25885. // "format": "int64",
  25886. // "location": "path",
  25887. // "required": true,
  25888. // "type": "string"
  25889. // }
  25890. // },
  25891. // "path": "userprofiles/{profileId}/eventTags/{id}",
  25892. // "response": {
  25893. // "$ref": "EventTag"
  25894. // },
  25895. // "scopes": [
  25896. // "https://www.googleapis.com/auth/dfatrafficking"
  25897. // ]
  25898. // }
  25899. }
  25900. // method id "dfareporting.eventTags.insert":
  25901. type EventTagsInsertCall struct {
  25902. s *Service
  25903. profileId int64
  25904. eventtag *EventTag
  25905. urlParams_ gensupport.URLParams
  25906. ctx_ context.Context
  25907. header_ http.Header
  25908. }
  25909. // Insert: Inserts a new event tag.
  25910. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  25911. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25912. c.profileId = profileId
  25913. c.eventtag = eventtag
  25914. return c
  25915. }
  25916. // Fields allows partial responses to be retrieved. See
  25917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25918. // for more information.
  25919. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  25920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25921. return c
  25922. }
  25923. // Context sets the context to be used in this call's Do method. Any
  25924. // pending HTTP request will be aborted if the provided context is
  25925. // canceled.
  25926. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  25927. c.ctx_ = ctx
  25928. return c
  25929. }
  25930. // Header returns an http.Header that can be modified by the caller to
  25931. // add HTTP headers to the request.
  25932. func (c *EventTagsInsertCall) Header() http.Header {
  25933. if c.header_ == nil {
  25934. c.header_ = make(http.Header)
  25935. }
  25936. return c.header_
  25937. }
  25938. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  25939. reqHeaders := make(http.Header)
  25940. for k, v := range c.header_ {
  25941. reqHeaders[k] = v
  25942. }
  25943. reqHeaders.Set("User-Agent", c.s.userAgent())
  25944. var body io.Reader = nil
  25945. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  25946. if err != nil {
  25947. return nil, err
  25948. }
  25949. reqHeaders.Set("Content-Type", "application/json")
  25950. c.urlParams_.Set("alt", alt)
  25951. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  25952. urls += "?" + c.urlParams_.Encode()
  25953. req, _ := http.NewRequest("POST", urls, body)
  25954. req.Header = reqHeaders
  25955. googleapi.Expand(req.URL, map[string]string{
  25956. "profileId": strconv.FormatInt(c.profileId, 10),
  25957. })
  25958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25959. }
  25960. // Do executes the "dfareporting.eventTags.insert" call.
  25961. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  25962. // code is an error. Response headers are in either
  25963. // *EventTag.ServerResponse.Header or (if a response was returned at
  25964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25965. // to check whether the returned error was because
  25966. // http.StatusNotModified was returned.
  25967. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  25968. gensupport.SetOptions(c.urlParams_, opts...)
  25969. res, err := c.doRequest("json")
  25970. if res != nil && res.StatusCode == http.StatusNotModified {
  25971. if res.Body != nil {
  25972. res.Body.Close()
  25973. }
  25974. return nil, &googleapi.Error{
  25975. Code: res.StatusCode,
  25976. Header: res.Header,
  25977. }
  25978. }
  25979. if err != nil {
  25980. return nil, err
  25981. }
  25982. defer googleapi.CloseBody(res)
  25983. if err := googleapi.CheckResponse(res); err != nil {
  25984. return nil, err
  25985. }
  25986. ret := &EventTag{
  25987. ServerResponse: googleapi.ServerResponse{
  25988. Header: res.Header,
  25989. HTTPStatusCode: res.StatusCode,
  25990. },
  25991. }
  25992. target := &ret
  25993. if err := gensupport.DecodeResponse(target, res); err != nil {
  25994. return nil, err
  25995. }
  25996. return ret, nil
  25997. // {
  25998. // "description": "Inserts a new event tag.",
  25999. // "httpMethod": "POST",
  26000. // "id": "dfareporting.eventTags.insert",
  26001. // "parameterOrder": [
  26002. // "profileId"
  26003. // ],
  26004. // "parameters": {
  26005. // "profileId": {
  26006. // "description": "User profile ID associated with this request.",
  26007. // "format": "int64",
  26008. // "location": "path",
  26009. // "required": true,
  26010. // "type": "string"
  26011. // }
  26012. // },
  26013. // "path": "userprofiles/{profileId}/eventTags",
  26014. // "request": {
  26015. // "$ref": "EventTag"
  26016. // },
  26017. // "response": {
  26018. // "$ref": "EventTag"
  26019. // },
  26020. // "scopes": [
  26021. // "https://www.googleapis.com/auth/dfatrafficking"
  26022. // ]
  26023. // }
  26024. }
  26025. // method id "dfareporting.eventTags.list":
  26026. type EventTagsListCall struct {
  26027. s *Service
  26028. profileId int64
  26029. urlParams_ gensupport.URLParams
  26030. ifNoneMatch_ string
  26031. ctx_ context.Context
  26032. header_ http.Header
  26033. }
  26034. // List: Retrieves a list of event tags, possibly filtered.
  26035. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  26036. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26037. c.profileId = profileId
  26038. return c
  26039. }
  26040. // AdId sets the optional parameter "adId": Select only event tags that
  26041. // belong to this ad.
  26042. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  26043. c.urlParams_.Set("adId", fmt.Sprint(adId))
  26044. return c
  26045. }
  26046. // AdvertiserId sets the optional parameter "advertiserId": Select only
  26047. // event tags that belong to this advertiser.
  26048. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  26049. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  26050. return c
  26051. }
  26052. // CampaignId sets the optional parameter "campaignId": Select only
  26053. // event tags that belong to this campaign.
  26054. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  26055. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  26056. return c
  26057. }
  26058. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  26059. // Examine only the specified campaign or advertiser's event tags for
  26060. // matching selector criteria. When set to false, the parent advertiser
  26061. // and parent campaign of the specified ad or campaign is examined as
  26062. // well. In addition, when set to false, the status field is examined as
  26063. // well, along with the enabledByDefault field. This parameter can not
  26064. // be set to true when adId is specified as ads do not define their own
  26065. // even tags.
  26066. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  26067. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  26068. return c
  26069. }
  26070. // Enabled sets the optional parameter "enabled": Select only enabled
  26071. // event tags. What is considered enabled or disabled depends on the
  26072. // definitionsOnly parameter. When definitionsOnly is set to true, only
  26073. // the specified advertiser or campaign's event tags' enabledByDefault
  26074. // field is examined. When definitionsOnly is set to false, the
  26075. // specified ad or specified campaign's parent advertiser's or parent
  26076. // campaign's event tags' enabledByDefault and status fields are
  26077. // examined as well.
  26078. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  26079. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  26080. return c
  26081. }
  26082. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  26083. // only event tags with the specified event tag types. Event tag types
  26084. // can be used to specify whether to use a third-party pixel, a
  26085. // third-party JavaScript URL, or a third-party click-through URL for
  26086. // either impression or click tracking.
  26087. //
  26088. // Possible values:
  26089. // "CLICK_THROUGH_EVENT_TAG"
  26090. // "IMPRESSION_IMAGE_EVENT_TAG"
  26091. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  26092. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  26093. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  26094. return c
  26095. }
  26096. // Ids sets the optional parameter "ids": Select only event tags with
  26097. // these IDs.
  26098. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  26099. var ids_ []string
  26100. for _, v := range ids {
  26101. ids_ = append(ids_, fmt.Sprint(v))
  26102. }
  26103. c.urlParams_.SetMulti("ids", ids_)
  26104. return c
  26105. }
  26106. // SearchString sets the optional parameter "searchString": Allows
  26107. // searching for objects by name or ID. Wildcards (*) are allowed. For
  26108. // example, "eventtag*2015" will return objects with names like
  26109. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  26110. // 2015". Most of the searches also add wildcards implicitly at the
  26111. // start and the end of the search string. For example, a search string
  26112. // of "eventtag" will match objects with name "my eventtag", "eventtag
  26113. // 2015", or simply "eventtag".
  26114. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  26115. c.urlParams_.Set("searchString", searchString)
  26116. return c
  26117. }
  26118. // SortField sets the optional parameter "sortField": Field by which to
  26119. // sort the list.
  26120. //
  26121. // Possible values:
  26122. // "ID" (default)
  26123. // "NAME"
  26124. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  26125. c.urlParams_.Set("sortField", sortField)
  26126. return c
  26127. }
  26128. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26129. // results.
  26130. //
  26131. // Possible values:
  26132. // "ASCENDING" (default)
  26133. // "DESCENDING"
  26134. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  26135. c.urlParams_.Set("sortOrder", sortOrder)
  26136. return c
  26137. }
  26138. // Fields allows partial responses to be retrieved. See
  26139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26140. // for more information.
  26141. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  26142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26143. return c
  26144. }
  26145. // IfNoneMatch sets the optional parameter which makes the operation
  26146. // fail if the object's ETag matches the given value. This is useful for
  26147. // getting updates only after the object has changed since the last
  26148. // request. Use googleapi.IsNotModified to check whether the response
  26149. // error from Do is the result of In-None-Match.
  26150. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  26151. c.ifNoneMatch_ = entityTag
  26152. return c
  26153. }
  26154. // Context sets the context to be used in this call's Do method. Any
  26155. // pending HTTP request will be aborted if the provided context is
  26156. // canceled.
  26157. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  26158. c.ctx_ = ctx
  26159. return c
  26160. }
  26161. // Header returns an http.Header that can be modified by the caller to
  26162. // add HTTP headers to the request.
  26163. func (c *EventTagsListCall) Header() http.Header {
  26164. if c.header_ == nil {
  26165. c.header_ = make(http.Header)
  26166. }
  26167. return c.header_
  26168. }
  26169. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  26170. reqHeaders := make(http.Header)
  26171. for k, v := range c.header_ {
  26172. reqHeaders[k] = v
  26173. }
  26174. reqHeaders.Set("User-Agent", c.s.userAgent())
  26175. if c.ifNoneMatch_ != "" {
  26176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26177. }
  26178. var body io.Reader = nil
  26179. c.urlParams_.Set("alt", alt)
  26180. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  26181. urls += "?" + c.urlParams_.Encode()
  26182. req, _ := http.NewRequest("GET", urls, body)
  26183. req.Header = reqHeaders
  26184. googleapi.Expand(req.URL, map[string]string{
  26185. "profileId": strconv.FormatInt(c.profileId, 10),
  26186. })
  26187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26188. }
  26189. // Do executes the "dfareporting.eventTags.list" call.
  26190. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  26191. // non-2xx status code is an error. Response headers are in either
  26192. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  26193. // returned at all) in error.(*googleapi.Error).Header. Use
  26194. // googleapi.IsNotModified to check whether the returned error was
  26195. // because http.StatusNotModified was returned.
  26196. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  26197. gensupport.SetOptions(c.urlParams_, opts...)
  26198. res, err := c.doRequest("json")
  26199. if res != nil && res.StatusCode == http.StatusNotModified {
  26200. if res.Body != nil {
  26201. res.Body.Close()
  26202. }
  26203. return nil, &googleapi.Error{
  26204. Code: res.StatusCode,
  26205. Header: res.Header,
  26206. }
  26207. }
  26208. if err != nil {
  26209. return nil, err
  26210. }
  26211. defer googleapi.CloseBody(res)
  26212. if err := googleapi.CheckResponse(res); err != nil {
  26213. return nil, err
  26214. }
  26215. ret := &EventTagsListResponse{
  26216. ServerResponse: googleapi.ServerResponse{
  26217. Header: res.Header,
  26218. HTTPStatusCode: res.StatusCode,
  26219. },
  26220. }
  26221. target := &ret
  26222. if err := gensupport.DecodeResponse(target, res); err != nil {
  26223. return nil, err
  26224. }
  26225. return ret, nil
  26226. // {
  26227. // "description": "Retrieves a list of event tags, possibly filtered.",
  26228. // "httpMethod": "GET",
  26229. // "id": "dfareporting.eventTags.list",
  26230. // "parameterOrder": [
  26231. // "profileId"
  26232. // ],
  26233. // "parameters": {
  26234. // "adId": {
  26235. // "description": "Select only event tags that belong to this ad.",
  26236. // "format": "int64",
  26237. // "location": "query",
  26238. // "type": "string"
  26239. // },
  26240. // "advertiserId": {
  26241. // "description": "Select only event tags that belong to this advertiser.",
  26242. // "format": "int64",
  26243. // "location": "query",
  26244. // "type": "string"
  26245. // },
  26246. // "campaignId": {
  26247. // "description": "Select only event tags that belong to this campaign.",
  26248. // "format": "int64",
  26249. // "location": "query",
  26250. // "type": "string"
  26251. // },
  26252. // "definitionsOnly": {
  26253. // "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.",
  26254. // "location": "query",
  26255. // "type": "boolean"
  26256. // },
  26257. // "enabled": {
  26258. // "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.",
  26259. // "location": "query",
  26260. // "type": "boolean"
  26261. // },
  26262. // "eventTagTypes": {
  26263. // "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.",
  26264. // "enum": [
  26265. // "CLICK_THROUGH_EVENT_TAG",
  26266. // "IMPRESSION_IMAGE_EVENT_TAG",
  26267. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  26268. // ],
  26269. // "enumDescriptions": [
  26270. // "",
  26271. // "",
  26272. // ""
  26273. // ],
  26274. // "location": "query",
  26275. // "repeated": true,
  26276. // "type": "string"
  26277. // },
  26278. // "ids": {
  26279. // "description": "Select only event tags with these IDs.",
  26280. // "format": "int64",
  26281. // "location": "query",
  26282. // "repeated": true,
  26283. // "type": "string"
  26284. // },
  26285. // "profileId": {
  26286. // "description": "User profile ID associated with this request.",
  26287. // "format": "int64",
  26288. // "location": "path",
  26289. // "required": true,
  26290. // "type": "string"
  26291. // },
  26292. // "searchString": {
  26293. // "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\".",
  26294. // "location": "query",
  26295. // "type": "string"
  26296. // },
  26297. // "sortField": {
  26298. // "default": "ID",
  26299. // "description": "Field by which to sort the list.",
  26300. // "enum": [
  26301. // "ID",
  26302. // "NAME"
  26303. // ],
  26304. // "enumDescriptions": [
  26305. // "",
  26306. // ""
  26307. // ],
  26308. // "location": "query",
  26309. // "type": "string"
  26310. // },
  26311. // "sortOrder": {
  26312. // "default": "ASCENDING",
  26313. // "description": "Order of sorted results.",
  26314. // "enum": [
  26315. // "ASCENDING",
  26316. // "DESCENDING"
  26317. // ],
  26318. // "enumDescriptions": [
  26319. // "",
  26320. // ""
  26321. // ],
  26322. // "location": "query",
  26323. // "type": "string"
  26324. // }
  26325. // },
  26326. // "path": "userprofiles/{profileId}/eventTags",
  26327. // "response": {
  26328. // "$ref": "EventTagsListResponse"
  26329. // },
  26330. // "scopes": [
  26331. // "https://www.googleapis.com/auth/dfatrafficking"
  26332. // ]
  26333. // }
  26334. }
  26335. // method id "dfareporting.eventTags.patch":
  26336. type EventTagsPatchCall struct {
  26337. s *Service
  26338. profileId int64
  26339. eventtag *EventTag
  26340. urlParams_ gensupport.URLParams
  26341. ctx_ context.Context
  26342. header_ http.Header
  26343. }
  26344. // Patch: Updates an existing event tag. This method supports patch
  26345. // semantics.
  26346. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  26347. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26348. c.profileId = profileId
  26349. c.urlParams_.Set("id", fmt.Sprint(id))
  26350. c.eventtag = eventtag
  26351. return c
  26352. }
  26353. // Fields allows partial responses to be retrieved. See
  26354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26355. // for more information.
  26356. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  26357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26358. return c
  26359. }
  26360. // Context sets the context to be used in this call's Do method. Any
  26361. // pending HTTP request will be aborted if the provided context is
  26362. // canceled.
  26363. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  26364. c.ctx_ = ctx
  26365. return c
  26366. }
  26367. // Header returns an http.Header that can be modified by the caller to
  26368. // add HTTP headers to the request.
  26369. func (c *EventTagsPatchCall) Header() http.Header {
  26370. if c.header_ == nil {
  26371. c.header_ = make(http.Header)
  26372. }
  26373. return c.header_
  26374. }
  26375. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  26376. reqHeaders := make(http.Header)
  26377. for k, v := range c.header_ {
  26378. reqHeaders[k] = v
  26379. }
  26380. reqHeaders.Set("User-Agent", c.s.userAgent())
  26381. var body io.Reader = nil
  26382. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  26383. if err != nil {
  26384. return nil, err
  26385. }
  26386. reqHeaders.Set("Content-Type", "application/json")
  26387. c.urlParams_.Set("alt", alt)
  26388. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  26389. urls += "?" + c.urlParams_.Encode()
  26390. req, _ := http.NewRequest("PATCH", urls, body)
  26391. req.Header = reqHeaders
  26392. googleapi.Expand(req.URL, map[string]string{
  26393. "profileId": strconv.FormatInt(c.profileId, 10),
  26394. })
  26395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26396. }
  26397. // Do executes the "dfareporting.eventTags.patch" call.
  26398. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  26399. // code is an error. Response headers are in either
  26400. // *EventTag.ServerResponse.Header or (if a response was returned at
  26401. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26402. // to check whether the returned error was because
  26403. // http.StatusNotModified was returned.
  26404. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  26405. gensupport.SetOptions(c.urlParams_, opts...)
  26406. res, err := c.doRequest("json")
  26407. if res != nil && res.StatusCode == http.StatusNotModified {
  26408. if res.Body != nil {
  26409. res.Body.Close()
  26410. }
  26411. return nil, &googleapi.Error{
  26412. Code: res.StatusCode,
  26413. Header: res.Header,
  26414. }
  26415. }
  26416. if err != nil {
  26417. return nil, err
  26418. }
  26419. defer googleapi.CloseBody(res)
  26420. if err := googleapi.CheckResponse(res); err != nil {
  26421. return nil, err
  26422. }
  26423. ret := &EventTag{
  26424. ServerResponse: googleapi.ServerResponse{
  26425. Header: res.Header,
  26426. HTTPStatusCode: res.StatusCode,
  26427. },
  26428. }
  26429. target := &ret
  26430. if err := gensupport.DecodeResponse(target, res); err != nil {
  26431. return nil, err
  26432. }
  26433. return ret, nil
  26434. // {
  26435. // "description": "Updates an existing event tag. This method supports patch semantics.",
  26436. // "httpMethod": "PATCH",
  26437. // "id": "dfareporting.eventTags.patch",
  26438. // "parameterOrder": [
  26439. // "profileId",
  26440. // "id"
  26441. // ],
  26442. // "parameters": {
  26443. // "id": {
  26444. // "description": "Event tag ID.",
  26445. // "format": "int64",
  26446. // "location": "query",
  26447. // "required": true,
  26448. // "type": "string"
  26449. // },
  26450. // "profileId": {
  26451. // "description": "User profile ID associated with this request.",
  26452. // "format": "int64",
  26453. // "location": "path",
  26454. // "required": true,
  26455. // "type": "string"
  26456. // }
  26457. // },
  26458. // "path": "userprofiles/{profileId}/eventTags",
  26459. // "request": {
  26460. // "$ref": "EventTag"
  26461. // },
  26462. // "response": {
  26463. // "$ref": "EventTag"
  26464. // },
  26465. // "scopes": [
  26466. // "https://www.googleapis.com/auth/dfatrafficking"
  26467. // ]
  26468. // }
  26469. }
  26470. // method id "dfareporting.eventTags.update":
  26471. type EventTagsUpdateCall struct {
  26472. s *Service
  26473. profileId int64
  26474. eventtag *EventTag
  26475. urlParams_ gensupport.URLParams
  26476. ctx_ context.Context
  26477. header_ http.Header
  26478. }
  26479. // Update: Updates an existing event tag.
  26480. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  26481. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26482. c.profileId = profileId
  26483. c.eventtag = eventtag
  26484. return c
  26485. }
  26486. // Fields allows partial responses to be retrieved. See
  26487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26488. // for more information.
  26489. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  26490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26491. return c
  26492. }
  26493. // Context sets the context to be used in this call's Do method. Any
  26494. // pending HTTP request will be aborted if the provided context is
  26495. // canceled.
  26496. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  26497. c.ctx_ = ctx
  26498. return c
  26499. }
  26500. // Header returns an http.Header that can be modified by the caller to
  26501. // add HTTP headers to the request.
  26502. func (c *EventTagsUpdateCall) Header() http.Header {
  26503. if c.header_ == nil {
  26504. c.header_ = make(http.Header)
  26505. }
  26506. return c.header_
  26507. }
  26508. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  26509. reqHeaders := make(http.Header)
  26510. for k, v := range c.header_ {
  26511. reqHeaders[k] = v
  26512. }
  26513. reqHeaders.Set("User-Agent", c.s.userAgent())
  26514. var body io.Reader = nil
  26515. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  26516. if err != nil {
  26517. return nil, err
  26518. }
  26519. reqHeaders.Set("Content-Type", "application/json")
  26520. c.urlParams_.Set("alt", alt)
  26521. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  26522. urls += "?" + c.urlParams_.Encode()
  26523. req, _ := http.NewRequest("PUT", urls, body)
  26524. req.Header = reqHeaders
  26525. googleapi.Expand(req.URL, map[string]string{
  26526. "profileId": strconv.FormatInt(c.profileId, 10),
  26527. })
  26528. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26529. }
  26530. // Do executes the "dfareporting.eventTags.update" call.
  26531. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  26532. // code is an error. Response headers are in either
  26533. // *EventTag.ServerResponse.Header or (if a response was returned at
  26534. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26535. // to check whether the returned error was because
  26536. // http.StatusNotModified was returned.
  26537. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  26538. gensupport.SetOptions(c.urlParams_, opts...)
  26539. res, err := c.doRequest("json")
  26540. if res != nil && res.StatusCode == http.StatusNotModified {
  26541. if res.Body != nil {
  26542. res.Body.Close()
  26543. }
  26544. return nil, &googleapi.Error{
  26545. Code: res.StatusCode,
  26546. Header: res.Header,
  26547. }
  26548. }
  26549. if err != nil {
  26550. return nil, err
  26551. }
  26552. defer googleapi.CloseBody(res)
  26553. if err := googleapi.CheckResponse(res); err != nil {
  26554. return nil, err
  26555. }
  26556. ret := &EventTag{
  26557. ServerResponse: googleapi.ServerResponse{
  26558. Header: res.Header,
  26559. HTTPStatusCode: res.StatusCode,
  26560. },
  26561. }
  26562. target := &ret
  26563. if err := gensupport.DecodeResponse(target, res); err != nil {
  26564. return nil, err
  26565. }
  26566. return ret, nil
  26567. // {
  26568. // "description": "Updates an existing event tag.",
  26569. // "httpMethod": "PUT",
  26570. // "id": "dfareporting.eventTags.update",
  26571. // "parameterOrder": [
  26572. // "profileId"
  26573. // ],
  26574. // "parameters": {
  26575. // "profileId": {
  26576. // "description": "User profile ID associated with this request.",
  26577. // "format": "int64",
  26578. // "location": "path",
  26579. // "required": true,
  26580. // "type": "string"
  26581. // }
  26582. // },
  26583. // "path": "userprofiles/{profileId}/eventTags",
  26584. // "request": {
  26585. // "$ref": "EventTag"
  26586. // },
  26587. // "response": {
  26588. // "$ref": "EventTag"
  26589. // },
  26590. // "scopes": [
  26591. // "https://www.googleapis.com/auth/dfatrafficking"
  26592. // ]
  26593. // }
  26594. }
  26595. // method id "dfareporting.files.get":
  26596. type FilesGetCall struct {
  26597. s *Service
  26598. reportId int64
  26599. fileId int64
  26600. urlParams_ gensupport.URLParams
  26601. ifNoneMatch_ string
  26602. ctx_ context.Context
  26603. header_ http.Header
  26604. }
  26605. // Get: Retrieves a report file by its report ID and file ID. This
  26606. // method supports media download.
  26607. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  26608. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26609. c.reportId = reportId
  26610. c.fileId = fileId
  26611. return c
  26612. }
  26613. // Fields allows partial responses to be retrieved. See
  26614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26615. // for more information.
  26616. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  26617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26618. return c
  26619. }
  26620. // IfNoneMatch sets the optional parameter which makes the operation
  26621. // fail if the object's ETag matches the given value. This is useful for
  26622. // getting updates only after the object has changed since the last
  26623. // request. Use googleapi.IsNotModified to check whether the response
  26624. // error from Do is the result of In-None-Match.
  26625. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  26626. c.ifNoneMatch_ = entityTag
  26627. return c
  26628. }
  26629. // Context sets the context to be used in this call's Do and Download
  26630. // methods. Any pending HTTP request will be aborted if the provided
  26631. // context is canceled.
  26632. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  26633. c.ctx_ = ctx
  26634. return c
  26635. }
  26636. // Header returns an http.Header that can be modified by the caller to
  26637. // add HTTP headers to the request.
  26638. func (c *FilesGetCall) Header() http.Header {
  26639. if c.header_ == nil {
  26640. c.header_ = make(http.Header)
  26641. }
  26642. return c.header_
  26643. }
  26644. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  26645. reqHeaders := make(http.Header)
  26646. for k, v := range c.header_ {
  26647. reqHeaders[k] = v
  26648. }
  26649. reqHeaders.Set("User-Agent", c.s.userAgent())
  26650. if c.ifNoneMatch_ != "" {
  26651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26652. }
  26653. var body io.Reader = nil
  26654. c.urlParams_.Set("alt", alt)
  26655. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  26656. urls += "?" + c.urlParams_.Encode()
  26657. req, _ := http.NewRequest("GET", urls, body)
  26658. req.Header = reqHeaders
  26659. googleapi.Expand(req.URL, map[string]string{
  26660. "reportId": strconv.FormatInt(c.reportId, 10),
  26661. "fileId": strconv.FormatInt(c.fileId, 10),
  26662. })
  26663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26664. }
  26665. // Download fetches the API endpoint's "media" value, instead of the normal
  26666. // API response value. If the returned error is nil, the Response is guaranteed to
  26667. // have a 2xx status code. Callers must close the Response.Body as usual.
  26668. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  26669. gensupport.SetOptions(c.urlParams_, opts...)
  26670. res, err := c.doRequest("media")
  26671. if err != nil {
  26672. return nil, err
  26673. }
  26674. if err := googleapi.CheckMediaResponse(res); err != nil {
  26675. res.Body.Close()
  26676. return nil, err
  26677. }
  26678. return res, nil
  26679. }
  26680. // Do executes the "dfareporting.files.get" call.
  26681. // Exactly one of *File or error will be non-nil. Any non-2xx status
  26682. // code is an error. Response headers are in either
  26683. // *File.ServerResponse.Header or (if a response was returned at all) in
  26684. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  26685. // whether the returned error was because http.StatusNotModified was
  26686. // returned.
  26687. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  26688. gensupport.SetOptions(c.urlParams_, opts...)
  26689. res, err := c.doRequest("json")
  26690. if res != nil && res.StatusCode == http.StatusNotModified {
  26691. if res.Body != nil {
  26692. res.Body.Close()
  26693. }
  26694. return nil, &googleapi.Error{
  26695. Code: res.StatusCode,
  26696. Header: res.Header,
  26697. }
  26698. }
  26699. if err != nil {
  26700. return nil, err
  26701. }
  26702. defer googleapi.CloseBody(res)
  26703. if err := googleapi.CheckResponse(res); err != nil {
  26704. return nil, err
  26705. }
  26706. ret := &File{
  26707. ServerResponse: googleapi.ServerResponse{
  26708. Header: res.Header,
  26709. HTTPStatusCode: res.StatusCode,
  26710. },
  26711. }
  26712. target := &ret
  26713. if err := gensupport.DecodeResponse(target, res); err != nil {
  26714. return nil, err
  26715. }
  26716. return ret, nil
  26717. // {
  26718. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  26719. // "httpMethod": "GET",
  26720. // "id": "dfareporting.files.get",
  26721. // "parameterOrder": [
  26722. // "reportId",
  26723. // "fileId"
  26724. // ],
  26725. // "parameters": {
  26726. // "fileId": {
  26727. // "description": "The ID of the report file.",
  26728. // "format": "int64",
  26729. // "location": "path",
  26730. // "required": true,
  26731. // "type": "string"
  26732. // },
  26733. // "reportId": {
  26734. // "description": "The ID of the report.",
  26735. // "format": "int64",
  26736. // "location": "path",
  26737. // "required": true,
  26738. // "type": "string"
  26739. // }
  26740. // },
  26741. // "path": "reports/{reportId}/files/{fileId}",
  26742. // "response": {
  26743. // "$ref": "File"
  26744. // },
  26745. // "scopes": [
  26746. // "https://www.googleapis.com/auth/dfareporting"
  26747. // ],
  26748. // "supportsMediaDownload": true
  26749. // }
  26750. }
  26751. // method id "dfareporting.files.list":
  26752. type FilesListCall struct {
  26753. s *Service
  26754. profileId int64
  26755. urlParams_ gensupport.URLParams
  26756. ifNoneMatch_ string
  26757. ctx_ context.Context
  26758. header_ http.Header
  26759. }
  26760. // List: Lists files for a user profile.
  26761. func (r *FilesService) List(profileId int64) *FilesListCall {
  26762. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26763. c.profileId = profileId
  26764. return c
  26765. }
  26766. // MaxResults sets the optional parameter "maxResults": Maximum number
  26767. // of results to return.
  26768. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  26769. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26770. return c
  26771. }
  26772. // PageToken sets the optional parameter "pageToken": The value of the
  26773. // nextToken from the previous result page.
  26774. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  26775. c.urlParams_.Set("pageToken", pageToken)
  26776. return c
  26777. }
  26778. // Scope sets the optional parameter "scope": The scope that defines
  26779. // which results are returned.
  26780. //
  26781. // Possible values:
  26782. // "ALL" - All files in account.
  26783. // "MINE" (default) - My files.
  26784. // "SHARED_WITH_ME" - Files shared with me.
  26785. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  26786. c.urlParams_.Set("scope", scope)
  26787. return c
  26788. }
  26789. // SortField sets the optional parameter "sortField": The field by which
  26790. // to sort the list.
  26791. //
  26792. // Possible values:
  26793. // "ID" - Sort by file ID.
  26794. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  26795. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  26796. c.urlParams_.Set("sortField", sortField)
  26797. return c
  26798. }
  26799. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26800. // results.
  26801. //
  26802. // Possible values:
  26803. // "ASCENDING" - Ascending order.
  26804. // "DESCENDING" (default) - Descending order.
  26805. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  26806. c.urlParams_.Set("sortOrder", sortOrder)
  26807. return c
  26808. }
  26809. // Fields allows partial responses to be retrieved. See
  26810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26811. // for more information.
  26812. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  26813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26814. return c
  26815. }
  26816. // IfNoneMatch sets the optional parameter which makes the operation
  26817. // fail if the object's ETag matches the given value. This is useful for
  26818. // getting updates only after the object has changed since the last
  26819. // request. Use googleapi.IsNotModified to check whether the response
  26820. // error from Do is the result of In-None-Match.
  26821. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  26822. c.ifNoneMatch_ = entityTag
  26823. return c
  26824. }
  26825. // Context sets the context to be used in this call's Do method. Any
  26826. // pending HTTP request will be aborted if the provided context is
  26827. // canceled.
  26828. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  26829. c.ctx_ = ctx
  26830. return c
  26831. }
  26832. // Header returns an http.Header that can be modified by the caller to
  26833. // add HTTP headers to the request.
  26834. func (c *FilesListCall) Header() http.Header {
  26835. if c.header_ == nil {
  26836. c.header_ = make(http.Header)
  26837. }
  26838. return c.header_
  26839. }
  26840. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  26841. reqHeaders := make(http.Header)
  26842. for k, v := range c.header_ {
  26843. reqHeaders[k] = v
  26844. }
  26845. reqHeaders.Set("User-Agent", c.s.userAgent())
  26846. if c.ifNoneMatch_ != "" {
  26847. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26848. }
  26849. var body io.Reader = nil
  26850. c.urlParams_.Set("alt", alt)
  26851. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  26852. urls += "?" + c.urlParams_.Encode()
  26853. req, _ := http.NewRequest("GET", urls, body)
  26854. req.Header = reqHeaders
  26855. googleapi.Expand(req.URL, map[string]string{
  26856. "profileId": strconv.FormatInt(c.profileId, 10),
  26857. })
  26858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26859. }
  26860. // Do executes the "dfareporting.files.list" call.
  26861. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  26862. // code is an error. Response headers are in either
  26863. // *FileList.ServerResponse.Header or (if a response was returned at
  26864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26865. // to check whether the returned error was because
  26866. // http.StatusNotModified was returned.
  26867. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  26868. gensupport.SetOptions(c.urlParams_, opts...)
  26869. res, err := c.doRequest("json")
  26870. if res != nil && res.StatusCode == http.StatusNotModified {
  26871. if res.Body != nil {
  26872. res.Body.Close()
  26873. }
  26874. return nil, &googleapi.Error{
  26875. Code: res.StatusCode,
  26876. Header: res.Header,
  26877. }
  26878. }
  26879. if err != nil {
  26880. return nil, err
  26881. }
  26882. defer googleapi.CloseBody(res)
  26883. if err := googleapi.CheckResponse(res); err != nil {
  26884. return nil, err
  26885. }
  26886. ret := &FileList{
  26887. ServerResponse: googleapi.ServerResponse{
  26888. Header: res.Header,
  26889. HTTPStatusCode: res.StatusCode,
  26890. },
  26891. }
  26892. target := &ret
  26893. if err := gensupport.DecodeResponse(target, res); err != nil {
  26894. return nil, err
  26895. }
  26896. return ret, nil
  26897. // {
  26898. // "description": "Lists files for a user profile.",
  26899. // "httpMethod": "GET",
  26900. // "id": "dfareporting.files.list",
  26901. // "parameterOrder": [
  26902. // "profileId"
  26903. // ],
  26904. // "parameters": {
  26905. // "maxResults": {
  26906. // "default": "10",
  26907. // "description": "Maximum number of results to return.",
  26908. // "format": "int32",
  26909. // "location": "query",
  26910. // "maximum": "10",
  26911. // "minimum": "0",
  26912. // "type": "integer"
  26913. // },
  26914. // "pageToken": {
  26915. // "description": "The value of the nextToken from the previous result page.",
  26916. // "location": "query",
  26917. // "type": "string"
  26918. // },
  26919. // "profileId": {
  26920. // "description": "The DFA profile ID.",
  26921. // "format": "int64",
  26922. // "location": "path",
  26923. // "required": true,
  26924. // "type": "string"
  26925. // },
  26926. // "scope": {
  26927. // "default": "MINE",
  26928. // "description": "The scope that defines which results are returned.",
  26929. // "enum": [
  26930. // "ALL",
  26931. // "MINE",
  26932. // "SHARED_WITH_ME"
  26933. // ],
  26934. // "enumDescriptions": [
  26935. // "All files in account.",
  26936. // "My files.",
  26937. // "Files shared with me."
  26938. // ],
  26939. // "location": "query",
  26940. // "type": "string"
  26941. // },
  26942. // "sortField": {
  26943. // "default": "LAST_MODIFIED_TIME",
  26944. // "description": "The field by which to sort the list.",
  26945. // "enum": [
  26946. // "ID",
  26947. // "LAST_MODIFIED_TIME"
  26948. // ],
  26949. // "enumDescriptions": [
  26950. // "Sort by file ID.",
  26951. // "Sort by 'lastmodifiedAt' field."
  26952. // ],
  26953. // "location": "query",
  26954. // "type": "string"
  26955. // },
  26956. // "sortOrder": {
  26957. // "default": "DESCENDING",
  26958. // "description": "Order of sorted results.",
  26959. // "enum": [
  26960. // "ASCENDING",
  26961. // "DESCENDING"
  26962. // ],
  26963. // "enumDescriptions": [
  26964. // "Ascending order.",
  26965. // "Descending order."
  26966. // ],
  26967. // "location": "query",
  26968. // "type": "string"
  26969. // }
  26970. // },
  26971. // "path": "userprofiles/{profileId}/files",
  26972. // "response": {
  26973. // "$ref": "FileList"
  26974. // },
  26975. // "scopes": [
  26976. // "https://www.googleapis.com/auth/dfareporting"
  26977. // ]
  26978. // }
  26979. }
  26980. // Pages invokes f for each page of results.
  26981. // A non-nil error returned from f will halt the iteration.
  26982. // The provided context supersedes any context provided to the Context method.
  26983. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  26984. c.ctx_ = ctx
  26985. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26986. for {
  26987. x, err := c.Do()
  26988. if err != nil {
  26989. return err
  26990. }
  26991. if err := f(x); err != nil {
  26992. return err
  26993. }
  26994. if x.NextPageToken == "" {
  26995. return nil
  26996. }
  26997. c.PageToken(x.NextPageToken)
  26998. }
  26999. }
  27000. // method id "dfareporting.floodlightActivities.delete":
  27001. type FloodlightActivitiesDeleteCall struct {
  27002. s *Service
  27003. profileId int64
  27004. id int64
  27005. urlParams_ gensupport.URLParams
  27006. ctx_ context.Context
  27007. header_ http.Header
  27008. }
  27009. // Delete: Deletes an existing floodlight activity.
  27010. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  27011. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27012. c.profileId = profileId
  27013. c.id = id
  27014. return c
  27015. }
  27016. // Fields allows partial responses to be retrieved. See
  27017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27018. // for more information.
  27019. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  27020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27021. return c
  27022. }
  27023. // Context sets the context to be used in this call's Do method. Any
  27024. // pending HTTP request will be aborted if the provided context is
  27025. // canceled.
  27026. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  27027. c.ctx_ = ctx
  27028. return c
  27029. }
  27030. // Header returns an http.Header that can be modified by the caller to
  27031. // add HTTP headers to the request.
  27032. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  27033. if c.header_ == nil {
  27034. c.header_ = make(http.Header)
  27035. }
  27036. return c.header_
  27037. }
  27038. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  27039. reqHeaders := make(http.Header)
  27040. for k, v := range c.header_ {
  27041. reqHeaders[k] = v
  27042. }
  27043. reqHeaders.Set("User-Agent", c.s.userAgent())
  27044. var body io.Reader = nil
  27045. c.urlParams_.Set("alt", alt)
  27046. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  27047. urls += "?" + c.urlParams_.Encode()
  27048. req, _ := http.NewRequest("DELETE", urls, body)
  27049. req.Header = reqHeaders
  27050. googleapi.Expand(req.URL, map[string]string{
  27051. "profileId": strconv.FormatInt(c.profileId, 10),
  27052. "id": strconv.FormatInt(c.id, 10),
  27053. })
  27054. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27055. }
  27056. // Do executes the "dfareporting.floodlightActivities.delete" call.
  27057. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  27058. gensupport.SetOptions(c.urlParams_, opts...)
  27059. res, err := c.doRequest("json")
  27060. if err != nil {
  27061. return err
  27062. }
  27063. defer googleapi.CloseBody(res)
  27064. if err := googleapi.CheckResponse(res); err != nil {
  27065. return err
  27066. }
  27067. return nil
  27068. // {
  27069. // "description": "Deletes an existing floodlight activity.",
  27070. // "httpMethod": "DELETE",
  27071. // "id": "dfareporting.floodlightActivities.delete",
  27072. // "parameterOrder": [
  27073. // "profileId",
  27074. // "id"
  27075. // ],
  27076. // "parameters": {
  27077. // "id": {
  27078. // "description": "Floodlight activity ID.",
  27079. // "format": "int64",
  27080. // "location": "path",
  27081. // "required": true,
  27082. // "type": "string"
  27083. // },
  27084. // "profileId": {
  27085. // "description": "User profile ID associated with this request.",
  27086. // "format": "int64",
  27087. // "location": "path",
  27088. // "required": true,
  27089. // "type": "string"
  27090. // }
  27091. // },
  27092. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  27093. // "scopes": [
  27094. // "https://www.googleapis.com/auth/dfatrafficking"
  27095. // ]
  27096. // }
  27097. }
  27098. // method id "dfareporting.floodlightActivities.generatetag":
  27099. type FloodlightActivitiesGeneratetagCall struct {
  27100. s *Service
  27101. profileId int64
  27102. urlParams_ gensupport.URLParams
  27103. ctx_ context.Context
  27104. header_ http.Header
  27105. }
  27106. // Generatetag: Generates a tag for a floodlight activity.
  27107. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  27108. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27109. c.profileId = profileId
  27110. return c
  27111. }
  27112. // FloodlightActivityId sets the optional parameter
  27113. // "floodlightActivityId": Floodlight activity ID for which we want to
  27114. // generate a tag.
  27115. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  27116. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  27117. return c
  27118. }
  27119. // Fields allows partial responses to be retrieved. See
  27120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27121. // for more information.
  27122. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  27123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27124. return c
  27125. }
  27126. // Context sets the context to be used in this call's Do method. Any
  27127. // pending HTTP request will be aborted if the provided context is
  27128. // canceled.
  27129. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  27130. c.ctx_ = ctx
  27131. return c
  27132. }
  27133. // Header returns an http.Header that can be modified by the caller to
  27134. // add HTTP headers to the request.
  27135. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  27136. if c.header_ == nil {
  27137. c.header_ = make(http.Header)
  27138. }
  27139. return c.header_
  27140. }
  27141. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  27142. reqHeaders := make(http.Header)
  27143. for k, v := range c.header_ {
  27144. reqHeaders[k] = v
  27145. }
  27146. reqHeaders.Set("User-Agent", c.s.userAgent())
  27147. var body io.Reader = nil
  27148. c.urlParams_.Set("alt", alt)
  27149. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  27150. urls += "?" + c.urlParams_.Encode()
  27151. req, _ := http.NewRequest("POST", urls, body)
  27152. req.Header = reqHeaders
  27153. googleapi.Expand(req.URL, map[string]string{
  27154. "profileId": strconv.FormatInt(c.profileId, 10),
  27155. })
  27156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27157. }
  27158. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  27159. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  27160. // be non-nil. Any non-2xx status code is an error. Response headers are
  27161. // in either
  27162. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  27163. // a response was returned at all) in error.(*googleapi.Error).Header.
  27164. // Use googleapi.IsNotModified to check whether the returned error was
  27165. // because http.StatusNotModified was returned.
  27166. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  27167. gensupport.SetOptions(c.urlParams_, opts...)
  27168. res, err := c.doRequest("json")
  27169. if res != nil && res.StatusCode == http.StatusNotModified {
  27170. if res.Body != nil {
  27171. res.Body.Close()
  27172. }
  27173. return nil, &googleapi.Error{
  27174. Code: res.StatusCode,
  27175. Header: res.Header,
  27176. }
  27177. }
  27178. if err != nil {
  27179. return nil, err
  27180. }
  27181. defer googleapi.CloseBody(res)
  27182. if err := googleapi.CheckResponse(res); err != nil {
  27183. return nil, err
  27184. }
  27185. ret := &FloodlightActivitiesGenerateTagResponse{
  27186. ServerResponse: googleapi.ServerResponse{
  27187. Header: res.Header,
  27188. HTTPStatusCode: res.StatusCode,
  27189. },
  27190. }
  27191. target := &ret
  27192. if err := gensupport.DecodeResponse(target, res); err != nil {
  27193. return nil, err
  27194. }
  27195. return ret, nil
  27196. // {
  27197. // "description": "Generates a tag for a floodlight activity.",
  27198. // "httpMethod": "POST",
  27199. // "id": "dfareporting.floodlightActivities.generatetag",
  27200. // "parameterOrder": [
  27201. // "profileId"
  27202. // ],
  27203. // "parameters": {
  27204. // "floodlightActivityId": {
  27205. // "description": "Floodlight activity ID for which we want to generate a tag.",
  27206. // "format": "int64",
  27207. // "location": "query",
  27208. // "type": "string"
  27209. // },
  27210. // "profileId": {
  27211. // "description": "User profile ID associated with this request.",
  27212. // "format": "int64",
  27213. // "location": "path",
  27214. // "required": true,
  27215. // "type": "string"
  27216. // }
  27217. // },
  27218. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  27219. // "response": {
  27220. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  27221. // },
  27222. // "scopes": [
  27223. // "https://www.googleapis.com/auth/dfatrafficking"
  27224. // ]
  27225. // }
  27226. }
  27227. // method id "dfareporting.floodlightActivities.get":
  27228. type FloodlightActivitiesGetCall struct {
  27229. s *Service
  27230. profileId int64
  27231. id int64
  27232. urlParams_ gensupport.URLParams
  27233. ifNoneMatch_ string
  27234. ctx_ context.Context
  27235. header_ http.Header
  27236. }
  27237. // Get: Gets one floodlight activity by ID.
  27238. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  27239. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27240. c.profileId = profileId
  27241. c.id = id
  27242. return c
  27243. }
  27244. // Fields allows partial responses to be retrieved. See
  27245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27246. // for more information.
  27247. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  27248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27249. return c
  27250. }
  27251. // IfNoneMatch sets the optional parameter which makes the operation
  27252. // fail if the object's ETag matches the given value. This is useful for
  27253. // getting updates only after the object has changed since the last
  27254. // request. Use googleapi.IsNotModified to check whether the response
  27255. // error from Do is the result of In-None-Match.
  27256. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  27257. c.ifNoneMatch_ = entityTag
  27258. return c
  27259. }
  27260. // Context sets the context to be used in this call's Do method. Any
  27261. // pending HTTP request will be aborted if the provided context is
  27262. // canceled.
  27263. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  27264. c.ctx_ = ctx
  27265. return c
  27266. }
  27267. // Header returns an http.Header that can be modified by the caller to
  27268. // add HTTP headers to the request.
  27269. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  27270. if c.header_ == nil {
  27271. c.header_ = make(http.Header)
  27272. }
  27273. return c.header_
  27274. }
  27275. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  27276. reqHeaders := make(http.Header)
  27277. for k, v := range c.header_ {
  27278. reqHeaders[k] = v
  27279. }
  27280. reqHeaders.Set("User-Agent", c.s.userAgent())
  27281. if c.ifNoneMatch_ != "" {
  27282. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27283. }
  27284. var body io.Reader = nil
  27285. c.urlParams_.Set("alt", alt)
  27286. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  27287. urls += "?" + c.urlParams_.Encode()
  27288. req, _ := http.NewRequest("GET", urls, body)
  27289. req.Header = reqHeaders
  27290. googleapi.Expand(req.URL, map[string]string{
  27291. "profileId": strconv.FormatInt(c.profileId, 10),
  27292. "id": strconv.FormatInt(c.id, 10),
  27293. })
  27294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27295. }
  27296. // Do executes the "dfareporting.floodlightActivities.get" call.
  27297. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  27298. // non-2xx status code is an error. Response headers are in either
  27299. // *FloodlightActivity.ServerResponse.Header or (if a response was
  27300. // returned at all) in error.(*googleapi.Error).Header. Use
  27301. // googleapi.IsNotModified to check whether the returned error was
  27302. // because http.StatusNotModified was returned.
  27303. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  27304. gensupport.SetOptions(c.urlParams_, opts...)
  27305. res, err := c.doRequest("json")
  27306. if res != nil && res.StatusCode == http.StatusNotModified {
  27307. if res.Body != nil {
  27308. res.Body.Close()
  27309. }
  27310. return nil, &googleapi.Error{
  27311. Code: res.StatusCode,
  27312. Header: res.Header,
  27313. }
  27314. }
  27315. if err != nil {
  27316. return nil, err
  27317. }
  27318. defer googleapi.CloseBody(res)
  27319. if err := googleapi.CheckResponse(res); err != nil {
  27320. return nil, err
  27321. }
  27322. ret := &FloodlightActivity{
  27323. ServerResponse: googleapi.ServerResponse{
  27324. Header: res.Header,
  27325. HTTPStatusCode: res.StatusCode,
  27326. },
  27327. }
  27328. target := &ret
  27329. if err := gensupport.DecodeResponse(target, res); err != nil {
  27330. return nil, err
  27331. }
  27332. return ret, nil
  27333. // {
  27334. // "description": "Gets one floodlight activity by ID.",
  27335. // "httpMethod": "GET",
  27336. // "id": "dfareporting.floodlightActivities.get",
  27337. // "parameterOrder": [
  27338. // "profileId",
  27339. // "id"
  27340. // ],
  27341. // "parameters": {
  27342. // "id": {
  27343. // "description": "Floodlight activity ID.",
  27344. // "format": "int64",
  27345. // "location": "path",
  27346. // "required": true,
  27347. // "type": "string"
  27348. // },
  27349. // "profileId": {
  27350. // "description": "User profile ID associated with this request.",
  27351. // "format": "int64",
  27352. // "location": "path",
  27353. // "required": true,
  27354. // "type": "string"
  27355. // }
  27356. // },
  27357. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  27358. // "response": {
  27359. // "$ref": "FloodlightActivity"
  27360. // },
  27361. // "scopes": [
  27362. // "https://www.googleapis.com/auth/dfatrafficking"
  27363. // ]
  27364. // }
  27365. }
  27366. // method id "dfareporting.floodlightActivities.insert":
  27367. type FloodlightActivitiesInsertCall struct {
  27368. s *Service
  27369. profileId int64
  27370. floodlightactivity *FloodlightActivity
  27371. urlParams_ gensupport.URLParams
  27372. ctx_ context.Context
  27373. header_ http.Header
  27374. }
  27375. // Insert: Inserts a new floodlight activity.
  27376. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  27377. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27378. c.profileId = profileId
  27379. c.floodlightactivity = floodlightactivity
  27380. return c
  27381. }
  27382. // Fields allows partial responses to be retrieved. See
  27383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27384. // for more information.
  27385. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  27386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27387. return c
  27388. }
  27389. // Context sets the context to be used in this call's Do method. Any
  27390. // pending HTTP request will be aborted if the provided context is
  27391. // canceled.
  27392. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  27393. c.ctx_ = ctx
  27394. return c
  27395. }
  27396. // Header returns an http.Header that can be modified by the caller to
  27397. // add HTTP headers to the request.
  27398. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  27399. if c.header_ == nil {
  27400. c.header_ = make(http.Header)
  27401. }
  27402. return c.header_
  27403. }
  27404. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  27405. reqHeaders := make(http.Header)
  27406. for k, v := range c.header_ {
  27407. reqHeaders[k] = v
  27408. }
  27409. reqHeaders.Set("User-Agent", c.s.userAgent())
  27410. var body io.Reader = nil
  27411. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  27412. if err != nil {
  27413. return nil, err
  27414. }
  27415. reqHeaders.Set("Content-Type", "application/json")
  27416. c.urlParams_.Set("alt", alt)
  27417. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  27418. urls += "?" + c.urlParams_.Encode()
  27419. req, _ := http.NewRequest("POST", urls, body)
  27420. req.Header = reqHeaders
  27421. googleapi.Expand(req.URL, map[string]string{
  27422. "profileId": strconv.FormatInt(c.profileId, 10),
  27423. })
  27424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27425. }
  27426. // Do executes the "dfareporting.floodlightActivities.insert" call.
  27427. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  27428. // non-2xx status code is an error. Response headers are in either
  27429. // *FloodlightActivity.ServerResponse.Header or (if a response was
  27430. // returned at all) in error.(*googleapi.Error).Header. Use
  27431. // googleapi.IsNotModified to check whether the returned error was
  27432. // because http.StatusNotModified was returned.
  27433. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  27434. gensupport.SetOptions(c.urlParams_, opts...)
  27435. res, err := c.doRequest("json")
  27436. if res != nil && res.StatusCode == http.StatusNotModified {
  27437. if res.Body != nil {
  27438. res.Body.Close()
  27439. }
  27440. return nil, &googleapi.Error{
  27441. Code: res.StatusCode,
  27442. Header: res.Header,
  27443. }
  27444. }
  27445. if err != nil {
  27446. return nil, err
  27447. }
  27448. defer googleapi.CloseBody(res)
  27449. if err := googleapi.CheckResponse(res); err != nil {
  27450. return nil, err
  27451. }
  27452. ret := &FloodlightActivity{
  27453. ServerResponse: googleapi.ServerResponse{
  27454. Header: res.Header,
  27455. HTTPStatusCode: res.StatusCode,
  27456. },
  27457. }
  27458. target := &ret
  27459. if err := gensupport.DecodeResponse(target, res); err != nil {
  27460. return nil, err
  27461. }
  27462. return ret, nil
  27463. // {
  27464. // "description": "Inserts a new floodlight activity.",
  27465. // "httpMethod": "POST",
  27466. // "id": "dfareporting.floodlightActivities.insert",
  27467. // "parameterOrder": [
  27468. // "profileId"
  27469. // ],
  27470. // "parameters": {
  27471. // "profileId": {
  27472. // "description": "User profile ID associated with this request.",
  27473. // "format": "int64",
  27474. // "location": "path",
  27475. // "required": true,
  27476. // "type": "string"
  27477. // }
  27478. // },
  27479. // "path": "userprofiles/{profileId}/floodlightActivities",
  27480. // "request": {
  27481. // "$ref": "FloodlightActivity"
  27482. // },
  27483. // "response": {
  27484. // "$ref": "FloodlightActivity"
  27485. // },
  27486. // "scopes": [
  27487. // "https://www.googleapis.com/auth/dfatrafficking"
  27488. // ]
  27489. // }
  27490. }
  27491. // method id "dfareporting.floodlightActivities.list":
  27492. type FloodlightActivitiesListCall struct {
  27493. s *Service
  27494. profileId int64
  27495. urlParams_ gensupport.URLParams
  27496. ifNoneMatch_ string
  27497. ctx_ context.Context
  27498. header_ http.Header
  27499. }
  27500. // List: Retrieves a list of floodlight activities, possibly filtered.
  27501. // This method supports paging.
  27502. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  27503. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27504. c.profileId = profileId
  27505. return c
  27506. }
  27507. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27508. // floodlight activities for the specified advertiser ID. Must specify
  27509. // either ids, advertiserId, or floodlightConfigurationId for a
  27510. // non-empty result.
  27511. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  27512. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27513. return c
  27514. }
  27515. // FloodlightActivityGroupIds sets the optional parameter
  27516. // "floodlightActivityGroupIds": Select only floodlight activities with
  27517. // the specified floodlight activity group IDs.
  27518. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  27519. var floodlightActivityGroupIds_ []string
  27520. for _, v := range floodlightActivityGroupIds {
  27521. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  27522. }
  27523. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  27524. return c
  27525. }
  27526. // FloodlightActivityGroupName sets the optional parameter
  27527. // "floodlightActivityGroupName": Select only floodlight activities with
  27528. // the specified floodlight activity group name.
  27529. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  27530. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  27531. return c
  27532. }
  27533. // FloodlightActivityGroupTagString sets the optional parameter
  27534. // "floodlightActivityGroupTagString": Select only floodlight activities
  27535. // with the specified floodlight activity group tag string.
  27536. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  27537. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  27538. return c
  27539. }
  27540. // FloodlightActivityGroupType sets the optional parameter
  27541. // "floodlightActivityGroupType": Select only floodlight activities with
  27542. // the specified floodlight activity group type.
  27543. //
  27544. // Possible values:
  27545. // "COUNTER"
  27546. // "SALE"
  27547. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  27548. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  27549. return c
  27550. }
  27551. // FloodlightConfigurationId sets the optional parameter
  27552. // "floodlightConfigurationId": Select only floodlight activities for
  27553. // the specified floodlight configuration ID. Must specify either ids,
  27554. // advertiserId, or floodlightConfigurationId for a non-empty result.
  27555. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  27556. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  27557. return c
  27558. }
  27559. // Ids sets the optional parameter "ids": Select only floodlight
  27560. // activities with the specified IDs. Must specify either ids,
  27561. // advertiserId, or floodlightConfigurationId for a non-empty result.
  27562. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  27563. var ids_ []string
  27564. for _, v := range ids {
  27565. ids_ = append(ids_, fmt.Sprint(v))
  27566. }
  27567. c.urlParams_.SetMulti("ids", ids_)
  27568. return c
  27569. }
  27570. // MaxResults sets the optional parameter "maxResults": Maximum number
  27571. // of results to return.
  27572. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  27573. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27574. return c
  27575. }
  27576. // PageToken sets the optional parameter "pageToken": Value of the
  27577. // nextPageToken from the previous result page.
  27578. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  27579. c.urlParams_.Set("pageToken", pageToken)
  27580. return c
  27581. }
  27582. // SearchString sets the optional parameter "searchString": Allows
  27583. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27584. // example, "floodlightactivity*2015" will return objects with names
  27585. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  27586. // or simply "floodlightactivity 2015". Most of the searches also add
  27587. // wildcards implicitly at the start and the end of the search string.
  27588. // For example, a search string of "floodlightactivity" will match
  27589. // objects with name "my floodlightactivity activity",
  27590. // "floodlightactivity 2015", or simply "floodlightactivity".
  27591. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  27592. c.urlParams_.Set("searchString", searchString)
  27593. return c
  27594. }
  27595. // SortField sets the optional parameter "sortField": Field by which to
  27596. // sort the list.
  27597. //
  27598. // Possible values:
  27599. // "ID" (default)
  27600. // "NAME"
  27601. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  27602. c.urlParams_.Set("sortField", sortField)
  27603. return c
  27604. }
  27605. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27606. // results.
  27607. //
  27608. // Possible values:
  27609. // "ASCENDING" (default)
  27610. // "DESCENDING"
  27611. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  27612. c.urlParams_.Set("sortOrder", sortOrder)
  27613. return c
  27614. }
  27615. // TagString sets the optional parameter "tagString": Select only
  27616. // floodlight activities with the specified tag string.
  27617. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  27618. c.urlParams_.Set("tagString", tagString)
  27619. return c
  27620. }
  27621. // Fields allows partial responses to be retrieved. See
  27622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27623. // for more information.
  27624. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  27625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27626. return c
  27627. }
  27628. // IfNoneMatch sets the optional parameter which makes the operation
  27629. // fail if the object's ETag matches the given value. This is useful for
  27630. // getting updates only after the object has changed since the last
  27631. // request. Use googleapi.IsNotModified to check whether the response
  27632. // error from Do is the result of In-None-Match.
  27633. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  27634. c.ifNoneMatch_ = entityTag
  27635. return c
  27636. }
  27637. // Context sets the context to be used in this call's Do method. Any
  27638. // pending HTTP request will be aborted if the provided context is
  27639. // canceled.
  27640. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  27641. c.ctx_ = ctx
  27642. return c
  27643. }
  27644. // Header returns an http.Header that can be modified by the caller to
  27645. // add HTTP headers to the request.
  27646. func (c *FloodlightActivitiesListCall) Header() http.Header {
  27647. if c.header_ == nil {
  27648. c.header_ = make(http.Header)
  27649. }
  27650. return c.header_
  27651. }
  27652. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  27653. reqHeaders := make(http.Header)
  27654. for k, v := range c.header_ {
  27655. reqHeaders[k] = v
  27656. }
  27657. reqHeaders.Set("User-Agent", c.s.userAgent())
  27658. if c.ifNoneMatch_ != "" {
  27659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27660. }
  27661. var body io.Reader = nil
  27662. c.urlParams_.Set("alt", alt)
  27663. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  27664. urls += "?" + c.urlParams_.Encode()
  27665. req, _ := http.NewRequest("GET", urls, body)
  27666. req.Header = reqHeaders
  27667. googleapi.Expand(req.URL, map[string]string{
  27668. "profileId": strconv.FormatInt(c.profileId, 10),
  27669. })
  27670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27671. }
  27672. // Do executes the "dfareporting.floodlightActivities.list" call.
  27673. // Exactly one of *FloodlightActivitiesListResponse or error will be
  27674. // non-nil. Any non-2xx status code is an error. Response headers are in
  27675. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  27676. // a response was returned at all) in error.(*googleapi.Error).Header.
  27677. // Use googleapi.IsNotModified to check whether the returned error was
  27678. // because http.StatusNotModified was returned.
  27679. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  27680. gensupport.SetOptions(c.urlParams_, opts...)
  27681. res, err := c.doRequest("json")
  27682. if res != nil && res.StatusCode == http.StatusNotModified {
  27683. if res.Body != nil {
  27684. res.Body.Close()
  27685. }
  27686. return nil, &googleapi.Error{
  27687. Code: res.StatusCode,
  27688. Header: res.Header,
  27689. }
  27690. }
  27691. if err != nil {
  27692. return nil, err
  27693. }
  27694. defer googleapi.CloseBody(res)
  27695. if err := googleapi.CheckResponse(res); err != nil {
  27696. return nil, err
  27697. }
  27698. ret := &FloodlightActivitiesListResponse{
  27699. ServerResponse: googleapi.ServerResponse{
  27700. Header: res.Header,
  27701. HTTPStatusCode: res.StatusCode,
  27702. },
  27703. }
  27704. target := &ret
  27705. if err := gensupport.DecodeResponse(target, res); err != nil {
  27706. return nil, err
  27707. }
  27708. return ret, nil
  27709. // {
  27710. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  27711. // "httpMethod": "GET",
  27712. // "id": "dfareporting.floodlightActivities.list",
  27713. // "parameterOrder": [
  27714. // "profileId"
  27715. // ],
  27716. // "parameters": {
  27717. // "advertiserId": {
  27718. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  27719. // "format": "int64",
  27720. // "location": "query",
  27721. // "type": "string"
  27722. // },
  27723. // "floodlightActivityGroupIds": {
  27724. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  27725. // "format": "int64",
  27726. // "location": "query",
  27727. // "repeated": true,
  27728. // "type": "string"
  27729. // },
  27730. // "floodlightActivityGroupName": {
  27731. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  27732. // "location": "query",
  27733. // "type": "string"
  27734. // },
  27735. // "floodlightActivityGroupTagString": {
  27736. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  27737. // "location": "query",
  27738. // "type": "string"
  27739. // },
  27740. // "floodlightActivityGroupType": {
  27741. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  27742. // "enum": [
  27743. // "COUNTER",
  27744. // "SALE"
  27745. // ],
  27746. // "enumDescriptions": [
  27747. // "",
  27748. // ""
  27749. // ],
  27750. // "location": "query",
  27751. // "type": "string"
  27752. // },
  27753. // "floodlightConfigurationId": {
  27754. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  27755. // "format": "int64",
  27756. // "location": "query",
  27757. // "type": "string"
  27758. // },
  27759. // "ids": {
  27760. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  27761. // "format": "int64",
  27762. // "location": "query",
  27763. // "repeated": true,
  27764. // "type": "string"
  27765. // },
  27766. // "maxResults": {
  27767. // "default": "1000",
  27768. // "description": "Maximum number of results to return.",
  27769. // "format": "int32",
  27770. // "location": "query",
  27771. // "maximum": "1000",
  27772. // "minimum": "0",
  27773. // "type": "integer"
  27774. // },
  27775. // "pageToken": {
  27776. // "description": "Value of the nextPageToken from the previous result page.",
  27777. // "location": "query",
  27778. // "type": "string"
  27779. // },
  27780. // "profileId": {
  27781. // "description": "User profile ID associated with this request.",
  27782. // "format": "int64",
  27783. // "location": "path",
  27784. // "required": true,
  27785. // "type": "string"
  27786. // },
  27787. // "searchString": {
  27788. // "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\".",
  27789. // "location": "query",
  27790. // "type": "string"
  27791. // },
  27792. // "sortField": {
  27793. // "default": "ID",
  27794. // "description": "Field by which to sort the list.",
  27795. // "enum": [
  27796. // "ID",
  27797. // "NAME"
  27798. // ],
  27799. // "enumDescriptions": [
  27800. // "",
  27801. // ""
  27802. // ],
  27803. // "location": "query",
  27804. // "type": "string"
  27805. // },
  27806. // "sortOrder": {
  27807. // "default": "ASCENDING",
  27808. // "description": "Order of sorted results.",
  27809. // "enum": [
  27810. // "ASCENDING",
  27811. // "DESCENDING"
  27812. // ],
  27813. // "enumDescriptions": [
  27814. // "",
  27815. // ""
  27816. // ],
  27817. // "location": "query",
  27818. // "type": "string"
  27819. // },
  27820. // "tagString": {
  27821. // "description": "Select only floodlight activities with the specified tag string.",
  27822. // "location": "query",
  27823. // "type": "string"
  27824. // }
  27825. // },
  27826. // "path": "userprofiles/{profileId}/floodlightActivities",
  27827. // "response": {
  27828. // "$ref": "FloodlightActivitiesListResponse"
  27829. // },
  27830. // "scopes": [
  27831. // "https://www.googleapis.com/auth/dfatrafficking"
  27832. // ]
  27833. // }
  27834. }
  27835. // Pages invokes f for each page of results.
  27836. // A non-nil error returned from f will halt the iteration.
  27837. // The provided context supersedes any context provided to the Context method.
  27838. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  27839. c.ctx_ = ctx
  27840. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27841. for {
  27842. x, err := c.Do()
  27843. if err != nil {
  27844. return err
  27845. }
  27846. if err := f(x); err != nil {
  27847. return err
  27848. }
  27849. if x.NextPageToken == "" {
  27850. return nil
  27851. }
  27852. c.PageToken(x.NextPageToken)
  27853. }
  27854. }
  27855. // method id "dfareporting.floodlightActivities.patch":
  27856. type FloodlightActivitiesPatchCall struct {
  27857. s *Service
  27858. profileId int64
  27859. floodlightactivity *FloodlightActivity
  27860. urlParams_ gensupport.URLParams
  27861. ctx_ context.Context
  27862. header_ http.Header
  27863. }
  27864. // Patch: Updates an existing floodlight activity. This method supports
  27865. // patch semantics.
  27866. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  27867. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27868. c.profileId = profileId
  27869. c.urlParams_.Set("id", fmt.Sprint(id))
  27870. c.floodlightactivity = floodlightactivity
  27871. return c
  27872. }
  27873. // Fields allows partial responses to be retrieved. See
  27874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27875. // for more information.
  27876. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  27877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27878. return c
  27879. }
  27880. // Context sets the context to be used in this call's Do method. Any
  27881. // pending HTTP request will be aborted if the provided context is
  27882. // canceled.
  27883. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  27884. c.ctx_ = ctx
  27885. return c
  27886. }
  27887. // Header returns an http.Header that can be modified by the caller to
  27888. // add HTTP headers to the request.
  27889. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  27890. if c.header_ == nil {
  27891. c.header_ = make(http.Header)
  27892. }
  27893. return c.header_
  27894. }
  27895. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  27896. reqHeaders := make(http.Header)
  27897. for k, v := range c.header_ {
  27898. reqHeaders[k] = v
  27899. }
  27900. reqHeaders.Set("User-Agent", c.s.userAgent())
  27901. var body io.Reader = nil
  27902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  27903. if err != nil {
  27904. return nil, err
  27905. }
  27906. reqHeaders.Set("Content-Type", "application/json")
  27907. c.urlParams_.Set("alt", alt)
  27908. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  27909. urls += "?" + c.urlParams_.Encode()
  27910. req, _ := http.NewRequest("PATCH", urls, body)
  27911. req.Header = reqHeaders
  27912. googleapi.Expand(req.URL, map[string]string{
  27913. "profileId": strconv.FormatInt(c.profileId, 10),
  27914. })
  27915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27916. }
  27917. // Do executes the "dfareporting.floodlightActivities.patch" call.
  27918. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  27919. // non-2xx status code is an error. Response headers are in either
  27920. // *FloodlightActivity.ServerResponse.Header or (if a response was
  27921. // returned at all) in error.(*googleapi.Error).Header. Use
  27922. // googleapi.IsNotModified to check whether the returned error was
  27923. // because http.StatusNotModified was returned.
  27924. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  27925. gensupport.SetOptions(c.urlParams_, opts...)
  27926. res, err := c.doRequest("json")
  27927. if res != nil && res.StatusCode == http.StatusNotModified {
  27928. if res.Body != nil {
  27929. res.Body.Close()
  27930. }
  27931. return nil, &googleapi.Error{
  27932. Code: res.StatusCode,
  27933. Header: res.Header,
  27934. }
  27935. }
  27936. if err != nil {
  27937. return nil, err
  27938. }
  27939. defer googleapi.CloseBody(res)
  27940. if err := googleapi.CheckResponse(res); err != nil {
  27941. return nil, err
  27942. }
  27943. ret := &FloodlightActivity{
  27944. ServerResponse: googleapi.ServerResponse{
  27945. Header: res.Header,
  27946. HTTPStatusCode: res.StatusCode,
  27947. },
  27948. }
  27949. target := &ret
  27950. if err := gensupport.DecodeResponse(target, res); err != nil {
  27951. return nil, err
  27952. }
  27953. return ret, nil
  27954. // {
  27955. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  27956. // "httpMethod": "PATCH",
  27957. // "id": "dfareporting.floodlightActivities.patch",
  27958. // "parameterOrder": [
  27959. // "profileId",
  27960. // "id"
  27961. // ],
  27962. // "parameters": {
  27963. // "id": {
  27964. // "description": "Floodlight activity ID.",
  27965. // "format": "int64",
  27966. // "location": "query",
  27967. // "required": true,
  27968. // "type": "string"
  27969. // },
  27970. // "profileId": {
  27971. // "description": "User profile ID associated with this request.",
  27972. // "format": "int64",
  27973. // "location": "path",
  27974. // "required": true,
  27975. // "type": "string"
  27976. // }
  27977. // },
  27978. // "path": "userprofiles/{profileId}/floodlightActivities",
  27979. // "request": {
  27980. // "$ref": "FloodlightActivity"
  27981. // },
  27982. // "response": {
  27983. // "$ref": "FloodlightActivity"
  27984. // },
  27985. // "scopes": [
  27986. // "https://www.googleapis.com/auth/dfatrafficking"
  27987. // ]
  27988. // }
  27989. }
  27990. // method id "dfareporting.floodlightActivities.update":
  27991. type FloodlightActivitiesUpdateCall struct {
  27992. s *Service
  27993. profileId int64
  27994. floodlightactivity *FloodlightActivity
  27995. urlParams_ gensupport.URLParams
  27996. ctx_ context.Context
  27997. header_ http.Header
  27998. }
  27999. // Update: Updates an existing floodlight activity.
  28000. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  28001. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28002. c.profileId = profileId
  28003. c.floodlightactivity = floodlightactivity
  28004. return c
  28005. }
  28006. // Fields allows partial responses to be retrieved. See
  28007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28008. // for more information.
  28009. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  28010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28011. return c
  28012. }
  28013. // Context sets the context to be used in this call's Do method. Any
  28014. // pending HTTP request will be aborted if the provided context is
  28015. // canceled.
  28016. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  28017. c.ctx_ = ctx
  28018. return c
  28019. }
  28020. // Header returns an http.Header that can be modified by the caller to
  28021. // add HTTP headers to the request.
  28022. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  28023. if c.header_ == nil {
  28024. c.header_ = make(http.Header)
  28025. }
  28026. return c.header_
  28027. }
  28028. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  28029. reqHeaders := make(http.Header)
  28030. for k, v := range c.header_ {
  28031. reqHeaders[k] = v
  28032. }
  28033. reqHeaders.Set("User-Agent", c.s.userAgent())
  28034. var body io.Reader = nil
  28035. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  28036. if err != nil {
  28037. return nil, err
  28038. }
  28039. reqHeaders.Set("Content-Type", "application/json")
  28040. c.urlParams_.Set("alt", alt)
  28041. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28042. urls += "?" + c.urlParams_.Encode()
  28043. req, _ := http.NewRequest("PUT", urls, body)
  28044. req.Header = reqHeaders
  28045. googleapi.Expand(req.URL, map[string]string{
  28046. "profileId": strconv.FormatInt(c.profileId, 10),
  28047. })
  28048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28049. }
  28050. // Do executes the "dfareporting.floodlightActivities.update" call.
  28051. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28052. // non-2xx status code is an error. Response headers are in either
  28053. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28054. // returned at all) in error.(*googleapi.Error).Header. Use
  28055. // googleapi.IsNotModified to check whether the returned error was
  28056. // because http.StatusNotModified was returned.
  28057. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28058. gensupport.SetOptions(c.urlParams_, opts...)
  28059. res, err := c.doRequest("json")
  28060. if res != nil && res.StatusCode == http.StatusNotModified {
  28061. if res.Body != nil {
  28062. res.Body.Close()
  28063. }
  28064. return nil, &googleapi.Error{
  28065. Code: res.StatusCode,
  28066. Header: res.Header,
  28067. }
  28068. }
  28069. if err != nil {
  28070. return nil, err
  28071. }
  28072. defer googleapi.CloseBody(res)
  28073. if err := googleapi.CheckResponse(res); err != nil {
  28074. return nil, err
  28075. }
  28076. ret := &FloodlightActivity{
  28077. ServerResponse: googleapi.ServerResponse{
  28078. Header: res.Header,
  28079. HTTPStatusCode: res.StatusCode,
  28080. },
  28081. }
  28082. target := &ret
  28083. if err := gensupport.DecodeResponse(target, res); err != nil {
  28084. return nil, err
  28085. }
  28086. return ret, nil
  28087. // {
  28088. // "description": "Updates an existing floodlight activity.",
  28089. // "httpMethod": "PUT",
  28090. // "id": "dfareporting.floodlightActivities.update",
  28091. // "parameterOrder": [
  28092. // "profileId"
  28093. // ],
  28094. // "parameters": {
  28095. // "profileId": {
  28096. // "description": "User profile ID associated with this request.",
  28097. // "format": "int64",
  28098. // "location": "path",
  28099. // "required": true,
  28100. // "type": "string"
  28101. // }
  28102. // },
  28103. // "path": "userprofiles/{profileId}/floodlightActivities",
  28104. // "request": {
  28105. // "$ref": "FloodlightActivity"
  28106. // },
  28107. // "response": {
  28108. // "$ref": "FloodlightActivity"
  28109. // },
  28110. // "scopes": [
  28111. // "https://www.googleapis.com/auth/dfatrafficking"
  28112. // ]
  28113. // }
  28114. }
  28115. // method id "dfareporting.floodlightActivityGroups.get":
  28116. type FloodlightActivityGroupsGetCall struct {
  28117. s *Service
  28118. profileId int64
  28119. id int64
  28120. urlParams_ gensupport.URLParams
  28121. ifNoneMatch_ string
  28122. ctx_ context.Context
  28123. header_ http.Header
  28124. }
  28125. // Get: Gets one floodlight activity group by ID.
  28126. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  28127. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28128. c.profileId = profileId
  28129. c.id = id
  28130. return c
  28131. }
  28132. // Fields allows partial responses to be retrieved. See
  28133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28134. // for more information.
  28135. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  28136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28137. return c
  28138. }
  28139. // IfNoneMatch sets the optional parameter which makes the operation
  28140. // fail if the object's ETag matches the given value. This is useful for
  28141. // getting updates only after the object has changed since the last
  28142. // request. Use googleapi.IsNotModified to check whether the response
  28143. // error from Do is the result of In-None-Match.
  28144. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  28145. c.ifNoneMatch_ = entityTag
  28146. return c
  28147. }
  28148. // Context sets the context to be used in this call's Do method. Any
  28149. // pending HTTP request will be aborted if the provided context is
  28150. // canceled.
  28151. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  28152. c.ctx_ = ctx
  28153. return c
  28154. }
  28155. // Header returns an http.Header that can be modified by the caller to
  28156. // add HTTP headers to the request.
  28157. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  28158. if c.header_ == nil {
  28159. c.header_ = make(http.Header)
  28160. }
  28161. return c.header_
  28162. }
  28163. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  28164. reqHeaders := make(http.Header)
  28165. for k, v := range c.header_ {
  28166. reqHeaders[k] = v
  28167. }
  28168. reqHeaders.Set("User-Agent", c.s.userAgent())
  28169. if c.ifNoneMatch_ != "" {
  28170. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28171. }
  28172. var body io.Reader = nil
  28173. c.urlParams_.Set("alt", alt)
  28174. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  28175. urls += "?" + c.urlParams_.Encode()
  28176. req, _ := http.NewRequest("GET", urls, body)
  28177. req.Header = reqHeaders
  28178. googleapi.Expand(req.URL, map[string]string{
  28179. "profileId": strconv.FormatInt(c.profileId, 10),
  28180. "id": strconv.FormatInt(c.id, 10),
  28181. })
  28182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28183. }
  28184. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  28185. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28186. // non-2xx status code is an error. Response headers are in either
  28187. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28188. // returned at all) in error.(*googleapi.Error).Header. Use
  28189. // googleapi.IsNotModified to check whether the returned error was
  28190. // because http.StatusNotModified was returned.
  28191. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28192. gensupport.SetOptions(c.urlParams_, opts...)
  28193. res, err := c.doRequest("json")
  28194. if res != nil && res.StatusCode == http.StatusNotModified {
  28195. if res.Body != nil {
  28196. res.Body.Close()
  28197. }
  28198. return nil, &googleapi.Error{
  28199. Code: res.StatusCode,
  28200. Header: res.Header,
  28201. }
  28202. }
  28203. if err != nil {
  28204. return nil, err
  28205. }
  28206. defer googleapi.CloseBody(res)
  28207. if err := googleapi.CheckResponse(res); err != nil {
  28208. return nil, err
  28209. }
  28210. ret := &FloodlightActivityGroup{
  28211. ServerResponse: googleapi.ServerResponse{
  28212. Header: res.Header,
  28213. HTTPStatusCode: res.StatusCode,
  28214. },
  28215. }
  28216. target := &ret
  28217. if err := gensupport.DecodeResponse(target, res); err != nil {
  28218. return nil, err
  28219. }
  28220. return ret, nil
  28221. // {
  28222. // "description": "Gets one floodlight activity group by ID.",
  28223. // "httpMethod": "GET",
  28224. // "id": "dfareporting.floodlightActivityGroups.get",
  28225. // "parameterOrder": [
  28226. // "profileId",
  28227. // "id"
  28228. // ],
  28229. // "parameters": {
  28230. // "id": {
  28231. // "description": "Floodlight activity Group ID.",
  28232. // "format": "int64",
  28233. // "location": "path",
  28234. // "required": true,
  28235. // "type": "string"
  28236. // },
  28237. // "profileId": {
  28238. // "description": "User profile ID associated with this request.",
  28239. // "format": "int64",
  28240. // "location": "path",
  28241. // "required": true,
  28242. // "type": "string"
  28243. // }
  28244. // },
  28245. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  28246. // "response": {
  28247. // "$ref": "FloodlightActivityGroup"
  28248. // },
  28249. // "scopes": [
  28250. // "https://www.googleapis.com/auth/dfatrafficking"
  28251. // ]
  28252. // }
  28253. }
  28254. // method id "dfareporting.floodlightActivityGroups.insert":
  28255. type FloodlightActivityGroupsInsertCall struct {
  28256. s *Service
  28257. profileId int64
  28258. floodlightactivitygroup *FloodlightActivityGroup
  28259. urlParams_ gensupport.URLParams
  28260. ctx_ context.Context
  28261. header_ http.Header
  28262. }
  28263. // Insert: Inserts a new floodlight activity group.
  28264. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  28265. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28266. c.profileId = profileId
  28267. c.floodlightactivitygroup = floodlightactivitygroup
  28268. return c
  28269. }
  28270. // Fields allows partial responses to be retrieved. See
  28271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28272. // for more information.
  28273. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  28274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28275. return c
  28276. }
  28277. // Context sets the context to be used in this call's Do method. Any
  28278. // pending HTTP request will be aborted if the provided context is
  28279. // canceled.
  28280. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  28281. c.ctx_ = ctx
  28282. return c
  28283. }
  28284. // Header returns an http.Header that can be modified by the caller to
  28285. // add HTTP headers to the request.
  28286. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  28287. if c.header_ == nil {
  28288. c.header_ = make(http.Header)
  28289. }
  28290. return c.header_
  28291. }
  28292. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  28293. reqHeaders := make(http.Header)
  28294. for k, v := range c.header_ {
  28295. reqHeaders[k] = v
  28296. }
  28297. reqHeaders.Set("User-Agent", c.s.userAgent())
  28298. var body io.Reader = nil
  28299. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  28300. if err != nil {
  28301. return nil, err
  28302. }
  28303. reqHeaders.Set("Content-Type", "application/json")
  28304. c.urlParams_.Set("alt", alt)
  28305. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28306. urls += "?" + c.urlParams_.Encode()
  28307. req, _ := http.NewRequest("POST", urls, body)
  28308. req.Header = reqHeaders
  28309. googleapi.Expand(req.URL, map[string]string{
  28310. "profileId": strconv.FormatInt(c.profileId, 10),
  28311. })
  28312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28313. }
  28314. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  28315. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28316. // non-2xx status code is an error. Response headers are in either
  28317. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28318. // returned at all) in error.(*googleapi.Error).Header. Use
  28319. // googleapi.IsNotModified to check whether the returned error was
  28320. // because http.StatusNotModified was returned.
  28321. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28322. gensupport.SetOptions(c.urlParams_, opts...)
  28323. res, err := c.doRequest("json")
  28324. if res != nil && res.StatusCode == http.StatusNotModified {
  28325. if res.Body != nil {
  28326. res.Body.Close()
  28327. }
  28328. return nil, &googleapi.Error{
  28329. Code: res.StatusCode,
  28330. Header: res.Header,
  28331. }
  28332. }
  28333. if err != nil {
  28334. return nil, err
  28335. }
  28336. defer googleapi.CloseBody(res)
  28337. if err := googleapi.CheckResponse(res); err != nil {
  28338. return nil, err
  28339. }
  28340. ret := &FloodlightActivityGroup{
  28341. ServerResponse: googleapi.ServerResponse{
  28342. Header: res.Header,
  28343. HTTPStatusCode: res.StatusCode,
  28344. },
  28345. }
  28346. target := &ret
  28347. if err := gensupport.DecodeResponse(target, res); err != nil {
  28348. return nil, err
  28349. }
  28350. return ret, nil
  28351. // {
  28352. // "description": "Inserts a new floodlight activity group.",
  28353. // "httpMethod": "POST",
  28354. // "id": "dfareporting.floodlightActivityGroups.insert",
  28355. // "parameterOrder": [
  28356. // "profileId"
  28357. // ],
  28358. // "parameters": {
  28359. // "profileId": {
  28360. // "description": "User profile ID associated with this request.",
  28361. // "format": "int64",
  28362. // "location": "path",
  28363. // "required": true,
  28364. // "type": "string"
  28365. // }
  28366. // },
  28367. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28368. // "request": {
  28369. // "$ref": "FloodlightActivityGroup"
  28370. // },
  28371. // "response": {
  28372. // "$ref": "FloodlightActivityGroup"
  28373. // },
  28374. // "scopes": [
  28375. // "https://www.googleapis.com/auth/dfatrafficking"
  28376. // ]
  28377. // }
  28378. }
  28379. // method id "dfareporting.floodlightActivityGroups.list":
  28380. type FloodlightActivityGroupsListCall struct {
  28381. s *Service
  28382. profileId int64
  28383. urlParams_ gensupport.URLParams
  28384. ifNoneMatch_ string
  28385. ctx_ context.Context
  28386. header_ http.Header
  28387. }
  28388. // List: Retrieves a list of floodlight activity groups, possibly
  28389. // filtered. This method supports paging.
  28390. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  28391. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28392. c.profileId = profileId
  28393. return c
  28394. }
  28395. // AdvertiserId sets the optional parameter "advertiserId": Select only
  28396. // floodlight activity groups with the specified advertiser ID. Must
  28397. // specify either advertiserId or floodlightConfigurationId for a
  28398. // non-empty result.
  28399. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  28400. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  28401. return c
  28402. }
  28403. // FloodlightConfigurationId sets the optional parameter
  28404. // "floodlightConfigurationId": Select only floodlight activity groups
  28405. // with the specified floodlight configuration ID. Must specify either
  28406. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28407. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  28408. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  28409. return c
  28410. }
  28411. // Ids sets the optional parameter "ids": Select only floodlight
  28412. // activity groups with the specified IDs. Must specify either
  28413. // advertiserId or floodlightConfigurationId for a non-empty result.
  28414. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  28415. var ids_ []string
  28416. for _, v := range ids {
  28417. ids_ = append(ids_, fmt.Sprint(v))
  28418. }
  28419. c.urlParams_.SetMulti("ids", ids_)
  28420. return c
  28421. }
  28422. // MaxResults sets the optional parameter "maxResults": Maximum number
  28423. // of results to return.
  28424. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  28425. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28426. return c
  28427. }
  28428. // PageToken sets the optional parameter "pageToken": Value of the
  28429. // nextPageToken from the previous result page.
  28430. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  28431. c.urlParams_.Set("pageToken", pageToken)
  28432. return c
  28433. }
  28434. // SearchString sets the optional parameter "searchString": Allows
  28435. // searching for objects by name or ID. Wildcards (*) are allowed. For
  28436. // example, "floodlightactivitygroup*2015" will return objects with
  28437. // names like "floodlightactivitygroup June 2015",
  28438. // "floodlightactivitygroup April 2015", or simply
  28439. // "floodlightactivitygroup 2015". Most of the searches also add
  28440. // wildcards implicitly at the start and the end of the search string.
  28441. // For example, a search string of "floodlightactivitygroup" will match
  28442. // objects with name "my floodlightactivitygroup activity",
  28443. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  28444. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  28445. c.urlParams_.Set("searchString", searchString)
  28446. return c
  28447. }
  28448. // SortField sets the optional parameter "sortField": Field by which to
  28449. // sort the list.
  28450. //
  28451. // Possible values:
  28452. // "ID" (default)
  28453. // "NAME"
  28454. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  28455. c.urlParams_.Set("sortField", sortField)
  28456. return c
  28457. }
  28458. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28459. // results.
  28460. //
  28461. // Possible values:
  28462. // "ASCENDING" (default)
  28463. // "DESCENDING"
  28464. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  28465. c.urlParams_.Set("sortOrder", sortOrder)
  28466. return c
  28467. }
  28468. // Type sets the optional parameter "type": Select only floodlight
  28469. // activity groups with the specified floodlight activity group type.
  28470. //
  28471. // Possible values:
  28472. // "COUNTER"
  28473. // "SALE"
  28474. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  28475. c.urlParams_.Set("type", type_)
  28476. return c
  28477. }
  28478. // Fields allows partial responses to be retrieved. See
  28479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28480. // for more information.
  28481. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  28482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28483. return c
  28484. }
  28485. // IfNoneMatch sets the optional parameter which makes the operation
  28486. // fail if the object's ETag matches the given value. This is useful for
  28487. // getting updates only after the object has changed since the last
  28488. // request. Use googleapi.IsNotModified to check whether the response
  28489. // error from Do is the result of In-None-Match.
  28490. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  28491. c.ifNoneMatch_ = entityTag
  28492. return c
  28493. }
  28494. // Context sets the context to be used in this call's Do method. Any
  28495. // pending HTTP request will be aborted if the provided context is
  28496. // canceled.
  28497. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  28498. c.ctx_ = ctx
  28499. return c
  28500. }
  28501. // Header returns an http.Header that can be modified by the caller to
  28502. // add HTTP headers to the request.
  28503. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  28504. if c.header_ == nil {
  28505. c.header_ = make(http.Header)
  28506. }
  28507. return c.header_
  28508. }
  28509. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  28510. reqHeaders := make(http.Header)
  28511. for k, v := range c.header_ {
  28512. reqHeaders[k] = v
  28513. }
  28514. reqHeaders.Set("User-Agent", c.s.userAgent())
  28515. if c.ifNoneMatch_ != "" {
  28516. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28517. }
  28518. var body io.Reader = nil
  28519. c.urlParams_.Set("alt", alt)
  28520. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28521. urls += "?" + c.urlParams_.Encode()
  28522. req, _ := http.NewRequest("GET", urls, body)
  28523. req.Header = reqHeaders
  28524. googleapi.Expand(req.URL, map[string]string{
  28525. "profileId": strconv.FormatInt(c.profileId, 10),
  28526. })
  28527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28528. }
  28529. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  28530. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  28531. // non-nil. Any non-2xx status code is an error. Response headers are in
  28532. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  28533. // (if a response was returned at all) in
  28534. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28535. // whether the returned error was because http.StatusNotModified was
  28536. // returned.
  28537. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  28538. gensupport.SetOptions(c.urlParams_, opts...)
  28539. res, err := c.doRequest("json")
  28540. if res != nil && res.StatusCode == http.StatusNotModified {
  28541. if res.Body != nil {
  28542. res.Body.Close()
  28543. }
  28544. return nil, &googleapi.Error{
  28545. Code: res.StatusCode,
  28546. Header: res.Header,
  28547. }
  28548. }
  28549. if err != nil {
  28550. return nil, err
  28551. }
  28552. defer googleapi.CloseBody(res)
  28553. if err := googleapi.CheckResponse(res); err != nil {
  28554. return nil, err
  28555. }
  28556. ret := &FloodlightActivityGroupsListResponse{
  28557. ServerResponse: googleapi.ServerResponse{
  28558. Header: res.Header,
  28559. HTTPStatusCode: res.StatusCode,
  28560. },
  28561. }
  28562. target := &ret
  28563. if err := gensupport.DecodeResponse(target, res); err != nil {
  28564. return nil, err
  28565. }
  28566. return ret, nil
  28567. // {
  28568. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  28569. // "httpMethod": "GET",
  28570. // "id": "dfareporting.floodlightActivityGroups.list",
  28571. // "parameterOrder": [
  28572. // "profileId"
  28573. // ],
  28574. // "parameters": {
  28575. // "advertiserId": {
  28576. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  28577. // "format": "int64",
  28578. // "location": "query",
  28579. // "type": "string"
  28580. // },
  28581. // "floodlightConfigurationId": {
  28582. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  28583. // "format": "int64",
  28584. // "location": "query",
  28585. // "type": "string"
  28586. // },
  28587. // "ids": {
  28588. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  28589. // "format": "int64",
  28590. // "location": "query",
  28591. // "repeated": true,
  28592. // "type": "string"
  28593. // },
  28594. // "maxResults": {
  28595. // "default": "1000",
  28596. // "description": "Maximum number of results to return.",
  28597. // "format": "int32",
  28598. // "location": "query",
  28599. // "maximum": "1000",
  28600. // "minimum": "0",
  28601. // "type": "integer"
  28602. // },
  28603. // "pageToken": {
  28604. // "description": "Value of the nextPageToken from the previous result page.",
  28605. // "location": "query",
  28606. // "type": "string"
  28607. // },
  28608. // "profileId": {
  28609. // "description": "User profile ID associated with this request.",
  28610. // "format": "int64",
  28611. // "location": "path",
  28612. // "required": true,
  28613. // "type": "string"
  28614. // },
  28615. // "searchString": {
  28616. // "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\".",
  28617. // "location": "query",
  28618. // "type": "string"
  28619. // },
  28620. // "sortField": {
  28621. // "default": "ID",
  28622. // "description": "Field by which to sort the list.",
  28623. // "enum": [
  28624. // "ID",
  28625. // "NAME"
  28626. // ],
  28627. // "enumDescriptions": [
  28628. // "",
  28629. // ""
  28630. // ],
  28631. // "location": "query",
  28632. // "type": "string"
  28633. // },
  28634. // "sortOrder": {
  28635. // "default": "ASCENDING",
  28636. // "description": "Order of sorted results.",
  28637. // "enum": [
  28638. // "ASCENDING",
  28639. // "DESCENDING"
  28640. // ],
  28641. // "enumDescriptions": [
  28642. // "",
  28643. // ""
  28644. // ],
  28645. // "location": "query",
  28646. // "type": "string"
  28647. // },
  28648. // "type": {
  28649. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  28650. // "enum": [
  28651. // "COUNTER",
  28652. // "SALE"
  28653. // ],
  28654. // "enumDescriptions": [
  28655. // "",
  28656. // ""
  28657. // ],
  28658. // "location": "query",
  28659. // "type": "string"
  28660. // }
  28661. // },
  28662. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28663. // "response": {
  28664. // "$ref": "FloodlightActivityGroupsListResponse"
  28665. // },
  28666. // "scopes": [
  28667. // "https://www.googleapis.com/auth/dfatrafficking"
  28668. // ]
  28669. // }
  28670. }
  28671. // Pages invokes f for each page of results.
  28672. // A non-nil error returned from f will halt the iteration.
  28673. // The provided context supersedes any context provided to the Context method.
  28674. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  28675. c.ctx_ = ctx
  28676. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28677. for {
  28678. x, err := c.Do()
  28679. if err != nil {
  28680. return err
  28681. }
  28682. if err := f(x); err != nil {
  28683. return err
  28684. }
  28685. if x.NextPageToken == "" {
  28686. return nil
  28687. }
  28688. c.PageToken(x.NextPageToken)
  28689. }
  28690. }
  28691. // method id "dfareporting.floodlightActivityGroups.patch":
  28692. type FloodlightActivityGroupsPatchCall struct {
  28693. s *Service
  28694. profileId int64
  28695. floodlightactivitygroup *FloodlightActivityGroup
  28696. urlParams_ gensupport.URLParams
  28697. ctx_ context.Context
  28698. header_ http.Header
  28699. }
  28700. // Patch: Updates an existing floodlight activity group. This method
  28701. // supports patch semantics.
  28702. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  28703. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28704. c.profileId = profileId
  28705. c.urlParams_.Set("id", fmt.Sprint(id))
  28706. c.floodlightactivitygroup = floodlightactivitygroup
  28707. return c
  28708. }
  28709. // Fields allows partial responses to be retrieved. See
  28710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28711. // for more information.
  28712. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  28713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28714. return c
  28715. }
  28716. // Context sets the context to be used in this call's Do method. Any
  28717. // pending HTTP request will be aborted if the provided context is
  28718. // canceled.
  28719. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  28720. c.ctx_ = ctx
  28721. return c
  28722. }
  28723. // Header returns an http.Header that can be modified by the caller to
  28724. // add HTTP headers to the request.
  28725. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  28726. if c.header_ == nil {
  28727. c.header_ = make(http.Header)
  28728. }
  28729. return c.header_
  28730. }
  28731. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  28732. reqHeaders := make(http.Header)
  28733. for k, v := range c.header_ {
  28734. reqHeaders[k] = v
  28735. }
  28736. reqHeaders.Set("User-Agent", c.s.userAgent())
  28737. var body io.Reader = nil
  28738. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  28739. if err != nil {
  28740. return nil, err
  28741. }
  28742. reqHeaders.Set("Content-Type", "application/json")
  28743. c.urlParams_.Set("alt", alt)
  28744. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28745. urls += "?" + c.urlParams_.Encode()
  28746. req, _ := http.NewRequest("PATCH", urls, body)
  28747. req.Header = reqHeaders
  28748. googleapi.Expand(req.URL, map[string]string{
  28749. "profileId": strconv.FormatInt(c.profileId, 10),
  28750. })
  28751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28752. }
  28753. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  28754. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28755. // non-2xx status code is an error. Response headers are in either
  28756. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28757. // returned at all) in error.(*googleapi.Error).Header. Use
  28758. // googleapi.IsNotModified to check whether the returned error was
  28759. // because http.StatusNotModified was returned.
  28760. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28761. gensupport.SetOptions(c.urlParams_, opts...)
  28762. res, err := c.doRequest("json")
  28763. if res != nil && res.StatusCode == http.StatusNotModified {
  28764. if res.Body != nil {
  28765. res.Body.Close()
  28766. }
  28767. return nil, &googleapi.Error{
  28768. Code: res.StatusCode,
  28769. Header: res.Header,
  28770. }
  28771. }
  28772. if err != nil {
  28773. return nil, err
  28774. }
  28775. defer googleapi.CloseBody(res)
  28776. if err := googleapi.CheckResponse(res); err != nil {
  28777. return nil, err
  28778. }
  28779. ret := &FloodlightActivityGroup{
  28780. ServerResponse: googleapi.ServerResponse{
  28781. Header: res.Header,
  28782. HTTPStatusCode: res.StatusCode,
  28783. },
  28784. }
  28785. target := &ret
  28786. if err := gensupport.DecodeResponse(target, res); err != nil {
  28787. return nil, err
  28788. }
  28789. return ret, nil
  28790. // {
  28791. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  28792. // "httpMethod": "PATCH",
  28793. // "id": "dfareporting.floodlightActivityGroups.patch",
  28794. // "parameterOrder": [
  28795. // "profileId",
  28796. // "id"
  28797. // ],
  28798. // "parameters": {
  28799. // "id": {
  28800. // "description": "Floodlight activity Group ID.",
  28801. // "format": "int64",
  28802. // "location": "query",
  28803. // "required": true,
  28804. // "type": "string"
  28805. // },
  28806. // "profileId": {
  28807. // "description": "User profile ID associated with this request.",
  28808. // "format": "int64",
  28809. // "location": "path",
  28810. // "required": true,
  28811. // "type": "string"
  28812. // }
  28813. // },
  28814. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28815. // "request": {
  28816. // "$ref": "FloodlightActivityGroup"
  28817. // },
  28818. // "response": {
  28819. // "$ref": "FloodlightActivityGroup"
  28820. // },
  28821. // "scopes": [
  28822. // "https://www.googleapis.com/auth/dfatrafficking"
  28823. // ]
  28824. // }
  28825. }
  28826. // method id "dfareporting.floodlightActivityGroups.update":
  28827. type FloodlightActivityGroupsUpdateCall struct {
  28828. s *Service
  28829. profileId int64
  28830. floodlightactivitygroup *FloodlightActivityGroup
  28831. urlParams_ gensupport.URLParams
  28832. ctx_ context.Context
  28833. header_ http.Header
  28834. }
  28835. // Update: Updates an existing floodlight activity group.
  28836. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  28837. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28838. c.profileId = profileId
  28839. c.floodlightactivitygroup = floodlightactivitygroup
  28840. return c
  28841. }
  28842. // Fields allows partial responses to be retrieved. See
  28843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28844. // for more information.
  28845. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  28846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28847. return c
  28848. }
  28849. // Context sets the context to be used in this call's Do method. Any
  28850. // pending HTTP request will be aborted if the provided context is
  28851. // canceled.
  28852. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  28853. c.ctx_ = ctx
  28854. return c
  28855. }
  28856. // Header returns an http.Header that can be modified by the caller to
  28857. // add HTTP headers to the request.
  28858. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  28859. if c.header_ == nil {
  28860. c.header_ = make(http.Header)
  28861. }
  28862. return c.header_
  28863. }
  28864. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  28865. reqHeaders := make(http.Header)
  28866. for k, v := range c.header_ {
  28867. reqHeaders[k] = v
  28868. }
  28869. reqHeaders.Set("User-Agent", c.s.userAgent())
  28870. var body io.Reader = nil
  28871. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  28872. if err != nil {
  28873. return nil, err
  28874. }
  28875. reqHeaders.Set("Content-Type", "application/json")
  28876. c.urlParams_.Set("alt", alt)
  28877. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28878. urls += "?" + c.urlParams_.Encode()
  28879. req, _ := http.NewRequest("PUT", urls, body)
  28880. req.Header = reqHeaders
  28881. googleapi.Expand(req.URL, map[string]string{
  28882. "profileId": strconv.FormatInt(c.profileId, 10),
  28883. })
  28884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28885. }
  28886. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  28887. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28888. // non-2xx status code is an error. Response headers are in either
  28889. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28890. // returned at all) in error.(*googleapi.Error).Header. Use
  28891. // googleapi.IsNotModified to check whether the returned error was
  28892. // because http.StatusNotModified was returned.
  28893. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28894. gensupport.SetOptions(c.urlParams_, opts...)
  28895. res, err := c.doRequest("json")
  28896. if res != nil && res.StatusCode == http.StatusNotModified {
  28897. if res.Body != nil {
  28898. res.Body.Close()
  28899. }
  28900. return nil, &googleapi.Error{
  28901. Code: res.StatusCode,
  28902. Header: res.Header,
  28903. }
  28904. }
  28905. if err != nil {
  28906. return nil, err
  28907. }
  28908. defer googleapi.CloseBody(res)
  28909. if err := googleapi.CheckResponse(res); err != nil {
  28910. return nil, err
  28911. }
  28912. ret := &FloodlightActivityGroup{
  28913. ServerResponse: googleapi.ServerResponse{
  28914. Header: res.Header,
  28915. HTTPStatusCode: res.StatusCode,
  28916. },
  28917. }
  28918. target := &ret
  28919. if err := gensupport.DecodeResponse(target, res); err != nil {
  28920. return nil, err
  28921. }
  28922. return ret, nil
  28923. // {
  28924. // "description": "Updates an existing floodlight activity group.",
  28925. // "httpMethod": "PUT",
  28926. // "id": "dfareporting.floodlightActivityGroups.update",
  28927. // "parameterOrder": [
  28928. // "profileId"
  28929. // ],
  28930. // "parameters": {
  28931. // "profileId": {
  28932. // "description": "User profile ID associated with this request.",
  28933. // "format": "int64",
  28934. // "location": "path",
  28935. // "required": true,
  28936. // "type": "string"
  28937. // }
  28938. // },
  28939. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28940. // "request": {
  28941. // "$ref": "FloodlightActivityGroup"
  28942. // },
  28943. // "response": {
  28944. // "$ref": "FloodlightActivityGroup"
  28945. // },
  28946. // "scopes": [
  28947. // "https://www.googleapis.com/auth/dfatrafficking"
  28948. // ]
  28949. // }
  28950. }
  28951. // method id "dfareporting.floodlightConfigurations.get":
  28952. type FloodlightConfigurationsGetCall struct {
  28953. s *Service
  28954. profileId int64
  28955. id int64
  28956. urlParams_ gensupport.URLParams
  28957. ifNoneMatch_ string
  28958. ctx_ context.Context
  28959. header_ http.Header
  28960. }
  28961. // Get: Gets one floodlight configuration by ID.
  28962. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  28963. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28964. c.profileId = profileId
  28965. c.id = id
  28966. return c
  28967. }
  28968. // Fields allows partial responses to be retrieved. See
  28969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28970. // for more information.
  28971. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  28972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28973. return c
  28974. }
  28975. // IfNoneMatch sets the optional parameter which makes the operation
  28976. // fail if the object's ETag matches the given value. This is useful for
  28977. // getting updates only after the object has changed since the last
  28978. // request. Use googleapi.IsNotModified to check whether the response
  28979. // error from Do is the result of In-None-Match.
  28980. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  28981. c.ifNoneMatch_ = entityTag
  28982. return c
  28983. }
  28984. // Context sets the context to be used in this call's Do method. Any
  28985. // pending HTTP request will be aborted if the provided context is
  28986. // canceled.
  28987. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  28988. c.ctx_ = ctx
  28989. return c
  28990. }
  28991. // Header returns an http.Header that can be modified by the caller to
  28992. // add HTTP headers to the request.
  28993. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  28994. if c.header_ == nil {
  28995. c.header_ = make(http.Header)
  28996. }
  28997. return c.header_
  28998. }
  28999. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  29000. reqHeaders := make(http.Header)
  29001. for k, v := range c.header_ {
  29002. reqHeaders[k] = v
  29003. }
  29004. reqHeaders.Set("User-Agent", c.s.userAgent())
  29005. if c.ifNoneMatch_ != "" {
  29006. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29007. }
  29008. var body io.Reader = nil
  29009. c.urlParams_.Set("alt", alt)
  29010. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  29011. urls += "?" + c.urlParams_.Encode()
  29012. req, _ := http.NewRequest("GET", urls, body)
  29013. req.Header = reqHeaders
  29014. googleapi.Expand(req.URL, map[string]string{
  29015. "profileId": strconv.FormatInt(c.profileId, 10),
  29016. "id": strconv.FormatInt(c.id, 10),
  29017. })
  29018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29019. }
  29020. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  29021. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  29022. // non-2xx status code is an error. Response headers are in either
  29023. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  29024. // returned at all) in error.(*googleapi.Error).Header. Use
  29025. // googleapi.IsNotModified to check whether the returned error was
  29026. // because http.StatusNotModified was returned.
  29027. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  29028. gensupport.SetOptions(c.urlParams_, opts...)
  29029. res, err := c.doRequest("json")
  29030. if res != nil && res.StatusCode == http.StatusNotModified {
  29031. if res.Body != nil {
  29032. res.Body.Close()
  29033. }
  29034. return nil, &googleapi.Error{
  29035. Code: res.StatusCode,
  29036. Header: res.Header,
  29037. }
  29038. }
  29039. if err != nil {
  29040. return nil, err
  29041. }
  29042. defer googleapi.CloseBody(res)
  29043. if err := googleapi.CheckResponse(res); err != nil {
  29044. return nil, err
  29045. }
  29046. ret := &FloodlightConfiguration{
  29047. ServerResponse: googleapi.ServerResponse{
  29048. Header: res.Header,
  29049. HTTPStatusCode: res.StatusCode,
  29050. },
  29051. }
  29052. target := &ret
  29053. if err := gensupport.DecodeResponse(target, res); err != nil {
  29054. return nil, err
  29055. }
  29056. return ret, nil
  29057. // {
  29058. // "description": "Gets one floodlight configuration by ID.",
  29059. // "httpMethod": "GET",
  29060. // "id": "dfareporting.floodlightConfigurations.get",
  29061. // "parameterOrder": [
  29062. // "profileId",
  29063. // "id"
  29064. // ],
  29065. // "parameters": {
  29066. // "id": {
  29067. // "description": "Floodlight configuration ID.",
  29068. // "format": "int64",
  29069. // "location": "path",
  29070. // "required": true,
  29071. // "type": "string"
  29072. // },
  29073. // "profileId": {
  29074. // "description": "User profile ID associated with this request.",
  29075. // "format": "int64",
  29076. // "location": "path",
  29077. // "required": true,
  29078. // "type": "string"
  29079. // }
  29080. // },
  29081. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  29082. // "response": {
  29083. // "$ref": "FloodlightConfiguration"
  29084. // },
  29085. // "scopes": [
  29086. // "https://www.googleapis.com/auth/dfatrafficking"
  29087. // ]
  29088. // }
  29089. }
  29090. // method id "dfareporting.floodlightConfigurations.list":
  29091. type FloodlightConfigurationsListCall struct {
  29092. s *Service
  29093. profileId int64
  29094. urlParams_ gensupport.URLParams
  29095. ifNoneMatch_ string
  29096. ctx_ context.Context
  29097. header_ http.Header
  29098. }
  29099. // List: Retrieves a list of floodlight configurations, possibly
  29100. // filtered.
  29101. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  29102. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29103. c.profileId = profileId
  29104. return c
  29105. }
  29106. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  29107. // configurations to retrieve. Required field; otherwise an empty list
  29108. // will be returned.
  29109. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  29110. var ids_ []string
  29111. for _, v := range ids {
  29112. ids_ = append(ids_, fmt.Sprint(v))
  29113. }
  29114. c.urlParams_.SetMulti("ids", ids_)
  29115. return c
  29116. }
  29117. // Fields allows partial responses to be retrieved. See
  29118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29119. // for more information.
  29120. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  29121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29122. return c
  29123. }
  29124. // IfNoneMatch sets the optional parameter which makes the operation
  29125. // fail if the object's ETag matches the given value. This is useful for
  29126. // getting updates only after the object has changed since the last
  29127. // request. Use googleapi.IsNotModified to check whether the response
  29128. // error from Do is the result of In-None-Match.
  29129. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  29130. c.ifNoneMatch_ = entityTag
  29131. return c
  29132. }
  29133. // Context sets the context to be used in this call's Do method. Any
  29134. // pending HTTP request will be aborted if the provided context is
  29135. // canceled.
  29136. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  29137. c.ctx_ = ctx
  29138. return c
  29139. }
  29140. // Header returns an http.Header that can be modified by the caller to
  29141. // add HTTP headers to the request.
  29142. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  29143. if c.header_ == nil {
  29144. c.header_ = make(http.Header)
  29145. }
  29146. return c.header_
  29147. }
  29148. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  29149. reqHeaders := make(http.Header)
  29150. for k, v := range c.header_ {
  29151. reqHeaders[k] = v
  29152. }
  29153. reqHeaders.Set("User-Agent", c.s.userAgent())
  29154. if c.ifNoneMatch_ != "" {
  29155. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29156. }
  29157. var body io.Reader = nil
  29158. c.urlParams_.Set("alt", alt)
  29159. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  29160. urls += "?" + c.urlParams_.Encode()
  29161. req, _ := http.NewRequest("GET", urls, body)
  29162. req.Header = reqHeaders
  29163. googleapi.Expand(req.URL, map[string]string{
  29164. "profileId": strconv.FormatInt(c.profileId, 10),
  29165. })
  29166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29167. }
  29168. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  29169. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  29170. // non-nil. Any non-2xx status code is an error. Response headers are in
  29171. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  29172. // (if a response was returned at all) in
  29173. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  29174. // whether the returned error was because http.StatusNotModified was
  29175. // returned.
  29176. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  29177. gensupport.SetOptions(c.urlParams_, opts...)
  29178. res, err := c.doRequest("json")
  29179. if res != nil && res.StatusCode == http.StatusNotModified {
  29180. if res.Body != nil {
  29181. res.Body.Close()
  29182. }
  29183. return nil, &googleapi.Error{
  29184. Code: res.StatusCode,
  29185. Header: res.Header,
  29186. }
  29187. }
  29188. if err != nil {
  29189. return nil, err
  29190. }
  29191. defer googleapi.CloseBody(res)
  29192. if err := googleapi.CheckResponse(res); err != nil {
  29193. return nil, err
  29194. }
  29195. ret := &FloodlightConfigurationsListResponse{
  29196. ServerResponse: googleapi.ServerResponse{
  29197. Header: res.Header,
  29198. HTTPStatusCode: res.StatusCode,
  29199. },
  29200. }
  29201. target := &ret
  29202. if err := gensupport.DecodeResponse(target, res); err != nil {
  29203. return nil, err
  29204. }
  29205. return ret, nil
  29206. // {
  29207. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  29208. // "httpMethod": "GET",
  29209. // "id": "dfareporting.floodlightConfigurations.list",
  29210. // "parameterOrder": [
  29211. // "profileId"
  29212. // ],
  29213. // "parameters": {
  29214. // "ids": {
  29215. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  29216. // "format": "int64",
  29217. // "location": "query",
  29218. // "repeated": true,
  29219. // "type": "string"
  29220. // },
  29221. // "profileId": {
  29222. // "description": "User profile ID associated with this request.",
  29223. // "format": "int64",
  29224. // "location": "path",
  29225. // "required": true,
  29226. // "type": "string"
  29227. // }
  29228. // },
  29229. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  29230. // "response": {
  29231. // "$ref": "FloodlightConfigurationsListResponse"
  29232. // },
  29233. // "scopes": [
  29234. // "https://www.googleapis.com/auth/dfatrafficking"
  29235. // ]
  29236. // }
  29237. }
  29238. // method id "dfareporting.floodlightConfigurations.patch":
  29239. type FloodlightConfigurationsPatchCall struct {
  29240. s *Service
  29241. profileId int64
  29242. floodlightconfiguration *FloodlightConfiguration
  29243. urlParams_ gensupport.URLParams
  29244. ctx_ context.Context
  29245. header_ http.Header
  29246. }
  29247. // Patch: Updates an existing floodlight configuration. This method
  29248. // supports patch semantics.
  29249. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  29250. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29251. c.profileId = profileId
  29252. c.urlParams_.Set("id", fmt.Sprint(id))
  29253. c.floodlightconfiguration = floodlightconfiguration
  29254. return c
  29255. }
  29256. // Fields allows partial responses to be retrieved. See
  29257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29258. // for more information.
  29259. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  29260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29261. return c
  29262. }
  29263. // Context sets the context to be used in this call's Do method. Any
  29264. // pending HTTP request will be aborted if the provided context is
  29265. // canceled.
  29266. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  29267. c.ctx_ = ctx
  29268. return c
  29269. }
  29270. // Header returns an http.Header that can be modified by the caller to
  29271. // add HTTP headers to the request.
  29272. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  29273. if c.header_ == nil {
  29274. c.header_ = make(http.Header)
  29275. }
  29276. return c.header_
  29277. }
  29278. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  29279. reqHeaders := make(http.Header)
  29280. for k, v := range c.header_ {
  29281. reqHeaders[k] = v
  29282. }
  29283. reqHeaders.Set("User-Agent", c.s.userAgent())
  29284. var body io.Reader = nil
  29285. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  29286. if err != nil {
  29287. return nil, err
  29288. }
  29289. reqHeaders.Set("Content-Type", "application/json")
  29290. c.urlParams_.Set("alt", alt)
  29291. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  29292. urls += "?" + c.urlParams_.Encode()
  29293. req, _ := http.NewRequest("PATCH", urls, body)
  29294. req.Header = reqHeaders
  29295. googleapi.Expand(req.URL, map[string]string{
  29296. "profileId": strconv.FormatInt(c.profileId, 10),
  29297. })
  29298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29299. }
  29300. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  29301. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  29302. // non-2xx status code is an error. Response headers are in either
  29303. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  29304. // returned at all) in error.(*googleapi.Error).Header. Use
  29305. // googleapi.IsNotModified to check whether the returned error was
  29306. // because http.StatusNotModified was returned.
  29307. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  29308. gensupport.SetOptions(c.urlParams_, opts...)
  29309. res, err := c.doRequest("json")
  29310. if res != nil && res.StatusCode == http.StatusNotModified {
  29311. if res.Body != nil {
  29312. res.Body.Close()
  29313. }
  29314. return nil, &googleapi.Error{
  29315. Code: res.StatusCode,
  29316. Header: res.Header,
  29317. }
  29318. }
  29319. if err != nil {
  29320. return nil, err
  29321. }
  29322. defer googleapi.CloseBody(res)
  29323. if err := googleapi.CheckResponse(res); err != nil {
  29324. return nil, err
  29325. }
  29326. ret := &FloodlightConfiguration{
  29327. ServerResponse: googleapi.ServerResponse{
  29328. Header: res.Header,
  29329. HTTPStatusCode: res.StatusCode,
  29330. },
  29331. }
  29332. target := &ret
  29333. if err := gensupport.DecodeResponse(target, res); err != nil {
  29334. return nil, err
  29335. }
  29336. return ret, nil
  29337. // {
  29338. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  29339. // "httpMethod": "PATCH",
  29340. // "id": "dfareporting.floodlightConfigurations.patch",
  29341. // "parameterOrder": [
  29342. // "profileId",
  29343. // "id"
  29344. // ],
  29345. // "parameters": {
  29346. // "id": {
  29347. // "description": "Floodlight configuration ID.",
  29348. // "format": "int64",
  29349. // "location": "query",
  29350. // "required": true,
  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. // },
  29361. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  29362. // "request": {
  29363. // "$ref": "FloodlightConfiguration"
  29364. // },
  29365. // "response": {
  29366. // "$ref": "FloodlightConfiguration"
  29367. // },
  29368. // "scopes": [
  29369. // "https://www.googleapis.com/auth/dfatrafficking"
  29370. // ]
  29371. // }
  29372. }
  29373. // method id "dfareporting.floodlightConfigurations.update":
  29374. type FloodlightConfigurationsUpdateCall struct {
  29375. s *Service
  29376. profileId int64
  29377. floodlightconfiguration *FloodlightConfiguration
  29378. urlParams_ gensupport.URLParams
  29379. ctx_ context.Context
  29380. header_ http.Header
  29381. }
  29382. // Update: Updates an existing floodlight configuration.
  29383. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  29384. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29385. c.profileId = profileId
  29386. c.floodlightconfiguration = floodlightconfiguration
  29387. return c
  29388. }
  29389. // Fields allows partial responses to be retrieved. See
  29390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29391. // for more information.
  29392. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  29393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29394. return c
  29395. }
  29396. // Context sets the context to be used in this call's Do method. Any
  29397. // pending HTTP request will be aborted if the provided context is
  29398. // canceled.
  29399. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  29400. c.ctx_ = ctx
  29401. return c
  29402. }
  29403. // Header returns an http.Header that can be modified by the caller to
  29404. // add HTTP headers to the request.
  29405. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  29406. if c.header_ == nil {
  29407. c.header_ = make(http.Header)
  29408. }
  29409. return c.header_
  29410. }
  29411. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  29412. reqHeaders := make(http.Header)
  29413. for k, v := range c.header_ {
  29414. reqHeaders[k] = v
  29415. }
  29416. reqHeaders.Set("User-Agent", c.s.userAgent())
  29417. var body io.Reader = nil
  29418. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  29419. if err != nil {
  29420. return nil, err
  29421. }
  29422. reqHeaders.Set("Content-Type", "application/json")
  29423. c.urlParams_.Set("alt", alt)
  29424. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  29425. urls += "?" + c.urlParams_.Encode()
  29426. req, _ := http.NewRequest("PUT", urls, body)
  29427. req.Header = reqHeaders
  29428. googleapi.Expand(req.URL, map[string]string{
  29429. "profileId": strconv.FormatInt(c.profileId, 10),
  29430. })
  29431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29432. }
  29433. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  29434. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  29435. // non-2xx status code is an error. Response headers are in either
  29436. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  29437. // returned at all) in error.(*googleapi.Error).Header. Use
  29438. // googleapi.IsNotModified to check whether the returned error was
  29439. // because http.StatusNotModified was returned.
  29440. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  29441. gensupport.SetOptions(c.urlParams_, opts...)
  29442. res, err := c.doRequest("json")
  29443. if res != nil && res.StatusCode == http.StatusNotModified {
  29444. if res.Body != nil {
  29445. res.Body.Close()
  29446. }
  29447. return nil, &googleapi.Error{
  29448. Code: res.StatusCode,
  29449. Header: res.Header,
  29450. }
  29451. }
  29452. if err != nil {
  29453. return nil, err
  29454. }
  29455. defer googleapi.CloseBody(res)
  29456. if err := googleapi.CheckResponse(res); err != nil {
  29457. return nil, err
  29458. }
  29459. ret := &FloodlightConfiguration{
  29460. ServerResponse: googleapi.ServerResponse{
  29461. Header: res.Header,
  29462. HTTPStatusCode: res.StatusCode,
  29463. },
  29464. }
  29465. target := &ret
  29466. if err := gensupport.DecodeResponse(target, res); err != nil {
  29467. return nil, err
  29468. }
  29469. return ret, nil
  29470. // {
  29471. // "description": "Updates an existing floodlight configuration.",
  29472. // "httpMethod": "PUT",
  29473. // "id": "dfareporting.floodlightConfigurations.update",
  29474. // "parameterOrder": [
  29475. // "profileId"
  29476. // ],
  29477. // "parameters": {
  29478. // "profileId": {
  29479. // "description": "User profile ID associated with this request.",
  29480. // "format": "int64",
  29481. // "location": "path",
  29482. // "required": true,
  29483. // "type": "string"
  29484. // }
  29485. // },
  29486. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  29487. // "request": {
  29488. // "$ref": "FloodlightConfiguration"
  29489. // },
  29490. // "response": {
  29491. // "$ref": "FloodlightConfiguration"
  29492. // },
  29493. // "scopes": [
  29494. // "https://www.googleapis.com/auth/dfatrafficking"
  29495. // ]
  29496. // }
  29497. }
  29498. // method id "dfareporting.inventoryItems.get":
  29499. type InventoryItemsGetCall struct {
  29500. s *Service
  29501. profileId int64
  29502. projectId int64
  29503. id int64
  29504. urlParams_ gensupport.URLParams
  29505. ifNoneMatch_ string
  29506. ctx_ context.Context
  29507. header_ http.Header
  29508. }
  29509. // Get: Gets one inventory item by ID.
  29510. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  29511. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29512. c.profileId = profileId
  29513. c.projectId = projectId
  29514. c.id = id
  29515. return c
  29516. }
  29517. // Fields allows partial responses to be retrieved. See
  29518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29519. // for more information.
  29520. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  29521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29522. return c
  29523. }
  29524. // IfNoneMatch sets the optional parameter which makes the operation
  29525. // fail if the object's ETag matches the given value. This is useful for
  29526. // getting updates only after the object has changed since the last
  29527. // request. Use googleapi.IsNotModified to check whether the response
  29528. // error from Do is the result of In-None-Match.
  29529. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  29530. c.ifNoneMatch_ = entityTag
  29531. return c
  29532. }
  29533. // Context sets the context to be used in this call's Do method. Any
  29534. // pending HTTP request will be aborted if the provided context is
  29535. // canceled.
  29536. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  29537. c.ctx_ = ctx
  29538. return c
  29539. }
  29540. // Header returns an http.Header that can be modified by the caller to
  29541. // add HTTP headers to the request.
  29542. func (c *InventoryItemsGetCall) Header() http.Header {
  29543. if c.header_ == nil {
  29544. c.header_ = make(http.Header)
  29545. }
  29546. return c.header_
  29547. }
  29548. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  29549. reqHeaders := make(http.Header)
  29550. for k, v := range c.header_ {
  29551. reqHeaders[k] = v
  29552. }
  29553. reqHeaders.Set("User-Agent", c.s.userAgent())
  29554. if c.ifNoneMatch_ != "" {
  29555. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29556. }
  29557. var body io.Reader = nil
  29558. c.urlParams_.Set("alt", alt)
  29559. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  29560. urls += "?" + c.urlParams_.Encode()
  29561. req, _ := http.NewRequest("GET", urls, body)
  29562. req.Header = reqHeaders
  29563. googleapi.Expand(req.URL, map[string]string{
  29564. "profileId": strconv.FormatInt(c.profileId, 10),
  29565. "projectId": strconv.FormatInt(c.projectId, 10),
  29566. "id": strconv.FormatInt(c.id, 10),
  29567. })
  29568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29569. }
  29570. // Do executes the "dfareporting.inventoryItems.get" call.
  29571. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  29572. // status code is an error. Response headers are in either
  29573. // *InventoryItem.ServerResponse.Header or (if a response was returned
  29574. // at all) in error.(*googleapi.Error).Header. Use
  29575. // googleapi.IsNotModified to check whether the returned error was
  29576. // because http.StatusNotModified was returned.
  29577. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  29578. gensupport.SetOptions(c.urlParams_, opts...)
  29579. res, err := c.doRequest("json")
  29580. if res != nil && res.StatusCode == http.StatusNotModified {
  29581. if res.Body != nil {
  29582. res.Body.Close()
  29583. }
  29584. return nil, &googleapi.Error{
  29585. Code: res.StatusCode,
  29586. Header: res.Header,
  29587. }
  29588. }
  29589. if err != nil {
  29590. return nil, err
  29591. }
  29592. defer googleapi.CloseBody(res)
  29593. if err := googleapi.CheckResponse(res); err != nil {
  29594. return nil, err
  29595. }
  29596. ret := &InventoryItem{
  29597. ServerResponse: googleapi.ServerResponse{
  29598. Header: res.Header,
  29599. HTTPStatusCode: res.StatusCode,
  29600. },
  29601. }
  29602. target := &ret
  29603. if err := gensupport.DecodeResponse(target, res); err != nil {
  29604. return nil, err
  29605. }
  29606. return ret, nil
  29607. // {
  29608. // "description": "Gets one inventory item by ID.",
  29609. // "httpMethod": "GET",
  29610. // "id": "dfareporting.inventoryItems.get",
  29611. // "parameterOrder": [
  29612. // "profileId",
  29613. // "projectId",
  29614. // "id"
  29615. // ],
  29616. // "parameters": {
  29617. // "id": {
  29618. // "description": "Inventory item ID.",
  29619. // "format": "int64",
  29620. // "location": "path",
  29621. // "required": true,
  29622. // "type": "string"
  29623. // },
  29624. // "profileId": {
  29625. // "description": "User profile ID associated with this request.",
  29626. // "format": "int64",
  29627. // "location": "path",
  29628. // "required": true,
  29629. // "type": "string"
  29630. // },
  29631. // "projectId": {
  29632. // "description": "Project ID for order documents.",
  29633. // "format": "int64",
  29634. // "location": "path",
  29635. // "required": true,
  29636. // "type": "string"
  29637. // }
  29638. // },
  29639. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  29640. // "response": {
  29641. // "$ref": "InventoryItem"
  29642. // },
  29643. // "scopes": [
  29644. // "https://www.googleapis.com/auth/dfatrafficking"
  29645. // ]
  29646. // }
  29647. }
  29648. // method id "dfareporting.inventoryItems.list":
  29649. type InventoryItemsListCall struct {
  29650. s *Service
  29651. profileId int64
  29652. projectId int64
  29653. urlParams_ gensupport.URLParams
  29654. ifNoneMatch_ string
  29655. ctx_ context.Context
  29656. header_ http.Header
  29657. }
  29658. // List: Retrieves a list of inventory items, possibly filtered. This
  29659. // method supports paging.
  29660. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  29661. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29662. c.profileId = profileId
  29663. c.projectId = projectId
  29664. return c
  29665. }
  29666. // Ids sets the optional parameter "ids": Select only inventory items
  29667. // with these IDs.
  29668. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  29669. var ids_ []string
  29670. for _, v := range ids {
  29671. ids_ = append(ids_, fmt.Sprint(v))
  29672. }
  29673. c.urlParams_.SetMulti("ids", ids_)
  29674. return c
  29675. }
  29676. // InPlan sets the optional parameter "inPlan": Select only inventory
  29677. // items that are in plan.
  29678. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  29679. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  29680. return c
  29681. }
  29682. // MaxResults sets the optional parameter "maxResults": Maximum number
  29683. // of results to return.
  29684. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  29685. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29686. return c
  29687. }
  29688. // OrderId sets the optional parameter "orderId": Select only inventory
  29689. // items that belong to specified orders.
  29690. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  29691. var orderId_ []string
  29692. for _, v := range orderId {
  29693. orderId_ = append(orderId_, fmt.Sprint(v))
  29694. }
  29695. c.urlParams_.SetMulti("orderId", orderId_)
  29696. return c
  29697. }
  29698. // PageToken sets the optional parameter "pageToken": Value of the
  29699. // nextPageToken from the previous result page.
  29700. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  29701. c.urlParams_.Set("pageToken", pageToken)
  29702. return c
  29703. }
  29704. // SiteId sets the optional parameter "siteId": Select only inventory
  29705. // items that are associated with these sites.
  29706. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  29707. var siteId_ []string
  29708. for _, v := range siteId {
  29709. siteId_ = append(siteId_, fmt.Sprint(v))
  29710. }
  29711. c.urlParams_.SetMulti("siteId", siteId_)
  29712. return c
  29713. }
  29714. // SortField sets the optional parameter "sortField": Field by which to
  29715. // sort the list.
  29716. //
  29717. // Possible values:
  29718. // "ID" (default)
  29719. // "NAME"
  29720. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  29721. c.urlParams_.Set("sortField", sortField)
  29722. return c
  29723. }
  29724. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29725. // results.
  29726. //
  29727. // Possible values:
  29728. // "ASCENDING" (default)
  29729. // "DESCENDING"
  29730. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  29731. c.urlParams_.Set("sortOrder", sortOrder)
  29732. return c
  29733. }
  29734. // Type sets the optional parameter "type": Select only inventory items
  29735. // with this type.
  29736. //
  29737. // Possible values:
  29738. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  29739. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  29740. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  29741. c.urlParams_.Set("type", type_)
  29742. return c
  29743. }
  29744. // Fields allows partial responses to be retrieved. See
  29745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29746. // for more information.
  29747. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  29748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29749. return c
  29750. }
  29751. // IfNoneMatch sets the optional parameter which makes the operation
  29752. // fail if the object's ETag matches the given value. This is useful for
  29753. // getting updates only after the object has changed since the last
  29754. // request. Use googleapi.IsNotModified to check whether the response
  29755. // error from Do is the result of In-None-Match.
  29756. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  29757. c.ifNoneMatch_ = entityTag
  29758. return c
  29759. }
  29760. // Context sets the context to be used in this call's Do method. Any
  29761. // pending HTTP request will be aborted if the provided context is
  29762. // canceled.
  29763. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  29764. c.ctx_ = ctx
  29765. return c
  29766. }
  29767. // Header returns an http.Header that can be modified by the caller to
  29768. // add HTTP headers to the request.
  29769. func (c *InventoryItemsListCall) Header() http.Header {
  29770. if c.header_ == nil {
  29771. c.header_ = make(http.Header)
  29772. }
  29773. return c.header_
  29774. }
  29775. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  29776. reqHeaders := make(http.Header)
  29777. for k, v := range c.header_ {
  29778. reqHeaders[k] = v
  29779. }
  29780. reqHeaders.Set("User-Agent", c.s.userAgent())
  29781. if c.ifNoneMatch_ != "" {
  29782. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29783. }
  29784. var body io.Reader = nil
  29785. c.urlParams_.Set("alt", alt)
  29786. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  29787. urls += "?" + c.urlParams_.Encode()
  29788. req, _ := http.NewRequest("GET", urls, body)
  29789. req.Header = reqHeaders
  29790. googleapi.Expand(req.URL, map[string]string{
  29791. "profileId": strconv.FormatInt(c.profileId, 10),
  29792. "projectId": strconv.FormatInt(c.projectId, 10),
  29793. })
  29794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29795. }
  29796. // Do executes the "dfareporting.inventoryItems.list" call.
  29797. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  29798. // Any non-2xx status code is an error. Response headers are in either
  29799. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  29800. // was returned at all) in error.(*googleapi.Error).Header. Use
  29801. // googleapi.IsNotModified to check whether the returned error was
  29802. // because http.StatusNotModified was returned.
  29803. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  29804. gensupport.SetOptions(c.urlParams_, opts...)
  29805. res, err := c.doRequest("json")
  29806. if res != nil && res.StatusCode == http.StatusNotModified {
  29807. if res.Body != nil {
  29808. res.Body.Close()
  29809. }
  29810. return nil, &googleapi.Error{
  29811. Code: res.StatusCode,
  29812. Header: res.Header,
  29813. }
  29814. }
  29815. if err != nil {
  29816. return nil, err
  29817. }
  29818. defer googleapi.CloseBody(res)
  29819. if err := googleapi.CheckResponse(res); err != nil {
  29820. return nil, err
  29821. }
  29822. ret := &InventoryItemsListResponse{
  29823. ServerResponse: googleapi.ServerResponse{
  29824. Header: res.Header,
  29825. HTTPStatusCode: res.StatusCode,
  29826. },
  29827. }
  29828. target := &ret
  29829. if err := gensupport.DecodeResponse(target, res); err != nil {
  29830. return nil, err
  29831. }
  29832. return ret, nil
  29833. // {
  29834. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  29835. // "httpMethod": "GET",
  29836. // "id": "dfareporting.inventoryItems.list",
  29837. // "parameterOrder": [
  29838. // "profileId",
  29839. // "projectId"
  29840. // ],
  29841. // "parameters": {
  29842. // "ids": {
  29843. // "description": "Select only inventory items with these IDs.",
  29844. // "format": "int64",
  29845. // "location": "query",
  29846. // "repeated": true,
  29847. // "type": "string"
  29848. // },
  29849. // "inPlan": {
  29850. // "description": "Select only inventory items that are in plan.",
  29851. // "location": "query",
  29852. // "type": "boolean"
  29853. // },
  29854. // "maxResults": {
  29855. // "default": "1000",
  29856. // "description": "Maximum number of results to return.",
  29857. // "format": "int32",
  29858. // "location": "query",
  29859. // "maximum": "1000",
  29860. // "minimum": "0",
  29861. // "type": "integer"
  29862. // },
  29863. // "orderId": {
  29864. // "description": "Select only inventory items that belong to specified orders.",
  29865. // "format": "int64",
  29866. // "location": "query",
  29867. // "repeated": true,
  29868. // "type": "string"
  29869. // },
  29870. // "pageToken": {
  29871. // "description": "Value of the nextPageToken from the previous result page.",
  29872. // "location": "query",
  29873. // "type": "string"
  29874. // },
  29875. // "profileId": {
  29876. // "description": "User profile ID associated with this request.",
  29877. // "format": "int64",
  29878. // "location": "path",
  29879. // "required": true,
  29880. // "type": "string"
  29881. // },
  29882. // "projectId": {
  29883. // "description": "Project ID for order documents.",
  29884. // "format": "int64",
  29885. // "location": "path",
  29886. // "required": true,
  29887. // "type": "string"
  29888. // },
  29889. // "siteId": {
  29890. // "description": "Select only inventory items that are associated with these sites.",
  29891. // "format": "int64",
  29892. // "location": "query",
  29893. // "repeated": true,
  29894. // "type": "string"
  29895. // },
  29896. // "sortField": {
  29897. // "default": "ID",
  29898. // "description": "Field by which to sort the list.",
  29899. // "enum": [
  29900. // "ID",
  29901. // "NAME"
  29902. // ],
  29903. // "enumDescriptions": [
  29904. // "",
  29905. // ""
  29906. // ],
  29907. // "location": "query",
  29908. // "type": "string"
  29909. // },
  29910. // "sortOrder": {
  29911. // "default": "ASCENDING",
  29912. // "description": "Order of sorted results.",
  29913. // "enum": [
  29914. // "ASCENDING",
  29915. // "DESCENDING"
  29916. // ],
  29917. // "enumDescriptions": [
  29918. // "",
  29919. // ""
  29920. // ],
  29921. // "location": "query",
  29922. // "type": "string"
  29923. // },
  29924. // "type": {
  29925. // "description": "Select only inventory items with this type.",
  29926. // "enum": [
  29927. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  29928. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  29929. // ],
  29930. // "enumDescriptions": [
  29931. // "",
  29932. // ""
  29933. // ],
  29934. // "location": "query",
  29935. // "type": "string"
  29936. // }
  29937. // },
  29938. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  29939. // "response": {
  29940. // "$ref": "InventoryItemsListResponse"
  29941. // },
  29942. // "scopes": [
  29943. // "https://www.googleapis.com/auth/dfatrafficking"
  29944. // ]
  29945. // }
  29946. }
  29947. // Pages invokes f for each page of results.
  29948. // A non-nil error returned from f will halt the iteration.
  29949. // The provided context supersedes any context provided to the Context method.
  29950. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  29951. c.ctx_ = ctx
  29952. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29953. for {
  29954. x, err := c.Do()
  29955. if err != nil {
  29956. return err
  29957. }
  29958. if err := f(x); err != nil {
  29959. return err
  29960. }
  29961. if x.NextPageToken == "" {
  29962. return nil
  29963. }
  29964. c.PageToken(x.NextPageToken)
  29965. }
  29966. }
  29967. // method id "dfareporting.landingPages.delete":
  29968. type LandingPagesDeleteCall struct {
  29969. s *Service
  29970. profileId int64
  29971. campaignId int64
  29972. id int64
  29973. urlParams_ gensupport.URLParams
  29974. ctx_ context.Context
  29975. header_ http.Header
  29976. }
  29977. // Delete: Deletes an existing campaign landing page.
  29978. func (r *LandingPagesService) Delete(profileId int64, campaignId int64, id int64) *LandingPagesDeleteCall {
  29979. c := &LandingPagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29980. c.profileId = profileId
  29981. c.campaignId = campaignId
  29982. c.id = id
  29983. return c
  29984. }
  29985. // Fields allows partial responses to be retrieved. See
  29986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29987. // for more information.
  29988. func (c *LandingPagesDeleteCall) Fields(s ...googleapi.Field) *LandingPagesDeleteCall {
  29989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29990. return c
  29991. }
  29992. // Context sets the context to be used in this call's Do method. Any
  29993. // pending HTTP request will be aborted if the provided context is
  29994. // canceled.
  29995. func (c *LandingPagesDeleteCall) Context(ctx context.Context) *LandingPagesDeleteCall {
  29996. c.ctx_ = ctx
  29997. return c
  29998. }
  29999. // Header returns an http.Header that can be modified by the caller to
  30000. // add HTTP headers to the request.
  30001. func (c *LandingPagesDeleteCall) Header() http.Header {
  30002. if c.header_ == nil {
  30003. c.header_ = make(http.Header)
  30004. }
  30005. return c.header_
  30006. }
  30007. func (c *LandingPagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30008. reqHeaders := make(http.Header)
  30009. for k, v := range c.header_ {
  30010. reqHeaders[k] = v
  30011. }
  30012. reqHeaders.Set("User-Agent", c.s.userAgent())
  30013. var body io.Reader = nil
  30014. c.urlParams_.Set("alt", alt)
  30015. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}")
  30016. urls += "?" + c.urlParams_.Encode()
  30017. req, _ := http.NewRequest("DELETE", urls, body)
  30018. req.Header = reqHeaders
  30019. googleapi.Expand(req.URL, map[string]string{
  30020. "profileId": strconv.FormatInt(c.profileId, 10),
  30021. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30022. "id": strconv.FormatInt(c.id, 10),
  30023. })
  30024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30025. }
  30026. // Do executes the "dfareporting.landingPages.delete" call.
  30027. func (c *LandingPagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  30028. gensupport.SetOptions(c.urlParams_, opts...)
  30029. res, err := c.doRequest("json")
  30030. if err != nil {
  30031. return err
  30032. }
  30033. defer googleapi.CloseBody(res)
  30034. if err := googleapi.CheckResponse(res); err != nil {
  30035. return err
  30036. }
  30037. return nil
  30038. // {
  30039. // "description": "Deletes an existing campaign landing page.",
  30040. // "httpMethod": "DELETE",
  30041. // "id": "dfareporting.landingPages.delete",
  30042. // "parameterOrder": [
  30043. // "profileId",
  30044. // "campaignId",
  30045. // "id"
  30046. // ],
  30047. // "parameters": {
  30048. // "campaignId": {
  30049. // "description": "Landing page campaign ID.",
  30050. // "format": "int64",
  30051. // "location": "path",
  30052. // "required": true,
  30053. // "type": "string"
  30054. // },
  30055. // "id": {
  30056. // "description": "Landing page ID.",
  30057. // "format": "int64",
  30058. // "location": "path",
  30059. // "required": true,
  30060. // "type": "string"
  30061. // },
  30062. // "profileId": {
  30063. // "description": "User profile ID associated with this request.",
  30064. // "format": "int64",
  30065. // "location": "path",
  30066. // "required": true,
  30067. // "type": "string"
  30068. // }
  30069. // },
  30070. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}",
  30071. // "scopes": [
  30072. // "https://www.googleapis.com/auth/dfatrafficking"
  30073. // ]
  30074. // }
  30075. }
  30076. // method id "dfareporting.landingPages.get":
  30077. type LandingPagesGetCall struct {
  30078. s *Service
  30079. profileId int64
  30080. campaignId int64
  30081. id int64
  30082. urlParams_ gensupport.URLParams
  30083. ifNoneMatch_ string
  30084. ctx_ context.Context
  30085. header_ http.Header
  30086. }
  30087. // Get: Gets one campaign landing page by ID.
  30088. func (r *LandingPagesService) Get(profileId int64, campaignId int64, id int64) *LandingPagesGetCall {
  30089. c := &LandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30090. c.profileId = profileId
  30091. c.campaignId = campaignId
  30092. c.id = id
  30093. return c
  30094. }
  30095. // Fields allows partial responses to be retrieved. See
  30096. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30097. // for more information.
  30098. func (c *LandingPagesGetCall) Fields(s ...googleapi.Field) *LandingPagesGetCall {
  30099. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30100. return c
  30101. }
  30102. // IfNoneMatch sets the optional parameter which makes the operation
  30103. // fail if the object's ETag matches the given value. This is useful for
  30104. // getting updates only after the object has changed since the last
  30105. // request. Use googleapi.IsNotModified to check whether the response
  30106. // error from Do is the result of In-None-Match.
  30107. func (c *LandingPagesGetCall) IfNoneMatch(entityTag string) *LandingPagesGetCall {
  30108. c.ifNoneMatch_ = entityTag
  30109. return c
  30110. }
  30111. // Context sets the context to be used in this call's Do method. Any
  30112. // pending HTTP request will be aborted if the provided context is
  30113. // canceled.
  30114. func (c *LandingPagesGetCall) Context(ctx context.Context) *LandingPagesGetCall {
  30115. c.ctx_ = ctx
  30116. return c
  30117. }
  30118. // Header returns an http.Header that can be modified by the caller to
  30119. // add HTTP headers to the request.
  30120. func (c *LandingPagesGetCall) Header() http.Header {
  30121. if c.header_ == nil {
  30122. c.header_ = make(http.Header)
  30123. }
  30124. return c.header_
  30125. }
  30126. func (c *LandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  30127. reqHeaders := make(http.Header)
  30128. for k, v := range c.header_ {
  30129. reqHeaders[k] = v
  30130. }
  30131. reqHeaders.Set("User-Agent", c.s.userAgent())
  30132. if c.ifNoneMatch_ != "" {
  30133. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30134. }
  30135. var body io.Reader = nil
  30136. c.urlParams_.Set("alt", alt)
  30137. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}")
  30138. urls += "?" + c.urlParams_.Encode()
  30139. req, _ := http.NewRequest("GET", urls, body)
  30140. req.Header = reqHeaders
  30141. googleapi.Expand(req.URL, map[string]string{
  30142. "profileId": strconv.FormatInt(c.profileId, 10),
  30143. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30144. "id": strconv.FormatInt(c.id, 10),
  30145. })
  30146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30147. }
  30148. // Do executes the "dfareporting.landingPages.get" call.
  30149. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30150. // status code is an error. Response headers are in either
  30151. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30152. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30153. // to check whether the returned error was because
  30154. // http.StatusNotModified was returned.
  30155. func (c *LandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30156. gensupport.SetOptions(c.urlParams_, opts...)
  30157. res, err := c.doRequest("json")
  30158. if res != nil && res.StatusCode == http.StatusNotModified {
  30159. if res.Body != nil {
  30160. res.Body.Close()
  30161. }
  30162. return nil, &googleapi.Error{
  30163. Code: res.StatusCode,
  30164. Header: res.Header,
  30165. }
  30166. }
  30167. if err != nil {
  30168. return nil, err
  30169. }
  30170. defer googleapi.CloseBody(res)
  30171. if err := googleapi.CheckResponse(res); err != nil {
  30172. return nil, err
  30173. }
  30174. ret := &LandingPage{
  30175. ServerResponse: googleapi.ServerResponse{
  30176. Header: res.Header,
  30177. HTTPStatusCode: res.StatusCode,
  30178. },
  30179. }
  30180. target := &ret
  30181. if err := gensupport.DecodeResponse(target, res); err != nil {
  30182. return nil, err
  30183. }
  30184. return ret, nil
  30185. // {
  30186. // "description": "Gets one campaign landing page by ID.",
  30187. // "httpMethod": "GET",
  30188. // "id": "dfareporting.landingPages.get",
  30189. // "parameterOrder": [
  30190. // "profileId",
  30191. // "campaignId",
  30192. // "id"
  30193. // ],
  30194. // "parameters": {
  30195. // "campaignId": {
  30196. // "description": "Landing page campaign ID.",
  30197. // "format": "int64",
  30198. // "location": "path",
  30199. // "required": true,
  30200. // "type": "string"
  30201. // },
  30202. // "id": {
  30203. // "description": "Landing page ID.",
  30204. // "format": "int64",
  30205. // "location": "path",
  30206. // "required": true,
  30207. // "type": "string"
  30208. // },
  30209. // "profileId": {
  30210. // "description": "User profile ID associated with this request.",
  30211. // "format": "int64",
  30212. // "location": "path",
  30213. // "required": true,
  30214. // "type": "string"
  30215. // }
  30216. // },
  30217. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}",
  30218. // "response": {
  30219. // "$ref": "LandingPage"
  30220. // },
  30221. // "scopes": [
  30222. // "https://www.googleapis.com/auth/dfatrafficking"
  30223. // ]
  30224. // }
  30225. }
  30226. // method id "dfareporting.landingPages.insert":
  30227. type LandingPagesInsertCall struct {
  30228. s *Service
  30229. profileId int64
  30230. campaignId int64
  30231. landingpage *LandingPage
  30232. urlParams_ gensupport.URLParams
  30233. ctx_ context.Context
  30234. header_ http.Header
  30235. }
  30236. // Insert: Inserts a new landing page for the specified campaign.
  30237. func (r *LandingPagesService) Insert(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesInsertCall {
  30238. c := &LandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30239. c.profileId = profileId
  30240. c.campaignId = campaignId
  30241. c.landingpage = landingpage
  30242. return c
  30243. }
  30244. // Fields allows partial responses to be retrieved. See
  30245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30246. // for more information.
  30247. func (c *LandingPagesInsertCall) Fields(s ...googleapi.Field) *LandingPagesInsertCall {
  30248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30249. return c
  30250. }
  30251. // Context sets the context to be used in this call's Do method. Any
  30252. // pending HTTP request will be aborted if the provided context is
  30253. // canceled.
  30254. func (c *LandingPagesInsertCall) Context(ctx context.Context) *LandingPagesInsertCall {
  30255. c.ctx_ = ctx
  30256. return c
  30257. }
  30258. // Header returns an http.Header that can be modified by the caller to
  30259. // add HTTP headers to the request.
  30260. func (c *LandingPagesInsertCall) Header() http.Header {
  30261. if c.header_ == nil {
  30262. c.header_ = make(http.Header)
  30263. }
  30264. return c.header_
  30265. }
  30266. func (c *LandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  30267. reqHeaders := make(http.Header)
  30268. for k, v := range c.header_ {
  30269. reqHeaders[k] = v
  30270. }
  30271. reqHeaders.Set("User-Agent", c.s.userAgent())
  30272. var body io.Reader = nil
  30273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  30274. if err != nil {
  30275. return nil, err
  30276. }
  30277. reqHeaders.Set("Content-Type", "application/json")
  30278. c.urlParams_.Set("alt", alt)
  30279. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30280. urls += "?" + c.urlParams_.Encode()
  30281. req, _ := http.NewRequest("POST", urls, body)
  30282. req.Header = reqHeaders
  30283. googleapi.Expand(req.URL, map[string]string{
  30284. "profileId": strconv.FormatInt(c.profileId, 10),
  30285. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30286. })
  30287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30288. }
  30289. // Do executes the "dfareporting.landingPages.insert" call.
  30290. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30291. // status code is an error. Response headers are in either
  30292. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30293. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30294. // to check whether the returned error was because
  30295. // http.StatusNotModified was returned.
  30296. func (c *LandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30297. gensupport.SetOptions(c.urlParams_, opts...)
  30298. res, err := c.doRequest("json")
  30299. if res != nil && res.StatusCode == http.StatusNotModified {
  30300. if res.Body != nil {
  30301. res.Body.Close()
  30302. }
  30303. return nil, &googleapi.Error{
  30304. Code: res.StatusCode,
  30305. Header: res.Header,
  30306. }
  30307. }
  30308. if err != nil {
  30309. return nil, err
  30310. }
  30311. defer googleapi.CloseBody(res)
  30312. if err := googleapi.CheckResponse(res); err != nil {
  30313. return nil, err
  30314. }
  30315. ret := &LandingPage{
  30316. ServerResponse: googleapi.ServerResponse{
  30317. Header: res.Header,
  30318. HTTPStatusCode: res.StatusCode,
  30319. },
  30320. }
  30321. target := &ret
  30322. if err := gensupport.DecodeResponse(target, res); err != nil {
  30323. return nil, err
  30324. }
  30325. return ret, nil
  30326. // {
  30327. // "description": "Inserts a new landing page for the specified campaign.",
  30328. // "httpMethod": "POST",
  30329. // "id": "dfareporting.landingPages.insert",
  30330. // "parameterOrder": [
  30331. // "profileId",
  30332. // "campaignId"
  30333. // ],
  30334. // "parameters": {
  30335. // "campaignId": {
  30336. // "description": "Landing page campaign ID.",
  30337. // "format": "int64",
  30338. // "location": "path",
  30339. // "required": true,
  30340. // "type": "string"
  30341. // },
  30342. // "profileId": {
  30343. // "description": "User profile ID associated with this request.",
  30344. // "format": "int64",
  30345. // "location": "path",
  30346. // "required": true,
  30347. // "type": "string"
  30348. // }
  30349. // },
  30350. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30351. // "request": {
  30352. // "$ref": "LandingPage"
  30353. // },
  30354. // "response": {
  30355. // "$ref": "LandingPage"
  30356. // },
  30357. // "scopes": [
  30358. // "https://www.googleapis.com/auth/dfatrafficking"
  30359. // ]
  30360. // }
  30361. }
  30362. // method id "dfareporting.landingPages.list":
  30363. type LandingPagesListCall struct {
  30364. s *Service
  30365. profileId int64
  30366. campaignId int64
  30367. urlParams_ gensupport.URLParams
  30368. ifNoneMatch_ string
  30369. ctx_ context.Context
  30370. header_ http.Header
  30371. }
  30372. // List: Retrieves the list of landing pages for the specified campaign.
  30373. func (r *LandingPagesService) List(profileId int64, campaignId int64) *LandingPagesListCall {
  30374. c := &LandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30375. c.profileId = profileId
  30376. c.campaignId = campaignId
  30377. return c
  30378. }
  30379. // Fields allows partial responses to be retrieved. See
  30380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30381. // for more information.
  30382. func (c *LandingPagesListCall) Fields(s ...googleapi.Field) *LandingPagesListCall {
  30383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30384. return c
  30385. }
  30386. // IfNoneMatch sets the optional parameter which makes the operation
  30387. // fail if the object's ETag matches the given value. This is useful for
  30388. // getting updates only after the object has changed since the last
  30389. // request. Use googleapi.IsNotModified to check whether the response
  30390. // error from Do is the result of In-None-Match.
  30391. func (c *LandingPagesListCall) IfNoneMatch(entityTag string) *LandingPagesListCall {
  30392. c.ifNoneMatch_ = entityTag
  30393. return c
  30394. }
  30395. // Context sets the context to be used in this call's Do method. Any
  30396. // pending HTTP request will be aborted if the provided context is
  30397. // canceled.
  30398. func (c *LandingPagesListCall) Context(ctx context.Context) *LandingPagesListCall {
  30399. c.ctx_ = ctx
  30400. return c
  30401. }
  30402. // Header returns an http.Header that can be modified by the caller to
  30403. // add HTTP headers to the request.
  30404. func (c *LandingPagesListCall) Header() http.Header {
  30405. if c.header_ == nil {
  30406. c.header_ = make(http.Header)
  30407. }
  30408. return c.header_
  30409. }
  30410. func (c *LandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  30411. reqHeaders := make(http.Header)
  30412. for k, v := range c.header_ {
  30413. reqHeaders[k] = v
  30414. }
  30415. reqHeaders.Set("User-Agent", c.s.userAgent())
  30416. if c.ifNoneMatch_ != "" {
  30417. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30418. }
  30419. var body io.Reader = nil
  30420. c.urlParams_.Set("alt", alt)
  30421. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30422. urls += "?" + c.urlParams_.Encode()
  30423. req, _ := http.NewRequest("GET", urls, body)
  30424. req.Header = reqHeaders
  30425. googleapi.Expand(req.URL, map[string]string{
  30426. "profileId": strconv.FormatInt(c.profileId, 10),
  30427. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30428. })
  30429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30430. }
  30431. // Do executes the "dfareporting.landingPages.list" call.
  30432. // Exactly one of *LandingPagesListResponse or error will be non-nil.
  30433. // Any non-2xx status code is an error. Response headers are in either
  30434. // *LandingPagesListResponse.ServerResponse.Header or (if a response was
  30435. // returned at all) in error.(*googleapi.Error).Header. Use
  30436. // googleapi.IsNotModified to check whether the returned error was
  30437. // because http.StatusNotModified was returned.
  30438. func (c *LandingPagesListCall) Do(opts ...googleapi.CallOption) (*LandingPagesListResponse, error) {
  30439. gensupport.SetOptions(c.urlParams_, opts...)
  30440. res, err := c.doRequest("json")
  30441. if res != nil && res.StatusCode == http.StatusNotModified {
  30442. if res.Body != nil {
  30443. res.Body.Close()
  30444. }
  30445. return nil, &googleapi.Error{
  30446. Code: res.StatusCode,
  30447. Header: res.Header,
  30448. }
  30449. }
  30450. if err != nil {
  30451. return nil, err
  30452. }
  30453. defer googleapi.CloseBody(res)
  30454. if err := googleapi.CheckResponse(res); err != nil {
  30455. return nil, err
  30456. }
  30457. ret := &LandingPagesListResponse{
  30458. ServerResponse: googleapi.ServerResponse{
  30459. Header: res.Header,
  30460. HTTPStatusCode: res.StatusCode,
  30461. },
  30462. }
  30463. target := &ret
  30464. if err := gensupport.DecodeResponse(target, res); err != nil {
  30465. return nil, err
  30466. }
  30467. return ret, nil
  30468. // {
  30469. // "description": "Retrieves the list of landing pages for the specified campaign.",
  30470. // "httpMethod": "GET",
  30471. // "id": "dfareporting.landingPages.list",
  30472. // "parameterOrder": [
  30473. // "profileId",
  30474. // "campaignId"
  30475. // ],
  30476. // "parameters": {
  30477. // "campaignId": {
  30478. // "description": "Landing page campaign ID.",
  30479. // "format": "int64",
  30480. // "location": "path",
  30481. // "required": true,
  30482. // "type": "string"
  30483. // },
  30484. // "profileId": {
  30485. // "description": "User profile ID associated with this request.",
  30486. // "format": "int64",
  30487. // "location": "path",
  30488. // "required": true,
  30489. // "type": "string"
  30490. // }
  30491. // },
  30492. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30493. // "response": {
  30494. // "$ref": "LandingPagesListResponse"
  30495. // },
  30496. // "scopes": [
  30497. // "https://www.googleapis.com/auth/dfatrafficking"
  30498. // ]
  30499. // }
  30500. }
  30501. // method id "dfareporting.landingPages.patch":
  30502. type LandingPagesPatchCall struct {
  30503. s *Service
  30504. profileId int64
  30505. campaignId int64
  30506. landingpage *LandingPage
  30507. urlParams_ gensupport.URLParams
  30508. ctx_ context.Context
  30509. header_ http.Header
  30510. }
  30511. // Patch: Updates an existing campaign landing page. This method
  30512. // supports patch semantics.
  30513. func (r *LandingPagesService) Patch(profileId int64, campaignId int64, id int64, landingpage *LandingPage) *LandingPagesPatchCall {
  30514. c := &LandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30515. c.profileId = profileId
  30516. c.campaignId = campaignId
  30517. c.urlParams_.Set("id", fmt.Sprint(id))
  30518. c.landingpage = landingpage
  30519. return c
  30520. }
  30521. // Fields allows partial responses to be retrieved. See
  30522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30523. // for more information.
  30524. func (c *LandingPagesPatchCall) Fields(s ...googleapi.Field) *LandingPagesPatchCall {
  30525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30526. return c
  30527. }
  30528. // Context sets the context to be used in this call's Do method. Any
  30529. // pending HTTP request will be aborted if the provided context is
  30530. // canceled.
  30531. func (c *LandingPagesPatchCall) Context(ctx context.Context) *LandingPagesPatchCall {
  30532. c.ctx_ = ctx
  30533. return c
  30534. }
  30535. // Header returns an http.Header that can be modified by the caller to
  30536. // add HTTP headers to the request.
  30537. func (c *LandingPagesPatchCall) Header() http.Header {
  30538. if c.header_ == nil {
  30539. c.header_ = make(http.Header)
  30540. }
  30541. return c.header_
  30542. }
  30543. func (c *LandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  30544. reqHeaders := make(http.Header)
  30545. for k, v := range c.header_ {
  30546. reqHeaders[k] = v
  30547. }
  30548. reqHeaders.Set("User-Agent", c.s.userAgent())
  30549. var body io.Reader = nil
  30550. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  30551. if err != nil {
  30552. return nil, err
  30553. }
  30554. reqHeaders.Set("Content-Type", "application/json")
  30555. c.urlParams_.Set("alt", alt)
  30556. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30557. urls += "?" + c.urlParams_.Encode()
  30558. req, _ := http.NewRequest("PATCH", urls, body)
  30559. req.Header = reqHeaders
  30560. googleapi.Expand(req.URL, map[string]string{
  30561. "profileId": strconv.FormatInt(c.profileId, 10),
  30562. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30563. })
  30564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30565. }
  30566. // Do executes the "dfareporting.landingPages.patch" call.
  30567. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30568. // status code is an error. Response headers are in either
  30569. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30571. // to check whether the returned error was because
  30572. // http.StatusNotModified was returned.
  30573. func (c *LandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30574. gensupport.SetOptions(c.urlParams_, opts...)
  30575. res, err := c.doRequest("json")
  30576. if res != nil && res.StatusCode == http.StatusNotModified {
  30577. if res.Body != nil {
  30578. res.Body.Close()
  30579. }
  30580. return nil, &googleapi.Error{
  30581. Code: res.StatusCode,
  30582. Header: res.Header,
  30583. }
  30584. }
  30585. if err != nil {
  30586. return nil, err
  30587. }
  30588. defer googleapi.CloseBody(res)
  30589. if err := googleapi.CheckResponse(res); err != nil {
  30590. return nil, err
  30591. }
  30592. ret := &LandingPage{
  30593. ServerResponse: googleapi.ServerResponse{
  30594. Header: res.Header,
  30595. HTTPStatusCode: res.StatusCode,
  30596. },
  30597. }
  30598. target := &ret
  30599. if err := gensupport.DecodeResponse(target, res); err != nil {
  30600. return nil, err
  30601. }
  30602. return ret, nil
  30603. // {
  30604. // "description": "Updates an existing campaign landing page. This method supports patch semantics.",
  30605. // "httpMethod": "PATCH",
  30606. // "id": "dfareporting.landingPages.patch",
  30607. // "parameterOrder": [
  30608. // "profileId",
  30609. // "campaignId",
  30610. // "id"
  30611. // ],
  30612. // "parameters": {
  30613. // "campaignId": {
  30614. // "description": "Landing page campaign ID.",
  30615. // "format": "int64",
  30616. // "location": "path",
  30617. // "required": true,
  30618. // "type": "string"
  30619. // },
  30620. // "id": {
  30621. // "description": "Landing page ID.",
  30622. // "format": "int64",
  30623. // "location": "query",
  30624. // "required": true,
  30625. // "type": "string"
  30626. // },
  30627. // "profileId": {
  30628. // "description": "User profile ID associated with this request.",
  30629. // "format": "int64",
  30630. // "location": "path",
  30631. // "required": true,
  30632. // "type": "string"
  30633. // }
  30634. // },
  30635. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30636. // "request": {
  30637. // "$ref": "LandingPage"
  30638. // },
  30639. // "response": {
  30640. // "$ref": "LandingPage"
  30641. // },
  30642. // "scopes": [
  30643. // "https://www.googleapis.com/auth/dfatrafficking"
  30644. // ]
  30645. // }
  30646. }
  30647. // method id "dfareporting.landingPages.update":
  30648. type LandingPagesUpdateCall struct {
  30649. s *Service
  30650. profileId int64
  30651. campaignId int64
  30652. landingpage *LandingPage
  30653. urlParams_ gensupport.URLParams
  30654. ctx_ context.Context
  30655. header_ http.Header
  30656. }
  30657. // Update: Updates an existing campaign landing page.
  30658. func (r *LandingPagesService) Update(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesUpdateCall {
  30659. c := &LandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30660. c.profileId = profileId
  30661. c.campaignId = campaignId
  30662. c.landingpage = landingpage
  30663. return c
  30664. }
  30665. // Fields allows partial responses to be retrieved. See
  30666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30667. // for more information.
  30668. func (c *LandingPagesUpdateCall) Fields(s ...googleapi.Field) *LandingPagesUpdateCall {
  30669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30670. return c
  30671. }
  30672. // Context sets the context to be used in this call's Do method. Any
  30673. // pending HTTP request will be aborted if the provided context is
  30674. // canceled.
  30675. func (c *LandingPagesUpdateCall) Context(ctx context.Context) *LandingPagesUpdateCall {
  30676. c.ctx_ = ctx
  30677. return c
  30678. }
  30679. // Header returns an http.Header that can be modified by the caller to
  30680. // add HTTP headers to the request.
  30681. func (c *LandingPagesUpdateCall) Header() http.Header {
  30682. if c.header_ == nil {
  30683. c.header_ = make(http.Header)
  30684. }
  30685. return c.header_
  30686. }
  30687. func (c *LandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  30688. reqHeaders := make(http.Header)
  30689. for k, v := range c.header_ {
  30690. reqHeaders[k] = v
  30691. }
  30692. reqHeaders.Set("User-Agent", c.s.userAgent())
  30693. var body io.Reader = nil
  30694. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  30695. if err != nil {
  30696. return nil, err
  30697. }
  30698. reqHeaders.Set("Content-Type", "application/json")
  30699. c.urlParams_.Set("alt", alt)
  30700. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30701. urls += "?" + c.urlParams_.Encode()
  30702. req, _ := http.NewRequest("PUT", urls, body)
  30703. req.Header = reqHeaders
  30704. googleapi.Expand(req.URL, map[string]string{
  30705. "profileId": strconv.FormatInt(c.profileId, 10),
  30706. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30707. })
  30708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30709. }
  30710. // Do executes the "dfareporting.landingPages.update" call.
  30711. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30712. // status code is an error. Response headers are in either
  30713. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30714. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30715. // to check whether the returned error was because
  30716. // http.StatusNotModified was returned.
  30717. func (c *LandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30718. gensupport.SetOptions(c.urlParams_, opts...)
  30719. res, err := c.doRequest("json")
  30720. if res != nil && res.StatusCode == http.StatusNotModified {
  30721. if res.Body != nil {
  30722. res.Body.Close()
  30723. }
  30724. return nil, &googleapi.Error{
  30725. Code: res.StatusCode,
  30726. Header: res.Header,
  30727. }
  30728. }
  30729. if err != nil {
  30730. return nil, err
  30731. }
  30732. defer googleapi.CloseBody(res)
  30733. if err := googleapi.CheckResponse(res); err != nil {
  30734. return nil, err
  30735. }
  30736. ret := &LandingPage{
  30737. ServerResponse: googleapi.ServerResponse{
  30738. Header: res.Header,
  30739. HTTPStatusCode: res.StatusCode,
  30740. },
  30741. }
  30742. target := &ret
  30743. if err := gensupport.DecodeResponse(target, res); err != nil {
  30744. return nil, err
  30745. }
  30746. return ret, nil
  30747. // {
  30748. // "description": "Updates an existing campaign landing page.",
  30749. // "httpMethod": "PUT",
  30750. // "id": "dfareporting.landingPages.update",
  30751. // "parameterOrder": [
  30752. // "profileId",
  30753. // "campaignId"
  30754. // ],
  30755. // "parameters": {
  30756. // "campaignId": {
  30757. // "description": "Landing page campaign ID.",
  30758. // "format": "int64",
  30759. // "location": "path",
  30760. // "required": true,
  30761. // "type": "string"
  30762. // },
  30763. // "profileId": {
  30764. // "description": "User profile ID associated with this request.",
  30765. // "format": "int64",
  30766. // "location": "path",
  30767. // "required": true,
  30768. // "type": "string"
  30769. // }
  30770. // },
  30771. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30772. // "request": {
  30773. // "$ref": "LandingPage"
  30774. // },
  30775. // "response": {
  30776. // "$ref": "LandingPage"
  30777. // },
  30778. // "scopes": [
  30779. // "https://www.googleapis.com/auth/dfatrafficking"
  30780. // ]
  30781. // }
  30782. }
  30783. // method id "dfareporting.languages.list":
  30784. type LanguagesListCall struct {
  30785. s *Service
  30786. profileId int64
  30787. urlParams_ gensupport.URLParams
  30788. ifNoneMatch_ string
  30789. ctx_ context.Context
  30790. header_ http.Header
  30791. }
  30792. // List: Retrieves a list of languages.
  30793. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  30794. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30795. c.profileId = profileId
  30796. return c
  30797. }
  30798. // Fields allows partial responses to be retrieved. See
  30799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30800. // for more information.
  30801. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  30802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30803. return c
  30804. }
  30805. // IfNoneMatch sets the optional parameter which makes the operation
  30806. // fail if the object's ETag matches the given value. This is useful for
  30807. // getting updates only after the object has changed since the last
  30808. // request. Use googleapi.IsNotModified to check whether the response
  30809. // error from Do is the result of In-None-Match.
  30810. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  30811. c.ifNoneMatch_ = entityTag
  30812. return c
  30813. }
  30814. // Context sets the context to be used in this call's Do method. Any
  30815. // pending HTTP request will be aborted if the provided context is
  30816. // canceled.
  30817. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  30818. c.ctx_ = ctx
  30819. return c
  30820. }
  30821. // Header returns an http.Header that can be modified by the caller to
  30822. // add HTTP headers to the request.
  30823. func (c *LanguagesListCall) Header() http.Header {
  30824. if c.header_ == nil {
  30825. c.header_ = make(http.Header)
  30826. }
  30827. return c.header_
  30828. }
  30829. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  30830. reqHeaders := make(http.Header)
  30831. for k, v := range c.header_ {
  30832. reqHeaders[k] = v
  30833. }
  30834. reqHeaders.Set("User-Agent", c.s.userAgent())
  30835. if c.ifNoneMatch_ != "" {
  30836. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30837. }
  30838. var body io.Reader = nil
  30839. c.urlParams_.Set("alt", alt)
  30840. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  30841. urls += "?" + c.urlParams_.Encode()
  30842. req, _ := http.NewRequest("GET", urls, body)
  30843. req.Header = reqHeaders
  30844. googleapi.Expand(req.URL, map[string]string{
  30845. "profileId": strconv.FormatInt(c.profileId, 10),
  30846. })
  30847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30848. }
  30849. // Do executes the "dfareporting.languages.list" call.
  30850. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  30851. // non-2xx status code is an error. Response headers are in either
  30852. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  30853. // returned at all) in error.(*googleapi.Error).Header. Use
  30854. // googleapi.IsNotModified to check whether the returned error was
  30855. // because http.StatusNotModified was returned.
  30856. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  30857. gensupport.SetOptions(c.urlParams_, opts...)
  30858. res, err := c.doRequest("json")
  30859. if res != nil && res.StatusCode == http.StatusNotModified {
  30860. if res.Body != nil {
  30861. res.Body.Close()
  30862. }
  30863. return nil, &googleapi.Error{
  30864. Code: res.StatusCode,
  30865. Header: res.Header,
  30866. }
  30867. }
  30868. if err != nil {
  30869. return nil, err
  30870. }
  30871. defer googleapi.CloseBody(res)
  30872. if err := googleapi.CheckResponse(res); err != nil {
  30873. return nil, err
  30874. }
  30875. ret := &LanguagesListResponse{
  30876. ServerResponse: googleapi.ServerResponse{
  30877. Header: res.Header,
  30878. HTTPStatusCode: res.StatusCode,
  30879. },
  30880. }
  30881. target := &ret
  30882. if err := gensupport.DecodeResponse(target, res); err != nil {
  30883. return nil, err
  30884. }
  30885. return ret, nil
  30886. // {
  30887. // "description": "Retrieves a list of languages.",
  30888. // "httpMethod": "GET",
  30889. // "id": "dfareporting.languages.list",
  30890. // "parameterOrder": [
  30891. // "profileId"
  30892. // ],
  30893. // "parameters": {
  30894. // "profileId": {
  30895. // "description": "User profile ID associated with this request.",
  30896. // "format": "int64",
  30897. // "location": "path",
  30898. // "required": true,
  30899. // "type": "string"
  30900. // }
  30901. // },
  30902. // "path": "userprofiles/{profileId}/languages",
  30903. // "response": {
  30904. // "$ref": "LanguagesListResponse"
  30905. // },
  30906. // "scopes": [
  30907. // "https://www.googleapis.com/auth/dfatrafficking"
  30908. // ]
  30909. // }
  30910. }
  30911. // method id "dfareporting.metros.list":
  30912. type MetrosListCall struct {
  30913. s *Service
  30914. profileId int64
  30915. urlParams_ gensupport.URLParams
  30916. ifNoneMatch_ string
  30917. ctx_ context.Context
  30918. header_ http.Header
  30919. }
  30920. // List: Retrieves a list of metros.
  30921. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  30922. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30923. c.profileId = profileId
  30924. return c
  30925. }
  30926. // Fields allows partial responses to be retrieved. See
  30927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30928. // for more information.
  30929. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  30930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30931. return c
  30932. }
  30933. // IfNoneMatch sets the optional parameter which makes the operation
  30934. // fail if the object's ETag matches the given value. This is useful for
  30935. // getting updates only after the object has changed since the last
  30936. // request. Use googleapi.IsNotModified to check whether the response
  30937. // error from Do is the result of In-None-Match.
  30938. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  30939. c.ifNoneMatch_ = entityTag
  30940. return c
  30941. }
  30942. // Context sets the context to be used in this call's Do method. Any
  30943. // pending HTTP request will be aborted if the provided context is
  30944. // canceled.
  30945. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  30946. c.ctx_ = ctx
  30947. return c
  30948. }
  30949. // Header returns an http.Header that can be modified by the caller to
  30950. // add HTTP headers to the request.
  30951. func (c *MetrosListCall) Header() http.Header {
  30952. if c.header_ == nil {
  30953. c.header_ = make(http.Header)
  30954. }
  30955. return c.header_
  30956. }
  30957. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  30958. reqHeaders := make(http.Header)
  30959. for k, v := range c.header_ {
  30960. reqHeaders[k] = v
  30961. }
  30962. reqHeaders.Set("User-Agent", c.s.userAgent())
  30963. if c.ifNoneMatch_ != "" {
  30964. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30965. }
  30966. var body io.Reader = nil
  30967. c.urlParams_.Set("alt", alt)
  30968. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  30969. urls += "?" + c.urlParams_.Encode()
  30970. req, _ := http.NewRequest("GET", urls, body)
  30971. req.Header = reqHeaders
  30972. googleapi.Expand(req.URL, map[string]string{
  30973. "profileId": strconv.FormatInt(c.profileId, 10),
  30974. })
  30975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30976. }
  30977. // Do executes the "dfareporting.metros.list" call.
  30978. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  30979. // non-2xx status code is an error. Response headers are in either
  30980. // *MetrosListResponse.ServerResponse.Header or (if a response was
  30981. // returned at all) in error.(*googleapi.Error).Header. Use
  30982. // googleapi.IsNotModified to check whether the returned error was
  30983. // because http.StatusNotModified was returned.
  30984. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  30985. gensupport.SetOptions(c.urlParams_, opts...)
  30986. res, err := c.doRequest("json")
  30987. if res != nil && res.StatusCode == http.StatusNotModified {
  30988. if res.Body != nil {
  30989. res.Body.Close()
  30990. }
  30991. return nil, &googleapi.Error{
  30992. Code: res.StatusCode,
  30993. Header: res.Header,
  30994. }
  30995. }
  30996. if err != nil {
  30997. return nil, err
  30998. }
  30999. defer googleapi.CloseBody(res)
  31000. if err := googleapi.CheckResponse(res); err != nil {
  31001. return nil, err
  31002. }
  31003. ret := &MetrosListResponse{
  31004. ServerResponse: googleapi.ServerResponse{
  31005. Header: res.Header,
  31006. HTTPStatusCode: res.StatusCode,
  31007. },
  31008. }
  31009. target := &ret
  31010. if err := gensupport.DecodeResponse(target, res); err != nil {
  31011. return nil, err
  31012. }
  31013. return ret, nil
  31014. // {
  31015. // "description": "Retrieves a list of metros.",
  31016. // "httpMethod": "GET",
  31017. // "id": "dfareporting.metros.list",
  31018. // "parameterOrder": [
  31019. // "profileId"
  31020. // ],
  31021. // "parameters": {
  31022. // "profileId": {
  31023. // "description": "User profile ID associated with this request.",
  31024. // "format": "int64",
  31025. // "location": "path",
  31026. // "required": true,
  31027. // "type": "string"
  31028. // }
  31029. // },
  31030. // "path": "userprofiles/{profileId}/metros",
  31031. // "response": {
  31032. // "$ref": "MetrosListResponse"
  31033. // },
  31034. // "scopes": [
  31035. // "https://www.googleapis.com/auth/dfatrafficking"
  31036. // ]
  31037. // }
  31038. }
  31039. // method id "dfareporting.mobileCarriers.get":
  31040. type MobileCarriersGetCall struct {
  31041. s *Service
  31042. profileId int64
  31043. id int64
  31044. urlParams_ gensupport.URLParams
  31045. ifNoneMatch_ string
  31046. ctx_ context.Context
  31047. header_ http.Header
  31048. }
  31049. // Get: Gets one mobile carrier by ID.
  31050. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  31051. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31052. c.profileId = profileId
  31053. c.id = id
  31054. return c
  31055. }
  31056. // Fields allows partial responses to be retrieved. See
  31057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31058. // for more information.
  31059. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  31060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31061. return c
  31062. }
  31063. // IfNoneMatch sets the optional parameter which makes the operation
  31064. // fail if the object's ETag matches the given value. This is useful for
  31065. // getting updates only after the object has changed since the last
  31066. // request. Use googleapi.IsNotModified to check whether the response
  31067. // error from Do is the result of In-None-Match.
  31068. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  31069. c.ifNoneMatch_ = entityTag
  31070. return c
  31071. }
  31072. // Context sets the context to be used in this call's Do method. Any
  31073. // pending HTTP request will be aborted if the provided context is
  31074. // canceled.
  31075. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  31076. c.ctx_ = ctx
  31077. return c
  31078. }
  31079. // Header returns an http.Header that can be modified by the caller to
  31080. // add HTTP headers to the request.
  31081. func (c *MobileCarriersGetCall) Header() http.Header {
  31082. if c.header_ == nil {
  31083. c.header_ = make(http.Header)
  31084. }
  31085. return c.header_
  31086. }
  31087. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  31088. reqHeaders := make(http.Header)
  31089. for k, v := range c.header_ {
  31090. reqHeaders[k] = v
  31091. }
  31092. reqHeaders.Set("User-Agent", c.s.userAgent())
  31093. if c.ifNoneMatch_ != "" {
  31094. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31095. }
  31096. var body io.Reader = nil
  31097. c.urlParams_.Set("alt", alt)
  31098. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  31099. urls += "?" + c.urlParams_.Encode()
  31100. req, _ := http.NewRequest("GET", urls, body)
  31101. req.Header = reqHeaders
  31102. googleapi.Expand(req.URL, map[string]string{
  31103. "profileId": strconv.FormatInt(c.profileId, 10),
  31104. "id": strconv.FormatInt(c.id, 10),
  31105. })
  31106. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31107. }
  31108. // Do executes the "dfareporting.mobileCarriers.get" call.
  31109. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  31110. // status code is an error. Response headers are in either
  31111. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  31112. // at all) in error.(*googleapi.Error).Header. Use
  31113. // googleapi.IsNotModified to check whether the returned error was
  31114. // because http.StatusNotModified was returned.
  31115. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  31116. gensupport.SetOptions(c.urlParams_, opts...)
  31117. res, err := c.doRequest("json")
  31118. if res != nil && res.StatusCode == http.StatusNotModified {
  31119. if res.Body != nil {
  31120. res.Body.Close()
  31121. }
  31122. return nil, &googleapi.Error{
  31123. Code: res.StatusCode,
  31124. Header: res.Header,
  31125. }
  31126. }
  31127. if err != nil {
  31128. return nil, err
  31129. }
  31130. defer googleapi.CloseBody(res)
  31131. if err := googleapi.CheckResponse(res); err != nil {
  31132. return nil, err
  31133. }
  31134. ret := &MobileCarrier{
  31135. ServerResponse: googleapi.ServerResponse{
  31136. Header: res.Header,
  31137. HTTPStatusCode: res.StatusCode,
  31138. },
  31139. }
  31140. target := &ret
  31141. if err := gensupport.DecodeResponse(target, res); err != nil {
  31142. return nil, err
  31143. }
  31144. return ret, nil
  31145. // {
  31146. // "description": "Gets one mobile carrier by ID.",
  31147. // "httpMethod": "GET",
  31148. // "id": "dfareporting.mobileCarriers.get",
  31149. // "parameterOrder": [
  31150. // "profileId",
  31151. // "id"
  31152. // ],
  31153. // "parameters": {
  31154. // "id": {
  31155. // "description": "Mobile carrier ID.",
  31156. // "format": "int64",
  31157. // "location": "path",
  31158. // "required": true,
  31159. // "type": "string"
  31160. // },
  31161. // "profileId": {
  31162. // "description": "User profile ID associated with this request.",
  31163. // "format": "int64",
  31164. // "location": "path",
  31165. // "required": true,
  31166. // "type": "string"
  31167. // }
  31168. // },
  31169. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  31170. // "response": {
  31171. // "$ref": "MobileCarrier"
  31172. // },
  31173. // "scopes": [
  31174. // "https://www.googleapis.com/auth/dfatrafficking"
  31175. // ]
  31176. // }
  31177. }
  31178. // method id "dfareporting.mobileCarriers.list":
  31179. type MobileCarriersListCall struct {
  31180. s *Service
  31181. profileId int64
  31182. urlParams_ gensupport.URLParams
  31183. ifNoneMatch_ string
  31184. ctx_ context.Context
  31185. header_ http.Header
  31186. }
  31187. // List: Retrieves a list of mobile carriers.
  31188. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  31189. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31190. c.profileId = profileId
  31191. return c
  31192. }
  31193. // Fields allows partial responses to be retrieved. See
  31194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31195. // for more information.
  31196. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  31197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31198. return c
  31199. }
  31200. // IfNoneMatch sets the optional parameter which makes the operation
  31201. // fail if the object's ETag matches the given value. This is useful for
  31202. // getting updates only after the object has changed since the last
  31203. // request. Use googleapi.IsNotModified to check whether the response
  31204. // error from Do is the result of In-None-Match.
  31205. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  31206. c.ifNoneMatch_ = entityTag
  31207. return c
  31208. }
  31209. // Context sets the context to be used in this call's Do method. Any
  31210. // pending HTTP request will be aborted if the provided context is
  31211. // canceled.
  31212. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  31213. c.ctx_ = ctx
  31214. return c
  31215. }
  31216. // Header returns an http.Header that can be modified by the caller to
  31217. // add HTTP headers to the request.
  31218. func (c *MobileCarriersListCall) Header() http.Header {
  31219. if c.header_ == nil {
  31220. c.header_ = make(http.Header)
  31221. }
  31222. return c.header_
  31223. }
  31224. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  31225. reqHeaders := make(http.Header)
  31226. for k, v := range c.header_ {
  31227. reqHeaders[k] = v
  31228. }
  31229. reqHeaders.Set("User-Agent", c.s.userAgent())
  31230. if c.ifNoneMatch_ != "" {
  31231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31232. }
  31233. var body io.Reader = nil
  31234. c.urlParams_.Set("alt", alt)
  31235. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  31236. urls += "?" + c.urlParams_.Encode()
  31237. req, _ := http.NewRequest("GET", urls, body)
  31238. req.Header = reqHeaders
  31239. googleapi.Expand(req.URL, map[string]string{
  31240. "profileId": strconv.FormatInt(c.profileId, 10),
  31241. })
  31242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31243. }
  31244. // Do executes the "dfareporting.mobileCarriers.list" call.
  31245. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  31246. // Any non-2xx status code is an error. Response headers are in either
  31247. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  31248. // was returned at all) in error.(*googleapi.Error).Header. Use
  31249. // googleapi.IsNotModified to check whether the returned error was
  31250. // because http.StatusNotModified was returned.
  31251. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  31252. gensupport.SetOptions(c.urlParams_, opts...)
  31253. res, err := c.doRequest("json")
  31254. if res != nil && res.StatusCode == http.StatusNotModified {
  31255. if res.Body != nil {
  31256. res.Body.Close()
  31257. }
  31258. return nil, &googleapi.Error{
  31259. Code: res.StatusCode,
  31260. Header: res.Header,
  31261. }
  31262. }
  31263. if err != nil {
  31264. return nil, err
  31265. }
  31266. defer googleapi.CloseBody(res)
  31267. if err := googleapi.CheckResponse(res); err != nil {
  31268. return nil, err
  31269. }
  31270. ret := &MobileCarriersListResponse{
  31271. ServerResponse: googleapi.ServerResponse{
  31272. Header: res.Header,
  31273. HTTPStatusCode: res.StatusCode,
  31274. },
  31275. }
  31276. target := &ret
  31277. if err := gensupport.DecodeResponse(target, res); err != nil {
  31278. return nil, err
  31279. }
  31280. return ret, nil
  31281. // {
  31282. // "description": "Retrieves a list of mobile carriers.",
  31283. // "httpMethod": "GET",
  31284. // "id": "dfareporting.mobileCarriers.list",
  31285. // "parameterOrder": [
  31286. // "profileId"
  31287. // ],
  31288. // "parameters": {
  31289. // "profileId": {
  31290. // "description": "User profile ID associated with this request.",
  31291. // "format": "int64",
  31292. // "location": "path",
  31293. // "required": true,
  31294. // "type": "string"
  31295. // }
  31296. // },
  31297. // "path": "userprofiles/{profileId}/mobileCarriers",
  31298. // "response": {
  31299. // "$ref": "MobileCarriersListResponse"
  31300. // },
  31301. // "scopes": [
  31302. // "https://www.googleapis.com/auth/dfatrafficking"
  31303. // ]
  31304. // }
  31305. }
  31306. // method id "dfareporting.operatingSystemVersions.get":
  31307. type OperatingSystemVersionsGetCall struct {
  31308. s *Service
  31309. profileId int64
  31310. id int64
  31311. urlParams_ gensupport.URLParams
  31312. ifNoneMatch_ string
  31313. ctx_ context.Context
  31314. header_ http.Header
  31315. }
  31316. // Get: Gets one operating system version by ID.
  31317. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  31318. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31319. c.profileId = profileId
  31320. c.id = id
  31321. return c
  31322. }
  31323. // Fields allows partial responses to be retrieved. See
  31324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31325. // for more information.
  31326. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  31327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31328. return c
  31329. }
  31330. // IfNoneMatch sets the optional parameter which makes the operation
  31331. // fail if the object's ETag matches the given value. This is useful for
  31332. // getting updates only after the object has changed since the last
  31333. // request. Use googleapi.IsNotModified to check whether the response
  31334. // error from Do is the result of In-None-Match.
  31335. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  31336. c.ifNoneMatch_ = entityTag
  31337. return c
  31338. }
  31339. // Context sets the context to be used in this call's Do method. Any
  31340. // pending HTTP request will be aborted if the provided context is
  31341. // canceled.
  31342. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  31343. c.ctx_ = ctx
  31344. return c
  31345. }
  31346. // Header returns an http.Header that can be modified by the caller to
  31347. // add HTTP headers to the request.
  31348. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  31349. if c.header_ == nil {
  31350. c.header_ = make(http.Header)
  31351. }
  31352. return c.header_
  31353. }
  31354. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  31355. reqHeaders := make(http.Header)
  31356. for k, v := range c.header_ {
  31357. reqHeaders[k] = v
  31358. }
  31359. reqHeaders.Set("User-Agent", c.s.userAgent())
  31360. if c.ifNoneMatch_ != "" {
  31361. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31362. }
  31363. var body io.Reader = nil
  31364. c.urlParams_.Set("alt", alt)
  31365. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  31366. urls += "?" + c.urlParams_.Encode()
  31367. req, _ := http.NewRequest("GET", urls, body)
  31368. req.Header = reqHeaders
  31369. googleapi.Expand(req.URL, map[string]string{
  31370. "profileId": strconv.FormatInt(c.profileId, 10),
  31371. "id": strconv.FormatInt(c.id, 10),
  31372. })
  31373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31374. }
  31375. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  31376. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  31377. // non-2xx status code is an error. Response headers are in either
  31378. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  31379. // returned at all) in error.(*googleapi.Error).Header. Use
  31380. // googleapi.IsNotModified to check whether the returned error was
  31381. // because http.StatusNotModified was returned.
  31382. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  31383. gensupport.SetOptions(c.urlParams_, opts...)
  31384. res, err := c.doRequest("json")
  31385. if res != nil && res.StatusCode == http.StatusNotModified {
  31386. if res.Body != nil {
  31387. res.Body.Close()
  31388. }
  31389. return nil, &googleapi.Error{
  31390. Code: res.StatusCode,
  31391. Header: res.Header,
  31392. }
  31393. }
  31394. if err != nil {
  31395. return nil, err
  31396. }
  31397. defer googleapi.CloseBody(res)
  31398. if err := googleapi.CheckResponse(res); err != nil {
  31399. return nil, err
  31400. }
  31401. ret := &OperatingSystemVersion{
  31402. ServerResponse: googleapi.ServerResponse{
  31403. Header: res.Header,
  31404. HTTPStatusCode: res.StatusCode,
  31405. },
  31406. }
  31407. target := &ret
  31408. if err := gensupport.DecodeResponse(target, res); err != nil {
  31409. return nil, err
  31410. }
  31411. return ret, nil
  31412. // {
  31413. // "description": "Gets one operating system version by ID.",
  31414. // "httpMethod": "GET",
  31415. // "id": "dfareporting.operatingSystemVersions.get",
  31416. // "parameterOrder": [
  31417. // "profileId",
  31418. // "id"
  31419. // ],
  31420. // "parameters": {
  31421. // "id": {
  31422. // "description": "Operating system version ID.",
  31423. // "format": "int64",
  31424. // "location": "path",
  31425. // "required": true,
  31426. // "type": "string"
  31427. // },
  31428. // "profileId": {
  31429. // "description": "User profile ID associated with this request.",
  31430. // "format": "int64",
  31431. // "location": "path",
  31432. // "required": true,
  31433. // "type": "string"
  31434. // }
  31435. // },
  31436. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  31437. // "response": {
  31438. // "$ref": "OperatingSystemVersion"
  31439. // },
  31440. // "scopes": [
  31441. // "https://www.googleapis.com/auth/dfatrafficking"
  31442. // ]
  31443. // }
  31444. }
  31445. // method id "dfareporting.operatingSystemVersions.list":
  31446. type OperatingSystemVersionsListCall struct {
  31447. s *Service
  31448. profileId int64
  31449. urlParams_ gensupport.URLParams
  31450. ifNoneMatch_ string
  31451. ctx_ context.Context
  31452. header_ http.Header
  31453. }
  31454. // List: Retrieves a list of operating system versions.
  31455. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  31456. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31457. c.profileId = profileId
  31458. return c
  31459. }
  31460. // Fields allows partial responses to be retrieved. See
  31461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31462. // for more information.
  31463. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  31464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31465. return c
  31466. }
  31467. // IfNoneMatch sets the optional parameter which makes the operation
  31468. // fail if the object's ETag matches the given value. This is useful for
  31469. // getting updates only after the object has changed since the last
  31470. // request. Use googleapi.IsNotModified to check whether the response
  31471. // error from Do is the result of In-None-Match.
  31472. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  31473. c.ifNoneMatch_ = entityTag
  31474. return c
  31475. }
  31476. // Context sets the context to be used in this call's Do method. Any
  31477. // pending HTTP request will be aborted if the provided context is
  31478. // canceled.
  31479. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  31480. c.ctx_ = ctx
  31481. return c
  31482. }
  31483. // Header returns an http.Header that can be modified by the caller to
  31484. // add HTTP headers to the request.
  31485. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  31486. if c.header_ == nil {
  31487. c.header_ = make(http.Header)
  31488. }
  31489. return c.header_
  31490. }
  31491. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  31492. reqHeaders := make(http.Header)
  31493. for k, v := range c.header_ {
  31494. reqHeaders[k] = v
  31495. }
  31496. reqHeaders.Set("User-Agent", c.s.userAgent())
  31497. if c.ifNoneMatch_ != "" {
  31498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31499. }
  31500. var body io.Reader = nil
  31501. c.urlParams_.Set("alt", alt)
  31502. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  31503. urls += "?" + c.urlParams_.Encode()
  31504. req, _ := http.NewRequest("GET", urls, body)
  31505. req.Header = reqHeaders
  31506. googleapi.Expand(req.URL, map[string]string{
  31507. "profileId": strconv.FormatInt(c.profileId, 10),
  31508. })
  31509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31510. }
  31511. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  31512. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  31513. // non-nil. Any non-2xx status code is an error. Response headers are in
  31514. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  31515. // (if a response was returned at all) in
  31516. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  31517. // whether the returned error was because http.StatusNotModified was
  31518. // returned.
  31519. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  31520. gensupport.SetOptions(c.urlParams_, opts...)
  31521. res, err := c.doRequest("json")
  31522. if res != nil && res.StatusCode == http.StatusNotModified {
  31523. if res.Body != nil {
  31524. res.Body.Close()
  31525. }
  31526. return nil, &googleapi.Error{
  31527. Code: res.StatusCode,
  31528. Header: res.Header,
  31529. }
  31530. }
  31531. if err != nil {
  31532. return nil, err
  31533. }
  31534. defer googleapi.CloseBody(res)
  31535. if err := googleapi.CheckResponse(res); err != nil {
  31536. return nil, err
  31537. }
  31538. ret := &OperatingSystemVersionsListResponse{
  31539. ServerResponse: googleapi.ServerResponse{
  31540. Header: res.Header,
  31541. HTTPStatusCode: res.StatusCode,
  31542. },
  31543. }
  31544. target := &ret
  31545. if err := gensupport.DecodeResponse(target, res); err != nil {
  31546. return nil, err
  31547. }
  31548. return ret, nil
  31549. // {
  31550. // "description": "Retrieves a list of operating system versions.",
  31551. // "httpMethod": "GET",
  31552. // "id": "dfareporting.operatingSystemVersions.list",
  31553. // "parameterOrder": [
  31554. // "profileId"
  31555. // ],
  31556. // "parameters": {
  31557. // "profileId": {
  31558. // "description": "User profile ID associated with this request.",
  31559. // "format": "int64",
  31560. // "location": "path",
  31561. // "required": true,
  31562. // "type": "string"
  31563. // }
  31564. // },
  31565. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  31566. // "response": {
  31567. // "$ref": "OperatingSystemVersionsListResponse"
  31568. // },
  31569. // "scopes": [
  31570. // "https://www.googleapis.com/auth/dfatrafficking"
  31571. // ]
  31572. // }
  31573. }
  31574. // method id "dfareporting.operatingSystems.get":
  31575. type OperatingSystemsGetCall struct {
  31576. s *Service
  31577. profileId int64
  31578. dartId int64
  31579. urlParams_ gensupport.URLParams
  31580. ifNoneMatch_ string
  31581. ctx_ context.Context
  31582. header_ http.Header
  31583. }
  31584. // Get: Gets one operating system by DART ID.
  31585. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  31586. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31587. c.profileId = profileId
  31588. c.dartId = dartId
  31589. return c
  31590. }
  31591. // Fields allows partial responses to be retrieved. See
  31592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31593. // for more information.
  31594. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  31595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31596. return c
  31597. }
  31598. // IfNoneMatch sets the optional parameter which makes the operation
  31599. // fail if the object's ETag matches the given value. This is useful for
  31600. // getting updates only after the object has changed since the last
  31601. // request. Use googleapi.IsNotModified to check whether the response
  31602. // error from Do is the result of In-None-Match.
  31603. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  31604. c.ifNoneMatch_ = entityTag
  31605. return c
  31606. }
  31607. // Context sets the context to be used in this call's Do method. Any
  31608. // pending HTTP request will be aborted if the provided context is
  31609. // canceled.
  31610. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  31611. c.ctx_ = ctx
  31612. return c
  31613. }
  31614. // Header returns an http.Header that can be modified by the caller to
  31615. // add HTTP headers to the request.
  31616. func (c *OperatingSystemsGetCall) Header() http.Header {
  31617. if c.header_ == nil {
  31618. c.header_ = make(http.Header)
  31619. }
  31620. return c.header_
  31621. }
  31622. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  31623. reqHeaders := make(http.Header)
  31624. for k, v := range c.header_ {
  31625. reqHeaders[k] = v
  31626. }
  31627. reqHeaders.Set("User-Agent", c.s.userAgent())
  31628. if c.ifNoneMatch_ != "" {
  31629. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31630. }
  31631. var body io.Reader = nil
  31632. c.urlParams_.Set("alt", alt)
  31633. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  31634. urls += "?" + c.urlParams_.Encode()
  31635. req, _ := http.NewRequest("GET", urls, body)
  31636. req.Header = reqHeaders
  31637. googleapi.Expand(req.URL, map[string]string{
  31638. "profileId": strconv.FormatInt(c.profileId, 10),
  31639. "dartId": strconv.FormatInt(c.dartId, 10),
  31640. })
  31641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31642. }
  31643. // Do executes the "dfareporting.operatingSystems.get" call.
  31644. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  31645. // status code is an error. Response headers are in either
  31646. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  31647. // at all) in error.(*googleapi.Error).Header. Use
  31648. // googleapi.IsNotModified to check whether the returned error was
  31649. // because http.StatusNotModified was returned.
  31650. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  31651. gensupport.SetOptions(c.urlParams_, opts...)
  31652. res, err := c.doRequest("json")
  31653. if res != nil && res.StatusCode == http.StatusNotModified {
  31654. if res.Body != nil {
  31655. res.Body.Close()
  31656. }
  31657. return nil, &googleapi.Error{
  31658. Code: res.StatusCode,
  31659. Header: res.Header,
  31660. }
  31661. }
  31662. if err != nil {
  31663. return nil, err
  31664. }
  31665. defer googleapi.CloseBody(res)
  31666. if err := googleapi.CheckResponse(res); err != nil {
  31667. return nil, err
  31668. }
  31669. ret := &OperatingSystem{
  31670. ServerResponse: googleapi.ServerResponse{
  31671. Header: res.Header,
  31672. HTTPStatusCode: res.StatusCode,
  31673. },
  31674. }
  31675. target := &ret
  31676. if err := gensupport.DecodeResponse(target, res); err != nil {
  31677. return nil, err
  31678. }
  31679. return ret, nil
  31680. // {
  31681. // "description": "Gets one operating system by DART ID.",
  31682. // "httpMethod": "GET",
  31683. // "id": "dfareporting.operatingSystems.get",
  31684. // "parameterOrder": [
  31685. // "profileId",
  31686. // "dartId"
  31687. // ],
  31688. // "parameters": {
  31689. // "dartId": {
  31690. // "description": "Operating system DART ID.",
  31691. // "format": "int64",
  31692. // "location": "path",
  31693. // "required": true,
  31694. // "type": "string"
  31695. // },
  31696. // "profileId": {
  31697. // "description": "User profile ID associated with this request.",
  31698. // "format": "int64",
  31699. // "location": "path",
  31700. // "required": true,
  31701. // "type": "string"
  31702. // }
  31703. // },
  31704. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  31705. // "response": {
  31706. // "$ref": "OperatingSystem"
  31707. // },
  31708. // "scopes": [
  31709. // "https://www.googleapis.com/auth/dfatrafficking"
  31710. // ]
  31711. // }
  31712. }
  31713. // method id "dfareporting.operatingSystems.list":
  31714. type OperatingSystemsListCall struct {
  31715. s *Service
  31716. profileId int64
  31717. urlParams_ gensupport.URLParams
  31718. ifNoneMatch_ string
  31719. ctx_ context.Context
  31720. header_ http.Header
  31721. }
  31722. // List: Retrieves a list of operating systems.
  31723. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  31724. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31725. c.profileId = profileId
  31726. return c
  31727. }
  31728. // Fields allows partial responses to be retrieved. See
  31729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31730. // for more information.
  31731. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  31732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31733. return c
  31734. }
  31735. // IfNoneMatch sets the optional parameter which makes the operation
  31736. // fail if the object's ETag matches the given value. This is useful for
  31737. // getting updates only after the object has changed since the last
  31738. // request. Use googleapi.IsNotModified to check whether the response
  31739. // error from Do is the result of In-None-Match.
  31740. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  31741. c.ifNoneMatch_ = entityTag
  31742. return c
  31743. }
  31744. // Context sets the context to be used in this call's Do method. Any
  31745. // pending HTTP request will be aborted if the provided context is
  31746. // canceled.
  31747. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  31748. c.ctx_ = ctx
  31749. return c
  31750. }
  31751. // Header returns an http.Header that can be modified by the caller to
  31752. // add HTTP headers to the request.
  31753. func (c *OperatingSystemsListCall) Header() http.Header {
  31754. if c.header_ == nil {
  31755. c.header_ = make(http.Header)
  31756. }
  31757. return c.header_
  31758. }
  31759. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  31760. reqHeaders := make(http.Header)
  31761. for k, v := range c.header_ {
  31762. reqHeaders[k] = v
  31763. }
  31764. reqHeaders.Set("User-Agent", c.s.userAgent())
  31765. if c.ifNoneMatch_ != "" {
  31766. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31767. }
  31768. var body io.Reader = nil
  31769. c.urlParams_.Set("alt", alt)
  31770. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  31771. urls += "?" + c.urlParams_.Encode()
  31772. req, _ := http.NewRequest("GET", urls, body)
  31773. req.Header = reqHeaders
  31774. googleapi.Expand(req.URL, map[string]string{
  31775. "profileId": strconv.FormatInt(c.profileId, 10),
  31776. })
  31777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31778. }
  31779. // Do executes the "dfareporting.operatingSystems.list" call.
  31780. // Exactly one of *OperatingSystemsListResponse or error will be
  31781. // non-nil. Any non-2xx status code is an error. Response headers are in
  31782. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  31783. // response was returned at all) in error.(*googleapi.Error).Header. Use
  31784. // googleapi.IsNotModified to check whether the returned error was
  31785. // because http.StatusNotModified was returned.
  31786. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  31787. gensupport.SetOptions(c.urlParams_, opts...)
  31788. res, err := c.doRequest("json")
  31789. if res != nil && res.StatusCode == http.StatusNotModified {
  31790. if res.Body != nil {
  31791. res.Body.Close()
  31792. }
  31793. return nil, &googleapi.Error{
  31794. Code: res.StatusCode,
  31795. Header: res.Header,
  31796. }
  31797. }
  31798. if err != nil {
  31799. return nil, err
  31800. }
  31801. defer googleapi.CloseBody(res)
  31802. if err := googleapi.CheckResponse(res); err != nil {
  31803. return nil, err
  31804. }
  31805. ret := &OperatingSystemsListResponse{
  31806. ServerResponse: googleapi.ServerResponse{
  31807. Header: res.Header,
  31808. HTTPStatusCode: res.StatusCode,
  31809. },
  31810. }
  31811. target := &ret
  31812. if err := gensupport.DecodeResponse(target, res); err != nil {
  31813. return nil, err
  31814. }
  31815. return ret, nil
  31816. // {
  31817. // "description": "Retrieves a list of operating systems.",
  31818. // "httpMethod": "GET",
  31819. // "id": "dfareporting.operatingSystems.list",
  31820. // "parameterOrder": [
  31821. // "profileId"
  31822. // ],
  31823. // "parameters": {
  31824. // "profileId": {
  31825. // "description": "User profile ID associated with this request.",
  31826. // "format": "int64",
  31827. // "location": "path",
  31828. // "required": true,
  31829. // "type": "string"
  31830. // }
  31831. // },
  31832. // "path": "userprofiles/{profileId}/operatingSystems",
  31833. // "response": {
  31834. // "$ref": "OperatingSystemsListResponse"
  31835. // },
  31836. // "scopes": [
  31837. // "https://www.googleapis.com/auth/dfatrafficking"
  31838. // ]
  31839. // }
  31840. }
  31841. // method id "dfareporting.orderDocuments.get":
  31842. type OrderDocumentsGetCall struct {
  31843. s *Service
  31844. profileId int64
  31845. projectId int64
  31846. id int64
  31847. urlParams_ gensupport.URLParams
  31848. ifNoneMatch_ string
  31849. ctx_ context.Context
  31850. header_ http.Header
  31851. }
  31852. // Get: Gets one order document by ID.
  31853. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  31854. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31855. c.profileId = profileId
  31856. c.projectId = projectId
  31857. c.id = id
  31858. return c
  31859. }
  31860. // Fields allows partial responses to be retrieved. See
  31861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31862. // for more information.
  31863. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  31864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31865. return c
  31866. }
  31867. // IfNoneMatch sets the optional parameter which makes the operation
  31868. // fail if the object's ETag matches the given value. This is useful for
  31869. // getting updates only after the object has changed since the last
  31870. // request. Use googleapi.IsNotModified to check whether the response
  31871. // error from Do is the result of In-None-Match.
  31872. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  31873. c.ifNoneMatch_ = entityTag
  31874. return c
  31875. }
  31876. // Context sets the context to be used in this call's Do method. Any
  31877. // pending HTTP request will be aborted if the provided context is
  31878. // canceled.
  31879. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  31880. c.ctx_ = ctx
  31881. return c
  31882. }
  31883. // Header returns an http.Header that can be modified by the caller to
  31884. // add HTTP headers to the request.
  31885. func (c *OrderDocumentsGetCall) Header() http.Header {
  31886. if c.header_ == nil {
  31887. c.header_ = make(http.Header)
  31888. }
  31889. return c.header_
  31890. }
  31891. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  31892. reqHeaders := make(http.Header)
  31893. for k, v := range c.header_ {
  31894. reqHeaders[k] = v
  31895. }
  31896. reqHeaders.Set("User-Agent", c.s.userAgent())
  31897. if c.ifNoneMatch_ != "" {
  31898. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31899. }
  31900. var body io.Reader = nil
  31901. c.urlParams_.Set("alt", alt)
  31902. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  31903. urls += "?" + c.urlParams_.Encode()
  31904. req, _ := http.NewRequest("GET", urls, body)
  31905. req.Header = reqHeaders
  31906. googleapi.Expand(req.URL, map[string]string{
  31907. "profileId": strconv.FormatInt(c.profileId, 10),
  31908. "projectId": strconv.FormatInt(c.projectId, 10),
  31909. "id": strconv.FormatInt(c.id, 10),
  31910. })
  31911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31912. }
  31913. // Do executes the "dfareporting.orderDocuments.get" call.
  31914. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  31915. // status code is an error. Response headers are in either
  31916. // *OrderDocument.ServerResponse.Header or (if a response was returned
  31917. // at all) in error.(*googleapi.Error).Header. Use
  31918. // googleapi.IsNotModified to check whether the returned error was
  31919. // because http.StatusNotModified was returned.
  31920. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  31921. gensupport.SetOptions(c.urlParams_, opts...)
  31922. res, err := c.doRequest("json")
  31923. if res != nil && res.StatusCode == http.StatusNotModified {
  31924. if res.Body != nil {
  31925. res.Body.Close()
  31926. }
  31927. return nil, &googleapi.Error{
  31928. Code: res.StatusCode,
  31929. Header: res.Header,
  31930. }
  31931. }
  31932. if err != nil {
  31933. return nil, err
  31934. }
  31935. defer googleapi.CloseBody(res)
  31936. if err := googleapi.CheckResponse(res); err != nil {
  31937. return nil, err
  31938. }
  31939. ret := &OrderDocument{
  31940. ServerResponse: googleapi.ServerResponse{
  31941. Header: res.Header,
  31942. HTTPStatusCode: res.StatusCode,
  31943. },
  31944. }
  31945. target := &ret
  31946. if err := gensupport.DecodeResponse(target, res); err != nil {
  31947. return nil, err
  31948. }
  31949. return ret, nil
  31950. // {
  31951. // "description": "Gets one order document by ID.",
  31952. // "httpMethod": "GET",
  31953. // "id": "dfareporting.orderDocuments.get",
  31954. // "parameterOrder": [
  31955. // "profileId",
  31956. // "projectId",
  31957. // "id"
  31958. // ],
  31959. // "parameters": {
  31960. // "id": {
  31961. // "description": "Order document ID.",
  31962. // "format": "int64",
  31963. // "location": "path",
  31964. // "required": true,
  31965. // "type": "string"
  31966. // },
  31967. // "profileId": {
  31968. // "description": "User profile ID associated with this request.",
  31969. // "format": "int64",
  31970. // "location": "path",
  31971. // "required": true,
  31972. // "type": "string"
  31973. // },
  31974. // "projectId": {
  31975. // "description": "Project ID for order documents.",
  31976. // "format": "int64",
  31977. // "location": "path",
  31978. // "required": true,
  31979. // "type": "string"
  31980. // }
  31981. // },
  31982. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  31983. // "response": {
  31984. // "$ref": "OrderDocument"
  31985. // },
  31986. // "scopes": [
  31987. // "https://www.googleapis.com/auth/dfatrafficking"
  31988. // ]
  31989. // }
  31990. }
  31991. // method id "dfareporting.orderDocuments.list":
  31992. type OrderDocumentsListCall struct {
  31993. s *Service
  31994. profileId int64
  31995. projectId int64
  31996. urlParams_ gensupport.URLParams
  31997. ifNoneMatch_ string
  31998. ctx_ context.Context
  31999. header_ http.Header
  32000. }
  32001. // List: Retrieves a list of order documents, possibly filtered. This
  32002. // method supports paging.
  32003. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  32004. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32005. c.profileId = profileId
  32006. c.projectId = projectId
  32007. return c
  32008. }
  32009. // Approved sets the optional parameter "approved": Select only order
  32010. // documents that have been approved by at least one user.
  32011. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  32012. c.urlParams_.Set("approved", fmt.Sprint(approved))
  32013. return c
  32014. }
  32015. // Ids sets the optional parameter "ids": Select only order documents
  32016. // with these IDs.
  32017. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  32018. var ids_ []string
  32019. for _, v := range ids {
  32020. ids_ = append(ids_, fmt.Sprint(v))
  32021. }
  32022. c.urlParams_.SetMulti("ids", ids_)
  32023. return c
  32024. }
  32025. // MaxResults sets the optional parameter "maxResults": Maximum number
  32026. // of results to return.
  32027. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  32028. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32029. return c
  32030. }
  32031. // OrderId sets the optional parameter "orderId": Select only order
  32032. // documents for specified orders.
  32033. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  32034. var orderId_ []string
  32035. for _, v := range orderId {
  32036. orderId_ = append(orderId_, fmt.Sprint(v))
  32037. }
  32038. c.urlParams_.SetMulti("orderId", orderId_)
  32039. return c
  32040. }
  32041. // PageToken sets the optional parameter "pageToken": Value of the
  32042. // nextPageToken from the previous result page.
  32043. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  32044. c.urlParams_.Set("pageToken", pageToken)
  32045. return c
  32046. }
  32047. // SearchString sets the optional parameter "searchString": Allows
  32048. // searching for order documents by name or ID. Wildcards (*) are
  32049. // allowed. For example, "orderdocument*2015" will return order
  32050. // documents with names like "orderdocument June 2015", "orderdocument
  32051. // April 2015", or simply "orderdocument 2015". Most of the searches
  32052. // also add wildcards implicitly at the start and the end of the search
  32053. // string. For example, a search string of "orderdocument" will match
  32054. // order documents with name "my orderdocument", "orderdocument 2015",
  32055. // or simply "orderdocument".
  32056. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  32057. c.urlParams_.Set("searchString", searchString)
  32058. return c
  32059. }
  32060. // SiteId sets the optional parameter "siteId": Select only order
  32061. // documents that are associated with these sites.
  32062. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  32063. var siteId_ []string
  32064. for _, v := range siteId {
  32065. siteId_ = append(siteId_, fmt.Sprint(v))
  32066. }
  32067. c.urlParams_.SetMulti("siteId", siteId_)
  32068. return c
  32069. }
  32070. // SortField sets the optional parameter "sortField": Field by which to
  32071. // sort the list.
  32072. //
  32073. // Possible values:
  32074. // "ID" (default)
  32075. // "NAME"
  32076. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  32077. c.urlParams_.Set("sortField", sortField)
  32078. return c
  32079. }
  32080. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32081. // results.
  32082. //
  32083. // Possible values:
  32084. // "ASCENDING" (default)
  32085. // "DESCENDING"
  32086. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  32087. c.urlParams_.Set("sortOrder", sortOrder)
  32088. return c
  32089. }
  32090. // Fields allows partial responses to be retrieved. See
  32091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32092. // for more information.
  32093. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  32094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32095. return c
  32096. }
  32097. // IfNoneMatch sets the optional parameter which makes the operation
  32098. // fail if the object's ETag matches the given value. This is useful for
  32099. // getting updates only after the object has changed since the last
  32100. // request. Use googleapi.IsNotModified to check whether the response
  32101. // error from Do is the result of In-None-Match.
  32102. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  32103. c.ifNoneMatch_ = entityTag
  32104. return c
  32105. }
  32106. // Context sets the context to be used in this call's Do method. Any
  32107. // pending HTTP request will be aborted if the provided context is
  32108. // canceled.
  32109. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  32110. c.ctx_ = ctx
  32111. return c
  32112. }
  32113. // Header returns an http.Header that can be modified by the caller to
  32114. // add HTTP headers to the request.
  32115. func (c *OrderDocumentsListCall) Header() http.Header {
  32116. if c.header_ == nil {
  32117. c.header_ = make(http.Header)
  32118. }
  32119. return c.header_
  32120. }
  32121. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  32122. reqHeaders := make(http.Header)
  32123. for k, v := range c.header_ {
  32124. reqHeaders[k] = v
  32125. }
  32126. reqHeaders.Set("User-Agent", c.s.userAgent())
  32127. if c.ifNoneMatch_ != "" {
  32128. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32129. }
  32130. var body io.Reader = nil
  32131. c.urlParams_.Set("alt", alt)
  32132. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  32133. urls += "?" + c.urlParams_.Encode()
  32134. req, _ := http.NewRequest("GET", urls, body)
  32135. req.Header = reqHeaders
  32136. googleapi.Expand(req.URL, map[string]string{
  32137. "profileId": strconv.FormatInt(c.profileId, 10),
  32138. "projectId": strconv.FormatInt(c.projectId, 10),
  32139. })
  32140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32141. }
  32142. // Do executes the "dfareporting.orderDocuments.list" call.
  32143. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  32144. // Any non-2xx status code is an error. Response headers are in either
  32145. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  32146. // was returned at all) in error.(*googleapi.Error).Header. Use
  32147. // googleapi.IsNotModified to check whether the returned error was
  32148. // because http.StatusNotModified was returned.
  32149. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  32150. gensupport.SetOptions(c.urlParams_, opts...)
  32151. res, err := c.doRequest("json")
  32152. if res != nil && res.StatusCode == http.StatusNotModified {
  32153. if res.Body != nil {
  32154. res.Body.Close()
  32155. }
  32156. return nil, &googleapi.Error{
  32157. Code: res.StatusCode,
  32158. Header: res.Header,
  32159. }
  32160. }
  32161. if err != nil {
  32162. return nil, err
  32163. }
  32164. defer googleapi.CloseBody(res)
  32165. if err := googleapi.CheckResponse(res); err != nil {
  32166. return nil, err
  32167. }
  32168. ret := &OrderDocumentsListResponse{
  32169. ServerResponse: googleapi.ServerResponse{
  32170. Header: res.Header,
  32171. HTTPStatusCode: res.StatusCode,
  32172. },
  32173. }
  32174. target := &ret
  32175. if err := gensupport.DecodeResponse(target, res); err != nil {
  32176. return nil, err
  32177. }
  32178. return ret, nil
  32179. // {
  32180. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  32181. // "httpMethod": "GET",
  32182. // "id": "dfareporting.orderDocuments.list",
  32183. // "parameterOrder": [
  32184. // "profileId",
  32185. // "projectId"
  32186. // ],
  32187. // "parameters": {
  32188. // "approved": {
  32189. // "description": "Select only order documents that have been approved by at least one user.",
  32190. // "location": "query",
  32191. // "type": "boolean"
  32192. // },
  32193. // "ids": {
  32194. // "description": "Select only order documents with these IDs.",
  32195. // "format": "int64",
  32196. // "location": "query",
  32197. // "repeated": true,
  32198. // "type": "string"
  32199. // },
  32200. // "maxResults": {
  32201. // "default": "1000",
  32202. // "description": "Maximum number of results to return.",
  32203. // "format": "int32",
  32204. // "location": "query",
  32205. // "maximum": "1000",
  32206. // "minimum": "0",
  32207. // "type": "integer"
  32208. // },
  32209. // "orderId": {
  32210. // "description": "Select only order documents for specified orders.",
  32211. // "format": "int64",
  32212. // "location": "query",
  32213. // "repeated": true,
  32214. // "type": "string"
  32215. // },
  32216. // "pageToken": {
  32217. // "description": "Value of the nextPageToken from the previous result page.",
  32218. // "location": "query",
  32219. // "type": "string"
  32220. // },
  32221. // "profileId": {
  32222. // "description": "User profile ID associated with this request.",
  32223. // "format": "int64",
  32224. // "location": "path",
  32225. // "required": true,
  32226. // "type": "string"
  32227. // },
  32228. // "projectId": {
  32229. // "description": "Project ID for order documents.",
  32230. // "format": "int64",
  32231. // "location": "path",
  32232. // "required": true,
  32233. // "type": "string"
  32234. // },
  32235. // "searchString": {
  32236. // "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\".",
  32237. // "location": "query",
  32238. // "type": "string"
  32239. // },
  32240. // "siteId": {
  32241. // "description": "Select only order documents that are associated with these sites.",
  32242. // "format": "int64",
  32243. // "location": "query",
  32244. // "repeated": true,
  32245. // "type": "string"
  32246. // },
  32247. // "sortField": {
  32248. // "default": "ID",
  32249. // "description": "Field by which to sort the list.",
  32250. // "enum": [
  32251. // "ID",
  32252. // "NAME"
  32253. // ],
  32254. // "enumDescriptions": [
  32255. // "",
  32256. // ""
  32257. // ],
  32258. // "location": "query",
  32259. // "type": "string"
  32260. // },
  32261. // "sortOrder": {
  32262. // "default": "ASCENDING",
  32263. // "description": "Order of sorted results.",
  32264. // "enum": [
  32265. // "ASCENDING",
  32266. // "DESCENDING"
  32267. // ],
  32268. // "enumDescriptions": [
  32269. // "",
  32270. // ""
  32271. // ],
  32272. // "location": "query",
  32273. // "type": "string"
  32274. // }
  32275. // },
  32276. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  32277. // "response": {
  32278. // "$ref": "OrderDocumentsListResponse"
  32279. // },
  32280. // "scopes": [
  32281. // "https://www.googleapis.com/auth/dfatrafficking"
  32282. // ]
  32283. // }
  32284. }
  32285. // Pages invokes f for each page of results.
  32286. // A non-nil error returned from f will halt the iteration.
  32287. // The provided context supersedes any context provided to the Context method.
  32288. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  32289. c.ctx_ = ctx
  32290. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32291. for {
  32292. x, err := c.Do()
  32293. if err != nil {
  32294. return err
  32295. }
  32296. if err := f(x); err != nil {
  32297. return err
  32298. }
  32299. if x.NextPageToken == "" {
  32300. return nil
  32301. }
  32302. c.PageToken(x.NextPageToken)
  32303. }
  32304. }
  32305. // method id "dfareporting.orders.get":
  32306. type OrdersGetCall struct {
  32307. s *Service
  32308. profileId int64
  32309. projectId int64
  32310. id int64
  32311. urlParams_ gensupport.URLParams
  32312. ifNoneMatch_ string
  32313. ctx_ context.Context
  32314. header_ http.Header
  32315. }
  32316. // Get: Gets one order by ID.
  32317. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  32318. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32319. c.profileId = profileId
  32320. c.projectId = projectId
  32321. c.id = id
  32322. return c
  32323. }
  32324. // Fields allows partial responses to be retrieved. See
  32325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32326. // for more information.
  32327. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  32328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32329. return c
  32330. }
  32331. // IfNoneMatch sets the optional parameter which makes the operation
  32332. // fail if the object's ETag matches the given value. This is useful for
  32333. // getting updates only after the object has changed since the last
  32334. // request. Use googleapi.IsNotModified to check whether the response
  32335. // error from Do is the result of In-None-Match.
  32336. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  32337. c.ifNoneMatch_ = entityTag
  32338. return c
  32339. }
  32340. // Context sets the context to be used in this call's Do method. Any
  32341. // pending HTTP request will be aborted if the provided context is
  32342. // canceled.
  32343. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  32344. c.ctx_ = ctx
  32345. return c
  32346. }
  32347. // Header returns an http.Header that can be modified by the caller to
  32348. // add HTTP headers to the request.
  32349. func (c *OrdersGetCall) Header() http.Header {
  32350. if c.header_ == nil {
  32351. c.header_ = make(http.Header)
  32352. }
  32353. return c.header_
  32354. }
  32355. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  32356. reqHeaders := make(http.Header)
  32357. for k, v := range c.header_ {
  32358. reqHeaders[k] = v
  32359. }
  32360. reqHeaders.Set("User-Agent", c.s.userAgent())
  32361. if c.ifNoneMatch_ != "" {
  32362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32363. }
  32364. var body io.Reader = nil
  32365. c.urlParams_.Set("alt", alt)
  32366. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  32367. urls += "?" + c.urlParams_.Encode()
  32368. req, _ := http.NewRequest("GET", urls, body)
  32369. req.Header = reqHeaders
  32370. googleapi.Expand(req.URL, map[string]string{
  32371. "profileId": strconv.FormatInt(c.profileId, 10),
  32372. "projectId": strconv.FormatInt(c.projectId, 10),
  32373. "id": strconv.FormatInt(c.id, 10),
  32374. })
  32375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32376. }
  32377. // Do executes the "dfareporting.orders.get" call.
  32378. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  32379. // code is an error. Response headers are in either
  32380. // *Order.ServerResponse.Header or (if a response was returned at all)
  32381. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  32382. // check whether the returned error was because http.StatusNotModified
  32383. // was returned.
  32384. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  32385. gensupport.SetOptions(c.urlParams_, opts...)
  32386. res, err := c.doRequest("json")
  32387. if res != nil && res.StatusCode == http.StatusNotModified {
  32388. if res.Body != nil {
  32389. res.Body.Close()
  32390. }
  32391. return nil, &googleapi.Error{
  32392. Code: res.StatusCode,
  32393. Header: res.Header,
  32394. }
  32395. }
  32396. if err != nil {
  32397. return nil, err
  32398. }
  32399. defer googleapi.CloseBody(res)
  32400. if err := googleapi.CheckResponse(res); err != nil {
  32401. return nil, err
  32402. }
  32403. ret := &Order{
  32404. ServerResponse: googleapi.ServerResponse{
  32405. Header: res.Header,
  32406. HTTPStatusCode: res.StatusCode,
  32407. },
  32408. }
  32409. target := &ret
  32410. if err := gensupport.DecodeResponse(target, res); err != nil {
  32411. return nil, err
  32412. }
  32413. return ret, nil
  32414. // {
  32415. // "description": "Gets one order by ID.",
  32416. // "httpMethod": "GET",
  32417. // "id": "dfareporting.orders.get",
  32418. // "parameterOrder": [
  32419. // "profileId",
  32420. // "projectId",
  32421. // "id"
  32422. // ],
  32423. // "parameters": {
  32424. // "id": {
  32425. // "description": "Order ID.",
  32426. // "format": "int64",
  32427. // "location": "path",
  32428. // "required": true,
  32429. // "type": "string"
  32430. // },
  32431. // "profileId": {
  32432. // "description": "User profile ID associated with this request.",
  32433. // "format": "int64",
  32434. // "location": "path",
  32435. // "required": true,
  32436. // "type": "string"
  32437. // },
  32438. // "projectId": {
  32439. // "description": "Project ID for orders.",
  32440. // "format": "int64",
  32441. // "location": "path",
  32442. // "required": true,
  32443. // "type": "string"
  32444. // }
  32445. // },
  32446. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  32447. // "response": {
  32448. // "$ref": "Order"
  32449. // },
  32450. // "scopes": [
  32451. // "https://www.googleapis.com/auth/dfatrafficking"
  32452. // ]
  32453. // }
  32454. }
  32455. // method id "dfareporting.orders.list":
  32456. type OrdersListCall struct {
  32457. s *Service
  32458. profileId int64
  32459. projectId int64
  32460. urlParams_ gensupport.URLParams
  32461. ifNoneMatch_ string
  32462. ctx_ context.Context
  32463. header_ http.Header
  32464. }
  32465. // List: Retrieves a list of orders, possibly filtered. This method
  32466. // supports paging.
  32467. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  32468. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32469. c.profileId = profileId
  32470. c.projectId = projectId
  32471. return c
  32472. }
  32473. // Ids sets the optional parameter "ids": Select only orders with these
  32474. // IDs.
  32475. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  32476. var ids_ []string
  32477. for _, v := range ids {
  32478. ids_ = append(ids_, fmt.Sprint(v))
  32479. }
  32480. c.urlParams_.SetMulti("ids", ids_)
  32481. return c
  32482. }
  32483. // MaxResults sets the optional parameter "maxResults": Maximum number
  32484. // of results to return.
  32485. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  32486. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32487. return c
  32488. }
  32489. // PageToken sets the optional parameter "pageToken": Value of the
  32490. // nextPageToken from the previous result page.
  32491. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  32492. c.urlParams_.Set("pageToken", pageToken)
  32493. return c
  32494. }
  32495. // SearchString sets the optional parameter "searchString": Allows
  32496. // searching for orders by name or ID. Wildcards (*) are allowed. For
  32497. // example, "order*2015" will return orders with names like "order June
  32498. // 2015", "order April 2015", or simply "order 2015". Most of the
  32499. // searches also add wildcards implicitly at the start and the end of
  32500. // the search string. For example, a search string of "order" will match
  32501. // orders with name "my order", "order 2015", or simply "order".
  32502. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  32503. c.urlParams_.Set("searchString", searchString)
  32504. return c
  32505. }
  32506. // SiteId sets the optional parameter "siteId": Select only orders that
  32507. // are associated with these site IDs.
  32508. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  32509. var siteId_ []string
  32510. for _, v := range siteId {
  32511. siteId_ = append(siteId_, fmt.Sprint(v))
  32512. }
  32513. c.urlParams_.SetMulti("siteId", siteId_)
  32514. return c
  32515. }
  32516. // SortField sets the optional parameter "sortField": Field by which to
  32517. // sort the list.
  32518. //
  32519. // Possible values:
  32520. // "ID" (default)
  32521. // "NAME"
  32522. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  32523. c.urlParams_.Set("sortField", sortField)
  32524. return c
  32525. }
  32526. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32527. // results.
  32528. //
  32529. // Possible values:
  32530. // "ASCENDING" (default)
  32531. // "DESCENDING"
  32532. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  32533. c.urlParams_.Set("sortOrder", sortOrder)
  32534. return c
  32535. }
  32536. // Fields allows partial responses to be retrieved. See
  32537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32538. // for more information.
  32539. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  32540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32541. return c
  32542. }
  32543. // IfNoneMatch sets the optional parameter which makes the operation
  32544. // fail if the object's ETag matches the given value. This is useful for
  32545. // getting updates only after the object has changed since the last
  32546. // request. Use googleapi.IsNotModified to check whether the response
  32547. // error from Do is the result of In-None-Match.
  32548. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  32549. c.ifNoneMatch_ = entityTag
  32550. return c
  32551. }
  32552. // Context sets the context to be used in this call's Do method. Any
  32553. // pending HTTP request will be aborted if the provided context is
  32554. // canceled.
  32555. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  32556. c.ctx_ = ctx
  32557. return c
  32558. }
  32559. // Header returns an http.Header that can be modified by the caller to
  32560. // add HTTP headers to the request.
  32561. func (c *OrdersListCall) Header() http.Header {
  32562. if c.header_ == nil {
  32563. c.header_ = make(http.Header)
  32564. }
  32565. return c.header_
  32566. }
  32567. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  32568. reqHeaders := make(http.Header)
  32569. for k, v := range c.header_ {
  32570. reqHeaders[k] = v
  32571. }
  32572. reqHeaders.Set("User-Agent", c.s.userAgent())
  32573. if c.ifNoneMatch_ != "" {
  32574. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32575. }
  32576. var body io.Reader = nil
  32577. c.urlParams_.Set("alt", alt)
  32578. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  32579. urls += "?" + c.urlParams_.Encode()
  32580. req, _ := http.NewRequest("GET", urls, body)
  32581. req.Header = reqHeaders
  32582. googleapi.Expand(req.URL, map[string]string{
  32583. "profileId": strconv.FormatInt(c.profileId, 10),
  32584. "projectId": strconv.FormatInt(c.projectId, 10),
  32585. })
  32586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32587. }
  32588. // Do executes the "dfareporting.orders.list" call.
  32589. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  32590. // non-2xx status code is an error. Response headers are in either
  32591. // *OrdersListResponse.ServerResponse.Header or (if a response was
  32592. // returned at all) in error.(*googleapi.Error).Header. Use
  32593. // googleapi.IsNotModified to check whether the returned error was
  32594. // because http.StatusNotModified was returned.
  32595. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  32596. gensupport.SetOptions(c.urlParams_, opts...)
  32597. res, err := c.doRequest("json")
  32598. if res != nil && res.StatusCode == http.StatusNotModified {
  32599. if res.Body != nil {
  32600. res.Body.Close()
  32601. }
  32602. return nil, &googleapi.Error{
  32603. Code: res.StatusCode,
  32604. Header: res.Header,
  32605. }
  32606. }
  32607. if err != nil {
  32608. return nil, err
  32609. }
  32610. defer googleapi.CloseBody(res)
  32611. if err := googleapi.CheckResponse(res); err != nil {
  32612. return nil, err
  32613. }
  32614. ret := &OrdersListResponse{
  32615. ServerResponse: googleapi.ServerResponse{
  32616. Header: res.Header,
  32617. HTTPStatusCode: res.StatusCode,
  32618. },
  32619. }
  32620. target := &ret
  32621. if err := gensupport.DecodeResponse(target, res); err != nil {
  32622. return nil, err
  32623. }
  32624. return ret, nil
  32625. // {
  32626. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  32627. // "httpMethod": "GET",
  32628. // "id": "dfareporting.orders.list",
  32629. // "parameterOrder": [
  32630. // "profileId",
  32631. // "projectId"
  32632. // ],
  32633. // "parameters": {
  32634. // "ids": {
  32635. // "description": "Select only orders with these IDs.",
  32636. // "format": "int64",
  32637. // "location": "query",
  32638. // "repeated": true,
  32639. // "type": "string"
  32640. // },
  32641. // "maxResults": {
  32642. // "default": "1000",
  32643. // "description": "Maximum number of results to return.",
  32644. // "format": "int32",
  32645. // "location": "query",
  32646. // "maximum": "1000",
  32647. // "minimum": "0",
  32648. // "type": "integer"
  32649. // },
  32650. // "pageToken": {
  32651. // "description": "Value of the nextPageToken from the previous result page.",
  32652. // "location": "query",
  32653. // "type": "string"
  32654. // },
  32655. // "profileId": {
  32656. // "description": "User profile ID associated with this request.",
  32657. // "format": "int64",
  32658. // "location": "path",
  32659. // "required": true,
  32660. // "type": "string"
  32661. // },
  32662. // "projectId": {
  32663. // "description": "Project ID for orders.",
  32664. // "format": "int64",
  32665. // "location": "path",
  32666. // "required": true,
  32667. // "type": "string"
  32668. // },
  32669. // "searchString": {
  32670. // "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\".",
  32671. // "location": "query",
  32672. // "type": "string"
  32673. // },
  32674. // "siteId": {
  32675. // "description": "Select only orders that are associated with these site IDs.",
  32676. // "format": "int64",
  32677. // "location": "query",
  32678. // "repeated": true,
  32679. // "type": "string"
  32680. // },
  32681. // "sortField": {
  32682. // "default": "ID",
  32683. // "description": "Field by which to sort the list.",
  32684. // "enum": [
  32685. // "ID",
  32686. // "NAME"
  32687. // ],
  32688. // "enumDescriptions": [
  32689. // "",
  32690. // ""
  32691. // ],
  32692. // "location": "query",
  32693. // "type": "string"
  32694. // },
  32695. // "sortOrder": {
  32696. // "default": "ASCENDING",
  32697. // "description": "Order of sorted results.",
  32698. // "enum": [
  32699. // "ASCENDING",
  32700. // "DESCENDING"
  32701. // ],
  32702. // "enumDescriptions": [
  32703. // "",
  32704. // ""
  32705. // ],
  32706. // "location": "query",
  32707. // "type": "string"
  32708. // }
  32709. // },
  32710. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  32711. // "response": {
  32712. // "$ref": "OrdersListResponse"
  32713. // },
  32714. // "scopes": [
  32715. // "https://www.googleapis.com/auth/dfatrafficking"
  32716. // ]
  32717. // }
  32718. }
  32719. // Pages invokes f for each page of results.
  32720. // A non-nil error returned from f will halt the iteration.
  32721. // The provided context supersedes any context provided to the Context method.
  32722. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  32723. c.ctx_ = ctx
  32724. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32725. for {
  32726. x, err := c.Do()
  32727. if err != nil {
  32728. return err
  32729. }
  32730. if err := f(x); err != nil {
  32731. return err
  32732. }
  32733. if x.NextPageToken == "" {
  32734. return nil
  32735. }
  32736. c.PageToken(x.NextPageToken)
  32737. }
  32738. }
  32739. // method id "dfareporting.placementGroups.get":
  32740. type PlacementGroupsGetCall struct {
  32741. s *Service
  32742. profileId int64
  32743. id int64
  32744. urlParams_ gensupport.URLParams
  32745. ifNoneMatch_ string
  32746. ctx_ context.Context
  32747. header_ http.Header
  32748. }
  32749. // Get: Gets one placement group by ID.
  32750. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  32751. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32752. c.profileId = profileId
  32753. c.id = id
  32754. return c
  32755. }
  32756. // Fields allows partial responses to be retrieved. See
  32757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32758. // for more information.
  32759. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  32760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32761. return c
  32762. }
  32763. // IfNoneMatch sets the optional parameter which makes the operation
  32764. // fail if the object's ETag matches the given value. This is useful for
  32765. // getting updates only after the object has changed since the last
  32766. // request. Use googleapi.IsNotModified to check whether the response
  32767. // error from Do is the result of In-None-Match.
  32768. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  32769. c.ifNoneMatch_ = entityTag
  32770. return c
  32771. }
  32772. // Context sets the context to be used in this call's Do method. Any
  32773. // pending HTTP request will be aborted if the provided context is
  32774. // canceled.
  32775. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  32776. c.ctx_ = ctx
  32777. return c
  32778. }
  32779. // Header returns an http.Header that can be modified by the caller to
  32780. // add HTTP headers to the request.
  32781. func (c *PlacementGroupsGetCall) Header() http.Header {
  32782. if c.header_ == nil {
  32783. c.header_ = make(http.Header)
  32784. }
  32785. return c.header_
  32786. }
  32787. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  32788. reqHeaders := make(http.Header)
  32789. for k, v := range c.header_ {
  32790. reqHeaders[k] = v
  32791. }
  32792. reqHeaders.Set("User-Agent", c.s.userAgent())
  32793. if c.ifNoneMatch_ != "" {
  32794. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32795. }
  32796. var body io.Reader = nil
  32797. c.urlParams_.Set("alt", alt)
  32798. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  32799. urls += "?" + c.urlParams_.Encode()
  32800. req, _ := http.NewRequest("GET", urls, body)
  32801. req.Header = reqHeaders
  32802. googleapi.Expand(req.URL, map[string]string{
  32803. "profileId": strconv.FormatInt(c.profileId, 10),
  32804. "id": strconv.FormatInt(c.id, 10),
  32805. })
  32806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32807. }
  32808. // Do executes the "dfareporting.placementGroups.get" call.
  32809. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  32810. // status code is an error. Response headers are in either
  32811. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  32812. // at all) in error.(*googleapi.Error).Header. Use
  32813. // googleapi.IsNotModified to check whether the returned error was
  32814. // because http.StatusNotModified was returned.
  32815. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  32816. gensupport.SetOptions(c.urlParams_, opts...)
  32817. res, err := c.doRequest("json")
  32818. if res != nil && res.StatusCode == http.StatusNotModified {
  32819. if res.Body != nil {
  32820. res.Body.Close()
  32821. }
  32822. return nil, &googleapi.Error{
  32823. Code: res.StatusCode,
  32824. Header: res.Header,
  32825. }
  32826. }
  32827. if err != nil {
  32828. return nil, err
  32829. }
  32830. defer googleapi.CloseBody(res)
  32831. if err := googleapi.CheckResponse(res); err != nil {
  32832. return nil, err
  32833. }
  32834. ret := &PlacementGroup{
  32835. ServerResponse: googleapi.ServerResponse{
  32836. Header: res.Header,
  32837. HTTPStatusCode: res.StatusCode,
  32838. },
  32839. }
  32840. target := &ret
  32841. if err := gensupport.DecodeResponse(target, res); err != nil {
  32842. return nil, err
  32843. }
  32844. return ret, nil
  32845. // {
  32846. // "description": "Gets one placement group by ID.",
  32847. // "httpMethod": "GET",
  32848. // "id": "dfareporting.placementGroups.get",
  32849. // "parameterOrder": [
  32850. // "profileId",
  32851. // "id"
  32852. // ],
  32853. // "parameters": {
  32854. // "id": {
  32855. // "description": "Placement group ID.",
  32856. // "format": "int64",
  32857. // "location": "path",
  32858. // "required": true,
  32859. // "type": "string"
  32860. // },
  32861. // "profileId": {
  32862. // "description": "User profile ID associated with this request.",
  32863. // "format": "int64",
  32864. // "location": "path",
  32865. // "required": true,
  32866. // "type": "string"
  32867. // }
  32868. // },
  32869. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  32870. // "response": {
  32871. // "$ref": "PlacementGroup"
  32872. // },
  32873. // "scopes": [
  32874. // "https://www.googleapis.com/auth/dfatrafficking"
  32875. // ]
  32876. // }
  32877. }
  32878. // method id "dfareporting.placementGroups.insert":
  32879. type PlacementGroupsInsertCall struct {
  32880. s *Service
  32881. profileId int64
  32882. placementgroup *PlacementGroup
  32883. urlParams_ gensupport.URLParams
  32884. ctx_ context.Context
  32885. header_ http.Header
  32886. }
  32887. // Insert: Inserts a new placement group.
  32888. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  32889. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32890. c.profileId = profileId
  32891. c.placementgroup = placementgroup
  32892. return c
  32893. }
  32894. // Fields allows partial responses to be retrieved. See
  32895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32896. // for more information.
  32897. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  32898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32899. return c
  32900. }
  32901. // Context sets the context to be used in this call's Do method. Any
  32902. // pending HTTP request will be aborted if the provided context is
  32903. // canceled.
  32904. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  32905. c.ctx_ = ctx
  32906. return c
  32907. }
  32908. // Header returns an http.Header that can be modified by the caller to
  32909. // add HTTP headers to the request.
  32910. func (c *PlacementGroupsInsertCall) Header() http.Header {
  32911. if c.header_ == nil {
  32912. c.header_ = make(http.Header)
  32913. }
  32914. return c.header_
  32915. }
  32916. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  32917. reqHeaders := make(http.Header)
  32918. for k, v := range c.header_ {
  32919. reqHeaders[k] = v
  32920. }
  32921. reqHeaders.Set("User-Agent", c.s.userAgent())
  32922. var body io.Reader = nil
  32923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  32924. if err != nil {
  32925. return nil, err
  32926. }
  32927. reqHeaders.Set("Content-Type", "application/json")
  32928. c.urlParams_.Set("alt", alt)
  32929. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  32930. urls += "?" + c.urlParams_.Encode()
  32931. req, _ := http.NewRequest("POST", urls, body)
  32932. req.Header = reqHeaders
  32933. googleapi.Expand(req.URL, map[string]string{
  32934. "profileId": strconv.FormatInt(c.profileId, 10),
  32935. })
  32936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32937. }
  32938. // Do executes the "dfareporting.placementGroups.insert" call.
  32939. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  32940. // status code is an error. Response headers are in either
  32941. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  32942. // at all) in error.(*googleapi.Error).Header. Use
  32943. // googleapi.IsNotModified to check whether the returned error was
  32944. // because http.StatusNotModified was returned.
  32945. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  32946. gensupport.SetOptions(c.urlParams_, opts...)
  32947. res, err := c.doRequest("json")
  32948. if res != nil && res.StatusCode == http.StatusNotModified {
  32949. if res.Body != nil {
  32950. res.Body.Close()
  32951. }
  32952. return nil, &googleapi.Error{
  32953. Code: res.StatusCode,
  32954. Header: res.Header,
  32955. }
  32956. }
  32957. if err != nil {
  32958. return nil, err
  32959. }
  32960. defer googleapi.CloseBody(res)
  32961. if err := googleapi.CheckResponse(res); err != nil {
  32962. return nil, err
  32963. }
  32964. ret := &PlacementGroup{
  32965. ServerResponse: googleapi.ServerResponse{
  32966. Header: res.Header,
  32967. HTTPStatusCode: res.StatusCode,
  32968. },
  32969. }
  32970. target := &ret
  32971. if err := gensupport.DecodeResponse(target, res); err != nil {
  32972. return nil, err
  32973. }
  32974. return ret, nil
  32975. // {
  32976. // "description": "Inserts a new placement group.",
  32977. // "httpMethod": "POST",
  32978. // "id": "dfareporting.placementGroups.insert",
  32979. // "parameterOrder": [
  32980. // "profileId"
  32981. // ],
  32982. // "parameters": {
  32983. // "profileId": {
  32984. // "description": "User profile ID associated with this request.",
  32985. // "format": "int64",
  32986. // "location": "path",
  32987. // "required": true,
  32988. // "type": "string"
  32989. // }
  32990. // },
  32991. // "path": "userprofiles/{profileId}/placementGroups",
  32992. // "request": {
  32993. // "$ref": "PlacementGroup"
  32994. // },
  32995. // "response": {
  32996. // "$ref": "PlacementGroup"
  32997. // },
  32998. // "scopes": [
  32999. // "https://www.googleapis.com/auth/dfatrafficking"
  33000. // ]
  33001. // }
  33002. }
  33003. // method id "dfareporting.placementGroups.list":
  33004. type PlacementGroupsListCall struct {
  33005. s *Service
  33006. profileId int64
  33007. urlParams_ gensupport.URLParams
  33008. ifNoneMatch_ string
  33009. ctx_ context.Context
  33010. header_ http.Header
  33011. }
  33012. // List: Retrieves a list of placement groups, possibly filtered. This
  33013. // method supports paging.
  33014. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  33015. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33016. c.profileId = profileId
  33017. return c
  33018. }
  33019. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  33020. // only placement groups that belong to these advertisers.
  33021. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  33022. var advertiserIds_ []string
  33023. for _, v := range advertiserIds {
  33024. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  33025. }
  33026. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  33027. return c
  33028. }
  33029. // Archived sets the optional parameter "archived": Select only archived
  33030. // placements. Don't set this field to select both archived and
  33031. // non-archived placements.
  33032. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  33033. c.urlParams_.Set("archived", fmt.Sprint(archived))
  33034. return c
  33035. }
  33036. // CampaignIds sets the optional parameter "campaignIds": Select only
  33037. // placement groups that belong to these campaigns.
  33038. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  33039. var campaignIds_ []string
  33040. for _, v := range campaignIds {
  33041. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  33042. }
  33043. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  33044. return c
  33045. }
  33046. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  33047. // Select only placement groups that are associated with these content
  33048. // categories.
  33049. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  33050. var contentCategoryIds_ []string
  33051. for _, v := range contentCategoryIds {
  33052. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  33053. }
  33054. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  33055. return c
  33056. }
  33057. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  33058. // Select only placement groups that are associated with these directory
  33059. // sites.
  33060. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  33061. var directorySiteIds_ []string
  33062. for _, v := range directorySiteIds {
  33063. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  33064. }
  33065. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  33066. return c
  33067. }
  33068. // Ids sets the optional parameter "ids": Select only placement groups
  33069. // with these IDs.
  33070. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  33071. var ids_ []string
  33072. for _, v := range ids {
  33073. ids_ = append(ids_, fmt.Sprint(v))
  33074. }
  33075. c.urlParams_.SetMulti("ids", ids_)
  33076. return c
  33077. }
  33078. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  33079. // placements or placement groups whose end date is on or before the
  33080. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  33081. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  33082. c.urlParams_.Set("maxEndDate", maxEndDate)
  33083. return c
  33084. }
  33085. // MaxResults sets the optional parameter "maxResults": Maximum number
  33086. // of results to return.
  33087. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  33088. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33089. return c
  33090. }
  33091. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  33092. // placements or placement groups whose start date is on or before the
  33093. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  33094. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  33095. c.urlParams_.Set("maxStartDate", maxStartDate)
  33096. return c
  33097. }
  33098. // MinEndDate sets the optional parameter "minEndDate": Select only
  33099. // placements or placement groups whose end date is on or after the
  33100. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  33101. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  33102. c.urlParams_.Set("minEndDate", minEndDate)
  33103. return c
  33104. }
  33105. // MinStartDate sets the optional parameter "minStartDate": Select only
  33106. // placements or placement groups whose start date is on or after the
  33107. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  33108. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  33109. c.urlParams_.Set("minStartDate", minStartDate)
  33110. return c
  33111. }
  33112. // PageToken sets the optional parameter "pageToken": Value of the
  33113. // nextPageToken from the previous result page.
  33114. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  33115. c.urlParams_.Set("pageToken", pageToken)
  33116. return c
  33117. }
  33118. // PlacementGroupType sets the optional parameter "placementGroupType":
  33119. // Select only placement groups belonging with this group type. A
  33120. // package is a simple group of placements that acts as a single pricing
  33121. // point for a group of tags. A roadblock is a group of placements that
  33122. // not only acts as a single pricing point but also assumes that all the
  33123. // tags in it will be served at the same time. A roadblock requires one
  33124. // of its assigned placements to be marked as primary for reporting.
  33125. //
  33126. // Possible values:
  33127. // "PLACEMENT_PACKAGE"
  33128. // "PLACEMENT_ROADBLOCK"
  33129. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  33130. c.urlParams_.Set("placementGroupType", placementGroupType)
  33131. return c
  33132. }
  33133. // PlacementStrategyIds sets the optional parameter
  33134. // "placementStrategyIds": Select only placement groups that are
  33135. // associated with these placement strategies.
  33136. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  33137. var placementStrategyIds_ []string
  33138. for _, v := range placementStrategyIds {
  33139. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  33140. }
  33141. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  33142. return c
  33143. }
  33144. // PricingTypes sets the optional parameter "pricingTypes": Select only
  33145. // placement groups with these pricing types.
  33146. //
  33147. // Possible values:
  33148. // "PRICING_TYPE_CPA"
  33149. // "PRICING_TYPE_CPC"
  33150. // "PRICING_TYPE_CPM"
  33151. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  33152. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  33153. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33154. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  33155. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  33156. return c
  33157. }
  33158. // SearchString sets the optional parameter "searchString": Allows
  33159. // searching for placement groups by name or ID. Wildcards (*) are
  33160. // allowed. For example, "placement*2015" will return placement groups
  33161. // with names like "placement group June 2015", "placement group May
  33162. // 2015", or simply "placements 2015". Most of the searches also add
  33163. // wildcards implicitly at the start and the end of the search string.
  33164. // For example, a search string of "placementgroup" will match placement
  33165. // groups with name "my placementgroup", "placementgroup 2015", or
  33166. // simply "placementgroup".
  33167. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  33168. c.urlParams_.Set("searchString", searchString)
  33169. return c
  33170. }
  33171. // SiteIds sets the optional parameter "siteIds": Select only placement
  33172. // groups that are associated with these sites.
  33173. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  33174. var siteIds_ []string
  33175. for _, v := range siteIds {
  33176. siteIds_ = append(siteIds_, fmt.Sprint(v))
  33177. }
  33178. c.urlParams_.SetMulti("siteIds", siteIds_)
  33179. return c
  33180. }
  33181. // SortField sets the optional parameter "sortField": Field by which to
  33182. // sort the list.
  33183. //
  33184. // Possible values:
  33185. // "ID" (default)
  33186. // "NAME"
  33187. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  33188. c.urlParams_.Set("sortField", sortField)
  33189. return c
  33190. }
  33191. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33192. // results.
  33193. //
  33194. // Possible values:
  33195. // "ASCENDING" (default)
  33196. // "DESCENDING"
  33197. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  33198. c.urlParams_.Set("sortOrder", sortOrder)
  33199. return c
  33200. }
  33201. // Fields allows partial responses to be retrieved. See
  33202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33203. // for more information.
  33204. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  33205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33206. return c
  33207. }
  33208. // IfNoneMatch sets the optional parameter which makes the operation
  33209. // fail if the object's ETag matches the given value. This is useful for
  33210. // getting updates only after the object has changed since the last
  33211. // request. Use googleapi.IsNotModified to check whether the response
  33212. // error from Do is the result of In-None-Match.
  33213. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  33214. c.ifNoneMatch_ = entityTag
  33215. return c
  33216. }
  33217. // Context sets the context to be used in this call's Do method. Any
  33218. // pending HTTP request will be aborted if the provided context is
  33219. // canceled.
  33220. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  33221. c.ctx_ = ctx
  33222. return c
  33223. }
  33224. // Header returns an http.Header that can be modified by the caller to
  33225. // add HTTP headers to the request.
  33226. func (c *PlacementGroupsListCall) Header() http.Header {
  33227. if c.header_ == nil {
  33228. c.header_ = make(http.Header)
  33229. }
  33230. return c.header_
  33231. }
  33232. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  33233. reqHeaders := make(http.Header)
  33234. for k, v := range c.header_ {
  33235. reqHeaders[k] = v
  33236. }
  33237. reqHeaders.Set("User-Agent", c.s.userAgent())
  33238. if c.ifNoneMatch_ != "" {
  33239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33240. }
  33241. var body io.Reader = nil
  33242. c.urlParams_.Set("alt", alt)
  33243. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33244. urls += "?" + c.urlParams_.Encode()
  33245. req, _ := http.NewRequest("GET", urls, body)
  33246. req.Header = reqHeaders
  33247. googleapi.Expand(req.URL, map[string]string{
  33248. "profileId": strconv.FormatInt(c.profileId, 10),
  33249. })
  33250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33251. }
  33252. // Do executes the "dfareporting.placementGroups.list" call.
  33253. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  33254. // Any non-2xx status code is an error. Response headers are in either
  33255. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  33256. // was returned at all) in error.(*googleapi.Error).Header. Use
  33257. // googleapi.IsNotModified to check whether the returned error was
  33258. // because http.StatusNotModified was returned.
  33259. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  33260. gensupport.SetOptions(c.urlParams_, opts...)
  33261. res, err := c.doRequest("json")
  33262. if res != nil && res.StatusCode == http.StatusNotModified {
  33263. if res.Body != nil {
  33264. res.Body.Close()
  33265. }
  33266. return nil, &googleapi.Error{
  33267. Code: res.StatusCode,
  33268. Header: res.Header,
  33269. }
  33270. }
  33271. if err != nil {
  33272. return nil, err
  33273. }
  33274. defer googleapi.CloseBody(res)
  33275. if err := googleapi.CheckResponse(res); err != nil {
  33276. return nil, err
  33277. }
  33278. ret := &PlacementGroupsListResponse{
  33279. ServerResponse: googleapi.ServerResponse{
  33280. Header: res.Header,
  33281. HTTPStatusCode: res.StatusCode,
  33282. },
  33283. }
  33284. target := &ret
  33285. if err := gensupport.DecodeResponse(target, res); err != nil {
  33286. return nil, err
  33287. }
  33288. return ret, nil
  33289. // {
  33290. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  33291. // "httpMethod": "GET",
  33292. // "id": "dfareporting.placementGroups.list",
  33293. // "parameterOrder": [
  33294. // "profileId"
  33295. // ],
  33296. // "parameters": {
  33297. // "advertiserIds": {
  33298. // "description": "Select only placement groups that belong to these advertisers.",
  33299. // "format": "int64",
  33300. // "location": "query",
  33301. // "repeated": true,
  33302. // "type": "string"
  33303. // },
  33304. // "archived": {
  33305. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  33306. // "location": "query",
  33307. // "type": "boolean"
  33308. // },
  33309. // "campaignIds": {
  33310. // "description": "Select only placement groups that belong to these campaigns.",
  33311. // "format": "int64",
  33312. // "location": "query",
  33313. // "repeated": true,
  33314. // "type": "string"
  33315. // },
  33316. // "contentCategoryIds": {
  33317. // "description": "Select only placement groups that are associated with these content categories.",
  33318. // "format": "int64",
  33319. // "location": "query",
  33320. // "repeated": true,
  33321. // "type": "string"
  33322. // },
  33323. // "directorySiteIds": {
  33324. // "description": "Select only placement groups that are associated with these directory sites.",
  33325. // "format": "int64",
  33326. // "location": "query",
  33327. // "repeated": true,
  33328. // "type": "string"
  33329. // },
  33330. // "ids": {
  33331. // "description": "Select only placement groups with these IDs.",
  33332. // "format": "int64",
  33333. // "location": "query",
  33334. // "repeated": true,
  33335. // "type": "string"
  33336. // },
  33337. // "maxEndDate": {
  33338. // "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\".",
  33339. // "location": "query",
  33340. // "type": "string"
  33341. // },
  33342. // "maxResults": {
  33343. // "default": "800",
  33344. // "description": "Maximum number of results to return.",
  33345. // "format": "int32",
  33346. // "location": "query",
  33347. // "maximum": "800",
  33348. // "minimum": "0",
  33349. // "type": "integer"
  33350. // },
  33351. // "maxStartDate": {
  33352. // "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\".",
  33353. // "location": "query",
  33354. // "type": "string"
  33355. // },
  33356. // "minEndDate": {
  33357. // "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\".",
  33358. // "location": "query",
  33359. // "type": "string"
  33360. // },
  33361. // "minStartDate": {
  33362. // "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\".",
  33363. // "location": "query",
  33364. // "type": "string"
  33365. // },
  33366. // "pageToken": {
  33367. // "description": "Value of the nextPageToken from the previous result page.",
  33368. // "location": "query",
  33369. // "type": "string"
  33370. // },
  33371. // "placementGroupType": {
  33372. // "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.",
  33373. // "enum": [
  33374. // "PLACEMENT_PACKAGE",
  33375. // "PLACEMENT_ROADBLOCK"
  33376. // ],
  33377. // "enumDescriptions": [
  33378. // "",
  33379. // ""
  33380. // ],
  33381. // "location": "query",
  33382. // "type": "string"
  33383. // },
  33384. // "placementStrategyIds": {
  33385. // "description": "Select only placement groups that are associated with these placement strategies.",
  33386. // "format": "int64",
  33387. // "location": "query",
  33388. // "repeated": true,
  33389. // "type": "string"
  33390. // },
  33391. // "pricingTypes": {
  33392. // "description": "Select only placement groups with these pricing types.",
  33393. // "enum": [
  33394. // "PRICING_TYPE_CPA",
  33395. // "PRICING_TYPE_CPC",
  33396. // "PRICING_TYPE_CPM",
  33397. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  33398. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  33399. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33400. // ],
  33401. // "enumDescriptions": [
  33402. // "",
  33403. // "",
  33404. // "",
  33405. // "",
  33406. // "",
  33407. // ""
  33408. // ],
  33409. // "location": "query",
  33410. // "repeated": true,
  33411. // "type": "string"
  33412. // },
  33413. // "profileId": {
  33414. // "description": "User profile ID associated with this request.",
  33415. // "format": "int64",
  33416. // "location": "path",
  33417. // "required": true,
  33418. // "type": "string"
  33419. // },
  33420. // "searchString": {
  33421. // "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\".",
  33422. // "location": "query",
  33423. // "type": "string"
  33424. // },
  33425. // "siteIds": {
  33426. // "description": "Select only placement groups that are associated with these sites.",
  33427. // "format": "int64",
  33428. // "location": "query",
  33429. // "repeated": true,
  33430. // "type": "string"
  33431. // },
  33432. // "sortField": {
  33433. // "default": "ID",
  33434. // "description": "Field by which to sort the list.",
  33435. // "enum": [
  33436. // "ID",
  33437. // "NAME"
  33438. // ],
  33439. // "enumDescriptions": [
  33440. // "",
  33441. // ""
  33442. // ],
  33443. // "location": "query",
  33444. // "type": "string"
  33445. // },
  33446. // "sortOrder": {
  33447. // "default": "ASCENDING",
  33448. // "description": "Order of sorted results.",
  33449. // "enum": [
  33450. // "ASCENDING",
  33451. // "DESCENDING"
  33452. // ],
  33453. // "enumDescriptions": [
  33454. // "",
  33455. // ""
  33456. // ],
  33457. // "location": "query",
  33458. // "type": "string"
  33459. // }
  33460. // },
  33461. // "path": "userprofiles/{profileId}/placementGroups",
  33462. // "response": {
  33463. // "$ref": "PlacementGroupsListResponse"
  33464. // },
  33465. // "scopes": [
  33466. // "https://www.googleapis.com/auth/dfatrafficking"
  33467. // ]
  33468. // }
  33469. }
  33470. // Pages invokes f for each page of results.
  33471. // A non-nil error returned from f will halt the iteration.
  33472. // The provided context supersedes any context provided to the Context method.
  33473. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  33474. c.ctx_ = ctx
  33475. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33476. for {
  33477. x, err := c.Do()
  33478. if err != nil {
  33479. return err
  33480. }
  33481. if err := f(x); err != nil {
  33482. return err
  33483. }
  33484. if x.NextPageToken == "" {
  33485. return nil
  33486. }
  33487. c.PageToken(x.NextPageToken)
  33488. }
  33489. }
  33490. // method id "dfareporting.placementGroups.patch":
  33491. type PlacementGroupsPatchCall struct {
  33492. s *Service
  33493. profileId int64
  33494. placementgroup *PlacementGroup
  33495. urlParams_ gensupport.URLParams
  33496. ctx_ context.Context
  33497. header_ http.Header
  33498. }
  33499. // Patch: Updates an existing placement group. This method supports
  33500. // patch semantics.
  33501. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  33502. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33503. c.profileId = profileId
  33504. c.urlParams_.Set("id", fmt.Sprint(id))
  33505. c.placementgroup = placementgroup
  33506. return c
  33507. }
  33508. // Fields allows partial responses to be retrieved. See
  33509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33510. // for more information.
  33511. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  33512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33513. return c
  33514. }
  33515. // Context sets the context to be used in this call's Do method. Any
  33516. // pending HTTP request will be aborted if the provided context is
  33517. // canceled.
  33518. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  33519. c.ctx_ = ctx
  33520. return c
  33521. }
  33522. // Header returns an http.Header that can be modified by the caller to
  33523. // add HTTP headers to the request.
  33524. func (c *PlacementGroupsPatchCall) Header() http.Header {
  33525. if c.header_ == nil {
  33526. c.header_ = make(http.Header)
  33527. }
  33528. return c.header_
  33529. }
  33530. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  33531. reqHeaders := make(http.Header)
  33532. for k, v := range c.header_ {
  33533. reqHeaders[k] = v
  33534. }
  33535. reqHeaders.Set("User-Agent", c.s.userAgent())
  33536. var body io.Reader = nil
  33537. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33538. if err != nil {
  33539. return nil, err
  33540. }
  33541. reqHeaders.Set("Content-Type", "application/json")
  33542. c.urlParams_.Set("alt", alt)
  33543. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33544. urls += "?" + c.urlParams_.Encode()
  33545. req, _ := http.NewRequest("PATCH", urls, body)
  33546. req.Header = reqHeaders
  33547. googleapi.Expand(req.URL, map[string]string{
  33548. "profileId": strconv.FormatInt(c.profileId, 10),
  33549. })
  33550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33551. }
  33552. // Do executes the "dfareporting.placementGroups.patch" call.
  33553. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33554. // status code is an error. Response headers are in either
  33555. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33556. // at all) in error.(*googleapi.Error).Header. Use
  33557. // googleapi.IsNotModified to check whether the returned error was
  33558. // because http.StatusNotModified was returned.
  33559. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33560. gensupport.SetOptions(c.urlParams_, opts...)
  33561. res, err := c.doRequest("json")
  33562. if res != nil && res.StatusCode == http.StatusNotModified {
  33563. if res.Body != nil {
  33564. res.Body.Close()
  33565. }
  33566. return nil, &googleapi.Error{
  33567. Code: res.StatusCode,
  33568. Header: res.Header,
  33569. }
  33570. }
  33571. if err != nil {
  33572. return nil, err
  33573. }
  33574. defer googleapi.CloseBody(res)
  33575. if err := googleapi.CheckResponse(res); err != nil {
  33576. return nil, err
  33577. }
  33578. ret := &PlacementGroup{
  33579. ServerResponse: googleapi.ServerResponse{
  33580. Header: res.Header,
  33581. HTTPStatusCode: res.StatusCode,
  33582. },
  33583. }
  33584. target := &ret
  33585. if err := gensupport.DecodeResponse(target, res); err != nil {
  33586. return nil, err
  33587. }
  33588. return ret, nil
  33589. // {
  33590. // "description": "Updates an existing placement group. This method supports patch semantics.",
  33591. // "httpMethod": "PATCH",
  33592. // "id": "dfareporting.placementGroups.patch",
  33593. // "parameterOrder": [
  33594. // "profileId",
  33595. // "id"
  33596. // ],
  33597. // "parameters": {
  33598. // "id": {
  33599. // "description": "Placement group ID.",
  33600. // "format": "int64",
  33601. // "location": "query",
  33602. // "required": true,
  33603. // "type": "string"
  33604. // },
  33605. // "profileId": {
  33606. // "description": "User profile ID associated with this request.",
  33607. // "format": "int64",
  33608. // "location": "path",
  33609. // "required": true,
  33610. // "type": "string"
  33611. // }
  33612. // },
  33613. // "path": "userprofiles/{profileId}/placementGroups",
  33614. // "request": {
  33615. // "$ref": "PlacementGroup"
  33616. // },
  33617. // "response": {
  33618. // "$ref": "PlacementGroup"
  33619. // },
  33620. // "scopes": [
  33621. // "https://www.googleapis.com/auth/dfatrafficking"
  33622. // ]
  33623. // }
  33624. }
  33625. // method id "dfareporting.placementGroups.update":
  33626. type PlacementGroupsUpdateCall struct {
  33627. s *Service
  33628. profileId int64
  33629. placementgroup *PlacementGroup
  33630. urlParams_ gensupport.URLParams
  33631. ctx_ context.Context
  33632. header_ http.Header
  33633. }
  33634. // Update: Updates an existing placement group.
  33635. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  33636. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33637. c.profileId = profileId
  33638. c.placementgroup = placementgroup
  33639. return c
  33640. }
  33641. // Fields allows partial responses to be retrieved. See
  33642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33643. // for more information.
  33644. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  33645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33646. return c
  33647. }
  33648. // Context sets the context to be used in this call's Do method. Any
  33649. // pending HTTP request will be aborted if the provided context is
  33650. // canceled.
  33651. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  33652. c.ctx_ = ctx
  33653. return c
  33654. }
  33655. // Header returns an http.Header that can be modified by the caller to
  33656. // add HTTP headers to the request.
  33657. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  33658. if c.header_ == nil {
  33659. c.header_ = make(http.Header)
  33660. }
  33661. return c.header_
  33662. }
  33663. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  33664. reqHeaders := make(http.Header)
  33665. for k, v := range c.header_ {
  33666. reqHeaders[k] = v
  33667. }
  33668. reqHeaders.Set("User-Agent", c.s.userAgent())
  33669. var body io.Reader = nil
  33670. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33671. if err != nil {
  33672. return nil, err
  33673. }
  33674. reqHeaders.Set("Content-Type", "application/json")
  33675. c.urlParams_.Set("alt", alt)
  33676. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33677. urls += "?" + c.urlParams_.Encode()
  33678. req, _ := http.NewRequest("PUT", urls, body)
  33679. req.Header = reqHeaders
  33680. googleapi.Expand(req.URL, map[string]string{
  33681. "profileId": strconv.FormatInt(c.profileId, 10),
  33682. })
  33683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33684. }
  33685. // Do executes the "dfareporting.placementGroups.update" call.
  33686. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33687. // status code is an error. Response headers are in either
  33688. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33689. // at all) in error.(*googleapi.Error).Header. Use
  33690. // googleapi.IsNotModified to check whether the returned error was
  33691. // because http.StatusNotModified was returned.
  33692. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33693. gensupport.SetOptions(c.urlParams_, opts...)
  33694. res, err := c.doRequest("json")
  33695. if res != nil && res.StatusCode == http.StatusNotModified {
  33696. if res.Body != nil {
  33697. res.Body.Close()
  33698. }
  33699. return nil, &googleapi.Error{
  33700. Code: res.StatusCode,
  33701. Header: res.Header,
  33702. }
  33703. }
  33704. if err != nil {
  33705. return nil, err
  33706. }
  33707. defer googleapi.CloseBody(res)
  33708. if err := googleapi.CheckResponse(res); err != nil {
  33709. return nil, err
  33710. }
  33711. ret := &PlacementGroup{
  33712. ServerResponse: googleapi.ServerResponse{
  33713. Header: res.Header,
  33714. HTTPStatusCode: res.StatusCode,
  33715. },
  33716. }
  33717. target := &ret
  33718. if err := gensupport.DecodeResponse(target, res); err != nil {
  33719. return nil, err
  33720. }
  33721. return ret, nil
  33722. // {
  33723. // "description": "Updates an existing placement group.",
  33724. // "httpMethod": "PUT",
  33725. // "id": "dfareporting.placementGroups.update",
  33726. // "parameterOrder": [
  33727. // "profileId"
  33728. // ],
  33729. // "parameters": {
  33730. // "profileId": {
  33731. // "description": "User profile ID associated with this request.",
  33732. // "format": "int64",
  33733. // "location": "path",
  33734. // "required": true,
  33735. // "type": "string"
  33736. // }
  33737. // },
  33738. // "path": "userprofiles/{profileId}/placementGroups",
  33739. // "request": {
  33740. // "$ref": "PlacementGroup"
  33741. // },
  33742. // "response": {
  33743. // "$ref": "PlacementGroup"
  33744. // },
  33745. // "scopes": [
  33746. // "https://www.googleapis.com/auth/dfatrafficking"
  33747. // ]
  33748. // }
  33749. }
  33750. // method id "dfareporting.placementStrategies.delete":
  33751. type PlacementStrategiesDeleteCall struct {
  33752. s *Service
  33753. profileId int64
  33754. id int64
  33755. urlParams_ gensupport.URLParams
  33756. ctx_ context.Context
  33757. header_ http.Header
  33758. }
  33759. // Delete: Deletes an existing placement strategy.
  33760. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  33761. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33762. c.profileId = profileId
  33763. c.id = id
  33764. return c
  33765. }
  33766. // Fields allows partial responses to be retrieved. See
  33767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33768. // for more information.
  33769. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  33770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33771. return c
  33772. }
  33773. // Context sets the context to be used in this call's Do method. Any
  33774. // pending HTTP request will be aborted if the provided context is
  33775. // canceled.
  33776. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  33777. c.ctx_ = ctx
  33778. return c
  33779. }
  33780. // Header returns an http.Header that can be modified by the caller to
  33781. // add HTTP headers to the request.
  33782. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  33783. if c.header_ == nil {
  33784. c.header_ = make(http.Header)
  33785. }
  33786. return c.header_
  33787. }
  33788. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  33789. reqHeaders := make(http.Header)
  33790. for k, v := range c.header_ {
  33791. reqHeaders[k] = v
  33792. }
  33793. reqHeaders.Set("User-Agent", c.s.userAgent())
  33794. var body io.Reader = nil
  33795. c.urlParams_.Set("alt", alt)
  33796. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  33797. urls += "?" + c.urlParams_.Encode()
  33798. req, _ := http.NewRequest("DELETE", urls, body)
  33799. req.Header = reqHeaders
  33800. googleapi.Expand(req.URL, map[string]string{
  33801. "profileId": strconv.FormatInt(c.profileId, 10),
  33802. "id": strconv.FormatInt(c.id, 10),
  33803. })
  33804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33805. }
  33806. // Do executes the "dfareporting.placementStrategies.delete" call.
  33807. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  33808. gensupport.SetOptions(c.urlParams_, opts...)
  33809. res, err := c.doRequest("json")
  33810. if err != nil {
  33811. return err
  33812. }
  33813. defer googleapi.CloseBody(res)
  33814. if err := googleapi.CheckResponse(res); err != nil {
  33815. return err
  33816. }
  33817. return nil
  33818. // {
  33819. // "description": "Deletes an existing placement strategy.",
  33820. // "httpMethod": "DELETE",
  33821. // "id": "dfareporting.placementStrategies.delete",
  33822. // "parameterOrder": [
  33823. // "profileId",
  33824. // "id"
  33825. // ],
  33826. // "parameters": {
  33827. // "id": {
  33828. // "description": "Placement strategy ID.",
  33829. // "format": "int64",
  33830. // "location": "path",
  33831. // "required": true,
  33832. // "type": "string"
  33833. // },
  33834. // "profileId": {
  33835. // "description": "User profile ID associated with this request.",
  33836. // "format": "int64",
  33837. // "location": "path",
  33838. // "required": true,
  33839. // "type": "string"
  33840. // }
  33841. // },
  33842. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  33843. // "scopes": [
  33844. // "https://www.googleapis.com/auth/dfatrafficking"
  33845. // ]
  33846. // }
  33847. }
  33848. // method id "dfareporting.placementStrategies.get":
  33849. type PlacementStrategiesGetCall struct {
  33850. s *Service
  33851. profileId int64
  33852. id int64
  33853. urlParams_ gensupport.URLParams
  33854. ifNoneMatch_ string
  33855. ctx_ context.Context
  33856. header_ http.Header
  33857. }
  33858. // Get: Gets one placement strategy by ID.
  33859. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  33860. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33861. c.profileId = profileId
  33862. c.id = id
  33863. return c
  33864. }
  33865. // Fields allows partial responses to be retrieved. See
  33866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33867. // for more information.
  33868. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  33869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33870. return c
  33871. }
  33872. // IfNoneMatch sets the optional parameter which makes the operation
  33873. // fail if the object's ETag matches the given value. This is useful for
  33874. // getting updates only after the object has changed since the last
  33875. // request. Use googleapi.IsNotModified to check whether the response
  33876. // error from Do is the result of In-None-Match.
  33877. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  33878. c.ifNoneMatch_ = entityTag
  33879. return c
  33880. }
  33881. // Context sets the context to be used in this call's Do method. Any
  33882. // pending HTTP request will be aborted if the provided context is
  33883. // canceled.
  33884. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  33885. c.ctx_ = ctx
  33886. return c
  33887. }
  33888. // Header returns an http.Header that can be modified by the caller to
  33889. // add HTTP headers to the request.
  33890. func (c *PlacementStrategiesGetCall) Header() http.Header {
  33891. if c.header_ == nil {
  33892. c.header_ = make(http.Header)
  33893. }
  33894. return c.header_
  33895. }
  33896. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  33897. reqHeaders := make(http.Header)
  33898. for k, v := range c.header_ {
  33899. reqHeaders[k] = v
  33900. }
  33901. reqHeaders.Set("User-Agent", c.s.userAgent())
  33902. if c.ifNoneMatch_ != "" {
  33903. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33904. }
  33905. var body io.Reader = nil
  33906. c.urlParams_.Set("alt", alt)
  33907. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  33908. urls += "?" + c.urlParams_.Encode()
  33909. req, _ := http.NewRequest("GET", urls, body)
  33910. req.Header = reqHeaders
  33911. googleapi.Expand(req.URL, map[string]string{
  33912. "profileId": strconv.FormatInt(c.profileId, 10),
  33913. "id": strconv.FormatInt(c.id, 10),
  33914. })
  33915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33916. }
  33917. // Do executes the "dfareporting.placementStrategies.get" call.
  33918. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  33919. // non-2xx status code is an error. Response headers are in either
  33920. // *PlacementStrategy.ServerResponse.Header or (if a response was
  33921. // returned at all) in error.(*googleapi.Error).Header. Use
  33922. // googleapi.IsNotModified to check whether the returned error was
  33923. // because http.StatusNotModified was returned.
  33924. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  33925. gensupport.SetOptions(c.urlParams_, opts...)
  33926. res, err := c.doRequest("json")
  33927. if res != nil && res.StatusCode == http.StatusNotModified {
  33928. if res.Body != nil {
  33929. res.Body.Close()
  33930. }
  33931. return nil, &googleapi.Error{
  33932. Code: res.StatusCode,
  33933. Header: res.Header,
  33934. }
  33935. }
  33936. if err != nil {
  33937. return nil, err
  33938. }
  33939. defer googleapi.CloseBody(res)
  33940. if err := googleapi.CheckResponse(res); err != nil {
  33941. return nil, err
  33942. }
  33943. ret := &PlacementStrategy{
  33944. ServerResponse: googleapi.ServerResponse{
  33945. Header: res.Header,
  33946. HTTPStatusCode: res.StatusCode,
  33947. },
  33948. }
  33949. target := &ret
  33950. if err := gensupport.DecodeResponse(target, res); err != nil {
  33951. return nil, err
  33952. }
  33953. return ret, nil
  33954. // {
  33955. // "description": "Gets one placement strategy by ID.",
  33956. // "httpMethod": "GET",
  33957. // "id": "dfareporting.placementStrategies.get",
  33958. // "parameterOrder": [
  33959. // "profileId",
  33960. // "id"
  33961. // ],
  33962. // "parameters": {
  33963. // "id": {
  33964. // "description": "Placement strategy ID.",
  33965. // "format": "int64",
  33966. // "location": "path",
  33967. // "required": true,
  33968. // "type": "string"
  33969. // },
  33970. // "profileId": {
  33971. // "description": "User profile ID associated with this request.",
  33972. // "format": "int64",
  33973. // "location": "path",
  33974. // "required": true,
  33975. // "type": "string"
  33976. // }
  33977. // },
  33978. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  33979. // "response": {
  33980. // "$ref": "PlacementStrategy"
  33981. // },
  33982. // "scopes": [
  33983. // "https://www.googleapis.com/auth/dfatrafficking"
  33984. // ]
  33985. // }
  33986. }
  33987. // method id "dfareporting.placementStrategies.insert":
  33988. type PlacementStrategiesInsertCall struct {
  33989. s *Service
  33990. profileId int64
  33991. placementstrategy *PlacementStrategy
  33992. urlParams_ gensupport.URLParams
  33993. ctx_ context.Context
  33994. header_ http.Header
  33995. }
  33996. // Insert: Inserts a new placement strategy.
  33997. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  33998. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33999. c.profileId = profileId
  34000. c.placementstrategy = placementstrategy
  34001. return c
  34002. }
  34003. // Fields allows partial responses to be retrieved. See
  34004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34005. // for more information.
  34006. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  34007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34008. return c
  34009. }
  34010. // Context sets the context to be used in this call's Do method. Any
  34011. // pending HTTP request will be aborted if the provided context is
  34012. // canceled.
  34013. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  34014. c.ctx_ = ctx
  34015. return c
  34016. }
  34017. // Header returns an http.Header that can be modified by the caller to
  34018. // add HTTP headers to the request.
  34019. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  34020. if c.header_ == nil {
  34021. c.header_ = make(http.Header)
  34022. }
  34023. return c.header_
  34024. }
  34025. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  34026. reqHeaders := make(http.Header)
  34027. for k, v := range c.header_ {
  34028. reqHeaders[k] = v
  34029. }
  34030. reqHeaders.Set("User-Agent", c.s.userAgent())
  34031. var body io.Reader = nil
  34032. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34033. if err != nil {
  34034. return nil, err
  34035. }
  34036. reqHeaders.Set("Content-Type", "application/json")
  34037. c.urlParams_.Set("alt", alt)
  34038. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34039. urls += "?" + c.urlParams_.Encode()
  34040. req, _ := http.NewRequest("POST", urls, body)
  34041. req.Header = reqHeaders
  34042. googleapi.Expand(req.URL, map[string]string{
  34043. "profileId": strconv.FormatInt(c.profileId, 10),
  34044. })
  34045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34046. }
  34047. // Do executes the "dfareporting.placementStrategies.insert" call.
  34048. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34049. // non-2xx status code is an error. Response headers are in either
  34050. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34051. // returned at all) in error.(*googleapi.Error).Header. Use
  34052. // googleapi.IsNotModified to check whether the returned error was
  34053. // because http.StatusNotModified was returned.
  34054. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34055. gensupport.SetOptions(c.urlParams_, opts...)
  34056. res, err := c.doRequest("json")
  34057. if res != nil && res.StatusCode == http.StatusNotModified {
  34058. if res.Body != nil {
  34059. res.Body.Close()
  34060. }
  34061. return nil, &googleapi.Error{
  34062. Code: res.StatusCode,
  34063. Header: res.Header,
  34064. }
  34065. }
  34066. if err != nil {
  34067. return nil, err
  34068. }
  34069. defer googleapi.CloseBody(res)
  34070. if err := googleapi.CheckResponse(res); err != nil {
  34071. return nil, err
  34072. }
  34073. ret := &PlacementStrategy{
  34074. ServerResponse: googleapi.ServerResponse{
  34075. Header: res.Header,
  34076. HTTPStatusCode: res.StatusCode,
  34077. },
  34078. }
  34079. target := &ret
  34080. if err := gensupport.DecodeResponse(target, res); err != nil {
  34081. return nil, err
  34082. }
  34083. return ret, nil
  34084. // {
  34085. // "description": "Inserts a new placement strategy.",
  34086. // "httpMethod": "POST",
  34087. // "id": "dfareporting.placementStrategies.insert",
  34088. // "parameterOrder": [
  34089. // "profileId"
  34090. // ],
  34091. // "parameters": {
  34092. // "profileId": {
  34093. // "description": "User profile ID associated with this request.",
  34094. // "format": "int64",
  34095. // "location": "path",
  34096. // "required": true,
  34097. // "type": "string"
  34098. // }
  34099. // },
  34100. // "path": "userprofiles/{profileId}/placementStrategies",
  34101. // "request": {
  34102. // "$ref": "PlacementStrategy"
  34103. // },
  34104. // "response": {
  34105. // "$ref": "PlacementStrategy"
  34106. // },
  34107. // "scopes": [
  34108. // "https://www.googleapis.com/auth/dfatrafficking"
  34109. // ]
  34110. // }
  34111. }
  34112. // method id "dfareporting.placementStrategies.list":
  34113. type PlacementStrategiesListCall struct {
  34114. s *Service
  34115. profileId int64
  34116. urlParams_ gensupport.URLParams
  34117. ifNoneMatch_ string
  34118. ctx_ context.Context
  34119. header_ http.Header
  34120. }
  34121. // List: Retrieves a list of placement strategies, possibly filtered.
  34122. // This method supports paging.
  34123. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  34124. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34125. c.profileId = profileId
  34126. return c
  34127. }
  34128. // Ids sets the optional parameter "ids": Select only placement
  34129. // strategies with these IDs.
  34130. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  34131. var ids_ []string
  34132. for _, v := range ids {
  34133. ids_ = append(ids_, fmt.Sprint(v))
  34134. }
  34135. c.urlParams_.SetMulti("ids", ids_)
  34136. return c
  34137. }
  34138. // MaxResults sets the optional parameter "maxResults": Maximum number
  34139. // of results to return.
  34140. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  34141. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34142. return c
  34143. }
  34144. // PageToken sets the optional parameter "pageToken": Value of the
  34145. // nextPageToken from the previous result page.
  34146. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  34147. c.urlParams_.Set("pageToken", pageToken)
  34148. return c
  34149. }
  34150. // SearchString sets the optional parameter "searchString": Allows
  34151. // searching for objects by name or ID. Wildcards (*) are allowed. For
  34152. // example, "placementstrategy*2015" will return objects with names like
  34153. // "placementstrategy June 2015", "placementstrategy April 2015", or
  34154. // simply "placementstrategy 2015". Most of the searches also add
  34155. // wildcards implicitly at the start and the end of the search string.
  34156. // For example, a search string of "placementstrategy" will match
  34157. // objects with name "my placementstrategy", "placementstrategy 2015",
  34158. // or simply "placementstrategy".
  34159. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  34160. c.urlParams_.Set("searchString", searchString)
  34161. return c
  34162. }
  34163. // SortField sets the optional parameter "sortField": Field by which to
  34164. // sort the list.
  34165. //
  34166. // Possible values:
  34167. // "ID" (default)
  34168. // "NAME"
  34169. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  34170. c.urlParams_.Set("sortField", sortField)
  34171. return c
  34172. }
  34173. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34174. // results.
  34175. //
  34176. // Possible values:
  34177. // "ASCENDING" (default)
  34178. // "DESCENDING"
  34179. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  34180. c.urlParams_.Set("sortOrder", sortOrder)
  34181. return c
  34182. }
  34183. // Fields allows partial responses to be retrieved. See
  34184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34185. // for more information.
  34186. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  34187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34188. return c
  34189. }
  34190. // IfNoneMatch sets the optional parameter which makes the operation
  34191. // fail if the object's ETag matches the given value. This is useful for
  34192. // getting updates only after the object has changed since the last
  34193. // request. Use googleapi.IsNotModified to check whether the response
  34194. // error from Do is the result of In-None-Match.
  34195. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  34196. c.ifNoneMatch_ = entityTag
  34197. return c
  34198. }
  34199. // Context sets the context to be used in this call's Do method. Any
  34200. // pending HTTP request will be aborted if the provided context is
  34201. // canceled.
  34202. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  34203. c.ctx_ = ctx
  34204. return c
  34205. }
  34206. // Header returns an http.Header that can be modified by the caller to
  34207. // add HTTP headers to the request.
  34208. func (c *PlacementStrategiesListCall) Header() http.Header {
  34209. if c.header_ == nil {
  34210. c.header_ = make(http.Header)
  34211. }
  34212. return c.header_
  34213. }
  34214. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  34215. reqHeaders := make(http.Header)
  34216. for k, v := range c.header_ {
  34217. reqHeaders[k] = v
  34218. }
  34219. reqHeaders.Set("User-Agent", c.s.userAgent())
  34220. if c.ifNoneMatch_ != "" {
  34221. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34222. }
  34223. var body io.Reader = nil
  34224. c.urlParams_.Set("alt", alt)
  34225. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34226. urls += "?" + c.urlParams_.Encode()
  34227. req, _ := http.NewRequest("GET", urls, body)
  34228. req.Header = reqHeaders
  34229. googleapi.Expand(req.URL, map[string]string{
  34230. "profileId": strconv.FormatInt(c.profileId, 10),
  34231. })
  34232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34233. }
  34234. // Do executes the "dfareporting.placementStrategies.list" call.
  34235. // Exactly one of *PlacementStrategiesListResponse or error will be
  34236. // non-nil. Any non-2xx status code is an error. Response headers are in
  34237. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  34238. // a response was returned at all) in error.(*googleapi.Error).Header.
  34239. // Use googleapi.IsNotModified to check whether the returned error was
  34240. // because http.StatusNotModified was returned.
  34241. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  34242. gensupport.SetOptions(c.urlParams_, opts...)
  34243. res, err := c.doRequest("json")
  34244. if res != nil && res.StatusCode == http.StatusNotModified {
  34245. if res.Body != nil {
  34246. res.Body.Close()
  34247. }
  34248. return nil, &googleapi.Error{
  34249. Code: res.StatusCode,
  34250. Header: res.Header,
  34251. }
  34252. }
  34253. if err != nil {
  34254. return nil, err
  34255. }
  34256. defer googleapi.CloseBody(res)
  34257. if err := googleapi.CheckResponse(res); err != nil {
  34258. return nil, err
  34259. }
  34260. ret := &PlacementStrategiesListResponse{
  34261. ServerResponse: googleapi.ServerResponse{
  34262. Header: res.Header,
  34263. HTTPStatusCode: res.StatusCode,
  34264. },
  34265. }
  34266. target := &ret
  34267. if err := gensupport.DecodeResponse(target, res); err != nil {
  34268. return nil, err
  34269. }
  34270. return ret, nil
  34271. // {
  34272. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  34273. // "httpMethod": "GET",
  34274. // "id": "dfareporting.placementStrategies.list",
  34275. // "parameterOrder": [
  34276. // "profileId"
  34277. // ],
  34278. // "parameters": {
  34279. // "ids": {
  34280. // "description": "Select only placement strategies with these IDs.",
  34281. // "format": "int64",
  34282. // "location": "query",
  34283. // "repeated": true,
  34284. // "type": "string"
  34285. // },
  34286. // "maxResults": {
  34287. // "default": "1000",
  34288. // "description": "Maximum number of results to return.",
  34289. // "format": "int32",
  34290. // "location": "query",
  34291. // "maximum": "1000",
  34292. // "minimum": "0",
  34293. // "type": "integer"
  34294. // },
  34295. // "pageToken": {
  34296. // "description": "Value of the nextPageToken from the previous result page.",
  34297. // "location": "query",
  34298. // "type": "string"
  34299. // },
  34300. // "profileId": {
  34301. // "description": "User profile ID associated with this request.",
  34302. // "format": "int64",
  34303. // "location": "path",
  34304. // "required": true,
  34305. // "type": "string"
  34306. // },
  34307. // "searchString": {
  34308. // "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\".",
  34309. // "location": "query",
  34310. // "type": "string"
  34311. // },
  34312. // "sortField": {
  34313. // "default": "ID",
  34314. // "description": "Field by which to sort the list.",
  34315. // "enum": [
  34316. // "ID",
  34317. // "NAME"
  34318. // ],
  34319. // "enumDescriptions": [
  34320. // "",
  34321. // ""
  34322. // ],
  34323. // "location": "query",
  34324. // "type": "string"
  34325. // },
  34326. // "sortOrder": {
  34327. // "default": "ASCENDING",
  34328. // "description": "Order of sorted results.",
  34329. // "enum": [
  34330. // "ASCENDING",
  34331. // "DESCENDING"
  34332. // ],
  34333. // "enumDescriptions": [
  34334. // "",
  34335. // ""
  34336. // ],
  34337. // "location": "query",
  34338. // "type": "string"
  34339. // }
  34340. // },
  34341. // "path": "userprofiles/{profileId}/placementStrategies",
  34342. // "response": {
  34343. // "$ref": "PlacementStrategiesListResponse"
  34344. // },
  34345. // "scopes": [
  34346. // "https://www.googleapis.com/auth/dfatrafficking"
  34347. // ]
  34348. // }
  34349. }
  34350. // Pages invokes f for each page of results.
  34351. // A non-nil error returned from f will halt the iteration.
  34352. // The provided context supersedes any context provided to the Context method.
  34353. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  34354. c.ctx_ = ctx
  34355. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34356. for {
  34357. x, err := c.Do()
  34358. if err != nil {
  34359. return err
  34360. }
  34361. if err := f(x); err != nil {
  34362. return err
  34363. }
  34364. if x.NextPageToken == "" {
  34365. return nil
  34366. }
  34367. c.PageToken(x.NextPageToken)
  34368. }
  34369. }
  34370. // method id "dfareporting.placementStrategies.patch":
  34371. type PlacementStrategiesPatchCall struct {
  34372. s *Service
  34373. profileId int64
  34374. placementstrategy *PlacementStrategy
  34375. urlParams_ gensupport.URLParams
  34376. ctx_ context.Context
  34377. header_ http.Header
  34378. }
  34379. // Patch: Updates an existing placement strategy. This method supports
  34380. // patch semantics.
  34381. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  34382. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34383. c.profileId = profileId
  34384. c.urlParams_.Set("id", fmt.Sprint(id))
  34385. c.placementstrategy = placementstrategy
  34386. return c
  34387. }
  34388. // Fields allows partial responses to be retrieved. See
  34389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34390. // for more information.
  34391. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  34392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34393. return c
  34394. }
  34395. // Context sets the context to be used in this call's Do method. Any
  34396. // pending HTTP request will be aborted if the provided context is
  34397. // canceled.
  34398. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  34399. c.ctx_ = ctx
  34400. return c
  34401. }
  34402. // Header returns an http.Header that can be modified by the caller to
  34403. // add HTTP headers to the request.
  34404. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  34405. if c.header_ == nil {
  34406. c.header_ = make(http.Header)
  34407. }
  34408. return c.header_
  34409. }
  34410. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  34411. reqHeaders := make(http.Header)
  34412. for k, v := range c.header_ {
  34413. reqHeaders[k] = v
  34414. }
  34415. reqHeaders.Set("User-Agent", c.s.userAgent())
  34416. var body io.Reader = nil
  34417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34418. if err != nil {
  34419. return nil, err
  34420. }
  34421. reqHeaders.Set("Content-Type", "application/json")
  34422. c.urlParams_.Set("alt", alt)
  34423. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34424. urls += "?" + c.urlParams_.Encode()
  34425. req, _ := http.NewRequest("PATCH", urls, body)
  34426. req.Header = reqHeaders
  34427. googleapi.Expand(req.URL, map[string]string{
  34428. "profileId": strconv.FormatInt(c.profileId, 10),
  34429. })
  34430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34431. }
  34432. // Do executes the "dfareporting.placementStrategies.patch" call.
  34433. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34434. // non-2xx status code is an error. Response headers are in either
  34435. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34436. // returned at all) in error.(*googleapi.Error).Header. Use
  34437. // googleapi.IsNotModified to check whether the returned error was
  34438. // because http.StatusNotModified was returned.
  34439. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34440. gensupport.SetOptions(c.urlParams_, opts...)
  34441. res, err := c.doRequest("json")
  34442. if res != nil && res.StatusCode == http.StatusNotModified {
  34443. if res.Body != nil {
  34444. res.Body.Close()
  34445. }
  34446. return nil, &googleapi.Error{
  34447. Code: res.StatusCode,
  34448. Header: res.Header,
  34449. }
  34450. }
  34451. if err != nil {
  34452. return nil, err
  34453. }
  34454. defer googleapi.CloseBody(res)
  34455. if err := googleapi.CheckResponse(res); err != nil {
  34456. return nil, err
  34457. }
  34458. ret := &PlacementStrategy{
  34459. ServerResponse: googleapi.ServerResponse{
  34460. Header: res.Header,
  34461. HTTPStatusCode: res.StatusCode,
  34462. },
  34463. }
  34464. target := &ret
  34465. if err := gensupport.DecodeResponse(target, res); err != nil {
  34466. return nil, err
  34467. }
  34468. return ret, nil
  34469. // {
  34470. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  34471. // "httpMethod": "PATCH",
  34472. // "id": "dfareporting.placementStrategies.patch",
  34473. // "parameterOrder": [
  34474. // "profileId",
  34475. // "id"
  34476. // ],
  34477. // "parameters": {
  34478. // "id": {
  34479. // "description": "Placement strategy ID.",
  34480. // "format": "int64",
  34481. // "location": "query",
  34482. // "required": true,
  34483. // "type": "string"
  34484. // },
  34485. // "profileId": {
  34486. // "description": "User profile ID associated with this request.",
  34487. // "format": "int64",
  34488. // "location": "path",
  34489. // "required": true,
  34490. // "type": "string"
  34491. // }
  34492. // },
  34493. // "path": "userprofiles/{profileId}/placementStrategies",
  34494. // "request": {
  34495. // "$ref": "PlacementStrategy"
  34496. // },
  34497. // "response": {
  34498. // "$ref": "PlacementStrategy"
  34499. // },
  34500. // "scopes": [
  34501. // "https://www.googleapis.com/auth/dfatrafficking"
  34502. // ]
  34503. // }
  34504. }
  34505. // method id "dfareporting.placementStrategies.update":
  34506. type PlacementStrategiesUpdateCall struct {
  34507. s *Service
  34508. profileId int64
  34509. placementstrategy *PlacementStrategy
  34510. urlParams_ gensupport.URLParams
  34511. ctx_ context.Context
  34512. header_ http.Header
  34513. }
  34514. // Update: Updates an existing placement strategy.
  34515. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  34516. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34517. c.profileId = profileId
  34518. c.placementstrategy = placementstrategy
  34519. return c
  34520. }
  34521. // Fields allows partial responses to be retrieved. See
  34522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34523. // for more information.
  34524. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  34525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34526. return c
  34527. }
  34528. // Context sets the context to be used in this call's Do method. Any
  34529. // pending HTTP request will be aborted if the provided context is
  34530. // canceled.
  34531. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  34532. c.ctx_ = ctx
  34533. return c
  34534. }
  34535. // Header returns an http.Header that can be modified by the caller to
  34536. // add HTTP headers to the request.
  34537. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  34538. if c.header_ == nil {
  34539. c.header_ = make(http.Header)
  34540. }
  34541. return c.header_
  34542. }
  34543. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  34544. reqHeaders := make(http.Header)
  34545. for k, v := range c.header_ {
  34546. reqHeaders[k] = v
  34547. }
  34548. reqHeaders.Set("User-Agent", c.s.userAgent())
  34549. var body io.Reader = nil
  34550. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34551. if err != nil {
  34552. return nil, err
  34553. }
  34554. reqHeaders.Set("Content-Type", "application/json")
  34555. c.urlParams_.Set("alt", alt)
  34556. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34557. urls += "?" + c.urlParams_.Encode()
  34558. req, _ := http.NewRequest("PUT", urls, body)
  34559. req.Header = reqHeaders
  34560. googleapi.Expand(req.URL, map[string]string{
  34561. "profileId": strconv.FormatInt(c.profileId, 10),
  34562. })
  34563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34564. }
  34565. // Do executes the "dfareporting.placementStrategies.update" call.
  34566. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34567. // non-2xx status code is an error. Response headers are in either
  34568. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34569. // returned at all) in error.(*googleapi.Error).Header. Use
  34570. // googleapi.IsNotModified to check whether the returned error was
  34571. // because http.StatusNotModified was returned.
  34572. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34573. gensupport.SetOptions(c.urlParams_, opts...)
  34574. res, err := c.doRequest("json")
  34575. if res != nil && res.StatusCode == http.StatusNotModified {
  34576. if res.Body != nil {
  34577. res.Body.Close()
  34578. }
  34579. return nil, &googleapi.Error{
  34580. Code: res.StatusCode,
  34581. Header: res.Header,
  34582. }
  34583. }
  34584. if err != nil {
  34585. return nil, err
  34586. }
  34587. defer googleapi.CloseBody(res)
  34588. if err := googleapi.CheckResponse(res); err != nil {
  34589. return nil, err
  34590. }
  34591. ret := &PlacementStrategy{
  34592. ServerResponse: googleapi.ServerResponse{
  34593. Header: res.Header,
  34594. HTTPStatusCode: res.StatusCode,
  34595. },
  34596. }
  34597. target := &ret
  34598. if err := gensupport.DecodeResponse(target, res); err != nil {
  34599. return nil, err
  34600. }
  34601. return ret, nil
  34602. // {
  34603. // "description": "Updates an existing placement strategy.",
  34604. // "httpMethod": "PUT",
  34605. // "id": "dfareporting.placementStrategies.update",
  34606. // "parameterOrder": [
  34607. // "profileId"
  34608. // ],
  34609. // "parameters": {
  34610. // "profileId": {
  34611. // "description": "User profile ID associated with this request.",
  34612. // "format": "int64",
  34613. // "location": "path",
  34614. // "required": true,
  34615. // "type": "string"
  34616. // }
  34617. // },
  34618. // "path": "userprofiles/{profileId}/placementStrategies",
  34619. // "request": {
  34620. // "$ref": "PlacementStrategy"
  34621. // },
  34622. // "response": {
  34623. // "$ref": "PlacementStrategy"
  34624. // },
  34625. // "scopes": [
  34626. // "https://www.googleapis.com/auth/dfatrafficking"
  34627. // ]
  34628. // }
  34629. }
  34630. // method id "dfareporting.placements.generatetags":
  34631. type PlacementsGeneratetagsCall struct {
  34632. s *Service
  34633. profileId int64
  34634. urlParams_ gensupport.URLParams
  34635. ctx_ context.Context
  34636. header_ http.Header
  34637. }
  34638. // Generatetags: Generates tags for a placement.
  34639. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  34640. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34641. c.profileId = profileId
  34642. return c
  34643. }
  34644. // CampaignId sets the optional parameter "campaignId": Generate
  34645. // placements belonging to this campaign. This is a required field.
  34646. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  34647. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  34648. return c
  34649. }
  34650. // PlacementIds sets the optional parameter "placementIds": Generate
  34651. // tags for these placements.
  34652. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  34653. var placementIds_ []string
  34654. for _, v := range placementIds {
  34655. placementIds_ = append(placementIds_, fmt.Sprint(v))
  34656. }
  34657. c.urlParams_.SetMulti("placementIds", placementIds_)
  34658. return c
  34659. }
  34660. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  34661. // generate for these placements.
  34662. //
  34663. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  34664. // placements.
  34665. //
  34666. // Possible values:
  34667. // "PLACEMENT_TAG_CLICK_COMMANDS"
  34668. // "PLACEMENT_TAG_IFRAME_ILAYER"
  34669. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  34670. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  34671. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  34672. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  34673. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  34674. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  34675. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  34676. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  34677. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  34678. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  34679. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  34680. // "PLACEMENT_TAG_JAVASCRIPT"
  34681. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  34682. // "PLACEMENT_TAG_STANDARD"
  34683. // "PLACEMENT_TAG_TRACKING"
  34684. // "PLACEMENT_TAG_TRACKING_IFRAME"
  34685. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  34686. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  34687. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  34688. return c
  34689. }
  34690. // Fields allows partial responses to be retrieved. See
  34691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34692. // for more information.
  34693. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  34694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34695. return c
  34696. }
  34697. // Context sets the context to be used in this call's Do method. Any
  34698. // pending HTTP request will be aborted if the provided context is
  34699. // canceled.
  34700. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  34701. c.ctx_ = ctx
  34702. return c
  34703. }
  34704. // Header returns an http.Header that can be modified by the caller to
  34705. // add HTTP headers to the request.
  34706. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  34707. if c.header_ == nil {
  34708. c.header_ = make(http.Header)
  34709. }
  34710. return c.header_
  34711. }
  34712. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  34713. reqHeaders := make(http.Header)
  34714. for k, v := range c.header_ {
  34715. reqHeaders[k] = v
  34716. }
  34717. reqHeaders.Set("User-Agent", c.s.userAgent())
  34718. var body io.Reader = nil
  34719. c.urlParams_.Set("alt", alt)
  34720. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  34721. urls += "?" + c.urlParams_.Encode()
  34722. req, _ := http.NewRequest("POST", urls, body)
  34723. req.Header = reqHeaders
  34724. googleapi.Expand(req.URL, map[string]string{
  34725. "profileId": strconv.FormatInt(c.profileId, 10),
  34726. })
  34727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34728. }
  34729. // Do executes the "dfareporting.placements.generatetags" call.
  34730. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  34731. // non-nil. Any non-2xx status code is an error. Response headers are in
  34732. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  34733. // response was returned at all) in error.(*googleapi.Error).Header. Use
  34734. // googleapi.IsNotModified to check whether the returned error was
  34735. // because http.StatusNotModified was returned.
  34736. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  34737. gensupport.SetOptions(c.urlParams_, opts...)
  34738. res, err := c.doRequest("json")
  34739. if res != nil && res.StatusCode == http.StatusNotModified {
  34740. if res.Body != nil {
  34741. res.Body.Close()
  34742. }
  34743. return nil, &googleapi.Error{
  34744. Code: res.StatusCode,
  34745. Header: res.Header,
  34746. }
  34747. }
  34748. if err != nil {
  34749. return nil, err
  34750. }
  34751. defer googleapi.CloseBody(res)
  34752. if err := googleapi.CheckResponse(res); err != nil {
  34753. return nil, err
  34754. }
  34755. ret := &PlacementsGenerateTagsResponse{
  34756. ServerResponse: googleapi.ServerResponse{
  34757. Header: res.Header,
  34758. HTTPStatusCode: res.StatusCode,
  34759. },
  34760. }
  34761. target := &ret
  34762. if err := gensupport.DecodeResponse(target, res); err != nil {
  34763. return nil, err
  34764. }
  34765. return ret, nil
  34766. // {
  34767. // "description": "Generates tags for a placement.",
  34768. // "httpMethod": "POST",
  34769. // "id": "dfareporting.placements.generatetags",
  34770. // "parameterOrder": [
  34771. // "profileId"
  34772. // ],
  34773. // "parameters": {
  34774. // "campaignId": {
  34775. // "description": "Generate placements belonging to this campaign. This is a required field.",
  34776. // "format": "int64",
  34777. // "location": "query",
  34778. // "type": "string"
  34779. // },
  34780. // "placementIds": {
  34781. // "description": "Generate tags for these placements.",
  34782. // "format": "int64",
  34783. // "location": "query",
  34784. // "repeated": true,
  34785. // "type": "string"
  34786. // },
  34787. // "profileId": {
  34788. // "description": "User profile ID associated with this request.",
  34789. // "format": "int64",
  34790. // "location": "path",
  34791. // "required": true,
  34792. // "type": "string"
  34793. // },
  34794. // "tagFormats": {
  34795. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  34796. // "enum": [
  34797. // "PLACEMENT_TAG_CLICK_COMMANDS",
  34798. // "PLACEMENT_TAG_IFRAME_ILAYER",
  34799. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  34800. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  34801. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  34802. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  34803. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  34804. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  34805. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  34806. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  34807. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  34808. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  34809. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  34810. // "PLACEMENT_TAG_JAVASCRIPT",
  34811. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  34812. // "PLACEMENT_TAG_STANDARD",
  34813. // "PLACEMENT_TAG_TRACKING",
  34814. // "PLACEMENT_TAG_TRACKING_IFRAME",
  34815. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  34816. // ],
  34817. // "enumDescriptions": [
  34818. // "",
  34819. // "",
  34820. // "",
  34821. // "",
  34822. // "",
  34823. // "",
  34824. // "",
  34825. // "",
  34826. // "",
  34827. // "",
  34828. // "",
  34829. // "",
  34830. // "",
  34831. // "",
  34832. // "",
  34833. // "",
  34834. // "",
  34835. // "",
  34836. // ""
  34837. // ],
  34838. // "location": "query",
  34839. // "repeated": true,
  34840. // "type": "string"
  34841. // }
  34842. // },
  34843. // "path": "userprofiles/{profileId}/placements/generatetags",
  34844. // "response": {
  34845. // "$ref": "PlacementsGenerateTagsResponse"
  34846. // },
  34847. // "scopes": [
  34848. // "https://www.googleapis.com/auth/dfatrafficking"
  34849. // ]
  34850. // }
  34851. }
  34852. // method id "dfareporting.placements.get":
  34853. type PlacementsGetCall struct {
  34854. s *Service
  34855. profileId int64
  34856. id int64
  34857. urlParams_ gensupport.URLParams
  34858. ifNoneMatch_ string
  34859. ctx_ context.Context
  34860. header_ http.Header
  34861. }
  34862. // Get: Gets one placement by ID.
  34863. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  34864. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34865. c.profileId = profileId
  34866. c.id = id
  34867. return c
  34868. }
  34869. // Fields allows partial responses to be retrieved. See
  34870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34871. // for more information.
  34872. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  34873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34874. return c
  34875. }
  34876. // IfNoneMatch sets the optional parameter which makes the operation
  34877. // fail if the object's ETag matches the given value. This is useful for
  34878. // getting updates only after the object has changed since the last
  34879. // request. Use googleapi.IsNotModified to check whether the response
  34880. // error from Do is the result of In-None-Match.
  34881. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  34882. c.ifNoneMatch_ = entityTag
  34883. return c
  34884. }
  34885. // Context sets the context to be used in this call's Do method. Any
  34886. // pending HTTP request will be aborted if the provided context is
  34887. // canceled.
  34888. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  34889. c.ctx_ = ctx
  34890. return c
  34891. }
  34892. // Header returns an http.Header that can be modified by the caller to
  34893. // add HTTP headers to the request.
  34894. func (c *PlacementsGetCall) Header() http.Header {
  34895. if c.header_ == nil {
  34896. c.header_ = make(http.Header)
  34897. }
  34898. return c.header_
  34899. }
  34900. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  34901. reqHeaders := make(http.Header)
  34902. for k, v := range c.header_ {
  34903. reqHeaders[k] = v
  34904. }
  34905. reqHeaders.Set("User-Agent", c.s.userAgent())
  34906. if c.ifNoneMatch_ != "" {
  34907. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34908. }
  34909. var body io.Reader = nil
  34910. c.urlParams_.Set("alt", alt)
  34911. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  34912. urls += "?" + c.urlParams_.Encode()
  34913. req, _ := http.NewRequest("GET", urls, body)
  34914. req.Header = reqHeaders
  34915. googleapi.Expand(req.URL, map[string]string{
  34916. "profileId": strconv.FormatInt(c.profileId, 10),
  34917. "id": strconv.FormatInt(c.id, 10),
  34918. })
  34919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34920. }
  34921. // Do executes the "dfareporting.placements.get" call.
  34922. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  34923. // status code is an error. Response headers are in either
  34924. // *Placement.ServerResponse.Header or (if a response was returned at
  34925. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34926. // to check whether the returned error was because
  34927. // http.StatusNotModified was returned.
  34928. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  34929. gensupport.SetOptions(c.urlParams_, opts...)
  34930. res, err := c.doRequest("json")
  34931. if res != nil && res.StatusCode == http.StatusNotModified {
  34932. if res.Body != nil {
  34933. res.Body.Close()
  34934. }
  34935. return nil, &googleapi.Error{
  34936. Code: res.StatusCode,
  34937. Header: res.Header,
  34938. }
  34939. }
  34940. if err != nil {
  34941. return nil, err
  34942. }
  34943. defer googleapi.CloseBody(res)
  34944. if err := googleapi.CheckResponse(res); err != nil {
  34945. return nil, err
  34946. }
  34947. ret := &Placement{
  34948. ServerResponse: googleapi.ServerResponse{
  34949. Header: res.Header,
  34950. HTTPStatusCode: res.StatusCode,
  34951. },
  34952. }
  34953. target := &ret
  34954. if err := gensupport.DecodeResponse(target, res); err != nil {
  34955. return nil, err
  34956. }
  34957. return ret, nil
  34958. // {
  34959. // "description": "Gets one placement by ID.",
  34960. // "httpMethod": "GET",
  34961. // "id": "dfareporting.placements.get",
  34962. // "parameterOrder": [
  34963. // "profileId",
  34964. // "id"
  34965. // ],
  34966. // "parameters": {
  34967. // "id": {
  34968. // "description": "Placement ID.",
  34969. // "format": "int64",
  34970. // "location": "path",
  34971. // "required": true,
  34972. // "type": "string"
  34973. // },
  34974. // "profileId": {
  34975. // "description": "User profile ID associated with this request.",
  34976. // "format": "int64",
  34977. // "location": "path",
  34978. // "required": true,
  34979. // "type": "string"
  34980. // }
  34981. // },
  34982. // "path": "userprofiles/{profileId}/placements/{id}",
  34983. // "response": {
  34984. // "$ref": "Placement"
  34985. // },
  34986. // "scopes": [
  34987. // "https://www.googleapis.com/auth/dfatrafficking"
  34988. // ]
  34989. // }
  34990. }
  34991. // method id "dfareporting.placements.insert":
  34992. type PlacementsInsertCall struct {
  34993. s *Service
  34994. profileId int64
  34995. placement *Placement
  34996. urlParams_ gensupport.URLParams
  34997. ctx_ context.Context
  34998. header_ http.Header
  34999. }
  35000. // Insert: Inserts a new placement.
  35001. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  35002. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35003. c.profileId = profileId
  35004. c.placement = placement
  35005. return c
  35006. }
  35007. // Fields allows partial responses to be retrieved. See
  35008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35009. // for more information.
  35010. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  35011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35012. return c
  35013. }
  35014. // Context sets the context to be used in this call's Do method. Any
  35015. // pending HTTP request will be aborted if the provided context is
  35016. // canceled.
  35017. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  35018. c.ctx_ = ctx
  35019. return c
  35020. }
  35021. // Header returns an http.Header that can be modified by the caller to
  35022. // add HTTP headers to the request.
  35023. func (c *PlacementsInsertCall) Header() http.Header {
  35024. if c.header_ == nil {
  35025. c.header_ = make(http.Header)
  35026. }
  35027. return c.header_
  35028. }
  35029. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  35030. reqHeaders := make(http.Header)
  35031. for k, v := range c.header_ {
  35032. reqHeaders[k] = v
  35033. }
  35034. reqHeaders.Set("User-Agent", c.s.userAgent())
  35035. var body io.Reader = nil
  35036. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35037. if err != nil {
  35038. return nil, err
  35039. }
  35040. reqHeaders.Set("Content-Type", "application/json")
  35041. c.urlParams_.Set("alt", alt)
  35042. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35043. urls += "?" + c.urlParams_.Encode()
  35044. req, _ := http.NewRequest("POST", urls, body)
  35045. req.Header = reqHeaders
  35046. googleapi.Expand(req.URL, map[string]string{
  35047. "profileId": strconv.FormatInt(c.profileId, 10),
  35048. })
  35049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35050. }
  35051. // Do executes the "dfareporting.placements.insert" call.
  35052. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35053. // status code is an error. Response headers are in either
  35054. // *Placement.ServerResponse.Header or (if a response was returned at
  35055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35056. // to check whether the returned error was because
  35057. // http.StatusNotModified was returned.
  35058. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35059. gensupport.SetOptions(c.urlParams_, opts...)
  35060. res, err := c.doRequest("json")
  35061. if res != nil && res.StatusCode == http.StatusNotModified {
  35062. if res.Body != nil {
  35063. res.Body.Close()
  35064. }
  35065. return nil, &googleapi.Error{
  35066. Code: res.StatusCode,
  35067. Header: res.Header,
  35068. }
  35069. }
  35070. if err != nil {
  35071. return nil, err
  35072. }
  35073. defer googleapi.CloseBody(res)
  35074. if err := googleapi.CheckResponse(res); err != nil {
  35075. return nil, err
  35076. }
  35077. ret := &Placement{
  35078. ServerResponse: googleapi.ServerResponse{
  35079. Header: res.Header,
  35080. HTTPStatusCode: res.StatusCode,
  35081. },
  35082. }
  35083. target := &ret
  35084. if err := gensupport.DecodeResponse(target, res); err != nil {
  35085. return nil, err
  35086. }
  35087. return ret, nil
  35088. // {
  35089. // "description": "Inserts a new placement.",
  35090. // "httpMethod": "POST",
  35091. // "id": "dfareporting.placements.insert",
  35092. // "parameterOrder": [
  35093. // "profileId"
  35094. // ],
  35095. // "parameters": {
  35096. // "profileId": {
  35097. // "description": "User profile ID associated with this request.",
  35098. // "format": "int64",
  35099. // "location": "path",
  35100. // "required": true,
  35101. // "type": "string"
  35102. // }
  35103. // },
  35104. // "path": "userprofiles/{profileId}/placements",
  35105. // "request": {
  35106. // "$ref": "Placement"
  35107. // },
  35108. // "response": {
  35109. // "$ref": "Placement"
  35110. // },
  35111. // "scopes": [
  35112. // "https://www.googleapis.com/auth/dfatrafficking"
  35113. // ]
  35114. // }
  35115. }
  35116. // method id "dfareporting.placements.list":
  35117. type PlacementsListCall struct {
  35118. s *Service
  35119. profileId int64
  35120. urlParams_ gensupport.URLParams
  35121. ifNoneMatch_ string
  35122. ctx_ context.Context
  35123. header_ http.Header
  35124. }
  35125. // List: Retrieves a list of placements, possibly filtered. This method
  35126. // supports paging.
  35127. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  35128. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35129. c.profileId = profileId
  35130. return c
  35131. }
  35132. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  35133. // only placements that belong to these advertisers.
  35134. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  35135. var advertiserIds_ []string
  35136. for _, v := range advertiserIds {
  35137. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  35138. }
  35139. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  35140. return c
  35141. }
  35142. // Archived sets the optional parameter "archived": Select only archived
  35143. // placements. Don't set this field to select both archived and
  35144. // non-archived placements.
  35145. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  35146. c.urlParams_.Set("archived", fmt.Sprint(archived))
  35147. return c
  35148. }
  35149. // CampaignIds sets the optional parameter "campaignIds": Select only
  35150. // placements that belong to these campaigns.
  35151. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  35152. var campaignIds_ []string
  35153. for _, v := range campaignIds {
  35154. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  35155. }
  35156. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  35157. return c
  35158. }
  35159. // Compatibilities sets the optional parameter "compatibilities": Select
  35160. // only placements that are associated with these compatibilities.
  35161. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  35162. // or on mobile devices for regular or interstitial ads respectively.
  35163. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  35164. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  35165. // with the VAST standard.
  35166. //
  35167. // Possible values:
  35168. // "APP"
  35169. // "APP_INTERSTITIAL"
  35170. // "DISPLAY"
  35171. // "DISPLAY_INTERSTITIAL"
  35172. // "IN_STREAM_VIDEO"
  35173. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  35174. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  35175. return c
  35176. }
  35177. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  35178. // Select only placements that are associated with these content
  35179. // categories.
  35180. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  35181. var contentCategoryIds_ []string
  35182. for _, v := range contentCategoryIds {
  35183. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  35184. }
  35185. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  35186. return c
  35187. }
  35188. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  35189. // Select only placements that are associated with these directory
  35190. // sites.
  35191. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  35192. var directorySiteIds_ []string
  35193. for _, v := range directorySiteIds {
  35194. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  35195. }
  35196. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  35197. return c
  35198. }
  35199. // GroupIds sets the optional parameter "groupIds": Select only
  35200. // placements that belong to these placement groups.
  35201. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  35202. var groupIds_ []string
  35203. for _, v := range groupIds {
  35204. groupIds_ = append(groupIds_, fmt.Sprint(v))
  35205. }
  35206. c.urlParams_.SetMulti("groupIds", groupIds_)
  35207. return c
  35208. }
  35209. // Ids sets the optional parameter "ids": Select only placements with
  35210. // these IDs.
  35211. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  35212. var ids_ []string
  35213. for _, v := range ids {
  35214. ids_ = append(ids_, fmt.Sprint(v))
  35215. }
  35216. c.urlParams_.SetMulti("ids", ids_)
  35217. return c
  35218. }
  35219. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  35220. // placements or placement groups whose end date is on or before the
  35221. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  35222. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  35223. c.urlParams_.Set("maxEndDate", maxEndDate)
  35224. return c
  35225. }
  35226. // MaxResults sets the optional parameter "maxResults": Maximum number
  35227. // of results to return.
  35228. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  35229. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35230. return c
  35231. }
  35232. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  35233. // placements or placement groups whose start date is on or before the
  35234. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  35235. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  35236. c.urlParams_.Set("maxStartDate", maxStartDate)
  35237. return c
  35238. }
  35239. // MinEndDate sets the optional parameter "minEndDate": Select only
  35240. // placements or placement groups whose end date is on or after the
  35241. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  35242. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  35243. c.urlParams_.Set("minEndDate", minEndDate)
  35244. return c
  35245. }
  35246. // MinStartDate sets the optional parameter "minStartDate": Select only
  35247. // placements or placement groups whose start date is on or after the
  35248. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  35249. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  35250. c.urlParams_.Set("minStartDate", minStartDate)
  35251. return c
  35252. }
  35253. // PageToken sets the optional parameter "pageToken": Value of the
  35254. // nextPageToken from the previous result page.
  35255. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  35256. c.urlParams_.Set("pageToken", pageToken)
  35257. return c
  35258. }
  35259. // PaymentSource sets the optional parameter "paymentSource": Select
  35260. // only placements with this payment source.
  35261. //
  35262. // Possible values:
  35263. // "PLACEMENT_AGENCY_PAID"
  35264. // "PLACEMENT_PUBLISHER_PAID"
  35265. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  35266. c.urlParams_.Set("paymentSource", paymentSource)
  35267. return c
  35268. }
  35269. // PlacementStrategyIds sets the optional parameter
  35270. // "placementStrategyIds": Select only placements that are associated
  35271. // with these placement strategies.
  35272. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  35273. var placementStrategyIds_ []string
  35274. for _, v := range placementStrategyIds {
  35275. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  35276. }
  35277. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  35278. return c
  35279. }
  35280. // PricingTypes sets the optional parameter "pricingTypes": Select only
  35281. // placements with these pricing types.
  35282. //
  35283. // Possible values:
  35284. // "PRICING_TYPE_CPA"
  35285. // "PRICING_TYPE_CPC"
  35286. // "PRICING_TYPE_CPM"
  35287. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  35288. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  35289. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  35290. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  35291. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  35292. return c
  35293. }
  35294. // SearchString sets the optional parameter "searchString": Allows
  35295. // searching for placements by name or ID. Wildcards (*) are allowed.
  35296. // For example, "placement*2015" will return placements with names like
  35297. // "placement June 2015", "placement May 2015", or simply "placements
  35298. // 2015". Most of the searches also add wildcards implicitly at the
  35299. // start and the end of the search string. For example, a search string
  35300. // of "placement" will match placements with name "my placement",
  35301. // "placement 2015", or simply "placement".
  35302. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  35303. c.urlParams_.Set("searchString", searchString)
  35304. return c
  35305. }
  35306. // SiteIds sets the optional parameter "siteIds": Select only placements
  35307. // that are associated with these sites.
  35308. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  35309. var siteIds_ []string
  35310. for _, v := range siteIds {
  35311. siteIds_ = append(siteIds_, fmt.Sprint(v))
  35312. }
  35313. c.urlParams_.SetMulti("siteIds", siteIds_)
  35314. return c
  35315. }
  35316. // SizeIds sets the optional parameter "sizeIds": Select only placements
  35317. // that are associated with these sizes.
  35318. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  35319. var sizeIds_ []string
  35320. for _, v := range sizeIds {
  35321. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  35322. }
  35323. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  35324. return c
  35325. }
  35326. // SortField sets the optional parameter "sortField": Field by which to
  35327. // sort the list.
  35328. //
  35329. // Possible values:
  35330. // "ID" (default)
  35331. // "NAME"
  35332. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  35333. c.urlParams_.Set("sortField", sortField)
  35334. return c
  35335. }
  35336. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35337. // results.
  35338. //
  35339. // Possible values:
  35340. // "ASCENDING" (default)
  35341. // "DESCENDING"
  35342. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  35343. c.urlParams_.Set("sortOrder", sortOrder)
  35344. return c
  35345. }
  35346. // Fields allows partial responses to be retrieved. See
  35347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35348. // for more information.
  35349. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  35350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35351. return c
  35352. }
  35353. // IfNoneMatch sets the optional parameter which makes the operation
  35354. // fail if the object's ETag matches the given value. This is useful for
  35355. // getting updates only after the object has changed since the last
  35356. // request. Use googleapi.IsNotModified to check whether the response
  35357. // error from Do is the result of In-None-Match.
  35358. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  35359. c.ifNoneMatch_ = entityTag
  35360. return c
  35361. }
  35362. // Context sets the context to be used in this call's Do method. Any
  35363. // pending HTTP request will be aborted if the provided context is
  35364. // canceled.
  35365. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  35366. c.ctx_ = ctx
  35367. return c
  35368. }
  35369. // Header returns an http.Header that can be modified by the caller to
  35370. // add HTTP headers to the request.
  35371. func (c *PlacementsListCall) Header() http.Header {
  35372. if c.header_ == nil {
  35373. c.header_ = make(http.Header)
  35374. }
  35375. return c.header_
  35376. }
  35377. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  35378. reqHeaders := make(http.Header)
  35379. for k, v := range c.header_ {
  35380. reqHeaders[k] = v
  35381. }
  35382. reqHeaders.Set("User-Agent", c.s.userAgent())
  35383. if c.ifNoneMatch_ != "" {
  35384. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35385. }
  35386. var body io.Reader = nil
  35387. c.urlParams_.Set("alt", alt)
  35388. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35389. urls += "?" + c.urlParams_.Encode()
  35390. req, _ := http.NewRequest("GET", urls, body)
  35391. req.Header = reqHeaders
  35392. googleapi.Expand(req.URL, map[string]string{
  35393. "profileId": strconv.FormatInt(c.profileId, 10),
  35394. })
  35395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35396. }
  35397. // Do executes the "dfareporting.placements.list" call.
  35398. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  35399. // non-2xx status code is an error. Response headers are in either
  35400. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  35401. // returned at all) in error.(*googleapi.Error).Header. Use
  35402. // googleapi.IsNotModified to check whether the returned error was
  35403. // because http.StatusNotModified was returned.
  35404. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  35405. gensupport.SetOptions(c.urlParams_, opts...)
  35406. res, err := c.doRequest("json")
  35407. if res != nil && res.StatusCode == http.StatusNotModified {
  35408. if res.Body != nil {
  35409. res.Body.Close()
  35410. }
  35411. return nil, &googleapi.Error{
  35412. Code: res.StatusCode,
  35413. Header: res.Header,
  35414. }
  35415. }
  35416. if err != nil {
  35417. return nil, err
  35418. }
  35419. defer googleapi.CloseBody(res)
  35420. if err := googleapi.CheckResponse(res); err != nil {
  35421. return nil, err
  35422. }
  35423. ret := &PlacementsListResponse{
  35424. ServerResponse: googleapi.ServerResponse{
  35425. Header: res.Header,
  35426. HTTPStatusCode: res.StatusCode,
  35427. },
  35428. }
  35429. target := &ret
  35430. if err := gensupport.DecodeResponse(target, res); err != nil {
  35431. return nil, err
  35432. }
  35433. return ret, nil
  35434. // {
  35435. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  35436. // "httpMethod": "GET",
  35437. // "id": "dfareporting.placements.list",
  35438. // "parameterOrder": [
  35439. // "profileId"
  35440. // ],
  35441. // "parameters": {
  35442. // "advertiserIds": {
  35443. // "description": "Select only placements that belong to these advertisers.",
  35444. // "format": "int64",
  35445. // "location": "query",
  35446. // "repeated": true,
  35447. // "type": "string"
  35448. // },
  35449. // "archived": {
  35450. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  35451. // "location": "query",
  35452. // "type": "boolean"
  35453. // },
  35454. // "campaignIds": {
  35455. // "description": "Select only placements that belong to these campaigns.",
  35456. // "format": "int64",
  35457. // "location": "query",
  35458. // "repeated": true,
  35459. // "type": "string"
  35460. // },
  35461. // "compatibilities": {
  35462. // "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.",
  35463. // "enum": [
  35464. // "APP",
  35465. // "APP_INTERSTITIAL",
  35466. // "DISPLAY",
  35467. // "DISPLAY_INTERSTITIAL",
  35468. // "IN_STREAM_VIDEO"
  35469. // ],
  35470. // "enumDescriptions": [
  35471. // "",
  35472. // "",
  35473. // "",
  35474. // "",
  35475. // ""
  35476. // ],
  35477. // "location": "query",
  35478. // "repeated": true,
  35479. // "type": "string"
  35480. // },
  35481. // "contentCategoryIds": {
  35482. // "description": "Select only placements that are associated with these content categories.",
  35483. // "format": "int64",
  35484. // "location": "query",
  35485. // "repeated": true,
  35486. // "type": "string"
  35487. // },
  35488. // "directorySiteIds": {
  35489. // "description": "Select only placements that are associated with these directory sites.",
  35490. // "format": "int64",
  35491. // "location": "query",
  35492. // "repeated": true,
  35493. // "type": "string"
  35494. // },
  35495. // "groupIds": {
  35496. // "description": "Select only placements that belong to these placement groups.",
  35497. // "format": "int64",
  35498. // "location": "query",
  35499. // "repeated": true,
  35500. // "type": "string"
  35501. // },
  35502. // "ids": {
  35503. // "description": "Select only placements with these IDs.",
  35504. // "format": "int64",
  35505. // "location": "query",
  35506. // "repeated": true,
  35507. // "type": "string"
  35508. // },
  35509. // "maxEndDate": {
  35510. // "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\".",
  35511. // "location": "query",
  35512. // "type": "string"
  35513. // },
  35514. // "maxResults": {
  35515. // "default": "1000",
  35516. // "description": "Maximum number of results to return.",
  35517. // "format": "int32",
  35518. // "location": "query",
  35519. // "maximum": "1000",
  35520. // "minimum": "0",
  35521. // "type": "integer"
  35522. // },
  35523. // "maxStartDate": {
  35524. // "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\".",
  35525. // "location": "query",
  35526. // "type": "string"
  35527. // },
  35528. // "minEndDate": {
  35529. // "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\".",
  35530. // "location": "query",
  35531. // "type": "string"
  35532. // },
  35533. // "minStartDate": {
  35534. // "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\".",
  35535. // "location": "query",
  35536. // "type": "string"
  35537. // },
  35538. // "pageToken": {
  35539. // "description": "Value of the nextPageToken from the previous result page.",
  35540. // "location": "query",
  35541. // "type": "string"
  35542. // },
  35543. // "paymentSource": {
  35544. // "description": "Select only placements with this payment source.",
  35545. // "enum": [
  35546. // "PLACEMENT_AGENCY_PAID",
  35547. // "PLACEMENT_PUBLISHER_PAID"
  35548. // ],
  35549. // "enumDescriptions": [
  35550. // "",
  35551. // ""
  35552. // ],
  35553. // "location": "query",
  35554. // "type": "string"
  35555. // },
  35556. // "placementStrategyIds": {
  35557. // "description": "Select only placements that are associated with these placement strategies.",
  35558. // "format": "int64",
  35559. // "location": "query",
  35560. // "repeated": true,
  35561. // "type": "string"
  35562. // },
  35563. // "pricingTypes": {
  35564. // "description": "Select only placements with these pricing types.",
  35565. // "enum": [
  35566. // "PRICING_TYPE_CPA",
  35567. // "PRICING_TYPE_CPC",
  35568. // "PRICING_TYPE_CPM",
  35569. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  35570. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  35571. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  35572. // ],
  35573. // "enumDescriptions": [
  35574. // "",
  35575. // "",
  35576. // "",
  35577. // "",
  35578. // "",
  35579. // ""
  35580. // ],
  35581. // "location": "query",
  35582. // "repeated": true,
  35583. // "type": "string"
  35584. // },
  35585. // "profileId": {
  35586. // "description": "User profile ID associated with this request.",
  35587. // "format": "int64",
  35588. // "location": "path",
  35589. // "required": true,
  35590. // "type": "string"
  35591. // },
  35592. // "searchString": {
  35593. // "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\".",
  35594. // "location": "query",
  35595. // "type": "string"
  35596. // },
  35597. // "siteIds": {
  35598. // "description": "Select only placements that are associated with these sites.",
  35599. // "format": "int64",
  35600. // "location": "query",
  35601. // "repeated": true,
  35602. // "type": "string"
  35603. // },
  35604. // "sizeIds": {
  35605. // "description": "Select only placements that are associated with these sizes.",
  35606. // "format": "int64",
  35607. // "location": "query",
  35608. // "repeated": true,
  35609. // "type": "string"
  35610. // },
  35611. // "sortField": {
  35612. // "default": "ID",
  35613. // "description": "Field by which to sort the list.",
  35614. // "enum": [
  35615. // "ID",
  35616. // "NAME"
  35617. // ],
  35618. // "enumDescriptions": [
  35619. // "",
  35620. // ""
  35621. // ],
  35622. // "location": "query",
  35623. // "type": "string"
  35624. // },
  35625. // "sortOrder": {
  35626. // "default": "ASCENDING",
  35627. // "description": "Order of sorted results.",
  35628. // "enum": [
  35629. // "ASCENDING",
  35630. // "DESCENDING"
  35631. // ],
  35632. // "enumDescriptions": [
  35633. // "",
  35634. // ""
  35635. // ],
  35636. // "location": "query",
  35637. // "type": "string"
  35638. // }
  35639. // },
  35640. // "path": "userprofiles/{profileId}/placements",
  35641. // "response": {
  35642. // "$ref": "PlacementsListResponse"
  35643. // },
  35644. // "scopes": [
  35645. // "https://www.googleapis.com/auth/dfatrafficking"
  35646. // ]
  35647. // }
  35648. }
  35649. // Pages invokes f for each page of results.
  35650. // A non-nil error returned from f will halt the iteration.
  35651. // The provided context supersedes any context provided to the Context method.
  35652. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  35653. c.ctx_ = ctx
  35654. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35655. for {
  35656. x, err := c.Do()
  35657. if err != nil {
  35658. return err
  35659. }
  35660. if err := f(x); err != nil {
  35661. return err
  35662. }
  35663. if x.NextPageToken == "" {
  35664. return nil
  35665. }
  35666. c.PageToken(x.NextPageToken)
  35667. }
  35668. }
  35669. // method id "dfareporting.placements.patch":
  35670. type PlacementsPatchCall struct {
  35671. s *Service
  35672. profileId int64
  35673. placement *Placement
  35674. urlParams_ gensupport.URLParams
  35675. ctx_ context.Context
  35676. header_ http.Header
  35677. }
  35678. // Patch: Updates an existing placement. This method supports patch
  35679. // semantics.
  35680. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  35681. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35682. c.profileId = profileId
  35683. c.urlParams_.Set("id", fmt.Sprint(id))
  35684. c.placement = placement
  35685. return c
  35686. }
  35687. // Fields allows partial responses to be retrieved. See
  35688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35689. // for more information.
  35690. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  35691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35692. return c
  35693. }
  35694. // Context sets the context to be used in this call's Do method. Any
  35695. // pending HTTP request will be aborted if the provided context is
  35696. // canceled.
  35697. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  35698. c.ctx_ = ctx
  35699. return c
  35700. }
  35701. // Header returns an http.Header that can be modified by the caller to
  35702. // add HTTP headers to the request.
  35703. func (c *PlacementsPatchCall) Header() http.Header {
  35704. if c.header_ == nil {
  35705. c.header_ = make(http.Header)
  35706. }
  35707. return c.header_
  35708. }
  35709. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  35710. reqHeaders := make(http.Header)
  35711. for k, v := range c.header_ {
  35712. reqHeaders[k] = v
  35713. }
  35714. reqHeaders.Set("User-Agent", c.s.userAgent())
  35715. var body io.Reader = nil
  35716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35717. if err != nil {
  35718. return nil, err
  35719. }
  35720. reqHeaders.Set("Content-Type", "application/json")
  35721. c.urlParams_.Set("alt", alt)
  35722. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35723. urls += "?" + c.urlParams_.Encode()
  35724. req, _ := http.NewRequest("PATCH", urls, body)
  35725. req.Header = reqHeaders
  35726. googleapi.Expand(req.URL, map[string]string{
  35727. "profileId": strconv.FormatInt(c.profileId, 10),
  35728. })
  35729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35730. }
  35731. // Do executes the "dfareporting.placements.patch" call.
  35732. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35733. // status code is an error. Response headers are in either
  35734. // *Placement.ServerResponse.Header or (if a response was returned at
  35735. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35736. // to check whether the returned error was because
  35737. // http.StatusNotModified was returned.
  35738. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35739. gensupport.SetOptions(c.urlParams_, opts...)
  35740. res, err := c.doRequest("json")
  35741. if res != nil && res.StatusCode == http.StatusNotModified {
  35742. if res.Body != nil {
  35743. res.Body.Close()
  35744. }
  35745. return nil, &googleapi.Error{
  35746. Code: res.StatusCode,
  35747. Header: res.Header,
  35748. }
  35749. }
  35750. if err != nil {
  35751. return nil, err
  35752. }
  35753. defer googleapi.CloseBody(res)
  35754. if err := googleapi.CheckResponse(res); err != nil {
  35755. return nil, err
  35756. }
  35757. ret := &Placement{
  35758. ServerResponse: googleapi.ServerResponse{
  35759. Header: res.Header,
  35760. HTTPStatusCode: res.StatusCode,
  35761. },
  35762. }
  35763. target := &ret
  35764. if err := gensupport.DecodeResponse(target, res); err != nil {
  35765. return nil, err
  35766. }
  35767. return ret, nil
  35768. // {
  35769. // "description": "Updates an existing placement. This method supports patch semantics.",
  35770. // "httpMethod": "PATCH",
  35771. // "id": "dfareporting.placements.patch",
  35772. // "parameterOrder": [
  35773. // "profileId",
  35774. // "id"
  35775. // ],
  35776. // "parameters": {
  35777. // "id": {
  35778. // "description": "Placement ID.",
  35779. // "format": "int64",
  35780. // "location": "query",
  35781. // "required": true,
  35782. // "type": "string"
  35783. // },
  35784. // "profileId": {
  35785. // "description": "User profile ID associated with this request.",
  35786. // "format": "int64",
  35787. // "location": "path",
  35788. // "required": true,
  35789. // "type": "string"
  35790. // }
  35791. // },
  35792. // "path": "userprofiles/{profileId}/placements",
  35793. // "request": {
  35794. // "$ref": "Placement"
  35795. // },
  35796. // "response": {
  35797. // "$ref": "Placement"
  35798. // },
  35799. // "scopes": [
  35800. // "https://www.googleapis.com/auth/dfatrafficking"
  35801. // ]
  35802. // }
  35803. }
  35804. // method id "dfareporting.placements.update":
  35805. type PlacementsUpdateCall struct {
  35806. s *Service
  35807. profileId int64
  35808. placement *Placement
  35809. urlParams_ gensupport.URLParams
  35810. ctx_ context.Context
  35811. header_ http.Header
  35812. }
  35813. // Update: Updates an existing placement.
  35814. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  35815. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35816. c.profileId = profileId
  35817. c.placement = placement
  35818. return c
  35819. }
  35820. // Fields allows partial responses to be retrieved. See
  35821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35822. // for more information.
  35823. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  35824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35825. return c
  35826. }
  35827. // Context sets the context to be used in this call's Do method. Any
  35828. // pending HTTP request will be aborted if the provided context is
  35829. // canceled.
  35830. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  35831. c.ctx_ = ctx
  35832. return c
  35833. }
  35834. // Header returns an http.Header that can be modified by the caller to
  35835. // add HTTP headers to the request.
  35836. func (c *PlacementsUpdateCall) Header() http.Header {
  35837. if c.header_ == nil {
  35838. c.header_ = make(http.Header)
  35839. }
  35840. return c.header_
  35841. }
  35842. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35843. reqHeaders := make(http.Header)
  35844. for k, v := range c.header_ {
  35845. reqHeaders[k] = v
  35846. }
  35847. reqHeaders.Set("User-Agent", c.s.userAgent())
  35848. var body io.Reader = nil
  35849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35850. if err != nil {
  35851. return nil, err
  35852. }
  35853. reqHeaders.Set("Content-Type", "application/json")
  35854. c.urlParams_.Set("alt", alt)
  35855. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35856. urls += "?" + c.urlParams_.Encode()
  35857. req, _ := http.NewRequest("PUT", urls, body)
  35858. req.Header = reqHeaders
  35859. googleapi.Expand(req.URL, map[string]string{
  35860. "profileId": strconv.FormatInt(c.profileId, 10),
  35861. })
  35862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35863. }
  35864. // Do executes the "dfareporting.placements.update" call.
  35865. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35866. // status code is an error. Response headers are in either
  35867. // *Placement.ServerResponse.Header or (if a response was returned at
  35868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35869. // to check whether the returned error was because
  35870. // http.StatusNotModified was returned.
  35871. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35872. gensupport.SetOptions(c.urlParams_, opts...)
  35873. res, err := c.doRequest("json")
  35874. if res != nil && res.StatusCode == http.StatusNotModified {
  35875. if res.Body != nil {
  35876. res.Body.Close()
  35877. }
  35878. return nil, &googleapi.Error{
  35879. Code: res.StatusCode,
  35880. Header: res.Header,
  35881. }
  35882. }
  35883. if err != nil {
  35884. return nil, err
  35885. }
  35886. defer googleapi.CloseBody(res)
  35887. if err := googleapi.CheckResponse(res); err != nil {
  35888. return nil, err
  35889. }
  35890. ret := &Placement{
  35891. ServerResponse: googleapi.ServerResponse{
  35892. Header: res.Header,
  35893. HTTPStatusCode: res.StatusCode,
  35894. },
  35895. }
  35896. target := &ret
  35897. if err := gensupport.DecodeResponse(target, res); err != nil {
  35898. return nil, err
  35899. }
  35900. return ret, nil
  35901. // {
  35902. // "description": "Updates an existing placement.",
  35903. // "httpMethod": "PUT",
  35904. // "id": "dfareporting.placements.update",
  35905. // "parameterOrder": [
  35906. // "profileId"
  35907. // ],
  35908. // "parameters": {
  35909. // "profileId": {
  35910. // "description": "User profile ID associated with this request.",
  35911. // "format": "int64",
  35912. // "location": "path",
  35913. // "required": true,
  35914. // "type": "string"
  35915. // }
  35916. // },
  35917. // "path": "userprofiles/{profileId}/placements",
  35918. // "request": {
  35919. // "$ref": "Placement"
  35920. // },
  35921. // "response": {
  35922. // "$ref": "Placement"
  35923. // },
  35924. // "scopes": [
  35925. // "https://www.googleapis.com/auth/dfatrafficking"
  35926. // ]
  35927. // }
  35928. }
  35929. // method id "dfareporting.platformTypes.get":
  35930. type PlatformTypesGetCall struct {
  35931. s *Service
  35932. profileId int64
  35933. id int64
  35934. urlParams_ gensupport.URLParams
  35935. ifNoneMatch_ string
  35936. ctx_ context.Context
  35937. header_ http.Header
  35938. }
  35939. // Get: Gets one platform type by ID.
  35940. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  35941. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35942. c.profileId = profileId
  35943. c.id = id
  35944. return c
  35945. }
  35946. // Fields allows partial responses to be retrieved. See
  35947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35948. // for more information.
  35949. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  35950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35951. return c
  35952. }
  35953. // IfNoneMatch sets the optional parameter which makes the operation
  35954. // fail if the object's ETag matches the given value. This is useful for
  35955. // getting updates only after the object has changed since the last
  35956. // request. Use googleapi.IsNotModified to check whether the response
  35957. // error from Do is the result of In-None-Match.
  35958. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  35959. c.ifNoneMatch_ = entityTag
  35960. return c
  35961. }
  35962. // Context sets the context to be used in this call's Do method. Any
  35963. // pending HTTP request will be aborted if the provided context is
  35964. // canceled.
  35965. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  35966. c.ctx_ = ctx
  35967. return c
  35968. }
  35969. // Header returns an http.Header that can be modified by the caller to
  35970. // add HTTP headers to the request.
  35971. func (c *PlatformTypesGetCall) Header() http.Header {
  35972. if c.header_ == nil {
  35973. c.header_ = make(http.Header)
  35974. }
  35975. return c.header_
  35976. }
  35977. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  35978. reqHeaders := make(http.Header)
  35979. for k, v := range c.header_ {
  35980. reqHeaders[k] = v
  35981. }
  35982. reqHeaders.Set("User-Agent", c.s.userAgent())
  35983. if c.ifNoneMatch_ != "" {
  35984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35985. }
  35986. var body io.Reader = nil
  35987. c.urlParams_.Set("alt", alt)
  35988. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  35989. urls += "?" + c.urlParams_.Encode()
  35990. req, _ := http.NewRequest("GET", urls, body)
  35991. req.Header = reqHeaders
  35992. googleapi.Expand(req.URL, map[string]string{
  35993. "profileId": strconv.FormatInt(c.profileId, 10),
  35994. "id": strconv.FormatInt(c.id, 10),
  35995. })
  35996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35997. }
  35998. // Do executes the "dfareporting.platformTypes.get" call.
  35999. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  36000. // status code is an error. Response headers are in either
  36001. // *PlatformType.ServerResponse.Header or (if a response was returned at
  36002. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36003. // to check whether the returned error was because
  36004. // http.StatusNotModified was returned.
  36005. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  36006. gensupport.SetOptions(c.urlParams_, opts...)
  36007. res, err := c.doRequest("json")
  36008. if res != nil && res.StatusCode == http.StatusNotModified {
  36009. if res.Body != nil {
  36010. res.Body.Close()
  36011. }
  36012. return nil, &googleapi.Error{
  36013. Code: res.StatusCode,
  36014. Header: res.Header,
  36015. }
  36016. }
  36017. if err != nil {
  36018. return nil, err
  36019. }
  36020. defer googleapi.CloseBody(res)
  36021. if err := googleapi.CheckResponse(res); err != nil {
  36022. return nil, err
  36023. }
  36024. ret := &PlatformType{
  36025. ServerResponse: googleapi.ServerResponse{
  36026. Header: res.Header,
  36027. HTTPStatusCode: res.StatusCode,
  36028. },
  36029. }
  36030. target := &ret
  36031. if err := gensupport.DecodeResponse(target, res); err != nil {
  36032. return nil, err
  36033. }
  36034. return ret, nil
  36035. // {
  36036. // "description": "Gets one platform type by ID.",
  36037. // "httpMethod": "GET",
  36038. // "id": "dfareporting.platformTypes.get",
  36039. // "parameterOrder": [
  36040. // "profileId",
  36041. // "id"
  36042. // ],
  36043. // "parameters": {
  36044. // "id": {
  36045. // "description": "Platform type ID.",
  36046. // "format": "int64",
  36047. // "location": "path",
  36048. // "required": true,
  36049. // "type": "string"
  36050. // },
  36051. // "profileId": {
  36052. // "description": "User profile ID associated with this request.",
  36053. // "format": "int64",
  36054. // "location": "path",
  36055. // "required": true,
  36056. // "type": "string"
  36057. // }
  36058. // },
  36059. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  36060. // "response": {
  36061. // "$ref": "PlatformType"
  36062. // },
  36063. // "scopes": [
  36064. // "https://www.googleapis.com/auth/dfatrafficking"
  36065. // ]
  36066. // }
  36067. }
  36068. // method id "dfareporting.platformTypes.list":
  36069. type PlatformTypesListCall struct {
  36070. s *Service
  36071. profileId int64
  36072. urlParams_ gensupport.URLParams
  36073. ifNoneMatch_ string
  36074. ctx_ context.Context
  36075. header_ http.Header
  36076. }
  36077. // List: Retrieves a list of platform types.
  36078. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  36079. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36080. c.profileId = profileId
  36081. return c
  36082. }
  36083. // Fields allows partial responses to be retrieved. See
  36084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36085. // for more information.
  36086. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  36087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36088. return c
  36089. }
  36090. // IfNoneMatch sets the optional parameter which makes the operation
  36091. // fail if the object's ETag matches the given value. This is useful for
  36092. // getting updates only after the object has changed since the last
  36093. // request. Use googleapi.IsNotModified to check whether the response
  36094. // error from Do is the result of In-None-Match.
  36095. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  36096. c.ifNoneMatch_ = entityTag
  36097. return c
  36098. }
  36099. // Context sets the context to be used in this call's Do method. Any
  36100. // pending HTTP request will be aborted if the provided context is
  36101. // canceled.
  36102. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  36103. c.ctx_ = ctx
  36104. return c
  36105. }
  36106. // Header returns an http.Header that can be modified by the caller to
  36107. // add HTTP headers to the request.
  36108. func (c *PlatformTypesListCall) Header() http.Header {
  36109. if c.header_ == nil {
  36110. c.header_ = make(http.Header)
  36111. }
  36112. return c.header_
  36113. }
  36114. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  36115. reqHeaders := make(http.Header)
  36116. for k, v := range c.header_ {
  36117. reqHeaders[k] = v
  36118. }
  36119. reqHeaders.Set("User-Agent", c.s.userAgent())
  36120. if c.ifNoneMatch_ != "" {
  36121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36122. }
  36123. var body io.Reader = nil
  36124. c.urlParams_.Set("alt", alt)
  36125. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  36126. urls += "?" + c.urlParams_.Encode()
  36127. req, _ := http.NewRequest("GET", urls, body)
  36128. req.Header = reqHeaders
  36129. googleapi.Expand(req.URL, map[string]string{
  36130. "profileId": strconv.FormatInt(c.profileId, 10),
  36131. })
  36132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36133. }
  36134. // Do executes the "dfareporting.platformTypes.list" call.
  36135. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  36136. // Any non-2xx status code is an error. Response headers are in either
  36137. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  36138. // was returned at all) in error.(*googleapi.Error).Header. Use
  36139. // googleapi.IsNotModified to check whether the returned error was
  36140. // because http.StatusNotModified was returned.
  36141. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  36142. gensupport.SetOptions(c.urlParams_, opts...)
  36143. res, err := c.doRequest("json")
  36144. if res != nil && res.StatusCode == http.StatusNotModified {
  36145. if res.Body != nil {
  36146. res.Body.Close()
  36147. }
  36148. return nil, &googleapi.Error{
  36149. Code: res.StatusCode,
  36150. Header: res.Header,
  36151. }
  36152. }
  36153. if err != nil {
  36154. return nil, err
  36155. }
  36156. defer googleapi.CloseBody(res)
  36157. if err := googleapi.CheckResponse(res); err != nil {
  36158. return nil, err
  36159. }
  36160. ret := &PlatformTypesListResponse{
  36161. ServerResponse: googleapi.ServerResponse{
  36162. Header: res.Header,
  36163. HTTPStatusCode: res.StatusCode,
  36164. },
  36165. }
  36166. target := &ret
  36167. if err := gensupport.DecodeResponse(target, res); err != nil {
  36168. return nil, err
  36169. }
  36170. return ret, nil
  36171. // {
  36172. // "description": "Retrieves a list of platform types.",
  36173. // "httpMethod": "GET",
  36174. // "id": "dfareporting.platformTypes.list",
  36175. // "parameterOrder": [
  36176. // "profileId"
  36177. // ],
  36178. // "parameters": {
  36179. // "profileId": {
  36180. // "description": "User profile ID associated with this request.",
  36181. // "format": "int64",
  36182. // "location": "path",
  36183. // "required": true,
  36184. // "type": "string"
  36185. // }
  36186. // },
  36187. // "path": "userprofiles/{profileId}/platformTypes",
  36188. // "response": {
  36189. // "$ref": "PlatformTypesListResponse"
  36190. // },
  36191. // "scopes": [
  36192. // "https://www.googleapis.com/auth/dfatrafficking"
  36193. // ]
  36194. // }
  36195. }
  36196. // method id "dfareporting.postalCodes.get":
  36197. type PostalCodesGetCall struct {
  36198. s *Service
  36199. profileId int64
  36200. code string
  36201. urlParams_ gensupport.URLParams
  36202. ifNoneMatch_ string
  36203. ctx_ context.Context
  36204. header_ http.Header
  36205. }
  36206. // Get: Gets one postal code by ID.
  36207. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  36208. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36209. c.profileId = profileId
  36210. c.code = code
  36211. return c
  36212. }
  36213. // Fields allows partial responses to be retrieved. See
  36214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36215. // for more information.
  36216. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  36217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36218. return c
  36219. }
  36220. // IfNoneMatch sets the optional parameter which makes the operation
  36221. // fail if the object's ETag matches the given value. This is useful for
  36222. // getting updates only after the object has changed since the last
  36223. // request. Use googleapi.IsNotModified to check whether the response
  36224. // error from Do is the result of In-None-Match.
  36225. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  36226. c.ifNoneMatch_ = entityTag
  36227. return c
  36228. }
  36229. // Context sets the context to be used in this call's Do method. Any
  36230. // pending HTTP request will be aborted if the provided context is
  36231. // canceled.
  36232. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  36233. c.ctx_ = ctx
  36234. return c
  36235. }
  36236. // Header returns an http.Header that can be modified by the caller to
  36237. // add HTTP headers to the request.
  36238. func (c *PostalCodesGetCall) Header() http.Header {
  36239. if c.header_ == nil {
  36240. c.header_ = make(http.Header)
  36241. }
  36242. return c.header_
  36243. }
  36244. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  36245. reqHeaders := make(http.Header)
  36246. for k, v := range c.header_ {
  36247. reqHeaders[k] = v
  36248. }
  36249. reqHeaders.Set("User-Agent", c.s.userAgent())
  36250. if c.ifNoneMatch_ != "" {
  36251. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36252. }
  36253. var body io.Reader = nil
  36254. c.urlParams_.Set("alt", alt)
  36255. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  36256. urls += "?" + c.urlParams_.Encode()
  36257. req, _ := http.NewRequest("GET", urls, body)
  36258. req.Header = reqHeaders
  36259. googleapi.Expand(req.URL, map[string]string{
  36260. "profileId": strconv.FormatInt(c.profileId, 10),
  36261. "code": c.code,
  36262. })
  36263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36264. }
  36265. // Do executes the "dfareporting.postalCodes.get" call.
  36266. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  36267. // status code is an error. Response headers are in either
  36268. // *PostalCode.ServerResponse.Header or (if a response was returned at
  36269. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36270. // to check whether the returned error was because
  36271. // http.StatusNotModified was returned.
  36272. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  36273. gensupport.SetOptions(c.urlParams_, opts...)
  36274. res, err := c.doRequest("json")
  36275. if res != nil && res.StatusCode == http.StatusNotModified {
  36276. if res.Body != nil {
  36277. res.Body.Close()
  36278. }
  36279. return nil, &googleapi.Error{
  36280. Code: res.StatusCode,
  36281. Header: res.Header,
  36282. }
  36283. }
  36284. if err != nil {
  36285. return nil, err
  36286. }
  36287. defer googleapi.CloseBody(res)
  36288. if err := googleapi.CheckResponse(res); err != nil {
  36289. return nil, err
  36290. }
  36291. ret := &PostalCode{
  36292. ServerResponse: googleapi.ServerResponse{
  36293. Header: res.Header,
  36294. HTTPStatusCode: res.StatusCode,
  36295. },
  36296. }
  36297. target := &ret
  36298. if err := gensupport.DecodeResponse(target, res); err != nil {
  36299. return nil, err
  36300. }
  36301. return ret, nil
  36302. // {
  36303. // "description": "Gets one postal code by ID.",
  36304. // "httpMethod": "GET",
  36305. // "id": "dfareporting.postalCodes.get",
  36306. // "parameterOrder": [
  36307. // "profileId",
  36308. // "code"
  36309. // ],
  36310. // "parameters": {
  36311. // "code": {
  36312. // "description": "Postal code ID.",
  36313. // "location": "path",
  36314. // "required": true,
  36315. // "type": "string"
  36316. // },
  36317. // "profileId": {
  36318. // "description": "User profile ID associated with this request.",
  36319. // "format": "int64",
  36320. // "location": "path",
  36321. // "required": true,
  36322. // "type": "string"
  36323. // }
  36324. // },
  36325. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  36326. // "response": {
  36327. // "$ref": "PostalCode"
  36328. // },
  36329. // "scopes": [
  36330. // "https://www.googleapis.com/auth/dfatrafficking"
  36331. // ]
  36332. // }
  36333. }
  36334. // method id "dfareporting.postalCodes.list":
  36335. type PostalCodesListCall struct {
  36336. s *Service
  36337. profileId int64
  36338. urlParams_ gensupport.URLParams
  36339. ifNoneMatch_ string
  36340. ctx_ context.Context
  36341. header_ http.Header
  36342. }
  36343. // List: Retrieves a list of postal codes.
  36344. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  36345. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36346. c.profileId = profileId
  36347. return c
  36348. }
  36349. // Fields allows partial responses to be retrieved. See
  36350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36351. // for more information.
  36352. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  36353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36354. return c
  36355. }
  36356. // IfNoneMatch sets the optional parameter which makes the operation
  36357. // fail if the object's ETag matches the given value. This is useful for
  36358. // getting updates only after the object has changed since the last
  36359. // request. Use googleapi.IsNotModified to check whether the response
  36360. // error from Do is the result of In-None-Match.
  36361. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  36362. c.ifNoneMatch_ = entityTag
  36363. return c
  36364. }
  36365. // Context sets the context to be used in this call's Do method. Any
  36366. // pending HTTP request will be aborted if the provided context is
  36367. // canceled.
  36368. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  36369. c.ctx_ = ctx
  36370. return c
  36371. }
  36372. // Header returns an http.Header that can be modified by the caller to
  36373. // add HTTP headers to the request.
  36374. func (c *PostalCodesListCall) Header() http.Header {
  36375. if c.header_ == nil {
  36376. c.header_ = make(http.Header)
  36377. }
  36378. return c.header_
  36379. }
  36380. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  36381. reqHeaders := make(http.Header)
  36382. for k, v := range c.header_ {
  36383. reqHeaders[k] = v
  36384. }
  36385. reqHeaders.Set("User-Agent", c.s.userAgent())
  36386. if c.ifNoneMatch_ != "" {
  36387. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36388. }
  36389. var body io.Reader = nil
  36390. c.urlParams_.Set("alt", alt)
  36391. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  36392. urls += "?" + c.urlParams_.Encode()
  36393. req, _ := http.NewRequest("GET", urls, body)
  36394. req.Header = reqHeaders
  36395. googleapi.Expand(req.URL, map[string]string{
  36396. "profileId": strconv.FormatInt(c.profileId, 10),
  36397. })
  36398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36399. }
  36400. // Do executes the "dfareporting.postalCodes.list" call.
  36401. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  36402. // non-2xx status code is an error. Response headers are in either
  36403. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  36404. // returned at all) in error.(*googleapi.Error).Header. Use
  36405. // googleapi.IsNotModified to check whether the returned error was
  36406. // because http.StatusNotModified was returned.
  36407. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  36408. gensupport.SetOptions(c.urlParams_, opts...)
  36409. res, err := c.doRequest("json")
  36410. if res != nil && res.StatusCode == http.StatusNotModified {
  36411. if res.Body != nil {
  36412. res.Body.Close()
  36413. }
  36414. return nil, &googleapi.Error{
  36415. Code: res.StatusCode,
  36416. Header: res.Header,
  36417. }
  36418. }
  36419. if err != nil {
  36420. return nil, err
  36421. }
  36422. defer googleapi.CloseBody(res)
  36423. if err := googleapi.CheckResponse(res); err != nil {
  36424. return nil, err
  36425. }
  36426. ret := &PostalCodesListResponse{
  36427. ServerResponse: googleapi.ServerResponse{
  36428. Header: res.Header,
  36429. HTTPStatusCode: res.StatusCode,
  36430. },
  36431. }
  36432. target := &ret
  36433. if err := gensupport.DecodeResponse(target, res); err != nil {
  36434. return nil, err
  36435. }
  36436. return ret, nil
  36437. // {
  36438. // "description": "Retrieves a list of postal codes.",
  36439. // "httpMethod": "GET",
  36440. // "id": "dfareporting.postalCodes.list",
  36441. // "parameterOrder": [
  36442. // "profileId"
  36443. // ],
  36444. // "parameters": {
  36445. // "profileId": {
  36446. // "description": "User profile ID associated with this request.",
  36447. // "format": "int64",
  36448. // "location": "path",
  36449. // "required": true,
  36450. // "type": "string"
  36451. // }
  36452. // },
  36453. // "path": "userprofiles/{profileId}/postalCodes",
  36454. // "response": {
  36455. // "$ref": "PostalCodesListResponse"
  36456. // },
  36457. // "scopes": [
  36458. // "https://www.googleapis.com/auth/dfatrafficking"
  36459. // ]
  36460. // }
  36461. }
  36462. // method id "dfareporting.projects.get":
  36463. type ProjectsGetCall struct {
  36464. s *Service
  36465. profileId int64
  36466. id int64
  36467. urlParams_ gensupport.URLParams
  36468. ifNoneMatch_ string
  36469. ctx_ context.Context
  36470. header_ http.Header
  36471. }
  36472. // Get: Gets one project by ID.
  36473. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  36474. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36475. c.profileId = profileId
  36476. c.id = id
  36477. return c
  36478. }
  36479. // Fields allows partial responses to be retrieved. See
  36480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36481. // for more information.
  36482. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  36483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36484. return c
  36485. }
  36486. // IfNoneMatch sets the optional parameter which makes the operation
  36487. // fail if the object's ETag matches the given value. This is useful for
  36488. // getting updates only after the object has changed since the last
  36489. // request. Use googleapi.IsNotModified to check whether the response
  36490. // error from Do is the result of In-None-Match.
  36491. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  36492. c.ifNoneMatch_ = entityTag
  36493. return c
  36494. }
  36495. // Context sets the context to be used in this call's Do method. Any
  36496. // pending HTTP request will be aborted if the provided context is
  36497. // canceled.
  36498. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  36499. c.ctx_ = ctx
  36500. return c
  36501. }
  36502. // Header returns an http.Header that can be modified by the caller to
  36503. // add HTTP headers to the request.
  36504. func (c *ProjectsGetCall) Header() http.Header {
  36505. if c.header_ == nil {
  36506. c.header_ = make(http.Header)
  36507. }
  36508. return c.header_
  36509. }
  36510. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  36511. reqHeaders := make(http.Header)
  36512. for k, v := range c.header_ {
  36513. reqHeaders[k] = v
  36514. }
  36515. reqHeaders.Set("User-Agent", c.s.userAgent())
  36516. if c.ifNoneMatch_ != "" {
  36517. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36518. }
  36519. var body io.Reader = nil
  36520. c.urlParams_.Set("alt", alt)
  36521. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  36522. urls += "?" + c.urlParams_.Encode()
  36523. req, _ := http.NewRequest("GET", urls, body)
  36524. req.Header = reqHeaders
  36525. googleapi.Expand(req.URL, map[string]string{
  36526. "profileId": strconv.FormatInt(c.profileId, 10),
  36527. "id": strconv.FormatInt(c.id, 10),
  36528. })
  36529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36530. }
  36531. // Do executes the "dfareporting.projects.get" call.
  36532. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  36533. // code is an error. Response headers are in either
  36534. // *Project.ServerResponse.Header or (if a response was returned at all)
  36535. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36536. // check whether the returned error was because http.StatusNotModified
  36537. // was returned.
  36538. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  36539. gensupport.SetOptions(c.urlParams_, opts...)
  36540. res, err := c.doRequest("json")
  36541. if res != nil && res.StatusCode == http.StatusNotModified {
  36542. if res.Body != nil {
  36543. res.Body.Close()
  36544. }
  36545. return nil, &googleapi.Error{
  36546. Code: res.StatusCode,
  36547. Header: res.Header,
  36548. }
  36549. }
  36550. if err != nil {
  36551. return nil, err
  36552. }
  36553. defer googleapi.CloseBody(res)
  36554. if err := googleapi.CheckResponse(res); err != nil {
  36555. return nil, err
  36556. }
  36557. ret := &Project{
  36558. ServerResponse: googleapi.ServerResponse{
  36559. Header: res.Header,
  36560. HTTPStatusCode: res.StatusCode,
  36561. },
  36562. }
  36563. target := &ret
  36564. if err := gensupport.DecodeResponse(target, res); err != nil {
  36565. return nil, err
  36566. }
  36567. return ret, nil
  36568. // {
  36569. // "description": "Gets one project by ID.",
  36570. // "httpMethod": "GET",
  36571. // "id": "dfareporting.projects.get",
  36572. // "parameterOrder": [
  36573. // "profileId",
  36574. // "id"
  36575. // ],
  36576. // "parameters": {
  36577. // "id": {
  36578. // "description": "Project ID.",
  36579. // "format": "int64",
  36580. // "location": "path",
  36581. // "required": true,
  36582. // "type": "string"
  36583. // },
  36584. // "profileId": {
  36585. // "description": "User profile ID associated with this request.",
  36586. // "format": "int64",
  36587. // "location": "path",
  36588. // "required": true,
  36589. // "type": "string"
  36590. // }
  36591. // },
  36592. // "path": "userprofiles/{profileId}/projects/{id}",
  36593. // "response": {
  36594. // "$ref": "Project"
  36595. // },
  36596. // "scopes": [
  36597. // "https://www.googleapis.com/auth/dfatrafficking"
  36598. // ]
  36599. // }
  36600. }
  36601. // method id "dfareporting.projects.list":
  36602. type ProjectsListCall struct {
  36603. s *Service
  36604. profileId int64
  36605. urlParams_ gensupport.URLParams
  36606. ifNoneMatch_ string
  36607. ctx_ context.Context
  36608. header_ http.Header
  36609. }
  36610. // List: Retrieves a list of projects, possibly filtered. This method
  36611. // supports paging.
  36612. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  36613. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36614. c.profileId = profileId
  36615. return c
  36616. }
  36617. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36618. // only projects with these advertiser IDs.
  36619. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  36620. var advertiserIds_ []string
  36621. for _, v := range advertiserIds {
  36622. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36623. }
  36624. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36625. return c
  36626. }
  36627. // Ids sets the optional parameter "ids": Select only projects with
  36628. // these IDs.
  36629. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  36630. var ids_ []string
  36631. for _, v := range ids {
  36632. ids_ = append(ids_, fmt.Sprint(v))
  36633. }
  36634. c.urlParams_.SetMulti("ids", ids_)
  36635. return c
  36636. }
  36637. // MaxResults sets the optional parameter "maxResults": Maximum number
  36638. // of results to return.
  36639. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  36640. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36641. return c
  36642. }
  36643. // PageToken sets the optional parameter "pageToken": Value of the
  36644. // nextPageToken from the previous result page.
  36645. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  36646. c.urlParams_.Set("pageToken", pageToken)
  36647. return c
  36648. }
  36649. // SearchString sets the optional parameter "searchString": Allows
  36650. // searching for projects by name or ID. Wildcards (*) are allowed. For
  36651. // example, "project*2015" will return projects with names like "project
  36652. // June 2015", "project April 2015", or simply "project 2015". Most of
  36653. // the searches also add wildcards implicitly at the start and the end
  36654. // of the search string. For example, a search string of "project" will
  36655. // match projects with name "my project", "project 2015", or simply
  36656. // "project".
  36657. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  36658. c.urlParams_.Set("searchString", searchString)
  36659. return c
  36660. }
  36661. // SortField sets the optional parameter "sortField": Field by which to
  36662. // sort the list.
  36663. //
  36664. // Possible values:
  36665. // "ID" (default)
  36666. // "NAME"
  36667. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  36668. c.urlParams_.Set("sortField", sortField)
  36669. return c
  36670. }
  36671. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36672. // results.
  36673. //
  36674. // Possible values:
  36675. // "ASCENDING" (default)
  36676. // "DESCENDING"
  36677. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  36678. c.urlParams_.Set("sortOrder", sortOrder)
  36679. return c
  36680. }
  36681. // Fields allows partial responses to be retrieved. See
  36682. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36683. // for more information.
  36684. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  36685. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36686. return c
  36687. }
  36688. // IfNoneMatch sets the optional parameter which makes the operation
  36689. // fail if the object's ETag matches the given value. This is useful for
  36690. // getting updates only after the object has changed since the last
  36691. // request. Use googleapi.IsNotModified to check whether the response
  36692. // error from Do is the result of In-None-Match.
  36693. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  36694. c.ifNoneMatch_ = entityTag
  36695. return c
  36696. }
  36697. // Context sets the context to be used in this call's Do method. Any
  36698. // pending HTTP request will be aborted if the provided context is
  36699. // canceled.
  36700. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  36701. c.ctx_ = ctx
  36702. return c
  36703. }
  36704. // Header returns an http.Header that can be modified by the caller to
  36705. // add HTTP headers to the request.
  36706. func (c *ProjectsListCall) Header() http.Header {
  36707. if c.header_ == nil {
  36708. c.header_ = make(http.Header)
  36709. }
  36710. return c.header_
  36711. }
  36712. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  36713. reqHeaders := make(http.Header)
  36714. for k, v := range c.header_ {
  36715. reqHeaders[k] = v
  36716. }
  36717. reqHeaders.Set("User-Agent", c.s.userAgent())
  36718. if c.ifNoneMatch_ != "" {
  36719. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36720. }
  36721. var body io.Reader = nil
  36722. c.urlParams_.Set("alt", alt)
  36723. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  36724. urls += "?" + c.urlParams_.Encode()
  36725. req, _ := http.NewRequest("GET", urls, body)
  36726. req.Header = reqHeaders
  36727. googleapi.Expand(req.URL, map[string]string{
  36728. "profileId": strconv.FormatInt(c.profileId, 10),
  36729. })
  36730. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36731. }
  36732. // Do executes the "dfareporting.projects.list" call.
  36733. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  36734. // non-2xx status code is an error. Response headers are in either
  36735. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  36736. // returned at all) in error.(*googleapi.Error).Header. Use
  36737. // googleapi.IsNotModified to check whether the returned error was
  36738. // because http.StatusNotModified was returned.
  36739. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  36740. gensupport.SetOptions(c.urlParams_, opts...)
  36741. res, err := c.doRequest("json")
  36742. if res != nil && res.StatusCode == http.StatusNotModified {
  36743. if res.Body != nil {
  36744. res.Body.Close()
  36745. }
  36746. return nil, &googleapi.Error{
  36747. Code: res.StatusCode,
  36748. Header: res.Header,
  36749. }
  36750. }
  36751. if err != nil {
  36752. return nil, err
  36753. }
  36754. defer googleapi.CloseBody(res)
  36755. if err := googleapi.CheckResponse(res); err != nil {
  36756. return nil, err
  36757. }
  36758. ret := &ProjectsListResponse{
  36759. ServerResponse: googleapi.ServerResponse{
  36760. Header: res.Header,
  36761. HTTPStatusCode: res.StatusCode,
  36762. },
  36763. }
  36764. target := &ret
  36765. if err := gensupport.DecodeResponse(target, res); err != nil {
  36766. return nil, err
  36767. }
  36768. return ret, nil
  36769. // {
  36770. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  36771. // "httpMethod": "GET",
  36772. // "id": "dfareporting.projects.list",
  36773. // "parameterOrder": [
  36774. // "profileId"
  36775. // ],
  36776. // "parameters": {
  36777. // "advertiserIds": {
  36778. // "description": "Select only projects with these advertiser IDs.",
  36779. // "format": "int64",
  36780. // "location": "query",
  36781. // "repeated": true,
  36782. // "type": "string"
  36783. // },
  36784. // "ids": {
  36785. // "description": "Select only projects with these IDs.",
  36786. // "format": "int64",
  36787. // "location": "query",
  36788. // "repeated": true,
  36789. // "type": "string"
  36790. // },
  36791. // "maxResults": {
  36792. // "default": "1000",
  36793. // "description": "Maximum number of results to return.",
  36794. // "format": "int32",
  36795. // "location": "query",
  36796. // "maximum": "1000",
  36797. // "minimum": "0",
  36798. // "type": "integer"
  36799. // },
  36800. // "pageToken": {
  36801. // "description": "Value of the nextPageToken from the previous result page.",
  36802. // "location": "query",
  36803. // "type": "string"
  36804. // },
  36805. // "profileId": {
  36806. // "description": "User profile ID associated with this request.",
  36807. // "format": "int64",
  36808. // "location": "path",
  36809. // "required": true,
  36810. // "type": "string"
  36811. // },
  36812. // "searchString": {
  36813. // "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\".",
  36814. // "location": "query",
  36815. // "type": "string"
  36816. // },
  36817. // "sortField": {
  36818. // "default": "ID",
  36819. // "description": "Field by which to sort the list.",
  36820. // "enum": [
  36821. // "ID",
  36822. // "NAME"
  36823. // ],
  36824. // "enumDescriptions": [
  36825. // "",
  36826. // ""
  36827. // ],
  36828. // "location": "query",
  36829. // "type": "string"
  36830. // },
  36831. // "sortOrder": {
  36832. // "default": "ASCENDING",
  36833. // "description": "Order of sorted results.",
  36834. // "enum": [
  36835. // "ASCENDING",
  36836. // "DESCENDING"
  36837. // ],
  36838. // "enumDescriptions": [
  36839. // "",
  36840. // ""
  36841. // ],
  36842. // "location": "query",
  36843. // "type": "string"
  36844. // }
  36845. // },
  36846. // "path": "userprofiles/{profileId}/projects",
  36847. // "response": {
  36848. // "$ref": "ProjectsListResponse"
  36849. // },
  36850. // "scopes": [
  36851. // "https://www.googleapis.com/auth/dfatrafficking"
  36852. // ]
  36853. // }
  36854. }
  36855. // Pages invokes f for each page of results.
  36856. // A non-nil error returned from f will halt the iteration.
  36857. // The provided context supersedes any context provided to the Context method.
  36858. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  36859. c.ctx_ = ctx
  36860. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36861. for {
  36862. x, err := c.Do()
  36863. if err != nil {
  36864. return err
  36865. }
  36866. if err := f(x); err != nil {
  36867. return err
  36868. }
  36869. if x.NextPageToken == "" {
  36870. return nil
  36871. }
  36872. c.PageToken(x.NextPageToken)
  36873. }
  36874. }
  36875. // method id "dfareporting.regions.list":
  36876. type RegionsListCall struct {
  36877. s *Service
  36878. profileId int64
  36879. urlParams_ gensupport.URLParams
  36880. ifNoneMatch_ string
  36881. ctx_ context.Context
  36882. header_ http.Header
  36883. }
  36884. // List: Retrieves a list of regions.
  36885. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  36886. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36887. c.profileId = profileId
  36888. return c
  36889. }
  36890. // Fields allows partial responses to be retrieved. See
  36891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36892. // for more information.
  36893. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  36894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36895. return c
  36896. }
  36897. // IfNoneMatch sets the optional parameter which makes the operation
  36898. // fail if the object's ETag matches the given value. This is useful for
  36899. // getting updates only after the object has changed since the last
  36900. // request. Use googleapi.IsNotModified to check whether the response
  36901. // error from Do is the result of In-None-Match.
  36902. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  36903. c.ifNoneMatch_ = entityTag
  36904. return c
  36905. }
  36906. // Context sets the context to be used in this call's Do method. Any
  36907. // pending HTTP request will be aborted if the provided context is
  36908. // canceled.
  36909. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  36910. c.ctx_ = ctx
  36911. return c
  36912. }
  36913. // Header returns an http.Header that can be modified by the caller to
  36914. // add HTTP headers to the request.
  36915. func (c *RegionsListCall) Header() http.Header {
  36916. if c.header_ == nil {
  36917. c.header_ = make(http.Header)
  36918. }
  36919. return c.header_
  36920. }
  36921. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  36922. reqHeaders := make(http.Header)
  36923. for k, v := range c.header_ {
  36924. reqHeaders[k] = v
  36925. }
  36926. reqHeaders.Set("User-Agent", c.s.userAgent())
  36927. if c.ifNoneMatch_ != "" {
  36928. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36929. }
  36930. var body io.Reader = nil
  36931. c.urlParams_.Set("alt", alt)
  36932. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  36933. urls += "?" + c.urlParams_.Encode()
  36934. req, _ := http.NewRequest("GET", urls, body)
  36935. req.Header = reqHeaders
  36936. googleapi.Expand(req.URL, map[string]string{
  36937. "profileId": strconv.FormatInt(c.profileId, 10),
  36938. })
  36939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36940. }
  36941. // Do executes the "dfareporting.regions.list" call.
  36942. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  36943. // non-2xx status code is an error. Response headers are in either
  36944. // *RegionsListResponse.ServerResponse.Header or (if a response was
  36945. // returned at all) in error.(*googleapi.Error).Header. Use
  36946. // googleapi.IsNotModified to check whether the returned error was
  36947. // because http.StatusNotModified was returned.
  36948. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  36949. gensupport.SetOptions(c.urlParams_, opts...)
  36950. res, err := c.doRequest("json")
  36951. if res != nil && res.StatusCode == http.StatusNotModified {
  36952. if res.Body != nil {
  36953. res.Body.Close()
  36954. }
  36955. return nil, &googleapi.Error{
  36956. Code: res.StatusCode,
  36957. Header: res.Header,
  36958. }
  36959. }
  36960. if err != nil {
  36961. return nil, err
  36962. }
  36963. defer googleapi.CloseBody(res)
  36964. if err := googleapi.CheckResponse(res); err != nil {
  36965. return nil, err
  36966. }
  36967. ret := &RegionsListResponse{
  36968. ServerResponse: googleapi.ServerResponse{
  36969. Header: res.Header,
  36970. HTTPStatusCode: res.StatusCode,
  36971. },
  36972. }
  36973. target := &ret
  36974. if err := gensupport.DecodeResponse(target, res); err != nil {
  36975. return nil, err
  36976. }
  36977. return ret, nil
  36978. // {
  36979. // "description": "Retrieves a list of regions.",
  36980. // "httpMethod": "GET",
  36981. // "id": "dfareporting.regions.list",
  36982. // "parameterOrder": [
  36983. // "profileId"
  36984. // ],
  36985. // "parameters": {
  36986. // "profileId": {
  36987. // "description": "User profile ID associated with this request.",
  36988. // "format": "int64",
  36989. // "location": "path",
  36990. // "required": true,
  36991. // "type": "string"
  36992. // }
  36993. // },
  36994. // "path": "userprofiles/{profileId}/regions",
  36995. // "response": {
  36996. // "$ref": "RegionsListResponse"
  36997. // },
  36998. // "scopes": [
  36999. // "https://www.googleapis.com/auth/dfatrafficking"
  37000. // ]
  37001. // }
  37002. }
  37003. // method id "dfareporting.remarketingListShares.get":
  37004. type RemarketingListSharesGetCall struct {
  37005. s *Service
  37006. profileId int64
  37007. remarketingListId int64
  37008. urlParams_ gensupport.URLParams
  37009. ifNoneMatch_ string
  37010. ctx_ context.Context
  37011. header_ http.Header
  37012. }
  37013. // Get: Gets one remarketing list share by remarketing list ID.
  37014. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  37015. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37016. c.profileId = profileId
  37017. c.remarketingListId = remarketingListId
  37018. return c
  37019. }
  37020. // Fields allows partial responses to be retrieved. See
  37021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37022. // for more information.
  37023. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  37024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37025. return c
  37026. }
  37027. // IfNoneMatch sets the optional parameter which makes the operation
  37028. // fail if the object's ETag matches the given value. This is useful for
  37029. // getting updates only after the object has changed since the last
  37030. // request. Use googleapi.IsNotModified to check whether the response
  37031. // error from Do is the result of In-None-Match.
  37032. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  37033. c.ifNoneMatch_ = entityTag
  37034. return c
  37035. }
  37036. // Context sets the context to be used in this call's Do method. Any
  37037. // pending HTTP request will be aborted if the provided context is
  37038. // canceled.
  37039. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  37040. c.ctx_ = ctx
  37041. return c
  37042. }
  37043. // Header returns an http.Header that can be modified by the caller to
  37044. // add HTTP headers to the request.
  37045. func (c *RemarketingListSharesGetCall) Header() http.Header {
  37046. if c.header_ == nil {
  37047. c.header_ = make(http.Header)
  37048. }
  37049. return c.header_
  37050. }
  37051. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  37052. reqHeaders := make(http.Header)
  37053. for k, v := range c.header_ {
  37054. reqHeaders[k] = v
  37055. }
  37056. reqHeaders.Set("User-Agent", c.s.userAgent())
  37057. if c.ifNoneMatch_ != "" {
  37058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37059. }
  37060. var body io.Reader = nil
  37061. c.urlParams_.Set("alt", alt)
  37062. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  37063. urls += "?" + c.urlParams_.Encode()
  37064. req, _ := http.NewRequest("GET", urls, body)
  37065. req.Header = reqHeaders
  37066. googleapi.Expand(req.URL, map[string]string{
  37067. "profileId": strconv.FormatInt(c.profileId, 10),
  37068. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  37069. })
  37070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37071. }
  37072. // Do executes the "dfareporting.remarketingListShares.get" call.
  37073. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37074. // non-2xx status code is an error. Response headers are in either
  37075. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37076. // returned at all) in error.(*googleapi.Error).Header. Use
  37077. // googleapi.IsNotModified to check whether the returned error was
  37078. // because http.StatusNotModified was returned.
  37079. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37080. gensupport.SetOptions(c.urlParams_, opts...)
  37081. res, err := c.doRequest("json")
  37082. if res != nil && res.StatusCode == http.StatusNotModified {
  37083. if res.Body != nil {
  37084. res.Body.Close()
  37085. }
  37086. return nil, &googleapi.Error{
  37087. Code: res.StatusCode,
  37088. Header: res.Header,
  37089. }
  37090. }
  37091. if err != nil {
  37092. return nil, err
  37093. }
  37094. defer googleapi.CloseBody(res)
  37095. if err := googleapi.CheckResponse(res); err != nil {
  37096. return nil, err
  37097. }
  37098. ret := &RemarketingListShare{
  37099. ServerResponse: googleapi.ServerResponse{
  37100. Header: res.Header,
  37101. HTTPStatusCode: res.StatusCode,
  37102. },
  37103. }
  37104. target := &ret
  37105. if err := gensupport.DecodeResponse(target, res); err != nil {
  37106. return nil, err
  37107. }
  37108. return ret, nil
  37109. // {
  37110. // "description": "Gets one remarketing list share by remarketing list ID.",
  37111. // "httpMethod": "GET",
  37112. // "id": "dfareporting.remarketingListShares.get",
  37113. // "parameterOrder": [
  37114. // "profileId",
  37115. // "remarketingListId"
  37116. // ],
  37117. // "parameters": {
  37118. // "profileId": {
  37119. // "description": "User profile ID associated with this request.",
  37120. // "format": "int64",
  37121. // "location": "path",
  37122. // "required": true,
  37123. // "type": "string"
  37124. // },
  37125. // "remarketingListId": {
  37126. // "description": "Remarketing list ID.",
  37127. // "format": "int64",
  37128. // "location": "path",
  37129. // "required": true,
  37130. // "type": "string"
  37131. // }
  37132. // },
  37133. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  37134. // "response": {
  37135. // "$ref": "RemarketingListShare"
  37136. // },
  37137. // "scopes": [
  37138. // "https://www.googleapis.com/auth/dfatrafficking"
  37139. // ]
  37140. // }
  37141. }
  37142. // method id "dfareporting.remarketingListShares.patch":
  37143. type RemarketingListSharesPatchCall struct {
  37144. s *Service
  37145. profileId int64
  37146. remarketinglistshare *RemarketingListShare
  37147. urlParams_ gensupport.URLParams
  37148. ctx_ context.Context
  37149. header_ http.Header
  37150. }
  37151. // Patch: Updates an existing remarketing list share. This method
  37152. // supports patch semantics.
  37153. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  37154. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37155. c.profileId = profileId
  37156. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  37157. c.remarketinglistshare = remarketinglistshare
  37158. return c
  37159. }
  37160. // Fields allows partial responses to be retrieved. See
  37161. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37162. // for more information.
  37163. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  37164. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37165. return c
  37166. }
  37167. // Context sets the context to be used in this call's Do method. Any
  37168. // pending HTTP request will be aborted if the provided context is
  37169. // canceled.
  37170. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  37171. c.ctx_ = ctx
  37172. return c
  37173. }
  37174. // Header returns an http.Header that can be modified by the caller to
  37175. // add HTTP headers to the request.
  37176. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  37177. if c.header_ == nil {
  37178. c.header_ = make(http.Header)
  37179. }
  37180. return c.header_
  37181. }
  37182. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  37183. reqHeaders := make(http.Header)
  37184. for k, v := range c.header_ {
  37185. reqHeaders[k] = v
  37186. }
  37187. reqHeaders.Set("User-Agent", c.s.userAgent())
  37188. var body io.Reader = nil
  37189. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  37190. if err != nil {
  37191. return nil, err
  37192. }
  37193. reqHeaders.Set("Content-Type", "application/json")
  37194. c.urlParams_.Set("alt", alt)
  37195. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  37196. urls += "?" + c.urlParams_.Encode()
  37197. req, _ := http.NewRequest("PATCH", urls, body)
  37198. req.Header = reqHeaders
  37199. googleapi.Expand(req.URL, map[string]string{
  37200. "profileId": strconv.FormatInt(c.profileId, 10),
  37201. })
  37202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37203. }
  37204. // Do executes the "dfareporting.remarketingListShares.patch" call.
  37205. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37206. // non-2xx status code is an error. Response headers are in either
  37207. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37208. // returned at all) in error.(*googleapi.Error).Header. Use
  37209. // googleapi.IsNotModified to check whether the returned error was
  37210. // because http.StatusNotModified was returned.
  37211. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37212. gensupport.SetOptions(c.urlParams_, opts...)
  37213. res, err := c.doRequest("json")
  37214. if res != nil && res.StatusCode == http.StatusNotModified {
  37215. if res.Body != nil {
  37216. res.Body.Close()
  37217. }
  37218. return nil, &googleapi.Error{
  37219. Code: res.StatusCode,
  37220. Header: res.Header,
  37221. }
  37222. }
  37223. if err != nil {
  37224. return nil, err
  37225. }
  37226. defer googleapi.CloseBody(res)
  37227. if err := googleapi.CheckResponse(res); err != nil {
  37228. return nil, err
  37229. }
  37230. ret := &RemarketingListShare{
  37231. ServerResponse: googleapi.ServerResponse{
  37232. Header: res.Header,
  37233. HTTPStatusCode: res.StatusCode,
  37234. },
  37235. }
  37236. target := &ret
  37237. if err := gensupport.DecodeResponse(target, res); err != nil {
  37238. return nil, err
  37239. }
  37240. return ret, nil
  37241. // {
  37242. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  37243. // "httpMethod": "PATCH",
  37244. // "id": "dfareporting.remarketingListShares.patch",
  37245. // "parameterOrder": [
  37246. // "profileId",
  37247. // "remarketingListId"
  37248. // ],
  37249. // "parameters": {
  37250. // "profileId": {
  37251. // "description": "User profile ID associated with this request.",
  37252. // "format": "int64",
  37253. // "location": "path",
  37254. // "required": true,
  37255. // "type": "string"
  37256. // },
  37257. // "remarketingListId": {
  37258. // "description": "Remarketing list ID.",
  37259. // "format": "int64",
  37260. // "location": "query",
  37261. // "required": true,
  37262. // "type": "string"
  37263. // }
  37264. // },
  37265. // "path": "userprofiles/{profileId}/remarketingListShares",
  37266. // "request": {
  37267. // "$ref": "RemarketingListShare"
  37268. // },
  37269. // "response": {
  37270. // "$ref": "RemarketingListShare"
  37271. // },
  37272. // "scopes": [
  37273. // "https://www.googleapis.com/auth/dfatrafficking"
  37274. // ]
  37275. // }
  37276. }
  37277. // method id "dfareporting.remarketingListShares.update":
  37278. type RemarketingListSharesUpdateCall struct {
  37279. s *Service
  37280. profileId int64
  37281. remarketinglistshare *RemarketingListShare
  37282. urlParams_ gensupport.URLParams
  37283. ctx_ context.Context
  37284. header_ http.Header
  37285. }
  37286. // Update: Updates an existing remarketing list share.
  37287. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  37288. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37289. c.profileId = profileId
  37290. c.remarketinglistshare = remarketinglistshare
  37291. return c
  37292. }
  37293. // Fields allows partial responses to be retrieved. See
  37294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37295. // for more information.
  37296. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  37297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37298. return c
  37299. }
  37300. // Context sets the context to be used in this call's Do method. Any
  37301. // pending HTTP request will be aborted if the provided context is
  37302. // canceled.
  37303. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  37304. c.ctx_ = ctx
  37305. return c
  37306. }
  37307. // Header returns an http.Header that can be modified by the caller to
  37308. // add HTTP headers to the request.
  37309. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  37310. if c.header_ == nil {
  37311. c.header_ = make(http.Header)
  37312. }
  37313. return c.header_
  37314. }
  37315. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  37316. reqHeaders := make(http.Header)
  37317. for k, v := range c.header_ {
  37318. reqHeaders[k] = v
  37319. }
  37320. reqHeaders.Set("User-Agent", c.s.userAgent())
  37321. var body io.Reader = nil
  37322. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  37323. if err != nil {
  37324. return nil, err
  37325. }
  37326. reqHeaders.Set("Content-Type", "application/json")
  37327. c.urlParams_.Set("alt", alt)
  37328. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  37329. urls += "?" + c.urlParams_.Encode()
  37330. req, _ := http.NewRequest("PUT", urls, body)
  37331. req.Header = reqHeaders
  37332. googleapi.Expand(req.URL, map[string]string{
  37333. "profileId": strconv.FormatInt(c.profileId, 10),
  37334. })
  37335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37336. }
  37337. // Do executes the "dfareporting.remarketingListShares.update" call.
  37338. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37339. // non-2xx status code is an error. Response headers are in either
  37340. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37341. // returned at all) in error.(*googleapi.Error).Header. Use
  37342. // googleapi.IsNotModified to check whether the returned error was
  37343. // because http.StatusNotModified was returned.
  37344. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37345. gensupport.SetOptions(c.urlParams_, opts...)
  37346. res, err := c.doRequest("json")
  37347. if res != nil && res.StatusCode == http.StatusNotModified {
  37348. if res.Body != nil {
  37349. res.Body.Close()
  37350. }
  37351. return nil, &googleapi.Error{
  37352. Code: res.StatusCode,
  37353. Header: res.Header,
  37354. }
  37355. }
  37356. if err != nil {
  37357. return nil, err
  37358. }
  37359. defer googleapi.CloseBody(res)
  37360. if err := googleapi.CheckResponse(res); err != nil {
  37361. return nil, err
  37362. }
  37363. ret := &RemarketingListShare{
  37364. ServerResponse: googleapi.ServerResponse{
  37365. Header: res.Header,
  37366. HTTPStatusCode: res.StatusCode,
  37367. },
  37368. }
  37369. target := &ret
  37370. if err := gensupport.DecodeResponse(target, res); err != nil {
  37371. return nil, err
  37372. }
  37373. return ret, nil
  37374. // {
  37375. // "description": "Updates an existing remarketing list share.",
  37376. // "httpMethod": "PUT",
  37377. // "id": "dfareporting.remarketingListShares.update",
  37378. // "parameterOrder": [
  37379. // "profileId"
  37380. // ],
  37381. // "parameters": {
  37382. // "profileId": {
  37383. // "description": "User profile ID associated with this request.",
  37384. // "format": "int64",
  37385. // "location": "path",
  37386. // "required": true,
  37387. // "type": "string"
  37388. // }
  37389. // },
  37390. // "path": "userprofiles/{profileId}/remarketingListShares",
  37391. // "request": {
  37392. // "$ref": "RemarketingListShare"
  37393. // },
  37394. // "response": {
  37395. // "$ref": "RemarketingListShare"
  37396. // },
  37397. // "scopes": [
  37398. // "https://www.googleapis.com/auth/dfatrafficking"
  37399. // ]
  37400. // }
  37401. }
  37402. // method id "dfareporting.remarketingLists.get":
  37403. type RemarketingListsGetCall struct {
  37404. s *Service
  37405. profileId int64
  37406. id int64
  37407. urlParams_ gensupport.URLParams
  37408. ifNoneMatch_ string
  37409. ctx_ context.Context
  37410. header_ http.Header
  37411. }
  37412. // Get: Gets one remarketing list by ID.
  37413. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  37414. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37415. c.profileId = profileId
  37416. c.id = id
  37417. return c
  37418. }
  37419. // Fields allows partial responses to be retrieved. See
  37420. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37421. // for more information.
  37422. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  37423. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37424. return c
  37425. }
  37426. // IfNoneMatch sets the optional parameter which makes the operation
  37427. // fail if the object's ETag matches the given value. This is useful for
  37428. // getting updates only after the object has changed since the last
  37429. // request. Use googleapi.IsNotModified to check whether the response
  37430. // error from Do is the result of In-None-Match.
  37431. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  37432. c.ifNoneMatch_ = entityTag
  37433. return c
  37434. }
  37435. // Context sets the context to be used in this call's Do method. Any
  37436. // pending HTTP request will be aborted if the provided context is
  37437. // canceled.
  37438. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  37439. c.ctx_ = ctx
  37440. return c
  37441. }
  37442. // Header returns an http.Header that can be modified by the caller to
  37443. // add HTTP headers to the request.
  37444. func (c *RemarketingListsGetCall) Header() http.Header {
  37445. if c.header_ == nil {
  37446. c.header_ = make(http.Header)
  37447. }
  37448. return c.header_
  37449. }
  37450. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  37451. reqHeaders := make(http.Header)
  37452. for k, v := range c.header_ {
  37453. reqHeaders[k] = v
  37454. }
  37455. reqHeaders.Set("User-Agent", c.s.userAgent())
  37456. if c.ifNoneMatch_ != "" {
  37457. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37458. }
  37459. var body io.Reader = nil
  37460. c.urlParams_.Set("alt", alt)
  37461. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  37462. urls += "?" + c.urlParams_.Encode()
  37463. req, _ := http.NewRequest("GET", urls, body)
  37464. req.Header = reqHeaders
  37465. googleapi.Expand(req.URL, map[string]string{
  37466. "profileId": strconv.FormatInt(c.profileId, 10),
  37467. "id": strconv.FormatInt(c.id, 10),
  37468. })
  37469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37470. }
  37471. // Do executes the "dfareporting.remarketingLists.get" call.
  37472. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  37473. // status code is an error. Response headers are in either
  37474. // *RemarketingList.ServerResponse.Header or (if a response was returned
  37475. // at all) in error.(*googleapi.Error).Header. Use
  37476. // googleapi.IsNotModified to check whether the returned error was
  37477. // because http.StatusNotModified was returned.
  37478. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  37479. gensupport.SetOptions(c.urlParams_, opts...)
  37480. res, err := c.doRequest("json")
  37481. if res != nil && res.StatusCode == http.StatusNotModified {
  37482. if res.Body != nil {
  37483. res.Body.Close()
  37484. }
  37485. return nil, &googleapi.Error{
  37486. Code: res.StatusCode,
  37487. Header: res.Header,
  37488. }
  37489. }
  37490. if err != nil {
  37491. return nil, err
  37492. }
  37493. defer googleapi.CloseBody(res)
  37494. if err := googleapi.CheckResponse(res); err != nil {
  37495. return nil, err
  37496. }
  37497. ret := &RemarketingList{
  37498. ServerResponse: googleapi.ServerResponse{
  37499. Header: res.Header,
  37500. HTTPStatusCode: res.StatusCode,
  37501. },
  37502. }
  37503. target := &ret
  37504. if err := gensupport.DecodeResponse(target, res); err != nil {
  37505. return nil, err
  37506. }
  37507. return ret, nil
  37508. // {
  37509. // "description": "Gets one remarketing list by ID.",
  37510. // "httpMethod": "GET",
  37511. // "id": "dfareporting.remarketingLists.get",
  37512. // "parameterOrder": [
  37513. // "profileId",
  37514. // "id"
  37515. // ],
  37516. // "parameters": {
  37517. // "id": {
  37518. // "description": "Remarketing list ID.",
  37519. // "format": "int64",
  37520. // "location": "path",
  37521. // "required": true,
  37522. // "type": "string"
  37523. // },
  37524. // "profileId": {
  37525. // "description": "User profile ID associated with this request.",
  37526. // "format": "int64",
  37527. // "location": "path",
  37528. // "required": true,
  37529. // "type": "string"
  37530. // }
  37531. // },
  37532. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  37533. // "response": {
  37534. // "$ref": "RemarketingList"
  37535. // },
  37536. // "scopes": [
  37537. // "https://www.googleapis.com/auth/dfatrafficking"
  37538. // ]
  37539. // }
  37540. }
  37541. // method id "dfareporting.remarketingLists.insert":
  37542. type RemarketingListsInsertCall struct {
  37543. s *Service
  37544. profileId int64
  37545. remarketinglist *RemarketingList
  37546. urlParams_ gensupport.URLParams
  37547. ctx_ context.Context
  37548. header_ http.Header
  37549. }
  37550. // Insert: Inserts a new remarketing list.
  37551. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  37552. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37553. c.profileId = profileId
  37554. c.remarketinglist = remarketinglist
  37555. return c
  37556. }
  37557. // Fields allows partial responses to be retrieved. See
  37558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37559. // for more information.
  37560. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  37561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37562. return c
  37563. }
  37564. // Context sets the context to be used in this call's Do method. Any
  37565. // pending HTTP request will be aborted if the provided context is
  37566. // canceled.
  37567. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  37568. c.ctx_ = ctx
  37569. return c
  37570. }
  37571. // Header returns an http.Header that can be modified by the caller to
  37572. // add HTTP headers to the request.
  37573. func (c *RemarketingListsInsertCall) Header() http.Header {
  37574. if c.header_ == nil {
  37575. c.header_ = make(http.Header)
  37576. }
  37577. return c.header_
  37578. }
  37579. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  37580. reqHeaders := make(http.Header)
  37581. for k, v := range c.header_ {
  37582. reqHeaders[k] = v
  37583. }
  37584. reqHeaders.Set("User-Agent", c.s.userAgent())
  37585. var body io.Reader = nil
  37586. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  37587. if err != nil {
  37588. return nil, err
  37589. }
  37590. reqHeaders.Set("Content-Type", "application/json")
  37591. c.urlParams_.Set("alt", alt)
  37592. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37593. urls += "?" + c.urlParams_.Encode()
  37594. req, _ := http.NewRequest("POST", urls, body)
  37595. req.Header = reqHeaders
  37596. googleapi.Expand(req.URL, map[string]string{
  37597. "profileId": strconv.FormatInt(c.profileId, 10),
  37598. })
  37599. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37600. }
  37601. // Do executes the "dfareporting.remarketingLists.insert" call.
  37602. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  37603. // status code is an error. Response headers are in either
  37604. // *RemarketingList.ServerResponse.Header or (if a response was returned
  37605. // at all) in error.(*googleapi.Error).Header. Use
  37606. // googleapi.IsNotModified to check whether the returned error was
  37607. // because http.StatusNotModified was returned.
  37608. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  37609. gensupport.SetOptions(c.urlParams_, opts...)
  37610. res, err := c.doRequest("json")
  37611. if res != nil && res.StatusCode == http.StatusNotModified {
  37612. if res.Body != nil {
  37613. res.Body.Close()
  37614. }
  37615. return nil, &googleapi.Error{
  37616. Code: res.StatusCode,
  37617. Header: res.Header,
  37618. }
  37619. }
  37620. if err != nil {
  37621. return nil, err
  37622. }
  37623. defer googleapi.CloseBody(res)
  37624. if err := googleapi.CheckResponse(res); err != nil {
  37625. return nil, err
  37626. }
  37627. ret := &RemarketingList{
  37628. ServerResponse: googleapi.ServerResponse{
  37629. Header: res.Header,
  37630. HTTPStatusCode: res.StatusCode,
  37631. },
  37632. }
  37633. target := &ret
  37634. if err := gensupport.DecodeResponse(target, res); err != nil {
  37635. return nil, err
  37636. }
  37637. return ret, nil
  37638. // {
  37639. // "description": "Inserts a new remarketing list.",
  37640. // "httpMethod": "POST",
  37641. // "id": "dfareporting.remarketingLists.insert",
  37642. // "parameterOrder": [
  37643. // "profileId"
  37644. // ],
  37645. // "parameters": {
  37646. // "profileId": {
  37647. // "description": "User profile ID associated with this request.",
  37648. // "format": "int64",
  37649. // "location": "path",
  37650. // "required": true,
  37651. // "type": "string"
  37652. // }
  37653. // },
  37654. // "path": "userprofiles/{profileId}/remarketingLists",
  37655. // "request": {
  37656. // "$ref": "RemarketingList"
  37657. // },
  37658. // "response": {
  37659. // "$ref": "RemarketingList"
  37660. // },
  37661. // "scopes": [
  37662. // "https://www.googleapis.com/auth/dfatrafficking"
  37663. // ]
  37664. // }
  37665. }
  37666. // method id "dfareporting.remarketingLists.list":
  37667. type RemarketingListsListCall struct {
  37668. s *Service
  37669. profileId int64
  37670. urlParams_ gensupport.URLParams
  37671. ifNoneMatch_ string
  37672. ctx_ context.Context
  37673. header_ http.Header
  37674. }
  37675. // List: Retrieves a list of remarketing lists, possibly filtered. This
  37676. // method supports paging.
  37677. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  37678. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37679. c.profileId = profileId
  37680. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  37681. return c
  37682. }
  37683. // Active sets the optional parameter "active": Select only active or
  37684. // only inactive remarketing lists.
  37685. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  37686. c.urlParams_.Set("active", fmt.Sprint(active))
  37687. return c
  37688. }
  37689. // FloodlightActivityId sets the optional parameter
  37690. // "floodlightActivityId": Select only remarketing lists that have this
  37691. // floodlight activity ID.
  37692. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  37693. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  37694. return c
  37695. }
  37696. // MaxResults sets the optional parameter "maxResults": Maximum number
  37697. // of results to return.
  37698. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  37699. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37700. return c
  37701. }
  37702. // Name sets the optional parameter "name": Allows searching for objects
  37703. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  37704. // list*2015" will return objects with names like "remarketing list June
  37705. // 2015", "remarketing list April 2015", or simply "remarketing list
  37706. // 2015". Most of the searches also add wildcards implicitly at the
  37707. // start and the end of the search string. For example, a search string
  37708. // of "remarketing list" will match objects with name "my remarketing
  37709. // list", "remarketing list 2015", or simply "remarketing list".
  37710. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  37711. c.urlParams_.Set("name", name)
  37712. return c
  37713. }
  37714. // PageToken sets the optional parameter "pageToken": Value of the
  37715. // nextPageToken from the previous result page.
  37716. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  37717. c.urlParams_.Set("pageToken", pageToken)
  37718. return c
  37719. }
  37720. // SortField sets the optional parameter "sortField": Field by which to
  37721. // sort the list.
  37722. //
  37723. // Possible values:
  37724. // "ID" (default)
  37725. // "NAME"
  37726. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  37727. c.urlParams_.Set("sortField", sortField)
  37728. return c
  37729. }
  37730. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  37731. // results.
  37732. //
  37733. // Possible values:
  37734. // "ASCENDING" (default)
  37735. // "DESCENDING"
  37736. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  37737. c.urlParams_.Set("sortOrder", sortOrder)
  37738. return c
  37739. }
  37740. // Fields allows partial responses to be retrieved. See
  37741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37742. // for more information.
  37743. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  37744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37745. return c
  37746. }
  37747. // IfNoneMatch sets the optional parameter which makes the operation
  37748. // fail if the object's ETag matches the given value. This is useful for
  37749. // getting updates only after the object has changed since the last
  37750. // request. Use googleapi.IsNotModified to check whether the response
  37751. // error from Do is the result of In-None-Match.
  37752. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  37753. c.ifNoneMatch_ = entityTag
  37754. return c
  37755. }
  37756. // Context sets the context to be used in this call's Do method. Any
  37757. // pending HTTP request will be aborted if the provided context is
  37758. // canceled.
  37759. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  37760. c.ctx_ = ctx
  37761. return c
  37762. }
  37763. // Header returns an http.Header that can be modified by the caller to
  37764. // add HTTP headers to the request.
  37765. func (c *RemarketingListsListCall) Header() http.Header {
  37766. if c.header_ == nil {
  37767. c.header_ = make(http.Header)
  37768. }
  37769. return c.header_
  37770. }
  37771. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  37772. reqHeaders := make(http.Header)
  37773. for k, v := range c.header_ {
  37774. reqHeaders[k] = v
  37775. }
  37776. reqHeaders.Set("User-Agent", c.s.userAgent())
  37777. if c.ifNoneMatch_ != "" {
  37778. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37779. }
  37780. var body io.Reader = nil
  37781. c.urlParams_.Set("alt", alt)
  37782. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37783. urls += "?" + c.urlParams_.Encode()
  37784. req, _ := http.NewRequest("GET", urls, body)
  37785. req.Header = reqHeaders
  37786. googleapi.Expand(req.URL, map[string]string{
  37787. "profileId": strconv.FormatInt(c.profileId, 10),
  37788. })
  37789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37790. }
  37791. // Do executes the "dfareporting.remarketingLists.list" call.
  37792. // Exactly one of *RemarketingListsListResponse or error will be
  37793. // non-nil. Any non-2xx status code is an error. Response headers are in
  37794. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  37795. // response was returned at all) in error.(*googleapi.Error).Header. Use
  37796. // googleapi.IsNotModified to check whether the returned error was
  37797. // because http.StatusNotModified was returned.
  37798. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  37799. gensupport.SetOptions(c.urlParams_, opts...)
  37800. res, err := c.doRequest("json")
  37801. if res != nil && res.StatusCode == http.StatusNotModified {
  37802. if res.Body != nil {
  37803. res.Body.Close()
  37804. }
  37805. return nil, &googleapi.Error{
  37806. Code: res.StatusCode,
  37807. Header: res.Header,
  37808. }
  37809. }
  37810. if err != nil {
  37811. return nil, err
  37812. }
  37813. defer googleapi.CloseBody(res)
  37814. if err := googleapi.CheckResponse(res); err != nil {
  37815. return nil, err
  37816. }
  37817. ret := &RemarketingListsListResponse{
  37818. ServerResponse: googleapi.ServerResponse{
  37819. Header: res.Header,
  37820. HTTPStatusCode: res.StatusCode,
  37821. },
  37822. }
  37823. target := &ret
  37824. if err := gensupport.DecodeResponse(target, res); err != nil {
  37825. return nil, err
  37826. }
  37827. return ret, nil
  37828. // {
  37829. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  37830. // "httpMethod": "GET",
  37831. // "id": "dfareporting.remarketingLists.list",
  37832. // "parameterOrder": [
  37833. // "profileId",
  37834. // "advertiserId"
  37835. // ],
  37836. // "parameters": {
  37837. // "active": {
  37838. // "description": "Select only active or only inactive remarketing lists.",
  37839. // "location": "query",
  37840. // "type": "boolean"
  37841. // },
  37842. // "advertiserId": {
  37843. // "description": "Select only remarketing lists owned by this advertiser.",
  37844. // "format": "int64",
  37845. // "location": "query",
  37846. // "required": true,
  37847. // "type": "string"
  37848. // },
  37849. // "floodlightActivityId": {
  37850. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  37851. // "format": "int64",
  37852. // "location": "query",
  37853. // "type": "string"
  37854. // },
  37855. // "maxResults": {
  37856. // "default": "1000",
  37857. // "description": "Maximum number of results to return.",
  37858. // "format": "int32",
  37859. // "location": "query",
  37860. // "maximum": "1000",
  37861. // "minimum": "0",
  37862. // "type": "integer"
  37863. // },
  37864. // "name": {
  37865. // "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\".",
  37866. // "location": "query",
  37867. // "type": "string"
  37868. // },
  37869. // "pageToken": {
  37870. // "description": "Value of the nextPageToken from the previous result page.",
  37871. // "location": "query",
  37872. // "type": "string"
  37873. // },
  37874. // "profileId": {
  37875. // "description": "User profile ID associated with this request.",
  37876. // "format": "int64",
  37877. // "location": "path",
  37878. // "required": true,
  37879. // "type": "string"
  37880. // },
  37881. // "sortField": {
  37882. // "default": "ID",
  37883. // "description": "Field by which to sort the list.",
  37884. // "enum": [
  37885. // "ID",
  37886. // "NAME"
  37887. // ],
  37888. // "enumDescriptions": [
  37889. // "",
  37890. // ""
  37891. // ],
  37892. // "location": "query",
  37893. // "type": "string"
  37894. // },
  37895. // "sortOrder": {
  37896. // "default": "ASCENDING",
  37897. // "description": "Order of sorted results.",
  37898. // "enum": [
  37899. // "ASCENDING",
  37900. // "DESCENDING"
  37901. // ],
  37902. // "enumDescriptions": [
  37903. // "",
  37904. // ""
  37905. // ],
  37906. // "location": "query",
  37907. // "type": "string"
  37908. // }
  37909. // },
  37910. // "path": "userprofiles/{profileId}/remarketingLists",
  37911. // "response": {
  37912. // "$ref": "RemarketingListsListResponse"
  37913. // },
  37914. // "scopes": [
  37915. // "https://www.googleapis.com/auth/dfatrafficking"
  37916. // ]
  37917. // }
  37918. }
  37919. // Pages invokes f for each page of results.
  37920. // A non-nil error returned from f will halt the iteration.
  37921. // The provided context supersedes any context provided to the Context method.
  37922. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  37923. c.ctx_ = ctx
  37924. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37925. for {
  37926. x, err := c.Do()
  37927. if err != nil {
  37928. return err
  37929. }
  37930. if err := f(x); err != nil {
  37931. return err
  37932. }
  37933. if x.NextPageToken == "" {
  37934. return nil
  37935. }
  37936. c.PageToken(x.NextPageToken)
  37937. }
  37938. }
  37939. // method id "dfareporting.remarketingLists.patch":
  37940. type RemarketingListsPatchCall struct {
  37941. s *Service
  37942. profileId int64
  37943. remarketinglist *RemarketingList
  37944. urlParams_ gensupport.URLParams
  37945. ctx_ context.Context
  37946. header_ http.Header
  37947. }
  37948. // Patch: Updates an existing remarketing list. This method supports
  37949. // patch semantics.
  37950. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  37951. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37952. c.profileId = profileId
  37953. c.urlParams_.Set("id", fmt.Sprint(id))
  37954. c.remarketinglist = remarketinglist
  37955. return c
  37956. }
  37957. // Fields allows partial responses to be retrieved. See
  37958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37959. // for more information.
  37960. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  37961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37962. return c
  37963. }
  37964. // Context sets the context to be used in this call's Do method. Any
  37965. // pending HTTP request will be aborted if the provided context is
  37966. // canceled.
  37967. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  37968. c.ctx_ = ctx
  37969. return c
  37970. }
  37971. // Header returns an http.Header that can be modified by the caller to
  37972. // add HTTP headers to the request.
  37973. func (c *RemarketingListsPatchCall) Header() http.Header {
  37974. if c.header_ == nil {
  37975. c.header_ = make(http.Header)
  37976. }
  37977. return c.header_
  37978. }
  37979. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  37980. reqHeaders := make(http.Header)
  37981. for k, v := range c.header_ {
  37982. reqHeaders[k] = v
  37983. }
  37984. reqHeaders.Set("User-Agent", c.s.userAgent())
  37985. var body io.Reader = nil
  37986. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  37987. if err != nil {
  37988. return nil, err
  37989. }
  37990. reqHeaders.Set("Content-Type", "application/json")
  37991. c.urlParams_.Set("alt", alt)
  37992. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37993. urls += "?" + c.urlParams_.Encode()
  37994. req, _ := http.NewRequest("PATCH", urls, body)
  37995. req.Header = reqHeaders
  37996. googleapi.Expand(req.URL, map[string]string{
  37997. "profileId": strconv.FormatInt(c.profileId, 10),
  37998. })
  37999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38000. }
  38001. // Do executes the "dfareporting.remarketingLists.patch" call.
  38002. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38003. // status code is an error. Response headers are in either
  38004. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38005. // at all) in error.(*googleapi.Error).Header. Use
  38006. // googleapi.IsNotModified to check whether the returned error was
  38007. // because http.StatusNotModified was returned.
  38008. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38009. gensupport.SetOptions(c.urlParams_, opts...)
  38010. res, err := c.doRequest("json")
  38011. if res != nil && res.StatusCode == http.StatusNotModified {
  38012. if res.Body != nil {
  38013. res.Body.Close()
  38014. }
  38015. return nil, &googleapi.Error{
  38016. Code: res.StatusCode,
  38017. Header: res.Header,
  38018. }
  38019. }
  38020. if err != nil {
  38021. return nil, err
  38022. }
  38023. defer googleapi.CloseBody(res)
  38024. if err := googleapi.CheckResponse(res); err != nil {
  38025. return nil, err
  38026. }
  38027. ret := &RemarketingList{
  38028. ServerResponse: googleapi.ServerResponse{
  38029. Header: res.Header,
  38030. HTTPStatusCode: res.StatusCode,
  38031. },
  38032. }
  38033. target := &ret
  38034. if err := gensupport.DecodeResponse(target, res); err != nil {
  38035. return nil, err
  38036. }
  38037. return ret, nil
  38038. // {
  38039. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  38040. // "httpMethod": "PATCH",
  38041. // "id": "dfareporting.remarketingLists.patch",
  38042. // "parameterOrder": [
  38043. // "profileId",
  38044. // "id"
  38045. // ],
  38046. // "parameters": {
  38047. // "id": {
  38048. // "description": "Remarketing list ID.",
  38049. // "format": "int64",
  38050. // "location": "query",
  38051. // "required": true,
  38052. // "type": "string"
  38053. // },
  38054. // "profileId": {
  38055. // "description": "User profile ID associated with this request.",
  38056. // "format": "int64",
  38057. // "location": "path",
  38058. // "required": true,
  38059. // "type": "string"
  38060. // }
  38061. // },
  38062. // "path": "userprofiles/{profileId}/remarketingLists",
  38063. // "request": {
  38064. // "$ref": "RemarketingList"
  38065. // },
  38066. // "response": {
  38067. // "$ref": "RemarketingList"
  38068. // },
  38069. // "scopes": [
  38070. // "https://www.googleapis.com/auth/dfatrafficking"
  38071. // ]
  38072. // }
  38073. }
  38074. // method id "dfareporting.remarketingLists.update":
  38075. type RemarketingListsUpdateCall struct {
  38076. s *Service
  38077. profileId int64
  38078. remarketinglist *RemarketingList
  38079. urlParams_ gensupport.URLParams
  38080. ctx_ context.Context
  38081. header_ http.Header
  38082. }
  38083. // Update: Updates an existing remarketing list.
  38084. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  38085. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38086. c.profileId = profileId
  38087. c.remarketinglist = remarketinglist
  38088. return c
  38089. }
  38090. // Fields allows partial responses to be retrieved. See
  38091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38092. // for more information.
  38093. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  38094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38095. return c
  38096. }
  38097. // Context sets the context to be used in this call's Do method. Any
  38098. // pending HTTP request will be aborted if the provided context is
  38099. // canceled.
  38100. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  38101. c.ctx_ = ctx
  38102. return c
  38103. }
  38104. // Header returns an http.Header that can be modified by the caller to
  38105. // add HTTP headers to the request.
  38106. func (c *RemarketingListsUpdateCall) Header() http.Header {
  38107. if c.header_ == nil {
  38108. c.header_ = make(http.Header)
  38109. }
  38110. return c.header_
  38111. }
  38112. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  38113. reqHeaders := make(http.Header)
  38114. for k, v := range c.header_ {
  38115. reqHeaders[k] = v
  38116. }
  38117. reqHeaders.Set("User-Agent", c.s.userAgent())
  38118. var body io.Reader = nil
  38119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38120. if err != nil {
  38121. return nil, err
  38122. }
  38123. reqHeaders.Set("Content-Type", "application/json")
  38124. c.urlParams_.Set("alt", alt)
  38125. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38126. urls += "?" + c.urlParams_.Encode()
  38127. req, _ := http.NewRequest("PUT", urls, body)
  38128. req.Header = reqHeaders
  38129. googleapi.Expand(req.URL, map[string]string{
  38130. "profileId": strconv.FormatInt(c.profileId, 10),
  38131. })
  38132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38133. }
  38134. // Do executes the "dfareporting.remarketingLists.update" call.
  38135. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38136. // status code is an error. Response headers are in either
  38137. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38138. // at all) in error.(*googleapi.Error).Header. Use
  38139. // googleapi.IsNotModified to check whether the returned error was
  38140. // because http.StatusNotModified was returned.
  38141. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38142. gensupport.SetOptions(c.urlParams_, opts...)
  38143. res, err := c.doRequest("json")
  38144. if res != nil && res.StatusCode == http.StatusNotModified {
  38145. if res.Body != nil {
  38146. res.Body.Close()
  38147. }
  38148. return nil, &googleapi.Error{
  38149. Code: res.StatusCode,
  38150. Header: res.Header,
  38151. }
  38152. }
  38153. if err != nil {
  38154. return nil, err
  38155. }
  38156. defer googleapi.CloseBody(res)
  38157. if err := googleapi.CheckResponse(res); err != nil {
  38158. return nil, err
  38159. }
  38160. ret := &RemarketingList{
  38161. ServerResponse: googleapi.ServerResponse{
  38162. Header: res.Header,
  38163. HTTPStatusCode: res.StatusCode,
  38164. },
  38165. }
  38166. target := &ret
  38167. if err := gensupport.DecodeResponse(target, res); err != nil {
  38168. return nil, err
  38169. }
  38170. return ret, nil
  38171. // {
  38172. // "description": "Updates an existing remarketing list.",
  38173. // "httpMethod": "PUT",
  38174. // "id": "dfareporting.remarketingLists.update",
  38175. // "parameterOrder": [
  38176. // "profileId"
  38177. // ],
  38178. // "parameters": {
  38179. // "profileId": {
  38180. // "description": "User profile ID associated with this request.",
  38181. // "format": "int64",
  38182. // "location": "path",
  38183. // "required": true,
  38184. // "type": "string"
  38185. // }
  38186. // },
  38187. // "path": "userprofiles/{profileId}/remarketingLists",
  38188. // "request": {
  38189. // "$ref": "RemarketingList"
  38190. // },
  38191. // "response": {
  38192. // "$ref": "RemarketingList"
  38193. // },
  38194. // "scopes": [
  38195. // "https://www.googleapis.com/auth/dfatrafficking"
  38196. // ]
  38197. // }
  38198. }
  38199. // method id "dfareporting.reports.delete":
  38200. type ReportsDeleteCall struct {
  38201. s *Service
  38202. profileId int64
  38203. reportId int64
  38204. urlParams_ gensupport.URLParams
  38205. ctx_ context.Context
  38206. header_ http.Header
  38207. }
  38208. // Delete: Deletes a report by its ID.
  38209. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  38210. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38211. c.profileId = profileId
  38212. c.reportId = reportId
  38213. return c
  38214. }
  38215. // Fields allows partial responses to be retrieved. See
  38216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38217. // for more information.
  38218. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  38219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38220. return c
  38221. }
  38222. // Context sets the context to be used in this call's Do method. Any
  38223. // pending HTTP request will be aborted if the provided context is
  38224. // canceled.
  38225. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  38226. c.ctx_ = ctx
  38227. return c
  38228. }
  38229. // Header returns an http.Header that can be modified by the caller to
  38230. // add HTTP headers to the request.
  38231. func (c *ReportsDeleteCall) Header() http.Header {
  38232. if c.header_ == nil {
  38233. c.header_ = make(http.Header)
  38234. }
  38235. return c.header_
  38236. }
  38237. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  38238. reqHeaders := make(http.Header)
  38239. for k, v := range c.header_ {
  38240. reqHeaders[k] = v
  38241. }
  38242. reqHeaders.Set("User-Agent", c.s.userAgent())
  38243. var body io.Reader = nil
  38244. c.urlParams_.Set("alt", alt)
  38245. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38246. urls += "?" + c.urlParams_.Encode()
  38247. req, _ := http.NewRequest("DELETE", urls, body)
  38248. req.Header = reqHeaders
  38249. googleapi.Expand(req.URL, map[string]string{
  38250. "profileId": strconv.FormatInt(c.profileId, 10),
  38251. "reportId": strconv.FormatInt(c.reportId, 10),
  38252. })
  38253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38254. }
  38255. // Do executes the "dfareporting.reports.delete" call.
  38256. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  38257. gensupport.SetOptions(c.urlParams_, opts...)
  38258. res, err := c.doRequest("json")
  38259. if err != nil {
  38260. return err
  38261. }
  38262. defer googleapi.CloseBody(res)
  38263. if err := googleapi.CheckResponse(res); err != nil {
  38264. return err
  38265. }
  38266. return nil
  38267. // {
  38268. // "description": "Deletes a report by its ID.",
  38269. // "httpMethod": "DELETE",
  38270. // "id": "dfareporting.reports.delete",
  38271. // "parameterOrder": [
  38272. // "profileId",
  38273. // "reportId"
  38274. // ],
  38275. // "parameters": {
  38276. // "profileId": {
  38277. // "description": "The DFA user profile ID.",
  38278. // "format": "int64",
  38279. // "location": "path",
  38280. // "required": true,
  38281. // "type": "string"
  38282. // },
  38283. // "reportId": {
  38284. // "description": "The ID of the report.",
  38285. // "format": "int64",
  38286. // "location": "path",
  38287. // "required": true,
  38288. // "type": "string"
  38289. // }
  38290. // },
  38291. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38292. // "scopes": [
  38293. // "https://www.googleapis.com/auth/dfareporting"
  38294. // ]
  38295. // }
  38296. }
  38297. // method id "dfareporting.reports.get":
  38298. type ReportsGetCall struct {
  38299. s *Service
  38300. profileId int64
  38301. reportId int64
  38302. urlParams_ gensupport.URLParams
  38303. ifNoneMatch_ string
  38304. ctx_ context.Context
  38305. header_ http.Header
  38306. }
  38307. // Get: Retrieves a report by its ID.
  38308. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  38309. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38310. c.profileId = profileId
  38311. c.reportId = reportId
  38312. return c
  38313. }
  38314. // Fields allows partial responses to be retrieved. See
  38315. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38316. // for more information.
  38317. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  38318. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38319. return c
  38320. }
  38321. // IfNoneMatch sets the optional parameter which makes the operation
  38322. // fail if the object's ETag matches the given value. This is useful for
  38323. // getting updates only after the object has changed since the last
  38324. // request. Use googleapi.IsNotModified to check whether the response
  38325. // error from Do is the result of In-None-Match.
  38326. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  38327. c.ifNoneMatch_ = entityTag
  38328. return c
  38329. }
  38330. // Context sets the context to be used in this call's Do method. Any
  38331. // pending HTTP request will be aborted if the provided context is
  38332. // canceled.
  38333. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  38334. c.ctx_ = ctx
  38335. return c
  38336. }
  38337. // Header returns an http.Header that can be modified by the caller to
  38338. // add HTTP headers to the request.
  38339. func (c *ReportsGetCall) Header() http.Header {
  38340. if c.header_ == nil {
  38341. c.header_ = make(http.Header)
  38342. }
  38343. return c.header_
  38344. }
  38345. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  38346. reqHeaders := make(http.Header)
  38347. for k, v := range c.header_ {
  38348. reqHeaders[k] = v
  38349. }
  38350. reqHeaders.Set("User-Agent", c.s.userAgent())
  38351. if c.ifNoneMatch_ != "" {
  38352. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38353. }
  38354. var body io.Reader = nil
  38355. c.urlParams_.Set("alt", alt)
  38356. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38357. urls += "?" + c.urlParams_.Encode()
  38358. req, _ := http.NewRequest("GET", urls, body)
  38359. req.Header = reqHeaders
  38360. googleapi.Expand(req.URL, map[string]string{
  38361. "profileId": strconv.FormatInt(c.profileId, 10),
  38362. "reportId": strconv.FormatInt(c.reportId, 10),
  38363. })
  38364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38365. }
  38366. // Do executes the "dfareporting.reports.get" call.
  38367. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38368. // code is an error. Response headers are in either
  38369. // *Report.ServerResponse.Header or (if a response was returned at all)
  38370. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38371. // check whether the returned error was because http.StatusNotModified
  38372. // was returned.
  38373. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38374. gensupport.SetOptions(c.urlParams_, opts...)
  38375. res, err := c.doRequest("json")
  38376. if res != nil && res.StatusCode == http.StatusNotModified {
  38377. if res.Body != nil {
  38378. res.Body.Close()
  38379. }
  38380. return nil, &googleapi.Error{
  38381. Code: res.StatusCode,
  38382. Header: res.Header,
  38383. }
  38384. }
  38385. if err != nil {
  38386. return nil, err
  38387. }
  38388. defer googleapi.CloseBody(res)
  38389. if err := googleapi.CheckResponse(res); err != nil {
  38390. return nil, err
  38391. }
  38392. ret := &Report{
  38393. ServerResponse: googleapi.ServerResponse{
  38394. Header: res.Header,
  38395. HTTPStatusCode: res.StatusCode,
  38396. },
  38397. }
  38398. target := &ret
  38399. if err := gensupport.DecodeResponse(target, res); err != nil {
  38400. return nil, err
  38401. }
  38402. return ret, nil
  38403. // {
  38404. // "description": "Retrieves a report by its ID.",
  38405. // "httpMethod": "GET",
  38406. // "id": "dfareporting.reports.get",
  38407. // "parameterOrder": [
  38408. // "profileId",
  38409. // "reportId"
  38410. // ],
  38411. // "parameters": {
  38412. // "profileId": {
  38413. // "description": "The DFA user profile ID.",
  38414. // "format": "int64",
  38415. // "location": "path",
  38416. // "required": true,
  38417. // "type": "string"
  38418. // },
  38419. // "reportId": {
  38420. // "description": "The ID of the report.",
  38421. // "format": "int64",
  38422. // "location": "path",
  38423. // "required": true,
  38424. // "type": "string"
  38425. // }
  38426. // },
  38427. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38428. // "response": {
  38429. // "$ref": "Report"
  38430. // },
  38431. // "scopes": [
  38432. // "https://www.googleapis.com/auth/dfareporting"
  38433. // ]
  38434. // }
  38435. }
  38436. // method id "dfareporting.reports.insert":
  38437. type ReportsInsertCall struct {
  38438. s *Service
  38439. profileId int64
  38440. report *Report
  38441. urlParams_ gensupport.URLParams
  38442. ctx_ context.Context
  38443. header_ http.Header
  38444. }
  38445. // Insert: Creates a report.
  38446. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  38447. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38448. c.profileId = profileId
  38449. c.report = report
  38450. return c
  38451. }
  38452. // Fields allows partial responses to be retrieved. See
  38453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38454. // for more information.
  38455. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  38456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38457. return c
  38458. }
  38459. // Context sets the context to be used in this call's Do method. Any
  38460. // pending HTTP request will be aborted if the provided context is
  38461. // canceled.
  38462. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  38463. c.ctx_ = ctx
  38464. return c
  38465. }
  38466. // Header returns an http.Header that can be modified by the caller to
  38467. // add HTTP headers to the request.
  38468. func (c *ReportsInsertCall) Header() http.Header {
  38469. if c.header_ == nil {
  38470. c.header_ = make(http.Header)
  38471. }
  38472. return c.header_
  38473. }
  38474. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  38475. reqHeaders := make(http.Header)
  38476. for k, v := range c.header_ {
  38477. reqHeaders[k] = v
  38478. }
  38479. reqHeaders.Set("User-Agent", c.s.userAgent())
  38480. var body io.Reader = nil
  38481. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  38482. if err != nil {
  38483. return nil, err
  38484. }
  38485. reqHeaders.Set("Content-Type", "application/json")
  38486. c.urlParams_.Set("alt", alt)
  38487. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  38488. urls += "?" + c.urlParams_.Encode()
  38489. req, _ := http.NewRequest("POST", urls, body)
  38490. req.Header = reqHeaders
  38491. googleapi.Expand(req.URL, map[string]string{
  38492. "profileId": strconv.FormatInt(c.profileId, 10),
  38493. })
  38494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38495. }
  38496. // Do executes the "dfareporting.reports.insert" call.
  38497. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38498. // code is an error. Response headers are in either
  38499. // *Report.ServerResponse.Header or (if a response was returned at all)
  38500. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38501. // check whether the returned error was because http.StatusNotModified
  38502. // was returned.
  38503. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38504. gensupport.SetOptions(c.urlParams_, opts...)
  38505. res, err := c.doRequest("json")
  38506. if res != nil && res.StatusCode == http.StatusNotModified {
  38507. if res.Body != nil {
  38508. res.Body.Close()
  38509. }
  38510. return nil, &googleapi.Error{
  38511. Code: res.StatusCode,
  38512. Header: res.Header,
  38513. }
  38514. }
  38515. if err != nil {
  38516. return nil, err
  38517. }
  38518. defer googleapi.CloseBody(res)
  38519. if err := googleapi.CheckResponse(res); err != nil {
  38520. return nil, err
  38521. }
  38522. ret := &Report{
  38523. ServerResponse: googleapi.ServerResponse{
  38524. Header: res.Header,
  38525. HTTPStatusCode: res.StatusCode,
  38526. },
  38527. }
  38528. target := &ret
  38529. if err := gensupport.DecodeResponse(target, res); err != nil {
  38530. return nil, err
  38531. }
  38532. return ret, nil
  38533. // {
  38534. // "description": "Creates a report.",
  38535. // "httpMethod": "POST",
  38536. // "id": "dfareporting.reports.insert",
  38537. // "parameterOrder": [
  38538. // "profileId"
  38539. // ],
  38540. // "parameters": {
  38541. // "profileId": {
  38542. // "description": "The DFA user profile ID.",
  38543. // "format": "int64",
  38544. // "location": "path",
  38545. // "required": true,
  38546. // "type": "string"
  38547. // }
  38548. // },
  38549. // "path": "userprofiles/{profileId}/reports",
  38550. // "request": {
  38551. // "$ref": "Report"
  38552. // },
  38553. // "response": {
  38554. // "$ref": "Report"
  38555. // },
  38556. // "scopes": [
  38557. // "https://www.googleapis.com/auth/dfareporting"
  38558. // ]
  38559. // }
  38560. }
  38561. // method id "dfareporting.reports.list":
  38562. type ReportsListCall struct {
  38563. s *Service
  38564. profileId int64
  38565. urlParams_ gensupport.URLParams
  38566. ifNoneMatch_ string
  38567. ctx_ context.Context
  38568. header_ http.Header
  38569. }
  38570. // List: Retrieves list of reports.
  38571. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  38572. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38573. c.profileId = profileId
  38574. return c
  38575. }
  38576. // MaxResults sets the optional parameter "maxResults": Maximum number
  38577. // of results to return.
  38578. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  38579. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38580. return c
  38581. }
  38582. // PageToken sets the optional parameter "pageToken": The value of the
  38583. // nextToken from the previous result page.
  38584. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  38585. c.urlParams_.Set("pageToken", pageToken)
  38586. return c
  38587. }
  38588. // Scope sets the optional parameter "scope": The scope that defines
  38589. // which results are returned.
  38590. //
  38591. // Possible values:
  38592. // "ALL" - All reports in account.
  38593. // "MINE" (default) - My reports.
  38594. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  38595. c.urlParams_.Set("scope", scope)
  38596. return c
  38597. }
  38598. // SortField sets the optional parameter "sortField": The field by which
  38599. // to sort the list.
  38600. //
  38601. // Possible values:
  38602. // "ID" - Sort by report ID.
  38603. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  38604. // "NAME" - Sort by name of reports.
  38605. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  38606. c.urlParams_.Set("sortField", sortField)
  38607. return c
  38608. }
  38609. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38610. // results.
  38611. //
  38612. // Possible values:
  38613. // "ASCENDING" - Ascending order.
  38614. // "DESCENDING" (default) - Descending order.
  38615. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  38616. c.urlParams_.Set("sortOrder", sortOrder)
  38617. return c
  38618. }
  38619. // Fields allows partial responses to be retrieved. See
  38620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38621. // for more information.
  38622. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  38623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38624. return c
  38625. }
  38626. // IfNoneMatch sets the optional parameter which makes the operation
  38627. // fail if the object's ETag matches the given value. This is useful for
  38628. // getting updates only after the object has changed since the last
  38629. // request. Use googleapi.IsNotModified to check whether the response
  38630. // error from Do is the result of In-None-Match.
  38631. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  38632. c.ifNoneMatch_ = entityTag
  38633. return c
  38634. }
  38635. // Context sets the context to be used in this call's Do method. Any
  38636. // pending HTTP request will be aborted if the provided context is
  38637. // canceled.
  38638. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  38639. c.ctx_ = ctx
  38640. return c
  38641. }
  38642. // Header returns an http.Header that can be modified by the caller to
  38643. // add HTTP headers to the request.
  38644. func (c *ReportsListCall) Header() http.Header {
  38645. if c.header_ == nil {
  38646. c.header_ = make(http.Header)
  38647. }
  38648. return c.header_
  38649. }
  38650. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  38651. reqHeaders := make(http.Header)
  38652. for k, v := range c.header_ {
  38653. reqHeaders[k] = v
  38654. }
  38655. reqHeaders.Set("User-Agent", c.s.userAgent())
  38656. if c.ifNoneMatch_ != "" {
  38657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38658. }
  38659. var body io.Reader = nil
  38660. c.urlParams_.Set("alt", alt)
  38661. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  38662. urls += "?" + c.urlParams_.Encode()
  38663. req, _ := http.NewRequest("GET", urls, body)
  38664. req.Header = reqHeaders
  38665. googleapi.Expand(req.URL, map[string]string{
  38666. "profileId": strconv.FormatInt(c.profileId, 10),
  38667. })
  38668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38669. }
  38670. // Do executes the "dfareporting.reports.list" call.
  38671. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  38672. // status code is an error. Response headers are in either
  38673. // *ReportList.ServerResponse.Header or (if a response was returned at
  38674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38675. // to check whether the returned error was because
  38676. // http.StatusNotModified was returned.
  38677. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  38678. gensupport.SetOptions(c.urlParams_, opts...)
  38679. res, err := c.doRequest("json")
  38680. if res != nil && res.StatusCode == http.StatusNotModified {
  38681. if res.Body != nil {
  38682. res.Body.Close()
  38683. }
  38684. return nil, &googleapi.Error{
  38685. Code: res.StatusCode,
  38686. Header: res.Header,
  38687. }
  38688. }
  38689. if err != nil {
  38690. return nil, err
  38691. }
  38692. defer googleapi.CloseBody(res)
  38693. if err := googleapi.CheckResponse(res); err != nil {
  38694. return nil, err
  38695. }
  38696. ret := &ReportList{
  38697. ServerResponse: googleapi.ServerResponse{
  38698. Header: res.Header,
  38699. HTTPStatusCode: res.StatusCode,
  38700. },
  38701. }
  38702. target := &ret
  38703. if err := gensupport.DecodeResponse(target, res); err != nil {
  38704. return nil, err
  38705. }
  38706. return ret, nil
  38707. // {
  38708. // "description": "Retrieves list of reports.",
  38709. // "httpMethod": "GET",
  38710. // "id": "dfareporting.reports.list",
  38711. // "parameterOrder": [
  38712. // "profileId"
  38713. // ],
  38714. // "parameters": {
  38715. // "maxResults": {
  38716. // "default": "10",
  38717. // "description": "Maximum number of results to return.",
  38718. // "format": "int32",
  38719. // "location": "query",
  38720. // "maximum": "10",
  38721. // "minimum": "0",
  38722. // "type": "integer"
  38723. // },
  38724. // "pageToken": {
  38725. // "description": "The value of the nextToken from the previous result page.",
  38726. // "location": "query",
  38727. // "type": "string"
  38728. // },
  38729. // "profileId": {
  38730. // "description": "The DFA user profile ID.",
  38731. // "format": "int64",
  38732. // "location": "path",
  38733. // "required": true,
  38734. // "type": "string"
  38735. // },
  38736. // "scope": {
  38737. // "default": "MINE",
  38738. // "description": "The scope that defines which results are returned.",
  38739. // "enum": [
  38740. // "ALL",
  38741. // "MINE"
  38742. // ],
  38743. // "enumDescriptions": [
  38744. // "All reports in account.",
  38745. // "My reports."
  38746. // ],
  38747. // "location": "query",
  38748. // "type": "string"
  38749. // },
  38750. // "sortField": {
  38751. // "default": "LAST_MODIFIED_TIME",
  38752. // "description": "The field by which to sort the list.",
  38753. // "enum": [
  38754. // "ID",
  38755. // "LAST_MODIFIED_TIME",
  38756. // "NAME"
  38757. // ],
  38758. // "enumDescriptions": [
  38759. // "Sort by report ID.",
  38760. // "Sort by 'lastModifiedTime' field.",
  38761. // "Sort by name of reports."
  38762. // ],
  38763. // "location": "query",
  38764. // "type": "string"
  38765. // },
  38766. // "sortOrder": {
  38767. // "default": "DESCENDING",
  38768. // "description": "Order of sorted results.",
  38769. // "enum": [
  38770. // "ASCENDING",
  38771. // "DESCENDING"
  38772. // ],
  38773. // "enumDescriptions": [
  38774. // "Ascending order.",
  38775. // "Descending order."
  38776. // ],
  38777. // "location": "query",
  38778. // "type": "string"
  38779. // }
  38780. // },
  38781. // "path": "userprofiles/{profileId}/reports",
  38782. // "response": {
  38783. // "$ref": "ReportList"
  38784. // },
  38785. // "scopes": [
  38786. // "https://www.googleapis.com/auth/dfareporting"
  38787. // ]
  38788. // }
  38789. }
  38790. // Pages invokes f for each page of results.
  38791. // A non-nil error returned from f will halt the iteration.
  38792. // The provided context supersedes any context provided to the Context method.
  38793. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  38794. c.ctx_ = ctx
  38795. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38796. for {
  38797. x, err := c.Do()
  38798. if err != nil {
  38799. return err
  38800. }
  38801. if err := f(x); err != nil {
  38802. return err
  38803. }
  38804. if x.NextPageToken == "" {
  38805. return nil
  38806. }
  38807. c.PageToken(x.NextPageToken)
  38808. }
  38809. }
  38810. // method id "dfareporting.reports.patch":
  38811. type ReportsPatchCall struct {
  38812. s *Service
  38813. profileId int64
  38814. reportId int64
  38815. report *Report
  38816. urlParams_ gensupport.URLParams
  38817. ctx_ context.Context
  38818. header_ http.Header
  38819. }
  38820. // Patch: Updates a report. This method supports patch semantics.
  38821. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  38822. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38823. c.profileId = profileId
  38824. c.reportId = reportId
  38825. c.report = report
  38826. return c
  38827. }
  38828. // Fields allows partial responses to be retrieved. See
  38829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38830. // for more information.
  38831. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  38832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38833. return c
  38834. }
  38835. // Context sets the context to be used in this call's Do method. Any
  38836. // pending HTTP request will be aborted if the provided context is
  38837. // canceled.
  38838. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  38839. c.ctx_ = ctx
  38840. return c
  38841. }
  38842. // Header returns an http.Header that can be modified by the caller to
  38843. // add HTTP headers to the request.
  38844. func (c *ReportsPatchCall) Header() http.Header {
  38845. if c.header_ == nil {
  38846. c.header_ = make(http.Header)
  38847. }
  38848. return c.header_
  38849. }
  38850. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  38851. reqHeaders := make(http.Header)
  38852. for k, v := range c.header_ {
  38853. reqHeaders[k] = v
  38854. }
  38855. reqHeaders.Set("User-Agent", c.s.userAgent())
  38856. var body io.Reader = nil
  38857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  38858. if err != nil {
  38859. return nil, err
  38860. }
  38861. reqHeaders.Set("Content-Type", "application/json")
  38862. c.urlParams_.Set("alt", alt)
  38863. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38864. urls += "?" + c.urlParams_.Encode()
  38865. req, _ := http.NewRequest("PATCH", urls, body)
  38866. req.Header = reqHeaders
  38867. googleapi.Expand(req.URL, map[string]string{
  38868. "profileId": strconv.FormatInt(c.profileId, 10),
  38869. "reportId": strconv.FormatInt(c.reportId, 10),
  38870. })
  38871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38872. }
  38873. // Do executes the "dfareporting.reports.patch" call.
  38874. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38875. // code is an error. Response headers are in either
  38876. // *Report.ServerResponse.Header or (if a response was returned at all)
  38877. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38878. // check whether the returned error was because http.StatusNotModified
  38879. // was returned.
  38880. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38881. gensupport.SetOptions(c.urlParams_, opts...)
  38882. res, err := c.doRequest("json")
  38883. if res != nil && res.StatusCode == http.StatusNotModified {
  38884. if res.Body != nil {
  38885. res.Body.Close()
  38886. }
  38887. return nil, &googleapi.Error{
  38888. Code: res.StatusCode,
  38889. Header: res.Header,
  38890. }
  38891. }
  38892. if err != nil {
  38893. return nil, err
  38894. }
  38895. defer googleapi.CloseBody(res)
  38896. if err := googleapi.CheckResponse(res); err != nil {
  38897. return nil, err
  38898. }
  38899. ret := &Report{
  38900. ServerResponse: googleapi.ServerResponse{
  38901. Header: res.Header,
  38902. HTTPStatusCode: res.StatusCode,
  38903. },
  38904. }
  38905. target := &ret
  38906. if err := gensupport.DecodeResponse(target, res); err != nil {
  38907. return nil, err
  38908. }
  38909. return ret, nil
  38910. // {
  38911. // "description": "Updates a report. This method supports patch semantics.",
  38912. // "httpMethod": "PATCH",
  38913. // "id": "dfareporting.reports.patch",
  38914. // "parameterOrder": [
  38915. // "profileId",
  38916. // "reportId"
  38917. // ],
  38918. // "parameters": {
  38919. // "profileId": {
  38920. // "description": "The DFA user profile ID.",
  38921. // "format": "int64",
  38922. // "location": "path",
  38923. // "required": true,
  38924. // "type": "string"
  38925. // },
  38926. // "reportId": {
  38927. // "description": "The ID of the report.",
  38928. // "format": "int64",
  38929. // "location": "path",
  38930. // "required": true,
  38931. // "type": "string"
  38932. // }
  38933. // },
  38934. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38935. // "request": {
  38936. // "$ref": "Report"
  38937. // },
  38938. // "response": {
  38939. // "$ref": "Report"
  38940. // },
  38941. // "scopes": [
  38942. // "https://www.googleapis.com/auth/dfareporting"
  38943. // ]
  38944. // }
  38945. }
  38946. // method id "dfareporting.reports.run":
  38947. type ReportsRunCall struct {
  38948. s *Service
  38949. profileId int64
  38950. reportId int64
  38951. urlParams_ gensupport.URLParams
  38952. ctx_ context.Context
  38953. header_ http.Header
  38954. }
  38955. // Run: Runs a report.
  38956. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  38957. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38958. c.profileId = profileId
  38959. c.reportId = reportId
  38960. return c
  38961. }
  38962. // Synchronous sets the optional parameter "synchronous": If set and
  38963. // true, tries to run the report synchronously.
  38964. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  38965. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  38966. return c
  38967. }
  38968. // Fields allows partial responses to be retrieved. See
  38969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38970. // for more information.
  38971. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  38972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38973. return c
  38974. }
  38975. // Context sets the context to be used in this call's Do method. Any
  38976. // pending HTTP request will be aborted if the provided context is
  38977. // canceled.
  38978. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  38979. c.ctx_ = ctx
  38980. return c
  38981. }
  38982. // Header returns an http.Header that can be modified by the caller to
  38983. // add HTTP headers to the request.
  38984. func (c *ReportsRunCall) Header() http.Header {
  38985. if c.header_ == nil {
  38986. c.header_ = make(http.Header)
  38987. }
  38988. return c.header_
  38989. }
  38990. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  38991. reqHeaders := make(http.Header)
  38992. for k, v := range c.header_ {
  38993. reqHeaders[k] = v
  38994. }
  38995. reqHeaders.Set("User-Agent", c.s.userAgent())
  38996. var body io.Reader = nil
  38997. c.urlParams_.Set("alt", alt)
  38998. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  38999. urls += "?" + c.urlParams_.Encode()
  39000. req, _ := http.NewRequest("POST", urls, body)
  39001. req.Header = reqHeaders
  39002. googleapi.Expand(req.URL, map[string]string{
  39003. "profileId": strconv.FormatInt(c.profileId, 10),
  39004. "reportId": strconv.FormatInt(c.reportId, 10),
  39005. })
  39006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39007. }
  39008. // Do executes the "dfareporting.reports.run" call.
  39009. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39010. // code is an error. Response headers are in either
  39011. // *File.ServerResponse.Header or (if a response was returned at all) in
  39012. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39013. // whether the returned error was because http.StatusNotModified was
  39014. // returned.
  39015. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39016. gensupport.SetOptions(c.urlParams_, opts...)
  39017. res, err := c.doRequest("json")
  39018. if res != nil && res.StatusCode == http.StatusNotModified {
  39019. if res.Body != nil {
  39020. res.Body.Close()
  39021. }
  39022. return nil, &googleapi.Error{
  39023. Code: res.StatusCode,
  39024. Header: res.Header,
  39025. }
  39026. }
  39027. if err != nil {
  39028. return nil, err
  39029. }
  39030. defer googleapi.CloseBody(res)
  39031. if err := googleapi.CheckResponse(res); err != nil {
  39032. return nil, err
  39033. }
  39034. ret := &File{
  39035. ServerResponse: googleapi.ServerResponse{
  39036. Header: res.Header,
  39037. HTTPStatusCode: res.StatusCode,
  39038. },
  39039. }
  39040. target := &ret
  39041. if err := gensupport.DecodeResponse(target, res); err != nil {
  39042. return nil, err
  39043. }
  39044. return ret, nil
  39045. // {
  39046. // "description": "Runs a report.",
  39047. // "httpMethod": "POST",
  39048. // "id": "dfareporting.reports.run",
  39049. // "parameterOrder": [
  39050. // "profileId",
  39051. // "reportId"
  39052. // ],
  39053. // "parameters": {
  39054. // "profileId": {
  39055. // "description": "The DFA profile ID.",
  39056. // "format": "int64",
  39057. // "location": "path",
  39058. // "required": true,
  39059. // "type": "string"
  39060. // },
  39061. // "reportId": {
  39062. // "description": "The ID of the report.",
  39063. // "format": "int64",
  39064. // "location": "path",
  39065. // "required": true,
  39066. // "type": "string"
  39067. // },
  39068. // "synchronous": {
  39069. // "default": "false",
  39070. // "description": "If set and true, tries to run the report synchronously.",
  39071. // "location": "query",
  39072. // "type": "boolean"
  39073. // }
  39074. // },
  39075. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  39076. // "response": {
  39077. // "$ref": "File"
  39078. // },
  39079. // "scopes": [
  39080. // "https://www.googleapis.com/auth/dfareporting"
  39081. // ]
  39082. // }
  39083. }
  39084. // method id "dfareporting.reports.update":
  39085. type ReportsUpdateCall struct {
  39086. s *Service
  39087. profileId int64
  39088. reportId int64
  39089. report *Report
  39090. urlParams_ gensupport.URLParams
  39091. ctx_ context.Context
  39092. header_ http.Header
  39093. }
  39094. // Update: Updates a report.
  39095. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  39096. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39097. c.profileId = profileId
  39098. c.reportId = reportId
  39099. c.report = report
  39100. return c
  39101. }
  39102. // Fields allows partial responses to be retrieved. See
  39103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39104. // for more information.
  39105. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  39106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39107. return c
  39108. }
  39109. // Context sets the context to be used in this call's Do method. Any
  39110. // pending HTTP request will be aborted if the provided context is
  39111. // canceled.
  39112. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  39113. c.ctx_ = ctx
  39114. return c
  39115. }
  39116. // Header returns an http.Header that can be modified by the caller to
  39117. // add HTTP headers to the request.
  39118. func (c *ReportsUpdateCall) Header() http.Header {
  39119. if c.header_ == nil {
  39120. c.header_ = make(http.Header)
  39121. }
  39122. return c.header_
  39123. }
  39124. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39125. reqHeaders := make(http.Header)
  39126. for k, v := range c.header_ {
  39127. reqHeaders[k] = v
  39128. }
  39129. reqHeaders.Set("User-Agent", c.s.userAgent())
  39130. var body io.Reader = nil
  39131. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39132. if err != nil {
  39133. return nil, err
  39134. }
  39135. reqHeaders.Set("Content-Type", "application/json")
  39136. c.urlParams_.Set("alt", alt)
  39137. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39138. urls += "?" + c.urlParams_.Encode()
  39139. req, _ := http.NewRequest("PUT", urls, body)
  39140. req.Header = reqHeaders
  39141. googleapi.Expand(req.URL, map[string]string{
  39142. "profileId": strconv.FormatInt(c.profileId, 10),
  39143. "reportId": strconv.FormatInt(c.reportId, 10),
  39144. })
  39145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39146. }
  39147. // Do executes the "dfareporting.reports.update" call.
  39148. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39149. // code is an error. Response headers are in either
  39150. // *Report.ServerResponse.Header or (if a response was returned at all)
  39151. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39152. // check whether the returned error was because http.StatusNotModified
  39153. // was returned.
  39154. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39155. gensupport.SetOptions(c.urlParams_, opts...)
  39156. res, err := c.doRequest("json")
  39157. if res != nil && res.StatusCode == http.StatusNotModified {
  39158. if res.Body != nil {
  39159. res.Body.Close()
  39160. }
  39161. return nil, &googleapi.Error{
  39162. Code: res.StatusCode,
  39163. Header: res.Header,
  39164. }
  39165. }
  39166. if err != nil {
  39167. return nil, err
  39168. }
  39169. defer googleapi.CloseBody(res)
  39170. if err := googleapi.CheckResponse(res); err != nil {
  39171. return nil, err
  39172. }
  39173. ret := &Report{
  39174. ServerResponse: googleapi.ServerResponse{
  39175. Header: res.Header,
  39176. HTTPStatusCode: res.StatusCode,
  39177. },
  39178. }
  39179. target := &ret
  39180. if err := gensupport.DecodeResponse(target, res); err != nil {
  39181. return nil, err
  39182. }
  39183. return ret, nil
  39184. // {
  39185. // "description": "Updates a report.",
  39186. // "httpMethod": "PUT",
  39187. // "id": "dfareporting.reports.update",
  39188. // "parameterOrder": [
  39189. // "profileId",
  39190. // "reportId"
  39191. // ],
  39192. // "parameters": {
  39193. // "profileId": {
  39194. // "description": "The DFA user profile ID.",
  39195. // "format": "int64",
  39196. // "location": "path",
  39197. // "required": true,
  39198. // "type": "string"
  39199. // },
  39200. // "reportId": {
  39201. // "description": "The ID of the report.",
  39202. // "format": "int64",
  39203. // "location": "path",
  39204. // "required": true,
  39205. // "type": "string"
  39206. // }
  39207. // },
  39208. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39209. // "request": {
  39210. // "$ref": "Report"
  39211. // },
  39212. // "response": {
  39213. // "$ref": "Report"
  39214. // },
  39215. // "scopes": [
  39216. // "https://www.googleapis.com/auth/dfareporting"
  39217. // ]
  39218. // }
  39219. }
  39220. // method id "dfareporting.reports.compatibleFields.query":
  39221. type ReportsCompatibleFieldsQueryCall struct {
  39222. s *Service
  39223. profileId int64
  39224. report *Report
  39225. urlParams_ gensupport.URLParams
  39226. ctx_ context.Context
  39227. header_ http.Header
  39228. }
  39229. // Query: Returns the fields that are compatible to be selected in the
  39230. // respective sections of a report criteria, given the fields already
  39231. // selected in the input report and user permissions.
  39232. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  39233. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39234. c.profileId = profileId
  39235. c.report = report
  39236. return c
  39237. }
  39238. // Fields allows partial responses to be retrieved. See
  39239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39240. // for more information.
  39241. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  39242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39243. return c
  39244. }
  39245. // Context sets the context to be used in this call's Do method. Any
  39246. // pending HTTP request will be aborted if the provided context is
  39247. // canceled.
  39248. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  39249. c.ctx_ = ctx
  39250. return c
  39251. }
  39252. // Header returns an http.Header that can be modified by the caller to
  39253. // add HTTP headers to the request.
  39254. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  39255. if c.header_ == nil {
  39256. c.header_ = make(http.Header)
  39257. }
  39258. return c.header_
  39259. }
  39260. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  39261. reqHeaders := make(http.Header)
  39262. for k, v := range c.header_ {
  39263. reqHeaders[k] = v
  39264. }
  39265. reqHeaders.Set("User-Agent", c.s.userAgent())
  39266. var body io.Reader = nil
  39267. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39268. if err != nil {
  39269. return nil, err
  39270. }
  39271. reqHeaders.Set("Content-Type", "application/json")
  39272. c.urlParams_.Set("alt", alt)
  39273. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  39274. urls += "?" + c.urlParams_.Encode()
  39275. req, _ := http.NewRequest("POST", urls, body)
  39276. req.Header = reqHeaders
  39277. googleapi.Expand(req.URL, map[string]string{
  39278. "profileId": strconv.FormatInt(c.profileId, 10),
  39279. })
  39280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39281. }
  39282. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  39283. // Exactly one of *CompatibleFields or error will be non-nil. Any
  39284. // non-2xx status code is an error. Response headers are in either
  39285. // *CompatibleFields.ServerResponse.Header or (if a response was
  39286. // returned at all) in error.(*googleapi.Error).Header. Use
  39287. // googleapi.IsNotModified to check whether the returned error was
  39288. // because http.StatusNotModified was returned.
  39289. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  39290. gensupport.SetOptions(c.urlParams_, opts...)
  39291. res, err := c.doRequest("json")
  39292. if res != nil && res.StatusCode == http.StatusNotModified {
  39293. if res.Body != nil {
  39294. res.Body.Close()
  39295. }
  39296. return nil, &googleapi.Error{
  39297. Code: res.StatusCode,
  39298. Header: res.Header,
  39299. }
  39300. }
  39301. if err != nil {
  39302. return nil, err
  39303. }
  39304. defer googleapi.CloseBody(res)
  39305. if err := googleapi.CheckResponse(res); err != nil {
  39306. return nil, err
  39307. }
  39308. ret := &CompatibleFields{
  39309. ServerResponse: googleapi.ServerResponse{
  39310. Header: res.Header,
  39311. HTTPStatusCode: res.StatusCode,
  39312. },
  39313. }
  39314. target := &ret
  39315. if err := gensupport.DecodeResponse(target, res); err != nil {
  39316. return nil, err
  39317. }
  39318. return ret, nil
  39319. // {
  39320. // "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.",
  39321. // "httpMethod": "POST",
  39322. // "id": "dfareporting.reports.compatibleFields.query",
  39323. // "parameterOrder": [
  39324. // "profileId"
  39325. // ],
  39326. // "parameters": {
  39327. // "profileId": {
  39328. // "description": "The DFA user profile ID.",
  39329. // "format": "int64",
  39330. // "location": "path",
  39331. // "required": true,
  39332. // "type": "string"
  39333. // }
  39334. // },
  39335. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  39336. // "request": {
  39337. // "$ref": "Report"
  39338. // },
  39339. // "response": {
  39340. // "$ref": "CompatibleFields"
  39341. // },
  39342. // "scopes": [
  39343. // "https://www.googleapis.com/auth/dfareporting"
  39344. // ]
  39345. // }
  39346. }
  39347. // method id "dfareporting.reports.files.get":
  39348. type ReportsFilesGetCall struct {
  39349. s *Service
  39350. profileId int64
  39351. reportId int64
  39352. fileId int64
  39353. urlParams_ gensupport.URLParams
  39354. ifNoneMatch_ string
  39355. ctx_ context.Context
  39356. header_ http.Header
  39357. }
  39358. // Get: Retrieves a report file. This method supports media download.
  39359. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  39360. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39361. c.profileId = profileId
  39362. c.reportId = reportId
  39363. c.fileId = fileId
  39364. return c
  39365. }
  39366. // Fields allows partial responses to be retrieved. See
  39367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39368. // for more information.
  39369. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  39370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39371. return c
  39372. }
  39373. // IfNoneMatch sets the optional parameter which makes the operation
  39374. // fail if the object's ETag matches the given value. This is useful for
  39375. // getting updates only after the object has changed since the last
  39376. // request. Use googleapi.IsNotModified to check whether the response
  39377. // error from Do is the result of In-None-Match.
  39378. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  39379. c.ifNoneMatch_ = entityTag
  39380. return c
  39381. }
  39382. // Context sets the context to be used in this call's Do and Download
  39383. // methods. Any pending HTTP request will be aborted if the provided
  39384. // context is canceled.
  39385. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  39386. c.ctx_ = ctx
  39387. return c
  39388. }
  39389. // Header returns an http.Header that can be modified by the caller to
  39390. // add HTTP headers to the request.
  39391. func (c *ReportsFilesGetCall) Header() http.Header {
  39392. if c.header_ == nil {
  39393. c.header_ = make(http.Header)
  39394. }
  39395. return c.header_
  39396. }
  39397. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  39398. reqHeaders := make(http.Header)
  39399. for k, v := range c.header_ {
  39400. reqHeaders[k] = v
  39401. }
  39402. reqHeaders.Set("User-Agent", c.s.userAgent())
  39403. if c.ifNoneMatch_ != "" {
  39404. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39405. }
  39406. var body io.Reader = nil
  39407. c.urlParams_.Set("alt", alt)
  39408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  39409. urls += "?" + c.urlParams_.Encode()
  39410. req, _ := http.NewRequest("GET", urls, body)
  39411. req.Header = reqHeaders
  39412. googleapi.Expand(req.URL, map[string]string{
  39413. "profileId": strconv.FormatInt(c.profileId, 10),
  39414. "reportId": strconv.FormatInt(c.reportId, 10),
  39415. "fileId": strconv.FormatInt(c.fileId, 10),
  39416. })
  39417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39418. }
  39419. // Download fetches the API endpoint's "media" value, instead of the normal
  39420. // API response value. If the returned error is nil, the Response is guaranteed to
  39421. // have a 2xx status code. Callers must close the Response.Body as usual.
  39422. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  39423. gensupport.SetOptions(c.urlParams_, opts...)
  39424. res, err := c.doRequest("media")
  39425. if err != nil {
  39426. return nil, err
  39427. }
  39428. if err := googleapi.CheckMediaResponse(res); err != nil {
  39429. res.Body.Close()
  39430. return nil, err
  39431. }
  39432. return res, nil
  39433. }
  39434. // Do executes the "dfareporting.reports.files.get" call.
  39435. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39436. // code is an error. Response headers are in either
  39437. // *File.ServerResponse.Header or (if a response was returned at all) in
  39438. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39439. // whether the returned error was because http.StatusNotModified was
  39440. // returned.
  39441. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39442. gensupport.SetOptions(c.urlParams_, opts...)
  39443. res, err := c.doRequest("json")
  39444. if res != nil && res.StatusCode == http.StatusNotModified {
  39445. if res.Body != nil {
  39446. res.Body.Close()
  39447. }
  39448. return nil, &googleapi.Error{
  39449. Code: res.StatusCode,
  39450. Header: res.Header,
  39451. }
  39452. }
  39453. if err != nil {
  39454. return nil, err
  39455. }
  39456. defer googleapi.CloseBody(res)
  39457. if err := googleapi.CheckResponse(res); err != nil {
  39458. return nil, err
  39459. }
  39460. ret := &File{
  39461. ServerResponse: googleapi.ServerResponse{
  39462. Header: res.Header,
  39463. HTTPStatusCode: res.StatusCode,
  39464. },
  39465. }
  39466. target := &ret
  39467. if err := gensupport.DecodeResponse(target, res); err != nil {
  39468. return nil, err
  39469. }
  39470. return ret, nil
  39471. // {
  39472. // "description": "Retrieves a report file. This method supports media download.",
  39473. // "httpMethod": "GET",
  39474. // "id": "dfareporting.reports.files.get",
  39475. // "parameterOrder": [
  39476. // "profileId",
  39477. // "reportId",
  39478. // "fileId"
  39479. // ],
  39480. // "parameters": {
  39481. // "fileId": {
  39482. // "description": "The ID of the report file.",
  39483. // "format": "int64",
  39484. // "location": "path",
  39485. // "required": true,
  39486. // "type": "string"
  39487. // },
  39488. // "profileId": {
  39489. // "description": "The DFA profile ID.",
  39490. // "format": "int64",
  39491. // "location": "path",
  39492. // "required": true,
  39493. // "type": "string"
  39494. // },
  39495. // "reportId": {
  39496. // "description": "The ID of the report.",
  39497. // "format": "int64",
  39498. // "location": "path",
  39499. // "required": true,
  39500. // "type": "string"
  39501. // }
  39502. // },
  39503. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  39504. // "response": {
  39505. // "$ref": "File"
  39506. // },
  39507. // "scopes": [
  39508. // "https://www.googleapis.com/auth/dfareporting"
  39509. // ],
  39510. // "supportsMediaDownload": true
  39511. // }
  39512. }
  39513. // method id "dfareporting.reports.files.list":
  39514. type ReportsFilesListCall struct {
  39515. s *Service
  39516. profileId int64
  39517. reportId int64
  39518. urlParams_ gensupport.URLParams
  39519. ifNoneMatch_ string
  39520. ctx_ context.Context
  39521. header_ http.Header
  39522. }
  39523. // List: Lists files for a report.
  39524. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  39525. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39526. c.profileId = profileId
  39527. c.reportId = reportId
  39528. return c
  39529. }
  39530. // MaxResults sets the optional parameter "maxResults": Maximum number
  39531. // of results to return.
  39532. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  39533. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39534. return c
  39535. }
  39536. // PageToken sets the optional parameter "pageToken": The value of the
  39537. // nextToken from the previous result page.
  39538. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  39539. c.urlParams_.Set("pageToken", pageToken)
  39540. return c
  39541. }
  39542. // SortField sets the optional parameter "sortField": The field by which
  39543. // to sort the list.
  39544. //
  39545. // Possible values:
  39546. // "ID" - Sort by file ID.
  39547. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  39548. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  39549. c.urlParams_.Set("sortField", sortField)
  39550. return c
  39551. }
  39552. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39553. // results.
  39554. //
  39555. // Possible values:
  39556. // "ASCENDING" - Ascending order.
  39557. // "DESCENDING" (default) - Descending order.
  39558. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  39559. c.urlParams_.Set("sortOrder", sortOrder)
  39560. return c
  39561. }
  39562. // Fields allows partial responses to be retrieved. See
  39563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39564. // for more information.
  39565. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  39566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39567. return c
  39568. }
  39569. // IfNoneMatch sets the optional parameter which makes the operation
  39570. // fail if the object's ETag matches the given value. This is useful for
  39571. // getting updates only after the object has changed since the last
  39572. // request. Use googleapi.IsNotModified to check whether the response
  39573. // error from Do is the result of In-None-Match.
  39574. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  39575. c.ifNoneMatch_ = entityTag
  39576. return c
  39577. }
  39578. // Context sets the context to be used in this call's Do method. Any
  39579. // pending HTTP request will be aborted if the provided context is
  39580. // canceled.
  39581. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  39582. c.ctx_ = ctx
  39583. return c
  39584. }
  39585. // Header returns an http.Header that can be modified by the caller to
  39586. // add HTTP headers to the request.
  39587. func (c *ReportsFilesListCall) Header() http.Header {
  39588. if c.header_ == nil {
  39589. c.header_ = make(http.Header)
  39590. }
  39591. return c.header_
  39592. }
  39593. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  39594. reqHeaders := make(http.Header)
  39595. for k, v := range c.header_ {
  39596. reqHeaders[k] = v
  39597. }
  39598. reqHeaders.Set("User-Agent", c.s.userAgent())
  39599. if c.ifNoneMatch_ != "" {
  39600. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39601. }
  39602. var body io.Reader = nil
  39603. c.urlParams_.Set("alt", alt)
  39604. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  39605. urls += "?" + c.urlParams_.Encode()
  39606. req, _ := http.NewRequest("GET", urls, body)
  39607. req.Header = reqHeaders
  39608. googleapi.Expand(req.URL, map[string]string{
  39609. "profileId": strconv.FormatInt(c.profileId, 10),
  39610. "reportId": strconv.FormatInt(c.reportId, 10),
  39611. })
  39612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39613. }
  39614. // Do executes the "dfareporting.reports.files.list" call.
  39615. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  39616. // code is an error. Response headers are in either
  39617. // *FileList.ServerResponse.Header or (if a response was returned at
  39618. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39619. // to check whether the returned error was because
  39620. // http.StatusNotModified was returned.
  39621. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  39622. gensupport.SetOptions(c.urlParams_, opts...)
  39623. res, err := c.doRequest("json")
  39624. if res != nil && res.StatusCode == http.StatusNotModified {
  39625. if res.Body != nil {
  39626. res.Body.Close()
  39627. }
  39628. return nil, &googleapi.Error{
  39629. Code: res.StatusCode,
  39630. Header: res.Header,
  39631. }
  39632. }
  39633. if err != nil {
  39634. return nil, err
  39635. }
  39636. defer googleapi.CloseBody(res)
  39637. if err := googleapi.CheckResponse(res); err != nil {
  39638. return nil, err
  39639. }
  39640. ret := &FileList{
  39641. ServerResponse: googleapi.ServerResponse{
  39642. Header: res.Header,
  39643. HTTPStatusCode: res.StatusCode,
  39644. },
  39645. }
  39646. target := &ret
  39647. if err := gensupport.DecodeResponse(target, res); err != nil {
  39648. return nil, err
  39649. }
  39650. return ret, nil
  39651. // {
  39652. // "description": "Lists files for a report.",
  39653. // "httpMethod": "GET",
  39654. // "id": "dfareporting.reports.files.list",
  39655. // "parameterOrder": [
  39656. // "profileId",
  39657. // "reportId"
  39658. // ],
  39659. // "parameters": {
  39660. // "maxResults": {
  39661. // "default": "10",
  39662. // "description": "Maximum number of results to return.",
  39663. // "format": "int32",
  39664. // "location": "query",
  39665. // "maximum": "10",
  39666. // "minimum": "0",
  39667. // "type": "integer"
  39668. // },
  39669. // "pageToken": {
  39670. // "description": "The value of the nextToken from the previous result page.",
  39671. // "location": "query",
  39672. // "type": "string"
  39673. // },
  39674. // "profileId": {
  39675. // "description": "The DFA profile ID.",
  39676. // "format": "int64",
  39677. // "location": "path",
  39678. // "required": true,
  39679. // "type": "string"
  39680. // },
  39681. // "reportId": {
  39682. // "description": "The ID of the parent report.",
  39683. // "format": "int64",
  39684. // "location": "path",
  39685. // "required": true,
  39686. // "type": "string"
  39687. // },
  39688. // "sortField": {
  39689. // "default": "LAST_MODIFIED_TIME",
  39690. // "description": "The field by which to sort the list.",
  39691. // "enum": [
  39692. // "ID",
  39693. // "LAST_MODIFIED_TIME"
  39694. // ],
  39695. // "enumDescriptions": [
  39696. // "Sort by file ID.",
  39697. // "Sort by 'lastmodifiedAt' field."
  39698. // ],
  39699. // "location": "query",
  39700. // "type": "string"
  39701. // },
  39702. // "sortOrder": {
  39703. // "default": "DESCENDING",
  39704. // "description": "Order of sorted results.",
  39705. // "enum": [
  39706. // "ASCENDING",
  39707. // "DESCENDING"
  39708. // ],
  39709. // "enumDescriptions": [
  39710. // "Ascending order.",
  39711. // "Descending order."
  39712. // ],
  39713. // "location": "query",
  39714. // "type": "string"
  39715. // }
  39716. // },
  39717. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  39718. // "response": {
  39719. // "$ref": "FileList"
  39720. // },
  39721. // "scopes": [
  39722. // "https://www.googleapis.com/auth/dfareporting"
  39723. // ]
  39724. // }
  39725. }
  39726. // Pages invokes f for each page of results.
  39727. // A non-nil error returned from f will halt the iteration.
  39728. // The provided context supersedes any context provided to the Context method.
  39729. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  39730. c.ctx_ = ctx
  39731. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39732. for {
  39733. x, err := c.Do()
  39734. if err != nil {
  39735. return err
  39736. }
  39737. if err := f(x); err != nil {
  39738. return err
  39739. }
  39740. if x.NextPageToken == "" {
  39741. return nil
  39742. }
  39743. c.PageToken(x.NextPageToken)
  39744. }
  39745. }
  39746. // method id "dfareporting.sites.get":
  39747. type SitesGetCall struct {
  39748. s *Service
  39749. profileId int64
  39750. id int64
  39751. urlParams_ gensupport.URLParams
  39752. ifNoneMatch_ string
  39753. ctx_ context.Context
  39754. header_ http.Header
  39755. }
  39756. // Get: Gets one site by ID.
  39757. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  39758. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39759. c.profileId = profileId
  39760. c.id = id
  39761. return c
  39762. }
  39763. // Fields allows partial responses to be retrieved. See
  39764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39765. // for more information.
  39766. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  39767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39768. return c
  39769. }
  39770. // IfNoneMatch sets the optional parameter which makes the operation
  39771. // fail if the object's ETag matches the given value. This is useful for
  39772. // getting updates only after the object has changed since the last
  39773. // request. Use googleapi.IsNotModified to check whether the response
  39774. // error from Do is the result of In-None-Match.
  39775. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  39776. c.ifNoneMatch_ = entityTag
  39777. return c
  39778. }
  39779. // Context sets the context to be used in this call's Do method. Any
  39780. // pending HTTP request will be aborted if the provided context is
  39781. // canceled.
  39782. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  39783. c.ctx_ = ctx
  39784. return c
  39785. }
  39786. // Header returns an http.Header that can be modified by the caller to
  39787. // add HTTP headers to the request.
  39788. func (c *SitesGetCall) Header() http.Header {
  39789. if c.header_ == nil {
  39790. c.header_ = make(http.Header)
  39791. }
  39792. return c.header_
  39793. }
  39794. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  39795. reqHeaders := make(http.Header)
  39796. for k, v := range c.header_ {
  39797. reqHeaders[k] = v
  39798. }
  39799. reqHeaders.Set("User-Agent", c.s.userAgent())
  39800. if c.ifNoneMatch_ != "" {
  39801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39802. }
  39803. var body io.Reader = nil
  39804. c.urlParams_.Set("alt", alt)
  39805. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  39806. urls += "?" + c.urlParams_.Encode()
  39807. req, _ := http.NewRequest("GET", urls, body)
  39808. req.Header = reqHeaders
  39809. googleapi.Expand(req.URL, map[string]string{
  39810. "profileId": strconv.FormatInt(c.profileId, 10),
  39811. "id": strconv.FormatInt(c.id, 10),
  39812. })
  39813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39814. }
  39815. // Do executes the "dfareporting.sites.get" call.
  39816. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  39817. // code is an error. Response headers are in either
  39818. // *Site.ServerResponse.Header or (if a response was returned at all) in
  39819. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39820. // whether the returned error was because http.StatusNotModified was
  39821. // returned.
  39822. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  39823. gensupport.SetOptions(c.urlParams_, opts...)
  39824. res, err := c.doRequest("json")
  39825. if res != nil && res.StatusCode == http.StatusNotModified {
  39826. if res.Body != nil {
  39827. res.Body.Close()
  39828. }
  39829. return nil, &googleapi.Error{
  39830. Code: res.StatusCode,
  39831. Header: res.Header,
  39832. }
  39833. }
  39834. if err != nil {
  39835. return nil, err
  39836. }
  39837. defer googleapi.CloseBody(res)
  39838. if err := googleapi.CheckResponse(res); err != nil {
  39839. return nil, err
  39840. }
  39841. ret := &Site{
  39842. ServerResponse: googleapi.ServerResponse{
  39843. Header: res.Header,
  39844. HTTPStatusCode: res.StatusCode,
  39845. },
  39846. }
  39847. target := &ret
  39848. if err := gensupport.DecodeResponse(target, res); err != nil {
  39849. return nil, err
  39850. }
  39851. return ret, nil
  39852. // {
  39853. // "description": "Gets one site by ID.",
  39854. // "httpMethod": "GET",
  39855. // "id": "dfareporting.sites.get",
  39856. // "parameterOrder": [
  39857. // "profileId",
  39858. // "id"
  39859. // ],
  39860. // "parameters": {
  39861. // "id": {
  39862. // "description": "Site ID.",
  39863. // "format": "int64",
  39864. // "location": "path",
  39865. // "required": true,
  39866. // "type": "string"
  39867. // },
  39868. // "profileId": {
  39869. // "description": "User profile ID associated with this request.",
  39870. // "format": "int64",
  39871. // "location": "path",
  39872. // "required": true,
  39873. // "type": "string"
  39874. // }
  39875. // },
  39876. // "path": "userprofiles/{profileId}/sites/{id}",
  39877. // "response": {
  39878. // "$ref": "Site"
  39879. // },
  39880. // "scopes": [
  39881. // "https://www.googleapis.com/auth/dfatrafficking"
  39882. // ]
  39883. // }
  39884. }
  39885. // method id "dfareporting.sites.insert":
  39886. type SitesInsertCall struct {
  39887. s *Service
  39888. profileId int64
  39889. site *Site
  39890. urlParams_ gensupport.URLParams
  39891. ctx_ context.Context
  39892. header_ http.Header
  39893. }
  39894. // Insert: Inserts a new site.
  39895. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  39896. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39897. c.profileId = profileId
  39898. c.site = site
  39899. return c
  39900. }
  39901. // Fields allows partial responses to be retrieved. See
  39902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39903. // for more information.
  39904. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  39905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39906. return c
  39907. }
  39908. // Context sets the context to be used in this call's Do method. Any
  39909. // pending HTTP request will be aborted if the provided context is
  39910. // canceled.
  39911. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  39912. c.ctx_ = ctx
  39913. return c
  39914. }
  39915. // Header returns an http.Header that can be modified by the caller to
  39916. // add HTTP headers to the request.
  39917. func (c *SitesInsertCall) Header() http.Header {
  39918. if c.header_ == nil {
  39919. c.header_ = make(http.Header)
  39920. }
  39921. return c.header_
  39922. }
  39923. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  39924. reqHeaders := make(http.Header)
  39925. for k, v := range c.header_ {
  39926. reqHeaders[k] = v
  39927. }
  39928. reqHeaders.Set("User-Agent", c.s.userAgent())
  39929. var body io.Reader = nil
  39930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  39931. if err != nil {
  39932. return nil, err
  39933. }
  39934. reqHeaders.Set("Content-Type", "application/json")
  39935. c.urlParams_.Set("alt", alt)
  39936. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  39937. urls += "?" + c.urlParams_.Encode()
  39938. req, _ := http.NewRequest("POST", urls, body)
  39939. req.Header = reqHeaders
  39940. googleapi.Expand(req.URL, map[string]string{
  39941. "profileId": strconv.FormatInt(c.profileId, 10),
  39942. })
  39943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39944. }
  39945. // Do executes the "dfareporting.sites.insert" call.
  39946. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  39947. // code is an error. Response headers are in either
  39948. // *Site.ServerResponse.Header or (if a response was returned at all) in
  39949. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39950. // whether the returned error was because http.StatusNotModified was
  39951. // returned.
  39952. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  39953. gensupport.SetOptions(c.urlParams_, opts...)
  39954. res, err := c.doRequest("json")
  39955. if res != nil && res.StatusCode == http.StatusNotModified {
  39956. if res.Body != nil {
  39957. res.Body.Close()
  39958. }
  39959. return nil, &googleapi.Error{
  39960. Code: res.StatusCode,
  39961. Header: res.Header,
  39962. }
  39963. }
  39964. if err != nil {
  39965. return nil, err
  39966. }
  39967. defer googleapi.CloseBody(res)
  39968. if err := googleapi.CheckResponse(res); err != nil {
  39969. return nil, err
  39970. }
  39971. ret := &Site{
  39972. ServerResponse: googleapi.ServerResponse{
  39973. Header: res.Header,
  39974. HTTPStatusCode: res.StatusCode,
  39975. },
  39976. }
  39977. target := &ret
  39978. if err := gensupport.DecodeResponse(target, res); err != nil {
  39979. return nil, err
  39980. }
  39981. return ret, nil
  39982. // {
  39983. // "description": "Inserts a new site.",
  39984. // "httpMethod": "POST",
  39985. // "id": "dfareporting.sites.insert",
  39986. // "parameterOrder": [
  39987. // "profileId"
  39988. // ],
  39989. // "parameters": {
  39990. // "profileId": {
  39991. // "description": "User profile ID associated with this request.",
  39992. // "format": "int64",
  39993. // "location": "path",
  39994. // "required": true,
  39995. // "type": "string"
  39996. // }
  39997. // },
  39998. // "path": "userprofiles/{profileId}/sites",
  39999. // "request": {
  40000. // "$ref": "Site"
  40001. // },
  40002. // "response": {
  40003. // "$ref": "Site"
  40004. // },
  40005. // "scopes": [
  40006. // "https://www.googleapis.com/auth/dfatrafficking"
  40007. // ]
  40008. // }
  40009. }
  40010. // method id "dfareporting.sites.list":
  40011. type SitesListCall struct {
  40012. s *Service
  40013. profileId int64
  40014. urlParams_ gensupport.URLParams
  40015. ifNoneMatch_ string
  40016. ctx_ context.Context
  40017. header_ http.Header
  40018. }
  40019. // List: Retrieves a list of sites, possibly filtered. This method
  40020. // supports paging.
  40021. func (r *SitesService) List(profileId int64) *SitesListCall {
  40022. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40023. c.profileId = profileId
  40024. return c
  40025. }
  40026. // AcceptsInStreamVideoPlacements sets the optional parameter
  40027. // "acceptsInStreamVideoPlacements": This search filter is no longer
  40028. // supported and will have no effect on the results returned.
  40029. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  40030. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  40031. return c
  40032. }
  40033. // AcceptsInterstitialPlacements sets the optional parameter
  40034. // "acceptsInterstitialPlacements": This search filter is no longer
  40035. // supported and will have no effect on the results returned.
  40036. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  40037. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  40038. return c
  40039. }
  40040. // AcceptsPublisherPaidPlacements sets the optional parameter
  40041. // "acceptsPublisherPaidPlacements": Select only sites that accept
  40042. // publisher paid placements.
  40043. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  40044. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  40045. return c
  40046. }
  40047. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  40048. // AdWords sites.
  40049. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  40050. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  40051. return c
  40052. }
  40053. // Approved sets the optional parameter "approved": Select only approved
  40054. // sites.
  40055. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  40056. c.urlParams_.Set("approved", fmt.Sprint(approved))
  40057. return c
  40058. }
  40059. // CampaignIds sets the optional parameter "campaignIds": Select only
  40060. // sites with these campaign IDs.
  40061. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  40062. var campaignIds_ []string
  40063. for _, v := range campaignIds {
  40064. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  40065. }
  40066. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  40067. return c
  40068. }
  40069. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  40070. // Select only sites with these directory site IDs.
  40071. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  40072. var directorySiteIds_ []string
  40073. for _, v := range directorySiteIds {
  40074. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  40075. }
  40076. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  40077. return c
  40078. }
  40079. // Ids sets the optional parameter "ids": Select only sites with these
  40080. // IDs.
  40081. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  40082. var ids_ []string
  40083. for _, v := range ids {
  40084. ids_ = append(ids_, fmt.Sprint(v))
  40085. }
  40086. c.urlParams_.SetMulti("ids", ids_)
  40087. return c
  40088. }
  40089. // MaxResults sets the optional parameter "maxResults": Maximum number
  40090. // of results to return.
  40091. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  40092. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40093. return c
  40094. }
  40095. // PageToken sets the optional parameter "pageToken": Value of the
  40096. // nextPageToken from the previous result page.
  40097. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  40098. c.urlParams_.Set("pageToken", pageToken)
  40099. return c
  40100. }
  40101. // SearchString sets the optional parameter "searchString": Allows
  40102. // searching for objects by name, ID or keyName. Wildcards (*) are
  40103. // allowed. For example, "site*2015" will return objects with names like
  40104. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  40105. // the searches also add wildcards implicitly at the start and the end
  40106. // of the search string. For example, a search string of "site" will
  40107. // match objects with name "my site", "site 2015", or simply "site".
  40108. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  40109. c.urlParams_.Set("searchString", searchString)
  40110. return c
  40111. }
  40112. // SortField sets the optional parameter "sortField": Field by which to
  40113. // sort the list.
  40114. //
  40115. // Possible values:
  40116. // "ID" (default)
  40117. // "NAME"
  40118. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  40119. c.urlParams_.Set("sortField", sortField)
  40120. return c
  40121. }
  40122. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40123. // results.
  40124. //
  40125. // Possible values:
  40126. // "ASCENDING" (default)
  40127. // "DESCENDING"
  40128. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  40129. c.urlParams_.Set("sortOrder", sortOrder)
  40130. return c
  40131. }
  40132. // SubaccountId sets the optional parameter "subaccountId": Select only
  40133. // sites with this subaccount ID.
  40134. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  40135. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  40136. return c
  40137. }
  40138. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  40139. // sites that have not been mapped to a directory site.
  40140. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  40141. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  40142. return c
  40143. }
  40144. // Fields allows partial responses to be retrieved. See
  40145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40146. // for more information.
  40147. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  40148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40149. return c
  40150. }
  40151. // IfNoneMatch sets the optional parameter which makes the operation
  40152. // fail if the object's ETag matches the given value. This is useful for
  40153. // getting updates only after the object has changed since the last
  40154. // request. Use googleapi.IsNotModified to check whether the response
  40155. // error from Do is the result of In-None-Match.
  40156. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  40157. c.ifNoneMatch_ = entityTag
  40158. return c
  40159. }
  40160. // Context sets the context to be used in this call's Do method. Any
  40161. // pending HTTP request will be aborted if the provided context is
  40162. // canceled.
  40163. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  40164. c.ctx_ = ctx
  40165. return c
  40166. }
  40167. // Header returns an http.Header that can be modified by the caller to
  40168. // add HTTP headers to the request.
  40169. func (c *SitesListCall) Header() http.Header {
  40170. if c.header_ == nil {
  40171. c.header_ = make(http.Header)
  40172. }
  40173. return c.header_
  40174. }
  40175. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  40176. reqHeaders := make(http.Header)
  40177. for k, v := range c.header_ {
  40178. reqHeaders[k] = v
  40179. }
  40180. reqHeaders.Set("User-Agent", c.s.userAgent())
  40181. if c.ifNoneMatch_ != "" {
  40182. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40183. }
  40184. var body io.Reader = nil
  40185. c.urlParams_.Set("alt", alt)
  40186. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40187. urls += "?" + c.urlParams_.Encode()
  40188. req, _ := http.NewRequest("GET", urls, body)
  40189. req.Header = reqHeaders
  40190. googleapi.Expand(req.URL, map[string]string{
  40191. "profileId": strconv.FormatInt(c.profileId, 10),
  40192. })
  40193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40194. }
  40195. // Do executes the "dfareporting.sites.list" call.
  40196. // Exactly one of *SitesListResponse or error will be non-nil. Any
  40197. // non-2xx status code is an error. Response headers are in either
  40198. // *SitesListResponse.ServerResponse.Header or (if a response was
  40199. // returned at all) in error.(*googleapi.Error).Header. Use
  40200. // googleapi.IsNotModified to check whether the returned error was
  40201. // because http.StatusNotModified was returned.
  40202. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  40203. gensupport.SetOptions(c.urlParams_, opts...)
  40204. res, err := c.doRequest("json")
  40205. if res != nil && res.StatusCode == http.StatusNotModified {
  40206. if res.Body != nil {
  40207. res.Body.Close()
  40208. }
  40209. return nil, &googleapi.Error{
  40210. Code: res.StatusCode,
  40211. Header: res.Header,
  40212. }
  40213. }
  40214. if err != nil {
  40215. return nil, err
  40216. }
  40217. defer googleapi.CloseBody(res)
  40218. if err := googleapi.CheckResponse(res); err != nil {
  40219. return nil, err
  40220. }
  40221. ret := &SitesListResponse{
  40222. ServerResponse: googleapi.ServerResponse{
  40223. Header: res.Header,
  40224. HTTPStatusCode: res.StatusCode,
  40225. },
  40226. }
  40227. target := &ret
  40228. if err := gensupport.DecodeResponse(target, res); err != nil {
  40229. return nil, err
  40230. }
  40231. return ret, nil
  40232. // {
  40233. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  40234. // "httpMethod": "GET",
  40235. // "id": "dfareporting.sites.list",
  40236. // "parameterOrder": [
  40237. // "profileId"
  40238. // ],
  40239. // "parameters": {
  40240. // "acceptsInStreamVideoPlacements": {
  40241. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  40242. // "location": "query",
  40243. // "type": "boolean"
  40244. // },
  40245. // "acceptsInterstitialPlacements": {
  40246. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  40247. // "location": "query",
  40248. // "type": "boolean"
  40249. // },
  40250. // "acceptsPublisherPaidPlacements": {
  40251. // "description": "Select only sites that accept publisher paid placements.",
  40252. // "location": "query",
  40253. // "type": "boolean"
  40254. // },
  40255. // "adWordsSite": {
  40256. // "description": "Select only AdWords sites.",
  40257. // "location": "query",
  40258. // "type": "boolean"
  40259. // },
  40260. // "approved": {
  40261. // "description": "Select only approved sites.",
  40262. // "location": "query",
  40263. // "type": "boolean"
  40264. // },
  40265. // "campaignIds": {
  40266. // "description": "Select only sites with these campaign IDs.",
  40267. // "format": "int64",
  40268. // "location": "query",
  40269. // "repeated": true,
  40270. // "type": "string"
  40271. // },
  40272. // "directorySiteIds": {
  40273. // "description": "Select only sites with these directory site IDs.",
  40274. // "format": "int64",
  40275. // "location": "query",
  40276. // "repeated": true,
  40277. // "type": "string"
  40278. // },
  40279. // "ids": {
  40280. // "description": "Select only sites with these IDs.",
  40281. // "format": "int64",
  40282. // "location": "query",
  40283. // "repeated": true,
  40284. // "type": "string"
  40285. // },
  40286. // "maxResults": {
  40287. // "default": "1000",
  40288. // "description": "Maximum number of results to return.",
  40289. // "format": "int32",
  40290. // "location": "query",
  40291. // "maximum": "1000",
  40292. // "minimum": "0",
  40293. // "type": "integer"
  40294. // },
  40295. // "pageToken": {
  40296. // "description": "Value of the nextPageToken from the previous result page.",
  40297. // "location": "query",
  40298. // "type": "string"
  40299. // },
  40300. // "profileId": {
  40301. // "description": "User profile ID associated with this request.",
  40302. // "format": "int64",
  40303. // "location": "path",
  40304. // "required": true,
  40305. // "type": "string"
  40306. // },
  40307. // "searchString": {
  40308. // "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\".",
  40309. // "location": "query",
  40310. // "type": "string"
  40311. // },
  40312. // "sortField": {
  40313. // "default": "ID",
  40314. // "description": "Field by which to sort the list.",
  40315. // "enum": [
  40316. // "ID",
  40317. // "NAME"
  40318. // ],
  40319. // "enumDescriptions": [
  40320. // "",
  40321. // ""
  40322. // ],
  40323. // "location": "query",
  40324. // "type": "string"
  40325. // },
  40326. // "sortOrder": {
  40327. // "default": "ASCENDING",
  40328. // "description": "Order of sorted results.",
  40329. // "enum": [
  40330. // "ASCENDING",
  40331. // "DESCENDING"
  40332. // ],
  40333. // "enumDescriptions": [
  40334. // "",
  40335. // ""
  40336. // ],
  40337. // "location": "query",
  40338. // "type": "string"
  40339. // },
  40340. // "subaccountId": {
  40341. // "description": "Select only sites with this subaccount ID.",
  40342. // "format": "int64",
  40343. // "location": "query",
  40344. // "type": "string"
  40345. // },
  40346. // "unmappedSite": {
  40347. // "description": "Select only sites that have not been mapped to a directory site.",
  40348. // "location": "query",
  40349. // "type": "boolean"
  40350. // }
  40351. // },
  40352. // "path": "userprofiles/{profileId}/sites",
  40353. // "response": {
  40354. // "$ref": "SitesListResponse"
  40355. // },
  40356. // "scopes": [
  40357. // "https://www.googleapis.com/auth/dfatrafficking"
  40358. // ]
  40359. // }
  40360. }
  40361. // Pages invokes f for each page of results.
  40362. // A non-nil error returned from f will halt the iteration.
  40363. // The provided context supersedes any context provided to the Context method.
  40364. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  40365. c.ctx_ = ctx
  40366. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40367. for {
  40368. x, err := c.Do()
  40369. if err != nil {
  40370. return err
  40371. }
  40372. if err := f(x); err != nil {
  40373. return err
  40374. }
  40375. if x.NextPageToken == "" {
  40376. return nil
  40377. }
  40378. c.PageToken(x.NextPageToken)
  40379. }
  40380. }
  40381. // method id "dfareporting.sites.patch":
  40382. type SitesPatchCall struct {
  40383. s *Service
  40384. profileId int64
  40385. site *Site
  40386. urlParams_ gensupport.URLParams
  40387. ctx_ context.Context
  40388. header_ http.Header
  40389. }
  40390. // Patch: Updates an existing site. This method supports patch
  40391. // semantics.
  40392. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  40393. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40394. c.profileId = profileId
  40395. c.urlParams_.Set("id", fmt.Sprint(id))
  40396. c.site = site
  40397. return c
  40398. }
  40399. // Fields allows partial responses to be retrieved. See
  40400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40401. // for more information.
  40402. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  40403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40404. return c
  40405. }
  40406. // Context sets the context to be used in this call's Do method. Any
  40407. // pending HTTP request will be aborted if the provided context is
  40408. // canceled.
  40409. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  40410. c.ctx_ = ctx
  40411. return c
  40412. }
  40413. // Header returns an http.Header that can be modified by the caller to
  40414. // add HTTP headers to the request.
  40415. func (c *SitesPatchCall) Header() http.Header {
  40416. if c.header_ == nil {
  40417. c.header_ = make(http.Header)
  40418. }
  40419. return c.header_
  40420. }
  40421. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  40422. reqHeaders := make(http.Header)
  40423. for k, v := range c.header_ {
  40424. reqHeaders[k] = v
  40425. }
  40426. reqHeaders.Set("User-Agent", c.s.userAgent())
  40427. var body io.Reader = nil
  40428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40429. if err != nil {
  40430. return nil, err
  40431. }
  40432. reqHeaders.Set("Content-Type", "application/json")
  40433. c.urlParams_.Set("alt", alt)
  40434. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40435. urls += "?" + c.urlParams_.Encode()
  40436. req, _ := http.NewRequest("PATCH", urls, body)
  40437. req.Header = reqHeaders
  40438. googleapi.Expand(req.URL, map[string]string{
  40439. "profileId": strconv.FormatInt(c.profileId, 10),
  40440. })
  40441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40442. }
  40443. // Do executes the "dfareporting.sites.patch" call.
  40444. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40445. // code is an error. Response headers are in either
  40446. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40447. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40448. // whether the returned error was because http.StatusNotModified was
  40449. // returned.
  40450. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40451. gensupport.SetOptions(c.urlParams_, opts...)
  40452. res, err := c.doRequest("json")
  40453. if res != nil && res.StatusCode == http.StatusNotModified {
  40454. if res.Body != nil {
  40455. res.Body.Close()
  40456. }
  40457. return nil, &googleapi.Error{
  40458. Code: res.StatusCode,
  40459. Header: res.Header,
  40460. }
  40461. }
  40462. if err != nil {
  40463. return nil, err
  40464. }
  40465. defer googleapi.CloseBody(res)
  40466. if err := googleapi.CheckResponse(res); err != nil {
  40467. return nil, err
  40468. }
  40469. ret := &Site{
  40470. ServerResponse: googleapi.ServerResponse{
  40471. Header: res.Header,
  40472. HTTPStatusCode: res.StatusCode,
  40473. },
  40474. }
  40475. target := &ret
  40476. if err := gensupport.DecodeResponse(target, res); err != nil {
  40477. return nil, err
  40478. }
  40479. return ret, nil
  40480. // {
  40481. // "description": "Updates an existing site. This method supports patch semantics.",
  40482. // "httpMethod": "PATCH",
  40483. // "id": "dfareporting.sites.patch",
  40484. // "parameterOrder": [
  40485. // "profileId",
  40486. // "id"
  40487. // ],
  40488. // "parameters": {
  40489. // "id": {
  40490. // "description": "Site ID.",
  40491. // "format": "int64",
  40492. // "location": "query",
  40493. // "required": true,
  40494. // "type": "string"
  40495. // },
  40496. // "profileId": {
  40497. // "description": "User profile ID associated with this request.",
  40498. // "format": "int64",
  40499. // "location": "path",
  40500. // "required": true,
  40501. // "type": "string"
  40502. // }
  40503. // },
  40504. // "path": "userprofiles/{profileId}/sites",
  40505. // "request": {
  40506. // "$ref": "Site"
  40507. // },
  40508. // "response": {
  40509. // "$ref": "Site"
  40510. // },
  40511. // "scopes": [
  40512. // "https://www.googleapis.com/auth/dfatrafficking"
  40513. // ]
  40514. // }
  40515. }
  40516. // method id "dfareporting.sites.update":
  40517. type SitesUpdateCall struct {
  40518. s *Service
  40519. profileId int64
  40520. site *Site
  40521. urlParams_ gensupport.URLParams
  40522. ctx_ context.Context
  40523. header_ http.Header
  40524. }
  40525. // Update: Updates an existing site.
  40526. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  40527. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40528. c.profileId = profileId
  40529. c.site = site
  40530. return c
  40531. }
  40532. // Fields allows partial responses to be retrieved. See
  40533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40534. // for more information.
  40535. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  40536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40537. return c
  40538. }
  40539. // Context sets the context to be used in this call's Do method. Any
  40540. // pending HTTP request will be aborted if the provided context is
  40541. // canceled.
  40542. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  40543. c.ctx_ = ctx
  40544. return c
  40545. }
  40546. // Header returns an http.Header that can be modified by the caller to
  40547. // add HTTP headers to the request.
  40548. func (c *SitesUpdateCall) Header() http.Header {
  40549. if c.header_ == nil {
  40550. c.header_ = make(http.Header)
  40551. }
  40552. return c.header_
  40553. }
  40554. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  40555. reqHeaders := make(http.Header)
  40556. for k, v := range c.header_ {
  40557. reqHeaders[k] = v
  40558. }
  40559. reqHeaders.Set("User-Agent", c.s.userAgent())
  40560. var body io.Reader = nil
  40561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40562. if err != nil {
  40563. return nil, err
  40564. }
  40565. reqHeaders.Set("Content-Type", "application/json")
  40566. c.urlParams_.Set("alt", alt)
  40567. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40568. urls += "?" + c.urlParams_.Encode()
  40569. req, _ := http.NewRequest("PUT", urls, body)
  40570. req.Header = reqHeaders
  40571. googleapi.Expand(req.URL, map[string]string{
  40572. "profileId": strconv.FormatInt(c.profileId, 10),
  40573. })
  40574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40575. }
  40576. // Do executes the "dfareporting.sites.update" call.
  40577. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40578. // code is an error. Response headers are in either
  40579. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40580. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40581. // whether the returned error was because http.StatusNotModified was
  40582. // returned.
  40583. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40584. gensupport.SetOptions(c.urlParams_, opts...)
  40585. res, err := c.doRequest("json")
  40586. if res != nil && res.StatusCode == http.StatusNotModified {
  40587. if res.Body != nil {
  40588. res.Body.Close()
  40589. }
  40590. return nil, &googleapi.Error{
  40591. Code: res.StatusCode,
  40592. Header: res.Header,
  40593. }
  40594. }
  40595. if err != nil {
  40596. return nil, err
  40597. }
  40598. defer googleapi.CloseBody(res)
  40599. if err := googleapi.CheckResponse(res); err != nil {
  40600. return nil, err
  40601. }
  40602. ret := &Site{
  40603. ServerResponse: googleapi.ServerResponse{
  40604. Header: res.Header,
  40605. HTTPStatusCode: res.StatusCode,
  40606. },
  40607. }
  40608. target := &ret
  40609. if err := gensupport.DecodeResponse(target, res); err != nil {
  40610. return nil, err
  40611. }
  40612. return ret, nil
  40613. // {
  40614. // "description": "Updates an existing site.",
  40615. // "httpMethod": "PUT",
  40616. // "id": "dfareporting.sites.update",
  40617. // "parameterOrder": [
  40618. // "profileId"
  40619. // ],
  40620. // "parameters": {
  40621. // "profileId": {
  40622. // "description": "User profile ID associated with this request.",
  40623. // "format": "int64",
  40624. // "location": "path",
  40625. // "required": true,
  40626. // "type": "string"
  40627. // }
  40628. // },
  40629. // "path": "userprofiles/{profileId}/sites",
  40630. // "request": {
  40631. // "$ref": "Site"
  40632. // },
  40633. // "response": {
  40634. // "$ref": "Site"
  40635. // },
  40636. // "scopes": [
  40637. // "https://www.googleapis.com/auth/dfatrafficking"
  40638. // ]
  40639. // }
  40640. }
  40641. // method id "dfareporting.sizes.get":
  40642. type SizesGetCall struct {
  40643. s *Service
  40644. profileId int64
  40645. id int64
  40646. urlParams_ gensupport.URLParams
  40647. ifNoneMatch_ string
  40648. ctx_ context.Context
  40649. header_ http.Header
  40650. }
  40651. // Get: Gets one size by ID.
  40652. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  40653. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40654. c.profileId = profileId
  40655. c.id = id
  40656. return c
  40657. }
  40658. // Fields allows partial responses to be retrieved. See
  40659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40660. // for more information.
  40661. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  40662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40663. return c
  40664. }
  40665. // IfNoneMatch sets the optional parameter which makes the operation
  40666. // fail if the object's ETag matches the given value. This is useful for
  40667. // getting updates only after the object has changed since the last
  40668. // request. Use googleapi.IsNotModified to check whether the response
  40669. // error from Do is the result of In-None-Match.
  40670. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  40671. c.ifNoneMatch_ = entityTag
  40672. return c
  40673. }
  40674. // Context sets the context to be used in this call's Do method. Any
  40675. // pending HTTP request will be aborted if the provided context is
  40676. // canceled.
  40677. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  40678. c.ctx_ = ctx
  40679. return c
  40680. }
  40681. // Header returns an http.Header that can be modified by the caller to
  40682. // add HTTP headers to the request.
  40683. func (c *SizesGetCall) Header() http.Header {
  40684. if c.header_ == nil {
  40685. c.header_ = make(http.Header)
  40686. }
  40687. return c.header_
  40688. }
  40689. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  40690. reqHeaders := make(http.Header)
  40691. for k, v := range c.header_ {
  40692. reqHeaders[k] = v
  40693. }
  40694. reqHeaders.Set("User-Agent", c.s.userAgent())
  40695. if c.ifNoneMatch_ != "" {
  40696. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40697. }
  40698. var body io.Reader = nil
  40699. c.urlParams_.Set("alt", alt)
  40700. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  40701. urls += "?" + c.urlParams_.Encode()
  40702. req, _ := http.NewRequest("GET", urls, body)
  40703. req.Header = reqHeaders
  40704. googleapi.Expand(req.URL, map[string]string{
  40705. "profileId": strconv.FormatInt(c.profileId, 10),
  40706. "id": strconv.FormatInt(c.id, 10),
  40707. })
  40708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40709. }
  40710. // Do executes the "dfareporting.sizes.get" call.
  40711. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  40712. // code is an error. Response headers are in either
  40713. // *Size.ServerResponse.Header or (if a response was returned at all) in
  40714. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40715. // whether the returned error was because http.StatusNotModified was
  40716. // returned.
  40717. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  40718. gensupport.SetOptions(c.urlParams_, opts...)
  40719. res, err := c.doRequest("json")
  40720. if res != nil && res.StatusCode == http.StatusNotModified {
  40721. if res.Body != nil {
  40722. res.Body.Close()
  40723. }
  40724. return nil, &googleapi.Error{
  40725. Code: res.StatusCode,
  40726. Header: res.Header,
  40727. }
  40728. }
  40729. if err != nil {
  40730. return nil, err
  40731. }
  40732. defer googleapi.CloseBody(res)
  40733. if err := googleapi.CheckResponse(res); err != nil {
  40734. return nil, err
  40735. }
  40736. ret := &Size{
  40737. ServerResponse: googleapi.ServerResponse{
  40738. Header: res.Header,
  40739. HTTPStatusCode: res.StatusCode,
  40740. },
  40741. }
  40742. target := &ret
  40743. if err := gensupport.DecodeResponse(target, res); err != nil {
  40744. return nil, err
  40745. }
  40746. return ret, nil
  40747. // {
  40748. // "description": "Gets one size by ID.",
  40749. // "httpMethod": "GET",
  40750. // "id": "dfareporting.sizes.get",
  40751. // "parameterOrder": [
  40752. // "profileId",
  40753. // "id"
  40754. // ],
  40755. // "parameters": {
  40756. // "id": {
  40757. // "description": "Size ID.",
  40758. // "format": "int64",
  40759. // "location": "path",
  40760. // "required": true,
  40761. // "type": "string"
  40762. // },
  40763. // "profileId": {
  40764. // "description": "User profile ID associated with this request.",
  40765. // "format": "int64",
  40766. // "location": "path",
  40767. // "required": true,
  40768. // "type": "string"
  40769. // }
  40770. // },
  40771. // "path": "userprofiles/{profileId}/sizes/{id}",
  40772. // "response": {
  40773. // "$ref": "Size"
  40774. // },
  40775. // "scopes": [
  40776. // "https://www.googleapis.com/auth/dfatrafficking"
  40777. // ]
  40778. // }
  40779. }
  40780. // method id "dfareporting.sizes.insert":
  40781. type SizesInsertCall struct {
  40782. s *Service
  40783. profileId int64
  40784. size *Size
  40785. urlParams_ gensupport.URLParams
  40786. ctx_ context.Context
  40787. header_ http.Header
  40788. }
  40789. // Insert: Inserts a new size.
  40790. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  40791. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40792. c.profileId = profileId
  40793. c.size = size
  40794. return c
  40795. }
  40796. // Fields allows partial responses to be retrieved. See
  40797. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40798. // for more information.
  40799. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  40800. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40801. return c
  40802. }
  40803. // Context sets the context to be used in this call's Do method. Any
  40804. // pending HTTP request will be aborted if the provided context is
  40805. // canceled.
  40806. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  40807. c.ctx_ = ctx
  40808. return c
  40809. }
  40810. // Header returns an http.Header that can be modified by the caller to
  40811. // add HTTP headers to the request.
  40812. func (c *SizesInsertCall) Header() http.Header {
  40813. if c.header_ == nil {
  40814. c.header_ = make(http.Header)
  40815. }
  40816. return c.header_
  40817. }
  40818. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  40819. reqHeaders := make(http.Header)
  40820. for k, v := range c.header_ {
  40821. reqHeaders[k] = v
  40822. }
  40823. reqHeaders.Set("User-Agent", c.s.userAgent())
  40824. var body io.Reader = nil
  40825. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  40826. if err != nil {
  40827. return nil, err
  40828. }
  40829. reqHeaders.Set("Content-Type", "application/json")
  40830. c.urlParams_.Set("alt", alt)
  40831. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  40832. urls += "?" + c.urlParams_.Encode()
  40833. req, _ := http.NewRequest("POST", urls, body)
  40834. req.Header = reqHeaders
  40835. googleapi.Expand(req.URL, map[string]string{
  40836. "profileId": strconv.FormatInt(c.profileId, 10),
  40837. })
  40838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40839. }
  40840. // Do executes the "dfareporting.sizes.insert" call.
  40841. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  40842. // code is an error. Response headers are in either
  40843. // *Size.ServerResponse.Header or (if a response was returned at all) in
  40844. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40845. // whether the returned error was because http.StatusNotModified was
  40846. // returned.
  40847. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  40848. gensupport.SetOptions(c.urlParams_, opts...)
  40849. res, err := c.doRequest("json")
  40850. if res != nil && res.StatusCode == http.StatusNotModified {
  40851. if res.Body != nil {
  40852. res.Body.Close()
  40853. }
  40854. return nil, &googleapi.Error{
  40855. Code: res.StatusCode,
  40856. Header: res.Header,
  40857. }
  40858. }
  40859. if err != nil {
  40860. return nil, err
  40861. }
  40862. defer googleapi.CloseBody(res)
  40863. if err := googleapi.CheckResponse(res); err != nil {
  40864. return nil, err
  40865. }
  40866. ret := &Size{
  40867. ServerResponse: googleapi.ServerResponse{
  40868. Header: res.Header,
  40869. HTTPStatusCode: res.StatusCode,
  40870. },
  40871. }
  40872. target := &ret
  40873. if err := gensupport.DecodeResponse(target, res); err != nil {
  40874. return nil, err
  40875. }
  40876. return ret, nil
  40877. // {
  40878. // "description": "Inserts a new size.",
  40879. // "httpMethod": "POST",
  40880. // "id": "dfareporting.sizes.insert",
  40881. // "parameterOrder": [
  40882. // "profileId"
  40883. // ],
  40884. // "parameters": {
  40885. // "profileId": {
  40886. // "description": "User profile ID associated with this request.",
  40887. // "format": "int64",
  40888. // "location": "path",
  40889. // "required": true,
  40890. // "type": "string"
  40891. // }
  40892. // },
  40893. // "path": "userprofiles/{profileId}/sizes",
  40894. // "request": {
  40895. // "$ref": "Size"
  40896. // },
  40897. // "response": {
  40898. // "$ref": "Size"
  40899. // },
  40900. // "scopes": [
  40901. // "https://www.googleapis.com/auth/dfatrafficking"
  40902. // ]
  40903. // }
  40904. }
  40905. // method id "dfareporting.sizes.list":
  40906. type SizesListCall struct {
  40907. s *Service
  40908. profileId int64
  40909. urlParams_ gensupport.URLParams
  40910. ifNoneMatch_ string
  40911. ctx_ context.Context
  40912. header_ http.Header
  40913. }
  40914. // List: Retrieves a list of sizes, possibly filtered.
  40915. func (r *SizesService) List(profileId int64) *SizesListCall {
  40916. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40917. c.profileId = profileId
  40918. return c
  40919. }
  40920. // Height sets the optional parameter "height": Select only sizes with
  40921. // this height.
  40922. func (c *SizesListCall) Height(height int64) *SizesListCall {
  40923. c.urlParams_.Set("height", fmt.Sprint(height))
  40924. return c
  40925. }
  40926. // IabStandard sets the optional parameter "iabStandard": Select only
  40927. // IAB standard sizes.
  40928. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  40929. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  40930. return c
  40931. }
  40932. // Ids sets the optional parameter "ids": Select only sizes with these
  40933. // IDs.
  40934. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  40935. var ids_ []string
  40936. for _, v := range ids {
  40937. ids_ = append(ids_, fmt.Sprint(v))
  40938. }
  40939. c.urlParams_.SetMulti("ids", ids_)
  40940. return c
  40941. }
  40942. // Width sets the optional parameter "width": Select only sizes with
  40943. // this width.
  40944. func (c *SizesListCall) Width(width int64) *SizesListCall {
  40945. c.urlParams_.Set("width", fmt.Sprint(width))
  40946. return c
  40947. }
  40948. // Fields allows partial responses to be retrieved. See
  40949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40950. // for more information.
  40951. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  40952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40953. return c
  40954. }
  40955. // IfNoneMatch sets the optional parameter which makes the operation
  40956. // fail if the object's ETag matches the given value. This is useful for
  40957. // getting updates only after the object has changed since the last
  40958. // request. Use googleapi.IsNotModified to check whether the response
  40959. // error from Do is the result of In-None-Match.
  40960. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  40961. c.ifNoneMatch_ = entityTag
  40962. return c
  40963. }
  40964. // Context sets the context to be used in this call's Do method. Any
  40965. // pending HTTP request will be aborted if the provided context is
  40966. // canceled.
  40967. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  40968. c.ctx_ = ctx
  40969. return c
  40970. }
  40971. // Header returns an http.Header that can be modified by the caller to
  40972. // add HTTP headers to the request.
  40973. func (c *SizesListCall) Header() http.Header {
  40974. if c.header_ == nil {
  40975. c.header_ = make(http.Header)
  40976. }
  40977. return c.header_
  40978. }
  40979. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  40980. reqHeaders := make(http.Header)
  40981. for k, v := range c.header_ {
  40982. reqHeaders[k] = v
  40983. }
  40984. reqHeaders.Set("User-Agent", c.s.userAgent())
  40985. if c.ifNoneMatch_ != "" {
  40986. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40987. }
  40988. var body io.Reader = nil
  40989. c.urlParams_.Set("alt", alt)
  40990. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  40991. urls += "?" + c.urlParams_.Encode()
  40992. req, _ := http.NewRequest("GET", urls, body)
  40993. req.Header = reqHeaders
  40994. googleapi.Expand(req.URL, map[string]string{
  40995. "profileId": strconv.FormatInt(c.profileId, 10),
  40996. })
  40997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40998. }
  40999. // Do executes the "dfareporting.sizes.list" call.
  41000. // Exactly one of *SizesListResponse or error will be non-nil. Any
  41001. // non-2xx status code is an error. Response headers are in either
  41002. // *SizesListResponse.ServerResponse.Header or (if a response was
  41003. // returned at all) in error.(*googleapi.Error).Header. Use
  41004. // googleapi.IsNotModified to check whether the returned error was
  41005. // because http.StatusNotModified was returned.
  41006. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  41007. gensupport.SetOptions(c.urlParams_, opts...)
  41008. res, err := c.doRequest("json")
  41009. if res != nil && res.StatusCode == http.StatusNotModified {
  41010. if res.Body != nil {
  41011. res.Body.Close()
  41012. }
  41013. return nil, &googleapi.Error{
  41014. Code: res.StatusCode,
  41015. Header: res.Header,
  41016. }
  41017. }
  41018. if err != nil {
  41019. return nil, err
  41020. }
  41021. defer googleapi.CloseBody(res)
  41022. if err := googleapi.CheckResponse(res); err != nil {
  41023. return nil, err
  41024. }
  41025. ret := &SizesListResponse{
  41026. ServerResponse: googleapi.ServerResponse{
  41027. Header: res.Header,
  41028. HTTPStatusCode: res.StatusCode,
  41029. },
  41030. }
  41031. target := &ret
  41032. if err := gensupport.DecodeResponse(target, res); err != nil {
  41033. return nil, err
  41034. }
  41035. return ret, nil
  41036. // {
  41037. // "description": "Retrieves a list of sizes, possibly filtered.",
  41038. // "httpMethod": "GET",
  41039. // "id": "dfareporting.sizes.list",
  41040. // "parameterOrder": [
  41041. // "profileId"
  41042. // ],
  41043. // "parameters": {
  41044. // "height": {
  41045. // "description": "Select only sizes with this height.",
  41046. // "format": "int32",
  41047. // "location": "query",
  41048. // "maximum": "32767",
  41049. // "minimum": "0",
  41050. // "type": "integer"
  41051. // },
  41052. // "iabStandard": {
  41053. // "description": "Select only IAB standard sizes.",
  41054. // "location": "query",
  41055. // "type": "boolean"
  41056. // },
  41057. // "ids": {
  41058. // "description": "Select only sizes with these IDs.",
  41059. // "format": "int64",
  41060. // "location": "query",
  41061. // "repeated": true,
  41062. // "type": "string"
  41063. // },
  41064. // "profileId": {
  41065. // "description": "User profile ID associated with this request.",
  41066. // "format": "int64",
  41067. // "location": "path",
  41068. // "required": true,
  41069. // "type": "string"
  41070. // },
  41071. // "width": {
  41072. // "description": "Select only sizes with this width.",
  41073. // "format": "int32",
  41074. // "location": "query",
  41075. // "maximum": "32767",
  41076. // "minimum": "0",
  41077. // "type": "integer"
  41078. // }
  41079. // },
  41080. // "path": "userprofiles/{profileId}/sizes",
  41081. // "response": {
  41082. // "$ref": "SizesListResponse"
  41083. // },
  41084. // "scopes": [
  41085. // "https://www.googleapis.com/auth/dfatrafficking"
  41086. // ]
  41087. // }
  41088. }
  41089. // method id "dfareporting.subaccounts.get":
  41090. type SubaccountsGetCall struct {
  41091. s *Service
  41092. profileId int64
  41093. id int64
  41094. urlParams_ gensupport.URLParams
  41095. ifNoneMatch_ string
  41096. ctx_ context.Context
  41097. header_ http.Header
  41098. }
  41099. // Get: Gets one subaccount by ID.
  41100. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  41101. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41102. c.profileId = profileId
  41103. c.id = id
  41104. return c
  41105. }
  41106. // Fields allows partial responses to be retrieved. See
  41107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41108. // for more information.
  41109. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  41110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41111. return c
  41112. }
  41113. // IfNoneMatch sets the optional parameter which makes the operation
  41114. // fail if the object's ETag matches the given value. This is useful for
  41115. // getting updates only after the object has changed since the last
  41116. // request. Use googleapi.IsNotModified to check whether the response
  41117. // error from Do is the result of In-None-Match.
  41118. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  41119. c.ifNoneMatch_ = entityTag
  41120. return c
  41121. }
  41122. // Context sets the context to be used in this call's Do method. Any
  41123. // pending HTTP request will be aborted if the provided context is
  41124. // canceled.
  41125. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  41126. c.ctx_ = ctx
  41127. return c
  41128. }
  41129. // Header returns an http.Header that can be modified by the caller to
  41130. // add HTTP headers to the request.
  41131. func (c *SubaccountsGetCall) Header() http.Header {
  41132. if c.header_ == nil {
  41133. c.header_ = make(http.Header)
  41134. }
  41135. return c.header_
  41136. }
  41137. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  41138. reqHeaders := make(http.Header)
  41139. for k, v := range c.header_ {
  41140. reqHeaders[k] = v
  41141. }
  41142. reqHeaders.Set("User-Agent", c.s.userAgent())
  41143. if c.ifNoneMatch_ != "" {
  41144. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41145. }
  41146. var body io.Reader = nil
  41147. c.urlParams_.Set("alt", alt)
  41148. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  41149. urls += "?" + c.urlParams_.Encode()
  41150. req, _ := http.NewRequest("GET", urls, body)
  41151. req.Header = reqHeaders
  41152. googleapi.Expand(req.URL, map[string]string{
  41153. "profileId": strconv.FormatInt(c.profileId, 10),
  41154. "id": strconv.FormatInt(c.id, 10),
  41155. })
  41156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41157. }
  41158. // Do executes the "dfareporting.subaccounts.get" call.
  41159. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41160. // status code is an error. Response headers are in either
  41161. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41162. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41163. // to check whether the returned error was because
  41164. // http.StatusNotModified was returned.
  41165. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41166. gensupport.SetOptions(c.urlParams_, opts...)
  41167. res, err := c.doRequest("json")
  41168. if res != nil && res.StatusCode == http.StatusNotModified {
  41169. if res.Body != nil {
  41170. res.Body.Close()
  41171. }
  41172. return nil, &googleapi.Error{
  41173. Code: res.StatusCode,
  41174. Header: res.Header,
  41175. }
  41176. }
  41177. if err != nil {
  41178. return nil, err
  41179. }
  41180. defer googleapi.CloseBody(res)
  41181. if err := googleapi.CheckResponse(res); err != nil {
  41182. return nil, err
  41183. }
  41184. ret := &Subaccount{
  41185. ServerResponse: googleapi.ServerResponse{
  41186. Header: res.Header,
  41187. HTTPStatusCode: res.StatusCode,
  41188. },
  41189. }
  41190. target := &ret
  41191. if err := gensupport.DecodeResponse(target, res); err != nil {
  41192. return nil, err
  41193. }
  41194. return ret, nil
  41195. // {
  41196. // "description": "Gets one subaccount by ID.",
  41197. // "httpMethod": "GET",
  41198. // "id": "dfareporting.subaccounts.get",
  41199. // "parameterOrder": [
  41200. // "profileId",
  41201. // "id"
  41202. // ],
  41203. // "parameters": {
  41204. // "id": {
  41205. // "description": "Subaccount ID.",
  41206. // "format": "int64",
  41207. // "location": "path",
  41208. // "required": true,
  41209. // "type": "string"
  41210. // },
  41211. // "profileId": {
  41212. // "description": "User profile ID associated with this request.",
  41213. // "format": "int64",
  41214. // "location": "path",
  41215. // "required": true,
  41216. // "type": "string"
  41217. // }
  41218. // },
  41219. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  41220. // "response": {
  41221. // "$ref": "Subaccount"
  41222. // },
  41223. // "scopes": [
  41224. // "https://www.googleapis.com/auth/dfatrafficking"
  41225. // ]
  41226. // }
  41227. }
  41228. // method id "dfareporting.subaccounts.insert":
  41229. type SubaccountsInsertCall struct {
  41230. s *Service
  41231. profileId int64
  41232. subaccount *Subaccount
  41233. urlParams_ gensupport.URLParams
  41234. ctx_ context.Context
  41235. header_ http.Header
  41236. }
  41237. // Insert: Inserts a new subaccount.
  41238. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  41239. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41240. c.profileId = profileId
  41241. c.subaccount = subaccount
  41242. return c
  41243. }
  41244. // Fields allows partial responses to be retrieved. See
  41245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41246. // for more information.
  41247. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  41248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41249. return c
  41250. }
  41251. // Context sets the context to be used in this call's Do method. Any
  41252. // pending HTTP request will be aborted if the provided context is
  41253. // canceled.
  41254. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  41255. c.ctx_ = ctx
  41256. return c
  41257. }
  41258. // Header returns an http.Header that can be modified by the caller to
  41259. // add HTTP headers to the request.
  41260. func (c *SubaccountsInsertCall) Header() http.Header {
  41261. if c.header_ == nil {
  41262. c.header_ = make(http.Header)
  41263. }
  41264. return c.header_
  41265. }
  41266. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  41267. reqHeaders := make(http.Header)
  41268. for k, v := range c.header_ {
  41269. reqHeaders[k] = v
  41270. }
  41271. reqHeaders.Set("User-Agent", c.s.userAgent())
  41272. var body io.Reader = nil
  41273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41274. if err != nil {
  41275. return nil, err
  41276. }
  41277. reqHeaders.Set("Content-Type", "application/json")
  41278. c.urlParams_.Set("alt", alt)
  41279. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41280. urls += "?" + c.urlParams_.Encode()
  41281. req, _ := http.NewRequest("POST", urls, body)
  41282. req.Header = reqHeaders
  41283. googleapi.Expand(req.URL, map[string]string{
  41284. "profileId": strconv.FormatInt(c.profileId, 10),
  41285. })
  41286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41287. }
  41288. // Do executes the "dfareporting.subaccounts.insert" call.
  41289. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41290. // status code is an error. Response headers are in either
  41291. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41292. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41293. // to check whether the returned error was because
  41294. // http.StatusNotModified was returned.
  41295. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41296. gensupport.SetOptions(c.urlParams_, opts...)
  41297. res, err := c.doRequest("json")
  41298. if res != nil && res.StatusCode == http.StatusNotModified {
  41299. if res.Body != nil {
  41300. res.Body.Close()
  41301. }
  41302. return nil, &googleapi.Error{
  41303. Code: res.StatusCode,
  41304. Header: res.Header,
  41305. }
  41306. }
  41307. if err != nil {
  41308. return nil, err
  41309. }
  41310. defer googleapi.CloseBody(res)
  41311. if err := googleapi.CheckResponse(res); err != nil {
  41312. return nil, err
  41313. }
  41314. ret := &Subaccount{
  41315. ServerResponse: googleapi.ServerResponse{
  41316. Header: res.Header,
  41317. HTTPStatusCode: res.StatusCode,
  41318. },
  41319. }
  41320. target := &ret
  41321. if err := gensupport.DecodeResponse(target, res); err != nil {
  41322. return nil, err
  41323. }
  41324. return ret, nil
  41325. // {
  41326. // "description": "Inserts a new subaccount.",
  41327. // "httpMethod": "POST",
  41328. // "id": "dfareporting.subaccounts.insert",
  41329. // "parameterOrder": [
  41330. // "profileId"
  41331. // ],
  41332. // "parameters": {
  41333. // "profileId": {
  41334. // "description": "User profile ID associated with this request.",
  41335. // "format": "int64",
  41336. // "location": "path",
  41337. // "required": true,
  41338. // "type": "string"
  41339. // }
  41340. // },
  41341. // "path": "userprofiles/{profileId}/subaccounts",
  41342. // "request": {
  41343. // "$ref": "Subaccount"
  41344. // },
  41345. // "response": {
  41346. // "$ref": "Subaccount"
  41347. // },
  41348. // "scopes": [
  41349. // "https://www.googleapis.com/auth/dfatrafficking"
  41350. // ]
  41351. // }
  41352. }
  41353. // method id "dfareporting.subaccounts.list":
  41354. type SubaccountsListCall struct {
  41355. s *Service
  41356. profileId int64
  41357. urlParams_ gensupport.URLParams
  41358. ifNoneMatch_ string
  41359. ctx_ context.Context
  41360. header_ http.Header
  41361. }
  41362. // List: Gets a list of subaccounts, possibly filtered. This method
  41363. // supports paging.
  41364. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  41365. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41366. c.profileId = profileId
  41367. return c
  41368. }
  41369. // Ids sets the optional parameter "ids": Select only subaccounts with
  41370. // these IDs.
  41371. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  41372. var ids_ []string
  41373. for _, v := range ids {
  41374. ids_ = append(ids_, fmt.Sprint(v))
  41375. }
  41376. c.urlParams_.SetMulti("ids", ids_)
  41377. return c
  41378. }
  41379. // MaxResults sets the optional parameter "maxResults": Maximum number
  41380. // of results to return.
  41381. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  41382. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41383. return c
  41384. }
  41385. // PageToken sets the optional parameter "pageToken": Value of the
  41386. // nextPageToken from the previous result page.
  41387. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  41388. c.urlParams_.Set("pageToken", pageToken)
  41389. return c
  41390. }
  41391. // SearchString sets the optional parameter "searchString": Allows
  41392. // searching for objects by name or ID. Wildcards (*) are allowed. For
  41393. // example, "subaccount*2015" will return objects with names like
  41394. // "subaccount June 2015", "subaccount April 2015", or simply
  41395. // "subaccount 2015". Most of the searches also add wildcards implicitly
  41396. // at the start and the end of the search string. For example, a search
  41397. // string of "subaccount" will match objects with name "my subaccount",
  41398. // "subaccount 2015", or simply "subaccount".
  41399. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  41400. c.urlParams_.Set("searchString", searchString)
  41401. return c
  41402. }
  41403. // SortField sets the optional parameter "sortField": Field by which to
  41404. // sort the list.
  41405. //
  41406. // Possible values:
  41407. // "ID" (default)
  41408. // "NAME"
  41409. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  41410. c.urlParams_.Set("sortField", sortField)
  41411. return c
  41412. }
  41413. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41414. // results.
  41415. //
  41416. // Possible values:
  41417. // "ASCENDING" (default)
  41418. // "DESCENDING"
  41419. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  41420. c.urlParams_.Set("sortOrder", sortOrder)
  41421. return c
  41422. }
  41423. // Fields allows partial responses to be retrieved. See
  41424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41425. // for more information.
  41426. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  41427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41428. return c
  41429. }
  41430. // IfNoneMatch sets the optional parameter which makes the operation
  41431. // fail if the object's ETag matches the given value. This is useful for
  41432. // getting updates only after the object has changed since the last
  41433. // request. Use googleapi.IsNotModified to check whether the response
  41434. // error from Do is the result of In-None-Match.
  41435. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  41436. c.ifNoneMatch_ = entityTag
  41437. return c
  41438. }
  41439. // Context sets the context to be used in this call's Do method. Any
  41440. // pending HTTP request will be aborted if the provided context is
  41441. // canceled.
  41442. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  41443. c.ctx_ = ctx
  41444. return c
  41445. }
  41446. // Header returns an http.Header that can be modified by the caller to
  41447. // add HTTP headers to the request.
  41448. func (c *SubaccountsListCall) Header() http.Header {
  41449. if c.header_ == nil {
  41450. c.header_ = make(http.Header)
  41451. }
  41452. return c.header_
  41453. }
  41454. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  41455. reqHeaders := make(http.Header)
  41456. for k, v := range c.header_ {
  41457. reqHeaders[k] = v
  41458. }
  41459. reqHeaders.Set("User-Agent", c.s.userAgent())
  41460. if c.ifNoneMatch_ != "" {
  41461. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41462. }
  41463. var body io.Reader = nil
  41464. c.urlParams_.Set("alt", alt)
  41465. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41466. urls += "?" + c.urlParams_.Encode()
  41467. req, _ := http.NewRequest("GET", urls, body)
  41468. req.Header = reqHeaders
  41469. googleapi.Expand(req.URL, map[string]string{
  41470. "profileId": strconv.FormatInt(c.profileId, 10),
  41471. })
  41472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41473. }
  41474. // Do executes the "dfareporting.subaccounts.list" call.
  41475. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  41476. // non-2xx status code is an error. Response headers are in either
  41477. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  41478. // returned at all) in error.(*googleapi.Error).Header. Use
  41479. // googleapi.IsNotModified to check whether the returned error was
  41480. // because http.StatusNotModified was returned.
  41481. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  41482. gensupport.SetOptions(c.urlParams_, opts...)
  41483. res, err := c.doRequest("json")
  41484. if res != nil && res.StatusCode == http.StatusNotModified {
  41485. if res.Body != nil {
  41486. res.Body.Close()
  41487. }
  41488. return nil, &googleapi.Error{
  41489. Code: res.StatusCode,
  41490. Header: res.Header,
  41491. }
  41492. }
  41493. if err != nil {
  41494. return nil, err
  41495. }
  41496. defer googleapi.CloseBody(res)
  41497. if err := googleapi.CheckResponse(res); err != nil {
  41498. return nil, err
  41499. }
  41500. ret := &SubaccountsListResponse{
  41501. ServerResponse: googleapi.ServerResponse{
  41502. Header: res.Header,
  41503. HTTPStatusCode: res.StatusCode,
  41504. },
  41505. }
  41506. target := &ret
  41507. if err := gensupport.DecodeResponse(target, res); err != nil {
  41508. return nil, err
  41509. }
  41510. return ret, nil
  41511. // {
  41512. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  41513. // "httpMethod": "GET",
  41514. // "id": "dfareporting.subaccounts.list",
  41515. // "parameterOrder": [
  41516. // "profileId"
  41517. // ],
  41518. // "parameters": {
  41519. // "ids": {
  41520. // "description": "Select only subaccounts with these IDs.",
  41521. // "format": "int64",
  41522. // "location": "query",
  41523. // "repeated": true,
  41524. // "type": "string"
  41525. // },
  41526. // "maxResults": {
  41527. // "default": "1000",
  41528. // "description": "Maximum number of results to return.",
  41529. // "format": "int32",
  41530. // "location": "query",
  41531. // "maximum": "1000",
  41532. // "minimum": "0",
  41533. // "type": "integer"
  41534. // },
  41535. // "pageToken": {
  41536. // "description": "Value of the nextPageToken from the previous result page.",
  41537. // "location": "query",
  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. // "searchString": {
  41548. // "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\".",
  41549. // "location": "query",
  41550. // "type": "string"
  41551. // },
  41552. // "sortField": {
  41553. // "default": "ID",
  41554. // "description": "Field by which to sort the list.",
  41555. // "enum": [
  41556. // "ID",
  41557. // "NAME"
  41558. // ],
  41559. // "enumDescriptions": [
  41560. // "",
  41561. // ""
  41562. // ],
  41563. // "location": "query",
  41564. // "type": "string"
  41565. // },
  41566. // "sortOrder": {
  41567. // "default": "ASCENDING",
  41568. // "description": "Order of sorted results.",
  41569. // "enum": [
  41570. // "ASCENDING",
  41571. // "DESCENDING"
  41572. // ],
  41573. // "enumDescriptions": [
  41574. // "",
  41575. // ""
  41576. // ],
  41577. // "location": "query",
  41578. // "type": "string"
  41579. // }
  41580. // },
  41581. // "path": "userprofiles/{profileId}/subaccounts",
  41582. // "response": {
  41583. // "$ref": "SubaccountsListResponse"
  41584. // },
  41585. // "scopes": [
  41586. // "https://www.googleapis.com/auth/dfatrafficking"
  41587. // ]
  41588. // }
  41589. }
  41590. // Pages invokes f for each page of results.
  41591. // A non-nil error returned from f will halt the iteration.
  41592. // The provided context supersedes any context provided to the Context method.
  41593. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  41594. c.ctx_ = ctx
  41595. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41596. for {
  41597. x, err := c.Do()
  41598. if err != nil {
  41599. return err
  41600. }
  41601. if err := f(x); err != nil {
  41602. return err
  41603. }
  41604. if x.NextPageToken == "" {
  41605. return nil
  41606. }
  41607. c.PageToken(x.NextPageToken)
  41608. }
  41609. }
  41610. // method id "dfareporting.subaccounts.patch":
  41611. type SubaccountsPatchCall struct {
  41612. s *Service
  41613. profileId int64
  41614. subaccount *Subaccount
  41615. urlParams_ gensupport.URLParams
  41616. ctx_ context.Context
  41617. header_ http.Header
  41618. }
  41619. // Patch: Updates an existing subaccount. This method supports patch
  41620. // semantics.
  41621. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  41622. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41623. c.profileId = profileId
  41624. c.urlParams_.Set("id", fmt.Sprint(id))
  41625. c.subaccount = subaccount
  41626. return c
  41627. }
  41628. // Fields allows partial responses to be retrieved. See
  41629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41630. // for more information.
  41631. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  41632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41633. return c
  41634. }
  41635. // Context sets the context to be used in this call's Do method. Any
  41636. // pending HTTP request will be aborted if the provided context is
  41637. // canceled.
  41638. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  41639. c.ctx_ = ctx
  41640. return c
  41641. }
  41642. // Header returns an http.Header that can be modified by the caller to
  41643. // add HTTP headers to the request.
  41644. func (c *SubaccountsPatchCall) Header() http.Header {
  41645. if c.header_ == nil {
  41646. c.header_ = make(http.Header)
  41647. }
  41648. return c.header_
  41649. }
  41650. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  41651. reqHeaders := make(http.Header)
  41652. for k, v := range c.header_ {
  41653. reqHeaders[k] = v
  41654. }
  41655. reqHeaders.Set("User-Agent", c.s.userAgent())
  41656. var body io.Reader = nil
  41657. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41658. if err != nil {
  41659. return nil, err
  41660. }
  41661. reqHeaders.Set("Content-Type", "application/json")
  41662. c.urlParams_.Set("alt", alt)
  41663. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41664. urls += "?" + c.urlParams_.Encode()
  41665. req, _ := http.NewRequest("PATCH", urls, body)
  41666. req.Header = reqHeaders
  41667. googleapi.Expand(req.URL, map[string]string{
  41668. "profileId": strconv.FormatInt(c.profileId, 10),
  41669. })
  41670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41671. }
  41672. // Do executes the "dfareporting.subaccounts.patch" call.
  41673. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41674. // status code is an error. Response headers are in either
  41675. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41677. // to check whether the returned error was because
  41678. // http.StatusNotModified was returned.
  41679. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41680. gensupport.SetOptions(c.urlParams_, opts...)
  41681. res, err := c.doRequest("json")
  41682. if res != nil && res.StatusCode == http.StatusNotModified {
  41683. if res.Body != nil {
  41684. res.Body.Close()
  41685. }
  41686. return nil, &googleapi.Error{
  41687. Code: res.StatusCode,
  41688. Header: res.Header,
  41689. }
  41690. }
  41691. if err != nil {
  41692. return nil, err
  41693. }
  41694. defer googleapi.CloseBody(res)
  41695. if err := googleapi.CheckResponse(res); err != nil {
  41696. return nil, err
  41697. }
  41698. ret := &Subaccount{
  41699. ServerResponse: googleapi.ServerResponse{
  41700. Header: res.Header,
  41701. HTTPStatusCode: res.StatusCode,
  41702. },
  41703. }
  41704. target := &ret
  41705. if err := gensupport.DecodeResponse(target, res); err != nil {
  41706. return nil, err
  41707. }
  41708. return ret, nil
  41709. // {
  41710. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  41711. // "httpMethod": "PATCH",
  41712. // "id": "dfareporting.subaccounts.patch",
  41713. // "parameterOrder": [
  41714. // "profileId",
  41715. // "id"
  41716. // ],
  41717. // "parameters": {
  41718. // "id": {
  41719. // "description": "Subaccount ID.",
  41720. // "format": "int64",
  41721. // "location": "query",
  41722. // "required": true,
  41723. // "type": "string"
  41724. // },
  41725. // "profileId": {
  41726. // "description": "User profile ID associated with this request.",
  41727. // "format": "int64",
  41728. // "location": "path",
  41729. // "required": true,
  41730. // "type": "string"
  41731. // }
  41732. // },
  41733. // "path": "userprofiles/{profileId}/subaccounts",
  41734. // "request": {
  41735. // "$ref": "Subaccount"
  41736. // },
  41737. // "response": {
  41738. // "$ref": "Subaccount"
  41739. // },
  41740. // "scopes": [
  41741. // "https://www.googleapis.com/auth/dfatrafficking"
  41742. // ]
  41743. // }
  41744. }
  41745. // method id "dfareporting.subaccounts.update":
  41746. type SubaccountsUpdateCall struct {
  41747. s *Service
  41748. profileId int64
  41749. subaccount *Subaccount
  41750. urlParams_ gensupport.URLParams
  41751. ctx_ context.Context
  41752. header_ http.Header
  41753. }
  41754. // Update: Updates an existing subaccount.
  41755. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  41756. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41757. c.profileId = profileId
  41758. c.subaccount = subaccount
  41759. return c
  41760. }
  41761. // Fields allows partial responses to be retrieved. See
  41762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41763. // for more information.
  41764. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  41765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41766. return c
  41767. }
  41768. // Context sets the context to be used in this call's Do method. Any
  41769. // pending HTTP request will be aborted if the provided context is
  41770. // canceled.
  41771. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  41772. c.ctx_ = ctx
  41773. return c
  41774. }
  41775. // Header returns an http.Header that can be modified by the caller to
  41776. // add HTTP headers to the request.
  41777. func (c *SubaccountsUpdateCall) Header() http.Header {
  41778. if c.header_ == nil {
  41779. c.header_ = make(http.Header)
  41780. }
  41781. return c.header_
  41782. }
  41783. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  41784. reqHeaders := make(http.Header)
  41785. for k, v := range c.header_ {
  41786. reqHeaders[k] = v
  41787. }
  41788. reqHeaders.Set("User-Agent", c.s.userAgent())
  41789. var body io.Reader = nil
  41790. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41791. if err != nil {
  41792. return nil, err
  41793. }
  41794. reqHeaders.Set("Content-Type", "application/json")
  41795. c.urlParams_.Set("alt", alt)
  41796. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41797. urls += "?" + c.urlParams_.Encode()
  41798. req, _ := http.NewRequest("PUT", urls, body)
  41799. req.Header = reqHeaders
  41800. googleapi.Expand(req.URL, map[string]string{
  41801. "profileId": strconv.FormatInt(c.profileId, 10),
  41802. })
  41803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41804. }
  41805. // Do executes the "dfareporting.subaccounts.update" call.
  41806. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41807. // status code is an error. Response headers are in either
  41808. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41809. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41810. // to check whether the returned error was because
  41811. // http.StatusNotModified was returned.
  41812. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41813. gensupport.SetOptions(c.urlParams_, opts...)
  41814. res, err := c.doRequest("json")
  41815. if res != nil && res.StatusCode == http.StatusNotModified {
  41816. if res.Body != nil {
  41817. res.Body.Close()
  41818. }
  41819. return nil, &googleapi.Error{
  41820. Code: res.StatusCode,
  41821. Header: res.Header,
  41822. }
  41823. }
  41824. if err != nil {
  41825. return nil, err
  41826. }
  41827. defer googleapi.CloseBody(res)
  41828. if err := googleapi.CheckResponse(res); err != nil {
  41829. return nil, err
  41830. }
  41831. ret := &Subaccount{
  41832. ServerResponse: googleapi.ServerResponse{
  41833. Header: res.Header,
  41834. HTTPStatusCode: res.StatusCode,
  41835. },
  41836. }
  41837. target := &ret
  41838. if err := gensupport.DecodeResponse(target, res); err != nil {
  41839. return nil, err
  41840. }
  41841. return ret, nil
  41842. // {
  41843. // "description": "Updates an existing subaccount.",
  41844. // "httpMethod": "PUT",
  41845. // "id": "dfareporting.subaccounts.update",
  41846. // "parameterOrder": [
  41847. // "profileId"
  41848. // ],
  41849. // "parameters": {
  41850. // "profileId": {
  41851. // "description": "User profile ID associated with this request.",
  41852. // "format": "int64",
  41853. // "location": "path",
  41854. // "required": true,
  41855. // "type": "string"
  41856. // }
  41857. // },
  41858. // "path": "userprofiles/{profileId}/subaccounts",
  41859. // "request": {
  41860. // "$ref": "Subaccount"
  41861. // },
  41862. // "response": {
  41863. // "$ref": "Subaccount"
  41864. // },
  41865. // "scopes": [
  41866. // "https://www.googleapis.com/auth/dfatrafficking"
  41867. // ]
  41868. // }
  41869. }
  41870. // method id "dfareporting.targetableRemarketingLists.get":
  41871. type TargetableRemarketingListsGetCall struct {
  41872. s *Service
  41873. profileId int64
  41874. id int64
  41875. urlParams_ gensupport.URLParams
  41876. ifNoneMatch_ string
  41877. ctx_ context.Context
  41878. header_ http.Header
  41879. }
  41880. // Get: Gets one remarketing list by ID.
  41881. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  41882. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41883. c.profileId = profileId
  41884. c.id = id
  41885. return c
  41886. }
  41887. // Fields allows partial responses to be retrieved. See
  41888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41889. // for more information.
  41890. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  41891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41892. return c
  41893. }
  41894. // IfNoneMatch sets the optional parameter which makes the operation
  41895. // fail if the object's ETag matches the given value. This is useful for
  41896. // getting updates only after the object has changed since the last
  41897. // request. Use googleapi.IsNotModified to check whether the response
  41898. // error from Do is the result of In-None-Match.
  41899. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  41900. c.ifNoneMatch_ = entityTag
  41901. return c
  41902. }
  41903. // Context sets the context to be used in this call's Do method. Any
  41904. // pending HTTP request will be aborted if the provided context is
  41905. // canceled.
  41906. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  41907. c.ctx_ = ctx
  41908. return c
  41909. }
  41910. // Header returns an http.Header that can be modified by the caller to
  41911. // add HTTP headers to the request.
  41912. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  41913. if c.header_ == nil {
  41914. c.header_ = make(http.Header)
  41915. }
  41916. return c.header_
  41917. }
  41918. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  41919. reqHeaders := make(http.Header)
  41920. for k, v := range c.header_ {
  41921. reqHeaders[k] = v
  41922. }
  41923. reqHeaders.Set("User-Agent", c.s.userAgent())
  41924. if c.ifNoneMatch_ != "" {
  41925. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41926. }
  41927. var body io.Reader = nil
  41928. c.urlParams_.Set("alt", alt)
  41929. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  41930. urls += "?" + c.urlParams_.Encode()
  41931. req, _ := http.NewRequest("GET", urls, body)
  41932. req.Header = reqHeaders
  41933. googleapi.Expand(req.URL, map[string]string{
  41934. "profileId": strconv.FormatInt(c.profileId, 10),
  41935. "id": strconv.FormatInt(c.id, 10),
  41936. })
  41937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41938. }
  41939. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  41940. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  41941. // Any non-2xx status code is an error. Response headers are in either
  41942. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  41943. // was returned at all) in error.(*googleapi.Error).Header. Use
  41944. // googleapi.IsNotModified to check whether the returned error was
  41945. // because http.StatusNotModified was returned.
  41946. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  41947. gensupport.SetOptions(c.urlParams_, opts...)
  41948. res, err := c.doRequest("json")
  41949. if res != nil && res.StatusCode == http.StatusNotModified {
  41950. if res.Body != nil {
  41951. res.Body.Close()
  41952. }
  41953. return nil, &googleapi.Error{
  41954. Code: res.StatusCode,
  41955. Header: res.Header,
  41956. }
  41957. }
  41958. if err != nil {
  41959. return nil, err
  41960. }
  41961. defer googleapi.CloseBody(res)
  41962. if err := googleapi.CheckResponse(res); err != nil {
  41963. return nil, err
  41964. }
  41965. ret := &TargetableRemarketingList{
  41966. ServerResponse: googleapi.ServerResponse{
  41967. Header: res.Header,
  41968. HTTPStatusCode: res.StatusCode,
  41969. },
  41970. }
  41971. target := &ret
  41972. if err := gensupport.DecodeResponse(target, res); err != nil {
  41973. return nil, err
  41974. }
  41975. return ret, nil
  41976. // {
  41977. // "description": "Gets one remarketing list by ID.",
  41978. // "httpMethod": "GET",
  41979. // "id": "dfareporting.targetableRemarketingLists.get",
  41980. // "parameterOrder": [
  41981. // "profileId",
  41982. // "id"
  41983. // ],
  41984. // "parameters": {
  41985. // "id": {
  41986. // "description": "Remarketing list ID.",
  41987. // "format": "int64",
  41988. // "location": "path",
  41989. // "required": true,
  41990. // "type": "string"
  41991. // },
  41992. // "profileId": {
  41993. // "description": "User profile ID associated with this request.",
  41994. // "format": "int64",
  41995. // "location": "path",
  41996. // "required": true,
  41997. // "type": "string"
  41998. // }
  41999. // },
  42000. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  42001. // "response": {
  42002. // "$ref": "TargetableRemarketingList"
  42003. // },
  42004. // "scopes": [
  42005. // "https://www.googleapis.com/auth/dfatrafficking"
  42006. // ]
  42007. // }
  42008. }
  42009. // method id "dfareporting.targetableRemarketingLists.list":
  42010. type TargetableRemarketingListsListCall struct {
  42011. s *Service
  42012. profileId int64
  42013. urlParams_ gensupport.URLParams
  42014. ifNoneMatch_ string
  42015. ctx_ context.Context
  42016. header_ http.Header
  42017. }
  42018. // List: Retrieves a list of targetable remarketing lists, possibly
  42019. // filtered. This method supports paging.
  42020. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  42021. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42022. c.profileId = profileId
  42023. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42024. return c
  42025. }
  42026. // Active sets the optional parameter "active": Select only active or
  42027. // only inactive targetable remarketing lists.
  42028. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  42029. c.urlParams_.Set("active", fmt.Sprint(active))
  42030. return c
  42031. }
  42032. // MaxResults sets the optional parameter "maxResults": Maximum number
  42033. // of results to return.
  42034. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  42035. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42036. return c
  42037. }
  42038. // Name sets the optional parameter "name": Allows searching for objects
  42039. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  42040. // list*2015" will return objects with names like "remarketing list June
  42041. // 2015", "remarketing list April 2015", or simply "remarketing list
  42042. // 2015". Most of the searches also add wildcards implicitly at the
  42043. // start and the end of the search string. For example, a search string
  42044. // of "remarketing list" will match objects with name "my remarketing
  42045. // list", "remarketing list 2015", or simply "remarketing list".
  42046. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  42047. c.urlParams_.Set("name", name)
  42048. return c
  42049. }
  42050. // PageToken sets the optional parameter "pageToken": Value of the
  42051. // nextPageToken from the previous result page.
  42052. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  42053. c.urlParams_.Set("pageToken", pageToken)
  42054. return c
  42055. }
  42056. // SortField sets the optional parameter "sortField": Field by which to
  42057. // sort the list.
  42058. //
  42059. // Possible values:
  42060. // "ID" (default)
  42061. // "NAME"
  42062. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  42063. c.urlParams_.Set("sortField", sortField)
  42064. return c
  42065. }
  42066. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42067. // results.
  42068. //
  42069. // Possible values:
  42070. // "ASCENDING" (default)
  42071. // "DESCENDING"
  42072. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  42073. c.urlParams_.Set("sortOrder", sortOrder)
  42074. return c
  42075. }
  42076. // Fields allows partial responses to be retrieved. See
  42077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42078. // for more information.
  42079. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  42080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42081. return c
  42082. }
  42083. // IfNoneMatch sets the optional parameter which makes the operation
  42084. // fail if the object's ETag matches the given value. This is useful for
  42085. // getting updates only after the object has changed since the last
  42086. // request. Use googleapi.IsNotModified to check whether the response
  42087. // error from Do is the result of In-None-Match.
  42088. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  42089. c.ifNoneMatch_ = entityTag
  42090. return c
  42091. }
  42092. // Context sets the context to be used in this call's Do method. Any
  42093. // pending HTTP request will be aborted if the provided context is
  42094. // canceled.
  42095. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  42096. c.ctx_ = ctx
  42097. return c
  42098. }
  42099. // Header returns an http.Header that can be modified by the caller to
  42100. // add HTTP headers to the request.
  42101. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  42102. if c.header_ == nil {
  42103. c.header_ = make(http.Header)
  42104. }
  42105. return c.header_
  42106. }
  42107. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  42108. reqHeaders := make(http.Header)
  42109. for k, v := range c.header_ {
  42110. reqHeaders[k] = v
  42111. }
  42112. reqHeaders.Set("User-Agent", c.s.userAgent())
  42113. if c.ifNoneMatch_ != "" {
  42114. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42115. }
  42116. var body io.Reader = nil
  42117. c.urlParams_.Set("alt", alt)
  42118. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  42119. urls += "?" + c.urlParams_.Encode()
  42120. req, _ := http.NewRequest("GET", urls, body)
  42121. req.Header = reqHeaders
  42122. googleapi.Expand(req.URL, map[string]string{
  42123. "profileId": strconv.FormatInt(c.profileId, 10),
  42124. })
  42125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42126. }
  42127. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  42128. // Exactly one of *TargetableRemarketingListsListResponse or error will
  42129. // be non-nil. Any non-2xx status code is an error. Response headers are
  42130. // in either
  42131. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  42132. // a response was returned at all) in error.(*googleapi.Error).Header.
  42133. // Use googleapi.IsNotModified to check whether the returned error was
  42134. // because http.StatusNotModified was returned.
  42135. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  42136. gensupport.SetOptions(c.urlParams_, opts...)
  42137. res, err := c.doRequest("json")
  42138. if res != nil && res.StatusCode == http.StatusNotModified {
  42139. if res.Body != nil {
  42140. res.Body.Close()
  42141. }
  42142. return nil, &googleapi.Error{
  42143. Code: res.StatusCode,
  42144. Header: res.Header,
  42145. }
  42146. }
  42147. if err != nil {
  42148. return nil, err
  42149. }
  42150. defer googleapi.CloseBody(res)
  42151. if err := googleapi.CheckResponse(res); err != nil {
  42152. return nil, err
  42153. }
  42154. ret := &TargetableRemarketingListsListResponse{
  42155. ServerResponse: googleapi.ServerResponse{
  42156. Header: res.Header,
  42157. HTTPStatusCode: res.StatusCode,
  42158. },
  42159. }
  42160. target := &ret
  42161. if err := gensupport.DecodeResponse(target, res); err != nil {
  42162. return nil, err
  42163. }
  42164. return ret, nil
  42165. // {
  42166. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  42167. // "httpMethod": "GET",
  42168. // "id": "dfareporting.targetableRemarketingLists.list",
  42169. // "parameterOrder": [
  42170. // "profileId",
  42171. // "advertiserId"
  42172. // ],
  42173. // "parameters": {
  42174. // "active": {
  42175. // "description": "Select only active or only inactive targetable remarketing lists.",
  42176. // "location": "query",
  42177. // "type": "boolean"
  42178. // },
  42179. // "advertiserId": {
  42180. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  42181. // "format": "int64",
  42182. // "location": "query",
  42183. // "required": true,
  42184. // "type": "string"
  42185. // },
  42186. // "maxResults": {
  42187. // "default": "1000",
  42188. // "description": "Maximum number of results to return.",
  42189. // "format": "int32",
  42190. // "location": "query",
  42191. // "maximum": "1000",
  42192. // "minimum": "0",
  42193. // "type": "integer"
  42194. // },
  42195. // "name": {
  42196. // "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\".",
  42197. // "location": "query",
  42198. // "type": "string"
  42199. // },
  42200. // "pageToken": {
  42201. // "description": "Value of the nextPageToken from the previous result page.",
  42202. // "location": "query",
  42203. // "type": "string"
  42204. // },
  42205. // "profileId": {
  42206. // "description": "User profile ID associated with this request.",
  42207. // "format": "int64",
  42208. // "location": "path",
  42209. // "required": true,
  42210. // "type": "string"
  42211. // },
  42212. // "sortField": {
  42213. // "default": "ID",
  42214. // "description": "Field by which to sort the list.",
  42215. // "enum": [
  42216. // "ID",
  42217. // "NAME"
  42218. // ],
  42219. // "enumDescriptions": [
  42220. // "",
  42221. // ""
  42222. // ],
  42223. // "location": "query",
  42224. // "type": "string"
  42225. // },
  42226. // "sortOrder": {
  42227. // "default": "ASCENDING",
  42228. // "description": "Order of sorted results.",
  42229. // "enum": [
  42230. // "ASCENDING",
  42231. // "DESCENDING"
  42232. // ],
  42233. // "enumDescriptions": [
  42234. // "",
  42235. // ""
  42236. // ],
  42237. // "location": "query",
  42238. // "type": "string"
  42239. // }
  42240. // },
  42241. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  42242. // "response": {
  42243. // "$ref": "TargetableRemarketingListsListResponse"
  42244. // },
  42245. // "scopes": [
  42246. // "https://www.googleapis.com/auth/dfatrafficking"
  42247. // ]
  42248. // }
  42249. }
  42250. // Pages invokes f for each page of results.
  42251. // A non-nil error returned from f will halt the iteration.
  42252. // The provided context supersedes any context provided to the Context method.
  42253. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  42254. c.ctx_ = ctx
  42255. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42256. for {
  42257. x, err := c.Do()
  42258. if err != nil {
  42259. return err
  42260. }
  42261. if err := f(x); err != nil {
  42262. return err
  42263. }
  42264. if x.NextPageToken == "" {
  42265. return nil
  42266. }
  42267. c.PageToken(x.NextPageToken)
  42268. }
  42269. }
  42270. // method id "dfareporting.targetingTemplates.get":
  42271. type TargetingTemplatesGetCall struct {
  42272. s *Service
  42273. profileId int64
  42274. id int64
  42275. urlParams_ gensupport.URLParams
  42276. ifNoneMatch_ string
  42277. ctx_ context.Context
  42278. header_ http.Header
  42279. }
  42280. // Get: Gets one targeting template by ID.
  42281. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  42282. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42283. c.profileId = profileId
  42284. c.id = id
  42285. return c
  42286. }
  42287. // Fields allows partial responses to be retrieved. See
  42288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42289. // for more information.
  42290. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  42291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42292. return c
  42293. }
  42294. // IfNoneMatch sets the optional parameter which makes the operation
  42295. // fail if the object's ETag matches the given value. This is useful for
  42296. // getting updates only after the object has changed since the last
  42297. // request. Use googleapi.IsNotModified to check whether the response
  42298. // error from Do is the result of In-None-Match.
  42299. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  42300. c.ifNoneMatch_ = entityTag
  42301. return c
  42302. }
  42303. // Context sets the context to be used in this call's Do method. Any
  42304. // pending HTTP request will be aborted if the provided context is
  42305. // canceled.
  42306. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  42307. c.ctx_ = ctx
  42308. return c
  42309. }
  42310. // Header returns an http.Header that can be modified by the caller to
  42311. // add HTTP headers to the request.
  42312. func (c *TargetingTemplatesGetCall) Header() http.Header {
  42313. if c.header_ == nil {
  42314. c.header_ = make(http.Header)
  42315. }
  42316. return c.header_
  42317. }
  42318. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  42319. reqHeaders := make(http.Header)
  42320. for k, v := range c.header_ {
  42321. reqHeaders[k] = v
  42322. }
  42323. reqHeaders.Set("User-Agent", c.s.userAgent())
  42324. if c.ifNoneMatch_ != "" {
  42325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42326. }
  42327. var body io.Reader = nil
  42328. c.urlParams_.Set("alt", alt)
  42329. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  42330. urls += "?" + c.urlParams_.Encode()
  42331. req, _ := http.NewRequest("GET", urls, body)
  42332. req.Header = reqHeaders
  42333. googleapi.Expand(req.URL, map[string]string{
  42334. "profileId": strconv.FormatInt(c.profileId, 10),
  42335. "id": strconv.FormatInt(c.id, 10),
  42336. })
  42337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42338. }
  42339. // Do executes the "dfareporting.targetingTemplates.get" call.
  42340. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42341. // non-2xx status code is an error. Response headers are in either
  42342. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42343. // returned at all) in error.(*googleapi.Error).Header. Use
  42344. // googleapi.IsNotModified to check whether the returned error was
  42345. // because http.StatusNotModified was returned.
  42346. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42347. gensupport.SetOptions(c.urlParams_, opts...)
  42348. res, err := c.doRequest("json")
  42349. if res != nil && res.StatusCode == http.StatusNotModified {
  42350. if res.Body != nil {
  42351. res.Body.Close()
  42352. }
  42353. return nil, &googleapi.Error{
  42354. Code: res.StatusCode,
  42355. Header: res.Header,
  42356. }
  42357. }
  42358. if err != nil {
  42359. return nil, err
  42360. }
  42361. defer googleapi.CloseBody(res)
  42362. if err := googleapi.CheckResponse(res); err != nil {
  42363. return nil, err
  42364. }
  42365. ret := &TargetingTemplate{
  42366. ServerResponse: googleapi.ServerResponse{
  42367. Header: res.Header,
  42368. HTTPStatusCode: res.StatusCode,
  42369. },
  42370. }
  42371. target := &ret
  42372. if err := gensupport.DecodeResponse(target, res); err != nil {
  42373. return nil, err
  42374. }
  42375. return ret, nil
  42376. // {
  42377. // "description": "Gets one targeting template by ID.",
  42378. // "httpMethod": "GET",
  42379. // "id": "dfareporting.targetingTemplates.get",
  42380. // "parameterOrder": [
  42381. // "profileId",
  42382. // "id"
  42383. // ],
  42384. // "parameters": {
  42385. // "id": {
  42386. // "description": "Targeting template ID.",
  42387. // "format": "int64",
  42388. // "location": "path",
  42389. // "required": true,
  42390. // "type": "string"
  42391. // },
  42392. // "profileId": {
  42393. // "description": "User profile ID associated with this request.",
  42394. // "format": "int64",
  42395. // "location": "path",
  42396. // "required": true,
  42397. // "type": "string"
  42398. // }
  42399. // },
  42400. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  42401. // "response": {
  42402. // "$ref": "TargetingTemplate"
  42403. // },
  42404. // "scopes": [
  42405. // "https://www.googleapis.com/auth/dfatrafficking"
  42406. // ]
  42407. // }
  42408. }
  42409. // method id "dfareporting.targetingTemplates.insert":
  42410. type TargetingTemplatesInsertCall struct {
  42411. s *Service
  42412. profileId int64
  42413. targetingtemplate *TargetingTemplate
  42414. urlParams_ gensupport.URLParams
  42415. ctx_ context.Context
  42416. header_ http.Header
  42417. }
  42418. // Insert: Inserts a new targeting template.
  42419. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  42420. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42421. c.profileId = profileId
  42422. c.targetingtemplate = targetingtemplate
  42423. return c
  42424. }
  42425. // Fields allows partial responses to be retrieved. See
  42426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42427. // for more information.
  42428. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  42429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42430. return c
  42431. }
  42432. // Context sets the context to be used in this call's Do method. Any
  42433. // pending HTTP request will be aborted if the provided context is
  42434. // canceled.
  42435. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  42436. c.ctx_ = ctx
  42437. return c
  42438. }
  42439. // Header returns an http.Header that can be modified by the caller to
  42440. // add HTTP headers to the request.
  42441. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  42442. if c.header_ == nil {
  42443. c.header_ = make(http.Header)
  42444. }
  42445. return c.header_
  42446. }
  42447. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  42448. reqHeaders := make(http.Header)
  42449. for k, v := range c.header_ {
  42450. reqHeaders[k] = v
  42451. }
  42452. reqHeaders.Set("User-Agent", c.s.userAgent())
  42453. var body io.Reader = nil
  42454. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42455. if err != nil {
  42456. return nil, err
  42457. }
  42458. reqHeaders.Set("Content-Type", "application/json")
  42459. c.urlParams_.Set("alt", alt)
  42460. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42461. urls += "?" + c.urlParams_.Encode()
  42462. req, _ := http.NewRequest("POST", urls, body)
  42463. req.Header = reqHeaders
  42464. googleapi.Expand(req.URL, map[string]string{
  42465. "profileId": strconv.FormatInt(c.profileId, 10),
  42466. })
  42467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42468. }
  42469. // Do executes the "dfareporting.targetingTemplates.insert" call.
  42470. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42471. // non-2xx status code is an error. Response headers are in either
  42472. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42473. // returned at all) in error.(*googleapi.Error).Header. Use
  42474. // googleapi.IsNotModified to check whether the returned error was
  42475. // because http.StatusNotModified was returned.
  42476. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42477. gensupport.SetOptions(c.urlParams_, opts...)
  42478. res, err := c.doRequest("json")
  42479. if res != nil && res.StatusCode == http.StatusNotModified {
  42480. if res.Body != nil {
  42481. res.Body.Close()
  42482. }
  42483. return nil, &googleapi.Error{
  42484. Code: res.StatusCode,
  42485. Header: res.Header,
  42486. }
  42487. }
  42488. if err != nil {
  42489. return nil, err
  42490. }
  42491. defer googleapi.CloseBody(res)
  42492. if err := googleapi.CheckResponse(res); err != nil {
  42493. return nil, err
  42494. }
  42495. ret := &TargetingTemplate{
  42496. ServerResponse: googleapi.ServerResponse{
  42497. Header: res.Header,
  42498. HTTPStatusCode: res.StatusCode,
  42499. },
  42500. }
  42501. target := &ret
  42502. if err := gensupport.DecodeResponse(target, res); err != nil {
  42503. return nil, err
  42504. }
  42505. return ret, nil
  42506. // {
  42507. // "description": "Inserts a new targeting template.",
  42508. // "httpMethod": "POST",
  42509. // "id": "dfareporting.targetingTemplates.insert",
  42510. // "parameterOrder": [
  42511. // "profileId"
  42512. // ],
  42513. // "parameters": {
  42514. // "profileId": {
  42515. // "description": "User profile ID associated with this request.",
  42516. // "format": "int64",
  42517. // "location": "path",
  42518. // "required": true,
  42519. // "type": "string"
  42520. // }
  42521. // },
  42522. // "path": "userprofiles/{profileId}/targetingTemplates",
  42523. // "request": {
  42524. // "$ref": "TargetingTemplate"
  42525. // },
  42526. // "response": {
  42527. // "$ref": "TargetingTemplate"
  42528. // },
  42529. // "scopes": [
  42530. // "https://www.googleapis.com/auth/dfatrafficking"
  42531. // ]
  42532. // }
  42533. }
  42534. // method id "dfareporting.targetingTemplates.list":
  42535. type TargetingTemplatesListCall struct {
  42536. s *Service
  42537. profileId int64
  42538. urlParams_ gensupport.URLParams
  42539. ifNoneMatch_ string
  42540. ctx_ context.Context
  42541. header_ http.Header
  42542. }
  42543. // List: Retrieves a list of targeting templates, optionally filtered.
  42544. // This method supports paging.
  42545. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  42546. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42547. c.profileId = profileId
  42548. return c
  42549. }
  42550. // AdvertiserId sets the optional parameter "advertiserId": Select only
  42551. // targeting templates with this advertiser ID.
  42552. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  42553. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42554. return c
  42555. }
  42556. // Ids sets the optional parameter "ids": Select only targeting
  42557. // templates with these IDs.
  42558. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  42559. var ids_ []string
  42560. for _, v := range ids {
  42561. ids_ = append(ids_, fmt.Sprint(v))
  42562. }
  42563. c.urlParams_.SetMulti("ids", ids_)
  42564. return c
  42565. }
  42566. // MaxResults sets the optional parameter "maxResults": Maximum number
  42567. // of results to return.
  42568. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  42569. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42570. return c
  42571. }
  42572. // PageToken sets the optional parameter "pageToken": Value of the
  42573. // nextPageToken from the previous result page.
  42574. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  42575. c.urlParams_.Set("pageToken", pageToken)
  42576. return c
  42577. }
  42578. // SearchString sets the optional parameter "searchString": Allows
  42579. // searching for objects by name or ID. Wildcards (*) are allowed. For
  42580. // example, "template*2015" will return objects with names like
  42581. // "template June 2015", "template April 2015", or simply "template
  42582. // 2015". Most of the searches also add wildcards implicitly at the
  42583. // start and the end of the search string. For example, a search string
  42584. // of "template" will match objects with name "my template", "template
  42585. // 2015", or simply "template".
  42586. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  42587. c.urlParams_.Set("searchString", searchString)
  42588. return c
  42589. }
  42590. // SortField sets the optional parameter "sortField": Field by which to
  42591. // sort the list.
  42592. //
  42593. // Possible values:
  42594. // "ID" (default)
  42595. // "NAME"
  42596. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  42597. c.urlParams_.Set("sortField", sortField)
  42598. return c
  42599. }
  42600. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42601. // results.
  42602. //
  42603. // Possible values:
  42604. // "ASCENDING" (default)
  42605. // "DESCENDING"
  42606. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  42607. c.urlParams_.Set("sortOrder", sortOrder)
  42608. return c
  42609. }
  42610. // Fields allows partial responses to be retrieved. See
  42611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42612. // for more information.
  42613. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  42614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42615. return c
  42616. }
  42617. // IfNoneMatch sets the optional parameter which makes the operation
  42618. // fail if the object's ETag matches the given value. This is useful for
  42619. // getting updates only after the object has changed since the last
  42620. // request. Use googleapi.IsNotModified to check whether the response
  42621. // error from Do is the result of In-None-Match.
  42622. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  42623. c.ifNoneMatch_ = entityTag
  42624. return c
  42625. }
  42626. // Context sets the context to be used in this call's Do method. Any
  42627. // pending HTTP request will be aborted if the provided context is
  42628. // canceled.
  42629. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  42630. c.ctx_ = ctx
  42631. return c
  42632. }
  42633. // Header returns an http.Header that can be modified by the caller to
  42634. // add HTTP headers to the request.
  42635. func (c *TargetingTemplatesListCall) Header() http.Header {
  42636. if c.header_ == nil {
  42637. c.header_ = make(http.Header)
  42638. }
  42639. return c.header_
  42640. }
  42641. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  42642. reqHeaders := make(http.Header)
  42643. for k, v := range c.header_ {
  42644. reqHeaders[k] = v
  42645. }
  42646. reqHeaders.Set("User-Agent", c.s.userAgent())
  42647. if c.ifNoneMatch_ != "" {
  42648. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42649. }
  42650. var body io.Reader = nil
  42651. c.urlParams_.Set("alt", alt)
  42652. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42653. urls += "?" + c.urlParams_.Encode()
  42654. req, _ := http.NewRequest("GET", urls, body)
  42655. req.Header = reqHeaders
  42656. googleapi.Expand(req.URL, map[string]string{
  42657. "profileId": strconv.FormatInt(c.profileId, 10),
  42658. })
  42659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42660. }
  42661. // Do executes the "dfareporting.targetingTemplates.list" call.
  42662. // Exactly one of *TargetingTemplatesListResponse or error will be
  42663. // non-nil. Any non-2xx status code is an error. Response headers are in
  42664. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  42665. // response was returned at all) in error.(*googleapi.Error).Header. Use
  42666. // googleapi.IsNotModified to check whether the returned error was
  42667. // because http.StatusNotModified was returned.
  42668. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  42669. gensupport.SetOptions(c.urlParams_, opts...)
  42670. res, err := c.doRequest("json")
  42671. if res != nil && res.StatusCode == http.StatusNotModified {
  42672. if res.Body != nil {
  42673. res.Body.Close()
  42674. }
  42675. return nil, &googleapi.Error{
  42676. Code: res.StatusCode,
  42677. Header: res.Header,
  42678. }
  42679. }
  42680. if err != nil {
  42681. return nil, err
  42682. }
  42683. defer googleapi.CloseBody(res)
  42684. if err := googleapi.CheckResponse(res); err != nil {
  42685. return nil, err
  42686. }
  42687. ret := &TargetingTemplatesListResponse{
  42688. ServerResponse: googleapi.ServerResponse{
  42689. Header: res.Header,
  42690. HTTPStatusCode: res.StatusCode,
  42691. },
  42692. }
  42693. target := &ret
  42694. if err := gensupport.DecodeResponse(target, res); err != nil {
  42695. return nil, err
  42696. }
  42697. return ret, nil
  42698. // {
  42699. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  42700. // "httpMethod": "GET",
  42701. // "id": "dfareporting.targetingTemplates.list",
  42702. // "parameterOrder": [
  42703. // "profileId"
  42704. // ],
  42705. // "parameters": {
  42706. // "advertiserId": {
  42707. // "description": "Select only targeting templates with this advertiser ID.",
  42708. // "format": "int64",
  42709. // "location": "query",
  42710. // "type": "string"
  42711. // },
  42712. // "ids": {
  42713. // "description": "Select only targeting templates with these IDs.",
  42714. // "format": "int64",
  42715. // "location": "query",
  42716. // "repeated": true,
  42717. // "type": "string"
  42718. // },
  42719. // "maxResults": {
  42720. // "default": "1000",
  42721. // "description": "Maximum number of results to return.",
  42722. // "format": "int32",
  42723. // "location": "query",
  42724. // "maximum": "1000",
  42725. // "minimum": "0",
  42726. // "type": "integer"
  42727. // },
  42728. // "pageToken": {
  42729. // "description": "Value of the nextPageToken from the previous result page.",
  42730. // "location": "query",
  42731. // "type": "string"
  42732. // },
  42733. // "profileId": {
  42734. // "description": "User profile ID associated with this request.",
  42735. // "format": "int64",
  42736. // "location": "path",
  42737. // "required": true,
  42738. // "type": "string"
  42739. // },
  42740. // "searchString": {
  42741. // "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\".",
  42742. // "location": "query",
  42743. // "type": "string"
  42744. // },
  42745. // "sortField": {
  42746. // "default": "ID",
  42747. // "description": "Field by which to sort the list.",
  42748. // "enum": [
  42749. // "ID",
  42750. // "NAME"
  42751. // ],
  42752. // "enumDescriptions": [
  42753. // "",
  42754. // ""
  42755. // ],
  42756. // "location": "query",
  42757. // "type": "string"
  42758. // },
  42759. // "sortOrder": {
  42760. // "default": "ASCENDING",
  42761. // "description": "Order of sorted results.",
  42762. // "enum": [
  42763. // "ASCENDING",
  42764. // "DESCENDING"
  42765. // ],
  42766. // "enumDescriptions": [
  42767. // "",
  42768. // ""
  42769. // ],
  42770. // "location": "query",
  42771. // "type": "string"
  42772. // }
  42773. // },
  42774. // "path": "userprofiles/{profileId}/targetingTemplates",
  42775. // "response": {
  42776. // "$ref": "TargetingTemplatesListResponse"
  42777. // },
  42778. // "scopes": [
  42779. // "https://www.googleapis.com/auth/dfatrafficking"
  42780. // ]
  42781. // }
  42782. }
  42783. // Pages invokes f for each page of results.
  42784. // A non-nil error returned from f will halt the iteration.
  42785. // The provided context supersedes any context provided to the Context method.
  42786. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  42787. c.ctx_ = ctx
  42788. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42789. for {
  42790. x, err := c.Do()
  42791. if err != nil {
  42792. return err
  42793. }
  42794. if err := f(x); err != nil {
  42795. return err
  42796. }
  42797. if x.NextPageToken == "" {
  42798. return nil
  42799. }
  42800. c.PageToken(x.NextPageToken)
  42801. }
  42802. }
  42803. // method id "dfareporting.targetingTemplates.patch":
  42804. type TargetingTemplatesPatchCall struct {
  42805. s *Service
  42806. profileId int64
  42807. targetingtemplate *TargetingTemplate
  42808. urlParams_ gensupport.URLParams
  42809. ctx_ context.Context
  42810. header_ http.Header
  42811. }
  42812. // Patch: Updates an existing targeting template. This method supports
  42813. // patch semantics.
  42814. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  42815. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42816. c.profileId = profileId
  42817. c.urlParams_.Set("id", fmt.Sprint(id))
  42818. c.targetingtemplate = targetingtemplate
  42819. return c
  42820. }
  42821. // Fields allows partial responses to be retrieved. See
  42822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42823. // for more information.
  42824. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  42825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42826. return c
  42827. }
  42828. // Context sets the context to be used in this call's Do method. Any
  42829. // pending HTTP request will be aborted if the provided context is
  42830. // canceled.
  42831. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  42832. c.ctx_ = ctx
  42833. return c
  42834. }
  42835. // Header returns an http.Header that can be modified by the caller to
  42836. // add HTTP headers to the request.
  42837. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  42838. if c.header_ == nil {
  42839. c.header_ = make(http.Header)
  42840. }
  42841. return c.header_
  42842. }
  42843. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  42844. reqHeaders := make(http.Header)
  42845. for k, v := range c.header_ {
  42846. reqHeaders[k] = v
  42847. }
  42848. reqHeaders.Set("User-Agent", c.s.userAgent())
  42849. var body io.Reader = nil
  42850. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42851. if err != nil {
  42852. return nil, err
  42853. }
  42854. reqHeaders.Set("Content-Type", "application/json")
  42855. c.urlParams_.Set("alt", alt)
  42856. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42857. urls += "?" + c.urlParams_.Encode()
  42858. req, _ := http.NewRequest("PATCH", urls, body)
  42859. req.Header = reqHeaders
  42860. googleapi.Expand(req.URL, map[string]string{
  42861. "profileId": strconv.FormatInt(c.profileId, 10),
  42862. })
  42863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42864. }
  42865. // Do executes the "dfareporting.targetingTemplates.patch" call.
  42866. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42867. // non-2xx status code is an error. Response headers are in either
  42868. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42869. // returned at all) in error.(*googleapi.Error).Header. Use
  42870. // googleapi.IsNotModified to check whether the returned error was
  42871. // because http.StatusNotModified was returned.
  42872. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42873. gensupport.SetOptions(c.urlParams_, opts...)
  42874. res, err := c.doRequest("json")
  42875. if res != nil && res.StatusCode == http.StatusNotModified {
  42876. if res.Body != nil {
  42877. res.Body.Close()
  42878. }
  42879. return nil, &googleapi.Error{
  42880. Code: res.StatusCode,
  42881. Header: res.Header,
  42882. }
  42883. }
  42884. if err != nil {
  42885. return nil, err
  42886. }
  42887. defer googleapi.CloseBody(res)
  42888. if err := googleapi.CheckResponse(res); err != nil {
  42889. return nil, err
  42890. }
  42891. ret := &TargetingTemplate{
  42892. ServerResponse: googleapi.ServerResponse{
  42893. Header: res.Header,
  42894. HTTPStatusCode: res.StatusCode,
  42895. },
  42896. }
  42897. target := &ret
  42898. if err := gensupport.DecodeResponse(target, res); err != nil {
  42899. return nil, err
  42900. }
  42901. return ret, nil
  42902. // {
  42903. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  42904. // "httpMethod": "PATCH",
  42905. // "id": "dfareporting.targetingTemplates.patch",
  42906. // "parameterOrder": [
  42907. // "profileId",
  42908. // "id"
  42909. // ],
  42910. // "parameters": {
  42911. // "id": {
  42912. // "description": "Targeting template ID.",
  42913. // "format": "int64",
  42914. // "location": "query",
  42915. // "required": true,
  42916. // "type": "string"
  42917. // },
  42918. // "profileId": {
  42919. // "description": "User profile ID associated with this request.",
  42920. // "format": "int64",
  42921. // "location": "path",
  42922. // "required": true,
  42923. // "type": "string"
  42924. // }
  42925. // },
  42926. // "path": "userprofiles/{profileId}/targetingTemplates",
  42927. // "request": {
  42928. // "$ref": "TargetingTemplate"
  42929. // },
  42930. // "response": {
  42931. // "$ref": "TargetingTemplate"
  42932. // },
  42933. // "scopes": [
  42934. // "https://www.googleapis.com/auth/dfatrafficking"
  42935. // ]
  42936. // }
  42937. }
  42938. // method id "dfareporting.targetingTemplates.update":
  42939. type TargetingTemplatesUpdateCall struct {
  42940. s *Service
  42941. profileId int64
  42942. targetingtemplate *TargetingTemplate
  42943. urlParams_ gensupport.URLParams
  42944. ctx_ context.Context
  42945. header_ http.Header
  42946. }
  42947. // Update: Updates an existing targeting template.
  42948. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  42949. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42950. c.profileId = profileId
  42951. c.targetingtemplate = targetingtemplate
  42952. return c
  42953. }
  42954. // Fields allows partial responses to be retrieved. See
  42955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42956. // for more information.
  42957. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  42958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42959. return c
  42960. }
  42961. // Context sets the context to be used in this call's Do method. Any
  42962. // pending HTTP request will be aborted if the provided context is
  42963. // canceled.
  42964. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  42965. c.ctx_ = ctx
  42966. return c
  42967. }
  42968. // Header returns an http.Header that can be modified by the caller to
  42969. // add HTTP headers to the request.
  42970. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  42971. if c.header_ == nil {
  42972. c.header_ = make(http.Header)
  42973. }
  42974. return c.header_
  42975. }
  42976. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  42977. reqHeaders := make(http.Header)
  42978. for k, v := range c.header_ {
  42979. reqHeaders[k] = v
  42980. }
  42981. reqHeaders.Set("User-Agent", c.s.userAgent())
  42982. var body io.Reader = nil
  42983. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42984. if err != nil {
  42985. return nil, err
  42986. }
  42987. reqHeaders.Set("Content-Type", "application/json")
  42988. c.urlParams_.Set("alt", alt)
  42989. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42990. urls += "?" + c.urlParams_.Encode()
  42991. req, _ := http.NewRequest("PUT", urls, body)
  42992. req.Header = reqHeaders
  42993. googleapi.Expand(req.URL, map[string]string{
  42994. "profileId": strconv.FormatInt(c.profileId, 10),
  42995. })
  42996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42997. }
  42998. // Do executes the "dfareporting.targetingTemplates.update" call.
  42999. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43000. // non-2xx status code is an error. Response headers are in either
  43001. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43002. // returned at all) in error.(*googleapi.Error).Header. Use
  43003. // googleapi.IsNotModified to check whether the returned error was
  43004. // because http.StatusNotModified was returned.
  43005. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43006. gensupport.SetOptions(c.urlParams_, opts...)
  43007. res, err := c.doRequest("json")
  43008. if res != nil && res.StatusCode == http.StatusNotModified {
  43009. if res.Body != nil {
  43010. res.Body.Close()
  43011. }
  43012. return nil, &googleapi.Error{
  43013. Code: res.StatusCode,
  43014. Header: res.Header,
  43015. }
  43016. }
  43017. if err != nil {
  43018. return nil, err
  43019. }
  43020. defer googleapi.CloseBody(res)
  43021. if err := googleapi.CheckResponse(res); err != nil {
  43022. return nil, err
  43023. }
  43024. ret := &TargetingTemplate{
  43025. ServerResponse: googleapi.ServerResponse{
  43026. Header: res.Header,
  43027. HTTPStatusCode: res.StatusCode,
  43028. },
  43029. }
  43030. target := &ret
  43031. if err := gensupport.DecodeResponse(target, res); err != nil {
  43032. return nil, err
  43033. }
  43034. return ret, nil
  43035. // {
  43036. // "description": "Updates an existing targeting template.",
  43037. // "httpMethod": "PUT",
  43038. // "id": "dfareporting.targetingTemplates.update",
  43039. // "parameterOrder": [
  43040. // "profileId"
  43041. // ],
  43042. // "parameters": {
  43043. // "profileId": {
  43044. // "description": "User profile ID associated with this request.",
  43045. // "format": "int64",
  43046. // "location": "path",
  43047. // "required": true,
  43048. // "type": "string"
  43049. // }
  43050. // },
  43051. // "path": "userprofiles/{profileId}/targetingTemplates",
  43052. // "request": {
  43053. // "$ref": "TargetingTemplate"
  43054. // },
  43055. // "response": {
  43056. // "$ref": "TargetingTemplate"
  43057. // },
  43058. // "scopes": [
  43059. // "https://www.googleapis.com/auth/dfatrafficking"
  43060. // ]
  43061. // }
  43062. }
  43063. // method id "dfareporting.userProfiles.get":
  43064. type UserProfilesGetCall struct {
  43065. s *Service
  43066. profileId int64
  43067. urlParams_ gensupport.URLParams
  43068. ifNoneMatch_ string
  43069. ctx_ context.Context
  43070. header_ http.Header
  43071. }
  43072. // Get: Gets one user profile by ID.
  43073. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  43074. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43075. c.profileId = profileId
  43076. return c
  43077. }
  43078. // Fields allows partial responses to be retrieved. See
  43079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43080. // for more information.
  43081. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  43082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43083. return c
  43084. }
  43085. // IfNoneMatch sets the optional parameter which makes the operation
  43086. // fail if the object's ETag matches the given value. This is useful for
  43087. // getting updates only after the object has changed since the last
  43088. // request. Use googleapi.IsNotModified to check whether the response
  43089. // error from Do is the result of In-None-Match.
  43090. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  43091. c.ifNoneMatch_ = entityTag
  43092. return c
  43093. }
  43094. // Context sets the context to be used in this call's Do method. Any
  43095. // pending HTTP request will be aborted if the provided context is
  43096. // canceled.
  43097. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  43098. c.ctx_ = ctx
  43099. return c
  43100. }
  43101. // Header returns an http.Header that can be modified by the caller to
  43102. // add HTTP headers to the request.
  43103. func (c *UserProfilesGetCall) Header() http.Header {
  43104. if c.header_ == nil {
  43105. c.header_ = make(http.Header)
  43106. }
  43107. return c.header_
  43108. }
  43109. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  43110. reqHeaders := make(http.Header)
  43111. for k, v := range c.header_ {
  43112. reqHeaders[k] = v
  43113. }
  43114. reqHeaders.Set("User-Agent", c.s.userAgent())
  43115. if c.ifNoneMatch_ != "" {
  43116. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43117. }
  43118. var body io.Reader = nil
  43119. c.urlParams_.Set("alt", alt)
  43120. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  43121. urls += "?" + c.urlParams_.Encode()
  43122. req, _ := http.NewRequest("GET", urls, body)
  43123. req.Header = reqHeaders
  43124. googleapi.Expand(req.URL, map[string]string{
  43125. "profileId": strconv.FormatInt(c.profileId, 10),
  43126. })
  43127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43128. }
  43129. // Do executes the "dfareporting.userProfiles.get" call.
  43130. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  43131. // status code is an error. Response headers are in either
  43132. // *UserProfile.ServerResponse.Header or (if a response was returned at
  43133. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43134. // to check whether the returned error was because
  43135. // http.StatusNotModified was returned.
  43136. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  43137. gensupport.SetOptions(c.urlParams_, opts...)
  43138. res, err := c.doRequest("json")
  43139. if res != nil && res.StatusCode == http.StatusNotModified {
  43140. if res.Body != nil {
  43141. res.Body.Close()
  43142. }
  43143. return nil, &googleapi.Error{
  43144. Code: res.StatusCode,
  43145. Header: res.Header,
  43146. }
  43147. }
  43148. if err != nil {
  43149. return nil, err
  43150. }
  43151. defer googleapi.CloseBody(res)
  43152. if err := googleapi.CheckResponse(res); err != nil {
  43153. return nil, err
  43154. }
  43155. ret := &UserProfile{
  43156. ServerResponse: googleapi.ServerResponse{
  43157. Header: res.Header,
  43158. HTTPStatusCode: res.StatusCode,
  43159. },
  43160. }
  43161. target := &ret
  43162. if err := gensupport.DecodeResponse(target, res); err != nil {
  43163. return nil, err
  43164. }
  43165. return ret, nil
  43166. // {
  43167. // "description": "Gets one user profile by ID.",
  43168. // "httpMethod": "GET",
  43169. // "id": "dfareporting.userProfiles.get",
  43170. // "parameterOrder": [
  43171. // "profileId"
  43172. // ],
  43173. // "parameters": {
  43174. // "profileId": {
  43175. // "description": "The user profile ID.",
  43176. // "format": "int64",
  43177. // "location": "path",
  43178. // "required": true,
  43179. // "type": "string"
  43180. // }
  43181. // },
  43182. // "path": "userprofiles/{profileId}",
  43183. // "response": {
  43184. // "$ref": "UserProfile"
  43185. // },
  43186. // "scopes": [
  43187. // "https://www.googleapis.com/auth/dfareporting",
  43188. // "https://www.googleapis.com/auth/dfatrafficking"
  43189. // ]
  43190. // }
  43191. }
  43192. // method id "dfareporting.userProfiles.list":
  43193. type UserProfilesListCall struct {
  43194. s *Service
  43195. urlParams_ gensupport.URLParams
  43196. ifNoneMatch_ string
  43197. ctx_ context.Context
  43198. header_ http.Header
  43199. }
  43200. // List: Retrieves list of user profiles for a user.
  43201. func (r *UserProfilesService) List() *UserProfilesListCall {
  43202. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43203. return c
  43204. }
  43205. // Fields allows partial responses to be retrieved. See
  43206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43207. // for more information.
  43208. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  43209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43210. return c
  43211. }
  43212. // IfNoneMatch sets the optional parameter which makes the operation
  43213. // fail if the object's ETag matches the given value. This is useful for
  43214. // getting updates only after the object has changed since the last
  43215. // request. Use googleapi.IsNotModified to check whether the response
  43216. // error from Do is the result of In-None-Match.
  43217. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  43218. c.ifNoneMatch_ = entityTag
  43219. return c
  43220. }
  43221. // Context sets the context to be used in this call's Do method. Any
  43222. // pending HTTP request will be aborted if the provided context is
  43223. // canceled.
  43224. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  43225. c.ctx_ = ctx
  43226. return c
  43227. }
  43228. // Header returns an http.Header that can be modified by the caller to
  43229. // add HTTP headers to the request.
  43230. func (c *UserProfilesListCall) Header() http.Header {
  43231. if c.header_ == nil {
  43232. c.header_ = make(http.Header)
  43233. }
  43234. return c.header_
  43235. }
  43236. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  43237. reqHeaders := make(http.Header)
  43238. for k, v := range c.header_ {
  43239. reqHeaders[k] = v
  43240. }
  43241. reqHeaders.Set("User-Agent", c.s.userAgent())
  43242. if c.ifNoneMatch_ != "" {
  43243. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43244. }
  43245. var body io.Reader = nil
  43246. c.urlParams_.Set("alt", alt)
  43247. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  43248. urls += "?" + c.urlParams_.Encode()
  43249. req, _ := http.NewRequest("GET", urls, body)
  43250. req.Header = reqHeaders
  43251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43252. }
  43253. // Do executes the "dfareporting.userProfiles.list" call.
  43254. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  43255. // status code is an error. Response headers are in either
  43256. // *UserProfileList.ServerResponse.Header or (if a response was returned
  43257. // at all) in error.(*googleapi.Error).Header. Use
  43258. // googleapi.IsNotModified to check whether the returned error was
  43259. // because http.StatusNotModified was returned.
  43260. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  43261. gensupport.SetOptions(c.urlParams_, opts...)
  43262. res, err := c.doRequest("json")
  43263. if res != nil && res.StatusCode == http.StatusNotModified {
  43264. if res.Body != nil {
  43265. res.Body.Close()
  43266. }
  43267. return nil, &googleapi.Error{
  43268. Code: res.StatusCode,
  43269. Header: res.Header,
  43270. }
  43271. }
  43272. if err != nil {
  43273. return nil, err
  43274. }
  43275. defer googleapi.CloseBody(res)
  43276. if err := googleapi.CheckResponse(res); err != nil {
  43277. return nil, err
  43278. }
  43279. ret := &UserProfileList{
  43280. ServerResponse: googleapi.ServerResponse{
  43281. Header: res.Header,
  43282. HTTPStatusCode: res.StatusCode,
  43283. },
  43284. }
  43285. target := &ret
  43286. if err := gensupport.DecodeResponse(target, res); err != nil {
  43287. return nil, err
  43288. }
  43289. return ret, nil
  43290. // {
  43291. // "description": "Retrieves list of user profiles for a user.",
  43292. // "httpMethod": "GET",
  43293. // "id": "dfareporting.userProfiles.list",
  43294. // "path": "userprofiles",
  43295. // "response": {
  43296. // "$ref": "UserProfileList"
  43297. // },
  43298. // "scopes": [
  43299. // "https://www.googleapis.com/auth/dfareporting",
  43300. // "https://www.googleapis.com/auth/dfatrafficking"
  43301. // ]
  43302. // }
  43303. }
  43304. // method id "dfareporting.userRolePermissionGroups.get":
  43305. type UserRolePermissionGroupsGetCall struct {
  43306. s *Service
  43307. profileId int64
  43308. id int64
  43309. urlParams_ gensupport.URLParams
  43310. ifNoneMatch_ string
  43311. ctx_ context.Context
  43312. header_ http.Header
  43313. }
  43314. // Get: Gets one user role permission group by ID.
  43315. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  43316. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43317. c.profileId = profileId
  43318. c.id = id
  43319. return c
  43320. }
  43321. // Fields allows partial responses to be retrieved. See
  43322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43323. // for more information.
  43324. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  43325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43326. return c
  43327. }
  43328. // IfNoneMatch sets the optional parameter which makes the operation
  43329. // fail if the object's ETag matches the given value. This is useful for
  43330. // getting updates only after the object has changed since the last
  43331. // request. Use googleapi.IsNotModified to check whether the response
  43332. // error from Do is the result of In-None-Match.
  43333. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  43334. c.ifNoneMatch_ = entityTag
  43335. return c
  43336. }
  43337. // Context sets the context to be used in this call's Do method. Any
  43338. // pending HTTP request will be aborted if the provided context is
  43339. // canceled.
  43340. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  43341. c.ctx_ = ctx
  43342. return c
  43343. }
  43344. // Header returns an http.Header that can be modified by the caller to
  43345. // add HTTP headers to the request.
  43346. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  43347. if c.header_ == nil {
  43348. c.header_ = make(http.Header)
  43349. }
  43350. return c.header_
  43351. }
  43352. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  43353. reqHeaders := make(http.Header)
  43354. for k, v := range c.header_ {
  43355. reqHeaders[k] = v
  43356. }
  43357. reqHeaders.Set("User-Agent", c.s.userAgent())
  43358. if c.ifNoneMatch_ != "" {
  43359. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43360. }
  43361. var body io.Reader = nil
  43362. c.urlParams_.Set("alt", alt)
  43363. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  43364. urls += "?" + c.urlParams_.Encode()
  43365. req, _ := http.NewRequest("GET", urls, body)
  43366. req.Header = reqHeaders
  43367. googleapi.Expand(req.URL, map[string]string{
  43368. "profileId": strconv.FormatInt(c.profileId, 10),
  43369. "id": strconv.FormatInt(c.id, 10),
  43370. })
  43371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43372. }
  43373. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  43374. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  43375. // non-2xx status code is an error. Response headers are in either
  43376. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  43377. // returned at all) in error.(*googleapi.Error).Header. Use
  43378. // googleapi.IsNotModified to check whether the returned error was
  43379. // because http.StatusNotModified was returned.
  43380. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  43381. gensupport.SetOptions(c.urlParams_, opts...)
  43382. res, err := c.doRequest("json")
  43383. if res != nil && res.StatusCode == http.StatusNotModified {
  43384. if res.Body != nil {
  43385. res.Body.Close()
  43386. }
  43387. return nil, &googleapi.Error{
  43388. Code: res.StatusCode,
  43389. Header: res.Header,
  43390. }
  43391. }
  43392. if err != nil {
  43393. return nil, err
  43394. }
  43395. defer googleapi.CloseBody(res)
  43396. if err := googleapi.CheckResponse(res); err != nil {
  43397. return nil, err
  43398. }
  43399. ret := &UserRolePermissionGroup{
  43400. ServerResponse: googleapi.ServerResponse{
  43401. Header: res.Header,
  43402. HTTPStatusCode: res.StatusCode,
  43403. },
  43404. }
  43405. target := &ret
  43406. if err := gensupport.DecodeResponse(target, res); err != nil {
  43407. return nil, err
  43408. }
  43409. return ret, nil
  43410. // {
  43411. // "description": "Gets one user role permission group by ID.",
  43412. // "httpMethod": "GET",
  43413. // "id": "dfareporting.userRolePermissionGroups.get",
  43414. // "parameterOrder": [
  43415. // "profileId",
  43416. // "id"
  43417. // ],
  43418. // "parameters": {
  43419. // "id": {
  43420. // "description": "User role permission group ID.",
  43421. // "format": "int64",
  43422. // "location": "path",
  43423. // "required": true,
  43424. // "type": "string"
  43425. // },
  43426. // "profileId": {
  43427. // "description": "User profile ID associated with this request.",
  43428. // "format": "int64",
  43429. // "location": "path",
  43430. // "required": true,
  43431. // "type": "string"
  43432. // }
  43433. // },
  43434. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  43435. // "response": {
  43436. // "$ref": "UserRolePermissionGroup"
  43437. // },
  43438. // "scopes": [
  43439. // "https://www.googleapis.com/auth/dfatrafficking"
  43440. // ]
  43441. // }
  43442. }
  43443. // method id "dfareporting.userRolePermissionGroups.list":
  43444. type UserRolePermissionGroupsListCall struct {
  43445. s *Service
  43446. profileId int64
  43447. urlParams_ gensupport.URLParams
  43448. ifNoneMatch_ string
  43449. ctx_ context.Context
  43450. header_ http.Header
  43451. }
  43452. // List: Gets a list of all supported user role permission groups.
  43453. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  43454. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43455. c.profileId = profileId
  43456. return c
  43457. }
  43458. // Fields allows partial responses to be retrieved. See
  43459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43460. // for more information.
  43461. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  43462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43463. return c
  43464. }
  43465. // IfNoneMatch sets the optional parameter which makes the operation
  43466. // fail if the object's ETag matches the given value. This is useful for
  43467. // getting updates only after the object has changed since the last
  43468. // request. Use googleapi.IsNotModified to check whether the response
  43469. // error from Do is the result of In-None-Match.
  43470. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  43471. c.ifNoneMatch_ = entityTag
  43472. return c
  43473. }
  43474. // Context sets the context to be used in this call's Do method. Any
  43475. // pending HTTP request will be aborted if the provided context is
  43476. // canceled.
  43477. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  43478. c.ctx_ = ctx
  43479. return c
  43480. }
  43481. // Header returns an http.Header that can be modified by the caller to
  43482. // add HTTP headers to the request.
  43483. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  43484. if c.header_ == nil {
  43485. c.header_ = make(http.Header)
  43486. }
  43487. return c.header_
  43488. }
  43489. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  43490. reqHeaders := make(http.Header)
  43491. for k, v := range c.header_ {
  43492. reqHeaders[k] = v
  43493. }
  43494. reqHeaders.Set("User-Agent", c.s.userAgent())
  43495. if c.ifNoneMatch_ != "" {
  43496. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43497. }
  43498. var body io.Reader = nil
  43499. c.urlParams_.Set("alt", alt)
  43500. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  43501. urls += "?" + c.urlParams_.Encode()
  43502. req, _ := http.NewRequest("GET", urls, body)
  43503. req.Header = reqHeaders
  43504. googleapi.Expand(req.URL, map[string]string{
  43505. "profileId": strconv.FormatInt(c.profileId, 10),
  43506. })
  43507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43508. }
  43509. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  43510. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  43511. // non-nil. Any non-2xx status code is an error. Response headers are in
  43512. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  43513. // (if a response was returned at all) in
  43514. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  43515. // whether the returned error was because http.StatusNotModified was
  43516. // returned.
  43517. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  43518. gensupport.SetOptions(c.urlParams_, opts...)
  43519. res, err := c.doRequest("json")
  43520. if res != nil && res.StatusCode == http.StatusNotModified {
  43521. if res.Body != nil {
  43522. res.Body.Close()
  43523. }
  43524. return nil, &googleapi.Error{
  43525. Code: res.StatusCode,
  43526. Header: res.Header,
  43527. }
  43528. }
  43529. if err != nil {
  43530. return nil, err
  43531. }
  43532. defer googleapi.CloseBody(res)
  43533. if err := googleapi.CheckResponse(res); err != nil {
  43534. return nil, err
  43535. }
  43536. ret := &UserRolePermissionGroupsListResponse{
  43537. ServerResponse: googleapi.ServerResponse{
  43538. Header: res.Header,
  43539. HTTPStatusCode: res.StatusCode,
  43540. },
  43541. }
  43542. target := &ret
  43543. if err := gensupport.DecodeResponse(target, res); err != nil {
  43544. return nil, err
  43545. }
  43546. return ret, nil
  43547. // {
  43548. // "description": "Gets a list of all supported user role permission groups.",
  43549. // "httpMethod": "GET",
  43550. // "id": "dfareporting.userRolePermissionGroups.list",
  43551. // "parameterOrder": [
  43552. // "profileId"
  43553. // ],
  43554. // "parameters": {
  43555. // "profileId": {
  43556. // "description": "User profile ID associated with this request.",
  43557. // "format": "int64",
  43558. // "location": "path",
  43559. // "required": true,
  43560. // "type": "string"
  43561. // }
  43562. // },
  43563. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  43564. // "response": {
  43565. // "$ref": "UserRolePermissionGroupsListResponse"
  43566. // },
  43567. // "scopes": [
  43568. // "https://www.googleapis.com/auth/dfatrafficking"
  43569. // ]
  43570. // }
  43571. }
  43572. // method id "dfareporting.userRolePermissions.get":
  43573. type UserRolePermissionsGetCall struct {
  43574. s *Service
  43575. profileId int64
  43576. id int64
  43577. urlParams_ gensupport.URLParams
  43578. ifNoneMatch_ string
  43579. ctx_ context.Context
  43580. header_ http.Header
  43581. }
  43582. // Get: Gets one user role permission by ID.
  43583. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  43584. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43585. c.profileId = profileId
  43586. c.id = id
  43587. return c
  43588. }
  43589. // Fields allows partial responses to be retrieved. See
  43590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43591. // for more information.
  43592. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  43593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43594. return c
  43595. }
  43596. // IfNoneMatch sets the optional parameter which makes the operation
  43597. // fail if the object's ETag matches the given value. This is useful for
  43598. // getting updates only after the object has changed since the last
  43599. // request. Use googleapi.IsNotModified to check whether the response
  43600. // error from Do is the result of In-None-Match.
  43601. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  43602. c.ifNoneMatch_ = entityTag
  43603. return c
  43604. }
  43605. // Context sets the context to be used in this call's Do method. Any
  43606. // pending HTTP request will be aborted if the provided context is
  43607. // canceled.
  43608. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  43609. c.ctx_ = ctx
  43610. return c
  43611. }
  43612. // Header returns an http.Header that can be modified by the caller to
  43613. // add HTTP headers to the request.
  43614. func (c *UserRolePermissionsGetCall) Header() http.Header {
  43615. if c.header_ == nil {
  43616. c.header_ = make(http.Header)
  43617. }
  43618. return c.header_
  43619. }
  43620. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  43621. reqHeaders := make(http.Header)
  43622. for k, v := range c.header_ {
  43623. reqHeaders[k] = v
  43624. }
  43625. reqHeaders.Set("User-Agent", c.s.userAgent())
  43626. if c.ifNoneMatch_ != "" {
  43627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43628. }
  43629. var body io.Reader = nil
  43630. c.urlParams_.Set("alt", alt)
  43631. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  43632. urls += "?" + c.urlParams_.Encode()
  43633. req, _ := http.NewRequest("GET", urls, body)
  43634. req.Header = reqHeaders
  43635. googleapi.Expand(req.URL, map[string]string{
  43636. "profileId": strconv.FormatInt(c.profileId, 10),
  43637. "id": strconv.FormatInt(c.id, 10),
  43638. })
  43639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43640. }
  43641. // Do executes the "dfareporting.userRolePermissions.get" call.
  43642. // Exactly one of *UserRolePermission or error will be non-nil. Any
  43643. // non-2xx status code is an error. Response headers are in either
  43644. // *UserRolePermission.ServerResponse.Header or (if a response was
  43645. // returned at all) in error.(*googleapi.Error).Header. Use
  43646. // googleapi.IsNotModified to check whether the returned error was
  43647. // because http.StatusNotModified was returned.
  43648. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  43649. gensupport.SetOptions(c.urlParams_, opts...)
  43650. res, err := c.doRequest("json")
  43651. if res != nil && res.StatusCode == http.StatusNotModified {
  43652. if res.Body != nil {
  43653. res.Body.Close()
  43654. }
  43655. return nil, &googleapi.Error{
  43656. Code: res.StatusCode,
  43657. Header: res.Header,
  43658. }
  43659. }
  43660. if err != nil {
  43661. return nil, err
  43662. }
  43663. defer googleapi.CloseBody(res)
  43664. if err := googleapi.CheckResponse(res); err != nil {
  43665. return nil, err
  43666. }
  43667. ret := &UserRolePermission{
  43668. ServerResponse: googleapi.ServerResponse{
  43669. Header: res.Header,
  43670. HTTPStatusCode: res.StatusCode,
  43671. },
  43672. }
  43673. target := &ret
  43674. if err := gensupport.DecodeResponse(target, res); err != nil {
  43675. return nil, err
  43676. }
  43677. return ret, nil
  43678. // {
  43679. // "description": "Gets one user role permission by ID.",
  43680. // "httpMethod": "GET",
  43681. // "id": "dfareporting.userRolePermissions.get",
  43682. // "parameterOrder": [
  43683. // "profileId",
  43684. // "id"
  43685. // ],
  43686. // "parameters": {
  43687. // "id": {
  43688. // "description": "User role permission ID.",
  43689. // "format": "int64",
  43690. // "location": "path",
  43691. // "required": true,
  43692. // "type": "string"
  43693. // },
  43694. // "profileId": {
  43695. // "description": "User profile ID associated with this request.",
  43696. // "format": "int64",
  43697. // "location": "path",
  43698. // "required": true,
  43699. // "type": "string"
  43700. // }
  43701. // },
  43702. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  43703. // "response": {
  43704. // "$ref": "UserRolePermission"
  43705. // },
  43706. // "scopes": [
  43707. // "https://www.googleapis.com/auth/dfatrafficking"
  43708. // ]
  43709. // }
  43710. }
  43711. // method id "dfareporting.userRolePermissions.list":
  43712. type UserRolePermissionsListCall struct {
  43713. s *Service
  43714. profileId int64
  43715. urlParams_ gensupport.URLParams
  43716. ifNoneMatch_ string
  43717. ctx_ context.Context
  43718. header_ http.Header
  43719. }
  43720. // List: Gets a list of user role permissions, possibly filtered.
  43721. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  43722. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43723. c.profileId = profileId
  43724. return c
  43725. }
  43726. // Ids sets the optional parameter "ids": Select only user role
  43727. // permissions with these IDs.
  43728. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  43729. var ids_ []string
  43730. for _, v := range ids {
  43731. ids_ = append(ids_, fmt.Sprint(v))
  43732. }
  43733. c.urlParams_.SetMulti("ids", ids_)
  43734. return c
  43735. }
  43736. // Fields allows partial responses to be retrieved. See
  43737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43738. // for more information.
  43739. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  43740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43741. return c
  43742. }
  43743. // IfNoneMatch sets the optional parameter which makes the operation
  43744. // fail if the object's ETag matches the given value. This is useful for
  43745. // getting updates only after the object has changed since the last
  43746. // request. Use googleapi.IsNotModified to check whether the response
  43747. // error from Do is the result of In-None-Match.
  43748. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  43749. c.ifNoneMatch_ = entityTag
  43750. return c
  43751. }
  43752. // Context sets the context to be used in this call's Do method. Any
  43753. // pending HTTP request will be aborted if the provided context is
  43754. // canceled.
  43755. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  43756. c.ctx_ = ctx
  43757. return c
  43758. }
  43759. // Header returns an http.Header that can be modified by the caller to
  43760. // add HTTP headers to the request.
  43761. func (c *UserRolePermissionsListCall) Header() http.Header {
  43762. if c.header_ == nil {
  43763. c.header_ = make(http.Header)
  43764. }
  43765. return c.header_
  43766. }
  43767. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  43768. reqHeaders := make(http.Header)
  43769. for k, v := range c.header_ {
  43770. reqHeaders[k] = v
  43771. }
  43772. reqHeaders.Set("User-Agent", c.s.userAgent())
  43773. if c.ifNoneMatch_ != "" {
  43774. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43775. }
  43776. var body io.Reader = nil
  43777. c.urlParams_.Set("alt", alt)
  43778. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  43779. urls += "?" + c.urlParams_.Encode()
  43780. req, _ := http.NewRequest("GET", urls, body)
  43781. req.Header = reqHeaders
  43782. googleapi.Expand(req.URL, map[string]string{
  43783. "profileId": strconv.FormatInt(c.profileId, 10),
  43784. })
  43785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43786. }
  43787. // Do executes the "dfareporting.userRolePermissions.list" call.
  43788. // Exactly one of *UserRolePermissionsListResponse or error will be
  43789. // non-nil. Any non-2xx status code is an error. Response headers are in
  43790. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  43791. // a response was returned at all) in error.(*googleapi.Error).Header.
  43792. // Use googleapi.IsNotModified to check whether the returned error was
  43793. // because http.StatusNotModified was returned.
  43794. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  43795. gensupport.SetOptions(c.urlParams_, opts...)
  43796. res, err := c.doRequest("json")
  43797. if res != nil && res.StatusCode == http.StatusNotModified {
  43798. if res.Body != nil {
  43799. res.Body.Close()
  43800. }
  43801. return nil, &googleapi.Error{
  43802. Code: res.StatusCode,
  43803. Header: res.Header,
  43804. }
  43805. }
  43806. if err != nil {
  43807. return nil, err
  43808. }
  43809. defer googleapi.CloseBody(res)
  43810. if err := googleapi.CheckResponse(res); err != nil {
  43811. return nil, err
  43812. }
  43813. ret := &UserRolePermissionsListResponse{
  43814. ServerResponse: googleapi.ServerResponse{
  43815. Header: res.Header,
  43816. HTTPStatusCode: res.StatusCode,
  43817. },
  43818. }
  43819. target := &ret
  43820. if err := gensupport.DecodeResponse(target, res); err != nil {
  43821. return nil, err
  43822. }
  43823. return ret, nil
  43824. // {
  43825. // "description": "Gets a list of user role permissions, possibly filtered.",
  43826. // "httpMethod": "GET",
  43827. // "id": "dfareporting.userRolePermissions.list",
  43828. // "parameterOrder": [
  43829. // "profileId"
  43830. // ],
  43831. // "parameters": {
  43832. // "ids": {
  43833. // "description": "Select only user role permissions with these IDs.",
  43834. // "format": "int64",
  43835. // "location": "query",
  43836. // "repeated": true,
  43837. // "type": "string"
  43838. // },
  43839. // "profileId": {
  43840. // "description": "User profile ID associated with this request.",
  43841. // "format": "int64",
  43842. // "location": "path",
  43843. // "required": true,
  43844. // "type": "string"
  43845. // }
  43846. // },
  43847. // "path": "userprofiles/{profileId}/userRolePermissions",
  43848. // "response": {
  43849. // "$ref": "UserRolePermissionsListResponse"
  43850. // },
  43851. // "scopes": [
  43852. // "https://www.googleapis.com/auth/dfatrafficking"
  43853. // ]
  43854. // }
  43855. }
  43856. // method id "dfareporting.userRoles.delete":
  43857. type UserRolesDeleteCall struct {
  43858. s *Service
  43859. profileId int64
  43860. id int64
  43861. urlParams_ gensupport.URLParams
  43862. ctx_ context.Context
  43863. header_ http.Header
  43864. }
  43865. // Delete: Deletes an existing user role.
  43866. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  43867. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43868. c.profileId = profileId
  43869. c.id = id
  43870. return c
  43871. }
  43872. // Fields allows partial responses to be retrieved. See
  43873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43874. // for more information.
  43875. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  43876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43877. return c
  43878. }
  43879. // Context sets the context to be used in this call's Do method. Any
  43880. // pending HTTP request will be aborted if the provided context is
  43881. // canceled.
  43882. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  43883. c.ctx_ = ctx
  43884. return c
  43885. }
  43886. // Header returns an http.Header that can be modified by the caller to
  43887. // add HTTP headers to the request.
  43888. func (c *UserRolesDeleteCall) Header() http.Header {
  43889. if c.header_ == nil {
  43890. c.header_ = make(http.Header)
  43891. }
  43892. return c.header_
  43893. }
  43894. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  43895. reqHeaders := make(http.Header)
  43896. for k, v := range c.header_ {
  43897. reqHeaders[k] = v
  43898. }
  43899. reqHeaders.Set("User-Agent", c.s.userAgent())
  43900. var body io.Reader = nil
  43901. c.urlParams_.Set("alt", alt)
  43902. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  43903. urls += "?" + c.urlParams_.Encode()
  43904. req, _ := http.NewRequest("DELETE", urls, body)
  43905. req.Header = reqHeaders
  43906. googleapi.Expand(req.URL, map[string]string{
  43907. "profileId": strconv.FormatInt(c.profileId, 10),
  43908. "id": strconv.FormatInt(c.id, 10),
  43909. })
  43910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43911. }
  43912. // Do executes the "dfareporting.userRoles.delete" call.
  43913. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  43914. gensupport.SetOptions(c.urlParams_, opts...)
  43915. res, err := c.doRequest("json")
  43916. if err != nil {
  43917. return err
  43918. }
  43919. defer googleapi.CloseBody(res)
  43920. if err := googleapi.CheckResponse(res); err != nil {
  43921. return err
  43922. }
  43923. return nil
  43924. // {
  43925. // "description": "Deletes an existing user role.",
  43926. // "httpMethod": "DELETE",
  43927. // "id": "dfareporting.userRoles.delete",
  43928. // "parameterOrder": [
  43929. // "profileId",
  43930. // "id"
  43931. // ],
  43932. // "parameters": {
  43933. // "id": {
  43934. // "description": "User role ID.",
  43935. // "format": "int64",
  43936. // "location": "path",
  43937. // "required": true,
  43938. // "type": "string"
  43939. // },
  43940. // "profileId": {
  43941. // "description": "User profile ID associated with this request.",
  43942. // "format": "int64",
  43943. // "location": "path",
  43944. // "required": true,
  43945. // "type": "string"
  43946. // }
  43947. // },
  43948. // "path": "userprofiles/{profileId}/userRoles/{id}",
  43949. // "scopes": [
  43950. // "https://www.googleapis.com/auth/dfatrafficking"
  43951. // ]
  43952. // }
  43953. }
  43954. // method id "dfareporting.userRoles.get":
  43955. type UserRolesGetCall struct {
  43956. s *Service
  43957. profileId int64
  43958. id int64
  43959. urlParams_ gensupport.URLParams
  43960. ifNoneMatch_ string
  43961. ctx_ context.Context
  43962. header_ http.Header
  43963. }
  43964. // Get: Gets one user role by ID.
  43965. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  43966. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43967. c.profileId = profileId
  43968. c.id = id
  43969. return c
  43970. }
  43971. // Fields allows partial responses to be retrieved. See
  43972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43973. // for more information.
  43974. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  43975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43976. return c
  43977. }
  43978. // IfNoneMatch sets the optional parameter which makes the operation
  43979. // fail if the object's ETag matches the given value. This is useful for
  43980. // getting updates only after the object has changed since the last
  43981. // request. Use googleapi.IsNotModified to check whether the response
  43982. // error from Do is the result of In-None-Match.
  43983. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  43984. c.ifNoneMatch_ = entityTag
  43985. return c
  43986. }
  43987. // Context sets the context to be used in this call's Do method. Any
  43988. // pending HTTP request will be aborted if the provided context is
  43989. // canceled.
  43990. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  43991. c.ctx_ = ctx
  43992. return c
  43993. }
  43994. // Header returns an http.Header that can be modified by the caller to
  43995. // add HTTP headers to the request.
  43996. func (c *UserRolesGetCall) Header() http.Header {
  43997. if c.header_ == nil {
  43998. c.header_ = make(http.Header)
  43999. }
  44000. return c.header_
  44001. }
  44002. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  44003. reqHeaders := make(http.Header)
  44004. for k, v := range c.header_ {
  44005. reqHeaders[k] = v
  44006. }
  44007. reqHeaders.Set("User-Agent", c.s.userAgent())
  44008. if c.ifNoneMatch_ != "" {
  44009. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44010. }
  44011. var body io.Reader = nil
  44012. c.urlParams_.Set("alt", alt)
  44013. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  44014. urls += "?" + c.urlParams_.Encode()
  44015. req, _ := http.NewRequest("GET", urls, body)
  44016. req.Header = reqHeaders
  44017. googleapi.Expand(req.URL, map[string]string{
  44018. "profileId": strconv.FormatInt(c.profileId, 10),
  44019. "id": strconv.FormatInt(c.id, 10),
  44020. })
  44021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44022. }
  44023. // Do executes the "dfareporting.userRoles.get" call.
  44024. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44025. // code is an error. Response headers are in either
  44026. // *UserRole.ServerResponse.Header or (if a response was returned at
  44027. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44028. // to check whether the returned error was because
  44029. // http.StatusNotModified was returned.
  44030. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44031. gensupport.SetOptions(c.urlParams_, opts...)
  44032. res, err := c.doRequest("json")
  44033. if res != nil && res.StatusCode == http.StatusNotModified {
  44034. if res.Body != nil {
  44035. res.Body.Close()
  44036. }
  44037. return nil, &googleapi.Error{
  44038. Code: res.StatusCode,
  44039. Header: res.Header,
  44040. }
  44041. }
  44042. if err != nil {
  44043. return nil, err
  44044. }
  44045. defer googleapi.CloseBody(res)
  44046. if err := googleapi.CheckResponse(res); err != nil {
  44047. return nil, err
  44048. }
  44049. ret := &UserRole{
  44050. ServerResponse: googleapi.ServerResponse{
  44051. Header: res.Header,
  44052. HTTPStatusCode: res.StatusCode,
  44053. },
  44054. }
  44055. target := &ret
  44056. if err := gensupport.DecodeResponse(target, res); err != nil {
  44057. return nil, err
  44058. }
  44059. return ret, nil
  44060. // {
  44061. // "description": "Gets one user role by ID.",
  44062. // "httpMethod": "GET",
  44063. // "id": "dfareporting.userRoles.get",
  44064. // "parameterOrder": [
  44065. // "profileId",
  44066. // "id"
  44067. // ],
  44068. // "parameters": {
  44069. // "id": {
  44070. // "description": "User role ID.",
  44071. // "format": "int64",
  44072. // "location": "path",
  44073. // "required": true,
  44074. // "type": "string"
  44075. // },
  44076. // "profileId": {
  44077. // "description": "User profile ID associated with this request.",
  44078. // "format": "int64",
  44079. // "location": "path",
  44080. // "required": true,
  44081. // "type": "string"
  44082. // }
  44083. // },
  44084. // "path": "userprofiles/{profileId}/userRoles/{id}",
  44085. // "response": {
  44086. // "$ref": "UserRole"
  44087. // },
  44088. // "scopes": [
  44089. // "https://www.googleapis.com/auth/dfatrafficking"
  44090. // ]
  44091. // }
  44092. }
  44093. // method id "dfareporting.userRoles.insert":
  44094. type UserRolesInsertCall struct {
  44095. s *Service
  44096. profileId int64
  44097. userrole *UserRole
  44098. urlParams_ gensupport.URLParams
  44099. ctx_ context.Context
  44100. header_ http.Header
  44101. }
  44102. // Insert: Inserts a new user role.
  44103. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  44104. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44105. c.profileId = profileId
  44106. c.userrole = userrole
  44107. return c
  44108. }
  44109. // Fields allows partial responses to be retrieved. See
  44110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44111. // for more information.
  44112. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  44113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44114. return c
  44115. }
  44116. // Context sets the context to be used in this call's Do method. Any
  44117. // pending HTTP request will be aborted if the provided context is
  44118. // canceled.
  44119. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  44120. c.ctx_ = ctx
  44121. return c
  44122. }
  44123. // Header returns an http.Header that can be modified by the caller to
  44124. // add HTTP headers to the request.
  44125. func (c *UserRolesInsertCall) Header() http.Header {
  44126. if c.header_ == nil {
  44127. c.header_ = make(http.Header)
  44128. }
  44129. return c.header_
  44130. }
  44131. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  44132. reqHeaders := make(http.Header)
  44133. for k, v := range c.header_ {
  44134. reqHeaders[k] = v
  44135. }
  44136. reqHeaders.Set("User-Agent", c.s.userAgent())
  44137. var body io.Reader = nil
  44138. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44139. if err != nil {
  44140. return nil, err
  44141. }
  44142. reqHeaders.Set("Content-Type", "application/json")
  44143. c.urlParams_.Set("alt", alt)
  44144. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44145. urls += "?" + c.urlParams_.Encode()
  44146. req, _ := http.NewRequest("POST", urls, body)
  44147. req.Header = reqHeaders
  44148. googleapi.Expand(req.URL, map[string]string{
  44149. "profileId": strconv.FormatInt(c.profileId, 10),
  44150. })
  44151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44152. }
  44153. // Do executes the "dfareporting.userRoles.insert" call.
  44154. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44155. // code is an error. Response headers are in either
  44156. // *UserRole.ServerResponse.Header or (if a response was returned at
  44157. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44158. // to check whether the returned error was because
  44159. // http.StatusNotModified was returned.
  44160. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44161. gensupport.SetOptions(c.urlParams_, opts...)
  44162. res, err := c.doRequest("json")
  44163. if res != nil && res.StatusCode == http.StatusNotModified {
  44164. if res.Body != nil {
  44165. res.Body.Close()
  44166. }
  44167. return nil, &googleapi.Error{
  44168. Code: res.StatusCode,
  44169. Header: res.Header,
  44170. }
  44171. }
  44172. if err != nil {
  44173. return nil, err
  44174. }
  44175. defer googleapi.CloseBody(res)
  44176. if err := googleapi.CheckResponse(res); err != nil {
  44177. return nil, err
  44178. }
  44179. ret := &UserRole{
  44180. ServerResponse: googleapi.ServerResponse{
  44181. Header: res.Header,
  44182. HTTPStatusCode: res.StatusCode,
  44183. },
  44184. }
  44185. target := &ret
  44186. if err := gensupport.DecodeResponse(target, res); err != nil {
  44187. return nil, err
  44188. }
  44189. return ret, nil
  44190. // {
  44191. // "description": "Inserts a new user role.",
  44192. // "httpMethod": "POST",
  44193. // "id": "dfareporting.userRoles.insert",
  44194. // "parameterOrder": [
  44195. // "profileId"
  44196. // ],
  44197. // "parameters": {
  44198. // "profileId": {
  44199. // "description": "User profile ID associated with this request.",
  44200. // "format": "int64",
  44201. // "location": "path",
  44202. // "required": true,
  44203. // "type": "string"
  44204. // }
  44205. // },
  44206. // "path": "userprofiles/{profileId}/userRoles",
  44207. // "request": {
  44208. // "$ref": "UserRole"
  44209. // },
  44210. // "response": {
  44211. // "$ref": "UserRole"
  44212. // },
  44213. // "scopes": [
  44214. // "https://www.googleapis.com/auth/dfatrafficking"
  44215. // ]
  44216. // }
  44217. }
  44218. // method id "dfareporting.userRoles.list":
  44219. type UserRolesListCall struct {
  44220. s *Service
  44221. profileId int64
  44222. urlParams_ gensupport.URLParams
  44223. ifNoneMatch_ string
  44224. ctx_ context.Context
  44225. header_ http.Header
  44226. }
  44227. // List: Retrieves a list of user roles, possibly filtered. This method
  44228. // supports paging.
  44229. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  44230. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44231. c.profileId = profileId
  44232. return c
  44233. }
  44234. // AccountUserRoleOnly sets the optional parameter
  44235. // "accountUserRoleOnly": Select only account level user roles not
  44236. // associated with any specific subaccount.
  44237. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  44238. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  44239. return c
  44240. }
  44241. // Ids sets the optional parameter "ids": Select only user roles with
  44242. // the specified IDs.
  44243. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  44244. var ids_ []string
  44245. for _, v := range ids {
  44246. ids_ = append(ids_, fmt.Sprint(v))
  44247. }
  44248. c.urlParams_.SetMulti("ids", ids_)
  44249. return c
  44250. }
  44251. // MaxResults sets the optional parameter "maxResults": Maximum number
  44252. // of results to return.
  44253. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  44254. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44255. return c
  44256. }
  44257. // PageToken sets the optional parameter "pageToken": Value of the
  44258. // nextPageToken from the previous result page.
  44259. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  44260. c.urlParams_.Set("pageToken", pageToken)
  44261. return c
  44262. }
  44263. // SearchString sets the optional parameter "searchString": Allows
  44264. // searching for objects by name or ID. Wildcards (*) are allowed. For
  44265. // example, "userrole*2015" will return objects with names like
  44266. // "userrole June 2015", "userrole April 2015", or simply "userrole
  44267. // 2015". Most of the searches also add wildcards implicitly at the
  44268. // start and the end of the search string. For example, a search string
  44269. // of "userrole" will match objects with name "my userrole", "userrole
  44270. // 2015", or simply "userrole".
  44271. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  44272. c.urlParams_.Set("searchString", searchString)
  44273. return c
  44274. }
  44275. // SortField sets the optional parameter "sortField": Field by which to
  44276. // sort the list.
  44277. //
  44278. // Possible values:
  44279. // "ID" (default)
  44280. // "NAME"
  44281. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  44282. c.urlParams_.Set("sortField", sortField)
  44283. return c
  44284. }
  44285. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  44286. // results.
  44287. //
  44288. // Possible values:
  44289. // "ASCENDING" (default)
  44290. // "DESCENDING"
  44291. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  44292. c.urlParams_.Set("sortOrder", sortOrder)
  44293. return c
  44294. }
  44295. // SubaccountId sets the optional parameter "subaccountId": Select only
  44296. // user roles that belong to this subaccount.
  44297. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  44298. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  44299. return c
  44300. }
  44301. // Fields allows partial responses to be retrieved. See
  44302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44303. // for more information.
  44304. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  44305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44306. return c
  44307. }
  44308. // IfNoneMatch sets the optional parameter which makes the operation
  44309. // fail if the object's ETag matches the given value. This is useful for
  44310. // getting updates only after the object has changed since the last
  44311. // request. Use googleapi.IsNotModified to check whether the response
  44312. // error from Do is the result of In-None-Match.
  44313. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  44314. c.ifNoneMatch_ = entityTag
  44315. return c
  44316. }
  44317. // Context sets the context to be used in this call's Do method. Any
  44318. // pending HTTP request will be aborted if the provided context is
  44319. // canceled.
  44320. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  44321. c.ctx_ = ctx
  44322. return c
  44323. }
  44324. // Header returns an http.Header that can be modified by the caller to
  44325. // add HTTP headers to the request.
  44326. func (c *UserRolesListCall) Header() http.Header {
  44327. if c.header_ == nil {
  44328. c.header_ = make(http.Header)
  44329. }
  44330. return c.header_
  44331. }
  44332. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  44333. reqHeaders := make(http.Header)
  44334. for k, v := range c.header_ {
  44335. reqHeaders[k] = v
  44336. }
  44337. reqHeaders.Set("User-Agent", c.s.userAgent())
  44338. if c.ifNoneMatch_ != "" {
  44339. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44340. }
  44341. var body io.Reader = nil
  44342. c.urlParams_.Set("alt", alt)
  44343. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44344. urls += "?" + c.urlParams_.Encode()
  44345. req, _ := http.NewRequest("GET", urls, body)
  44346. req.Header = reqHeaders
  44347. googleapi.Expand(req.URL, map[string]string{
  44348. "profileId": strconv.FormatInt(c.profileId, 10),
  44349. })
  44350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44351. }
  44352. // Do executes the "dfareporting.userRoles.list" call.
  44353. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  44354. // non-2xx status code is an error. Response headers are in either
  44355. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  44356. // returned at all) in error.(*googleapi.Error).Header. Use
  44357. // googleapi.IsNotModified to check whether the returned error was
  44358. // because http.StatusNotModified was returned.
  44359. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  44360. gensupport.SetOptions(c.urlParams_, opts...)
  44361. res, err := c.doRequest("json")
  44362. if res != nil && res.StatusCode == http.StatusNotModified {
  44363. if res.Body != nil {
  44364. res.Body.Close()
  44365. }
  44366. return nil, &googleapi.Error{
  44367. Code: res.StatusCode,
  44368. Header: res.Header,
  44369. }
  44370. }
  44371. if err != nil {
  44372. return nil, err
  44373. }
  44374. defer googleapi.CloseBody(res)
  44375. if err := googleapi.CheckResponse(res); err != nil {
  44376. return nil, err
  44377. }
  44378. ret := &UserRolesListResponse{
  44379. ServerResponse: googleapi.ServerResponse{
  44380. Header: res.Header,
  44381. HTTPStatusCode: res.StatusCode,
  44382. },
  44383. }
  44384. target := &ret
  44385. if err := gensupport.DecodeResponse(target, res); err != nil {
  44386. return nil, err
  44387. }
  44388. return ret, nil
  44389. // {
  44390. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  44391. // "httpMethod": "GET",
  44392. // "id": "dfareporting.userRoles.list",
  44393. // "parameterOrder": [
  44394. // "profileId"
  44395. // ],
  44396. // "parameters": {
  44397. // "accountUserRoleOnly": {
  44398. // "description": "Select only account level user roles not associated with any specific subaccount.",
  44399. // "location": "query",
  44400. // "type": "boolean"
  44401. // },
  44402. // "ids": {
  44403. // "description": "Select only user roles with the specified IDs.",
  44404. // "format": "int64",
  44405. // "location": "query",
  44406. // "repeated": true,
  44407. // "type": "string"
  44408. // },
  44409. // "maxResults": {
  44410. // "default": "1000",
  44411. // "description": "Maximum number of results to return.",
  44412. // "format": "int32",
  44413. // "location": "query",
  44414. // "maximum": "1000",
  44415. // "minimum": "0",
  44416. // "type": "integer"
  44417. // },
  44418. // "pageToken": {
  44419. // "description": "Value of the nextPageToken from the previous result page.",
  44420. // "location": "query",
  44421. // "type": "string"
  44422. // },
  44423. // "profileId": {
  44424. // "description": "User profile ID associated with this request.",
  44425. // "format": "int64",
  44426. // "location": "path",
  44427. // "required": true,
  44428. // "type": "string"
  44429. // },
  44430. // "searchString": {
  44431. // "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\".",
  44432. // "location": "query",
  44433. // "type": "string"
  44434. // },
  44435. // "sortField": {
  44436. // "default": "ID",
  44437. // "description": "Field by which to sort the list.",
  44438. // "enum": [
  44439. // "ID",
  44440. // "NAME"
  44441. // ],
  44442. // "enumDescriptions": [
  44443. // "",
  44444. // ""
  44445. // ],
  44446. // "location": "query",
  44447. // "type": "string"
  44448. // },
  44449. // "sortOrder": {
  44450. // "default": "ASCENDING",
  44451. // "description": "Order of sorted results.",
  44452. // "enum": [
  44453. // "ASCENDING",
  44454. // "DESCENDING"
  44455. // ],
  44456. // "enumDescriptions": [
  44457. // "",
  44458. // ""
  44459. // ],
  44460. // "location": "query",
  44461. // "type": "string"
  44462. // },
  44463. // "subaccountId": {
  44464. // "description": "Select only user roles that belong to this subaccount.",
  44465. // "format": "int64",
  44466. // "location": "query",
  44467. // "type": "string"
  44468. // }
  44469. // },
  44470. // "path": "userprofiles/{profileId}/userRoles",
  44471. // "response": {
  44472. // "$ref": "UserRolesListResponse"
  44473. // },
  44474. // "scopes": [
  44475. // "https://www.googleapis.com/auth/dfatrafficking"
  44476. // ]
  44477. // }
  44478. }
  44479. // Pages invokes f for each page of results.
  44480. // A non-nil error returned from f will halt the iteration.
  44481. // The provided context supersedes any context provided to the Context method.
  44482. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  44483. c.ctx_ = ctx
  44484. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44485. for {
  44486. x, err := c.Do()
  44487. if err != nil {
  44488. return err
  44489. }
  44490. if err := f(x); err != nil {
  44491. return err
  44492. }
  44493. if x.NextPageToken == "" {
  44494. return nil
  44495. }
  44496. c.PageToken(x.NextPageToken)
  44497. }
  44498. }
  44499. // method id "dfareporting.userRoles.patch":
  44500. type UserRolesPatchCall struct {
  44501. s *Service
  44502. profileId int64
  44503. userrole *UserRole
  44504. urlParams_ gensupport.URLParams
  44505. ctx_ context.Context
  44506. header_ http.Header
  44507. }
  44508. // Patch: Updates an existing user role. This method supports patch
  44509. // semantics.
  44510. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  44511. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44512. c.profileId = profileId
  44513. c.urlParams_.Set("id", fmt.Sprint(id))
  44514. c.userrole = userrole
  44515. return c
  44516. }
  44517. // Fields allows partial responses to be retrieved. See
  44518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44519. // for more information.
  44520. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  44521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44522. return c
  44523. }
  44524. // Context sets the context to be used in this call's Do method. Any
  44525. // pending HTTP request will be aborted if the provided context is
  44526. // canceled.
  44527. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  44528. c.ctx_ = ctx
  44529. return c
  44530. }
  44531. // Header returns an http.Header that can be modified by the caller to
  44532. // add HTTP headers to the request.
  44533. func (c *UserRolesPatchCall) Header() http.Header {
  44534. if c.header_ == nil {
  44535. c.header_ = make(http.Header)
  44536. }
  44537. return c.header_
  44538. }
  44539. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  44540. reqHeaders := make(http.Header)
  44541. for k, v := range c.header_ {
  44542. reqHeaders[k] = v
  44543. }
  44544. reqHeaders.Set("User-Agent", c.s.userAgent())
  44545. var body io.Reader = nil
  44546. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44547. if err != nil {
  44548. return nil, err
  44549. }
  44550. reqHeaders.Set("Content-Type", "application/json")
  44551. c.urlParams_.Set("alt", alt)
  44552. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44553. urls += "?" + c.urlParams_.Encode()
  44554. req, _ := http.NewRequest("PATCH", urls, body)
  44555. req.Header = reqHeaders
  44556. googleapi.Expand(req.URL, map[string]string{
  44557. "profileId": strconv.FormatInt(c.profileId, 10),
  44558. })
  44559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44560. }
  44561. // Do executes the "dfareporting.userRoles.patch" call.
  44562. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44563. // code is an error. Response headers are in either
  44564. // *UserRole.ServerResponse.Header or (if a response was returned at
  44565. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44566. // to check whether the returned error was because
  44567. // http.StatusNotModified was returned.
  44568. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44569. gensupport.SetOptions(c.urlParams_, opts...)
  44570. res, err := c.doRequest("json")
  44571. if res != nil && res.StatusCode == http.StatusNotModified {
  44572. if res.Body != nil {
  44573. res.Body.Close()
  44574. }
  44575. return nil, &googleapi.Error{
  44576. Code: res.StatusCode,
  44577. Header: res.Header,
  44578. }
  44579. }
  44580. if err != nil {
  44581. return nil, err
  44582. }
  44583. defer googleapi.CloseBody(res)
  44584. if err := googleapi.CheckResponse(res); err != nil {
  44585. return nil, err
  44586. }
  44587. ret := &UserRole{
  44588. ServerResponse: googleapi.ServerResponse{
  44589. Header: res.Header,
  44590. HTTPStatusCode: res.StatusCode,
  44591. },
  44592. }
  44593. target := &ret
  44594. if err := gensupport.DecodeResponse(target, res); err != nil {
  44595. return nil, err
  44596. }
  44597. return ret, nil
  44598. // {
  44599. // "description": "Updates an existing user role. This method supports patch semantics.",
  44600. // "httpMethod": "PATCH",
  44601. // "id": "dfareporting.userRoles.patch",
  44602. // "parameterOrder": [
  44603. // "profileId",
  44604. // "id"
  44605. // ],
  44606. // "parameters": {
  44607. // "id": {
  44608. // "description": "User role ID.",
  44609. // "format": "int64",
  44610. // "location": "query",
  44611. // "required": true,
  44612. // "type": "string"
  44613. // },
  44614. // "profileId": {
  44615. // "description": "User profile ID associated with this request.",
  44616. // "format": "int64",
  44617. // "location": "path",
  44618. // "required": true,
  44619. // "type": "string"
  44620. // }
  44621. // },
  44622. // "path": "userprofiles/{profileId}/userRoles",
  44623. // "request": {
  44624. // "$ref": "UserRole"
  44625. // },
  44626. // "response": {
  44627. // "$ref": "UserRole"
  44628. // },
  44629. // "scopes": [
  44630. // "https://www.googleapis.com/auth/dfatrafficking"
  44631. // ]
  44632. // }
  44633. }
  44634. // method id "dfareporting.userRoles.update":
  44635. type UserRolesUpdateCall struct {
  44636. s *Service
  44637. profileId int64
  44638. userrole *UserRole
  44639. urlParams_ gensupport.URLParams
  44640. ctx_ context.Context
  44641. header_ http.Header
  44642. }
  44643. // Update: Updates an existing user role.
  44644. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  44645. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44646. c.profileId = profileId
  44647. c.userrole = userrole
  44648. return c
  44649. }
  44650. // Fields allows partial responses to be retrieved. See
  44651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44652. // for more information.
  44653. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  44654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44655. return c
  44656. }
  44657. // Context sets the context to be used in this call's Do method. Any
  44658. // pending HTTP request will be aborted if the provided context is
  44659. // canceled.
  44660. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  44661. c.ctx_ = ctx
  44662. return c
  44663. }
  44664. // Header returns an http.Header that can be modified by the caller to
  44665. // add HTTP headers to the request.
  44666. func (c *UserRolesUpdateCall) Header() http.Header {
  44667. if c.header_ == nil {
  44668. c.header_ = make(http.Header)
  44669. }
  44670. return c.header_
  44671. }
  44672. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  44673. reqHeaders := make(http.Header)
  44674. for k, v := range c.header_ {
  44675. reqHeaders[k] = v
  44676. }
  44677. reqHeaders.Set("User-Agent", c.s.userAgent())
  44678. var body io.Reader = nil
  44679. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44680. if err != nil {
  44681. return nil, err
  44682. }
  44683. reqHeaders.Set("Content-Type", "application/json")
  44684. c.urlParams_.Set("alt", alt)
  44685. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44686. urls += "?" + c.urlParams_.Encode()
  44687. req, _ := http.NewRequest("PUT", urls, body)
  44688. req.Header = reqHeaders
  44689. googleapi.Expand(req.URL, map[string]string{
  44690. "profileId": strconv.FormatInt(c.profileId, 10),
  44691. })
  44692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44693. }
  44694. // Do executes the "dfareporting.userRoles.update" call.
  44695. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44696. // code is an error. Response headers are in either
  44697. // *UserRole.ServerResponse.Header or (if a response was returned at
  44698. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44699. // to check whether the returned error was because
  44700. // http.StatusNotModified was returned.
  44701. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44702. gensupport.SetOptions(c.urlParams_, opts...)
  44703. res, err := c.doRequest("json")
  44704. if res != nil && res.StatusCode == http.StatusNotModified {
  44705. if res.Body != nil {
  44706. res.Body.Close()
  44707. }
  44708. return nil, &googleapi.Error{
  44709. Code: res.StatusCode,
  44710. Header: res.Header,
  44711. }
  44712. }
  44713. if err != nil {
  44714. return nil, err
  44715. }
  44716. defer googleapi.CloseBody(res)
  44717. if err := googleapi.CheckResponse(res); err != nil {
  44718. return nil, err
  44719. }
  44720. ret := &UserRole{
  44721. ServerResponse: googleapi.ServerResponse{
  44722. Header: res.Header,
  44723. HTTPStatusCode: res.StatusCode,
  44724. },
  44725. }
  44726. target := &ret
  44727. if err := gensupport.DecodeResponse(target, res); err != nil {
  44728. return nil, err
  44729. }
  44730. return ret, nil
  44731. // {
  44732. // "description": "Updates an existing user role.",
  44733. // "httpMethod": "PUT",
  44734. // "id": "dfareporting.userRoles.update",
  44735. // "parameterOrder": [
  44736. // "profileId"
  44737. // ],
  44738. // "parameters": {
  44739. // "profileId": {
  44740. // "description": "User profile ID associated with this request.",
  44741. // "format": "int64",
  44742. // "location": "path",
  44743. // "required": true,
  44744. // "type": "string"
  44745. // }
  44746. // },
  44747. // "path": "userprofiles/{profileId}/userRoles",
  44748. // "request": {
  44749. // "$ref": "UserRole"
  44750. // },
  44751. // "response": {
  44752. // "$ref": "UserRole"
  44753. // },
  44754. // "scopes": [
  44755. // "https://www.googleapis.com/auth/dfatrafficking"
  44756. // ]
  44757. // }
  44758. }
  44759. // method id "dfareporting.videoFormats.get":
  44760. type VideoFormatsGetCall struct {
  44761. s *Service
  44762. profileId int64
  44763. id int64
  44764. urlParams_ gensupport.URLParams
  44765. ifNoneMatch_ string
  44766. ctx_ context.Context
  44767. header_ http.Header
  44768. }
  44769. // Get: Gets one video format by ID.
  44770. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  44771. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44772. c.profileId = profileId
  44773. c.id = id
  44774. return c
  44775. }
  44776. // Fields allows partial responses to be retrieved. See
  44777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44778. // for more information.
  44779. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  44780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44781. return c
  44782. }
  44783. // IfNoneMatch sets the optional parameter which makes the operation
  44784. // fail if the object's ETag matches the given value. This is useful for
  44785. // getting updates only after the object has changed since the last
  44786. // request. Use googleapi.IsNotModified to check whether the response
  44787. // error from Do is the result of In-None-Match.
  44788. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  44789. c.ifNoneMatch_ = entityTag
  44790. return c
  44791. }
  44792. // Context sets the context to be used in this call's Do method. Any
  44793. // pending HTTP request will be aborted if the provided context is
  44794. // canceled.
  44795. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  44796. c.ctx_ = ctx
  44797. return c
  44798. }
  44799. // Header returns an http.Header that can be modified by the caller to
  44800. // add HTTP headers to the request.
  44801. func (c *VideoFormatsGetCall) Header() http.Header {
  44802. if c.header_ == nil {
  44803. c.header_ = make(http.Header)
  44804. }
  44805. return c.header_
  44806. }
  44807. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  44808. reqHeaders := make(http.Header)
  44809. for k, v := range c.header_ {
  44810. reqHeaders[k] = v
  44811. }
  44812. reqHeaders.Set("User-Agent", c.s.userAgent())
  44813. if c.ifNoneMatch_ != "" {
  44814. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44815. }
  44816. var body io.Reader = nil
  44817. c.urlParams_.Set("alt", alt)
  44818. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  44819. urls += "?" + c.urlParams_.Encode()
  44820. req, _ := http.NewRequest("GET", urls, body)
  44821. req.Header = reqHeaders
  44822. googleapi.Expand(req.URL, map[string]string{
  44823. "profileId": strconv.FormatInt(c.profileId, 10),
  44824. "id": strconv.FormatInt(c.id, 10),
  44825. })
  44826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44827. }
  44828. // Do executes the "dfareporting.videoFormats.get" call.
  44829. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  44830. // status code is an error. Response headers are in either
  44831. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  44832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44833. // to check whether the returned error was because
  44834. // http.StatusNotModified was returned.
  44835. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  44836. gensupport.SetOptions(c.urlParams_, opts...)
  44837. res, err := c.doRequest("json")
  44838. if res != nil && res.StatusCode == http.StatusNotModified {
  44839. if res.Body != nil {
  44840. res.Body.Close()
  44841. }
  44842. return nil, &googleapi.Error{
  44843. Code: res.StatusCode,
  44844. Header: res.Header,
  44845. }
  44846. }
  44847. if err != nil {
  44848. return nil, err
  44849. }
  44850. defer googleapi.CloseBody(res)
  44851. if err := googleapi.CheckResponse(res); err != nil {
  44852. return nil, err
  44853. }
  44854. ret := &VideoFormat{
  44855. ServerResponse: googleapi.ServerResponse{
  44856. Header: res.Header,
  44857. HTTPStatusCode: res.StatusCode,
  44858. },
  44859. }
  44860. target := &ret
  44861. if err := gensupport.DecodeResponse(target, res); err != nil {
  44862. return nil, err
  44863. }
  44864. return ret, nil
  44865. // {
  44866. // "description": "Gets one video format by ID.",
  44867. // "httpMethod": "GET",
  44868. // "id": "dfareporting.videoFormats.get",
  44869. // "parameterOrder": [
  44870. // "profileId",
  44871. // "id"
  44872. // ],
  44873. // "parameters": {
  44874. // "id": {
  44875. // "description": "Video format ID.",
  44876. // "format": "int32",
  44877. // "location": "path",
  44878. // "required": true,
  44879. // "type": "integer"
  44880. // },
  44881. // "profileId": {
  44882. // "description": "User profile ID associated with this request.",
  44883. // "format": "int64",
  44884. // "location": "path",
  44885. // "required": true,
  44886. // "type": "string"
  44887. // }
  44888. // },
  44889. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  44890. // "response": {
  44891. // "$ref": "VideoFormat"
  44892. // },
  44893. // "scopes": [
  44894. // "https://www.googleapis.com/auth/dfatrafficking"
  44895. // ]
  44896. // }
  44897. }
  44898. // method id "dfareporting.videoFormats.list":
  44899. type VideoFormatsListCall struct {
  44900. s *Service
  44901. profileId int64
  44902. urlParams_ gensupport.URLParams
  44903. ifNoneMatch_ string
  44904. ctx_ context.Context
  44905. header_ http.Header
  44906. }
  44907. // List: Lists available video formats.
  44908. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  44909. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44910. c.profileId = profileId
  44911. return c
  44912. }
  44913. // Fields allows partial responses to be retrieved. See
  44914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44915. // for more information.
  44916. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  44917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44918. return c
  44919. }
  44920. // IfNoneMatch sets the optional parameter which makes the operation
  44921. // fail if the object's ETag matches the given value. This is useful for
  44922. // getting updates only after the object has changed since the last
  44923. // request. Use googleapi.IsNotModified to check whether the response
  44924. // error from Do is the result of In-None-Match.
  44925. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  44926. c.ifNoneMatch_ = entityTag
  44927. return c
  44928. }
  44929. // Context sets the context to be used in this call's Do method. Any
  44930. // pending HTTP request will be aborted if the provided context is
  44931. // canceled.
  44932. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  44933. c.ctx_ = ctx
  44934. return c
  44935. }
  44936. // Header returns an http.Header that can be modified by the caller to
  44937. // add HTTP headers to the request.
  44938. func (c *VideoFormatsListCall) Header() http.Header {
  44939. if c.header_ == nil {
  44940. c.header_ = make(http.Header)
  44941. }
  44942. return c.header_
  44943. }
  44944. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  44945. reqHeaders := make(http.Header)
  44946. for k, v := range c.header_ {
  44947. reqHeaders[k] = v
  44948. }
  44949. reqHeaders.Set("User-Agent", c.s.userAgent())
  44950. if c.ifNoneMatch_ != "" {
  44951. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44952. }
  44953. var body io.Reader = nil
  44954. c.urlParams_.Set("alt", alt)
  44955. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  44956. urls += "?" + c.urlParams_.Encode()
  44957. req, _ := http.NewRequest("GET", urls, body)
  44958. req.Header = reqHeaders
  44959. googleapi.Expand(req.URL, map[string]string{
  44960. "profileId": strconv.FormatInt(c.profileId, 10),
  44961. })
  44962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44963. }
  44964. // Do executes the "dfareporting.videoFormats.list" call.
  44965. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  44966. // Any non-2xx status code is an error. Response headers are in either
  44967. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  44968. // returned at all) in error.(*googleapi.Error).Header. Use
  44969. // googleapi.IsNotModified to check whether the returned error was
  44970. // because http.StatusNotModified was returned.
  44971. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  44972. gensupport.SetOptions(c.urlParams_, opts...)
  44973. res, err := c.doRequest("json")
  44974. if res != nil && res.StatusCode == http.StatusNotModified {
  44975. if res.Body != nil {
  44976. res.Body.Close()
  44977. }
  44978. return nil, &googleapi.Error{
  44979. Code: res.StatusCode,
  44980. Header: res.Header,
  44981. }
  44982. }
  44983. if err != nil {
  44984. return nil, err
  44985. }
  44986. defer googleapi.CloseBody(res)
  44987. if err := googleapi.CheckResponse(res); err != nil {
  44988. return nil, err
  44989. }
  44990. ret := &VideoFormatsListResponse{
  44991. ServerResponse: googleapi.ServerResponse{
  44992. Header: res.Header,
  44993. HTTPStatusCode: res.StatusCode,
  44994. },
  44995. }
  44996. target := &ret
  44997. if err := gensupport.DecodeResponse(target, res); err != nil {
  44998. return nil, err
  44999. }
  45000. return ret, nil
  45001. // {
  45002. // "description": "Lists available video formats.",
  45003. // "httpMethod": "GET",
  45004. // "id": "dfareporting.videoFormats.list",
  45005. // "parameterOrder": [
  45006. // "profileId"
  45007. // ],
  45008. // "parameters": {
  45009. // "profileId": {
  45010. // "description": "User profile ID associated with this request.",
  45011. // "format": "int64",
  45012. // "location": "path",
  45013. // "required": true,
  45014. // "type": "string"
  45015. // }
  45016. // },
  45017. // "path": "userprofiles/{profileId}/videoFormats",
  45018. // "response": {
  45019. // "$ref": "VideoFormatsListResponse"
  45020. // },
  45021. // "scopes": [
  45022. // "https://www.googleapis.com/auth/dfatrafficking"
  45023. // ]
  45024. // }
  45025. }