Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

50993 rader
1.7 MiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API.
  6. //
  7. // For product documentation, see: https://developers.google.com/doubleclick-advertisers/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/dfareporting/v3.3"
  14. // ...
  15. // ctx := context.Background()
  16. // dfareportingService, err := dfareporting.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // dfareportingService, err := dfareporting.NewService(ctx, option.WithScopes(dfareporting.DfatraffickingScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // dfareportingService, err := dfareporting.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // dfareportingService, err := dfareporting.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package dfareporting // import "google.golang.org/api/dfareporting/v3.3"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "dfareporting:v3.3"
  71. const apiName = "dfareporting"
  72. const apiVersion = "v3.3"
  73. const basePath = "https://www.googleapis.com/dfareporting/v3.3/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // Manage DoubleClick Digital Marketing conversions
  77. DdmconversionsScope = "https://www.googleapis.com/auth/ddmconversions"
  78. // View and manage DoubleClick for Advertisers reports
  79. DfareportingScope = "https://www.googleapis.com/auth/dfareporting"
  80. // View and manage your DoubleClick Campaign Manager's (DCM) display ad
  81. // campaigns
  82. DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking"
  83. )
  84. // NewService creates a new Service.
  85. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  86. scopesOption := option.WithScopes(
  87. "https://www.googleapis.com/auth/ddmconversions",
  88. "https://www.googleapis.com/auth/dfareporting",
  89. "https://www.googleapis.com/auth/dfatrafficking",
  90. )
  91. // NOTE: prepend, so we don't override user-specified scopes.
  92. opts = append([]option.ClientOption{scopesOption}, opts...)
  93. client, endpoint, err := htransport.NewClient(ctx, opts...)
  94. if err != nil {
  95. return nil, err
  96. }
  97. s, err := New(client)
  98. if err != nil {
  99. return nil, err
  100. }
  101. if endpoint != "" {
  102. s.BasePath = endpoint
  103. }
  104. return s, nil
  105. }
  106. // New creates a new Service. It uses the provided http.Client for requests.
  107. //
  108. // Deprecated: please use NewService instead.
  109. // To provide a custom HTTP client, use option.WithHTTPClient.
  110. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  111. func New(client *http.Client) (*Service, error) {
  112. if client == nil {
  113. return nil, errors.New("client is nil")
  114. }
  115. s := &Service{client: client, BasePath: basePath}
  116. s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s)
  117. s.AccountPermissionGroups = NewAccountPermissionGroupsService(s)
  118. s.AccountPermissions = NewAccountPermissionsService(s)
  119. s.AccountUserProfiles = NewAccountUserProfilesService(s)
  120. s.Accounts = NewAccountsService(s)
  121. s.Ads = NewAdsService(s)
  122. s.AdvertiserGroups = NewAdvertiserGroupsService(s)
  123. s.AdvertiserLandingPages = NewAdvertiserLandingPagesService(s)
  124. s.Advertisers = NewAdvertisersService(s)
  125. s.Browsers = NewBrowsersService(s)
  126. s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s)
  127. s.Campaigns = NewCampaignsService(s)
  128. s.ChangeLogs = NewChangeLogsService(s)
  129. s.Cities = NewCitiesService(s)
  130. s.ConnectionTypes = NewConnectionTypesService(s)
  131. s.ContentCategories = NewContentCategoriesService(s)
  132. s.Conversions = NewConversionsService(s)
  133. s.Countries = NewCountriesService(s)
  134. s.CreativeAssets = NewCreativeAssetsService(s)
  135. s.CreativeFieldValues = NewCreativeFieldValuesService(s)
  136. s.CreativeFields = NewCreativeFieldsService(s)
  137. s.CreativeGroups = NewCreativeGroupsService(s)
  138. s.Creatives = NewCreativesService(s)
  139. s.DimensionValues = NewDimensionValuesService(s)
  140. s.DirectorySites = NewDirectorySitesService(s)
  141. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  142. s.EventTags = NewEventTagsService(s)
  143. s.Files = NewFilesService(s)
  144. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  145. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  146. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  147. s.InventoryItems = NewInventoryItemsService(s)
  148. s.Languages = NewLanguagesService(s)
  149. s.Metros = NewMetrosService(s)
  150. s.MobileApps = NewMobileAppsService(s)
  151. s.MobileCarriers = NewMobileCarriersService(s)
  152. s.OperatingSystemVersions = NewOperatingSystemVersionsService(s)
  153. s.OperatingSystems = NewOperatingSystemsService(s)
  154. s.OrderDocuments = NewOrderDocumentsService(s)
  155. s.Orders = NewOrdersService(s)
  156. s.PlacementGroups = NewPlacementGroupsService(s)
  157. s.PlacementStrategies = NewPlacementStrategiesService(s)
  158. s.Placements = NewPlacementsService(s)
  159. s.PlatformTypes = NewPlatformTypesService(s)
  160. s.PostalCodes = NewPostalCodesService(s)
  161. s.Projects = NewProjectsService(s)
  162. s.Regions = NewRegionsService(s)
  163. s.RemarketingListShares = NewRemarketingListSharesService(s)
  164. s.RemarketingLists = NewRemarketingListsService(s)
  165. s.Reports = NewReportsService(s)
  166. s.Sites = NewSitesService(s)
  167. s.Sizes = NewSizesService(s)
  168. s.Subaccounts = NewSubaccountsService(s)
  169. s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s)
  170. s.TargetingTemplates = NewTargetingTemplatesService(s)
  171. s.UserProfiles = NewUserProfilesService(s)
  172. s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s)
  173. s.UserRolePermissions = NewUserRolePermissionsService(s)
  174. s.UserRoles = NewUserRolesService(s)
  175. s.VideoFormats = NewVideoFormatsService(s)
  176. return s, nil
  177. }
  178. type Service struct {
  179. client *http.Client
  180. BasePath string // API endpoint base URL
  181. UserAgent string // optional additional User-Agent fragment
  182. AccountActiveAdSummaries *AccountActiveAdSummariesService
  183. AccountPermissionGroups *AccountPermissionGroupsService
  184. AccountPermissions *AccountPermissionsService
  185. AccountUserProfiles *AccountUserProfilesService
  186. Accounts *AccountsService
  187. Ads *AdsService
  188. AdvertiserGroups *AdvertiserGroupsService
  189. AdvertiserLandingPages *AdvertiserLandingPagesService
  190. Advertisers *AdvertisersService
  191. Browsers *BrowsersService
  192. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  193. Campaigns *CampaignsService
  194. ChangeLogs *ChangeLogsService
  195. Cities *CitiesService
  196. ConnectionTypes *ConnectionTypesService
  197. ContentCategories *ContentCategoriesService
  198. Conversions *ConversionsService
  199. Countries *CountriesService
  200. CreativeAssets *CreativeAssetsService
  201. CreativeFieldValues *CreativeFieldValuesService
  202. CreativeFields *CreativeFieldsService
  203. CreativeGroups *CreativeGroupsService
  204. Creatives *CreativesService
  205. DimensionValues *DimensionValuesService
  206. DirectorySites *DirectorySitesService
  207. DynamicTargetingKeys *DynamicTargetingKeysService
  208. EventTags *EventTagsService
  209. Files *FilesService
  210. FloodlightActivities *FloodlightActivitiesService
  211. FloodlightActivityGroups *FloodlightActivityGroupsService
  212. FloodlightConfigurations *FloodlightConfigurationsService
  213. InventoryItems *InventoryItemsService
  214. Languages *LanguagesService
  215. Metros *MetrosService
  216. MobileApps *MobileAppsService
  217. MobileCarriers *MobileCarriersService
  218. OperatingSystemVersions *OperatingSystemVersionsService
  219. OperatingSystems *OperatingSystemsService
  220. OrderDocuments *OrderDocumentsService
  221. Orders *OrdersService
  222. PlacementGroups *PlacementGroupsService
  223. PlacementStrategies *PlacementStrategiesService
  224. Placements *PlacementsService
  225. PlatformTypes *PlatformTypesService
  226. PostalCodes *PostalCodesService
  227. Projects *ProjectsService
  228. Regions *RegionsService
  229. RemarketingListShares *RemarketingListSharesService
  230. RemarketingLists *RemarketingListsService
  231. Reports *ReportsService
  232. Sites *SitesService
  233. Sizes *SizesService
  234. Subaccounts *SubaccountsService
  235. TargetableRemarketingLists *TargetableRemarketingListsService
  236. TargetingTemplates *TargetingTemplatesService
  237. UserProfiles *UserProfilesService
  238. UserRolePermissionGroups *UserRolePermissionGroupsService
  239. UserRolePermissions *UserRolePermissionsService
  240. UserRoles *UserRolesService
  241. VideoFormats *VideoFormatsService
  242. }
  243. func (s *Service) userAgent() string {
  244. if s.UserAgent == "" {
  245. return googleapi.UserAgent
  246. }
  247. return googleapi.UserAgent + " " + s.UserAgent
  248. }
  249. func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService {
  250. rs := &AccountActiveAdSummariesService{s: s}
  251. return rs
  252. }
  253. type AccountActiveAdSummariesService struct {
  254. s *Service
  255. }
  256. func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService {
  257. rs := &AccountPermissionGroupsService{s: s}
  258. return rs
  259. }
  260. type AccountPermissionGroupsService struct {
  261. s *Service
  262. }
  263. func NewAccountPermissionsService(s *Service) *AccountPermissionsService {
  264. rs := &AccountPermissionsService{s: s}
  265. return rs
  266. }
  267. type AccountPermissionsService struct {
  268. s *Service
  269. }
  270. func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService {
  271. rs := &AccountUserProfilesService{s: s}
  272. return rs
  273. }
  274. type AccountUserProfilesService struct {
  275. s *Service
  276. }
  277. func NewAccountsService(s *Service) *AccountsService {
  278. rs := &AccountsService{s: s}
  279. return rs
  280. }
  281. type AccountsService struct {
  282. s *Service
  283. }
  284. func NewAdsService(s *Service) *AdsService {
  285. rs := &AdsService{s: s}
  286. return rs
  287. }
  288. type AdsService struct {
  289. s *Service
  290. }
  291. func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService {
  292. rs := &AdvertiserGroupsService{s: s}
  293. return rs
  294. }
  295. type AdvertiserGroupsService struct {
  296. s *Service
  297. }
  298. func NewAdvertiserLandingPagesService(s *Service) *AdvertiserLandingPagesService {
  299. rs := &AdvertiserLandingPagesService{s: s}
  300. return rs
  301. }
  302. type AdvertiserLandingPagesService struct {
  303. s *Service
  304. }
  305. func NewAdvertisersService(s *Service) *AdvertisersService {
  306. rs := &AdvertisersService{s: s}
  307. return rs
  308. }
  309. type AdvertisersService struct {
  310. s *Service
  311. }
  312. func NewBrowsersService(s *Service) *BrowsersService {
  313. rs := &BrowsersService{s: s}
  314. return rs
  315. }
  316. type BrowsersService struct {
  317. s *Service
  318. }
  319. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  320. rs := &CampaignCreativeAssociationsService{s: s}
  321. return rs
  322. }
  323. type CampaignCreativeAssociationsService struct {
  324. s *Service
  325. }
  326. func NewCampaignsService(s *Service) *CampaignsService {
  327. rs := &CampaignsService{s: s}
  328. return rs
  329. }
  330. type CampaignsService struct {
  331. s *Service
  332. }
  333. func NewChangeLogsService(s *Service) *ChangeLogsService {
  334. rs := &ChangeLogsService{s: s}
  335. return rs
  336. }
  337. type ChangeLogsService struct {
  338. s *Service
  339. }
  340. func NewCitiesService(s *Service) *CitiesService {
  341. rs := &CitiesService{s: s}
  342. return rs
  343. }
  344. type CitiesService struct {
  345. s *Service
  346. }
  347. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  348. rs := &ConnectionTypesService{s: s}
  349. return rs
  350. }
  351. type ConnectionTypesService struct {
  352. s *Service
  353. }
  354. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  355. rs := &ContentCategoriesService{s: s}
  356. return rs
  357. }
  358. type ContentCategoriesService struct {
  359. s *Service
  360. }
  361. func NewConversionsService(s *Service) *ConversionsService {
  362. rs := &ConversionsService{s: s}
  363. return rs
  364. }
  365. type ConversionsService struct {
  366. s *Service
  367. }
  368. func NewCountriesService(s *Service) *CountriesService {
  369. rs := &CountriesService{s: s}
  370. return rs
  371. }
  372. type CountriesService struct {
  373. s *Service
  374. }
  375. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  376. rs := &CreativeAssetsService{s: s}
  377. return rs
  378. }
  379. type CreativeAssetsService struct {
  380. s *Service
  381. }
  382. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  383. rs := &CreativeFieldValuesService{s: s}
  384. return rs
  385. }
  386. type CreativeFieldValuesService struct {
  387. s *Service
  388. }
  389. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  390. rs := &CreativeFieldsService{s: s}
  391. return rs
  392. }
  393. type CreativeFieldsService struct {
  394. s *Service
  395. }
  396. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  397. rs := &CreativeGroupsService{s: s}
  398. return rs
  399. }
  400. type CreativeGroupsService struct {
  401. s *Service
  402. }
  403. func NewCreativesService(s *Service) *CreativesService {
  404. rs := &CreativesService{s: s}
  405. return rs
  406. }
  407. type CreativesService struct {
  408. s *Service
  409. }
  410. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  411. rs := &DimensionValuesService{s: s}
  412. return rs
  413. }
  414. type DimensionValuesService struct {
  415. s *Service
  416. }
  417. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  418. rs := &DirectorySitesService{s: s}
  419. return rs
  420. }
  421. type DirectorySitesService struct {
  422. s *Service
  423. }
  424. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  425. rs := &DynamicTargetingKeysService{s: s}
  426. return rs
  427. }
  428. type DynamicTargetingKeysService struct {
  429. s *Service
  430. }
  431. func NewEventTagsService(s *Service) *EventTagsService {
  432. rs := &EventTagsService{s: s}
  433. return rs
  434. }
  435. type EventTagsService struct {
  436. s *Service
  437. }
  438. func NewFilesService(s *Service) *FilesService {
  439. rs := &FilesService{s: s}
  440. return rs
  441. }
  442. type FilesService struct {
  443. s *Service
  444. }
  445. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  446. rs := &FloodlightActivitiesService{s: s}
  447. return rs
  448. }
  449. type FloodlightActivitiesService struct {
  450. s *Service
  451. }
  452. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  453. rs := &FloodlightActivityGroupsService{s: s}
  454. return rs
  455. }
  456. type FloodlightActivityGroupsService struct {
  457. s *Service
  458. }
  459. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  460. rs := &FloodlightConfigurationsService{s: s}
  461. return rs
  462. }
  463. type FloodlightConfigurationsService struct {
  464. s *Service
  465. }
  466. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  467. rs := &InventoryItemsService{s: s}
  468. return rs
  469. }
  470. type InventoryItemsService struct {
  471. s *Service
  472. }
  473. func NewLanguagesService(s *Service) *LanguagesService {
  474. rs := &LanguagesService{s: s}
  475. return rs
  476. }
  477. type LanguagesService struct {
  478. s *Service
  479. }
  480. func NewMetrosService(s *Service) *MetrosService {
  481. rs := &MetrosService{s: s}
  482. return rs
  483. }
  484. type MetrosService struct {
  485. s *Service
  486. }
  487. func NewMobileAppsService(s *Service) *MobileAppsService {
  488. rs := &MobileAppsService{s: s}
  489. return rs
  490. }
  491. type MobileAppsService struct {
  492. s *Service
  493. }
  494. func NewMobileCarriersService(s *Service) *MobileCarriersService {
  495. rs := &MobileCarriersService{s: s}
  496. return rs
  497. }
  498. type MobileCarriersService struct {
  499. s *Service
  500. }
  501. func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService {
  502. rs := &OperatingSystemVersionsService{s: s}
  503. return rs
  504. }
  505. type OperatingSystemVersionsService struct {
  506. s *Service
  507. }
  508. func NewOperatingSystemsService(s *Service) *OperatingSystemsService {
  509. rs := &OperatingSystemsService{s: s}
  510. return rs
  511. }
  512. type OperatingSystemsService struct {
  513. s *Service
  514. }
  515. func NewOrderDocumentsService(s *Service) *OrderDocumentsService {
  516. rs := &OrderDocumentsService{s: s}
  517. return rs
  518. }
  519. type OrderDocumentsService struct {
  520. s *Service
  521. }
  522. func NewOrdersService(s *Service) *OrdersService {
  523. rs := &OrdersService{s: s}
  524. return rs
  525. }
  526. type OrdersService struct {
  527. s *Service
  528. }
  529. func NewPlacementGroupsService(s *Service) *PlacementGroupsService {
  530. rs := &PlacementGroupsService{s: s}
  531. return rs
  532. }
  533. type PlacementGroupsService struct {
  534. s *Service
  535. }
  536. func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService {
  537. rs := &PlacementStrategiesService{s: s}
  538. return rs
  539. }
  540. type PlacementStrategiesService struct {
  541. s *Service
  542. }
  543. func NewPlacementsService(s *Service) *PlacementsService {
  544. rs := &PlacementsService{s: s}
  545. return rs
  546. }
  547. type PlacementsService struct {
  548. s *Service
  549. }
  550. func NewPlatformTypesService(s *Service) *PlatformTypesService {
  551. rs := &PlatformTypesService{s: s}
  552. return rs
  553. }
  554. type PlatformTypesService struct {
  555. s *Service
  556. }
  557. func NewPostalCodesService(s *Service) *PostalCodesService {
  558. rs := &PostalCodesService{s: s}
  559. return rs
  560. }
  561. type PostalCodesService struct {
  562. s *Service
  563. }
  564. func NewProjectsService(s *Service) *ProjectsService {
  565. rs := &ProjectsService{s: s}
  566. return rs
  567. }
  568. type ProjectsService struct {
  569. s *Service
  570. }
  571. func NewRegionsService(s *Service) *RegionsService {
  572. rs := &RegionsService{s: s}
  573. return rs
  574. }
  575. type RegionsService struct {
  576. s *Service
  577. }
  578. func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService {
  579. rs := &RemarketingListSharesService{s: s}
  580. return rs
  581. }
  582. type RemarketingListSharesService struct {
  583. s *Service
  584. }
  585. func NewRemarketingListsService(s *Service) *RemarketingListsService {
  586. rs := &RemarketingListsService{s: s}
  587. return rs
  588. }
  589. type RemarketingListsService struct {
  590. s *Service
  591. }
  592. func NewReportsService(s *Service) *ReportsService {
  593. rs := &ReportsService{s: s}
  594. rs.CompatibleFields = NewReportsCompatibleFieldsService(s)
  595. rs.Files = NewReportsFilesService(s)
  596. return rs
  597. }
  598. type ReportsService struct {
  599. s *Service
  600. CompatibleFields *ReportsCompatibleFieldsService
  601. Files *ReportsFilesService
  602. }
  603. func NewReportsCompatibleFieldsService(s *Service) *ReportsCompatibleFieldsService {
  604. rs := &ReportsCompatibleFieldsService{s: s}
  605. return rs
  606. }
  607. type ReportsCompatibleFieldsService struct {
  608. s *Service
  609. }
  610. func NewReportsFilesService(s *Service) *ReportsFilesService {
  611. rs := &ReportsFilesService{s: s}
  612. return rs
  613. }
  614. type ReportsFilesService struct {
  615. s *Service
  616. }
  617. func NewSitesService(s *Service) *SitesService {
  618. rs := &SitesService{s: s}
  619. return rs
  620. }
  621. type SitesService struct {
  622. s *Service
  623. }
  624. func NewSizesService(s *Service) *SizesService {
  625. rs := &SizesService{s: s}
  626. return rs
  627. }
  628. type SizesService struct {
  629. s *Service
  630. }
  631. func NewSubaccountsService(s *Service) *SubaccountsService {
  632. rs := &SubaccountsService{s: s}
  633. return rs
  634. }
  635. type SubaccountsService struct {
  636. s *Service
  637. }
  638. func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService {
  639. rs := &TargetableRemarketingListsService{s: s}
  640. return rs
  641. }
  642. type TargetableRemarketingListsService struct {
  643. s *Service
  644. }
  645. func NewTargetingTemplatesService(s *Service) *TargetingTemplatesService {
  646. rs := &TargetingTemplatesService{s: s}
  647. return rs
  648. }
  649. type TargetingTemplatesService struct {
  650. s *Service
  651. }
  652. func NewUserProfilesService(s *Service) *UserProfilesService {
  653. rs := &UserProfilesService{s: s}
  654. return rs
  655. }
  656. type UserProfilesService struct {
  657. s *Service
  658. }
  659. func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService {
  660. rs := &UserRolePermissionGroupsService{s: s}
  661. return rs
  662. }
  663. type UserRolePermissionGroupsService struct {
  664. s *Service
  665. }
  666. func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService {
  667. rs := &UserRolePermissionsService{s: s}
  668. return rs
  669. }
  670. type UserRolePermissionsService struct {
  671. s *Service
  672. }
  673. func NewUserRolesService(s *Service) *UserRolesService {
  674. rs := &UserRolesService{s: s}
  675. return rs
  676. }
  677. type UserRolesService struct {
  678. s *Service
  679. }
  680. func NewVideoFormatsService(s *Service) *VideoFormatsService {
  681. rs := &VideoFormatsService{s: s}
  682. return rs
  683. }
  684. type VideoFormatsService struct {
  685. s *Service
  686. }
  687. // Account: Contains properties of a Campaign Manager account.
  688. type Account struct {
  689. // AccountPermissionIds: Account permissions assigned to this account.
  690. AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"`
  691. // AccountProfile: Profile for this account. This is a read-only field
  692. // that can be left blank.
  693. //
  694. // Possible values:
  695. // "ACCOUNT_PROFILE_BASIC"
  696. // "ACCOUNT_PROFILE_STANDARD"
  697. AccountProfile string `json:"accountProfile,omitempty"`
  698. // Active: Whether this account is active.
  699. Active bool `json:"active,omitempty"`
  700. // ActiveAdsLimitTier: Maximum number of active ads allowed for this
  701. // account.
  702. //
  703. // Possible values:
  704. // "ACTIVE_ADS_TIER_100K"
  705. // "ACTIVE_ADS_TIER_1M"
  706. // "ACTIVE_ADS_TIER_200K"
  707. // "ACTIVE_ADS_TIER_300K"
  708. // "ACTIVE_ADS_TIER_40K"
  709. // "ACTIVE_ADS_TIER_500K"
  710. // "ACTIVE_ADS_TIER_750K"
  711. // "ACTIVE_ADS_TIER_75K"
  712. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  713. // ActiveViewOptOut: Whether to serve creatives with Active View tags.
  714. // If disabled, viewability data will not be available for any
  715. // impressions.
  716. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  717. // AvailablePermissionIds: User role permissions available to the user
  718. // roles of this account.
  719. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  720. // CountryId: ID of the country associated with this account.
  721. CountryId int64 `json:"countryId,omitempty,string"`
  722. // CurrencyId: ID of currency associated with this account. This is a
  723. // required field.
  724. // Acceptable values are:
  725. // - "1" for USD
  726. // - "2" for GBP
  727. // - "3" for ESP
  728. // - "4" for SEK
  729. // - "5" for CAD
  730. // - "6" for JPY
  731. // - "7" for DEM
  732. // - "8" for AUD
  733. // - "9" for FRF
  734. // - "10" for ITL
  735. // - "11" for DKK
  736. // - "12" for NOK
  737. // - "13" for FIM
  738. // - "14" for ZAR
  739. // - "15" for IEP
  740. // - "16" for NLG
  741. // - "17" for EUR
  742. // - "18" for KRW
  743. // - "19" for TWD
  744. // - "20" for SGD
  745. // - "21" for CNY
  746. // - "22" for HKD
  747. // - "23" for NZD
  748. // - "24" for MYR
  749. // - "25" for BRL
  750. // - "26" for PTE
  751. // - "27" for MXP
  752. // - "28" for CLP
  753. // - "29" for TRY
  754. // - "30" for ARS
  755. // - "31" for PEN
  756. // - "32" for ILS
  757. // - "33" for CHF
  758. // - "34" for VEF
  759. // - "35" for COP
  760. // - "36" for GTQ
  761. // - "37" for PLN
  762. // - "39" for INR
  763. // - "40" for THB
  764. // - "41" for IDR
  765. // - "42" for CZK
  766. // - "43" for RON
  767. // - "44" for HUF
  768. // - "45" for RUB
  769. // - "46" for AED
  770. // - "47" for BGN
  771. // - "48" for HRK
  772. // - "49" for MXN
  773. // - "50" for NGN
  774. CurrencyId int64 `json:"currencyId,omitempty,string"`
  775. // DefaultCreativeSizeId: Default placement dimensions for this account.
  776. DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"`
  777. // Description: Description of this account.
  778. Description string `json:"description,omitempty"`
  779. // Id: ID of this account. This is a read-only, auto-generated field.
  780. Id int64 `json:"id,omitempty,string"`
  781. // Kind: Identifies what kind of resource this is. Value: the fixed
  782. // string "dfareporting#account".
  783. Kind string `json:"kind,omitempty"`
  784. // Locale: Locale of this account.
  785. // Acceptable values are:
  786. // - "cs" (Czech)
  787. // - "de" (German)
  788. // - "en" (English)
  789. // - "en-GB" (English United Kingdom)
  790. // - "es" (Spanish)
  791. // - "fr" (French)
  792. // - "it" (Italian)
  793. // - "ja" (Japanese)
  794. // - "ko" (Korean)
  795. // - "pl" (Polish)
  796. // - "pt-BR" (Portuguese Brazil)
  797. // - "ru" (Russian)
  798. // - "sv" (Swedish)
  799. // - "tr" (Turkish)
  800. // - "zh-CN" (Chinese Simplified)
  801. // - "zh-TW" (Chinese Traditional)
  802. Locale string `json:"locale,omitempty"`
  803. // MaximumImageSize: Maximum image size allowed for this account, in
  804. // kilobytes. Value must be greater than or equal to 1.
  805. MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"`
  806. // Name: Name of this account. This is a required field, and must be
  807. // less than 128 characters long and be globally unique.
  808. Name string `json:"name,omitempty"`
  809. // NielsenOcrEnabled: Whether campaigns created in this account will be
  810. // enabled for Nielsen OCR reach ratings by default.
  811. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  812. // ReportsConfiguration: Reporting configuration of this account.
  813. ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"`
  814. // ShareReportsWithTwitter: Share Path to Conversion reports with
  815. // Twitter.
  816. ShareReportsWithTwitter bool `json:"shareReportsWithTwitter,omitempty"`
  817. // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser
  818. // creatives. Acceptable values are 1 to 10240, inclusive.
  819. TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"`
  820. // ServerResponse contains the HTTP response code and headers from the
  821. // server.
  822. googleapi.ServerResponse `json:"-"`
  823. // ForceSendFields is a list of field names (e.g.
  824. // "AccountPermissionIds") to unconditionally include in API requests.
  825. // By default, fields with empty values are omitted from API requests.
  826. // However, any non-pointer, non-interface field appearing in
  827. // ForceSendFields will be sent to the server regardless of whether the
  828. // field is empty or not. This may be used to include empty fields in
  829. // Patch requests.
  830. ForceSendFields []string `json:"-"`
  831. // NullFields is a list of field names (e.g. "AccountPermissionIds") to
  832. // include in API requests with the JSON null value. By default, fields
  833. // with empty values are omitted from API requests. However, any field
  834. // with an empty value appearing in NullFields will be sent to the
  835. // server as null. It is an error if a field in this list has a
  836. // non-empty value. This may be used to include null fields in Patch
  837. // requests.
  838. NullFields []string `json:"-"`
  839. }
  840. func (s *Account) MarshalJSON() ([]byte, error) {
  841. type NoMethod Account
  842. raw := NoMethod(*s)
  843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  844. }
  845. // AccountActiveAdSummary: Gets a summary of active ads in an account.
  846. type AccountActiveAdSummary struct {
  847. // AccountId: ID of the account.
  848. AccountId int64 `json:"accountId,omitempty,string"`
  849. // ActiveAds: Ads that have been activated for the account
  850. ActiveAds int64 `json:"activeAds,omitempty,string"`
  851. // ActiveAdsLimitTier: Maximum number of active ads allowed for the
  852. // account.
  853. //
  854. // Possible values:
  855. // "ACTIVE_ADS_TIER_100K"
  856. // "ACTIVE_ADS_TIER_1M"
  857. // "ACTIVE_ADS_TIER_200K"
  858. // "ACTIVE_ADS_TIER_300K"
  859. // "ACTIVE_ADS_TIER_40K"
  860. // "ACTIVE_ADS_TIER_500K"
  861. // "ACTIVE_ADS_TIER_750K"
  862. // "ACTIVE_ADS_TIER_75K"
  863. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  864. // AvailableAds: Ads that can be activated for the account.
  865. AvailableAds int64 `json:"availableAds,omitempty,string"`
  866. // Kind: Identifies what kind of resource this is. Value: the fixed
  867. // string "dfareporting#accountActiveAdSummary".
  868. Kind string `json:"kind,omitempty"`
  869. // ServerResponse contains the HTTP response code and headers from the
  870. // server.
  871. googleapi.ServerResponse `json:"-"`
  872. // ForceSendFields is a list of field names (e.g. "AccountId") to
  873. // unconditionally include in API requests. By default, fields with
  874. // empty values are omitted from API requests. However, any non-pointer,
  875. // non-interface field appearing in ForceSendFields will be sent to the
  876. // server regardless of whether the field is empty or not. This may be
  877. // used to include empty fields in Patch requests.
  878. ForceSendFields []string `json:"-"`
  879. // NullFields is a list of field names (e.g. "AccountId") to include in
  880. // API requests with the JSON null value. By default, fields with empty
  881. // values are omitted from API requests. However, any field with an
  882. // empty value appearing in NullFields will be sent to the server as
  883. // null. It is an error if a field in this list has a non-empty value.
  884. // This may be used to include null fields in Patch requests.
  885. NullFields []string `json:"-"`
  886. }
  887. func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) {
  888. type NoMethod AccountActiveAdSummary
  889. raw := NoMethod(*s)
  890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  891. }
  892. // AccountPermission: AccountPermissions contains information about a
  893. // particular account permission. Some features of Campaign Manager
  894. // require an account permission to be present in the account.
  895. type AccountPermission struct {
  896. // AccountProfiles: Account profiles associated with this account
  897. // permission.
  898. //
  899. // Possible values are:
  900. // - "ACCOUNT_PROFILE_BASIC"
  901. // - "ACCOUNT_PROFILE_STANDARD"
  902. //
  903. // Possible values:
  904. // "ACCOUNT_PROFILE_BASIC"
  905. // "ACCOUNT_PROFILE_STANDARD"
  906. AccountProfiles []string `json:"accountProfiles,omitempty"`
  907. // Id: ID of this account permission.
  908. Id int64 `json:"id,omitempty,string"`
  909. // Kind: Identifies what kind of resource this is. Value: the fixed
  910. // string "dfareporting#accountPermission".
  911. Kind string `json:"kind,omitempty"`
  912. // Level: Administrative level required to enable this account
  913. // permission.
  914. //
  915. // Possible values:
  916. // "ADMINISTRATOR"
  917. // "USER"
  918. Level string `json:"level,omitempty"`
  919. // Name: Name of this account permission.
  920. Name string `json:"name,omitempty"`
  921. // PermissionGroupId: Permission group of this account permission.
  922. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  923. // ServerResponse contains the HTTP response code and headers from the
  924. // server.
  925. googleapi.ServerResponse `json:"-"`
  926. // ForceSendFields is a list of field names (e.g. "AccountProfiles") to
  927. // unconditionally include in API requests. By default, fields with
  928. // empty values are omitted from API requests. However, any non-pointer,
  929. // non-interface field appearing in ForceSendFields will be sent to the
  930. // server regardless of whether the field is empty or not. This may be
  931. // used to include empty fields in Patch requests.
  932. ForceSendFields []string `json:"-"`
  933. // NullFields is a list of field names (e.g. "AccountProfiles") to
  934. // include in API requests with the JSON null value. By default, fields
  935. // with empty values are omitted from API requests. However, any field
  936. // with an empty value appearing in NullFields will be sent to the
  937. // server as null. It is an error if a field in this list has a
  938. // non-empty value. This may be used to include null fields in Patch
  939. // requests.
  940. NullFields []string `json:"-"`
  941. }
  942. func (s *AccountPermission) MarshalJSON() ([]byte, error) {
  943. type NoMethod AccountPermission
  944. raw := NoMethod(*s)
  945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  946. }
  947. // AccountPermissionGroup: AccountPermissionGroups contains a mapping of
  948. // permission group IDs to names. A permission group is a grouping of
  949. // account permissions.
  950. type AccountPermissionGroup struct {
  951. // Id: ID of this account permission group.
  952. Id int64 `json:"id,omitempty,string"`
  953. // Kind: Identifies what kind of resource this is. Value: the fixed
  954. // string "dfareporting#accountPermissionGroup".
  955. Kind string `json:"kind,omitempty"`
  956. // Name: Name of this account permission group.
  957. Name string `json:"name,omitempty"`
  958. // ServerResponse contains the HTTP response code and headers from the
  959. // server.
  960. googleapi.ServerResponse `json:"-"`
  961. // ForceSendFields is a list of field names (e.g. "Id") to
  962. // unconditionally include in API requests. By default, fields with
  963. // empty values are omitted from API requests. However, any non-pointer,
  964. // non-interface field appearing in ForceSendFields will be sent to the
  965. // server regardless of whether the field is empty or not. This may be
  966. // used to include empty fields in Patch requests.
  967. ForceSendFields []string `json:"-"`
  968. // NullFields is a list of field names (e.g. "Id") to include in API
  969. // requests with the JSON null value. By default, fields with empty
  970. // values are omitted from API requests. However, any field with an
  971. // empty value appearing in NullFields will be sent to the server as
  972. // null. It is an error if a field in this list has a non-empty value.
  973. // This may be used to include null fields in Patch requests.
  974. NullFields []string `json:"-"`
  975. }
  976. func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) {
  977. type NoMethod AccountPermissionGroup
  978. raw := NoMethod(*s)
  979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  980. }
  981. // AccountPermissionGroupsListResponse: Account Permission Group List
  982. // Response
  983. type AccountPermissionGroupsListResponse struct {
  984. // AccountPermissionGroups: Account permission group collection.
  985. AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"`
  986. // Kind: Identifies what kind of resource this is. Value: the fixed
  987. // string "dfareporting#accountPermissionGroupsListResponse".
  988. Kind string `json:"kind,omitempty"`
  989. // ServerResponse contains the HTTP response code and headers from the
  990. // server.
  991. googleapi.ServerResponse `json:"-"`
  992. // ForceSendFields is a list of field names (e.g.
  993. // "AccountPermissionGroups") to unconditionally include in API
  994. // requests. By default, fields with empty values are omitted from API
  995. // requests. However, any non-pointer, non-interface field appearing in
  996. // ForceSendFields will be sent to the server regardless of whether the
  997. // field is empty or not. This may be used to include empty fields in
  998. // Patch requests.
  999. ForceSendFields []string `json:"-"`
  1000. // NullFields is a list of field names (e.g. "AccountPermissionGroups")
  1001. // to include in API requests with the JSON null value. By default,
  1002. // fields with empty values are omitted from API requests. However, any
  1003. // field with an empty value appearing in NullFields will be sent to the
  1004. // server as null. It is an error if a field in this list has a
  1005. // non-empty value. This may be used to include null fields in Patch
  1006. // requests.
  1007. NullFields []string `json:"-"`
  1008. }
  1009. func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  1010. type NoMethod AccountPermissionGroupsListResponse
  1011. raw := NoMethod(*s)
  1012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1013. }
  1014. // AccountPermissionsListResponse: Account Permission List Response
  1015. type AccountPermissionsListResponse struct {
  1016. // AccountPermissions: Account permission collection.
  1017. AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"`
  1018. // Kind: Identifies what kind of resource this is. Value: the fixed
  1019. // string "dfareporting#accountPermissionsListResponse".
  1020. Kind string `json:"kind,omitempty"`
  1021. // ServerResponse contains the HTTP response code and headers from the
  1022. // server.
  1023. googleapi.ServerResponse `json:"-"`
  1024. // ForceSendFields is a list of field names (e.g. "AccountPermissions")
  1025. // to unconditionally include in API requests. By default, fields with
  1026. // empty values are omitted from API requests. However, any non-pointer,
  1027. // non-interface field appearing in ForceSendFields will be sent to the
  1028. // server regardless of whether the field is empty or not. This may be
  1029. // used to include empty fields in Patch requests.
  1030. ForceSendFields []string `json:"-"`
  1031. // NullFields is a list of field names (e.g. "AccountPermissions") to
  1032. // include in API requests with the JSON null value. By default, fields
  1033. // with empty values are omitted from API requests. However, any field
  1034. // with an empty value appearing in NullFields will be sent to the
  1035. // server as null. It is an error if a field in this list has a
  1036. // non-empty value. This may be used to include null fields in Patch
  1037. // requests.
  1038. NullFields []string `json:"-"`
  1039. }
  1040. func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) {
  1041. type NoMethod AccountPermissionsListResponse
  1042. raw := NoMethod(*s)
  1043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1044. }
  1045. // AccountUserProfile: AccountUserProfiles contains properties of a
  1046. // Campaign Manager user profile. This resource is specifically for
  1047. // managing user profiles, whereas UserProfiles is for accessing the
  1048. // API.
  1049. type AccountUserProfile struct {
  1050. // AccountId: Account ID of the user profile. This is a read-only field
  1051. // that can be left blank.
  1052. AccountId int64 `json:"accountId,omitempty,string"`
  1053. // Active: Whether this user profile is active. This defaults to false,
  1054. // and must be set true on insert for the user profile to be usable.
  1055. Active bool `json:"active,omitempty"`
  1056. // AdvertiserFilter: Filter that describes which advertisers are visible
  1057. // to the user profile.
  1058. AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"`
  1059. // CampaignFilter: Filter that describes which campaigns are visible to
  1060. // the user profile.
  1061. CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"`
  1062. // Comments: Comments for this user profile.
  1063. Comments string `json:"comments,omitempty"`
  1064. // Email: Email of the user profile. The email addresss must be linked
  1065. // to a Google Account. This field is required on insertion and is
  1066. // read-only after insertion.
  1067. Email string `json:"email,omitempty"`
  1068. // Id: ID of the user profile. This is a read-only, auto-generated
  1069. // field.
  1070. Id int64 `json:"id,omitempty,string"`
  1071. // Kind: Identifies what kind of resource this is. Value: the fixed
  1072. // string "dfareporting#accountUserProfile".
  1073. Kind string `json:"kind,omitempty"`
  1074. // Locale: Locale of the user profile. This is a required
  1075. // field.
  1076. // Acceptable values are:
  1077. // - "cs" (Czech)
  1078. // - "de" (German)
  1079. // - "en" (English)
  1080. // - "en-GB" (English United Kingdom)
  1081. // - "es" (Spanish)
  1082. // - "fr" (French)
  1083. // - "it" (Italian)
  1084. // - "ja" (Japanese)
  1085. // - "ko" (Korean)
  1086. // - "pl" (Polish)
  1087. // - "pt-BR" (Portuguese Brazil)
  1088. // - "ru" (Russian)
  1089. // - "sv" (Swedish)
  1090. // - "tr" (Turkish)
  1091. // - "zh-CN" (Chinese Simplified)
  1092. // - "zh-TW" (Chinese Traditional)
  1093. Locale string `json:"locale,omitempty"`
  1094. // Name: Name of the user profile. This is a required field. Must be
  1095. // less than 64 characters long, must be globally unique, and cannot
  1096. // contain whitespace or any of the following characters: "&;"#%,".
  1097. Name string `json:"name,omitempty"`
  1098. // SiteFilter: Filter that describes which sites are visible to the user
  1099. // profile.
  1100. SiteFilter *ObjectFilter `json:"siteFilter,omitempty"`
  1101. // SubaccountId: Subaccount ID of the user profile. This is a read-only
  1102. // field that can be left blank.
  1103. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1104. // TraffickerType: Trafficker type of this user profile. This is a
  1105. // read-only field.
  1106. //
  1107. // Possible values:
  1108. // "EXTERNAL_TRAFFICKER"
  1109. // "INTERNAL_NON_TRAFFICKER"
  1110. // "INTERNAL_TRAFFICKER"
  1111. TraffickerType string `json:"traffickerType,omitempty"`
  1112. // UserAccessType: User type of the user profile. This is a read-only
  1113. // field that can be left blank.
  1114. //
  1115. // Possible values:
  1116. // "INTERNAL_ADMINISTRATOR"
  1117. // "NORMAL_USER"
  1118. // "READ_ONLY_SUPER_USER"
  1119. // "SUPER_USER"
  1120. UserAccessType string `json:"userAccessType,omitempty"`
  1121. // UserRoleFilter: Filter that describes which user roles are visible to
  1122. // the user profile.
  1123. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1124. // UserRoleId: User role ID of the user profile. This is a required
  1125. // field.
  1126. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1127. // ServerResponse contains the HTTP response code and headers from the
  1128. // server.
  1129. googleapi.ServerResponse `json:"-"`
  1130. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1131. // unconditionally include in API requests. By default, fields with
  1132. // empty values are omitted from API requests. However, any non-pointer,
  1133. // non-interface field appearing in ForceSendFields will be sent to the
  1134. // server regardless of whether the field is empty or not. This may be
  1135. // used to include empty fields in Patch requests.
  1136. ForceSendFields []string `json:"-"`
  1137. // NullFields is a list of field names (e.g. "AccountId") to include in
  1138. // API requests with the JSON null value. By default, fields with empty
  1139. // values are omitted from API requests. However, any field with an
  1140. // empty value appearing in NullFields will be sent to the server as
  1141. // null. It is an error if a field in this list has a non-empty value.
  1142. // This may be used to include null fields in Patch requests.
  1143. NullFields []string `json:"-"`
  1144. }
  1145. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1146. type NoMethod AccountUserProfile
  1147. raw := NoMethod(*s)
  1148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1149. }
  1150. // AccountUserProfilesListResponse: Account User Profile List Response
  1151. type AccountUserProfilesListResponse struct {
  1152. // AccountUserProfiles: Account user profile collection.
  1153. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1154. // Kind: Identifies what kind of resource this is. Value: the fixed
  1155. // string "dfareporting#accountUserProfilesListResponse".
  1156. Kind string `json:"kind,omitempty"`
  1157. // NextPageToken: Pagination token to be used for the next list
  1158. // operation.
  1159. NextPageToken string `json:"nextPageToken,omitempty"`
  1160. // ServerResponse contains the HTTP response code and headers from the
  1161. // server.
  1162. googleapi.ServerResponse `json:"-"`
  1163. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1164. // to unconditionally include in API requests. By default, fields with
  1165. // empty values are omitted from API requests. However, any non-pointer,
  1166. // non-interface field appearing in ForceSendFields will be sent to the
  1167. // server regardless of whether the field is empty or not. This may be
  1168. // used to include empty fields in Patch requests.
  1169. ForceSendFields []string `json:"-"`
  1170. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1171. // include in API requests with the JSON null value. By default, fields
  1172. // with empty values are omitted from API requests. However, any field
  1173. // with an empty value appearing in NullFields will be sent to the
  1174. // server as null. It is an error if a field in this list has a
  1175. // non-empty value. This may be used to include null fields in Patch
  1176. // requests.
  1177. NullFields []string `json:"-"`
  1178. }
  1179. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1180. type NoMethod AccountUserProfilesListResponse
  1181. raw := NoMethod(*s)
  1182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1183. }
  1184. // AccountsListResponse: Account List Response
  1185. type AccountsListResponse struct {
  1186. // Accounts: Account collection.
  1187. Accounts []*Account `json:"accounts,omitempty"`
  1188. // Kind: Identifies what kind of resource this is. Value: the fixed
  1189. // string "dfareporting#accountsListResponse".
  1190. Kind string `json:"kind,omitempty"`
  1191. // NextPageToken: Pagination token to be used for the next list
  1192. // operation.
  1193. NextPageToken string `json:"nextPageToken,omitempty"`
  1194. // ServerResponse contains the HTTP response code and headers from the
  1195. // server.
  1196. googleapi.ServerResponse `json:"-"`
  1197. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1198. // unconditionally include in API requests. By default, fields with
  1199. // empty values are omitted from API requests. However, any non-pointer,
  1200. // non-interface field appearing in ForceSendFields will be sent to the
  1201. // server regardless of whether the field is empty or not. This may be
  1202. // used to include empty fields in Patch requests.
  1203. ForceSendFields []string `json:"-"`
  1204. // NullFields is a list of field names (e.g. "Accounts") to include in
  1205. // API requests with the JSON null value. By default, fields with empty
  1206. // values are omitted from API requests. However, any field with an
  1207. // empty value appearing in NullFields will be sent to the server as
  1208. // null. It is an error if a field in this list has a non-empty value.
  1209. // This may be used to include null fields in Patch requests.
  1210. NullFields []string `json:"-"`
  1211. }
  1212. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1213. type NoMethod AccountsListResponse
  1214. raw := NoMethod(*s)
  1215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1216. }
  1217. // Activities: Represents an activity group.
  1218. type Activities struct {
  1219. // Filters: List of activity filters. The dimension values need to be
  1220. // all either of type "dfa:activity" or "dfa:activityGroup".
  1221. Filters []*DimensionValue `json:"filters,omitempty"`
  1222. // Kind: The kind of resource this is, in this case
  1223. // dfareporting#activities.
  1224. Kind string `json:"kind,omitempty"`
  1225. // MetricNames: List of names of floodlight activity metrics.
  1226. MetricNames []string `json:"metricNames,omitempty"`
  1227. // ForceSendFields is a list of field names (e.g. "Filters") to
  1228. // unconditionally include in API requests. By default, fields with
  1229. // empty values are omitted from API requests. However, any non-pointer,
  1230. // non-interface field appearing in ForceSendFields will be sent to the
  1231. // server regardless of whether the field is empty or not. This may be
  1232. // used to include empty fields in Patch requests.
  1233. ForceSendFields []string `json:"-"`
  1234. // NullFields is a list of field names (e.g. "Filters") to include in
  1235. // API requests with the JSON null value. By default, fields with empty
  1236. // values are omitted from API requests. However, any field with an
  1237. // empty value appearing in NullFields will be sent to the server as
  1238. // null. It is an error if a field in this list has a non-empty value.
  1239. // This may be used to include null fields in Patch requests.
  1240. NullFields []string `json:"-"`
  1241. }
  1242. func (s *Activities) MarshalJSON() ([]byte, error) {
  1243. type NoMethod Activities
  1244. raw := NoMethod(*s)
  1245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1246. }
  1247. // Ad: Contains properties of a Campaign Manager ad.
  1248. type Ad struct {
  1249. // AccountId: Account ID of this ad. This is a read-only field that can
  1250. // be left blank.
  1251. AccountId int64 `json:"accountId,omitempty,string"`
  1252. // Active: Whether this ad is active. When true, archived must be false.
  1253. Active bool `json:"active,omitempty"`
  1254. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1255. // insertion.
  1256. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1257. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1258. // advertiser. This is a read-only, auto-generated field.
  1259. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1260. // Archived: Whether this ad is archived. When true, active must be
  1261. // false.
  1262. Archived bool `json:"archived,omitempty"`
  1263. // AudienceSegmentId: Audience segment ID that is being targeted for
  1264. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1265. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1266. // CampaignId: Campaign ID of this ad. This is a required field on
  1267. // insertion.
  1268. CampaignId int64 `json:"campaignId,omitempty,string"`
  1269. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1270. // This is a read-only, auto-generated field.
  1271. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1272. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1273. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1274. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1275. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1276. // for this ad. Applies to the URL in the ad or (if overriding ad
  1277. // properties) the URL in the creative.
  1278. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1279. // Comments: Comments for this ad.
  1280. Comments string `json:"comments,omitempty"`
  1281. // Compatibility: Compatibility of this ad. Applicable when type is
  1282. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1283. // either rendering on desktop or on mobile devices or in mobile apps
  1284. // for regular or interstitial ads, respectively. APP and
  1285. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1286. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1287. // default ads created for those placements will be limited to those
  1288. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1289. // video ads developed with the VAST standard.
  1290. //
  1291. // Possible values:
  1292. // "APP"
  1293. // "APP_INTERSTITIAL"
  1294. // "DISPLAY"
  1295. // "DISPLAY_INTERSTITIAL"
  1296. // "IN_STREAM_AUDIO"
  1297. // "IN_STREAM_VIDEO"
  1298. Compatibility string `json:"compatibility,omitempty"`
  1299. // CreateInfo: Information about the creation of this ad. This is a
  1300. // read-only field.
  1301. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1302. // CreativeGroupAssignments: Creative group assignments for this ad.
  1303. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1304. // per creative group number is allowed for a maximum of two
  1305. // assignments.
  1306. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1307. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1308. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1309. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1310. // should have exactly one creativeAssignment.
  1311. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1312. // DayPartTargeting: Time and day targeting information for this ad.
  1313. // This field must be left blank if the ad is using a targeting
  1314. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1315. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1316. // DefaultClickThroughEventTagProperties: Default click-through event
  1317. // tag properties for this ad.
  1318. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1319. // DeliverySchedule: Delivery schedule information for this ad.
  1320. // Applicable when type is AD_SERVING_STANDARD_AD or
  1321. // AD_SERVING_TRACKING. This field along with subfields priority and
  1322. // impressionRatio are required on insertion when type is
  1323. // AD_SERVING_STANDARD_AD.
  1324. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1325. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1326. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1327. // field on insert, and is read-only after insert.
  1328. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1329. // EndTime: Date and time that this ad should stop serving. Must be
  1330. // later than the start time. This is a required field on insertion.
  1331. EndTime string `json:"endTime,omitempty"`
  1332. // EventTagOverrides: Event tag overrides for this ad.
  1333. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1334. // GeoTargeting: Geographical targeting information for this ad. This
  1335. // field must be left blank if the ad is using a targeting template.
  1336. // Applicable when type is AD_SERVING_STANDARD_AD.
  1337. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1338. // Id: ID of this ad. This is a read-only, auto-generated field.
  1339. Id int64 `json:"id,omitempty,string"`
  1340. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1341. // read-only, auto-generated field.
  1342. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1343. // KeyValueTargetingExpression: Key-value targeting information for this
  1344. // ad. This field must be left blank if the ad is using a targeting
  1345. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1346. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1347. // Kind: Identifies what kind of resource this is. Value: the fixed
  1348. // string "dfareporting#ad".
  1349. Kind string `json:"kind,omitempty"`
  1350. // LanguageTargeting: Language targeting information for this ad. This
  1351. // field must be left blank if the ad is using a targeting template.
  1352. // Applicable when type is AD_SERVING_STANDARD_AD.
  1353. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1354. // LastModifiedInfo: Information about the most recent modification of
  1355. // this ad. This is a read-only field.
  1356. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1357. // Name: Name of this ad. This is a required field and must be less than
  1358. // 256 characters long.
  1359. Name string `json:"name,omitempty"`
  1360. // PlacementAssignments: Placement assignments for this ad.
  1361. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1362. // RemarketingListExpression: Remarketing list targeting expression for
  1363. // this ad. This field must be left blank if the ad is using a targeting
  1364. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1365. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1366. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1367. Size *Size `json:"size,omitempty"`
  1368. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1369. // field that is auto-generated when the ad is inserted or updated.
  1370. SslCompliant bool `json:"sslCompliant,omitempty"`
  1371. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1372. // that is auto-generated when the ad is inserted or updated.
  1373. SslRequired bool `json:"sslRequired,omitempty"`
  1374. // StartTime: Date and time that this ad should start serving. If
  1375. // creating an ad, this field must be a time in the future. This is a
  1376. // required field on insertion.
  1377. StartTime string `json:"startTime,omitempty"`
  1378. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1379. // that can be left blank.
  1380. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1381. // TargetingTemplateId: Targeting template ID, used to apply
  1382. // preconfigured targeting information to this ad. This cannot be set
  1383. // while any of dayPartTargeting, geoTargeting,
  1384. // keyValueTargetingExpression, languageTargeting,
  1385. // remarketingListExpression, or technologyTargeting are set. Applicable
  1386. // when type is AD_SERVING_STANDARD_AD.
  1387. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1388. // TechnologyTargeting: Technology platform targeting information for
  1389. // this ad. This field must be left blank if the ad is using a targeting
  1390. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1391. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1392. // Type: Type of ad. This is a required field on insertion. Note that
  1393. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1394. // Creative resource).
  1395. //
  1396. // Possible values:
  1397. // "AD_SERVING_CLICK_TRACKER"
  1398. // "AD_SERVING_DEFAULT_AD"
  1399. // "AD_SERVING_STANDARD_AD"
  1400. // "AD_SERVING_TRACKING"
  1401. Type string `json:"type,omitempty"`
  1402. // ServerResponse contains the HTTP response code and headers from the
  1403. // server.
  1404. googleapi.ServerResponse `json:"-"`
  1405. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1406. // unconditionally include in API requests. By default, fields with
  1407. // empty values are omitted from API requests. However, any non-pointer,
  1408. // non-interface field appearing in ForceSendFields will be sent to the
  1409. // server regardless of whether the field is empty or not. This may be
  1410. // used to include empty fields in Patch requests.
  1411. ForceSendFields []string `json:"-"`
  1412. // NullFields is a list of field names (e.g. "AccountId") to include in
  1413. // API requests with the JSON null value. By default, fields with empty
  1414. // values are omitted from API requests. However, any field with an
  1415. // empty value appearing in NullFields will be sent to the server as
  1416. // null. It is an error if a field in this list has a non-empty value.
  1417. // This may be used to include null fields in Patch requests.
  1418. NullFields []string `json:"-"`
  1419. }
  1420. func (s *Ad) MarshalJSON() ([]byte, error) {
  1421. type NoMethod Ad
  1422. raw := NoMethod(*s)
  1423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1424. }
  1425. // AdBlockingConfiguration: Campaign ad blocking settings.
  1426. type AdBlockingConfiguration struct {
  1427. // ClickThroughUrl: Click-through URL used by brand-neutral ads. This is
  1428. // a required field when overrideClickThroughUrl is set to true.
  1429. ClickThroughUrl string `json:"clickThroughUrl,omitempty"`
  1430. // CreativeBundleId: ID of a creative bundle to use for this campaign.
  1431. // If set, brand-neutral ads will select creatives from this bundle.
  1432. // Otherwise, a default transparent pixel will be used.
  1433. CreativeBundleId int64 `json:"creativeBundleId,omitempty,string"`
  1434. // Enabled: Whether this campaign has enabled ad blocking. When true, ad
  1435. // blocking is enabled for placements in the campaign, but this may be
  1436. // overridden by site and placement settings. When false, ad blocking is
  1437. // disabled for all placements under the campaign, regardless of site
  1438. // and placement settings.
  1439. Enabled bool `json:"enabled,omitempty"`
  1440. // OverrideClickThroughUrl: Whether the brand-neutral ad's click-through
  1441. // URL comes from the campaign's creative bundle or the override URL.
  1442. // Must be set to true if ad blocking is enabled and no creative bundle
  1443. // is configured.
  1444. OverrideClickThroughUrl bool `json:"overrideClickThroughUrl,omitempty"`
  1445. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  1446. // unconditionally include in API requests. By default, fields with
  1447. // empty values are omitted from API requests. However, any non-pointer,
  1448. // non-interface field appearing in ForceSendFields will be sent to the
  1449. // server regardless of whether the field is empty or not. This may be
  1450. // used to include empty fields in Patch requests.
  1451. ForceSendFields []string `json:"-"`
  1452. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  1453. // include in API requests with the JSON null value. By default, fields
  1454. // with empty values are omitted from API requests. However, any field
  1455. // with an empty value appearing in NullFields will be sent to the
  1456. // server as null. It is an error if a field in this list has a
  1457. // non-empty value. This may be used to include null fields in Patch
  1458. // requests.
  1459. NullFields []string `json:"-"`
  1460. }
  1461. func (s *AdBlockingConfiguration) MarshalJSON() ([]byte, error) {
  1462. type NoMethod AdBlockingConfiguration
  1463. raw := NoMethod(*s)
  1464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1465. }
  1466. // AdSlot: Ad Slot
  1467. type AdSlot struct {
  1468. // Comment: Comment for this ad slot.
  1469. Comment string `json:"comment,omitempty"`
  1470. // Compatibility: Ad slot compatibility. DISPLAY and
  1471. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1472. // devices or in mobile apps for regular or interstitial ads
  1473. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1474. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1475. // developed with the VAST standard.
  1476. //
  1477. // Possible values:
  1478. // "APP"
  1479. // "APP_INTERSTITIAL"
  1480. // "DISPLAY"
  1481. // "DISPLAY_INTERSTITIAL"
  1482. // "IN_STREAM_AUDIO"
  1483. // "IN_STREAM_VIDEO"
  1484. Compatibility string `json:"compatibility,omitempty"`
  1485. // Height: Height of this ad slot.
  1486. Height int64 `json:"height,omitempty,string"`
  1487. // LinkedPlacementId: ID of the placement from an external platform that
  1488. // is linked to this ad slot.
  1489. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1490. // Name: Name of this ad slot.
  1491. Name string `json:"name,omitempty"`
  1492. // PaymentSourceType: Payment source type of this ad slot.
  1493. //
  1494. // Possible values:
  1495. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1496. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1497. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1498. // Primary: Primary ad slot of a roadblock inventory item.
  1499. Primary bool `json:"primary,omitempty"`
  1500. // Width: Width of this ad slot.
  1501. Width int64 `json:"width,omitempty,string"`
  1502. // ForceSendFields is a list of field names (e.g. "Comment") to
  1503. // unconditionally include in API requests. By default, fields with
  1504. // empty values are omitted from API requests. However, any non-pointer,
  1505. // non-interface field appearing in ForceSendFields will be sent to the
  1506. // server regardless of whether the field is empty or not. This may be
  1507. // used to include empty fields in Patch requests.
  1508. ForceSendFields []string `json:"-"`
  1509. // NullFields is a list of field names (e.g. "Comment") to include in
  1510. // API requests with the JSON null value. By default, fields with empty
  1511. // values are omitted from API requests. However, any field with an
  1512. // empty value appearing in NullFields will be sent to the server as
  1513. // null. It is an error if a field in this list has a non-empty value.
  1514. // This may be used to include null fields in Patch requests.
  1515. NullFields []string `json:"-"`
  1516. }
  1517. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1518. type NoMethod AdSlot
  1519. raw := NoMethod(*s)
  1520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1521. }
  1522. // AdsListResponse: Ad List Response
  1523. type AdsListResponse struct {
  1524. // Ads: Ad collection.
  1525. Ads []*Ad `json:"ads,omitempty"`
  1526. // Kind: Identifies what kind of resource this is. Value: the fixed
  1527. // string "dfareporting#adsListResponse".
  1528. Kind string `json:"kind,omitempty"`
  1529. // NextPageToken: Pagination token to be used for the next list
  1530. // operation.
  1531. NextPageToken string `json:"nextPageToken,omitempty"`
  1532. // ServerResponse contains the HTTP response code and headers from the
  1533. // server.
  1534. googleapi.ServerResponse `json:"-"`
  1535. // ForceSendFields is a list of field names (e.g. "Ads") to
  1536. // unconditionally include in API requests. By default, fields with
  1537. // empty values are omitted from API requests. However, any non-pointer,
  1538. // non-interface field appearing in ForceSendFields will be sent to the
  1539. // server regardless of whether the field is empty or not. This may be
  1540. // used to include empty fields in Patch requests.
  1541. ForceSendFields []string `json:"-"`
  1542. // NullFields is a list of field names (e.g. "Ads") to include in API
  1543. // requests with the JSON null value. By default, fields with empty
  1544. // values are omitted from API requests. However, any field with an
  1545. // empty value appearing in NullFields will be sent to the server as
  1546. // null. It is an error if a field in this list has a non-empty value.
  1547. // This may be used to include null fields in Patch requests.
  1548. NullFields []string `json:"-"`
  1549. }
  1550. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1551. type NoMethod AdsListResponse
  1552. raw := NoMethod(*s)
  1553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1554. }
  1555. // Advertiser: Contains properties of a Campaign Manager advertiser.
  1556. type Advertiser struct {
  1557. // AccountId: Account ID of this advertiser.This is a read-only field
  1558. // that can be left blank.
  1559. AccountId int64 `json:"accountId,omitempty,string"`
  1560. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1561. // to. You can group advertisers for reporting purposes, allowing you to
  1562. // see aggregated information for all advertisers in each group.
  1563. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1564. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1565. // creative associations under this advertiser. Must be less than 129
  1566. // characters long.
  1567. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1568. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1569. // apply by default to the landing pages of this advertiser's campaigns.
  1570. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1571. // DefaultEmail: Default email address used in sender field for tag
  1572. // emails.
  1573. DefaultEmail string `json:"defaultEmail,omitempty"`
  1574. // FloodlightConfigurationId: Floodlight configuration ID of this
  1575. // advertiser. The floodlight configuration ID will be created
  1576. // automatically, so on insert this field should be left blank. This
  1577. // field can be set to another advertiser's floodlight configuration ID
  1578. // in order to share that advertiser's floodlight configuration with
  1579. // this advertiser, so long as:
  1580. // - This advertiser's original floodlight configuration is not already
  1581. // associated with floodlight activities or floodlight activity groups.
  1582. //
  1583. // - This advertiser's original floodlight configuration is not already
  1584. // shared with another advertiser.
  1585. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1586. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1587. // of the floodlight configuration. This is a read-only, auto-generated
  1588. // field.
  1589. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1590. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1591. Id int64 `json:"id,omitempty,string"`
  1592. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1593. // is a read-only, auto-generated field.
  1594. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1595. // Kind: Identifies what kind of resource this is. Value: the fixed
  1596. // string "dfareporting#advertiser".
  1597. Kind string `json:"kind,omitempty"`
  1598. // Name: Name of this advertiser. This is a required field and must be
  1599. // less than 256 characters long and unique among advertisers of the
  1600. // same account.
  1601. Name string `json:"name,omitempty"`
  1602. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1603. // before any sharing occurred. Set the floodlightConfigurationId of
  1604. // this advertiser to originalFloodlightConfigurationId to unshare the
  1605. // advertiser's current floodlight configuration. You cannot unshare an
  1606. // advertiser's floodlight configuration if the shared configuration has
  1607. // activities associated with any campaign or placement.
  1608. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1609. // Status: Status of this advertiser.
  1610. //
  1611. // Possible values:
  1612. // "APPROVED"
  1613. // "ON_HOLD"
  1614. Status string `json:"status,omitempty"`
  1615. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1616. // field that can be left blank.
  1617. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1618. // Suspended: Suspension status of this advertiser.
  1619. Suspended bool `json:"suspended,omitempty"`
  1620. // ServerResponse contains the HTTP response code and headers from the
  1621. // server.
  1622. googleapi.ServerResponse `json:"-"`
  1623. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1624. // unconditionally include in API requests. By default, fields with
  1625. // empty values are omitted from API requests. However, any non-pointer,
  1626. // non-interface field appearing in ForceSendFields will be sent to the
  1627. // server regardless of whether the field is empty or not. This may be
  1628. // used to include empty fields in Patch requests.
  1629. ForceSendFields []string `json:"-"`
  1630. // NullFields is a list of field names (e.g. "AccountId") to include in
  1631. // API requests with the JSON null value. By default, fields with empty
  1632. // values are omitted from API requests. However, any field with an
  1633. // empty value appearing in NullFields will be sent to the server as
  1634. // null. It is an error if a field in this list has a non-empty value.
  1635. // This may be used to include null fields in Patch requests.
  1636. NullFields []string `json:"-"`
  1637. }
  1638. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1639. type NoMethod Advertiser
  1640. raw := NoMethod(*s)
  1641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1642. }
  1643. // AdvertiserGroup: Groups advertisers together so that reports can be
  1644. // generated for the entire group at once.
  1645. type AdvertiserGroup struct {
  1646. // AccountId: Account ID of this advertiser group. This is a read-only
  1647. // field that can be left blank.
  1648. AccountId int64 `json:"accountId,omitempty,string"`
  1649. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1650. // field.
  1651. Id int64 `json:"id,omitempty,string"`
  1652. // Kind: Identifies what kind of resource this is. Value: the fixed
  1653. // string "dfareporting#advertiserGroup".
  1654. Kind string `json:"kind,omitempty"`
  1655. // Name: Name of this advertiser group. This is a required field and
  1656. // must be less than 256 characters long and unique among advertiser
  1657. // groups of the same account.
  1658. Name string `json:"name,omitempty"`
  1659. // ServerResponse contains the HTTP response code and headers from the
  1660. // server.
  1661. googleapi.ServerResponse `json:"-"`
  1662. // ForceSendFields is a list of field names (e.g. "AccountId") 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. "AccountId") 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 *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1678. type NoMethod AdvertiserGroup
  1679. raw := NoMethod(*s)
  1680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1681. }
  1682. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1683. type AdvertiserGroupsListResponse struct {
  1684. // AdvertiserGroups: Advertiser group collection.
  1685. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1686. // Kind: Identifies what kind of resource this is. Value: the fixed
  1687. // string "dfareporting#advertiserGroupsListResponse".
  1688. Kind string `json:"kind,omitempty"`
  1689. // NextPageToken: Pagination token to be used for the next list
  1690. // operation.
  1691. NextPageToken string `json:"nextPageToken,omitempty"`
  1692. // ServerResponse contains the HTTP response code and headers from the
  1693. // server.
  1694. googleapi.ServerResponse `json:"-"`
  1695. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1696. // unconditionally include in API requests. By default, fields with
  1697. // empty values are omitted from API requests. However, any non-pointer,
  1698. // non-interface field appearing in ForceSendFields will be sent to the
  1699. // server regardless of whether the field is empty or not. This may be
  1700. // used to include empty fields in Patch requests.
  1701. ForceSendFields []string `json:"-"`
  1702. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1703. // include in API requests with the JSON null value. By default, fields
  1704. // with empty values are omitted from API requests. However, any field
  1705. // with an empty value appearing in NullFields will be sent to the
  1706. // server as null. It is an error if a field in this list has a
  1707. // non-empty value. This may be used to include null fields in Patch
  1708. // requests.
  1709. NullFields []string `json:"-"`
  1710. }
  1711. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1712. type NoMethod AdvertiserGroupsListResponse
  1713. raw := NoMethod(*s)
  1714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1715. }
  1716. // AdvertiserLandingPagesListResponse: Landing Page List Response
  1717. type AdvertiserLandingPagesListResponse struct {
  1718. // Kind: Identifies what kind of resource this is. Value: the fixed
  1719. // string "dfareporting#advertiserLandingPagesListResponse".
  1720. Kind string `json:"kind,omitempty"`
  1721. // LandingPages: Landing page collection
  1722. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  1723. // NextPageToken: Pagination token to be used for the next list
  1724. // operation.
  1725. NextPageToken string `json:"nextPageToken,omitempty"`
  1726. // ServerResponse contains the HTTP response code and headers from the
  1727. // server.
  1728. googleapi.ServerResponse `json:"-"`
  1729. // ForceSendFields is a list of field names (e.g. "Kind") to
  1730. // unconditionally include in API requests. By default, fields with
  1731. // empty values are omitted from API requests. However, any non-pointer,
  1732. // non-interface field appearing in ForceSendFields will be sent to the
  1733. // server regardless of whether the field is empty or not. This may be
  1734. // used to include empty fields in Patch requests.
  1735. ForceSendFields []string `json:"-"`
  1736. // NullFields is a list of field names (e.g. "Kind") to include in API
  1737. // requests with the JSON null value. By default, fields with empty
  1738. // values are omitted from API requests. However, any field with an
  1739. // empty value appearing in NullFields will be sent to the server as
  1740. // null. It is an error if a field in this list has a non-empty value.
  1741. // This may be used to include null fields in Patch requests.
  1742. NullFields []string `json:"-"`
  1743. }
  1744. func (s *AdvertiserLandingPagesListResponse) MarshalJSON() ([]byte, error) {
  1745. type NoMethod AdvertiserLandingPagesListResponse
  1746. raw := NoMethod(*s)
  1747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1748. }
  1749. // AdvertisersListResponse: Advertiser List Response
  1750. type AdvertisersListResponse struct {
  1751. // Advertisers: Advertiser collection.
  1752. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1753. // Kind: Identifies what kind of resource this is. Value: the fixed
  1754. // string "dfareporting#advertisersListResponse".
  1755. Kind string `json:"kind,omitempty"`
  1756. // NextPageToken: Pagination token to be used for the next list
  1757. // operation.
  1758. NextPageToken string `json:"nextPageToken,omitempty"`
  1759. // ServerResponse contains the HTTP response code and headers from the
  1760. // server.
  1761. googleapi.ServerResponse `json:"-"`
  1762. // ForceSendFields is a list of field names (e.g. "Advertisers") to
  1763. // unconditionally include in API requests. By default, fields with
  1764. // empty values are omitted from API requests. However, any non-pointer,
  1765. // non-interface field appearing in ForceSendFields will be sent to the
  1766. // server regardless of whether the field is empty or not. This may be
  1767. // used to include empty fields in Patch requests.
  1768. ForceSendFields []string `json:"-"`
  1769. // NullFields is a list of field names (e.g. "Advertisers") to include
  1770. // in API requests with the JSON null value. By default, fields with
  1771. // empty values are omitted from API requests. However, any field with
  1772. // an empty value appearing in NullFields will be sent to the server as
  1773. // null. It is an error if a field in this list has a non-empty value.
  1774. // This may be used to include null fields in Patch requests.
  1775. NullFields []string `json:"-"`
  1776. }
  1777. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1778. type NoMethod AdvertisersListResponse
  1779. raw := NoMethod(*s)
  1780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1781. }
  1782. // AudienceSegment: Audience Segment.
  1783. type AudienceSegment struct {
  1784. // Allocation: Weight allocated to this segment. The weight assigned
  1785. // will be understood in proportion to the weights assigned to other
  1786. // segments in the same segment group. Acceptable values are 1 to 1000,
  1787. // inclusive.
  1788. Allocation int64 `json:"allocation,omitempty"`
  1789. // Id: ID of this audience segment. This is a read-only, auto-generated
  1790. // field.
  1791. Id int64 `json:"id,omitempty,string"`
  1792. // Name: Name of this audience segment. This is a required field and
  1793. // must be less than 65 characters long.
  1794. Name string `json:"name,omitempty"`
  1795. // ForceSendFields is a list of field names (e.g. "Allocation") to
  1796. // unconditionally include in API requests. By default, fields with
  1797. // empty values are omitted from API requests. However, any non-pointer,
  1798. // non-interface field appearing in ForceSendFields will be sent to the
  1799. // server regardless of whether the field is empty or not. This may be
  1800. // used to include empty fields in Patch requests.
  1801. ForceSendFields []string `json:"-"`
  1802. // NullFields is a list of field names (e.g. "Allocation") to include in
  1803. // API requests with the JSON null value. By default, fields with empty
  1804. // values are omitted from API requests. However, any field with an
  1805. // empty value appearing in NullFields will be sent to the server as
  1806. // null. It is an error if a field in this list has a non-empty value.
  1807. // This may be used to include null fields in Patch requests.
  1808. NullFields []string `json:"-"`
  1809. }
  1810. func (s *AudienceSegment) MarshalJSON() ([]byte, error) {
  1811. type NoMethod AudienceSegment
  1812. raw := NoMethod(*s)
  1813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1814. }
  1815. // AudienceSegmentGroup: Audience Segment Group.
  1816. type AudienceSegmentGroup struct {
  1817. // AudienceSegments: Audience segments assigned to this group. The
  1818. // number of segments must be between 2 and 100.
  1819. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1820. // Id: ID of this audience segment group. This is a read-only,
  1821. // auto-generated field.
  1822. Id int64 `json:"id,omitempty,string"`
  1823. // Name: Name of this audience segment group. This is a required field
  1824. // and must be less than 65 characters long.
  1825. Name string `json:"name,omitempty"`
  1826. // ForceSendFields is a list of field names (e.g. "AudienceSegments") to
  1827. // unconditionally include in API requests. By default, fields with
  1828. // empty values are omitted from API requests. However, any non-pointer,
  1829. // non-interface field appearing in ForceSendFields will be sent to the
  1830. // server regardless of whether the field is empty or not. This may be
  1831. // used to include empty fields in Patch requests.
  1832. ForceSendFields []string `json:"-"`
  1833. // NullFields is a list of field names (e.g. "AudienceSegments") to
  1834. // include in API requests with the JSON null value. By default, fields
  1835. // with empty values are omitted from API requests. However, any field
  1836. // with an empty value appearing in NullFields will be sent to the
  1837. // server as null. It is an error if a field in this list has a
  1838. // non-empty value. This may be used to include null fields in Patch
  1839. // requests.
  1840. NullFields []string `json:"-"`
  1841. }
  1842. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1843. type NoMethod AudienceSegmentGroup
  1844. raw := NoMethod(*s)
  1845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1846. }
  1847. // Browser: Contains information about a browser that can be targeted by
  1848. // ads.
  1849. type Browser struct {
  1850. // BrowserVersionId: ID referring to this grouping of browser and
  1851. // version numbers. This is the ID used for targeting.
  1852. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1853. // DartId: DART ID of this browser. This is the ID used when generating
  1854. // reports.
  1855. DartId int64 `json:"dartId,omitempty,string"`
  1856. // Kind: Identifies what kind of resource this is. Value: the fixed
  1857. // string "dfareporting#browser".
  1858. Kind string `json:"kind,omitempty"`
  1859. // MajorVersion: Major version number (leftmost number) of this browser.
  1860. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1861. // 5. An asterisk (*) may be used to target any version number, and a
  1862. // question mark (?) may be used to target cases where the version
  1863. // number cannot be identified. For example, Chrome *.* targets any
  1864. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1865. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1866. // server knows the browser is Firefox but can't tell which version it
  1867. // is.
  1868. MajorVersion string `json:"majorVersion,omitempty"`
  1869. // MinorVersion: Minor version number (number after first dot on left)
  1870. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1871. // should be set to 0. An asterisk (*) may be used to target any version
  1872. // number, and a question mark (?) may be used to target cases where the
  1873. // version number cannot be identified. For example, Chrome *.* targets
  1874. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1875. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1876. // server knows the browser is Firefox but can't tell which version it
  1877. // is.
  1878. MinorVersion string `json:"minorVersion,omitempty"`
  1879. // Name: Name of this browser.
  1880. Name string `json:"name,omitempty"`
  1881. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1882. // unconditionally include in API requests. By default, fields with
  1883. // empty values are omitted from API requests. However, any non-pointer,
  1884. // non-interface field appearing in ForceSendFields will be sent to the
  1885. // server regardless of whether the field is empty or not. This may be
  1886. // used to include empty fields in Patch requests.
  1887. ForceSendFields []string `json:"-"`
  1888. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1889. // include in API requests with the JSON null value. By default, fields
  1890. // with empty values are omitted from API requests. However, any field
  1891. // with an empty value appearing in NullFields will be sent to the
  1892. // server as null. It is an error if a field in this list has a
  1893. // non-empty value. This may be used to include null fields in Patch
  1894. // requests.
  1895. NullFields []string `json:"-"`
  1896. }
  1897. func (s *Browser) MarshalJSON() ([]byte, error) {
  1898. type NoMethod Browser
  1899. raw := NoMethod(*s)
  1900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1901. }
  1902. // BrowsersListResponse: Browser List Response
  1903. type BrowsersListResponse struct {
  1904. // Browsers: Browser collection.
  1905. Browsers []*Browser `json:"browsers,omitempty"`
  1906. // Kind: Identifies what kind of resource this is. Value: the fixed
  1907. // string "dfareporting#browsersListResponse".
  1908. Kind string `json:"kind,omitempty"`
  1909. // ServerResponse contains the HTTP response code and headers from the
  1910. // server.
  1911. googleapi.ServerResponse `json:"-"`
  1912. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1913. // unconditionally include in API requests. By default, fields with
  1914. // empty values are omitted from API requests. However, any non-pointer,
  1915. // non-interface field appearing in ForceSendFields will be sent to the
  1916. // server regardless of whether the field is empty or not. This may be
  1917. // used to include empty fields in Patch requests.
  1918. ForceSendFields []string `json:"-"`
  1919. // NullFields is a list of field names (e.g. "Browsers") to include in
  1920. // API requests with the JSON null value. By default, fields with empty
  1921. // values are omitted from API requests. However, any field with an
  1922. // empty value appearing in NullFields will be sent to the server as
  1923. // null. It is an error if a field in this list has a non-empty value.
  1924. // This may be used to include null fields in Patch requests.
  1925. NullFields []string `json:"-"`
  1926. }
  1927. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1928. type NoMethod BrowsersListResponse
  1929. raw := NoMethod(*s)
  1930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1931. }
  1932. // Campaign: Contains properties of a Campaign Manager campaign.
  1933. type Campaign struct {
  1934. // AccountId: Account ID of this campaign. This is a read-only field
  1935. // that can be left blank.
  1936. AccountId int64 `json:"accountId,omitempty,string"`
  1937. // AdBlockingConfiguration: Ad blocking settings for this campaign.
  1938. AdBlockingConfiguration *AdBlockingConfiguration `json:"adBlockingConfiguration,omitempty"`
  1939. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1940. // optimization configurations for the campaign.
  1941. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1942. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1943. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1944. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1945. // field.
  1946. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1947. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1948. // this campaign. This is a read-only, auto-generated field.
  1949. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1950. // Archived: Whether this campaign has been archived.
  1951. Archived bool `json:"archived,omitempty"`
  1952. // AudienceSegmentGroups: Audience segment groups assigned to this
  1953. // campaign. Cannot have more than 300 segment groups.
  1954. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1955. // BillingInvoiceCode: Billing invoice code included in the Campaign
  1956. // Manager client billing invoices associated with the campaign.
  1957. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1958. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1959. // properties for this campaign.
  1960. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1961. // Comment: Arbitrary comments about this campaign. Must be less than
  1962. // 256 characters long.
  1963. Comment string `json:"comment,omitempty"`
  1964. // CreateInfo: Information about the creation of this campaign. This is
  1965. // a read-only field.
  1966. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1967. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1968. // campaign.
  1969. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1970. // CreativeOptimizationConfiguration: Creative optimization
  1971. // configuration for the campaign.
  1972. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1973. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1974. // override properties for this campaign.
  1975. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1976. // DefaultLandingPageId: The default landing page ID for this campaign.
  1977. DefaultLandingPageId int64 `json:"defaultLandingPageId,omitempty,string"`
  1978. // EndDate: Date on which the campaign will stop running. On insert, the
  1979. // end date must be today or a future date. The end date must be later
  1980. // than or be the same as the start date. If, for example, you set
  1981. // 6/25/2015 as both the start and end dates, the effective campaign run
  1982. // date is just that day only, 6/25/2015. The hours, minutes, and
  1983. // seconds of the end date should not be set, as doing so will result in
  1984. // an error. This is a required field.
  1985. EndDate string `json:"endDate,omitempty"`
  1986. // EventTagOverrides: Overrides that can be used to activate or
  1987. // deactivate advertiser event tags.
  1988. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1989. // ExternalId: External ID for this campaign.
  1990. ExternalId string `json:"externalId,omitempty"`
  1991. // Id: ID of this campaign. This is a read-only auto-generated field.
  1992. Id int64 `json:"id,omitempty,string"`
  1993. // IdDimensionValue: Dimension value for the ID of this campaign. This
  1994. // is a read-only, auto-generated field.
  1995. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1996. // Kind: Identifies what kind of resource this is. Value: the fixed
  1997. // string "dfareporting#campaign".
  1998. Kind string `json:"kind,omitempty"`
  1999. // LastModifiedInfo: Information about the most recent modification of
  2000. // this campaign. This is a read-only field.
  2001. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  2002. // Name: Name of this campaign. This is a required field and must be
  2003. // less than 256 characters long and unique among campaigns of the same
  2004. // advertiser.
  2005. Name string `json:"name,omitempty"`
  2006. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  2007. // campaign.
  2008. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  2009. // StartDate: Date on which the campaign starts running. The start date
  2010. // can be any date. The hours, minutes, and seconds of the start date
  2011. // should not be set, as doing so will result in an error. This is a
  2012. // required field.
  2013. StartDate string `json:"startDate,omitempty"`
  2014. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  2015. // field that can be left blank.
  2016. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2017. // TraffickerEmails: Campaign trafficker contact emails.
  2018. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  2019. // ServerResponse contains the HTTP response code and headers from the
  2020. // server.
  2021. googleapi.ServerResponse `json:"-"`
  2022. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2023. // unconditionally include in API requests. By default, fields with
  2024. // empty values are omitted from API requests. However, any non-pointer,
  2025. // non-interface field appearing in ForceSendFields will be sent to the
  2026. // server regardless of whether the field is empty or not. This may be
  2027. // used to include empty fields in Patch requests.
  2028. ForceSendFields []string `json:"-"`
  2029. // NullFields is a list of field names (e.g. "AccountId") to include in
  2030. // API requests with the JSON null value. By default, fields with empty
  2031. // values are omitted from API requests. However, any field with an
  2032. // empty value appearing in NullFields will be sent to the server as
  2033. // null. It is an error if a field in this list has a non-empty value.
  2034. // This may be used to include null fields in Patch requests.
  2035. NullFields []string `json:"-"`
  2036. }
  2037. func (s *Campaign) MarshalJSON() ([]byte, error) {
  2038. type NoMethod Campaign
  2039. raw := NoMethod(*s)
  2040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2041. }
  2042. // CampaignCreativeAssociation: Identifies a creative which has been
  2043. // associated with a given campaign.
  2044. type CampaignCreativeAssociation struct {
  2045. // CreativeId: ID of the creative associated with the campaign. This is
  2046. // a required field.
  2047. CreativeId int64 `json:"creativeId,omitempty,string"`
  2048. // Kind: Identifies what kind of resource this is. Value: the fixed
  2049. // string "dfareporting#campaignCreativeAssociation".
  2050. Kind string `json:"kind,omitempty"`
  2051. // ServerResponse contains the HTTP response code and headers from the
  2052. // server.
  2053. googleapi.ServerResponse `json:"-"`
  2054. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  2055. // unconditionally include in API requests. By default, fields with
  2056. // empty values are omitted from API requests. However, any non-pointer,
  2057. // non-interface field appearing in ForceSendFields will be sent to the
  2058. // server regardless of whether the field is empty or not. This may be
  2059. // used to include empty fields in Patch requests.
  2060. ForceSendFields []string `json:"-"`
  2061. // NullFields is a list of field names (e.g. "CreativeId") to include in
  2062. // API requests with the JSON null value. By default, fields with empty
  2063. // values are omitted from API requests. However, any field with an
  2064. // empty value appearing in NullFields will be sent to the server as
  2065. // null. It is an error if a field in this list has a non-empty value.
  2066. // This may be used to include null fields in Patch requests.
  2067. NullFields []string `json:"-"`
  2068. }
  2069. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  2070. type NoMethod CampaignCreativeAssociation
  2071. raw := NoMethod(*s)
  2072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2073. }
  2074. // CampaignCreativeAssociationsListResponse: Campaign Creative
  2075. // Association List Response
  2076. type CampaignCreativeAssociationsListResponse struct {
  2077. // CampaignCreativeAssociations: Campaign creative association
  2078. // collection
  2079. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  2080. // Kind: Identifies what kind of resource this is. Value: the fixed
  2081. // string "dfareporting#campaignCreativeAssociationsListResponse".
  2082. Kind string `json:"kind,omitempty"`
  2083. // NextPageToken: Pagination token to be used for the next list
  2084. // operation.
  2085. NextPageToken string `json:"nextPageToken,omitempty"`
  2086. // ServerResponse contains the HTTP response code and headers from the
  2087. // server.
  2088. googleapi.ServerResponse `json:"-"`
  2089. // ForceSendFields is a list of field names (e.g.
  2090. // "CampaignCreativeAssociations") to unconditionally include in API
  2091. // requests. By default, fields with empty values are omitted from API
  2092. // requests. However, any non-pointer, non-interface field appearing in
  2093. // ForceSendFields will be sent to the server regardless of whether the
  2094. // field is empty or not. This may be used to include empty fields in
  2095. // Patch requests.
  2096. ForceSendFields []string `json:"-"`
  2097. // NullFields is a list of field names (e.g.
  2098. // "CampaignCreativeAssociations") to include in API requests with the
  2099. // JSON null value. By default, fields with empty values are omitted
  2100. // from API requests. However, any field with an empty value appearing
  2101. // in NullFields will be sent to the server as null. It is an error if a
  2102. // field in this list has a non-empty value. This may be used to include
  2103. // null fields in Patch requests.
  2104. NullFields []string `json:"-"`
  2105. }
  2106. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  2107. type NoMethod CampaignCreativeAssociationsListResponse
  2108. raw := NoMethod(*s)
  2109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2110. }
  2111. // CampaignsListResponse: Campaign List Response
  2112. type CampaignsListResponse struct {
  2113. // Campaigns: Campaign collection.
  2114. Campaigns []*Campaign `json:"campaigns,omitempty"`
  2115. // Kind: Identifies what kind of resource this is. Value: the fixed
  2116. // string "dfareporting#campaignsListResponse".
  2117. Kind string `json:"kind,omitempty"`
  2118. // NextPageToken: Pagination token to be used for the next list
  2119. // operation.
  2120. NextPageToken string `json:"nextPageToken,omitempty"`
  2121. // ServerResponse contains the HTTP response code and headers from the
  2122. // server.
  2123. googleapi.ServerResponse `json:"-"`
  2124. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  2125. // unconditionally include in API requests. By default, fields with
  2126. // empty values are omitted from API requests. However, any non-pointer,
  2127. // non-interface field appearing in ForceSendFields will be sent to the
  2128. // server regardless of whether the field is empty or not. This may be
  2129. // used to include empty fields in Patch requests.
  2130. ForceSendFields []string `json:"-"`
  2131. // NullFields is a list of field names (e.g. "Campaigns") to include in
  2132. // API requests with the JSON null value. By default, fields with empty
  2133. // values are omitted from API requests. However, any field with an
  2134. // empty value appearing in NullFields will be sent to the server as
  2135. // null. It is an error if a field in this list has a non-empty value.
  2136. // This may be used to include null fields in Patch requests.
  2137. NullFields []string `json:"-"`
  2138. }
  2139. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2140. type NoMethod CampaignsListResponse
  2141. raw := NoMethod(*s)
  2142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2143. }
  2144. // ChangeLog: Describes a change that a user has made to a resource.
  2145. type ChangeLog struct {
  2146. // AccountId: Account ID of the modified object.
  2147. AccountId int64 `json:"accountId,omitempty,string"`
  2148. // Action: Action which caused the change.
  2149. Action string `json:"action,omitempty"`
  2150. // ChangeTime: Time when the object was modified.
  2151. ChangeTime string `json:"changeTime,omitempty"`
  2152. // FieldName: Field name of the object which changed.
  2153. FieldName string `json:"fieldName,omitempty"`
  2154. // Id: ID of this change log.
  2155. Id int64 `json:"id,omitempty,string"`
  2156. // Kind: Identifies what kind of resource this is. Value: the fixed
  2157. // string "dfareporting#changeLog".
  2158. Kind string `json:"kind,omitempty"`
  2159. // NewValue: New value of the object field.
  2160. NewValue string `json:"newValue,omitempty"`
  2161. // ObjectId: ID of the object of this change log. The object could be a
  2162. // campaign, placement, ad, or other type.
  2163. ObjectId int64 `json:"objectId,omitempty,string"`
  2164. // ObjectType: Object type of the change log.
  2165. ObjectType string `json:"objectType,omitempty"`
  2166. // OldValue: Old value of the object field.
  2167. OldValue string `json:"oldValue,omitempty"`
  2168. // SubaccountId: Subaccount ID of the modified object.
  2169. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2170. // TransactionId: Transaction ID of this change log. When a single API
  2171. // call results in many changes, each change will have a separate ID in
  2172. // the change log but will share the same transactionId.
  2173. TransactionId int64 `json:"transactionId,omitempty,string"`
  2174. // UserProfileId: ID of the user who modified the object.
  2175. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2176. // UserProfileName: User profile name of the user who modified the
  2177. // object.
  2178. UserProfileName string `json:"userProfileName,omitempty"`
  2179. // ServerResponse contains the HTTP response code and headers from the
  2180. // server.
  2181. googleapi.ServerResponse `json:"-"`
  2182. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2183. // unconditionally include in API requests. By default, fields with
  2184. // empty values are omitted from API requests. However, any non-pointer,
  2185. // non-interface field appearing in ForceSendFields will be sent to the
  2186. // server regardless of whether the field is empty or not. This may be
  2187. // used to include empty fields in Patch requests.
  2188. ForceSendFields []string `json:"-"`
  2189. // NullFields is a list of field names (e.g. "AccountId") to include in
  2190. // API requests with the JSON null value. By default, fields with empty
  2191. // values are omitted from API requests. However, any field with an
  2192. // empty value appearing in NullFields will be sent to the server as
  2193. // null. It is an error if a field in this list has a non-empty value.
  2194. // This may be used to include null fields in Patch requests.
  2195. NullFields []string `json:"-"`
  2196. }
  2197. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2198. type NoMethod ChangeLog
  2199. raw := NoMethod(*s)
  2200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2201. }
  2202. // ChangeLogsListResponse: Change Log List Response
  2203. type ChangeLogsListResponse struct {
  2204. // ChangeLogs: Change log collection.
  2205. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2206. // Kind: Identifies what kind of resource this is. Value: the fixed
  2207. // string "dfareporting#changeLogsListResponse".
  2208. Kind string `json:"kind,omitempty"`
  2209. // NextPageToken: Pagination token to be used for the next list
  2210. // operation.
  2211. NextPageToken string `json:"nextPageToken,omitempty"`
  2212. // ServerResponse contains the HTTP response code and headers from the
  2213. // server.
  2214. googleapi.ServerResponse `json:"-"`
  2215. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2216. // unconditionally include in API requests. By default, fields with
  2217. // empty values are omitted from API requests. However, any non-pointer,
  2218. // non-interface field appearing in ForceSendFields will be sent to the
  2219. // server regardless of whether the field is empty or not. This may be
  2220. // used to include empty fields in Patch requests.
  2221. ForceSendFields []string `json:"-"`
  2222. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2223. // API requests with the JSON null value. By default, fields with empty
  2224. // values are omitted from API requests. However, any field with an
  2225. // empty value appearing in NullFields will be sent to the server as
  2226. // null. It is an error if a field in this list has a non-empty value.
  2227. // This may be used to include null fields in Patch requests.
  2228. NullFields []string `json:"-"`
  2229. }
  2230. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2231. type NoMethod ChangeLogsListResponse
  2232. raw := NoMethod(*s)
  2233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2234. }
  2235. // CitiesListResponse: City List Response
  2236. type CitiesListResponse struct {
  2237. // Cities: City collection.
  2238. Cities []*City `json:"cities,omitempty"`
  2239. // Kind: Identifies what kind of resource this is. Value: the fixed
  2240. // string "dfareporting#citiesListResponse".
  2241. Kind string `json:"kind,omitempty"`
  2242. // ServerResponse contains the HTTP response code and headers from the
  2243. // server.
  2244. googleapi.ServerResponse `json:"-"`
  2245. // ForceSendFields is a list of field names (e.g. "Cities") to
  2246. // unconditionally include in API requests. By default, fields with
  2247. // empty values are omitted from API requests. However, any non-pointer,
  2248. // non-interface field appearing in ForceSendFields will be sent to the
  2249. // server regardless of whether the field is empty or not. This may be
  2250. // used to include empty fields in Patch requests.
  2251. ForceSendFields []string `json:"-"`
  2252. // NullFields is a list of field names (e.g. "Cities") to include in API
  2253. // requests with the JSON null value. By default, fields with empty
  2254. // values are omitted from API requests. However, any field with an
  2255. // empty value appearing in NullFields will be sent to the server as
  2256. // null. It is an error if a field in this list has a non-empty value.
  2257. // This may be used to include null fields in Patch requests.
  2258. NullFields []string `json:"-"`
  2259. }
  2260. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2261. type NoMethod CitiesListResponse
  2262. raw := NoMethod(*s)
  2263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2264. }
  2265. // City: Contains information about a city that can be targeted by ads.
  2266. type City struct {
  2267. // CountryCode: Country code of the country to which this city belongs.
  2268. CountryCode string `json:"countryCode,omitempty"`
  2269. // CountryDartId: DART ID of the country to which this city belongs.
  2270. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2271. // DartId: DART ID of this city. This is the ID used for targeting and
  2272. // generating reports.
  2273. DartId int64 `json:"dartId,omitempty,string"`
  2274. // Kind: Identifies what kind of resource this is. Value: the fixed
  2275. // string "dfareporting#city".
  2276. Kind string `json:"kind,omitempty"`
  2277. // MetroCode: Metro region code of the metro region (DMA) to which this
  2278. // city belongs.
  2279. MetroCode string `json:"metroCode,omitempty"`
  2280. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2281. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2282. // Name: Name of this city.
  2283. Name string `json:"name,omitempty"`
  2284. // RegionCode: Region code of the region to which this city belongs.
  2285. RegionCode string `json:"regionCode,omitempty"`
  2286. // RegionDartId: DART ID of the region to which this city belongs.
  2287. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2288. // ForceSendFields is a list of field names (e.g. "CountryCode") 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. "CountryCode") to include
  2296. // in API requests with the JSON null value. By default, fields with
  2297. // empty values are omitted from API requests. However, any field with
  2298. // an empty value appearing in NullFields will be sent to the server as
  2299. // null. It is an error if a field in this list has a non-empty value.
  2300. // This may be used to include null fields in Patch requests.
  2301. NullFields []string `json:"-"`
  2302. }
  2303. func (s *City) MarshalJSON() ([]byte, error) {
  2304. type NoMethod City
  2305. raw := NoMethod(*s)
  2306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2307. }
  2308. // ClickTag: Creative Click Tag.
  2309. type ClickTag struct {
  2310. // ClickThroughUrl: Parameter value for the specified click tag. This
  2311. // field contains a click-through url.
  2312. ClickThroughUrl *CreativeClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2313. // EventName: Advertiser event name associated with the click tag. This
  2314. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2315. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2316. EventName string `json:"eventName,omitempty"`
  2317. // Name: Parameter name for the specified click tag. For
  2318. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2319. // value of the creative asset's creativeAssetId.name field.
  2320. Name string `json:"name,omitempty"`
  2321. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2322. // unconditionally include in API requests. By default, fields with
  2323. // empty values are omitted from API requests. However, any non-pointer,
  2324. // non-interface field appearing in ForceSendFields will be sent to the
  2325. // server regardless of whether the field is empty or not. This may be
  2326. // used to include empty fields in Patch requests.
  2327. ForceSendFields []string `json:"-"`
  2328. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2329. // include in API requests with the JSON null value. By default, fields
  2330. // with empty values are omitted from API requests. However, any field
  2331. // with an empty value appearing in NullFields will be sent to the
  2332. // server as null. It is an error if a field in this list has a
  2333. // non-empty value. This may be used to include null fields in Patch
  2334. // requests.
  2335. NullFields []string `json:"-"`
  2336. }
  2337. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2338. type NoMethod ClickTag
  2339. raw := NoMethod(*s)
  2340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2341. }
  2342. // ClickThroughUrl: Click-through URL
  2343. type ClickThroughUrl struct {
  2344. // ComputedClickThroughUrl: Read-only convenience field representing the
  2345. // actual URL that will be used for this click-through. The URL is
  2346. // computed as follows:
  2347. // - If defaultLandingPage is enabled then the campaign's default
  2348. // landing page URL is assigned to this field.
  2349. // - If defaultLandingPage is not enabled and a landingPageId is
  2350. // specified then that landing page's URL is assigned to this field.
  2351. // - If neither of the above cases apply, then the customClickThroughUrl
  2352. // is assigned to this field.
  2353. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2354. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2355. // defaultLandingPage field is set to false and the landingPageId field
  2356. // is left unset.
  2357. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2358. // DefaultLandingPage: Whether the campaign default landing page is
  2359. // used.
  2360. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2361. // LandingPageId: ID of the landing page for the click-through URL.
  2362. // Applicable if the defaultLandingPage field is set to false.
  2363. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2364. // ForceSendFields is a list of field names (e.g.
  2365. // "ComputedClickThroughUrl") to unconditionally include in API
  2366. // requests. By default, fields with empty values are omitted from API
  2367. // requests. However, any non-pointer, non-interface field appearing in
  2368. // ForceSendFields will be sent to the server regardless of whether the
  2369. // field is empty or not. This may be used to include empty fields in
  2370. // Patch requests.
  2371. ForceSendFields []string `json:"-"`
  2372. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2373. // to include in API requests with the JSON null value. By default,
  2374. // fields with empty values are omitted from API requests. However, any
  2375. // field with an empty value appearing in NullFields will be sent to the
  2376. // server as null. It is an error if a field in this list has a
  2377. // non-empty value. This may be used to include null fields in Patch
  2378. // requests.
  2379. NullFields []string `json:"-"`
  2380. }
  2381. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2382. type NoMethod ClickThroughUrl
  2383. raw := NoMethod(*s)
  2384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2385. }
  2386. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2387. type ClickThroughUrlSuffixProperties struct {
  2388. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2389. // in this entity's scope. Must be less than 128 characters long.
  2390. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2391. // OverrideInheritedSuffix: Whether this entity should override the
  2392. // inherited click-through URL suffix with its own defined value.
  2393. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2394. // ForceSendFields is a list of field names (e.g.
  2395. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2396. // By default, fields with empty values are omitted from API requests.
  2397. // However, any non-pointer, non-interface field appearing in
  2398. // ForceSendFields will be sent to the server regardless of whether the
  2399. // field is empty or not. This may be used to include empty fields in
  2400. // Patch requests.
  2401. ForceSendFields []string `json:"-"`
  2402. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2403. // include in API requests with the JSON null value. By default, fields
  2404. // with empty values are omitted from API requests. However, any field
  2405. // with an empty value appearing in NullFields will be sent to the
  2406. // server as null. It is an error if a field in this list has a
  2407. // non-empty value. This may be used to include null fields in Patch
  2408. // requests.
  2409. NullFields []string `json:"-"`
  2410. }
  2411. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2412. type NoMethod ClickThroughUrlSuffixProperties
  2413. raw := NoMethod(*s)
  2414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2415. }
  2416. // CompanionClickThroughOverride: Companion Click-through override.
  2417. type CompanionClickThroughOverride struct {
  2418. // ClickThroughUrl: Click-through URL of this companion click-through
  2419. // override.
  2420. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2421. // CreativeId: ID of the creative for this companion click-through
  2422. // override.
  2423. CreativeId int64 `json:"creativeId,omitempty,string"`
  2424. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2425. // unconditionally include in API requests. By default, fields with
  2426. // empty values are omitted from API requests. However, any non-pointer,
  2427. // non-interface field appearing in ForceSendFields will be sent to the
  2428. // server regardless of whether the field is empty or not. This may be
  2429. // used to include empty fields in Patch requests.
  2430. ForceSendFields []string `json:"-"`
  2431. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2432. // include in API requests with the JSON null value. By default, fields
  2433. // with empty values are omitted from API requests. However, any field
  2434. // with an empty value appearing in NullFields will be sent to the
  2435. // server as null. It is an error if a field in this list has a
  2436. // non-empty value. This may be used to include null fields in Patch
  2437. // requests.
  2438. NullFields []string `json:"-"`
  2439. }
  2440. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2441. type NoMethod CompanionClickThroughOverride
  2442. raw := NoMethod(*s)
  2443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2444. }
  2445. // CompanionSetting: Companion Settings
  2446. type CompanionSetting struct {
  2447. // CompanionsDisabled: Whether companions are disabled for this
  2448. // placement.
  2449. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2450. // EnabledSizes: Whitelist of companion sizes to be served to this
  2451. // placement. Set this list to null or empty to serve all companion
  2452. // sizes.
  2453. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2454. // ImageOnly: Whether to serve only static images as companions.
  2455. ImageOnly bool `json:"imageOnly,omitempty"`
  2456. // Kind: Identifies what kind of resource this is. Value: the fixed
  2457. // string "dfareporting#companionSetting".
  2458. Kind string `json:"kind,omitempty"`
  2459. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2460. // to unconditionally include in API requests. By default, fields with
  2461. // empty values are omitted from API requests. However, any non-pointer,
  2462. // non-interface field appearing in ForceSendFields will be sent to the
  2463. // server regardless of whether the field is empty or not. This may be
  2464. // used to include empty fields in Patch requests.
  2465. ForceSendFields []string `json:"-"`
  2466. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2467. // include in API requests with the JSON null value. By default, fields
  2468. // with empty values are omitted from API requests. However, any field
  2469. // with an empty value appearing in NullFields will be sent to the
  2470. // server as null. It is an error if a field in this list has a
  2471. // non-empty value. This may be used to include null fields in Patch
  2472. // requests.
  2473. NullFields []string `json:"-"`
  2474. }
  2475. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2476. type NoMethod CompanionSetting
  2477. raw := NoMethod(*s)
  2478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2479. }
  2480. // CompatibleFields: Represents a response to the queryCompatibleFields
  2481. // method.
  2482. type CompatibleFields struct {
  2483. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2484. // compatible to be selected for a report of type
  2485. // "CROSS_DIMENSION_REACH".
  2486. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2487. // FloodlightReportCompatibleFields: Contains items that are compatible
  2488. // to be selected for a report of type "FLOODLIGHT".
  2489. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2490. // Kind: The kind of resource this is, in this case
  2491. // dfareporting#compatibleFields.
  2492. Kind string `json:"kind,omitempty"`
  2493. // PathToConversionReportCompatibleFields: Contains items that are
  2494. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2495. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2496. // ReachReportCompatibleFields: Contains items that are compatible to be
  2497. // selected for a report of type "REACH".
  2498. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2499. // ReportCompatibleFields: Contains items that are compatible to be
  2500. // selected for a report of type "STANDARD".
  2501. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2502. // ServerResponse contains the HTTP response code and headers from the
  2503. // server.
  2504. googleapi.ServerResponse `json:"-"`
  2505. // ForceSendFields is a list of field names (e.g.
  2506. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2507. // include in API requests. By default, fields with empty values are
  2508. // omitted from API requests. However, any non-pointer, non-interface
  2509. // field appearing in ForceSendFields will be sent to the server
  2510. // regardless of whether the field is empty or not. This may be used to
  2511. // include empty fields in Patch requests.
  2512. ForceSendFields []string `json:"-"`
  2513. // NullFields is a list of field names (e.g.
  2514. // "CrossDimensionReachReportCompatibleFields") to include in API
  2515. // requests with the JSON null value. By default, fields with empty
  2516. // values are omitted from API requests. However, any field with an
  2517. // empty value appearing in NullFields will be sent to the server as
  2518. // null. It is an error if a field in this list has a non-empty value.
  2519. // This may be used to include null fields in Patch requests.
  2520. NullFields []string `json:"-"`
  2521. }
  2522. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2523. type NoMethod CompatibleFields
  2524. raw := NoMethod(*s)
  2525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2526. }
  2527. // ConnectionType: Contains information about an internet connection
  2528. // type that can be targeted by ads. Clients can use the connection type
  2529. // to target mobile vs. broadband users.
  2530. type ConnectionType struct {
  2531. // Id: ID of this connection type.
  2532. Id int64 `json:"id,omitempty,string"`
  2533. // Kind: Identifies what kind of resource this is. Value: the fixed
  2534. // string "dfareporting#connectionType".
  2535. Kind string `json:"kind,omitempty"`
  2536. // Name: Name of this connection type.
  2537. Name string `json:"name,omitempty"`
  2538. // ServerResponse contains the HTTP response code and headers from the
  2539. // server.
  2540. googleapi.ServerResponse `json:"-"`
  2541. // ForceSendFields is a list of field names (e.g. "Id") to
  2542. // unconditionally include in API requests. By default, fields with
  2543. // empty values are omitted from API requests. However, any non-pointer,
  2544. // non-interface field appearing in ForceSendFields will be sent to the
  2545. // server regardless of whether the field is empty or not. This may be
  2546. // used to include empty fields in Patch requests.
  2547. ForceSendFields []string `json:"-"`
  2548. // NullFields is a list of field names (e.g. "Id") to include in API
  2549. // requests with the JSON null value. By default, fields with empty
  2550. // values are omitted from API requests. However, any field with an
  2551. // empty value appearing in NullFields will be sent to the server as
  2552. // null. It is an error if a field in this list has a non-empty value.
  2553. // This may be used to include null fields in Patch requests.
  2554. NullFields []string `json:"-"`
  2555. }
  2556. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2557. type NoMethod ConnectionType
  2558. raw := NoMethod(*s)
  2559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2560. }
  2561. // ConnectionTypesListResponse: Connection Type List Response
  2562. type ConnectionTypesListResponse struct {
  2563. // ConnectionTypes: Collection of connection types such as broadband and
  2564. // mobile.
  2565. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2566. // Kind: Identifies what kind of resource this is. Value: the fixed
  2567. // string "dfareporting#connectionTypesListResponse".
  2568. Kind string `json:"kind,omitempty"`
  2569. // ServerResponse contains the HTTP response code and headers from the
  2570. // server.
  2571. googleapi.ServerResponse `json:"-"`
  2572. // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to
  2573. // unconditionally include in API requests. By default, fields with
  2574. // empty values are omitted from API requests. However, any non-pointer,
  2575. // non-interface field appearing in ForceSendFields will be sent to the
  2576. // server regardless of whether the field is empty or not. This may be
  2577. // used to include empty fields in Patch requests.
  2578. ForceSendFields []string `json:"-"`
  2579. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2580. // include in API requests with the JSON null value. By default, fields
  2581. // with empty values are omitted from API requests. However, any field
  2582. // with an empty value appearing in NullFields will be sent to the
  2583. // server as null. It is an error if a field in this list has a
  2584. // non-empty value. This may be used to include null fields in Patch
  2585. // requests.
  2586. NullFields []string `json:"-"`
  2587. }
  2588. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2589. type NoMethod ConnectionTypesListResponse
  2590. raw := NoMethod(*s)
  2591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2592. }
  2593. // ContentCategoriesListResponse: Content Category List Response
  2594. type ContentCategoriesListResponse struct {
  2595. // ContentCategories: Content category collection.
  2596. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2597. // Kind: Identifies what kind of resource this is. Value: the fixed
  2598. // string "dfareporting#contentCategoriesListResponse".
  2599. Kind string `json:"kind,omitempty"`
  2600. // NextPageToken: Pagination token to be used for the next list
  2601. // operation.
  2602. NextPageToken string `json:"nextPageToken,omitempty"`
  2603. // ServerResponse contains the HTTP response code and headers from the
  2604. // server.
  2605. googleapi.ServerResponse `json:"-"`
  2606. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2607. // to unconditionally include in API requests. By default, fields with
  2608. // empty values are omitted from API requests. However, any non-pointer,
  2609. // non-interface field appearing in ForceSendFields will be sent to the
  2610. // server regardless of whether the field is empty or not. This may be
  2611. // used to include empty fields in Patch requests.
  2612. ForceSendFields []string `json:"-"`
  2613. // NullFields is a list of field names (e.g. "ContentCategories") to
  2614. // include in API requests with the JSON null value. By default, fields
  2615. // with empty values are omitted from API requests. However, any field
  2616. // with an empty value appearing in NullFields will be sent to the
  2617. // server as null. It is an error if a field in this list has a
  2618. // non-empty value. This may be used to include null fields in Patch
  2619. // requests.
  2620. NullFields []string `json:"-"`
  2621. }
  2622. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2623. type NoMethod ContentCategoriesListResponse
  2624. raw := NoMethod(*s)
  2625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2626. }
  2627. // ContentCategory: Organizes placements according to the contents of
  2628. // their associated webpages.
  2629. type ContentCategory struct {
  2630. // AccountId: Account ID of this content category. This is a read-only
  2631. // field that can be left blank.
  2632. AccountId int64 `json:"accountId,omitempty,string"`
  2633. // Id: ID of this content category. This is a read-only, auto-generated
  2634. // field.
  2635. Id int64 `json:"id,omitempty,string"`
  2636. // Kind: Identifies what kind of resource this is. Value: the fixed
  2637. // string "dfareporting#contentCategory".
  2638. Kind string `json:"kind,omitempty"`
  2639. // Name: Name of this content category. This is a required field and
  2640. // must be less than 256 characters long and unique among content
  2641. // categories of the same account.
  2642. Name string `json:"name,omitempty"`
  2643. // ServerResponse contains the HTTP response code and headers from the
  2644. // server.
  2645. googleapi.ServerResponse `json:"-"`
  2646. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2647. // unconditionally include in API requests. By default, fields with
  2648. // empty values are omitted from API requests. However, any non-pointer,
  2649. // non-interface field appearing in ForceSendFields will be sent to the
  2650. // server regardless of whether the field is empty or not. This may be
  2651. // used to include empty fields in Patch requests.
  2652. ForceSendFields []string `json:"-"`
  2653. // NullFields is a list of field names (e.g. "AccountId") to include in
  2654. // API requests with the JSON null value. By default, fields with empty
  2655. // values are omitted from API requests. However, any field with an
  2656. // empty value appearing in NullFields will be sent to the server as
  2657. // null. It is an error if a field in this list has a non-empty value.
  2658. // This may be used to include null fields in Patch requests.
  2659. NullFields []string `json:"-"`
  2660. }
  2661. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2662. type NoMethod ContentCategory
  2663. raw := NoMethod(*s)
  2664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2665. }
  2666. // Conversion: A Conversion represents when a user successfully performs
  2667. // a desired action after seeing an ad.
  2668. type Conversion struct {
  2669. // ChildDirectedTreatment: Whether this particular request may come from
  2670. // a user under the age of 13, under COPPA compliance.
  2671. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2672. // CustomVariables: Custom floodlight variables.
  2673. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2674. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2675. // encryptionInfo should also be specified. This field is mutually
  2676. // exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid.
  2677. // This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a
  2678. // required field.
  2679. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2680. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2681. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2682. // be used in the inserted conversion. If no such user ID is found then
  2683. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2684. // When set, encryptionInfo should also be specified. This field may
  2685. // only be used when calling batchinsert; it is not supported by
  2686. // batchupdate. This field is mutually exclusive with encryptedUserId,
  2687. // mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId
  2688. // or gclid is a required field.
  2689. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2690. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2691. // is a required field.
  2692. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2693. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2694. // conversion. This is a required field.
  2695. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2696. // Gclid: The Google click ID. This field is mutually exclusive with
  2697. // encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This
  2698. // or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId
  2699. // is a required field.
  2700. Gclid string `json:"gclid,omitempty"`
  2701. // Kind: Identifies what kind of resource this is. Value: the fixed
  2702. // string "dfareporting#conversion".
  2703. Kind string `json:"kind,omitempty"`
  2704. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2705. // true, the conversion will be used for reporting but not targeting.
  2706. // This will prevent remarketing.
  2707. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2708. // MobileDeviceId: The mobile device ID. This field is mutually
  2709. // exclusive with encryptedUserId, encryptedUserIdCandidates[] and
  2710. // gclid. This or encryptedUserId or encryptedUserIdCandidates[] or
  2711. // gclid is a required field.
  2712. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2713. // NonPersonalizedAd: Whether the conversion was for a non personalized
  2714. // ad.
  2715. NonPersonalizedAd bool `json:"nonPersonalizedAd,omitempty"`
  2716. // Ordinal: The ordinal of the conversion. Use this field to control how
  2717. // conversions of the same user and day are de-duplicated. This is a
  2718. // required field.
  2719. Ordinal string `json:"ordinal,omitempty"`
  2720. // Quantity: The quantity of the conversion.
  2721. Quantity int64 `json:"quantity,omitempty,string"`
  2722. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2723. // This is a required field.
  2724. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2725. // TreatmentForUnderage: Whether this particular request may come from a
  2726. // user under the age of 16 (may differ by country), under compliance
  2727. // with the European Union's General Data Protection Regulation (GDPR).
  2728. TreatmentForUnderage bool `json:"treatmentForUnderage,omitempty"`
  2729. // Value: The value of the conversion.
  2730. Value float64 `json:"value,omitempty"`
  2731. // ForceSendFields is a list of field names (e.g.
  2732. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2733. // By default, fields with empty values are omitted from API requests.
  2734. // However, any non-pointer, non-interface field appearing in
  2735. // ForceSendFields will be sent to the server regardless of whether the
  2736. // field is empty or not. This may be used to include empty fields in
  2737. // Patch requests.
  2738. ForceSendFields []string `json:"-"`
  2739. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2740. // to include in API requests with the JSON null value. By default,
  2741. // fields with empty values are omitted from API requests. However, any
  2742. // field with an empty value appearing in NullFields will be sent to the
  2743. // server as null. It is an error if a field in this list has a
  2744. // non-empty value. This may be used to include null fields in Patch
  2745. // requests.
  2746. NullFields []string `json:"-"`
  2747. }
  2748. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2749. type NoMethod Conversion
  2750. raw := NoMethod(*s)
  2751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2752. }
  2753. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2754. type NoMethod Conversion
  2755. var s1 struct {
  2756. Value gensupport.JSONFloat64 `json:"value"`
  2757. *NoMethod
  2758. }
  2759. s1.NoMethod = (*NoMethod)(s)
  2760. if err := json.Unmarshal(data, &s1); err != nil {
  2761. return err
  2762. }
  2763. s.Value = float64(s1.Value)
  2764. return nil
  2765. }
  2766. // ConversionError: The error code and description for a conversion that
  2767. // failed to insert or update.
  2768. type ConversionError struct {
  2769. // Code: The error code.
  2770. //
  2771. // Possible values:
  2772. // "INTERNAL"
  2773. // "INVALID_ARGUMENT"
  2774. // "NOT_FOUND"
  2775. // "PERMISSION_DENIED"
  2776. Code string `json:"code,omitempty"`
  2777. // Kind: Identifies what kind of resource this is. Value: the fixed
  2778. // string "dfareporting#conversionError".
  2779. Kind string `json:"kind,omitempty"`
  2780. // Message: A description of the error.
  2781. Message string `json:"message,omitempty"`
  2782. // ForceSendFields is a list of field names (e.g. "Code") to
  2783. // unconditionally include in API requests. By default, fields with
  2784. // empty values are omitted from API requests. However, any non-pointer,
  2785. // non-interface field appearing in ForceSendFields will be sent to the
  2786. // server regardless of whether the field is empty or not. This may be
  2787. // used to include empty fields in Patch requests.
  2788. ForceSendFields []string `json:"-"`
  2789. // NullFields is a list of field names (e.g. "Code") to include in API
  2790. // requests with the JSON null value. By default, fields with empty
  2791. // values are omitted from API requests. However, any field with an
  2792. // empty value appearing in NullFields will be sent to the server as
  2793. // null. It is an error if a field in this list has a non-empty value.
  2794. // This may be used to include null fields in Patch requests.
  2795. NullFields []string `json:"-"`
  2796. }
  2797. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2798. type NoMethod ConversionError
  2799. raw := NoMethod(*s)
  2800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2801. }
  2802. // ConversionStatus: The original conversion that was inserted or
  2803. // updated and whether there were any errors.
  2804. type ConversionStatus struct {
  2805. // Conversion: The original conversion that was inserted or updated.
  2806. Conversion *Conversion `json:"conversion,omitempty"`
  2807. // Errors: A list of errors related to this conversion.
  2808. Errors []*ConversionError `json:"errors,omitempty"`
  2809. // Kind: Identifies what kind of resource this is. Value: the fixed
  2810. // string "dfareporting#conversionStatus".
  2811. Kind string `json:"kind,omitempty"`
  2812. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2813. // unconditionally include in API requests. By default, fields with
  2814. // empty values are omitted from API requests. However, any non-pointer,
  2815. // non-interface field appearing in ForceSendFields will be sent to the
  2816. // server regardless of whether the field is empty or not. This may be
  2817. // used to include empty fields in Patch requests.
  2818. ForceSendFields []string `json:"-"`
  2819. // NullFields is a list of field names (e.g. "Conversion") to include in
  2820. // API requests with the JSON null value. By default, fields with empty
  2821. // values are omitted from API requests. However, any field with an
  2822. // empty value appearing in NullFields will be sent to the server as
  2823. // null. It is an error if a field in this list has a non-empty value.
  2824. // This may be used to include null fields in Patch requests.
  2825. NullFields []string `json:"-"`
  2826. }
  2827. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2828. type NoMethod ConversionStatus
  2829. raw := NoMethod(*s)
  2830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2831. }
  2832. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2833. type ConversionsBatchInsertRequest struct {
  2834. // Conversions: The set of conversions to insert.
  2835. Conversions []*Conversion `json:"conversions,omitempty"`
  2836. // EncryptionInfo: Describes how encryptedUserId or
  2837. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2838. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2839. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2840. // Kind: Identifies what kind of resource this is. Value: the fixed
  2841. // string "dfareporting#conversionsBatchInsertRequest".
  2842. Kind string `json:"kind,omitempty"`
  2843. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2844. // unconditionally include in API requests. By default, fields with
  2845. // empty values are omitted from API requests. However, any non-pointer,
  2846. // non-interface field appearing in ForceSendFields will be sent to the
  2847. // server regardless of whether the field is empty or not. This may be
  2848. // used to include empty fields in Patch requests.
  2849. ForceSendFields []string `json:"-"`
  2850. // NullFields is a list of field names (e.g. "Conversions") to include
  2851. // in API requests with the JSON null value. By default, fields with
  2852. // empty values are omitted from API requests. However, any field with
  2853. // an empty value appearing in NullFields will be sent to the server as
  2854. // null. It is an error if a field in this list has a non-empty value.
  2855. // This may be used to include null fields in Patch requests.
  2856. NullFields []string `json:"-"`
  2857. }
  2858. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2859. type NoMethod ConversionsBatchInsertRequest
  2860. raw := NoMethod(*s)
  2861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2862. }
  2863. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2864. type ConversionsBatchInsertResponse struct {
  2865. // HasFailures: Indicates that some or all conversions failed to insert.
  2866. HasFailures bool `json:"hasFailures,omitempty"`
  2867. // Kind: Identifies what kind of resource this is. Value: the fixed
  2868. // string "dfareporting#conversionsBatchInsertResponse".
  2869. Kind string `json:"kind,omitempty"`
  2870. // Status: The insert status of each conversion. Statuses are returned
  2871. // in the same order that conversions are inserted.
  2872. Status []*ConversionStatus `json:"status,omitempty"`
  2873. // ServerResponse contains the HTTP response code and headers from the
  2874. // server.
  2875. googleapi.ServerResponse `json:"-"`
  2876. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2877. // unconditionally include in API requests. By default, fields with
  2878. // empty values are omitted from API requests. However, any non-pointer,
  2879. // non-interface field appearing in ForceSendFields will be sent to the
  2880. // server regardless of whether the field is empty or not. This may be
  2881. // used to include empty fields in Patch requests.
  2882. ForceSendFields []string `json:"-"`
  2883. // NullFields is a list of field names (e.g. "HasFailures") to include
  2884. // in API requests with the JSON null value. By default, fields with
  2885. // empty values are omitted from API requests. However, any field with
  2886. // an empty value appearing in NullFields will be sent to the server as
  2887. // null. It is an error if a field in this list has a non-empty value.
  2888. // This may be used to include null fields in Patch requests.
  2889. NullFields []string `json:"-"`
  2890. }
  2891. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2892. type NoMethod ConversionsBatchInsertResponse
  2893. raw := NoMethod(*s)
  2894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2895. }
  2896. // ConversionsBatchUpdateRequest: Update Conversions Request.
  2897. type ConversionsBatchUpdateRequest struct {
  2898. // Conversions: The set of conversions to update.
  2899. Conversions []*Conversion `json:"conversions,omitempty"`
  2900. // EncryptionInfo: Describes how encryptedUserId is encrypted. This is a
  2901. // required field if encryptedUserId is used.
  2902. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2903. // Kind: Identifies what kind of resource this is. Value: the fixed
  2904. // string "dfareporting#conversionsBatchUpdateRequest".
  2905. Kind string `json:"kind,omitempty"`
  2906. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2907. // unconditionally include in API requests. By default, fields with
  2908. // empty values are omitted from API requests. However, any non-pointer,
  2909. // non-interface field appearing in ForceSendFields will be sent to the
  2910. // server regardless of whether the field is empty or not. This may be
  2911. // used to include empty fields in Patch requests.
  2912. ForceSendFields []string `json:"-"`
  2913. // NullFields is a list of field names (e.g. "Conversions") to include
  2914. // in API requests with the JSON null value. By default, fields with
  2915. // empty values are omitted from API requests. However, any field with
  2916. // an empty value appearing in NullFields will be sent to the server as
  2917. // null. It is an error if a field in this list has a non-empty value.
  2918. // This may be used to include null fields in Patch requests.
  2919. NullFields []string `json:"-"`
  2920. }
  2921. func (s *ConversionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  2922. type NoMethod ConversionsBatchUpdateRequest
  2923. raw := NoMethod(*s)
  2924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2925. }
  2926. // ConversionsBatchUpdateResponse: Update Conversions Response.
  2927. type ConversionsBatchUpdateResponse struct {
  2928. // HasFailures: Indicates that some or all conversions failed to update.
  2929. HasFailures bool `json:"hasFailures,omitempty"`
  2930. // Kind: Identifies what kind of resource this is. Value: the fixed
  2931. // string "dfareporting#conversionsBatchUpdateResponse".
  2932. Kind string `json:"kind,omitempty"`
  2933. // Status: The update status of each conversion. Statuses are returned
  2934. // in the same order that conversions are updated.
  2935. Status []*ConversionStatus `json:"status,omitempty"`
  2936. // ServerResponse contains the HTTP response code and headers from the
  2937. // server.
  2938. googleapi.ServerResponse `json:"-"`
  2939. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2940. // unconditionally include in API requests. By default, fields with
  2941. // empty values are omitted from API requests. However, any non-pointer,
  2942. // non-interface field appearing in ForceSendFields will be sent to the
  2943. // server regardless of whether the field is empty or not. This may be
  2944. // used to include empty fields in Patch requests.
  2945. ForceSendFields []string `json:"-"`
  2946. // NullFields is a list of field names (e.g. "HasFailures") to include
  2947. // in API requests with the JSON null value. By default, fields with
  2948. // empty values are omitted from API requests. However, any field with
  2949. // an empty value appearing in NullFields will be sent to the server as
  2950. // null. It is an error if a field in this list has a non-empty value.
  2951. // This may be used to include null fields in Patch requests.
  2952. NullFields []string `json:"-"`
  2953. }
  2954. func (s *ConversionsBatchUpdateResponse) MarshalJSON() ([]byte, error) {
  2955. type NoMethod ConversionsBatchUpdateResponse
  2956. raw := NoMethod(*s)
  2957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2958. }
  2959. // CountriesListResponse: Country List Response
  2960. type CountriesListResponse struct {
  2961. // Countries: Country collection.
  2962. Countries []*Country `json:"countries,omitempty"`
  2963. // Kind: Identifies what kind of resource this is. Value: the fixed
  2964. // string "dfareporting#countriesListResponse".
  2965. Kind string `json:"kind,omitempty"`
  2966. // ServerResponse contains the HTTP response code and headers from the
  2967. // server.
  2968. googleapi.ServerResponse `json:"-"`
  2969. // ForceSendFields is a list of field names (e.g. "Countries") to
  2970. // unconditionally include in API requests. By default, fields with
  2971. // empty values are omitted from API requests. However, any non-pointer,
  2972. // non-interface field appearing in ForceSendFields will be sent to the
  2973. // server regardless of whether the field is empty or not. This may be
  2974. // used to include empty fields in Patch requests.
  2975. ForceSendFields []string `json:"-"`
  2976. // NullFields is a list of field names (e.g. "Countries") to include in
  2977. // API requests with the JSON null value. By default, fields with empty
  2978. // values are omitted from API requests. However, any field with an
  2979. // empty value appearing in NullFields will be sent to the server as
  2980. // null. It is an error if a field in this list has a non-empty value.
  2981. // This may be used to include null fields in Patch requests.
  2982. NullFields []string `json:"-"`
  2983. }
  2984. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2985. type NoMethod CountriesListResponse
  2986. raw := NoMethod(*s)
  2987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2988. }
  2989. // Country: Contains information about a country that can be targeted by
  2990. // ads.
  2991. type Country struct {
  2992. // CountryCode: Country code.
  2993. CountryCode string `json:"countryCode,omitempty"`
  2994. // DartId: DART ID of this country. This is the ID used for targeting
  2995. // and generating reports.
  2996. DartId int64 `json:"dartId,omitempty,string"`
  2997. // Kind: Identifies what kind of resource this is. Value: the fixed
  2998. // string "dfareporting#country".
  2999. Kind string `json:"kind,omitempty"`
  3000. // Name: Name of this country.
  3001. Name string `json:"name,omitempty"`
  3002. // SslEnabled: Whether ad serving supports secure servers in this
  3003. // country.
  3004. SslEnabled bool `json:"sslEnabled,omitempty"`
  3005. // ServerResponse contains the HTTP response code and headers from the
  3006. // server.
  3007. googleapi.ServerResponse `json:"-"`
  3008. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  3009. // unconditionally include in API requests. By default, fields with
  3010. // empty values are omitted from API requests. However, any non-pointer,
  3011. // non-interface field appearing in ForceSendFields will be sent to the
  3012. // server regardless of whether the field is empty or not. This may be
  3013. // used to include empty fields in Patch requests.
  3014. ForceSendFields []string `json:"-"`
  3015. // NullFields is a list of field names (e.g. "CountryCode") to include
  3016. // in API requests with the JSON null value. By default, fields with
  3017. // empty values are omitted from API requests. However, any field with
  3018. // an empty value appearing in NullFields will be sent to the server as
  3019. // null. It is an error if a field in this list has a non-empty value.
  3020. // This may be used to include null fields in Patch requests.
  3021. NullFields []string `json:"-"`
  3022. }
  3023. func (s *Country) MarshalJSON() ([]byte, error) {
  3024. type NoMethod Country
  3025. raw := NoMethod(*s)
  3026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3027. }
  3028. // Creative: Contains properties of a Creative.
  3029. type Creative struct {
  3030. // AccountId: Account ID of this creative. This field, if left unset,
  3031. // will be auto-generated for both insert and update operations.
  3032. // Applicable to all creative types.
  3033. AccountId int64 `json:"accountId,omitempty,string"`
  3034. // Active: Whether the creative is active. Applicable to all creative
  3035. // types.
  3036. Active bool `json:"active,omitempty"`
  3037. // AdParameters: Ad parameters user for VPAID creative. This is a
  3038. // read-only field. Applicable to the following creative types: all
  3039. // VPAID.
  3040. AdParameters string `json:"adParameters,omitempty"`
  3041. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  3042. // customize the creative settings of a Rich Media ad running on your
  3043. // site without having to contact the advertiser. You can use keywords
  3044. // to dynamically change the look or functionality of a creative.
  3045. // Applicable to the following creative types: all RICH_MEDIA, and all
  3046. // VPAID.
  3047. AdTagKeys []string `json:"adTagKeys,omitempty"`
  3048. // AdditionalSizes: Additional sizes associated with a responsive
  3049. // creative. When inserting or updating a creative either the size ID
  3050. // field or size width and height fields can be used. Applicable to
  3051. // DISPLAY creatives when the primary asset type is HTML_IMAGE.
  3052. AdditionalSizes []*Size `json:"additionalSizes,omitempty"`
  3053. // AdvertiserId: Advertiser ID of this creative. This is a required
  3054. // field. Applicable to all creative types.
  3055. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  3056. // AllowScriptAccess: Whether script access is allowed for this
  3057. // creative. This is a read-only and deprecated field which will
  3058. // automatically be set to true on update. Applicable to the following
  3059. // creative types: FLASH_INPAGE.
  3060. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  3061. // Archived: Whether the creative is archived. Applicable to all
  3062. // creative types.
  3063. Archived bool `json:"archived,omitempty"`
  3064. // ArtworkType: Type of artwork used for the creative. This is a
  3065. // read-only field. Applicable to the following creative types: all
  3066. // RICH_MEDIA, and all VPAID.
  3067. //
  3068. // Possible values:
  3069. // "ARTWORK_TYPE_FLASH"
  3070. // "ARTWORK_TYPE_HTML5"
  3071. // "ARTWORK_TYPE_IMAGE"
  3072. // "ARTWORK_TYPE_MIXED"
  3073. ArtworkType string `json:"artworkType,omitempty"`
  3074. // AuthoringSource: Source application where creative was authored.
  3075. // Presently, only DBM authored creatives will have this field set.
  3076. // Applicable to all creative types.
  3077. //
  3078. // Possible values:
  3079. // "CREATIVE_AUTHORING_SOURCE_DBM"
  3080. // "CREATIVE_AUTHORING_SOURCE_DCM"
  3081. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  3082. AuthoringSource string `json:"authoringSource,omitempty"`
  3083. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  3084. // read-only field. Applicable to the following creative types:
  3085. // HTML5_BANNER.
  3086. //
  3087. // Possible values:
  3088. // "NINJA"
  3089. // "SWIFFY"
  3090. AuthoringTool string `json:"authoringTool,omitempty"`
  3091. // AutoAdvanceImages: Whether images are automatically advanced for
  3092. // image gallery creatives. Applicable to the following creative types:
  3093. // DISPLAY_IMAGE_GALLERY.
  3094. AutoAdvanceImages bool `json:"autoAdvanceImages,omitempty"`
  3095. // BackgroundColor: The 6-character HTML color code, beginning with #,
  3096. // for the background of the window area where the Flash file is
  3097. // displayed. Default is white. Applicable to the following creative
  3098. // types: FLASH_INPAGE.
  3099. BackgroundColor string `json:"backgroundColor,omitempty"`
  3100. // BackupImageClickThroughUrl: Click-through URL for backup image.
  3101. // Applicable to ENHANCED_BANNER when the primary asset type is not
  3102. // HTML_IMAGE.
  3103. BackupImageClickThroughUrl *CreativeClickThroughUrl `json:"backupImageClickThroughUrl,omitempty"`
  3104. // BackupImageFeatures: List of feature dependencies that will cause a
  3105. // backup image to be served if the browser that serves the ad does not
  3106. // support them. Feature dependencies are features that a browser must
  3107. // be able to support in order to render your HTML5 creative asset
  3108. // correctly. This field is initially auto-generated to contain all
  3109. // features detected by Campaign Manager for all the assets of this
  3110. // creative and can then be modified by the client. To reset this field,
  3111. // copy over all the creativeAssets' detected features. Applicable to
  3112. // the following creative types: HTML5_BANNER. Applicable to DISPLAY
  3113. // when the primary asset type is not HTML_IMAGE.
  3114. //
  3115. // Possible values:
  3116. // "APPLICATION_CACHE"
  3117. // "AUDIO"
  3118. // "CANVAS"
  3119. // "CANVAS_TEXT"
  3120. // "CSS_ANIMATIONS"
  3121. // "CSS_BACKGROUND_SIZE"
  3122. // "CSS_BORDER_IMAGE"
  3123. // "CSS_BORDER_RADIUS"
  3124. // "CSS_BOX_SHADOW"
  3125. // "CSS_COLUMNS"
  3126. // "CSS_FLEX_BOX"
  3127. // "CSS_FONT_FACE"
  3128. // "CSS_GENERATED_CONTENT"
  3129. // "CSS_GRADIENTS"
  3130. // "CSS_HSLA"
  3131. // "CSS_MULTIPLE_BGS"
  3132. // "CSS_OPACITY"
  3133. // "CSS_REFLECTIONS"
  3134. // "CSS_RGBA"
  3135. // "CSS_TEXT_SHADOW"
  3136. // "CSS_TRANSFORMS"
  3137. // "CSS_TRANSFORMS3D"
  3138. // "CSS_TRANSITIONS"
  3139. // "DRAG_AND_DROP"
  3140. // "GEO_LOCATION"
  3141. // "HASH_CHANGE"
  3142. // "HISTORY"
  3143. // "INDEXED_DB"
  3144. // "INLINE_SVG"
  3145. // "INPUT_ATTR_AUTOCOMPLETE"
  3146. // "INPUT_ATTR_AUTOFOCUS"
  3147. // "INPUT_ATTR_LIST"
  3148. // "INPUT_ATTR_MAX"
  3149. // "INPUT_ATTR_MIN"
  3150. // "INPUT_ATTR_MULTIPLE"
  3151. // "INPUT_ATTR_PATTERN"
  3152. // "INPUT_ATTR_PLACEHOLDER"
  3153. // "INPUT_ATTR_REQUIRED"
  3154. // "INPUT_ATTR_STEP"
  3155. // "INPUT_TYPE_COLOR"
  3156. // "INPUT_TYPE_DATE"
  3157. // "INPUT_TYPE_DATETIME"
  3158. // "INPUT_TYPE_DATETIME_LOCAL"
  3159. // "INPUT_TYPE_EMAIL"
  3160. // "INPUT_TYPE_MONTH"
  3161. // "INPUT_TYPE_NUMBER"
  3162. // "INPUT_TYPE_RANGE"
  3163. // "INPUT_TYPE_SEARCH"
  3164. // "INPUT_TYPE_TEL"
  3165. // "INPUT_TYPE_TIME"
  3166. // "INPUT_TYPE_URL"
  3167. // "INPUT_TYPE_WEEK"
  3168. // "LOCAL_STORAGE"
  3169. // "POST_MESSAGE"
  3170. // "SESSION_STORAGE"
  3171. // "SMIL"
  3172. // "SVG_CLIP_PATHS"
  3173. // "SVG_FE_IMAGE"
  3174. // "SVG_FILTERS"
  3175. // "SVG_HREF"
  3176. // "TOUCH"
  3177. // "VIDEO"
  3178. // "WEBGL"
  3179. // "WEB_SOCKETS"
  3180. // "WEB_SQL_DATABASE"
  3181. // "WEB_WORKERS"
  3182. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  3183. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  3184. // backup image. Applicable to the following creative types: DISPLAY
  3185. // when the primary asset type is not HTML_IMAGE.
  3186. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  3187. // BackupImageTargetWindow: Target window for backup image. Applicable
  3188. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  3189. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3190. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  3191. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  3192. // HTML5_BANNER creatives, this is a subset of detected click tags for
  3193. // the assets associated with this creative. After creating a flash
  3194. // asset, detected click tags will be returned in the
  3195. // creativeAssetMetadata. When inserting the creative, populate the
  3196. // creative clickTags field using the creativeAssetMetadata.clickTags
  3197. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  3198. // one entry in this list for each image creative asset. A click tag is
  3199. // matched with a corresponding creative asset by matching the
  3200. // clickTag.name field with the creativeAsset.assetIdentifier.name
  3201. // field. Applicable to the following creative types:
  3202. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  3203. // DISPLAY when the primary asset type is not HTML_IMAGE.
  3204. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3205. // CommercialId: Industry standard ID assigned to creative for reach and
  3206. // frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives.
  3207. CommercialId string `json:"commercialId,omitempty"`
  3208. // CompanionCreatives: List of companion creatives assigned to an
  3209. // in-Stream video creative. Acceptable values include IDs of existing
  3210. // flash and image creatives. Applicable to the following creative
  3211. // types: all VPAID, all INSTREAM_AUDIO and all INSTREAM_VIDEO with
  3212. // dynamicAssetSelection set to false.
  3213. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  3214. // Compatibility: Compatibilities associated with this creative. This is
  3215. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3216. // rendering either on desktop or on mobile devices or in mobile apps
  3217. // for regular or interstitial ads, respectively. APP and
  3218. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3219. // creatives may have these compatibilities since new creatives will
  3220. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3221. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3222. // with the VAST standard. IN_STREAM_AUDIO refers to rendering in
  3223. // in-stream audio ads developed with the VAST standard. Applicable to
  3224. // all creative types.
  3225. //
  3226. // Acceptable values are:
  3227. // - "APP"
  3228. // - "APP_INTERSTITIAL"
  3229. // - "IN_STREAM_VIDEO"
  3230. // - "IN_STREAM_AUDIO"
  3231. // - "DISPLAY"
  3232. // - "DISPLAY_INTERSTITIAL"
  3233. //
  3234. // Possible values:
  3235. // "APP"
  3236. // "APP_INTERSTITIAL"
  3237. // "DISPLAY"
  3238. // "DISPLAY_INTERSTITIAL"
  3239. // "IN_STREAM_AUDIO"
  3240. // "IN_STREAM_VIDEO"
  3241. Compatibility []string `json:"compatibility,omitempty"`
  3242. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3243. // creative need to be automatically converted to HTML5. This flag is
  3244. // enabled by default and users can choose to disable it if they don't
  3245. // want the system to generate and use HTML5 asset for this creative.
  3246. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3247. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3248. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3249. // CounterCustomEvents: List of counter events configured for the
  3250. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3251. // and auto-generated from clickTags. Applicable to the following
  3252. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3253. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3254. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3255. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3256. // CreativeAssets: Assets associated with a creative. Applicable to all
  3257. // but the following creative types: INTERNAL_REDIRECT,
  3258. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3259. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3260. // CreativeFieldAssignments: Creative field assignments for this
  3261. // creative. Applicable to all creative types.
  3262. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3263. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3264. // Key-values let you customize the creative settings of a Rich Media ad
  3265. // running on your site without having to contact the advertiser. You
  3266. // can use key-values to dynamically change the look or functionality of
  3267. // a creative. Applicable to the following creative types: all
  3268. // RICH_MEDIA, and all VPAID.
  3269. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3270. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3271. // target individual assets in this creative. When set to true
  3272. // creativeAssetSelection must be set. This also controls asset-level
  3273. // companions. When this is true, companion creatives should be assigned
  3274. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3275. // creatives.
  3276. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3277. // ExitCustomEvents: List of exit events configured for the creative.
  3278. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3279. // and auto-generated from clickTags, For DISPLAY, an event is also
  3280. // created from the backupImageReportingLabel. Applicable to the
  3281. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3282. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3283. // HTML_IMAGE.
  3284. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3285. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3286. // file communicate with either Flash Player or the program hosting
  3287. // Flash Player, such as a web browser. This is only triggered if
  3288. // allowScriptAccess field is true. Applicable to the following creative
  3289. // types: FLASH_INPAGE.
  3290. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3291. // HtmlCode: HTML code for the creative. This is a required field when
  3292. // applicable. This field is ignored if htmlCodeLocked is true.
  3293. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3294. // and HTML5_BANNER, and all RICH_MEDIA.
  3295. HtmlCode string `json:"htmlCode,omitempty"`
  3296. // HtmlCodeLocked: Whether HTML code is generated by Campaign Manager or
  3297. // manually entered. Set to true to ignore changes to htmlCode.
  3298. // Applicable to the following creative types: FLASH_INPAGE and
  3299. // HTML5_BANNER.
  3300. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3301. // Id: ID of this creative. This is a read-only, auto-generated field.
  3302. // Applicable to all creative types.
  3303. Id int64 `json:"id,omitempty,string"`
  3304. // IdDimensionValue: Dimension value for the ID of this creative. This
  3305. // is a read-only field. Applicable to all creative types.
  3306. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3307. // Kind: Identifies what kind of resource this is. Value: the fixed
  3308. // string "dfareporting#creative".
  3309. Kind string `json:"kind,omitempty"`
  3310. // LastModifiedInfo: Creative last modification information. This is a
  3311. // read-only field. Applicable to all creative types.
  3312. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3313. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3314. // associated with rich media and VPAID creatives. This is a read-only
  3315. // field. Applicable to the following creative types: all RICH_MEDIA,
  3316. // and all VPAID.
  3317. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3318. // MediaDescription: Description of the audio or video ad. Applicable to
  3319. // the following creative types: all INSTREAM_VIDEO, INSTREAM_AUDIO, and
  3320. // all VPAID.
  3321. MediaDescription string `json:"mediaDescription,omitempty"`
  3322. // MediaDuration: Creative audio or video duration in seconds. This is a
  3323. // read-only field. Applicable to the following creative types:
  3324. // INSTREAM_VIDEO, INSTREAM_AUDIO, all RICH_MEDIA, and all VPAID.
  3325. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3326. // Name: Name of the creative. This is a required field and must be less
  3327. // than 256 characters long. Applicable to all creative types.
  3328. Name string `json:"name,omitempty"`
  3329. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3330. // to the following creative types: all RICH_MEDIA.
  3331. OverrideCss string `json:"overrideCss,omitempty"`
  3332. // ProgressOffset: Amount of time to play the video before counting a
  3333. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3334. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3335. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3336. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3337. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3338. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3339. // This is a required field when applicable. Applicable to the following
  3340. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3341. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3342. RedirectUrl string `json:"redirectUrl,omitempty"`
  3343. // RenderingId: ID of current rendering version. This is a read-only
  3344. // field. Applicable to all creative types.
  3345. RenderingId int64 `json:"renderingId,omitempty,string"`
  3346. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3347. // this creative. This is a read-only field. Applicable to all creative
  3348. // types.
  3349. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3350. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3351. // for this creative. For example, 11.2.202.235. This is a read-only
  3352. // field. Applicable to the following creative types: all RICH_MEDIA,
  3353. // and all VPAID.
  3354. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3355. // RequiredFlashVersion: The internal Flash version for this creative as
  3356. // calculated by Studio. This is a read-only field. Applicable to the
  3357. // following creative types: FLASH_INPAGE all RICH_MEDIA, and all VPAID.
  3358. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3359. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3360. // Size: Size associated with this creative. When inserting or updating
  3361. // a creative either the size ID field or size width and height fields
  3362. // can be used. This is a required field when applicable; however for
  3363. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3364. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3365. // automatically set using the actual size of the associated image
  3366. // assets. Applicable to the following creative types: DISPLAY,
  3367. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3368. // RICH_MEDIA.
  3369. Size *Size `json:"size,omitempty"`
  3370. // SkipOffset: Amount of time to play the video before the skip button
  3371. // appears. Applicable to the following creative types: all
  3372. // INSTREAM_VIDEO.
  3373. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3374. // Skippable: Whether the user can choose to skip the creative.
  3375. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3376. // all VPAID.
  3377. Skippable bool `json:"skippable,omitempty"`
  3378. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3379. // read-only field. Applicable to all creative types.
  3380. SslCompliant bool `json:"sslCompliant,omitempty"`
  3381. // SslOverride: Whether creative should be treated as SSL compliant even
  3382. // if the system scan shows it's not. Applicable to all creative types.
  3383. SslOverride bool `json:"sslOverride,omitempty"`
  3384. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3385. // and VPAID creatives. This is a read-only field. Applicable to the
  3386. // following creative types: all RICH_MEDIA, and all VPAID.
  3387. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3388. // StudioCreativeId: Studio creative ID associated with rich media and
  3389. // VPAID creatives. This is a read-only field. Applicable to the
  3390. // following creative types: all RICH_MEDIA, and all VPAID.
  3391. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3392. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3393. // with rich media and VPAID creatives. This is a read-only field.
  3394. // Applicable to the following creative types: all RICH_MEDIA, and all
  3395. // VPAID.
  3396. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3397. // SubaccountId: Subaccount ID of this creative. This field, if left
  3398. // unset, will be auto-generated for both insert and update operations.
  3399. // Applicable to all creative types.
  3400. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3401. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3402. // backup image impressions. Applicable to the following creative types:
  3403. // all RICH_MEDIA.
  3404. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3405. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3406. // rich media impressions. Applicable to the following creative types:
  3407. // all RICH_MEDIA.
  3408. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3409. // ThirdPartyUrls: Third-party URLs for tracking in-stream creative
  3410. // events. Applicable to the following creative types: all
  3411. // INSTREAM_VIDEO, all INSTREAM_AUDIO, and all VPAID.
  3412. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3413. // TimerCustomEvents: List of timer events configured for the creative.
  3414. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3415. // auto-generated from clickTags. Applicable to the following creative
  3416. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3417. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3418. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3419. // TotalFileSize: Combined size of all creative assets. This is a
  3420. // read-only field. Applicable to the following creative types: all
  3421. // RICH_MEDIA, and all VPAID.
  3422. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3423. // Type: Type of this creative. This is a required field. Applicable to
  3424. // all creative types.
  3425. //
  3426. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3427. // existing creatives. New creatives should use DISPLAY as a replacement
  3428. // for these types.
  3429. //
  3430. // Possible values:
  3431. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3432. // "CUSTOM_DISPLAY"
  3433. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3434. // "DISPLAY"
  3435. // "DISPLAY_IMAGE_GALLERY"
  3436. // "DISPLAY_REDIRECT"
  3437. // "FLASH_INPAGE"
  3438. // "HTML5_BANNER"
  3439. // "IMAGE"
  3440. // "INSTREAM_AUDIO"
  3441. // "INSTREAM_VIDEO"
  3442. // "INSTREAM_VIDEO_REDIRECT"
  3443. // "INTERNAL_REDIRECT"
  3444. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3445. // "RICH_MEDIA_DISPLAY_BANNER"
  3446. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3447. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3448. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3449. // "RICH_MEDIA_IM_EXPAND"
  3450. // "RICH_MEDIA_INPAGE_FLOATING"
  3451. // "RICH_MEDIA_MOBILE_IN_APP"
  3452. // "RICH_MEDIA_PEEL_DOWN"
  3453. // "TRACKING_TEXT"
  3454. // "VPAID_LINEAR_VIDEO"
  3455. // "VPAID_NON_LINEAR_VIDEO"
  3456. Type string `json:"type,omitempty"`
  3457. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  3458. // to the following creative types: INSTREAM_AUDIO and INSTREAM_VIDEO
  3459. // and VPAID.
  3460. UniversalAdId *UniversalAdId `json:"universalAdId,omitempty"`
  3461. // Version: The version number helps you keep track of multiple versions
  3462. // of your creative in your reports. The version number will always be
  3463. // auto-generated during insert operations to start at 1. For tracking
  3464. // creatives the version cannot be incremented and will always remain at
  3465. // 1. For all other creative types the version can be incremented only
  3466. // by 1 during update operations. In addition, the version will be
  3467. // automatically incremented by 1 when undergoing Rich Media creative
  3468. // merging. Applicable to all creative types.
  3469. Version int64 `json:"version,omitempty"`
  3470. // ServerResponse contains the HTTP response code and headers from the
  3471. // server.
  3472. googleapi.ServerResponse `json:"-"`
  3473. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3474. // unconditionally include in API requests. By default, fields with
  3475. // empty values are omitted from API requests. However, any non-pointer,
  3476. // non-interface field appearing in ForceSendFields will be sent to the
  3477. // server regardless of whether the field is empty or not. This may be
  3478. // used to include empty fields in Patch requests.
  3479. ForceSendFields []string `json:"-"`
  3480. // NullFields is a list of field names (e.g. "AccountId") to include in
  3481. // API requests with the JSON null value. By default, fields with empty
  3482. // values are omitted from API requests. However, any field with an
  3483. // empty value appearing in NullFields will be sent to the server as
  3484. // null. It is an error if a field in this list has a non-empty value.
  3485. // This may be used to include null fields in Patch requests.
  3486. NullFields []string `json:"-"`
  3487. }
  3488. func (s *Creative) MarshalJSON() ([]byte, error) {
  3489. type NoMethod Creative
  3490. raw := NoMethod(*s)
  3491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3492. }
  3493. func (s *Creative) UnmarshalJSON(data []byte) error {
  3494. type NoMethod Creative
  3495. var s1 struct {
  3496. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3497. *NoMethod
  3498. }
  3499. s1.NoMethod = (*NoMethod)(s)
  3500. if err := json.Unmarshal(data, &s1); err != nil {
  3501. return err
  3502. }
  3503. s.MediaDuration = float64(s1.MediaDuration)
  3504. return nil
  3505. }
  3506. // CreativeAsset: Creative Asset.
  3507. type CreativeAsset struct {
  3508. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3509. // This is a read-only field. Applicable to the following creative type:
  3510. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3511. // not HTML_IMAGE.
  3512. ActionScript3 bool `json:"actionScript3,omitempty"`
  3513. // Active: Whether the video or audio asset is active. This is a
  3514. // read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the
  3515. // following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and all
  3516. // VPAID.
  3517. Active bool `json:"active,omitempty"`
  3518. // AdditionalSizes: Additional sizes associated with this creative
  3519. // asset. HTML5 asset generated by compatible software such as GWD will
  3520. // be able to support more sizes this creative asset can render.
  3521. AdditionalSizes []*Size `json:"additionalSizes,omitempty"`
  3522. // Alignment: Possible alignments for an asset. This is a read-only
  3523. // field. Applicable to the following creative types:
  3524. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3525. //
  3526. // Possible values:
  3527. // "ALIGNMENT_BOTTOM"
  3528. // "ALIGNMENT_LEFT"
  3529. // "ALIGNMENT_RIGHT"
  3530. // "ALIGNMENT_TOP"
  3531. Alignment string `json:"alignment,omitempty"`
  3532. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3533. // field. Applicable to the following creative types: all RICH_MEDIA.
  3534. //
  3535. // Possible values:
  3536. // "ARTWORK_TYPE_FLASH"
  3537. // "ARTWORK_TYPE_HTML5"
  3538. // "ARTWORK_TYPE_IMAGE"
  3539. // "ARTWORK_TYPE_MIXED"
  3540. ArtworkType string `json:"artworkType,omitempty"`
  3541. // AssetIdentifier: Identifier of this asset. This is the same
  3542. // identifier returned during creative asset insert operation. This is a
  3543. // required field. Applicable to all but the following creative types:
  3544. // all REDIRECT and TRACKING_TEXT.
  3545. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3546. // AudioBitRate: Audio stream bit rate in kbps. This is a read-only
  3547. // field. Applicable to the following creative types: INSTREAM_AUDIO,
  3548. // INSTREAM_VIDEO and all VPAID.
  3549. AudioBitRate int64 `json:"audioBitRate,omitempty"`
  3550. // AudioSampleRate: Audio sample bit rate in hertz. This is a read-only
  3551. // field. Applicable to the following creative types: INSTREAM_AUDIO,
  3552. // INSTREAM_VIDEO and all VPAID.
  3553. AudioSampleRate int64 `json:"audioSampleRate,omitempty"`
  3554. // BackupImageExit: Exit event configured for the backup image.
  3555. // Applicable to the following creative types: all RICH_MEDIA.
  3556. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3557. // BitRate: Detected bit-rate for audio or video asset. This is a
  3558. // read-only field. Applicable to the following creative types:
  3559. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3560. BitRate int64 `json:"bitRate,omitempty"`
  3561. // ChildAssetType: Rich media child asset type. This is a read-only
  3562. // field. Applicable to the following creative types: all VPAID.
  3563. //
  3564. // Possible values:
  3565. // "CHILD_ASSET_TYPE_DATA"
  3566. // "CHILD_ASSET_TYPE_FLASH"
  3567. // "CHILD_ASSET_TYPE_IMAGE"
  3568. // "CHILD_ASSET_TYPE_VIDEO"
  3569. ChildAssetType string `json:"childAssetType,omitempty"`
  3570. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3571. // field. Applicable to the following creative types: all RICH_MEDIA and
  3572. // all VPAID. Additionally, applicable to assets whose displayType is
  3573. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3574. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3575. // CompanionCreativeIds: List of companion creatives assigned to an
  3576. // in-stream video creative asset. Acceptable values include IDs of
  3577. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3578. // creative type with dynamicAssetSelection set to true.
  3579. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3580. // CustomStartTimeValue: Custom start time in seconds for making the
  3581. // asset visible. Applicable to the following creative types: all
  3582. // RICH_MEDIA. Value must be greater than or equal to 0.
  3583. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3584. // DetectedFeatures: List of feature dependencies for the creative asset
  3585. // that are detected by Campaign Manager. Feature dependencies are
  3586. // features that a browser must be able to support in order to render
  3587. // your HTML5 creative correctly. This is a read-only, auto-generated
  3588. // field. Applicable to the following creative types: HTML5_BANNER.
  3589. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3590. //
  3591. // Possible values:
  3592. // "APPLICATION_CACHE"
  3593. // "AUDIO"
  3594. // "CANVAS"
  3595. // "CANVAS_TEXT"
  3596. // "CSS_ANIMATIONS"
  3597. // "CSS_BACKGROUND_SIZE"
  3598. // "CSS_BORDER_IMAGE"
  3599. // "CSS_BORDER_RADIUS"
  3600. // "CSS_BOX_SHADOW"
  3601. // "CSS_COLUMNS"
  3602. // "CSS_FLEX_BOX"
  3603. // "CSS_FONT_FACE"
  3604. // "CSS_GENERATED_CONTENT"
  3605. // "CSS_GRADIENTS"
  3606. // "CSS_HSLA"
  3607. // "CSS_MULTIPLE_BGS"
  3608. // "CSS_OPACITY"
  3609. // "CSS_REFLECTIONS"
  3610. // "CSS_RGBA"
  3611. // "CSS_TEXT_SHADOW"
  3612. // "CSS_TRANSFORMS"
  3613. // "CSS_TRANSFORMS3D"
  3614. // "CSS_TRANSITIONS"
  3615. // "DRAG_AND_DROP"
  3616. // "GEO_LOCATION"
  3617. // "HASH_CHANGE"
  3618. // "HISTORY"
  3619. // "INDEXED_DB"
  3620. // "INLINE_SVG"
  3621. // "INPUT_ATTR_AUTOCOMPLETE"
  3622. // "INPUT_ATTR_AUTOFOCUS"
  3623. // "INPUT_ATTR_LIST"
  3624. // "INPUT_ATTR_MAX"
  3625. // "INPUT_ATTR_MIN"
  3626. // "INPUT_ATTR_MULTIPLE"
  3627. // "INPUT_ATTR_PATTERN"
  3628. // "INPUT_ATTR_PLACEHOLDER"
  3629. // "INPUT_ATTR_REQUIRED"
  3630. // "INPUT_ATTR_STEP"
  3631. // "INPUT_TYPE_COLOR"
  3632. // "INPUT_TYPE_DATE"
  3633. // "INPUT_TYPE_DATETIME"
  3634. // "INPUT_TYPE_DATETIME_LOCAL"
  3635. // "INPUT_TYPE_EMAIL"
  3636. // "INPUT_TYPE_MONTH"
  3637. // "INPUT_TYPE_NUMBER"
  3638. // "INPUT_TYPE_RANGE"
  3639. // "INPUT_TYPE_SEARCH"
  3640. // "INPUT_TYPE_TEL"
  3641. // "INPUT_TYPE_TIME"
  3642. // "INPUT_TYPE_URL"
  3643. // "INPUT_TYPE_WEEK"
  3644. // "LOCAL_STORAGE"
  3645. // "POST_MESSAGE"
  3646. // "SESSION_STORAGE"
  3647. // "SMIL"
  3648. // "SVG_CLIP_PATHS"
  3649. // "SVG_FE_IMAGE"
  3650. // "SVG_FILTERS"
  3651. // "SVG_HREF"
  3652. // "TOUCH"
  3653. // "VIDEO"
  3654. // "WEBGL"
  3655. // "WEB_SOCKETS"
  3656. // "WEB_SQL_DATABASE"
  3657. // "WEB_WORKERS"
  3658. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3659. // DisplayType: Type of rich media asset. This is a read-only field.
  3660. // Applicable to the following creative types: all RICH_MEDIA.
  3661. //
  3662. // Possible values:
  3663. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3664. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3665. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3666. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3667. // "ASSET_DISPLAY_TYPE_FLOATING"
  3668. // "ASSET_DISPLAY_TYPE_INPAGE"
  3669. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3670. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3671. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3672. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3673. DisplayType string `json:"displayType,omitempty"`
  3674. // Duration: Duration in seconds for which an asset will be displayed.
  3675. // Applicable to the following creative types: INSTREAM_AUDIO,
  3676. // INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must be greater than or
  3677. // equal to 1.
  3678. Duration int64 `json:"duration,omitempty"`
  3679. // DurationType: Duration type for which an asset will be displayed.
  3680. // Applicable to the following creative types: all RICH_MEDIA.
  3681. //
  3682. // Possible values:
  3683. // "ASSET_DURATION_TYPE_AUTO"
  3684. // "ASSET_DURATION_TYPE_CUSTOM"
  3685. // "ASSET_DURATION_TYPE_NONE"
  3686. DurationType string `json:"durationType,omitempty"`
  3687. // ExpandedDimension: Detected expanded dimension for video asset. This
  3688. // is a read-only field. Applicable to the following creative types:
  3689. // INSTREAM_VIDEO and all VPAID.
  3690. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3691. // FileSize: File size associated with this creative asset. This is a
  3692. // read-only field. Applicable to all but the following creative types:
  3693. // all REDIRECT and TRACKING_TEXT.
  3694. FileSize int64 `json:"fileSize,omitempty,string"`
  3695. // FlashVersion: Flash version of the asset. This is a read-only field.
  3696. // Applicable to the following creative types: FLASH_INPAGE, all
  3697. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3698. // asset type is not HTML_IMAGE.
  3699. FlashVersion int64 `json:"flashVersion,omitempty"`
  3700. // FrameRate: Video frame rate for video asset in frames per second.
  3701. // This is a read-only field. Applicable to the following creative
  3702. // types: INSTREAM_VIDEO and all VPAID.
  3703. FrameRate float64 `json:"frameRate,omitempty"`
  3704. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3705. // Applicable to the following creative types: all RICH_MEDIA.
  3706. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3707. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3708. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3709. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3710. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3711. // a read-only field. Applicable to the following creative types: all
  3712. // RICH_MEDIA.
  3713. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3714. // Id: Numeric ID of this creative asset. This is a required field and
  3715. // should not be modified. Applicable to all but the following creative
  3716. // types: all REDIRECT and TRACKING_TEXT.
  3717. Id int64 `json:"id,omitempty,string"`
  3718. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3719. // read-only, auto-generated field.
  3720. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3721. // MediaDuration: Detected duration for audio or video asset. This is a
  3722. // read-only field. Applicable to the following creative types:
  3723. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3724. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3725. // MimeType: Detected MIME type for audio or video asset. This is a
  3726. // read-only field. Applicable to the following creative types:
  3727. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3728. MimeType string `json:"mimeType,omitempty"`
  3729. // Offset: Offset position for an asset in collapsed mode. This is a
  3730. // read-only field. Applicable to the following creative types: all
  3731. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3732. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3733. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3734. Offset *OffsetPosition `json:"offset,omitempty"`
  3735. // Orientation: Orientation of video asset. This is a read-only,
  3736. // auto-generated field.
  3737. //
  3738. // Possible values:
  3739. // "LANDSCAPE"
  3740. // "PORTRAIT"
  3741. // "SQUARE"
  3742. Orientation string `json:"orientation,omitempty"`
  3743. // OriginalBackup: Whether the backup asset is original or changed by
  3744. // the user in Campaign Manager. Applicable to the following creative
  3745. // types: all RICH_MEDIA.
  3746. OriginalBackup bool `json:"originalBackup,omitempty"`
  3747. // PoliteLoad: Whether this asset is used as a polite load asset.
  3748. PoliteLoad bool `json:"politeLoad,omitempty"`
  3749. // Position: Offset position for an asset. Applicable to the following
  3750. // creative types: all RICH_MEDIA.
  3751. Position *OffsetPosition `json:"position,omitempty"`
  3752. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3753. // field. Applicable to the following creative types: all RICH_MEDIA.
  3754. //
  3755. // Possible values:
  3756. // "OFFSET_UNIT_PERCENT"
  3757. // "OFFSET_UNIT_PIXEL"
  3758. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3759. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3760. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3761. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3762. // Applicable to the following creative types: all RICH_MEDIA.
  3763. //
  3764. // Possible values:
  3765. // "OFFSET_UNIT_PERCENT"
  3766. // "OFFSET_UNIT_PIXEL"
  3767. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3768. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3769. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3770. // read-only field. Applicable to the following creative types:
  3771. // INSTREAM_VIDEO and all VPAID.
  3772. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3773. // Pushdown: Whether the asset pushes down other content. Applicable to
  3774. // the following creative types: all RICH_MEDIA. Additionally, only
  3775. // applicable when the asset offsets are 0, the collapsedSize.width
  3776. // matches size.width, and the collapsedSize.height is less than
  3777. // size.height.
  3778. Pushdown bool `json:"pushdown,omitempty"`
  3779. // PushdownDuration: Pushdown duration in seconds for an asset.
  3780. // Applicable to the following creative types: all
  3781. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3782. // field is true, the offsets are 0, the collapsedSize.width matches
  3783. // size.width, and the collapsedSize.height is less than size.height.
  3784. // Acceptable values are 0 to 9.99, inclusive.
  3785. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3786. // Role: Role of the asset in relation to creative. Applicable to all
  3787. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3788. // This is a required field.
  3789. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3790. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3791. // primary assets), and all VPAID creatives.
  3792. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3793. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3794. // type is not HTML_IMAGE.
  3795. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3796. // creatives.
  3797. // OTHER refers to assets from sources other than Campaign Manager, such
  3798. // as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3799. // creatives.
  3800. // PARENT_VIDEO refers to videos uploaded by the user in Campaign
  3801. // Manager and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3802. // creatives.
  3803. // TRANSCODED_VIDEO refers to videos transcoded by Campaign Manager from
  3804. // PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and
  3805. // VPAID_LINEAR_VIDEO creatives.
  3806. // ALTERNATE_VIDEO refers to the Campaign Manager representation of
  3807. // child asset videos from Studio, and is applicable to
  3808. // VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within
  3809. // Campaign Manager.
  3810. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3811. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3812. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3813. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3814. // creative.
  3815. // PARENT_AUDIO refers to audios uploaded by the user in Campaign
  3816. // Manager and is applicable to INSTREAM_AUDIO
  3817. // creatives.
  3818. // TRANSCODED_AUDIO refers to audios transcoded by Campaign Manager from
  3819. // PARENT_AUDIO assets and is applicable to INSTREAM_AUDIO creatives.
  3820. //
  3821. // Possible values:
  3822. // "ADDITIONAL_FLASH"
  3823. // "ADDITIONAL_IMAGE"
  3824. // "ALTERNATE_VIDEO"
  3825. // "BACKUP_IMAGE"
  3826. // "OTHER"
  3827. // "PARENT_AUDIO"
  3828. // "PARENT_VIDEO"
  3829. // "PRIMARY"
  3830. // "TRANSCODED_AUDIO"
  3831. // "TRANSCODED_VIDEO"
  3832. Role string `json:"role,omitempty"`
  3833. // Size: Size associated with this creative asset. This is a required
  3834. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3835. // if left blank, this field will be automatically set using the actual
  3836. // size of the associated image asset. Applicable to the following
  3837. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3838. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3839. // asset type is not HTML_IMAGE.
  3840. Size *Size `json:"size,omitempty"`
  3841. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3842. // field. Applicable to all but the following creative types: all
  3843. // REDIRECT and TRACKING_TEXT.
  3844. SslCompliant bool `json:"sslCompliant,omitempty"`
  3845. // StartTimeType: Initial wait time type before making the asset
  3846. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3847. //
  3848. // Possible values:
  3849. // "ASSET_START_TIME_TYPE_CUSTOM"
  3850. // "ASSET_START_TIME_TYPE_NONE"
  3851. StartTimeType string `json:"startTimeType,omitempty"`
  3852. // StreamingServingUrl: Streaming URL for video asset. This is a
  3853. // read-only field. Applicable to the following creative types:
  3854. // INSTREAM_VIDEO and all VPAID.
  3855. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3856. // Transparency: Whether the asset is transparent. Applicable to the
  3857. // following creative types: all RICH_MEDIA. Additionally, only
  3858. // applicable to HTML5 assets.
  3859. Transparency bool `json:"transparency,omitempty"`
  3860. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3861. // read-only field. Applicable to the following creative types: all
  3862. // RICH_MEDIA.
  3863. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3864. // WindowMode: Window mode options for flash assets. Applicable to the
  3865. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3866. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3867. // RICH_MEDIA_INPAGE_FLOATING.
  3868. //
  3869. // Possible values:
  3870. // "OPAQUE"
  3871. // "TRANSPARENT"
  3872. // "WINDOW"
  3873. WindowMode string `json:"windowMode,omitempty"`
  3874. // ZIndex: zIndex value of an asset. Applicable to the following
  3875. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3876. // assets whose displayType is NOT one of the following types:
  3877. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3878. // values are -999999999 to 999999999, inclusive.
  3879. ZIndex int64 `json:"zIndex,omitempty"`
  3880. // ZipFilename: File name of zip file. This is a read-only field.
  3881. // Applicable to the following creative types: HTML5_BANNER.
  3882. ZipFilename string `json:"zipFilename,omitempty"`
  3883. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3884. // to the following creative types: HTML5_BANNER.
  3885. ZipFilesize string `json:"zipFilesize,omitempty"`
  3886. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3887. // unconditionally include in API requests. By default, fields with
  3888. // empty values are omitted from API requests. However, any non-pointer,
  3889. // non-interface field appearing in ForceSendFields will be sent to the
  3890. // server regardless of whether the field is empty or not. This may be
  3891. // used to include empty fields in Patch requests.
  3892. ForceSendFields []string `json:"-"`
  3893. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3894. // in API requests with the JSON null value. By default, fields with
  3895. // empty values are omitted from API requests. However, any field with
  3896. // an empty value appearing in NullFields will be sent to the server as
  3897. // null. It is an error if a field in this list has a non-empty value.
  3898. // This may be used to include null fields in Patch requests.
  3899. NullFields []string `json:"-"`
  3900. }
  3901. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3902. type NoMethod CreativeAsset
  3903. raw := NoMethod(*s)
  3904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3905. }
  3906. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3907. type NoMethod CreativeAsset
  3908. var s1 struct {
  3909. FrameRate gensupport.JSONFloat64 `json:"frameRate"`
  3910. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3911. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3912. *NoMethod
  3913. }
  3914. s1.NoMethod = (*NoMethod)(s)
  3915. if err := json.Unmarshal(data, &s1); err != nil {
  3916. return err
  3917. }
  3918. s.FrameRate = float64(s1.FrameRate)
  3919. s.MediaDuration = float64(s1.MediaDuration)
  3920. s.PushdownDuration = float64(s1.PushdownDuration)
  3921. return nil
  3922. }
  3923. // CreativeAssetId: Creative Asset ID.
  3924. type CreativeAssetId struct {
  3925. // Name: Name of the creative asset. This is a required field while
  3926. // inserting an asset. After insertion, this assetIdentifier is used to
  3927. // identify the uploaded asset. Characters in the name must be
  3928. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3929. Name string `json:"name,omitempty"`
  3930. // Type: Type of asset to upload. This is a required field. FLASH and
  3931. // IMAGE are no longer supported for new uploads. All image assets
  3932. // should use HTML_IMAGE.
  3933. //
  3934. // Possible values:
  3935. // "AUDIO"
  3936. // "FLASH"
  3937. // "HTML"
  3938. // "HTML_IMAGE"
  3939. // "IMAGE"
  3940. // "VIDEO"
  3941. Type string `json:"type,omitempty"`
  3942. // ForceSendFields is a list of field names (e.g. "Name") to
  3943. // unconditionally include in API requests. By default, fields with
  3944. // empty values are omitted from API requests. However, any non-pointer,
  3945. // non-interface field appearing in ForceSendFields will be sent to the
  3946. // server regardless of whether the field is empty or not. This may be
  3947. // used to include empty fields in Patch requests.
  3948. ForceSendFields []string `json:"-"`
  3949. // NullFields is a list of field names (e.g. "Name") to include in API
  3950. // requests with the JSON null value. By default, fields with empty
  3951. // values are omitted from API requests. However, any field with an
  3952. // empty value appearing in NullFields will be sent to the server as
  3953. // null. It is an error if a field in this list has a non-empty value.
  3954. // This may be used to include null fields in Patch requests.
  3955. NullFields []string `json:"-"`
  3956. }
  3957. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3958. type NoMethod CreativeAssetId
  3959. raw := NoMethod(*s)
  3960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3961. }
  3962. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3963. // creative asset file which will be uploaded or has already been
  3964. // uploaded. Refer to the creative sample code for how to upload assets
  3965. // and insert a creative.
  3966. type CreativeAssetMetadata struct {
  3967. // AssetIdentifier: ID of the creative asset. This is a required field.
  3968. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3969. // ClickTags: List of detected click tags for assets. This is a
  3970. // read-only auto-generated field.
  3971. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3972. // DetectedFeatures: List of feature dependencies for the creative asset
  3973. // that are detected by Campaign Manager. Feature dependencies are
  3974. // features that a browser must be able to support in order to render
  3975. // your HTML5 creative correctly. This is a read-only, auto-generated
  3976. // field.
  3977. //
  3978. // Possible values:
  3979. // "APPLICATION_CACHE"
  3980. // "AUDIO"
  3981. // "CANVAS"
  3982. // "CANVAS_TEXT"
  3983. // "CSS_ANIMATIONS"
  3984. // "CSS_BACKGROUND_SIZE"
  3985. // "CSS_BORDER_IMAGE"
  3986. // "CSS_BORDER_RADIUS"
  3987. // "CSS_BOX_SHADOW"
  3988. // "CSS_COLUMNS"
  3989. // "CSS_FLEX_BOX"
  3990. // "CSS_FONT_FACE"
  3991. // "CSS_GENERATED_CONTENT"
  3992. // "CSS_GRADIENTS"
  3993. // "CSS_HSLA"
  3994. // "CSS_MULTIPLE_BGS"
  3995. // "CSS_OPACITY"
  3996. // "CSS_REFLECTIONS"
  3997. // "CSS_RGBA"
  3998. // "CSS_TEXT_SHADOW"
  3999. // "CSS_TRANSFORMS"
  4000. // "CSS_TRANSFORMS3D"
  4001. // "CSS_TRANSITIONS"
  4002. // "DRAG_AND_DROP"
  4003. // "GEO_LOCATION"
  4004. // "HASH_CHANGE"
  4005. // "HISTORY"
  4006. // "INDEXED_DB"
  4007. // "INLINE_SVG"
  4008. // "INPUT_ATTR_AUTOCOMPLETE"
  4009. // "INPUT_ATTR_AUTOFOCUS"
  4010. // "INPUT_ATTR_LIST"
  4011. // "INPUT_ATTR_MAX"
  4012. // "INPUT_ATTR_MIN"
  4013. // "INPUT_ATTR_MULTIPLE"
  4014. // "INPUT_ATTR_PATTERN"
  4015. // "INPUT_ATTR_PLACEHOLDER"
  4016. // "INPUT_ATTR_REQUIRED"
  4017. // "INPUT_ATTR_STEP"
  4018. // "INPUT_TYPE_COLOR"
  4019. // "INPUT_TYPE_DATE"
  4020. // "INPUT_TYPE_DATETIME"
  4021. // "INPUT_TYPE_DATETIME_LOCAL"
  4022. // "INPUT_TYPE_EMAIL"
  4023. // "INPUT_TYPE_MONTH"
  4024. // "INPUT_TYPE_NUMBER"
  4025. // "INPUT_TYPE_RANGE"
  4026. // "INPUT_TYPE_SEARCH"
  4027. // "INPUT_TYPE_TEL"
  4028. // "INPUT_TYPE_TIME"
  4029. // "INPUT_TYPE_URL"
  4030. // "INPUT_TYPE_WEEK"
  4031. // "LOCAL_STORAGE"
  4032. // "POST_MESSAGE"
  4033. // "SESSION_STORAGE"
  4034. // "SMIL"
  4035. // "SVG_CLIP_PATHS"
  4036. // "SVG_FE_IMAGE"
  4037. // "SVG_FILTERS"
  4038. // "SVG_HREF"
  4039. // "TOUCH"
  4040. // "VIDEO"
  4041. // "WEBGL"
  4042. // "WEB_SOCKETS"
  4043. // "WEB_SQL_DATABASE"
  4044. // "WEB_WORKERS"
  4045. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  4046. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  4047. // field.
  4048. Id int64 `json:"id,omitempty,string"`
  4049. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  4050. // This is a read-only, auto-generated field.
  4051. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  4052. // Kind: Identifies what kind of resource this is. Value: the fixed
  4053. // string "dfareporting#creativeAssetMetadata".
  4054. Kind string `json:"kind,omitempty"`
  4055. // WarnedValidationRules: Rules validated during code generation that
  4056. // generated a warning. This is a read-only, auto-generated
  4057. // field.
  4058. //
  4059. // Possible values are:
  4060. // - "ADMOB_REFERENCED"
  4061. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  4062. // - "ASSET_INVALID"
  4063. // - "CLICK_TAG_HARD_CODED"
  4064. // - "CLICK_TAG_INVALID"
  4065. // - "CLICK_TAG_IN_GWD"
  4066. // - "CLICK_TAG_MISSING"
  4067. // - "CLICK_TAG_MORE_THAN_ONE"
  4068. // - "CLICK_TAG_NON_TOP_LEVEL"
  4069. // - "COMPONENT_UNSUPPORTED_DCM"
  4070. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  4071. // - "EXTERNAL_FILE_REFERENCED"
  4072. // - "FILE_DETAIL_EMPTY"
  4073. // - "FILE_TYPE_INVALID"
  4074. // - "GWD_PROPERTIES_INVALID"
  4075. // - "HTML5_FEATURE_UNSUPPORTED"
  4076. // - "LINKED_FILE_NOT_FOUND"
  4077. // - "MAX_FLASH_VERSION_11"
  4078. // - "MRAID_REFERENCED"
  4079. // - "NOT_SSL_COMPLIANT"
  4080. // - "ORPHANED_ASSET"
  4081. // - "PRIMARY_HTML_MISSING"
  4082. // - "SVG_INVALID"
  4083. // - "ZIP_INVALID"
  4084. //
  4085. // Possible values:
  4086. // "ADMOB_REFERENCED"
  4087. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  4088. // "ASSET_INVALID"
  4089. // "CLICK_TAG_HARD_CODED"
  4090. // "CLICK_TAG_INVALID"
  4091. // "CLICK_TAG_IN_GWD"
  4092. // "CLICK_TAG_MISSING"
  4093. // "CLICK_TAG_MORE_THAN_ONE"
  4094. // "CLICK_TAG_NON_TOP_LEVEL"
  4095. // "COMPONENT_UNSUPPORTED_DCM"
  4096. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  4097. // "EXTERNAL_FILE_REFERENCED"
  4098. // "FILE_DETAIL_EMPTY"
  4099. // "FILE_TYPE_INVALID"
  4100. // "GWD_PROPERTIES_INVALID"
  4101. // "HTML5_FEATURE_UNSUPPORTED"
  4102. // "LINKED_FILE_NOT_FOUND"
  4103. // "MAX_FLASH_VERSION_11"
  4104. // "MRAID_REFERENCED"
  4105. // "NOT_SSL_COMPLIANT"
  4106. // "ORPHANED_ASSET"
  4107. // "PRIMARY_HTML_MISSING"
  4108. // "SVG_INVALID"
  4109. // "ZIP_INVALID"
  4110. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  4111. // ServerResponse contains the HTTP response code and headers from the
  4112. // server.
  4113. googleapi.ServerResponse `json:"-"`
  4114. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  4115. // unconditionally include in API requests. By default, fields with
  4116. // empty values are omitted from API requests. However, any non-pointer,
  4117. // non-interface field appearing in ForceSendFields will be sent to the
  4118. // server regardless of whether the field is empty or not. This may be
  4119. // used to include empty fields in Patch requests.
  4120. ForceSendFields []string `json:"-"`
  4121. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  4122. // include in API requests with the JSON null value. By default, fields
  4123. // with empty values are omitted from API requests. However, any field
  4124. // with an empty value appearing in NullFields will be sent to the
  4125. // server as null. It is an error if a field in this list has a
  4126. // non-empty value. This may be used to include null fields in Patch
  4127. // requests.
  4128. NullFields []string `json:"-"`
  4129. }
  4130. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  4131. type NoMethod CreativeAssetMetadata
  4132. raw := NoMethod(*s)
  4133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4134. }
  4135. // CreativeAssetSelection: Encapsulates the list of rules for asset
  4136. // selection and a default asset in case none of the rules match.
  4137. // Applicable to INSTREAM_VIDEO creatives.
  4138. type CreativeAssetSelection struct {
  4139. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  4140. // the parent assets in this creative, and will be served if none of the
  4141. // rules match. This is a required field.
  4142. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  4143. // Rules: Rules determine which asset will be served to a viewer. Rules
  4144. // will be evaluated in the order in which they are stored in this list.
  4145. // This list must contain at least one rule. Applicable to
  4146. // INSTREAM_VIDEO creatives.
  4147. Rules []*Rule `json:"rules,omitempty"`
  4148. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  4149. // unconditionally include in API requests. By default, fields with
  4150. // empty values are omitted from API requests. However, any non-pointer,
  4151. // non-interface field appearing in ForceSendFields will be sent to the
  4152. // server regardless of whether the field is empty or not. This may be
  4153. // used to include empty fields in Patch requests.
  4154. ForceSendFields []string `json:"-"`
  4155. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  4156. // include in API requests with the JSON null value. By default, fields
  4157. // with empty values are omitted from API requests. However, any field
  4158. // with an empty value appearing in NullFields will be sent to the
  4159. // server as null. It is an error if a field in this list has a
  4160. // non-empty value. This may be used to include null fields in Patch
  4161. // requests.
  4162. NullFields []string `json:"-"`
  4163. }
  4164. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  4165. type NoMethod CreativeAssetSelection
  4166. raw := NoMethod(*s)
  4167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4168. }
  4169. // CreativeAssignment: Creative Assignment.
  4170. type CreativeAssignment struct {
  4171. // Active: Whether this creative assignment is active. When true, the
  4172. // creative will be included in the ad's rotation.
  4173. Active bool `json:"active,omitempty"`
  4174. // ApplyEventTags: Whether applicable event tags should fire when this
  4175. // creative assignment is rendered. If this value is unset when the ad
  4176. // is inserted or updated, it will default to true for all creative
  4177. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  4178. // and INSTREAM_VIDEO.
  4179. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  4180. // ClickThroughUrl: Click-through URL of the creative assignment.
  4181. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  4182. // CompanionCreativeOverrides: Companion creative overrides for this
  4183. // creative assignment. Applicable to video ads.
  4184. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  4185. // CreativeGroupAssignments: Creative group assignments for this
  4186. // creative assignment. Only one assignment per creative group number is
  4187. // allowed for a maximum of two assignments.
  4188. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  4189. // CreativeId: ID of the creative to be assigned. This is a required
  4190. // field.
  4191. CreativeId int64 `json:"creativeId,omitempty,string"`
  4192. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  4193. // This is a read-only, auto-generated field.
  4194. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  4195. // EndTime: Date and time that the assigned creative should stop
  4196. // serving. Must be later than the start time.
  4197. EndTime string `json:"endTime,omitempty"`
  4198. // RichMediaExitOverrides: Rich media exit overrides for this creative
  4199. // assignment.
  4200. // Applicable when the creative type is any of the following:
  4201. // - DISPLAY
  4202. // - RICH_MEDIA_INPAGE
  4203. // - RICH_MEDIA_INPAGE_FLOATING
  4204. // - RICH_MEDIA_IM_EXPAND
  4205. // - RICH_MEDIA_EXPANDING
  4206. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  4207. // - RICH_MEDIA_MOBILE_IN_APP
  4208. // - RICH_MEDIA_MULTI_FLOATING
  4209. // - RICH_MEDIA_PEEL_DOWN
  4210. // - VPAID_LINEAR
  4211. // - VPAID_NON_LINEAR
  4212. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  4213. // Sequence: Sequence number of the creative assignment, applicable when
  4214. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  4215. // values are 1 to 65535, inclusive.
  4216. Sequence int64 `json:"sequence,omitempty"`
  4217. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  4218. // This is a read-only field that is auto-generated when the ad is
  4219. // inserted or updated.
  4220. SslCompliant bool `json:"sslCompliant,omitempty"`
  4221. // StartTime: Date and time that the assigned creative should start
  4222. // serving.
  4223. StartTime string `json:"startTime,omitempty"`
  4224. // Weight: Weight of the creative assignment, applicable when the
  4225. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  4226. // than or equal to 1.
  4227. Weight int64 `json:"weight,omitempty"`
  4228. // ForceSendFields is a list of field names (e.g. "Active") to
  4229. // unconditionally include in API requests. By default, fields with
  4230. // empty values are omitted from API requests. However, any non-pointer,
  4231. // non-interface field appearing in ForceSendFields will be sent to the
  4232. // server regardless of whether the field is empty or not. This may be
  4233. // used to include empty fields in Patch requests.
  4234. ForceSendFields []string `json:"-"`
  4235. // NullFields is a list of field names (e.g. "Active") to include in API
  4236. // requests with the JSON null value. By default, fields with empty
  4237. // values are omitted from API requests. However, any field with an
  4238. // empty value appearing in NullFields will be sent to the server as
  4239. // null. It is an error if a field in this list has a non-empty value.
  4240. // This may be used to include null fields in Patch requests.
  4241. NullFields []string `json:"-"`
  4242. }
  4243. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  4244. type NoMethod CreativeAssignment
  4245. raw := NoMethod(*s)
  4246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4247. }
  4248. // CreativeClickThroughUrl: Click-through URL
  4249. type CreativeClickThroughUrl struct {
  4250. // ComputedClickThroughUrl: Read-only convenience field representing the
  4251. // actual URL that will be used for this click-through. The URL is
  4252. // computed as follows:
  4253. // - If landingPageId is specified then that landing page's URL is
  4254. // assigned to this field.
  4255. // - Otherwise, the customClickThroughUrl is assigned to this field.
  4256. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  4257. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  4258. // landingPageId field is left unset.
  4259. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  4260. // LandingPageId: ID of the landing page for the click-through URL.
  4261. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  4262. // ForceSendFields is a list of field names (e.g.
  4263. // "ComputedClickThroughUrl") to unconditionally include in API
  4264. // requests. By default, fields with empty values are omitted from API
  4265. // requests. However, any non-pointer, non-interface field appearing in
  4266. // ForceSendFields will be sent to the server regardless of whether the
  4267. // field is empty or not. This may be used to include empty fields in
  4268. // Patch requests.
  4269. ForceSendFields []string `json:"-"`
  4270. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  4271. // to include in API requests with the JSON null value. By default,
  4272. // fields with empty values are omitted from API requests. However, any
  4273. // field with an empty value appearing in NullFields will be sent to the
  4274. // server as null. It is an error if a field in this list has a
  4275. // non-empty value. This may be used to include null fields in Patch
  4276. // requests.
  4277. NullFields []string `json:"-"`
  4278. }
  4279. func (s *CreativeClickThroughUrl) MarshalJSON() ([]byte, error) {
  4280. type NoMethod CreativeClickThroughUrl
  4281. raw := NoMethod(*s)
  4282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4283. }
  4284. // CreativeCustomEvent: Creative Custom Event.
  4285. type CreativeCustomEvent struct {
  4286. // AdvertiserCustomEventId: Unique ID of this event used by Reporting
  4287. // and Data Transfer. This is a read-only field.
  4288. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  4289. // AdvertiserCustomEventName: User-entered name for the event.
  4290. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  4291. // AdvertiserCustomEventType: Type of the event. This is a read-only
  4292. // field.
  4293. //
  4294. // Possible values:
  4295. // "ADVERTISER_EVENT_COUNTER"
  4296. // "ADVERTISER_EVENT_EXIT"
  4297. // "ADVERTISER_EVENT_TIMER"
  4298. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  4299. // ArtworkLabel: Artwork label column, used to link events in Campaign
  4300. // Manager back to events in Studio. This is a required field and should
  4301. // not be modified after insertion.
  4302. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4303. // ArtworkType: Artwork type used by the creative.This is a read-only
  4304. // field.
  4305. //
  4306. // Possible values:
  4307. // "ARTWORK_TYPE_FLASH"
  4308. // "ARTWORK_TYPE_HTML5"
  4309. // "ARTWORK_TYPE_IMAGE"
  4310. // "ARTWORK_TYPE_MIXED"
  4311. ArtworkType string `json:"artworkType,omitempty"`
  4312. // ExitClickThroughUrl: Exit click-through URL for the event. This field
  4313. // is used only for exit events.
  4314. ExitClickThroughUrl *CreativeClickThroughUrl `json:"exitClickThroughUrl,omitempty"`
  4315. // Id: ID of this event. This is a required field and should not be
  4316. // modified after insertion.
  4317. Id int64 `json:"id,omitempty,string"`
  4318. // PopupWindowProperties: Properties for rich media popup windows. This
  4319. // field is used only for exit events.
  4320. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4321. // TargetType: Target type used by the event.
  4322. //
  4323. // Possible values:
  4324. // "TARGET_BLANK"
  4325. // "TARGET_PARENT"
  4326. // "TARGET_POPUP"
  4327. // "TARGET_SELF"
  4328. // "TARGET_TOP"
  4329. TargetType string `json:"targetType,omitempty"`
  4330. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4331. // videos in a single creative. This is a read-only field.
  4332. VideoReportingId string `json:"videoReportingId,omitempty"`
  4333. // ForceSendFields is a list of field names (e.g.
  4334. // "AdvertiserCustomEventId") to unconditionally include in API
  4335. // requests. By default, fields with empty values are omitted from API
  4336. // requests. However, any non-pointer, non-interface field appearing in
  4337. // ForceSendFields will be sent to the server regardless of whether the
  4338. // field is empty or not. This may be used to include empty fields in
  4339. // Patch requests.
  4340. ForceSendFields []string `json:"-"`
  4341. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4342. // to include in API requests with the JSON null value. By default,
  4343. // fields with empty values are omitted from API requests. However, any
  4344. // field with an empty value appearing in NullFields will be sent to the
  4345. // server as null. It is an error if a field in this list has a
  4346. // non-empty value. This may be used to include null fields in Patch
  4347. // requests.
  4348. NullFields []string `json:"-"`
  4349. }
  4350. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4351. type NoMethod CreativeCustomEvent
  4352. raw := NoMethod(*s)
  4353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4354. }
  4355. // CreativeField: Contains properties of a creative field.
  4356. type CreativeField struct {
  4357. // AccountId: Account ID of this creative field. This is a read-only
  4358. // field that can be left blank.
  4359. AccountId int64 `json:"accountId,omitempty,string"`
  4360. // AdvertiserId: Advertiser ID of this creative field. This is a
  4361. // required field on insertion.
  4362. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4363. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4364. // advertiser. This is a read-only, auto-generated field.
  4365. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4366. // Id: ID of this creative field. This is a read-only, auto-generated
  4367. // field.
  4368. Id int64 `json:"id,omitempty,string"`
  4369. // Kind: Identifies what kind of resource this is. Value: the fixed
  4370. // string "dfareporting#creativeField".
  4371. Kind string `json:"kind,omitempty"`
  4372. // Name: Name of this creative field. This is a required field and must
  4373. // be less than 256 characters long and unique among creative fields of
  4374. // the same advertiser.
  4375. Name string `json:"name,omitempty"`
  4376. // SubaccountId: Subaccount ID of this creative field. This is a
  4377. // read-only field that can be left blank.
  4378. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4379. // ServerResponse contains the HTTP response code and headers from the
  4380. // server.
  4381. googleapi.ServerResponse `json:"-"`
  4382. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4383. // unconditionally include in API requests. By default, fields with
  4384. // empty values are omitted from API requests. However, any non-pointer,
  4385. // non-interface field appearing in ForceSendFields will be sent to the
  4386. // server regardless of whether the field is empty or not. This may be
  4387. // used to include empty fields in Patch requests.
  4388. ForceSendFields []string `json:"-"`
  4389. // NullFields is a list of field names (e.g. "AccountId") to include in
  4390. // API requests with the JSON null value. By default, fields with empty
  4391. // values are omitted from API requests. However, any field with an
  4392. // empty value appearing in NullFields will be sent to the server as
  4393. // null. It is an error if a field in this list has a non-empty value.
  4394. // This may be used to include null fields in Patch requests.
  4395. NullFields []string `json:"-"`
  4396. }
  4397. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4398. type NoMethod CreativeField
  4399. raw := NoMethod(*s)
  4400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4401. }
  4402. // CreativeFieldAssignment: Creative Field Assignment.
  4403. type CreativeFieldAssignment struct {
  4404. // CreativeFieldId: ID of the creative field.
  4405. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4406. // CreativeFieldValueId: ID of the creative field value.
  4407. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4408. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4409. // unconditionally include in API requests. By default, fields with
  4410. // empty values are omitted from API requests. However, any non-pointer,
  4411. // non-interface field appearing in ForceSendFields will be sent to the
  4412. // server regardless of whether the field is empty or not. This may be
  4413. // used to include empty fields in Patch requests.
  4414. ForceSendFields []string `json:"-"`
  4415. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4416. // include in API requests with the JSON null value. By default, fields
  4417. // with empty values are omitted from API requests. However, any field
  4418. // with an empty value appearing in NullFields will be sent to the
  4419. // server as null. It is an error if a field in this list has a
  4420. // non-empty value. This may be used to include null fields in Patch
  4421. // requests.
  4422. NullFields []string `json:"-"`
  4423. }
  4424. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4425. type NoMethod CreativeFieldAssignment
  4426. raw := NoMethod(*s)
  4427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4428. }
  4429. // CreativeFieldValue: Contains properties of a creative field value.
  4430. type CreativeFieldValue struct {
  4431. // Id: ID of this creative field value. This is a read-only,
  4432. // auto-generated field.
  4433. Id int64 `json:"id,omitempty,string"`
  4434. // Kind: Identifies what kind of resource this is. Value: the fixed
  4435. // string "dfareporting#creativeFieldValue".
  4436. Kind string `json:"kind,omitempty"`
  4437. // Value: Value of this creative field value. It needs to be less than
  4438. // 256 characters in length and unique per creative field.
  4439. Value string `json:"value,omitempty"`
  4440. // ServerResponse contains the HTTP response code and headers from the
  4441. // server.
  4442. googleapi.ServerResponse `json:"-"`
  4443. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") to include in API
  4451. // requests with the JSON null value. By default, fields with empty
  4452. // values are omitted from API requests. However, any field with an
  4453. // 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 *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4459. type NoMethod CreativeFieldValue
  4460. raw := NoMethod(*s)
  4461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4462. }
  4463. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4464. type CreativeFieldValuesListResponse struct {
  4465. // CreativeFieldValues: Creative field value collection.
  4466. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4467. // Kind: Identifies what kind of resource this is. Value: the fixed
  4468. // string "dfareporting#creativeFieldValuesListResponse".
  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. "CreativeFieldValues")
  4477. // to 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. "CreativeFieldValues") to
  4484. // include in API requests with the JSON null value. By default, fields
  4485. // with empty values are omitted from API requests. However, any field
  4486. // with an empty value appearing in NullFields will be sent to the
  4487. // server as null. It is an error if a field in this list has a
  4488. // non-empty value. This may be used to include null fields in Patch
  4489. // requests.
  4490. NullFields []string `json:"-"`
  4491. }
  4492. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4493. type NoMethod CreativeFieldValuesListResponse
  4494. raw := NoMethod(*s)
  4495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4496. }
  4497. // CreativeFieldsListResponse: Creative Field List Response
  4498. type CreativeFieldsListResponse struct {
  4499. // CreativeFields: Creative field collection.
  4500. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4501. // Kind: Identifies what kind of resource this is. Value: the fixed
  4502. // string "dfareporting#creativeFieldsListResponse".
  4503. Kind string `json:"kind,omitempty"`
  4504. // NextPageToken: Pagination token to be used for the next list
  4505. // operation.
  4506. NextPageToken string `json:"nextPageToken,omitempty"`
  4507. // ServerResponse contains the HTTP response code and headers from the
  4508. // server.
  4509. googleapi.ServerResponse `json:"-"`
  4510. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4511. // unconditionally include in API requests. By default, fields with
  4512. // empty values are omitted from API requests. However, any non-pointer,
  4513. // non-interface field appearing in ForceSendFields will be sent to the
  4514. // server regardless of whether the field is empty or not. This may be
  4515. // used to include empty fields in Patch requests.
  4516. ForceSendFields []string `json:"-"`
  4517. // NullFields is a list of field names (e.g. "CreativeFields") to
  4518. // include in API requests with the JSON null value. By default, fields
  4519. // with empty values are omitted from API requests. However, any field
  4520. // with an empty value appearing in NullFields will be sent to the
  4521. // server as null. It is an error if a field in this list has a
  4522. // non-empty value. This may be used to include null fields in Patch
  4523. // requests.
  4524. NullFields []string `json:"-"`
  4525. }
  4526. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4527. type NoMethod CreativeFieldsListResponse
  4528. raw := NoMethod(*s)
  4529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4530. }
  4531. // CreativeGroup: Contains properties of a creative group.
  4532. type CreativeGroup struct {
  4533. // AccountId: Account ID of this creative group. This is a read-only
  4534. // field that can be left blank.
  4535. AccountId int64 `json:"accountId,omitempty,string"`
  4536. // AdvertiserId: Advertiser ID of this creative group. This is a
  4537. // required field on insertion.
  4538. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4539. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4540. // advertiser. This is a read-only, auto-generated field.
  4541. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4542. // GroupNumber: Subgroup of the creative group. Assign your creative
  4543. // groups to a subgroup in order to filter or manage them more easily.
  4544. // This field is required on insertion and is read-only after insertion.
  4545. // Acceptable values are 1 to 2, inclusive.
  4546. GroupNumber int64 `json:"groupNumber,omitempty"`
  4547. // Id: ID of this creative group. This is a read-only, auto-generated
  4548. // field.
  4549. Id int64 `json:"id,omitempty,string"`
  4550. // Kind: Identifies what kind of resource this is. Value: the fixed
  4551. // string "dfareporting#creativeGroup".
  4552. Kind string `json:"kind,omitempty"`
  4553. // Name: Name of this creative group. This is a required field and must
  4554. // be less than 256 characters long and unique among creative groups of
  4555. // the same advertiser.
  4556. Name string `json:"name,omitempty"`
  4557. // SubaccountId: Subaccount ID of this creative group. This is a
  4558. // read-only field that can be left blank.
  4559. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4560. // ServerResponse contains the HTTP response code and headers from the
  4561. // server.
  4562. googleapi.ServerResponse `json:"-"`
  4563. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4564. // unconditionally include in API requests. By default, fields with
  4565. // empty values are omitted from API requests. However, any non-pointer,
  4566. // non-interface field appearing in ForceSendFields will be sent to the
  4567. // server regardless of whether the field is empty or not. This may be
  4568. // used to include empty fields in Patch requests.
  4569. ForceSendFields []string `json:"-"`
  4570. // NullFields is a list of field names (e.g. "AccountId") to include in
  4571. // API requests with the JSON null value. By default, fields with empty
  4572. // values are omitted from API requests. However, any field with an
  4573. // empty value appearing in NullFields will be sent to the server as
  4574. // null. It is an error if a field in this list has a non-empty value.
  4575. // This may be used to include null fields in Patch requests.
  4576. NullFields []string `json:"-"`
  4577. }
  4578. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4579. type NoMethod CreativeGroup
  4580. raw := NoMethod(*s)
  4581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4582. }
  4583. // CreativeGroupAssignment: Creative Group Assignment.
  4584. type CreativeGroupAssignment struct {
  4585. // CreativeGroupId: ID of the creative group to be assigned.
  4586. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4587. // CreativeGroupNumber: Creative group number of the creative group
  4588. // assignment.
  4589. //
  4590. // Possible values:
  4591. // "CREATIVE_GROUP_ONE"
  4592. // "CREATIVE_GROUP_TWO"
  4593. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4594. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4595. // unconditionally include in API requests. By default, fields with
  4596. // empty values are omitted from API requests. However, any non-pointer,
  4597. // non-interface field appearing in ForceSendFields will be sent to the
  4598. // server regardless of whether the field is empty or not. This may be
  4599. // used to include empty fields in Patch requests.
  4600. ForceSendFields []string `json:"-"`
  4601. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4602. // include in API requests with the JSON null value. By default, fields
  4603. // with empty values are omitted from API requests. However, any field
  4604. // with an empty value appearing in NullFields will be sent to the
  4605. // server as null. It is an error if a field in this list has a
  4606. // non-empty value. This may be used to include null fields in Patch
  4607. // requests.
  4608. NullFields []string `json:"-"`
  4609. }
  4610. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4611. type NoMethod CreativeGroupAssignment
  4612. raw := NoMethod(*s)
  4613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4614. }
  4615. // CreativeGroupsListResponse: Creative Group List Response
  4616. type CreativeGroupsListResponse struct {
  4617. // CreativeGroups: Creative group collection.
  4618. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4619. // Kind: Identifies what kind of resource this is. Value: the fixed
  4620. // string "dfareporting#creativeGroupsListResponse".
  4621. Kind string `json:"kind,omitempty"`
  4622. // NextPageToken: Pagination token to be used for the next list
  4623. // operation.
  4624. NextPageToken string `json:"nextPageToken,omitempty"`
  4625. // ServerResponse contains the HTTP response code and headers from the
  4626. // server.
  4627. googleapi.ServerResponse `json:"-"`
  4628. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4629. // unconditionally include in API requests. By default, fields with
  4630. // empty values are omitted from API requests. However, any non-pointer,
  4631. // non-interface field appearing in ForceSendFields will be sent to the
  4632. // server regardless of whether the field is empty or not. This may be
  4633. // used to include empty fields in Patch requests.
  4634. ForceSendFields []string `json:"-"`
  4635. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4636. // include in API requests with the JSON null value. By default, fields
  4637. // with empty values are omitted from API requests. However, any field
  4638. // with an empty value appearing in NullFields will be sent to the
  4639. // server as null. It is an error if a field in this list has a
  4640. // non-empty value. This may be used to include null fields in Patch
  4641. // requests.
  4642. NullFields []string `json:"-"`
  4643. }
  4644. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4645. type NoMethod CreativeGroupsListResponse
  4646. raw := NoMethod(*s)
  4647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4648. }
  4649. // CreativeOptimizationConfiguration: Creative optimization settings.
  4650. type CreativeOptimizationConfiguration struct {
  4651. // Id: ID of this creative optimization config. This field is
  4652. // auto-generated when the campaign is inserted or updated. It can be
  4653. // null for existing campaigns.
  4654. Id int64 `json:"id,omitempty,string"`
  4655. // Name: Name of this creative optimization config. This is a required
  4656. // field and must be less than 129 characters long.
  4657. Name string `json:"name,omitempty"`
  4658. // OptimizationActivitys: List of optimization activities associated
  4659. // with this configuration.
  4660. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4661. // OptimizationModel: Optimization model for this configuration.
  4662. //
  4663. // Possible values:
  4664. // "CLICK"
  4665. // "POST_CLICK"
  4666. // "POST_CLICK_AND_IMPRESSION"
  4667. // "POST_IMPRESSION"
  4668. // "VIDEO_COMPLETION"
  4669. OptimizationModel string `json:"optimizationModel,omitempty"`
  4670. // ForceSendFields is a list of field names (e.g. "Id") to
  4671. // unconditionally include in API requests. By default, fields with
  4672. // empty values are omitted from API requests. However, any non-pointer,
  4673. // non-interface field appearing in ForceSendFields will be sent to the
  4674. // server regardless of whether the field is empty or not. This may be
  4675. // used to include empty fields in Patch requests.
  4676. ForceSendFields []string `json:"-"`
  4677. // NullFields is a list of field names (e.g. "Id") to include in API
  4678. // requests with the JSON null value. By default, fields with empty
  4679. // values are omitted from API requests. However, any field with an
  4680. // empty value appearing in NullFields will be sent to the server as
  4681. // null. It is an error if a field in this list has a non-empty value.
  4682. // This may be used to include null fields in Patch requests.
  4683. NullFields []string `json:"-"`
  4684. }
  4685. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4686. type NoMethod CreativeOptimizationConfiguration
  4687. raw := NoMethod(*s)
  4688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4689. }
  4690. // CreativeRotation: Creative Rotation.
  4691. type CreativeRotation struct {
  4692. // CreativeAssignments: Creative assignments in this creative rotation.
  4693. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4694. // CreativeOptimizationConfigurationId: Creative optimization
  4695. // configuration that is used by this ad. It should refer to one of the
  4696. // existing optimization configurations in the ad's campaign. If it is
  4697. // unset or set to 0, then the campaign's default optimization
  4698. // configuration will be used for this ad.
  4699. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4700. // Type: Type of creative rotation. Can be used to specify whether to
  4701. // use sequential or random rotation.
  4702. //
  4703. // Possible values:
  4704. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4705. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4706. Type string `json:"type,omitempty"`
  4707. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4708. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4709. //
  4710. // Possible values:
  4711. // "WEIGHT_STRATEGY_CUSTOM"
  4712. // "WEIGHT_STRATEGY_EQUAL"
  4713. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4714. // "WEIGHT_STRATEGY_OPTIMIZED"
  4715. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4716. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4717. // to unconditionally include in API requests. By default, fields with
  4718. // empty values are omitted from API requests. However, any non-pointer,
  4719. // non-interface field appearing in ForceSendFields will be sent to the
  4720. // server regardless of whether the field is empty or not. This may be
  4721. // used to include empty fields in Patch requests.
  4722. ForceSendFields []string `json:"-"`
  4723. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4724. // include in API requests with the JSON null value. By default, fields
  4725. // with empty values are omitted from API requests. However, any field
  4726. // with an empty value appearing in NullFields will be sent to the
  4727. // server as null. It is an error if a field in this list has a
  4728. // non-empty value. This may be used to include null fields in Patch
  4729. // requests.
  4730. NullFields []string `json:"-"`
  4731. }
  4732. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4733. type NoMethod CreativeRotation
  4734. raw := NoMethod(*s)
  4735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4736. }
  4737. // CreativesListResponse: Creative List Response
  4738. type CreativesListResponse struct {
  4739. // Creatives: Creative collection.
  4740. Creatives []*Creative `json:"creatives,omitempty"`
  4741. // Kind: Identifies what kind of resource this is. Value: the fixed
  4742. // string "dfareporting#creativesListResponse".
  4743. Kind string `json:"kind,omitempty"`
  4744. // NextPageToken: Pagination token to be used for the next list
  4745. // operation.
  4746. NextPageToken string `json:"nextPageToken,omitempty"`
  4747. // ServerResponse contains the HTTP response code and headers from the
  4748. // server.
  4749. googleapi.ServerResponse `json:"-"`
  4750. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4751. // unconditionally include in API requests. By default, fields with
  4752. // empty values are omitted from API requests. However, any non-pointer,
  4753. // non-interface field appearing in ForceSendFields will be sent to the
  4754. // server regardless of whether the field is empty or not. This may be
  4755. // used to include empty fields in Patch requests.
  4756. ForceSendFields []string `json:"-"`
  4757. // NullFields is a list of field names (e.g. "Creatives") to include in
  4758. // API requests with the JSON null value. By default, fields with empty
  4759. // values are omitted from API requests. However, any field with an
  4760. // empty value appearing in NullFields will be sent to the server as
  4761. // null. It is an error if a field in this list has a non-empty value.
  4762. // This may be used to include null fields in Patch requests.
  4763. NullFields []string `json:"-"`
  4764. }
  4765. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4766. type NoMethod CreativesListResponse
  4767. raw := NoMethod(*s)
  4768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4769. }
  4770. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4771. // compatible to be selected for a report of type
  4772. // "CROSS_DIMENSION_REACH".
  4773. type CrossDimensionReachReportCompatibleFields struct {
  4774. // Breakdown: Dimensions which are compatible to be selected in the
  4775. // "breakdown" section of the report.
  4776. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4777. // DimensionFilters: Dimensions which are compatible to be selected in
  4778. // the "dimensionFilters" section of the report.
  4779. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4780. // Kind: The kind of resource this is, in this case
  4781. // dfareporting#crossDimensionReachReportCompatibleFields.
  4782. Kind string `json:"kind,omitempty"`
  4783. // Metrics: Metrics which are compatible to be selected in the
  4784. // "metricNames" section of the report.
  4785. Metrics []*Metric `json:"metrics,omitempty"`
  4786. // OverlapMetrics: Metrics which are compatible to be selected in the
  4787. // "overlapMetricNames" section of the report.
  4788. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4789. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4790. // unconditionally include in API requests. By default, fields with
  4791. // empty values are omitted from API requests. However, any non-pointer,
  4792. // non-interface field appearing in ForceSendFields will be sent to the
  4793. // server regardless of whether the field is empty or not. This may be
  4794. // used to include empty fields in Patch requests.
  4795. ForceSendFields []string `json:"-"`
  4796. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4797. // API requests with the JSON null value. By default, fields with empty
  4798. // values are omitted from API requests. However, any field with an
  4799. // empty value appearing in NullFields will be sent to the server as
  4800. // null. It is an error if a field in this list has a non-empty value.
  4801. // This may be used to include null fields in Patch requests.
  4802. NullFields []string `json:"-"`
  4803. }
  4804. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4805. type NoMethod CrossDimensionReachReportCompatibleFields
  4806. raw := NoMethod(*s)
  4807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4808. }
  4809. // CustomFloodlightVariable: A custom floodlight variable.
  4810. type CustomFloodlightVariable struct {
  4811. // Kind: Identifies what kind of resource this is. Value: the fixed
  4812. // string "dfareporting#customFloodlightVariable".
  4813. Kind string `json:"kind,omitempty"`
  4814. // Type: The type of custom floodlight variable to supply a value for.
  4815. // These map to the "u[1-20]=" in the tags.
  4816. //
  4817. // Possible values:
  4818. // "U1"
  4819. // "U10"
  4820. // "U100"
  4821. // "U11"
  4822. // "U12"
  4823. // "U13"
  4824. // "U14"
  4825. // "U15"
  4826. // "U16"
  4827. // "U17"
  4828. // "U18"
  4829. // "U19"
  4830. // "U2"
  4831. // "U20"
  4832. // "U21"
  4833. // "U22"
  4834. // "U23"
  4835. // "U24"
  4836. // "U25"
  4837. // "U26"
  4838. // "U27"
  4839. // "U28"
  4840. // "U29"
  4841. // "U3"
  4842. // "U30"
  4843. // "U31"
  4844. // "U32"
  4845. // "U33"
  4846. // "U34"
  4847. // "U35"
  4848. // "U36"
  4849. // "U37"
  4850. // "U38"
  4851. // "U39"
  4852. // "U4"
  4853. // "U40"
  4854. // "U41"
  4855. // "U42"
  4856. // "U43"
  4857. // "U44"
  4858. // "U45"
  4859. // "U46"
  4860. // "U47"
  4861. // "U48"
  4862. // "U49"
  4863. // "U5"
  4864. // "U50"
  4865. // "U51"
  4866. // "U52"
  4867. // "U53"
  4868. // "U54"
  4869. // "U55"
  4870. // "U56"
  4871. // "U57"
  4872. // "U58"
  4873. // "U59"
  4874. // "U6"
  4875. // "U60"
  4876. // "U61"
  4877. // "U62"
  4878. // "U63"
  4879. // "U64"
  4880. // "U65"
  4881. // "U66"
  4882. // "U67"
  4883. // "U68"
  4884. // "U69"
  4885. // "U7"
  4886. // "U70"
  4887. // "U71"
  4888. // "U72"
  4889. // "U73"
  4890. // "U74"
  4891. // "U75"
  4892. // "U76"
  4893. // "U77"
  4894. // "U78"
  4895. // "U79"
  4896. // "U8"
  4897. // "U80"
  4898. // "U81"
  4899. // "U82"
  4900. // "U83"
  4901. // "U84"
  4902. // "U85"
  4903. // "U86"
  4904. // "U87"
  4905. // "U88"
  4906. // "U89"
  4907. // "U9"
  4908. // "U90"
  4909. // "U91"
  4910. // "U92"
  4911. // "U93"
  4912. // "U94"
  4913. // "U95"
  4914. // "U96"
  4915. // "U97"
  4916. // "U98"
  4917. // "U99"
  4918. Type string `json:"type,omitempty"`
  4919. // Value: The value of the custom floodlight variable. The length of
  4920. // string must not exceed 50 characters.
  4921. Value string `json:"value,omitempty"`
  4922. // ForceSendFields is a list of field names (e.g. "Kind") to
  4923. // unconditionally include in API requests. By default, fields with
  4924. // empty values are omitted from API requests. However, any non-pointer,
  4925. // non-interface field appearing in ForceSendFields will be sent to the
  4926. // server regardless of whether the field is empty or not. This may be
  4927. // used to include empty fields in Patch requests.
  4928. ForceSendFields []string `json:"-"`
  4929. // NullFields is a list of field names (e.g. "Kind") to include in API
  4930. // requests with the JSON null value. By default, fields with empty
  4931. // values are omitted from API requests. However, any field with an
  4932. // empty value appearing in NullFields will be sent to the server as
  4933. // null. It is an error if a field in this list has a non-empty value.
  4934. // This may be used to include null fields in Patch requests.
  4935. NullFields []string `json:"-"`
  4936. }
  4937. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4938. type NoMethod CustomFloodlightVariable
  4939. raw := NoMethod(*s)
  4940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4941. }
  4942. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4943. type CustomRichMediaEvents struct {
  4944. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4945. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4946. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4947. // Kind: The kind of resource this is, in this case
  4948. // dfareporting#customRichMediaEvents.
  4949. Kind string `json:"kind,omitempty"`
  4950. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4951. // unconditionally include in API requests. By default, fields with
  4952. // empty values are omitted from API requests. However, any non-pointer,
  4953. // non-interface field appearing in ForceSendFields will be sent to the
  4954. // server regardless of whether the field is empty or not. This may be
  4955. // used to include empty fields in Patch requests.
  4956. ForceSendFields []string `json:"-"`
  4957. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4958. // include in API requests with the JSON null value. By default, fields
  4959. // with empty values are omitted from API requests. However, any field
  4960. // with an empty value appearing in NullFields will be sent to the
  4961. // server as null. It is an error if a field in this list has a
  4962. // non-empty value. This may be used to include null fields in Patch
  4963. // requests.
  4964. NullFields []string `json:"-"`
  4965. }
  4966. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4967. type NoMethod CustomRichMediaEvents
  4968. raw := NoMethod(*s)
  4969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4970. }
  4971. // CustomViewabilityMetric: Custom Viewability Metric
  4972. type CustomViewabilityMetric struct {
  4973. // Configuration: Configuration of the custom viewability metric.
  4974. Configuration *CustomViewabilityMetricConfiguration `json:"configuration,omitempty"`
  4975. // Id: ID of the custom viewability metric.
  4976. Id int64 `json:"id,omitempty,string"`
  4977. // Name: Name of the custom viewability metric.
  4978. Name string `json:"name,omitempty"`
  4979. // ForceSendFields is a list of field names (e.g. "Configuration") to
  4980. // unconditionally include in API requests. By default, fields with
  4981. // empty values are omitted from API requests. However, any non-pointer,
  4982. // non-interface field appearing in ForceSendFields will be sent to the
  4983. // server regardless of whether the field is empty or not. This may be
  4984. // used to include empty fields in Patch requests.
  4985. ForceSendFields []string `json:"-"`
  4986. // NullFields is a list of field names (e.g. "Configuration") to include
  4987. // in API requests with the JSON null value. By default, fields with
  4988. // empty values are omitted from API requests. However, any field with
  4989. // an empty value appearing in NullFields will be sent to the server as
  4990. // null. It is an error if a field in this list has a non-empty value.
  4991. // This may be used to include null fields in Patch requests.
  4992. NullFields []string `json:"-"`
  4993. }
  4994. func (s *CustomViewabilityMetric) MarshalJSON() ([]byte, error) {
  4995. type NoMethod CustomViewabilityMetric
  4996. raw := NoMethod(*s)
  4997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4998. }
  4999. // CustomViewabilityMetricConfiguration: The attributes, like playtime
  5000. // and percent onscreen, that define the Custom Viewability Metric.
  5001. type CustomViewabilityMetricConfiguration struct {
  5002. // Audible: Whether the video must be audible to count an impression.
  5003. Audible bool `json:"audible,omitempty"`
  5004. // TimeMillis: The time in milliseconds the video must play for the
  5005. // Custom Viewability Metric to count an impression. If both this and
  5006. // timePercent are specified, the earlier of the two will be used.
  5007. TimeMillis int64 `json:"timeMillis,omitempty"`
  5008. // TimePercent: The percentage of video that must play for the Custom
  5009. // Viewability Metric to count an impression. If both this and
  5010. // timeMillis are specified, the earlier of the two will be used.
  5011. TimePercent int64 `json:"timePercent,omitempty"`
  5012. // ViewabilityPercent: The percentage of video that must be on screen
  5013. // for the Custom Viewability Metric to count an impression.
  5014. ViewabilityPercent int64 `json:"viewabilityPercent,omitempty"`
  5015. // ForceSendFields is a list of field names (e.g. "Audible") to
  5016. // unconditionally include in API requests. By default, fields with
  5017. // empty values are omitted from API requests. However, any non-pointer,
  5018. // non-interface field appearing in ForceSendFields will be sent to the
  5019. // server regardless of whether the field is empty or not. This may be
  5020. // used to include empty fields in Patch requests.
  5021. ForceSendFields []string `json:"-"`
  5022. // NullFields is a list of field names (e.g. "Audible") to include in
  5023. // API requests with the JSON null value. By default, fields with empty
  5024. // values are omitted from API requests. However, any field with an
  5025. // empty value appearing in NullFields will be sent to the server as
  5026. // null. It is an error if a field in this list has a non-empty value.
  5027. // This may be used to include null fields in Patch requests.
  5028. NullFields []string `json:"-"`
  5029. }
  5030. func (s *CustomViewabilityMetricConfiguration) MarshalJSON() ([]byte, error) {
  5031. type NoMethod CustomViewabilityMetricConfiguration
  5032. raw := NoMethod(*s)
  5033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5034. }
  5035. // DateRange: Represents a date range.
  5036. type DateRange struct {
  5037. // EndDate: The end date of the date range, inclusive. A string of the
  5038. // format: "yyyy-MM-dd".
  5039. EndDate string `json:"endDate,omitempty"`
  5040. // Kind: The kind of resource this is, in this case
  5041. // dfareporting#dateRange.
  5042. Kind string `json:"kind,omitempty"`
  5043. // RelativeDateRange: The date range relative to the date of when the
  5044. // report is run.
  5045. //
  5046. // Possible values:
  5047. // "LAST_14_DAYS"
  5048. // "LAST_24_MONTHS"
  5049. // "LAST_30_DAYS"
  5050. // "LAST_365_DAYS"
  5051. // "LAST_60_DAYS"
  5052. // "LAST_7_DAYS"
  5053. // "LAST_90_DAYS"
  5054. // "MONTH_TO_DATE"
  5055. // "PREVIOUS_MONTH"
  5056. // "PREVIOUS_QUARTER"
  5057. // "PREVIOUS_WEEK"
  5058. // "PREVIOUS_YEAR"
  5059. // "QUARTER_TO_DATE"
  5060. // "TODAY"
  5061. // "WEEK_TO_DATE"
  5062. // "YEAR_TO_DATE"
  5063. // "YESTERDAY"
  5064. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  5065. // StartDate: The start date of the date range, inclusive. A string of
  5066. // the format: "yyyy-MM-dd".
  5067. StartDate string `json:"startDate,omitempty"`
  5068. // ForceSendFields is a list of field names (e.g. "EndDate") to
  5069. // unconditionally include in API requests. By default, fields with
  5070. // empty values are omitted from API requests. However, any non-pointer,
  5071. // non-interface field appearing in ForceSendFields will be sent to the
  5072. // server regardless of whether the field is empty or not. This may be
  5073. // used to include empty fields in Patch requests.
  5074. ForceSendFields []string `json:"-"`
  5075. // NullFields is a list of field names (e.g. "EndDate") to include in
  5076. // API requests with the JSON null value. By default, fields with empty
  5077. // values are omitted from API requests. However, any field with an
  5078. // empty value appearing in NullFields will be sent to the server as
  5079. // null. It is an error if a field in this list has a non-empty value.
  5080. // This may be used to include null fields in Patch requests.
  5081. NullFields []string `json:"-"`
  5082. }
  5083. func (s *DateRange) MarshalJSON() ([]byte, error) {
  5084. type NoMethod DateRange
  5085. raw := NoMethod(*s)
  5086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5087. }
  5088. // DayPartTargeting: Day Part Targeting.
  5089. type DayPartTargeting struct {
  5090. // DaysOfWeek: Days of the week when the ad will serve.
  5091. //
  5092. // Acceptable values are:
  5093. // - "SUNDAY"
  5094. // - "MONDAY"
  5095. // - "TUESDAY"
  5096. // - "WEDNESDAY"
  5097. // - "THURSDAY"
  5098. // - "FRIDAY"
  5099. // - "SATURDAY"
  5100. //
  5101. // Possible values:
  5102. // "FRIDAY"
  5103. // "MONDAY"
  5104. // "SATURDAY"
  5105. // "SUNDAY"
  5106. // "THURSDAY"
  5107. // "TUESDAY"
  5108. // "WEDNESDAY"
  5109. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  5110. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  5111. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  5112. // days of week, in which case the ad would serve during these hours on
  5113. // the specified days. For example if Monday, Wednesday, Friday are the
  5114. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  5115. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  5116. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  5117. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  5118. // UserLocalTime: Whether or not to use the user's local time. If false,
  5119. // the America/New York time zone applies.
  5120. UserLocalTime bool `json:"userLocalTime,omitempty"`
  5121. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  5122. // unconditionally include in API requests. By default, fields with
  5123. // empty values are omitted from API requests. However, any non-pointer,
  5124. // non-interface field appearing in ForceSendFields will be sent to the
  5125. // server regardless of whether the field is empty or not. This may be
  5126. // used to include empty fields in Patch requests.
  5127. ForceSendFields []string `json:"-"`
  5128. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  5129. // API requests with the JSON null value. By default, fields with empty
  5130. // values are omitted from API requests. However, any field with an
  5131. // empty value appearing in NullFields will be sent to the server as
  5132. // null. It is an error if a field in this list has a non-empty value.
  5133. // This may be used to include null fields in Patch requests.
  5134. NullFields []string `json:"-"`
  5135. }
  5136. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  5137. type NoMethod DayPartTargeting
  5138. raw := NoMethod(*s)
  5139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5140. }
  5141. // DeepLink: Contains information about a landing page deep link.
  5142. type DeepLink struct {
  5143. // AppUrl: The URL of the mobile app being linked to.
  5144. AppUrl string `json:"appUrl,omitempty"`
  5145. // FallbackUrl: The fallback URL. This URL will be served to users who
  5146. // do not have the mobile app installed.
  5147. FallbackUrl string `json:"fallbackUrl,omitempty"`
  5148. // Kind: Identifies what kind of resource this is. Value: the fixed
  5149. // string "dfareporting#deepLink".
  5150. Kind string `json:"kind,omitempty"`
  5151. // MobileApp: The mobile app targeted by this deep link.
  5152. MobileApp *MobileApp `json:"mobileApp,omitempty"`
  5153. // RemarketingListIds: Ads served to users on these remarketing lists
  5154. // will use this deep link. Applicable when mobileApp.directory is
  5155. // APPLE_APP_STORE.
  5156. RemarketingListIds googleapi.Int64s `json:"remarketingListIds,omitempty"`
  5157. // ForceSendFields is a list of field names (e.g. "AppUrl") to
  5158. // unconditionally include in API requests. By default, fields with
  5159. // empty values are omitted from API requests. However, any non-pointer,
  5160. // non-interface field appearing in ForceSendFields will be sent to the
  5161. // server regardless of whether the field is empty or not. This may be
  5162. // used to include empty fields in Patch requests.
  5163. ForceSendFields []string `json:"-"`
  5164. // NullFields is a list of field names (e.g. "AppUrl") to include in API
  5165. // requests with the JSON null value. By default, fields with empty
  5166. // values are omitted from API requests. However, any field with an
  5167. // empty value appearing in NullFields will be sent to the server as
  5168. // null. It is an error if a field in this list has a non-empty value.
  5169. // This may be used to include null fields in Patch requests.
  5170. NullFields []string `json:"-"`
  5171. }
  5172. func (s *DeepLink) MarshalJSON() ([]byte, error) {
  5173. type NoMethod DeepLink
  5174. raw := NoMethod(*s)
  5175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5176. }
  5177. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  5178. // overriding the default click-through event tag. A campaign may
  5179. // override the event tag defined at the advertiser level, and an ad may
  5180. // also override the campaign's setting further.
  5181. type DefaultClickThroughEventTagProperties struct {
  5182. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  5183. // apply to all ads in this entity's scope.
  5184. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  5185. // OverrideInheritedEventTag: Whether this entity should override the
  5186. // inherited default click-through event tag with its own defined value.
  5187. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  5188. // ForceSendFields is a list of field names (e.g.
  5189. // "DefaultClickThroughEventTagId") to unconditionally include in API
  5190. // requests. By default, fields with empty values are omitted from API
  5191. // requests. However, any non-pointer, non-interface field appearing in
  5192. // ForceSendFields will be sent to the server regardless of whether the
  5193. // field is empty or not. This may be used to include empty fields in
  5194. // Patch requests.
  5195. ForceSendFields []string `json:"-"`
  5196. // NullFields is a list of field names (e.g.
  5197. // "DefaultClickThroughEventTagId") to include in API requests with the
  5198. // JSON null value. By default, fields with empty values are omitted
  5199. // from API requests. However, any field with an empty value appearing
  5200. // in NullFields will be sent to the server as null. It is an error if a
  5201. // field in this list has a non-empty value. This may be used to include
  5202. // null fields in Patch requests.
  5203. NullFields []string `json:"-"`
  5204. }
  5205. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  5206. type NoMethod DefaultClickThroughEventTagProperties
  5207. raw := NoMethod(*s)
  5208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5209. }
  5210. // DeliverySchedule: Delivery Schedule.
  5211. type DeliverySchedule struct {
  5212. // FrequencyCap: Limit on the number of times an individual user can be
  5213. // served the ad within a specified period of time.
  5214. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  5215. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  5216. // will not serve after the end date and time. Otherwise the ad will
  5217. // continue to be served until it has reached its delivery goals.
  5218. HardCutoff bool `json:"hardCutoff,omitempty"`
  5219. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  5220. // how often each ad is served relative to the others. For example, if
  5221. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  5222. // 3, then Campaign Manager will serve ad B three times as often as ad
  5223. // A. Acceptable values are 1 to 10, inclusive.
  5224. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  5225. // Priority: Serving priority of an ad, with respect to other ads. The
  5226. // lower the priority number, the greater the priority with which it is
  5227. // served.
  5228. //
  5229. // Possible values:
  5230. // "AD_PRIORITY_01"
  5231. // "AD_PRIORITY_02"
  5232. // "AD_PRIORITY_03"
  5233. // "AD_PRIORITY_04"
  5234. // "AD_PRIORITY_05"
  5235. // "AD_PRIORITY_06"
  5236. // "AD_PRIORITY_07"
  5237. // "AD_PRIORITY_08"
  5238. // "AD_PRIORITY_09"
  5239. // "AD_PRIORITY_10"
  5240. // "AD_PRIORITY_11"
  5241. // "AD_PRIORITY_12"
  5242. // "AD_PRIORITY_13"
  5243. // "AD_PRIORITY_14"
  5244. // "AD_PRIORITY_15"
  5245. // "AD_PRIORITY_16"
  5246. Priority string `json:"priority,omitempty"`
  5247. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  5248. // unconditionally include in API requests. By default, fields with
  5249. // empty values are omitted from API requests. However, any non-pointer,
  5250. // non-interface field appearing in ForceSendFields will be sent to the
  5251. // server regardless of whether the field is empty or not. This may be
  5252. // used to include empty fields in Patch requests.
  5253. ForceSendFields []string `json:"-"`
  5254. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  5255. // in API requests with the JSON null value. By default, fields with
  5256. // empty values are omitted from API requests. However, any field with
  5257. // an empty value appearing in NullFields will be sent to the server as
  5258. // null. It is an error if a field in this list has a non-empty value.
  5259. // This may be used to include null fields in Patch requests.
  5260. NullFields []string `json:"-"`
  5261. }
  5262. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  5263. type NoMethod DeliverySchedule
  5264. raw := NoMethod(*s)
  5265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5266. }
  5267. // DfpSettings: Google Ad Manager Settings
  5268. type DfpSettings struct {
  5269. // DfpNetworkCode: Ad Manager network code for this directory site.
  5270. DfpNetworkCode string `json:"dfpNetworkCode,omitempty"`
  5271. // DfpNetworkName: Ad Manager network name for this directory site.
  5272. DfpNetworkName string `json:"dfpNetworkName,omitempty"`
  5273. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  5274. // programmatic placements.
  5275. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  5276. // PubPaidPlacementAccepted: Whether this directory site accepts
  5277. // publisher-paid tags.
  5278. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  5279. // PublisherPortalOnly: Whether this directory site is available only
  5280. // via Publisher Portal.
  5281. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  5282. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  5283. // unconditionally include in API requests. By default, fields with
  5284. // empty values are omitted from API requests. However, any non-pointer,
  5285. // non-interface field appearing in ForceSendFields will be sent to the
  5286. // server regardless of whether the field is empty or not. This may be
  5287. // used to include empty fields in Patch requests.
  5288. ForceSendFields []string `json:"-"`
  5289. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  5290. // include in API requests with the JSON null value. By default, fields
  5291. // with empty values are omitted from API requests. However, any field
  5292. // with an empty value appearing in NullFields will be sent to the
  5293. // server as null. It is an error if a field in this list has a
  5294. // non-empty value. This may be used to include null fields in Patch
  5295. // requests.
  5296. NullFields []string `json:"-"`
  5297. }
  5298. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  5299. type NoMethod DfpSettings
  5300. raw := NoMethod(*s)
  5301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5302. }
  5303. // Dimension: Represents a dimension.
  5304. type Dimension struct {
  5305. // Kind: The kind of resource this is, in this case
  5306. // dfareporting#dimension.
  5307. Kind string `json:"kind,omitempty"`
  5308. // Name: The dimension name, e.g. dfa:advertiser
  5309. Name string `json:"name,omitempty"`
  5310. // ForceSendFields is a list of field names (e.g. "Kind") to
  5311. // unconditionally include in API requests. By default, fields with
  5312. // empty values are omitted from API requests. However, any non-pointer,
  5313. // non-interface field appearing in ForceSendFields will be sent to the
  5314. // server regardless of whether the field is empty or not. This may be
  5315. // used to include empty fields in Patch requests.
  5316. ForceSendFields []string `json:"-"`
  5317. // NullFields is a list of field names (e.g. "Kind") to include in API
  5318. // requests with the JSON null value. By default, fields with empty
  5319. // values are omitted from API requests. However, any field with an
  5320. // empty value appearing in NullFields will be sent to the server as
  5321. // null. It is an error if a field in this list has a non-empty value.
  5322. // This may be used to include null fields in Patch requests.
  5323. NullFields []string `json:"-"`
  5324. }
  5325. func (s *Dimension) MarshalJSON() ([]byte, error) {
  5326. type NoMethod Dimension
  5327. raw := NoMethod(*s)
  5328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5329. }
  5330. // DimensionFilter: Represents a dimension filter.
  5331. type DimensionFilter struct {
  5332. // DimensionName: The name of the dimension to filter.
  5333. DimensionName string `json:"dimensionName,omitempty"`
  5334. // Kind: The kind of resource this is, in this case
  5335. // dfareporting#dimensionFilter.
  5336. Kind string `json:"kind,omitempty"`
  5337. // Value: The value of the dimension to filter.
  5338. Value string `json:"value,omitempty"`
  5339. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5340. // unconditionally include in API requests. By default, fields with
  5341. // empty values are omitted from API requests. However, any non-pointer,
  5342. // non-interface field appearing in ForceSendFields will be sent to the
  5343. // server regardless of whether the field is empty or not. This may be
  5344. // used to include empty fields in Patch requests.
  5345. ForceSendFields []string `json:"-"`
  5346. // NullFields is a list of field names (e.g. "DimensionName") to include
  5347. // in API requests with the JSON null value. By default, fields with
  5348. // empty values are omitted from API requests. However, any field with
  5349. // an empty value appearing in NullFields will be sent to the server as
  5350. // null. It is an error if a field in this list has a non-empty value.
  5351. // This may be used to include null fields in Patch requests.
  5352. NullFields []string `json:"-"`
  5353. }
  5354. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  5355. type NoMethod DimensionFilter
  5356. raw := NoMethod(*s)
  5357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5358. }
  5359. // DimensionValue: Represents a DimensionValue resource.
  5360. type DimensionValue struct {
  5361. // DimensionName: The name of the dimension.
  5362. DimensionName string `json:"dimensionName,omitempty"`
  5363. // Etag: The eTag of this response for caching purposes.
  5364. Etag string `json:"etag,omitempty"`
  5365. // Id: The ID associated with the value if available.
  5366. Id string `json:"id,omitempty"`
  5367. // Kind: The kind of resource this is, in this case
  5368. // dfareporting#dimensionValue.
  5369. Kind string `json:"kind,omitempty"`
  5370. // MatchType: Determines how the 'value' field is matched when
  5371. // filtering. If not specified, defaults to EXACT. If set to
  5372. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  5373. // length character sequences, and it can be escaped with a backslash.
  5374. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  5375. // matchType other than EXACT.
  5376. //
  5377. // Possible values:
  5378. // "BEGINS_WITH"
  5379. // "CONTAINS"
  5380. // "EXACT"
  5381. // "WILDCARD_EXPRESSION"
  5382. MatchType string `json:"matchType,omitempty"`
  5383. // Value: The value of the dimension.
  5384. Value string `json:"value,omitempty"`
  5385. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5386. // unconditionally include in API requests. By default, fields with
  5387. // empty values are omitted from API requests. However, any non-pointer,
  5388. // non-interface field appearing in ForceSendFields will be sent to the
  5389. // server regardless of whether the field is empty or not. This may be
  5390. // used to include empty fields in Patch requests.
  5391. ForceSendFields []string `json:"-"`
  5392. // NullFields is a list of field names (e.g. "DimensionName") to include
  5393. // in API requests with the JSON null value. By default, fields with
  5394. // empty values are omitted from API requests. However, any field with
  5395. // an empty value appearing in NullFields will be sent to the server as
  5396. // null. It is an error if a field in this list has a non-empty value.
  5397. // This may be used to include null fields in Patch requests.
  5398. NullFields []string `json:"-"`
  5399. }
  5400. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5401. type NoMethod DimensionValue
  5402. raw := NoMethod(*s)
  5403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5404. }
  5405. // DimensionValueList: Represents the list of DimensionValue resources.
  5406. type DimensionValueList struct {
  5407. // Etag: The eTag of this response for caching purposes.
  5408. Etag string `json:"etag,omitempty"`
  5409. // Items: The dimension values returned in this response.
  5410. Items []*DimensionValue `json:"items,omitempty"`
  5411. // Kind: The kind of list this is, in this case
  5412. // dfareporting#dimensionValueList.
  5413. Kind string `json:"kind,omitempty"`
  5414. // NextPageToken: Continuation token used to page through dimension
  5415. // values. To retrieve the next page of results, set the next request's
  5416. // "pageToken" to the value of this field. The page token is only valid
  5417. // for a limited amount of time and should not be persisted.
  5418. NextPageToken string `json:"nextPageToken,omitempty"`
  5419. // ServerResponse contains the HTTP response code and headers from the
  5420. // server.
  5421. googleapi.ServerResponse `json:"-"`
  5422. // ForceSendFields is a list of field names (e.g. "Etag") to
  5423. // unconditionally include in API requests. By default, fields with
  5424. // empty values are omitted from API requests. However, any non-pointer,
  5425. // non-interface field appearing in ForceSendFields will be sent to the
  5426. // server regardless of whether the field is empty or not. This may be
  5427. // used to include empty fields in Patch requests.
  5428. ForceSendFields []string `json:"-"`
  5429. // NullFields is a list of field names (e.g. "Etag") to include in API
  5430. // requests with the JSON null value. By default, fields with empty
  5431. // values are omitted from API requests. However, any field with an
  5432. // empty value appearing in NullFields will be sent to the server as
  5433. // null. It is an error if a field in this list has a non-empty value.
  5434. // This may be used to include null fields in Patch requests.
  5435. NullFields []string `json:"-"`
  5436. }
  5437. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5438. type NoMethod DimensionValueList
  5439. raw := NoMethod(*s)
  5440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5441. }
  5442. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5443. type DimensionValueRequest struct {
  5444. // DimensionName: The name of the dimension for which values should be
  5445. // requested.
  5446. DimensionName string `json:"dimensionName,omitempty"`
  5447. // EndDate: The end date of the date range for which to retrieve
  5448. // dimension values. A string of the format "yyyy-MM-dd".
  5449. EndDate string `json:"endDate,omitempty"`
  5450. // Filters: The list of filters by which to filter values. The filters
  5451. // are ANDed.
  5452. Filters []*DimensionFilter `json:"filters,omitempty"`
  5453. // Kind: The kind of request this is, in this case
  5454. // dfareporting#dimensionValueRequest.
  5455. Kind string `json:"kind,omitempty"`
  5456. // StartDate: The start date of the date range for which to retrieve
  5457. // dimension values. A string of the format "yyyy-MM-dd".
  5458. StartDate string `json:"startDate,omitempty"`
  5459. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5460. // unconditionally include in API requests. By default, fields with
  5461. // empty values are omitted from API requests. However, any non-pointer,
  5462. // non-interface field appearing in ForceSendFields will be sent to the
  5463. // server regardless of whether the field is empty or not. This may be
  5464. // used to include empty fields in Patch requests.
  5465. ForceSendFields []string `json:"-"`
  5466. // NullFields is a list of field names (e.g. "DimensionName") to include
  5467. // in API requests with the JSON null value. By default, fields with
  5468. // empty values are omitted from API requests. However, any field with
  5469. // an empty value appearing in NullFields will be sent to the server as
  5470. // null. It is an error if a field in this list has a non-empty value.
  5471. // This may be used to include null fields in Patch requests.
  5472. NullFields []string `json:"-"`
  5473. }
  5474. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5475. type NoMethod DimensionValueRequest
  5476. raw := NoMethod(*s)
  5477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5478. }
  5479. // DirectorySite: DirectorySites contains properties of a website from
  5480. // the Site Directory. Sites need to be added to an account via the
  5481. // Sites resource before they can be assigned to a placement.
  5482. type DirectorySite struct {
  5483. // Active: Whether this directory site is active.
  5484. Active bool `json:"active,omitempty"`
  5485. // Id: ID of this directory site. This is a read-only, auto-generated
  5486. // field.
  5487. Id int64 `json:"id,omitempty,string"`
  5488. // IdDimensionValue: Dimension value for the ID of this directory site.
  5489. // This is a read-only, auto-generated field.
  5490. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5491. // InpageTagFormats: Tag types for regular placements.
  5492. //
  5493. // Acceptable values are:
  5494. // - "STANDARD"
  5495. // - "IFRAME_JAVASCRIPT_INPAGE"
  5496. // - "INTERNAL_REDIRECT_INPAGE"
  5497. // - "JAVASCRIPT_INPAGE"
  5498. //
  5499. // Possible values:
  5500. // "IFRAME_JAVASCRIPT_INPAGE"
  5501. // "INTERNAL_REDIRECT_INPAGE"
  5502. // "JAVASCRIPT_INPAGE"
  5503. // "STANDARD"
  5504. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5505. // InterstitialTagFormats: Tag types for interstitial
  5506. // placements.
  5507. //
  5508. // Acceptable values are:
  5509. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5510. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5511. // - "JAVASCRIPT_INTERSTITIAL"
  5512. //
  5513. // Possible values:
  5514. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5515. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5516. // "JAVASCRIPT_INTERSTITIAL"
  5517. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5518. // Kind: Identifies what kind of resource this is. Value: the fixed
  5519. // string "dfareporting#directorySite".
  5520. Kind string `json:"kind,omitempty"`
  5521. // Name: Name of this directory site.
  5522. Name string `json:"name,omitempty"`
  5523. // Settings: Directory site settings.
  5524. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5525. // Url: URL of this directory site.
  5526. Url string `json:"url,omitempty"`
  5527. // ServerResponse contains the HTTP response code and headers from the
  5528. // server.
  5529. googleapi.ServerResponse `json:"-"`
  5530. // ForceSendFields is a list of field names (e.g. "Active") to
  5531. // unconditionally include in API requests. By default, fields with
  5532. // empty values are omitted from API requests. However, any non-pointer,
  5533. // non-interface field appearing in ForceSendFields will be sent to the
  5534. // server regardless of whether the field is empty or not. This may be
  5535. // used to include empty fields in Patch requests.
  5536. ForceSendFields []string `json:"-"`
  5537. // NullFields is a list of field names (e.g. "Active") to include in API
  5538. // requests with the JSON null value. By default, fields with empty
  5539. // values are omitted from API requests. However, any field with an
  5540. // empty value appearing in NullFields will be sent to the server as
  5541. // null. It is an error if a field in this list has a non-empty value.
  5542. // This may be used to include null fields in Patch requests.
  5543. NullFields []string `json:"-"`
  5544. }
  5545. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5546. type NoMethod DirectorySite
  5547. raw := NoMethod(*s)
  5548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5549. }
  5550. // DirectorySiteSettings: Directory Site Settings
  5551. type DirectorySiteSettings struct {
  5552. // ActiveViewOptOut: Whether this directory site has disabled active
  5553. // view creatives.
  5554. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5555. // DfpSettings: Directory site Ad Manager settings.
  5556. DfpSettings *DfpSettings `json:"dfpSettings,omitempty"`
  5557. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5558. // video ads.
  5559. InstreamVideoPlacementAccepted bool `json:"instreamVideoPlacementAccepted,omitempty"`
  5560. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5561. // ads.
  5562. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5563. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5564. // unconditionally include in API requests. By default, fields with
  5565. // empty values are omitted from API requests. However, any non-pointer,
  5566. // non-interface field appearing in ForceSendFields will be sent to the
  5567. // server regardless of whether the field is empty or not. This may be
  5568. // used to include empty fields in Patch requests.
  5569. ForceSendFields []string `json:"-"`
  5570. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5571. // include in API requests with the JSON null value. By default, fields
  5572. // with empty values are omitted from API requests. However, any field
  5573. // with an empty value appearing in NullFields will be sent to the
  5574. // server as null. It is an error if a field in this list has a
  5575. // non-empty value. This may be used to include null fields in Patch
  5576. // requests.
  5577. NullFields []string `json:"-"`
  5578. }
  5579. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5580. type NoMethod DirectorySiteSettings
  5581. raw := NoMethod(*s)
  5582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5583. }
  5584. // DirectorySitesListResponse: Directory Site List Response
  5585. type DirectorySitesListResponse struct {
  5586. // DirectorySites: Directory site collection.
  5587. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5588. // Kind: Identifies what kind of resource this is. Value: the fixed
  5589. // string "dfareporting#directorySitesListResponse".
  5590. Kind string `json:"kind,omitempty"`
  5591. // NextPageToken: Pagination token to be used for the next list
  5592. // operation.
  5593. NextPageToken string `json:"nextPageToken,omitempty"`
  5594. // ServerResponse contains the HTTP response code and headers from the
  5595. // server.
  5596. googleapi.ServerResponse `json:"-"`
  5597. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5598. // unconditionally include in API requests. By default, fields with
  5599. // empty values are omitted from API requests. However, any non-pointer,
  5600. // non-interface field appearing in ForceSendFields will be sent to the
  5601. // server regardless of whether the field is empty or not. This may be
  5602. // used to include empty fields in Patch requests.
  5603. ForceSendFields []string `json:"-"`
  5604. // NullFields is a list of field names (e.g. "DirectorySites") to
  5605. // include in API requests with the JSON null value. By default, fields
  5606. // with empty values are omitted from API requests. However, any field
  5607. // with an empty value appearing in NullFields will be sent to the
  5608. // server as null. It is an error if a field in this list has a
  5609. // non-empty value. This may be used to include null fields in Patch
  5610. // requests.
  5611. NullFields []string `json:"-"`
  5612. }
  5613. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5614. type NoMethod DirectorySitesListResponse
  5615. raw := NoMethod(*s)
  5616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5617. }
  5618. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5619. // Dynamic targeting keys are unique, user-friendly labels, created at
  5620. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5621. // and placements and used for targeting with Studio dynamic creatives.
  5622. // Use these labels instead of numeric Campaign Manager IDs (such as
  5623. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5624. type DynamicTargetingKey struct {
  5625. // Kind: Identifies what kind of resource this is. Value: the fixed
  5626. // string "dfareporting#dynamicTargetingKey".
  5627. Kind string `json:"kind,omitempty"`
  5628. // Name: Name of this dynamic targeting key. This is a required field.
  5629. // Must be less than 256 characters long and cannot contain commas. All
  5630. // characters are converted to lowercase.
  5631. Name string `json:"name,omitempty"`
  5632. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5633. // required field.
  5634. ObjectId int64 `json:"objectId,omitempty,string"`
  5635. // ObjectType: Type of the object of this dynamic targeting key. This is
  5636. // a required field.
  5637. //
  5638. // Possible values:
  5639. // "OBJECT_AD"
  5640. // "OBJECT_ADVERTISER"
  5641. // "OBJECT_CREATIVE"
  5642. // "OBJECT_PLACEMENT"
  5643. ObjectType string `json:"objectType,omitempty"`
  5644. // ServerResponse contains the HTTP response code and headers from the
  5645. // server.
  5646. googleapi.ServerResponse `json:"-"`
  5647. // ForceSendFields is a list of field names (e.g. "Kind") to
  5648. // unconditionally include in API requests. By default, fields with
  5649. // empty values are omitted from API requests. However, any non-pointer,
  5650. // non-interface field appearing in ForceSendFields will be sent to the
  5651. // server regardless of whether the field is empty or not. This may be
  5652. // used to include empty fields in Patch requests.
  5653. ForceSendFields []string `json:"-"`
  5654. // NullFields is a list of field names (e.g. "Kind") to include in API
  5655. // requests with the JSON null value. By default, fields with empty
  5656. // values are omitted from API requests. However, any field with an
  5657. // empty value appearing in NullFields will be sent to the server as
  5658. // null. It is an error if a field in this list has a non-empty value.
  5659. // This may be used to include null fields in Patch requests.
  5660. NullFields []string `json:"-"`
  5661. }
  5662. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5663. type NoMethod DynamicTargetingKey
  5664. raw := NoMethod(*s)
  5665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5666. }
  5667. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5668. type DynamicTargetingKeysListResponse struct {
  5669. // DynamicTargetingKeys: Dynamic targeting key collection.
  5670. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5671. // Kind: Identifies what kind of resource this is. Value: the fixed
  5672. // string "dfareporting#dynamicTargetingKeysListResponse".
  5673. Kind string `json:"kind,omitempty"`
  5674. // ServerResponse contains the HTTP response code and headers from the
  5675. // server.
  5676. googleapi.ServerResponse `json:"-"`
  5677. // ForceSendFields is a list of field names (e.g.
  5678. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5679. // By default, fields with empty values are omitted from API requests.
  5680. // However, any non-pointer, non-interface field appearing in
  5681. // ForceSendFields will be sent to the server regardless of whether the
  5682. // field is empty or not. This may be used to include empty fields in
  5683. // Patch requests.
  5684. ForceSendFields []string `json:"-"`
  5685. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5686. // include in API requests with the JSON null value. By default, fields
  5687. // with empty values are omitted from API requests. However, any field
  5688. // with an empty value appearing in NullFields will be sent to the
  5689. // server as null. It is an error if a field in this list has a
  5690. // non-empty value. This may be used to include null fields in Patch
  5691. // requests.
  5692. NullFields []string `json:"-"`
  5693. }
  5694. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5695. type NoMethod DynamicTargetingKeysListResponse
  5696. raw := NoMethod(*s)
  5697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5698. }
  5699. // EncryptionInfo: A description of how user IDs are encrypted.
  5700. type EncryptionInfo struct {
  5701. // EncryptionEntityId: The encryption entity ID. This should match the
  5702. // encryption configuration for ad serving or Data Transfer.
  5703. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5704. // EncryptionEntityType: The encryption entity type. This should match
  5705. // the encryption configuration for ad serving or Data Transfer.
  5706. //
  5707. // Possible values:
  5708. // "ADWORDS_CUSTOMER"
  5709. // "DBM_ADVERTISER"
  5710. // "DBM_PARTNER"
  5711. // "DCM_ACCOUNT"
  5712. // "DCM_ADVERTISER"
  5713. // "DFP_NETWORK_CODE"
  5714. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5715. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5716. // EncryptionSource: Describes whether the encrypted cookie was received
  5717. // from ad serving (the %m macro) or from Data Transfer.
  5718. //
  5719. // Possible values:
  5720. // "AD_SERVING"
  5721. // "DATA_TRANSFER"
  5722. // "ENCRYPTION_SCOPE_UNKNOWN"
  5723. EncryptionSource string `json:"encryptionSource,omitempty"`
  5724. // Kind: Identifies what kind of resource this is. Value: the fixed
  5725. // string "dfareporting#encryptionInfo".
  5726. Kind string `json:"kind,omitempty"`
  5727. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5728. // to unconditionally include in API requests. By default, fields with
  5729. // empty values are omitted from API requests. However, any non-pointer,
  5730. // non-interface field appearing in ForceSendFields will be sent to the
  5731. // server regardless of whether the field is empty or not. This may be
  5732. // used to include empty fields in Patch requests.
  5733. ForceSendFields []string `json:"-"`
  5734. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5735. // include in API requests with the JSON null value. By default, fields
  5736. // with empty values are omitted from API requests. However, any field
  5737. // with an empty value appearing in NullFields will be sent to the
  5738. // server as null. It is an error if a field in this list has a
  5739. // non-empty value. This may be used to include null fields in Patch
  5740. // requests.
  5741. NullFields []string `json:"-"`
  5742. }
  5743. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5744. type NoMethod EncryptionInfo
  5745. raw := NoMethod(*s)
  5746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5747. }
  5748. // EventTag: Contains properties of an event tag.
  5749. type EventTag struct {
  5750. // AccountId: Account ID of this event tag. This is a read-only field
  5751. // that can be left blank.
  5752. AccountId int64 `json:"accountId,omitempty,string"`
  5753. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5754. // campaignId field is required on insertion.
  5755. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5756. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5757. // advertiser. This is a read-only, auto-generated field.
  5758. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5759. // CampaignId: Campaign ID of this event tag. This field or the
  5760. // advertiserId field is required on insertion.
  5761. CampaignId int64 `json:"campaignId,omitempty,string"`
  5762. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5763. // This is a read-only, auto-generated field.
  5764. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5765. // EnabledByDefault: Whether this event tag should be automatically
  5766. // enabled for all of the advertiser's campaigns and ads.
  5767. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5768. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5769. // that are trafficked through Display & Video 360 to Ad Exchange. This
  5770. // may be useful if the event tag uses a pixel that is unapproved for Ad
  5771. // Exchange bids on one or more networks, such as the Google Display
  5772. // Network.
  5773. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5774. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5775. Id int64 `json:"id,omitempty,string"`
  5776. // Kind: Identifies what kind of resource this is. Value: the fixed
  5777. // string "dfareporting#eventTag".
  5778. Kind string `json:"kind,omitempty"`
  5779. // Name: Name of this event tag. This is a required field and must be
  5780. // less than 256 characters long.
  5781. Name string `json:"name,omitempty"`
  5782. // SiteFilterType: Site filter type for this event tag. If no type is
  5783. // specified then the event tag will be applied to all sites.
  5784. //
  5785. // Possible values:
  5786. // "BLACKLIST"
  5787. // "WHITELIST"
  5788. SiteFilterType string `json:"siteFilterType,omitempty"`
  5789. // SiteIds: Filter list of site IDs associated with this event tag. The
  5790. // siteFilterType determines whether this is a whitelist or blacklist
  5791. // filter.
  5792. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5793. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5794. // read-only field.
  5795. SslCompliant bool `json:"sslCompliant,omitempty"`
  5796. // Status: Status of this event tag. Must be ENABLED for this event tag
  5797. // to fire. This is a required field.
  5798. //
  5799. // Possible values:
  5800. // "DISABLED"
  5801. // "ENABLED"
  5802. Status string `json:"status,omitempty"`
  5803. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5804. // field that can be left blank.
  5805. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5806. // Type: Event tag type. Can be used to specify whether to use a
  5807. // third-party pixel, a third-party JavaScript URL, or a third-party
  5808. // click-through URL for either impression or click tracking. This is a
  5809. // required field.
  5810. //
  5811. // Possible values:
  5812. // "CLICK_THROUGH_EVENT_TAG"
  5813. // "IMPRESSION_IMAGE_EVENT_TAG"
  5814. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5815. Type string `json:"type,omitempty"`
  5816. // Url: Payload URL for this event tag. The URL on a click-through event
  5817. // tag should have a landing page URL appended to the end of it. This
  5818. // field is required on insertion.
  5819. Url string `json:"url,omitempty"`
  5820. // UrlEscapeLevels: Number of times the landing page URL should be
  5821. // URL-escaped before being appended to the click-through event tag URL.
  5822. // Only applies to click-through event tags as specified by the event
  5823. // tag type.
  5824. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5825. // ServerResponse contains the HTTP response code and headers from the
  5826. // server.
  5827. googleapi.ServerResponse `json:"-"`
  5828. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5829. // unconditionally include in API requests. By default, fields with
  5830. // empty values are omitted from API requests. However, any non-pointer,
  5831. // non-interface field appearing in ForceSendFields will be sent to the
  5832. // server regardless of whether the field is empty or not. This may be
  5833. // used to include empty fields in Patch requests.
  5834. ForceSendFields []string `json:"-"`
  5835. // NullFields is a list of field names (e.g. "AccountId") to include in
  5836. // API requests with the JSON null value. By default, fields with empty
  5837. // values are omitted from API requests. However, any field with an
  5838. // empty value appearing in NullFields will be sent to the server as
  5839. // null. It is an error if a field in this list has a non-empty value.
  5840. // This may be used to include null fields in Patch requests.
  5841. NullFields []string `json:"-"`
  5842. }
  5843. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5844. type NoMethod EventTag
  5845. raw := NoMethod(*s)
  5846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5847. }
  5848. // EventTagOverride: Event tag override information.
  5849. type EventTagOverride struct {
  5850. // Enabled: Whether this override is enabled.
  5851. Enabled bool `json:"enabled,omitempty"`
  5852. // Id: ID of this event tag override. This is a read-only,
  5853. // auto-generated field.
  5854. Id int64 `json:"id,omitempty,string"`
  5855. // ForceSendFields is a list of field names (e.g. "Enabled") to
  5856. // unconditionally include in API requests. By default, fields with
  5857. // empty values are omitted from API requests. However, any non-pointer,
  5858. // non-interface field appearing in ForceSendFields will be sent to the
  5859. // server regardless of whether the field is empty or not. This may be
  5860. // used to include empty fields in Patch requests.
  5861. ForceSendFields []string `json:"-"`
  5862. // NullFields is a list of field names (e.g. "Enabled") to include in
  5863. // API requests with the JSON null value. By default, fields with empty
  5864. // values are omitted from API requests. However, any field with an
  5865. // empty value appearing in NullFields will be sent to the server as
  5866. // null. It is an error if a field in this list has a non-empty value.
  5867. // This may be used to include null fields in Patch requests.
  5868. NullFields []string `json:"-"`
  5869. }
  5870. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  5871. type NoMethod EventTagOverride
  5872. raw := NoMethod(*s)
  5873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5874. }
  5875. // EventTagsListResponse: Event Tag List Response
  5876. type EventTagsListResponse struct {
  5877. // EventTags: Event tag collection.
  5878. EventTags []*EventTag `json:"eventTags,omitempty"`
  5879. // Kind: Identifies what kind of resource this is. Value: the fixed
  5880. // string "dfareporting#eventTagsListResponse".
  5881. Kind string `json:"kind,omitempty"`
  5882. // ServerResponse contains the HTTP response code and headers from the
  5883. // server.
  5884. googleapi.ServerResponse `json:"-"`
  5885. // ForceSendFields is a list of field names (e.g. "EventTags") to
  5886. // unconditionally include in API requests. By default, fields with
  5887. // empty values are omitted from API requests. However, any non-pointer,
  5888. // non-interface field appearing in ForceSendFields will be sent to the
  5889. // server regardless of whether the field is empty or not. This may be
  5890. // used to include empty fields in Patch requests.
  5891. ForceSendFields []string `json:"-"`
  5892. // NullFields is a list of field names (e.g. "EventTags") to include in
  5893. // API requests with the JSON null value. By default, fields with empty
  5894. // values are omitted from API requests. However, any field with an
  5895. // empty value appearing in NullFields will be sent to the server as
  5896. // null. It is an error if a field in this list has a non-empty value.
  5897. // This may be used to include null fields in Patch requests.
  5898. NullFields []string `json:"-"`
  5899. }
  5900. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  5901. type NoMethod EventTagsListResponse
  5902. raw := NoMethod(*s)
  5903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5904. }
  5905. // File: Represents a File resource. A file contains the metadata for a
  5906. // report run. It shows the status of the run and holds the URLs to the
  5907. // generated report data if the run is finished and the status is
  5908. // "REPORT_AVAILABLE".
  5909. type File struct {
  5910. // DateRange: The date range for which the file has report data. The
  5911. // date range will always be the absolute date range for which the
  5912. // report is run.
  5913. DateRange *DateRange `json:"dateRange,omitempty"`
  5914. // Etag: The eTag of this response for caching purposes.
  5915. Etag string `json:"etag,omitempty"`
  5916. // FileName: The filename of the file.
  5917. FileName string `json:"fileName,omitempty"`
  5918. // Format: The output format of the report. Only available once the file
  5919. // is available.
  5920. //
  5921. // Possible values:
  5922. // "CSV"
  5923. // "EXCEL"
  5924. Format string `json:"format,omitempty"`
  5925. // Id: The unique ID of this report file.
  5926. Id int64 `json:"id,omitempty,string"`
  5927. // Kind: The kind of resource this is, in this case dfareporting#file.
  5928. Kind string `json:"kind,omitempty"`
  5929. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  5930. // file was last modified.
  5931. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  5932. // ReportId: The ID of the report this file was generated from.
  5933. ReportId int64 `json:"reportId,omitempty,string"`
  5934. // Status: The status of the report file.
  5935. //
  5936. // Possible values:
  5937. // "CANCELLED"
  5938. // "FAILED"
  5939. // "PROCESSING"
  5940. // "REPORT_AVAILABLE"
  5941. Status string `json:"status,omitempty"`
  5942. // Urls: The URLs where the completed report file can be downloaded.
  5943. Urls *FileUrls `json:"urls,omitempty"`
  5944. // ServerResponse contains the HTTP response code and headers from the
  5945. // server.
  5946. googleapi.ServerResponse `json:"-"`
  5947. // ForceSendFields is a list of field names (e.g. "DateRange") to
  5948. // unconditionally include in API requests. By default, fields with
  5949. // empty values are omitted from API requests. However, any non-pointer,
  5950. // non-interface field appearing in ForceSendFields will be sent to the
  5951. // server regardless of whether the field is empty or not. This may be
  5952. // used to include empty fields in Patch requests.
  5953. ForceSendFields []string `json:"-"`
  5954. // NullFields is a list of field names (e.g. "DateRange") to include in
  5955. // API requests with the JSON null value. By default, fields with empty
  5956. // values are omitted from API requests. However, any field with an
  5957. // empty value appearing in NullFields will be sent to the server as
  5958. // null. It is an error if a field in this list has a non-empty value.
  5959. // This may be used to include null fields in Patch requests.
  5960. NullFields []string `json:"-"`
  5961. }
  5962. func (s *File) MarshalJSON() ([]byte, error) {
  5963. type NoMethod File
  5964. raw := NoMethod(*s)
  5965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5966. }
  5967. // FileUrls: The URLs where the completed report file can be downloaded.
  5968. type FileUrls struct {
  5969. // ApiUrl: The URL for downloading the report data through the API.
  5970. ApiUrl string `json:"apiUrl,omitempty"`
  5971. // BrowserUrl: The URL for downloading the report data through a
  5972. // browser.
  5973. BrowserUrl string `json:"browserUrl,omitempty"`
  5974. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  5975. // unconditionally include in API requests. By default, fields with
  5976. // empty values are omitted from API requests. However, any non-pointer,
  5977. // non-interface field appearing in ForceSendFields will be sent to the
  5978. // server regardless of whether the field is empty or not. This may be
  5979. // used to include empty fields in Patch requests.
  5980. ForceSendFields []string `json:"-"`
  5981. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  5982. // requests with the JSON null value. By default, fields with empty
  5983. // values are omitted from API requests. However, any field with an
  5984. // empty value appearing in NullFields will be sent to the server as
  5985. // null. It is an error if a field in this list has a non-empty value.
  5986. // This may be used to include null fields in Patch requests.
  5987. NullFields []string `json:"-"`
  5988. }
  5989. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  5990. type NoMethod FileUrls
  5991. raw := NoMethod(*s)
  5992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5993. }
  5994. // FileList: Represents the list of File resources.
  5995. type FileList struct {
  5996. // Etag: The eTag of this response for caching purposes.
  5997. Etag string `json:"etag,omitempty"`
  5998. // Items: The files returned in this response.
  5999. Items []*File `json:"items,omitempty"`
  6000. // Kind: The kind of list this is, in this case dfareporting#fileList.
  6001. Kind string `json:"kind,omitempty"`
  6002. // NextPageToken: Continuation token used to page through files. To
  6003. // retrieve the next page of results, set the next request's "pageToken"
  6004. // to the value of this field. The page token is only valid for a
  6005. // limited amount of time and should not be persisted.
  6006. NextPageToken string `json:"nextPageToken,omitempty"`
  6007. // ServerResponse contains the HTTP response code and headers from the
  6008. // server.
  6009. googleapi.ServerResponse `json:"-"`
  6010. // ForceSendFields is a list of field names (e.g. "Etag") to
  6011. // unconditionally include in API requests. By default, fields with
  6012. // empty values are omitted from API requests. However, any non-pointer,
  6013. // non-interface field appearing in ForceSendFields will be sent to the
  6014. // server regardless of whether the field is empty or not. This may be
  6015. // used to include empty fields in Patch requests.
  6016. ForceSendFields []string `json:"-"`
  6017. // NullFields is a list of field names (e.g. "Etag") to include in API
  6018. // requests with the JSON null value. By default, fields with empty
  6019. // values are omitted from API requests. However, any field with an
  6020. // empty value appearing in NullFields will be sent to the server as
  6021. // null. It is an error if a field in this list has a non-empty value.
  6022. // This may be used to include null fields in Patch requests.
  6023. NullFields []string `json:"-"`
  6024. }
  6025. func (s *FileList) MarshalJSON() ([]byte, error) {
  6026. type NoMethod FileList
  6027. raw := NoMethod(*s)
  6028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6029. }
  6030. // Flight: Flight
  6031. type Flight struct {
  6032. // EndDate: Inventory item flight end date.
  6033. EndDate string `json:"endDate,omitempty"`
  6034. // RateOrCost: Rate or cost of this flight.
  6035. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  6036. // StartDate: Inventory item flight start date.
  6037. StartDate string `json:"startDate,omitempty"`
  6038. // Units: Units of this flight.
  6039. Units int64 `json:"units,omitempty,string"`
  6040. // ForceSendFields is a list of field names (e.g. "EndDate") to
  6041. // unconditionally include in API requests. By default, fields with
  6042. // empty values are omitted from API requests. However, any non-pointer,
  6043. // non-interface field appearing in ForceSendFields will be sent to the
  6044. // server regardless of whether the field is empty or not. This may be
  6045. // used to include empty fields in Patch requests.
  6046. ForceSendFields []string `json:"-"`
  6047. // NullFields is a list of field names (e.g. "EndDate") to include in
  6048. // API requests with the JSON null value. By default, fields with empty
  6049. // values are omitted from API requests. However, any field with an
  6050. // empty value appearing in NullFields will be sent to the server as
  6051. // null. It is an error if a field in this list has a non-empty value.
  6052. // This may be used to include null fields in Patch requests.
  6053. NullFields []string `json:"-"`
  6054. }
  6055. func (s *Flight) MarshalJSON() ([]byte, error) {
  6056. type NoMethod Flight
  6057. raw := NoMethod(*s)
  6058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6059. }
  6060. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  6061. // GenerateTag Response
  6062. type FloodlightActivitiesGenerateTagResponse struct {
  6063. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  6064. // For global site tags, this is the event snippet.
  6065. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  6066. // GlobalSiteTagGlobalSnippet: The global snippet section of a global
  6067. // site tag. The global site tag sets new cookies on your domain, which
  6068. // will store a unique identifier for a user or the ad click that
  6069. // brought the user to your site. Learn more.
  6070. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"`
  6071. // Kind: Identifies what kind of resource this is. Value: the fixed
  6072. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  6073. Kind string `json:"kind,omitempty"`
  6074. // ServerResponse contains the HTTP response code and headers from the
  6075. // server.
  6076. googleapi.ServerResponse `json:"-"`
  6077. // ForceSendFields is a list of field names (e.g.
  6078. // "FloodlightActivityTag") to unconditionally include in API requests.
  6079. // By default, fields with empty values are omitted from API requests.
  6080. // However, any non-pointer, non-interface field appearing in
  6081. // ForceSendFields will be sent to the server regardless of whether the
  6082. // field is empty or not. This may be used to include empty fields in
  6083. // Patch requests.
  6084. ForceSendFields []string `json:"-"`
  6085. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  6086. // include in API requests with the JSON null value. By default, fields
  6087. // with empty values are omitted from API requests. However, any field
  6088. // with an empty value appearing in NullFields will be sent to the
  6089. // server as null. It is an error if a field in this list has a
  6090. // non-empty value. This may be used to include null fields in Patch
  6091. // requests.
  6092. NullFields []string `json:"-"`
  6093. }
  6094. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  6095. type NoMethod FloodlightActivitiesGenerateTagResponse
  6096. raw := NoMethod(*s)
  6097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6098. }
  6099. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  6100. type FloodlightActivitiesListResponse struct {
  6101. // FloodlightActivities: Floodlight activity collection.
  6102. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  6103. // Kind: Identifies what kind of resource this is. Value: the fixed
  6104. // string "dfareporting#floodlightActivitiesListResponse".
  6105. Kind string `json:"kind,omitempty"`
  6106. // NextPageToken: Pagination token to be used for the next list
  6107. // operation.
  6108. NextPageToken string `json:"nextPageToken,omitempty"`
  6109. // ServerResponse contains the HTTP response code and headers from the
  6110. // server.
  6111. googleapi.ServerResponse `json:"-"`
  6112. // ForceSendFields is a list of field names (e.g.
  6113. // "FloodlightActivities") to unconditionally include in API requests.
  6114. // By default, fields with empty values are omitted from API requests.
  6115. // However, any non-pointer, non-interface field appearing in
  6116. // ForceSendFields will be sent to the server regardless of whether the
  6117. // field is empty or not. This may be used to include empty fields in
  6118. // Patch requests.
  6119. ForceSendFields []string `json:"-"`
  6120. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  6121. // include in API requests with the JSON null value. By default, fields
  6122. // with empty values are omitted from API requests. However, any field
  6123. // with an empty value appearing in NullFields will be sent to the
  6124. // server as null. It is an error if a field in this list has a
  6125. // non-empty value. This may be used to include null fields in Patch
  6126. // requests.
  6127. NullFields []string `json:"-"`
  6128. }
  6129. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  6130. type NoMethod FloodlightActivitiesListResponse
  6131. raw := NoMethod(*s)
  6132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6133. }
  6134. // FloodlightActivity: Contains properties of a Floodlight activity.
  6135. type FloodlightActivity struct {
  6136. // AccountId: Account ID of this floodlight activity. This is a
  6137. // read-only field that can be left blank.
  6138. AccountId int64 `json:"accountId,omitempty,string"`
  6139. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  6140. // field is left blank, the value will be copied over either from the
  6141. // activity group's advertiser or the existing activity's advertiser.
  6142. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6143. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6144. // advertiser. This is a read-only, auto-generated field.
  6145. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6146. // CacheBustingType: Code type used for cache busting in the generated
  6147. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  6148. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  6149. //
  6150. // Possible values:
  6151. // "ACTIVE_SERVER_PAGE"
  6152. // "COLD_FUSION"
  6153. // "JAVASCRIPT"
  6154. // "JSP"
  6155. // "PHP"
  6156. CacheBustingType string `json:"cacheBustingType,omitempty"`
  6157. // CountingMethod: Counting method for conversions for this floodlight
  6158. // activity. This is a required field.
  6159. //
  6160. // Possible values:
  6161. // "ITEMS_SOLD_COUNTING"
  6162. // "SESSION_COUNTING"
  6163. // "STANDARD_COUNTING"
  6164. // "TRANSACTIONS_COUNTING"
  6165. // "UNIQUE_COUNTING"
  6166. CountingMethod string `json:"countingMethod,omitempty"`
  6167. // DefaultTags: Dynamic floodlight tags.
  6168. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  6169. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  6170. // be less than 256 characters long.
  6171. ExpectedUrl string `json:"expectedUrl,omitempty"`
  6172. // FloodlightActivityGroupId: Floodlight activity group ID of this
  6173. // floodlight activity. This is a required field.
  6174. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  6175. // FloodlightActivityGroupName: Name of the associated floodlight
  6176. // activity group. This is a read-only field.
  6177. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  6178. // FloodlightActivityGroupTagString: Tag string of the associated
  6179. // floodlight activity group. This is a read-only field.
  6180. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  6181. // FloodlightActivityGroupType: Type of the associated floodlight
  6182. // activity group. This is a read-only field.
  6183. //
  6184. // Possible values:
  6185. // "COUNTER"
  6186. // "SALE"
  6187. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6188. // FloodlightConfigurationId: Floodlight configuration ID of this
  6189. // floodlight activity. If this field is left blank, the value will be
  6190. // copied over either from the activity group's floodlight configuration
  6191. // or from the existing activity's floodlight configuration.
  6192. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6193. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6194. // of the floodlight configuration. This is a read-only, auto-generated
  6195. // field.
  6196. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6197. // FloodlightTagType: The type of Floodlight tag this activity will
  6198. // generate. This is a required field.
  6199. //
  6200. // Possible values:
  6201. // "GLOBAL_SITE_TAG"
  6202. // "IFRAME"
  6203. // "IMAGE"
  6204. FloodlightTagType string `json:"floodlightTagType,omitempty"`
  6205. // Hidden: Whether this activity is archived.
  6206. Hidden bool `json:"hidden,omitempty"`
  6207. // Id: ID of this floodlight activity. This is a read-only,
  6208. // auto-generated field.
  6209. Id int64 `json:"id,omitempty,string"`
  6210. // IdDimensionValue: Dimension value for the ID of this floodlight
  6211. // activity. This is a read-only, auto-generated field.
  6212. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6213. // Kind: Identifies what kind of resource this is. Value: the fixed
  6214. // string "dfareporting#floodlightActivity".
  6215. Kind string `json:"kind,omitempty"`
  6216. // Name: Name of this floodlight activity. This is a required field.
  6217. // Must be less than 129 characters long and cannot contain quotes.
  6218. Name string `json:"name,omitempty"`
  6219. // Notes: General notes or implementation instructions for the tag.
  6220. Notes string `json:"notes,omitempty"`
  6221. // PublisherTags: Publisher dynamic floodlight tags.
  6222. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6223. // Secure: Whether this tag should use SSL.
  6224. Secure bool `json:"secure,omitempty"`
  6225. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6226. // is a read-only field, its value detected by the system from the
  6227. // floodlight tags.
  6228. SslCompliant bool `json:"sslCompliant,omitempty"`
  6229. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6230. SslRequired bool `json:"sslRequired,omitempty"`
  6231. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6232. // read-only field that can be left blank.
  6233. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6234. // TagFormat: Tag format type for the floodlight activity. If left
  6235. // blank, the tag format will default to HTML.
  6236. //
  6237. // Possible values:
  6238. // "HTML"
  6239. // "XHTML"
  6240. TagFormat string `json:"tagFormat,omitempty"`
  6241. // TagString: Value of the cat= parameter in the floodlight tag, which
  6242. // the ad servers use to identify the activity. This is optional: if
  6243. // empty, a new tag string will be generated for you. This string must
  6244. // be 1 to 8 characters long, with valid characters being
  6245. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6246. // activities of the same activity group. This field is read-only after
  6247. // insertion.
  6248. TagString string `json:"tagString,omitempty"`
  6249. // UserDefinedVariableTypes: List of the user-defined variables used by
  6250. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6251. // of these can have a user defined type.
  6252. // Acceptable values are U1 to U100, inclusive.
  6253. //
  6254. // Possible values:
  6255. // "U1"
  6256. // "U10"
  6257. // "U100"
  6258. // "U11"
  6259. // "U12"
  6260. // "U13"
  6261. // "U14"
  6262. // "U15"
  6263. // "U16"
  6264. // "U17"
  6265. // "U18"
  6266. // "U19"
  6267. // "U2"
  6268. // "U20"
  6269. // "U21"
  6270. // "U22"
  6271. // "U23"
  6272. // "U24"
  6273. // "U25"
  6274. // "U26"
  6275. // "U27"
  6276. // "U28"
  6277. // "U29"
  6278. // "U3"
  6279. // "U30"
  6280. // "U31"
  6281. // "U32"
  6282. // "U33"
  6283. // "U34"
  6284. // "U35"
  6285. // "U36"
  6286. // "U37"
  6287. // "U38"
  6288. // "U39"
  6289. // "U4"
  6290. // "U40"
  6291. // "U41"
  6292. // "U42"
  6293. // "U43"
  6294. // "U44"
  6295. // "U45"
  6296. // "U46"
  6297. // "U47"
  6298. // "U48"
  6299. // "U49"
  6300. // "U5"
  6301. // "U50"
  6302. // "U51"
  6303. // "U52"
  6304. // "U53"
  6305. // "U54"
  6306. // "U55"
  6307. // "U56"
  6308. // "U57"
  6309. // "U58"
  6310. // "U59"
  6311. // "U6"
  6312. // "U60"
  6313. // "U61"
  6314. // "U62"
  6315. // "U63"
  6316. // "U64"
  6317. // "U65"
  6318. // "U66"
  6319. // "U67"
  6320. // "U68"
  6321. // "U69"
  6322. // "U7"
  6323. // "U70"
  6324. // "U71"
  6325. // "U72"
  6326. // "U73"
  6327. // "U74"
  6328. // "U75"
  6329. // "U76"
  6330. // "U77"
  6331. // "U78"
  6332. // "U79"
  6333. // "U8"
  6334. // "U80"
  6335. // "U81"
  6336. // "U82"
  6337. // "U83"
  6338. // "U84"
  6339. // "U85"
  6340. // "U86"
  6341. // "U87"
  6342. // "U88"
  6343. // "U89"
  6344. // "U9"
  6345. // "U90"
  6346. // "U91"
  6347. // "U92"
  6348. // "U93"
  6349. // "U94"
  6350. // "U95"
  6351. // "U96"
  6352. // "U97"
  6353. // "U98"
  6354. // "U99"
  6355. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6356. // ServerResponse contains the HTTP response code and headers from the
  6357. // server.
  6358. googleapi.ServerResponse `json:"-"`
  6359. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6360. // unconditionally include in API requests. By default, fields with
  6361. // empty values are omitted from API requests. However, any non-pointer,
  6362. // non-interface field appearing in ForceSendFields will be sent to the
  6363. // server regardless of whether the field is empty or not. This may be
  6364. // used to include empty fields in Patch requests.
  6365. ForceSendFields []string `json:"-"`
  6366. // NullFields is a list of field names (e.g. "AccountId") to include in
  6367. // API requests with the JSON null value. By default, fields with empty
  6368. // values are omitted from API requests. However, any field with an
  6369. // empty value appearing in NullFields will be sent to the server as
  6370. // null. It is an error if a field in this list has a non-empty value.
  6371. // This may be used to include null fields in Patch requests.
  6372. NullFields []string `json:"-"`
  6373. }
  6374. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6375. type NoMethod FloodlightActivity
  6376. raw := NoMethod(*s)
  6377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6378. }
  6379. // FloodlightActivityDynamicTag: Dynamic Tag
  6380. type FloodlightActivityDynamicTag struct {
  6381. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6382. // field.
  6383. Id int64 `json:"id,omitempty,string"`
  6384. // Name: Name of this tag.
  6385. Name string `json:"name,omitempty"`
  6386. // Tag: Tag code.
  6387. Tag string `json:"tag,omitempty"`
  6388. // ForceSendFields is a list of field names (e.g. "Id") to
  6389. // unconditionally include in API requests. By default, fields with
  6390. // empty values are omitted from API requests. However, any non-pointer,
  6391. // non-interface field appearing in ForceSendFields will be sent to the
  6392. // server regardless of whether the field is empty or not. This may be
  6393. // used to include empty fields in Patch requests.
  6394. ForceSendFields []string `json:"-"`
  6395. // NullFields is a list of field names (e.g. "Id") to include in API
  6396. // requests with the JSON null value. By default, fields with empty
  6397. // values are omitted from API requests. However, any field with an
  6398. // empty value appearing in NullFields will be sent to the server as
  6399. // null. It is an error if a field in this list has a non-empty value.
  6400. // This may be used to include null fields in Patch requests.
  6401. NullFields []string `json:"-"`
  6402. }
  6403. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6404. type NoMethod FloodlightActivityDynamicTag
  6405. raw := NoMethod(*s)
  6406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6407. }
  6408. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6409. // group.
  6410. type FloodlightActivityGroup struct {
  6411. // AccountId: Account ID of this floodlight activity group. This is a
  6412. // read-only field that can be left blank.
  6413. AccountId int64 `json:"accountId,omitempty,string"`
  6414. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6415. // this field is left blank, the value will be copied over either from
  6416. // the floodlight configuration's advertiser or from the existing
  6417. // activity group's advertiser.
  6418. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6419. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6420. // advertiser. This is a read-only, auto-generated field.
  6421. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6422. // FloodlightConfigurationId: Floodlight configuration ID of this
  6423. // floodlight activity group. This is a required field.
  6424. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6425. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6426. // of the floodlight configuration. This is a read-only, auto-generated
  6427. // field.
  6428. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6429. // Id: ID of this floodlight activity group. This is a read-only,
  6430. // auto-generated field.
  6431. Id int64 `json:"id,omitempty,string"`
  6432. // IdDimensionValue: Dimension value for the ID of this floodlight
  6433. // activity group. This is a read-only, auto-generated field.
  6434. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6435. // Kind: Identifies what kind of resource this is. Value: the fixed
  6436. // string "dfareporting#floodlightActivityGroup".
  6437. Kind string `json:"kind,omitempty"`
  6438. // Name: Name of this floodlight activity group. This is a required
  6439. // field. Must be less than 65 characters long and cannot contain
  6440. // quotes.
  6441. Name string `json:"name,omitempty"`
  6442. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6443. // is a read-only field that can be left blank.
  6444. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6445. // TagString: Value of the type= parameter in the floodlight tag, which
  6446. // the ad servers use to identify the activity group that the activity
  6447. // belongs to. This is optional: if empty, a new tag string will be
  6448. // generated for you. This string must be 1 to 8 characters long, with
  6449. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6450. // also be unique among activity groups of the same floodlight
  6451. // configuration. This field is read-only after insertion.
  6452. TagString string `json:"tagString,omitempty"`
  6453. // Type: Type of the floodlight activity group. This is a required field
  6454. // that is read-only after insertion.
  6455. //
  6456. // Possible values:
  6457. // "COUNTER"
  6458. // "SALE"
  6459. Type string `json:"type,omitempty"`
  6460. // ServerResponse contains the HTTP response code and headers from the
  6461. // server.
  6462. googleapi.ServerResponse `json:"-"`
  6463. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6464. // unconditionally include in API requests. By default, fields with
  6465. // empty values are omitted from API requests. However, any non-pointer,
  6466. // non-interface field appearing in ForceSendFields will be sent to the
  6467. // server regardless of whether the field is empty or not. This may be
  6468. // used to include empty fields in Patch requests.
  6469. ForceSendFields []string `json:"-"`
  6470. // NullFields is a list of field names (e.g. "AccountId") to include in
  6471. // API requests with the JSON null value. By default, fields with empty
  6472. // values are omitted from API requests. However, any field with an
  6473. // empty value appearing in NullFields will be sent to the server as
  6474. // null. It is an error if a field in this list has a non-empty value.
  6475. // This may be used to include null fields in Patch requests.
  6476. NullFields []string `json:"-"`
  6477. }
  6478. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6479. type NoMethod FloodlightActivityGroup
  6480. raw := NoMethod(*s)
  6481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6482. }
  6483. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6484. // Response
  6485. type FloodlightActivityGroupsListResponse struct {
  6486. // FloodlightActivityGroups: Floodlight activity group collection.
  6487. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6488. // Kind: Identifies what kind of resource this is. Value: the fixed
  6489. // string "dfareporting#floodlightActivityGroupsListResponse".
  6490. Kind string `json:"kind,omitempty"`
  6491. // NextPageToken: Pagination token to be used for the next list
  6492. // operation.
  6493. NextPageToken string `json:"nextPageToken,omitempty"`
  6494. // ServerResponse contains the HTTP response code and headers from the
  6495. // server.
  6496. googleapi.ServerResponse `json:"-"`
  6497. // ForceSendFields is a list of field names (e.g.
  6498. // "FloodlightActivityGroups") to unconditionally include in API
  6499. // requests. By default, fields with empty values are omitted from API
  6500. // requests. However, any non-pointer, non-interface field appearing in
  6501. // ForceSendFields will be sent to the server regardless of whether the
  6502. // field is empty or not. This may be used to include empty fields in
  6503. // Patch requests.
  6504. ForceSendFields []string `json:"-"`
  6505. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6506. // to include in API requests with the JSON null value. By default,
  6507. // fields with empty values are omitted from API requests. However, any
  6508. // field with an empty value appearing in NullFields will be sent to the
  6509. // server as null. It is an error if a field in this list has a
  6510. // non-empty value. This may be used to include null fields in Patch
  6511. // requests.
  6512. NullFields []string `json:"-"`
  6513. }
  6514. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6515. type NoMethod FloodlightActivityGroupsListResponse
  6516. raw := NoMethod(*s)
  6517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6518. }
  6519. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6520. type FloodlightActivityPublisherDynamicTag struct {
  6521. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6522. ClickThrough bool `json:"clickThrough,omitempty"`
  6523. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6524. // write-only field that can be used as an alternative to the siteId
  6525. // field. When this resource is retrieved, only the siteId field will be
  6526. // populated.
  6527. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6528. // DynamicTag: Dynamic floodlight tag.
  6529. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6530. // SiteId: Site ID of this dynamic tag.
  6531. SiteId int64 `json:"siteId,omitempty,string"`
  6532. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6533. // a read-only, auto-generated field.
  6534. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6535. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6536. ViewThrough bool `json:"viewThrough,omitempty"`
  6537. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6538. // unconditionally include in API requests. By default, fields with
  6539. // empty values are omitted from API requests. However, any non-pointer,
  6540. // non-interface field appearing in ForceSendFields will be sent to the
  6541. // server regardless of whether the field is empty or not. This may be
  6542. // used to include empty fields in Patch requests.
  6543. ForceSendFields []string `json:"-"`
  6544. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6545. // in API requests with the JSON null value. By default, fields with
  6546. // empty values are omitted from API requests. However, any field with
  6547. // an empty value appearing in NullFields will be sent to the server as
  6548. // null. It is an error if a field in this list has a non-empty value.
  6549. // This may be used to include null fields in Patch requests.
  6550. NullFields []string `json:"-"`
  6551. }
  6552. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6553. type NoMethod FloodlightActivityPublisherDynamicTag
  6554. raw := NoMethod(*s)
  6555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6556. }
  6557. // FloodlightConfiguration: Contains properties of a Floodlight
  6558. // configuration.
  6559. type FloodlightConfiguration struct {
  6560. // AccountId: Account ID of this floodlight configuration. This is a
  6561. // read-only field that can be left blank.
  6562. AccountId int64 `json:"accountId,omitempty,string"`
  6563. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6564. // floodlight configuration.
  6565. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6566. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6567. // advertiser. This is a read-only, auto-generated field.
  6568. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6569. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6570. // Google Analytics.
  6571. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6572. // CustomViewabilityMetric: Custom Viewability metric for the floodlight
  6573. // configuration.
  6574. CustomViewabilityMetric *CustomViewabilityMetric `json:"customViewabilityMetric,omitempty"`
  6575. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6576. // report is enabled. This report shows detailed pathway information on
  6577. // up to 10 of the most recent ad exposures seen by a user before
  6578. // converting.
  6579. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6580. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6581. // in reports. This is a required field.
  6582. //
  6583. // Possible values:
  6584. // "MONDAY"
  6585. // "SUNDAY"
  6586. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6587. // Id: ID of this floodlight configuration. This is a read-only,
  6588. // auto-generated field.
  6589. Id int64 `json:"id,omitempty,string"`
  6590. // IdDimensionValue: Dimension value for the ID of this floodlight
  6591. // configuration. This is a read-only, auto-generated field.
  6592. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6593. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6594. // is enabled.
  6595. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6596. // Kind: Identifies what kind of resource this is. Value: the fixed
  6597. // string "dfareporting#floodlightConfiguration".
  6598. Kind string `json:"kind,omitempty"`
  6599. // LookbackConfiguration: Lookback window settings for this floodlight
  6600. // configuration.
  6601. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6602. // NaturalSearchConversionAttributionOption: Types of attribution
  6603. // options for natural search conversions.
  6604. //
  6605. // Possible values:
  6606. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6607. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6608. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6609. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6610. // OmnitureSettings: Settings for Campaign Manager Omniture integration.
  6611. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6612. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6613. // a read-only field that can be left blank.
  6614. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6615. // TagSettings: Configuration settings for dynamic and image floodlight
  6616. // tags.
  6617. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6618. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6619. // tokens enabled for this configuration.
  6620. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6621. // UserDefinedVariableConfigurations: List of user defined variables
  6622. // enabled for this configuration.
  6623. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6624. // ServerResponse contains the HTTP response code and headers from the
  6625. // server.
  6626. googleapi.ServerResponse `json:"-"`
  6627. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6628. // unconditionally include in API requests. By default, fields with
  6629. // empty values are omitted from API requests. However, any non-pointer,
  6630. // non-interface field appearing in ForceSendFields will be sent to the
  6631. // server regardless of whether the field is empty or not. This may be
  6632. // used to include empty fields in Patch requests.
  6633. ForceSendFields []string `json:"-"`
  6634. // NullFields is a list of field names (e.g. "AccountId") to include in
  6635. // API requests with the JSON null value. By default, fields with empty
  6636. // values are omitted from API requests. However, any field with an
  6637. // empty value appearing in NullFields will be sent to the server as
  6638. // null. It is an error if a field in this list has a non-empty value.
  6639. // This may be used to include null fields in Patch requests.
  6640. NullFields []string `json:"-"`
  6641. }
  6642. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6643. type NoMethod FloodlightConfiguration
  6644. raw := NoMethod(*s)
  6645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6646. }
  6647. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6648. // Response
  6649. type FloodlightConfigurationsListResponse struct {
  6650. // FloodlightConfigurations: Floodlight configuration collection.
  6651. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6652. // Kind: Identifies what kind of resource this is. Value: the fixed
  6653. // string "dfareporting#floodlightConfigurationsListResponse".
  6654. Kind string `json:"kind,omitempty"`
  6655. // ServerResponse contains the HTTP response code and headers from the
  6656. // server.
  6657. googleapi.ServerResponse `json:"-"`
  6658. // ForceSendFields is a list of field names (e.g.
  6659. // "FloodlightConfigurations") to unconditionally include in API
  6660. // requests. By default, fields with empty values are omitted from API
  6661. // requests. However, any non-pointer, non-interface field appearing in
  6662. // ForceSendFields will be sent to the server regardless of whether the
  6663. // field is empty or not. This may be used to include empty fields in
  6664. // Patch requests.
  6665. ForceSendFields []string `json:"-"`
  6666. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6667. // to include in API requests with the JSON null value. By default,
  6668. // fields with empty values are omitted from API requests. However, any
  6669. // field with an empty value appearing in NullFields will be sent to the
  6670. // server as null. It is an error if a field in this list has a
  6671. // non-empty value. This may be used to include null fields in Patch
  6672. // requests.
  6673. NullFields []string `json:"-"`
  6674. }
  6675. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6676. type NoMethod FloodlightConfigurationsListResponse
  6677. raw := NoMethod(*s)
  6678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6679. }
  6680. // FloodlightReportCompatibleFields: Represents fields that are
  6681. // compatible to be selected for a report of type "FlOODLIGHT".
  6682. type FloodlightReportCompatibleFields struct {
  6683. // DimensionFilters: Dimensions which are compatible to be selected in
  6684. // the "dimensionFilters" section of the report.
  6685. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6686. // Dimensions: Dimensions which are compatible to be selected in the
  6687. // "dimensions" section of the report.
  6688. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6689. // Kind: The kind of resource this is, in this case
  6690. // dfareporting#floodlightReportCompatibleFields.
  6691. Kind string `json:"kind,omitempty"`
  6692. // Metrics: Metrics which are compatible to be selected in the
  6693. // "metricNames" section of the report.
  6694. Metrics []*Metric `json:"metrics,omitempty"`
  6695. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6696. // unconditionally include in API requests. By default, fields with
  6697. // empty values are omitted from API requests. However, any non-pointer,
  6698. // non-interface field appearing in ForceSendFields will be sent to the
  6699. // server regardless of whether the field is empty or not. This may be
  6700. // used to include empty fields in Patch requests.
  6701. ForceSendFields []string `json:"-"`
  6702. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6703. // include in API requests with the JSON null value. By default, fields
  6704. // with empty values are omitted from API requests. However, any field
  6705. // with an empty value appearing in NullFields will be sent to the
  6706. // server as null. It is an error if a field in this list has a
  6707. // non-empty value. This may be used to include null fields in Patch
  6708. // requests.
  6709. NullFields []string `json:"-"`
  6710. }
  6711. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6712. type NoMethod FloodlightReportCompatibleFields
  6713. raw := NoMethod(*s)
  6714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6715. }
  6716. // FrequencyCap: Frequency Cap.
  6717. type FrequencyCap struct {
  6718. // Duration: Duration of time, in seconds, for this frequency cap. The
  6719. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6720. // inclusive.
  6721. Duration int64 `json:"duration,omitempty,string"`
  6722. // Impressions: Number of times an individual user can be served the ad
  6723. // within the specified duration. Acceptable values are 1 to 15,
  6724. // inclusive.
  6725. Impressions int64 `json:"impressions,omitempty,string"`
  6726. // ForceSendFields is a list of field names (e.g. "Duration") to
  6727. // unconditionally include in API requests. By default, fields with
  6728. // empty values are omitted from API requests. However, any non-pointer,
  6729. // non-interface field appearing in ForceSendFields will be sent to the
  6730. // server regardless of whether the field is empty or not. This may be
  6731. // used to include empty fields in Patch requests.
  6732. ForceSendFields []string `json:"-"`
  6733. // NullFields is a list of field names (e.g. "Duration") to include in
  6734. // API requests with the JSON null value. By default, fields with empty
  6735. // values are omitted from API requests. However, any field with an
  6736. // empty value appearing in NullFields will be sent to the server as
  6737. // null. It is an error if a field in this list has a non-empty value.
  6738. // This may be used to include null fields in Patch requests.
  6739. NullFields []string `json:"-"`
  6740. }
  6741. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6742. type NoMethod FrequencyCap
  6743. raw := NoMethod(*s)
  6744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6745. }
  6746. // FsCommand: FsCommand.
  6747. type FsCommand struct {
  6748. // Left: Distance from the left of the browser.Applicable when
  6749. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6750. Left int64 `json:"left,omitempty"`
  6751. // PositionOption: Position in the browser where the window will open.
  6752. //
  6753. // Possible values:
  6754. // "CENTERED"
  6755. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6756. PositionOption string `json:"positionOption,omitempty"`
  6757. // Top: Distance from the top of the browser. Applicable when
  6758. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6759. Top int64 `json:"top,omitempty"`
  6760. // WindowHeight: Height of the window.
  6761. WindowHeight int64 `json:"windowHeight,omitempty"`
  6762. // WindowWidth: Width of the window.
  6763. WindowWidth int64 `json:"windowWidth,omitempty"`
  6764. // ForceSendFields is a list of field names (e.g. "Left") to
  6765. // unconditionally include in API requests. By default, fields with
  6766. // empty values are omitted from API requests. However, any non-pointer,
  6767. // non-interface field appearing in ForceSendFields will be sent to the
  6768. // server regardless of whether the field is empty or not. This may be
  6769. // used to include empty fields in Patch requests.
  6770. ForceSendFields []string `json:"-"`
  6771. // NullFields is a list of field names (e.g. "Left") to include in API
  6772. // requests with the JSON null value. By default, fields with empty
  6773. // values are omitted from API requests. However, any field with an
  6774. // empty value appearing in NullFields will be sent to the server as
  6775. // null. It is an error if a field in this list has a non-empty value.
  6776. // This may be used to include null fields in Patch requests.
  6777. NullFields []string `json:"-"`
  6778. }
  6779. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6780. type NoMethod FsCommand
  6781. raw := NoMethod(*s)
  6782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6783. }
  6784. // GeoTargeting: Geographical Targeting.
  6785. type GeoTargeting struct {
  6786. // Cities: Cities to be targeted. For each city only dartId is required.
  6787. // The other fields are populated automatically when the ad is inserted
  6788. // or updated. If targeting a city, do not target or exclude the country
  6789. // of the city, and do not target the metro or region of the city.
  6790. Cities []*City `json:"cities,omitempty"`
  6791. // Countries: Countries to be targeted or excluded from targeting,
  6792. // depending on the setting of the excludeCountries field. For each
  6793. // country only dartId is required. The other fields are populated
  6794. // automatically when the ad is inserted or updated. If targeting or
  6795. // excluding a country, do not target regions, cities, metros, or postal
  6796. // codes in the same country.
  6797. Countries []*Country `json:"countries,omitempty"`
  6798. // ExcludeCountries: Whether or not to exclude the countries in the
  6799. // countries field from targeting. If false, the countries field refers
  6800. // to countries which will be targeted by the ad.
  6801. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6802. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6803. // The other fields are populated automatically when the ad is inserted
  6804. // or updated. If targeting a metro, do not target or exclude the
  6805. // country of the metro.
  6806. Metros []*Metro `json:"metros,omitempty"`
  6807. // PostalCodes: Postal codes to be targeted. For each postal code only
  6808. // id is required. The other fields are populated automatically when the
  6809. // ad is inserted or updated. If targeting a postal code, do not target
  6810. // or exclude the country of the postal code.
  6811. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6812. // Regions: Regions to be targeted. For each region only dartId is
  6813. // required. The other fields are populated automatically when the ad is
  6814. // inserted or updated. If targeting a region, do not target or exclude
  6815. // the country of the region.
  6816. Regions []*Region `json:"regions,omitempty"`
  6817. // ForceSendFields is a list of field names (e.g. "Cities") to
  6818. // unconditionally include in API requests. By default, fields with
  6819. // empty values are omitted from API requests. However, any non-pointer,
  6820. // non-interface field appearing in ForceSendFields will be sent to the
  6821. // server regardless of whether the field is empty or not. This may be
  6822. // used to include empty fields in Patch requests.
  6823. ForceSendFields []string `json:"-"`
  6824. // NullFields is a list of field names (e.g. "Cities") to include in API
  6825. // requests with the JSON null value. By default, fields with empty
  6826. // values are omitted from API requests. However, any field with an
  6827. // empty value appearing in NullFields will be sent to the server as
  6828. // null. It is an error if a field in this list has a non-empty value.
  6829. // This may be used to include null fields in Patch requests.
  6830. NullFields []string `json:"-"`
  6831. }
  6832. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6833. type NoMethod GeoTargeting
  6834. raw := NoMethod(*s)
  6835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6836. }
  6837. // InventoryItem: Represents a buy from the Planning inventory store.
  6838. type InventoryItem struct {
  6839. // AccountId: Account ID of this inventory item.
  6840. AccountId int64 `json:"accountId,omitempty,string"`
  6841. // AdSlots: Ad slots of this inventory item. If this inventory item
  6842. // represents a standalone placement, there will be exactly one ad slot.
  6843. // If this inventory item represents a placement group, there will be
  6844. // more than one ad slot, each representing one child placement in that
  6845. // placement group.
  6846. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6847. // AdvertiserId: Advertiser ID of this inventory item.
  6848. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6849. // ContentCategoryId: Content category ID of this inventory item.
  6850. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6851. // EstimatedClickThroughRate: Estimated click-through rate of this
  6852. // inventory item.
  6853. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6854. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6855. // item.
  6856. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  6857. // Id: ID of this inventory item.
  6858. Id int64 `json:"id,omitempty,string"`
  6859. // InPlan: Whether this inventory item is in plan.
  6860. InPlan bool `json:"inPlan,omitempty"`
  6861. // Kind: Identifies what kind of resource this is. Value: the fixed
  6862. // string "dfareporting#inventoryItem".
  6863. Kind string `json:"kind,omitempty"`
  6864. // LastModifiedInfo: Information about the most recent modification of
  6865. // this inventory item.
  6866. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  6867. // Name: Name of this inventory item. For standalone inventory items,
  6868. // this is the same name as that of its only ad slot. For group
  6869. // inventory items, this can differ from the name of any of its ad
  6870. // slots.
  6871. Name string `json:"name,omitempty"`
  6872. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  6873. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  6874. // OrderId: Order ID of this inventory item.
  6875. OrderId int64 `json:"orderId,omitempty,string"`
  6876. // PlacementStrategyId: Placement strategy ID of this inventory item.
  6877. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  6878. // Pricing: Pricing of this inventory item.
  6879. Pricing *Pricing `json:"pricing,omitempty"`
  6880. // ProjectId: Project ID of this inventory item.
  6881. ProjectId int64 `json:"projectId,omitempty,string"`
  6882. // RfpId: RFP ID of this inventory item.
  6883. RfpId int64 `json:"rfpId,omitempty,string"`
  6884. // SiteId: ID of the site this inventory item is associated with.
  6885. SiteId int64 `json:"siteId,omitempty,string"`
  6886. // SubaccountId: Subaccount ID of this inventory item.
  6887. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6888. // Type: Type of inventory item.
  6889. //
  6890. // Possible values:
  6891. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  6892. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  6893. Type string `json:"type,omitempty"`
  6894. // ServerResponse contains the HTTP response code and headers from the
  6895. // server.
  6896. googleapi.ServerResponse `json:"-"`
  6897. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6898. // unconditionally include in API requests. By default, fields with
  6899. // empty values are omitted from API requests. However, any non-pointer,
  6900. // non-interface field appearing in ForceSendFields will be sent to the
  6901. // server regardless of whether the field is empty or not. This may be
  6902. // used to include empty fields in Patch requests.
  6903. ForceSendFields []string `json:"-"`
  6904. // NullFields is a list of field names (e.g. "AccountId") to include in
  6905. // API requests with the JSON null value. By default, fields with empty
  6906. // values are omitted from API requests. However, any field with an
  6907. // empty value appearing in NullFields will be sent to the server as
  6908. // null. It is an error if a field in this list has a non-empty value.
  6909. // This may be used to include null fields in Patch requests.
  6910. NullFields []string `json:"-"`
  6911. }
  6912. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  6913. type NoMethod InventoryItem
  6914. raw := NoMethod(*s)
  6915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6916. }
  6917. // InventoryItemsListResponse: Inventory item List Response
  6918. type InventoryItemsListResponse struct {
  6919. // InventoryItems: Inventory item collection
  6920. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  6921. // Kind: Identifies what kind of resource this is. Value: the fixed
  6922. // string "dfareporting#inventoryItemsListResponse".
  6923. Kind string `json:"kind,omitempty"`
  6924. // NextPageToken: Pagination token to be used for the next list
  6925. // operation.
  6926. NextPageToken string `json:"nextPageToken,omitempty"`
  6927. // ServerResponse contains the HTTP response code and headers from the
  6928. // server.
  6929. googleapi.ServerResponse `json:"-"`
  6930. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  6931. // unconditionally include in API requests. By default, fields with
  6932. // empty values are omitted from API requests. However, any non-pointer,
  6933. // non-interface field appearing in ForceSendFields will be sent to the
  6934. // server regardless of whether the field is empty or not. This may be
  6935. // used to include empty fields in Patch requests.
  6936. ForceSendFields []string `json:"-"`
  6937. // NullFields is a list of field names (e.g. "InventoryItems") to
  6938. // include in API requests with the JSON null value. By default, fields
  6939. // with empty values are omitted from API requests. However, any field
  6940. // with an empty value appearing in NullFields will be sent to the
  6941. // server as null. It is an error if a field in this list has a
  6942. // non-empty value. This may be used to include null fields in Patch
  6943. // requests.
  6944. NullFields []string `json:"-"`
  6945. }
  6946. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  6947. type NoMethod InventoryItemsListResponse
  6948. raw := NoMethod(*s)
  6949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6950. }
  6951. // KeyValueTargetingExpression: Key Value Targeting Expression.
  6952. type KeyValueTargetingExpression struct {
  6953. // Expression: Keyword expression being targeted by the ad.
  6954. Expression string `json:"expression,omitempty"`
  6955. // ForceSendFields is a list of field names (e.g. "Expression") to
  6956. // unconditionally include in API requests. By default, fields with
  6957. // empty values are omitted from API requests. However, any non-pointer,
  6958. // non-interface field appearing in ForceSendFields will be sent to the
  6959. // server regardless of whether the field is empty or not. This may be
  6960. // used to include empty fields in Patch requests.
  6961. ForceSendFields []string `json:"-"`
  6962. // NullFields is a list of field names (e.g. "Expression") to include in
  6963. // API requests with the JSON null value. By default, fields with empty
  6964. // values are omitted from API requests. However, any field with an
  6965. // empty value appearing in NullFields will be sent to the server as
  6966. // null. It is an error if a field in this list has a non-empty value.
  6967. // This may be used to include null fields in Patch requests.
  6968. NullFields []string `json:"-"`
  6969. }
  6970. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  6971. type NoMethod KeyValueTargetingExpression
  6972. raw := NoMethod(*s)
  6973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6974. }
  6975. // LandingPage: Contains information about where a user's browser is
  6976. // taken after the user clicks an ad.
  6977. type LandingPage struct {
  6978. // AdvertiserId: Advertiser ID of this landing page. This is a required
  6979. // field.
  6980. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6981. // Archived: Whether this landing page has been archived.
  6982. Archived bool `json:"archived,omitempty"`
  6983. // DeepLinks: Links that will direct the user to a mobile app, if
  6984. // installed.
  6985. DeepLinks []*DeepLink `json:"deepLinks,omitempty"`
  6986. // Id: ID of this landing page. This is a read-only, auto-generated
  6987. // field.
  6988. Id int64 `json:"id,omitempty,string"`
  6989. // Kind: Identifies what kind of resource this is. Value: the fixed
  6990. // string "dfareporting#landingPage".
  6991. Kind string `json:"kind,omitempty"`
  6992. // Name: Name of this landing page. This is a required field. It must be
  6993. // less than 256 characters long.
  6994. Name string `json:"name,omitempty"`
  6995. // Url: URL of this landing page. This is a required field.
  6996. Url string `json:"url,omitempty"`
  6997. // ServerResponse contains the HTTP response code and headers from the
  6998. // server.
  6999. googleapi.ServerResponse `json:"-"`
  7000. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  7001. // unconditionally include in API requests. By default, fields with
  7002. // empty values are omitted from API requests. However, any non-pointer,
  7003. // non-interface field appearing in ForceSendFields will be sent to the
  7004. // server regardless of whether the field is empty or not. This may be
  7005. // used to include empty fields in Patch requests.
  7006. ForceSendFields []string `json:"-"`
  7007. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  7008. // in API requests with the JSON null value. By default, fields with
  7009. // empty values are omitted from API requests. However, any field with
  7010. // an empty value appearing in NullFields will be sent to the server as
  7011. // null. It is an error if a field in this list has a non-empty value.
  7012. // This may be used to include null fields in Patch requests.
  7013. NullFields []string `json:"-"`
  7014. }
  7015. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  7016. type NoMethod LandingPage
  7017. raw := NoMethod(*s)
  7018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7019. }
  7020. // Language: Contains information about a language that can be targeted
  7021. // by ads.
  7022. type Language struct {
  7023. // Id: Language ID of this language. This is the ID used for targeting
  7024. // and generating reports.
  7025. Id int64 `json:"id,omitempty,string"`
  7026. // Kind: Identifies what kind of resource this is. Value: the fixed
  7027. // string "dfareporting#language".
  7028. Kind string `json:"kind,omitempty"`
  7029. // LanguageCode: Format of language code is an ISO 639 two-letter
  7030. // language code optionally followed by an underscore followed by an ISO
  7031. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  7032. // Chinese.
  7033. LanguageCode string `json:"languageCode,omitempty"`
  7034. // Name: Name of this language.
  7035. Name string `json:"name,omitempty"`
  7036. // ForceSendFields is a list of field names (e.g. "Id") to
  7037. // unconditionally include in API requests. By default, fields with
  7038. // empty values are omitted from API requests. However, any non-pointer,
  7039. // non-interface field appearing in ForceSendFields will be sent to the
  7040. // server regardless of whether the field is empty or not. This may be
  7041. // used to include empty fields in Patch requests.
  7042. ForceSendFields []string `json:"-"`
  7043. // NullFields is a list of field names (e.g. "Id") to include in API
  7044. // requests with the JSON null value. By default, fields with empty
  7045. // values are omitted from API requests. However, any field with an
  7046. // empty value appearing in NullFields will be sent to the server as
  7047. // null. It is an error if a field in this list has a non-empty value.
  7048. // This may be used to include null fields in Patch requests.
  7049. NullFields []string `json:"-"`
  7050. }
  7051. func (s *Language) MarshalJSON() ([]byte, error) {
  7052. type NoMethod Language
  7053. raw := NoMethod(*s)
  7054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7055. }
  7056. // LanguageTargeting: Language Targeting.
  7057. type LanguageTargeting struct {
  7058. // Languages: Languages that this ad targets. For each language only
  7059. // languageId is required. The other fields are populated automatically
  7060. // when the ad is inserted or updated.
  7061. Languages []*Language `json:"languages,omitempty"`
  7062. // ForceSendFields is a list of field names (e.g. "Languages") to
  7063. // unconditionally include in API requests. By default, fields with
  7064. // empty values are omitted from API requests. However, any non-pointer,
  7065. // non-interface field appearing in ForceSendFields will be sent to the
  7066. // server regardless of whether the field is empty or not. This may be
  7067. // used to include empty fields in Patch requests.
  7068. ForceSendFields []string `json:"-"`
  7069. // NullFields is a list of field names (e.g. "Languages") to include in
  7070. // API requests with the JSON null value. By default, fields with empty
  7071. // values are omitted from API requests. However, any field with an
  7072. // empty value appearing in NullFields will be sent to the server as
  7073. // null. It is an error if a field in this list has a non-empty value.
  7074. // This may be used to include null fields in Patch requests.
  7075. NullFields []string `json:"-"`
  7076. }
  7077. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  7078. type NoMethod LanguageTargeting
  7079. raw := NoMethod(*s)
  7080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7081. }
  7082. // LanguagesListResponse: Language List Response
  7083. type LanguagesListResponse struct {
  7084. // Kind: Identifies what kind of resource this is. Value: the fixed
  7085. // string "dfareporting#languagesListResponse".
  7086. Kind string `json:"kind,omitempty"`
  7087. // Languages: Language collection.
  7088. Languages []*Language `json:"languages,omitempty"`
  7089. // ServerResponse contains the HTTP response code and headers from the
  7090. // server.
  7091. googleapi.ServerResponse `json:"-"`
  7092. // ForceSendFields is a list of field names (e.g. "Kind") to
  7093. // unconditionally include in API requests. By default, fields with
  7094. // empty values are omitted from API requests. However, any non-pointer,
  7095. // non-interface field appearing in ForceSendFields will be sent to the
  7096. // server regardless of whether the field is empty or not. This may be
  7097. // used to include empty fields in Patch requests.
  7098. ForceSendFields []string `json:"-"`
  7099. // NullFields is a list of field names (e.g. "Kind") to include in API
  7100. // requests with the JSON null value. By default, fields with empty
  7101. // values are omitted from API requests. However, any field with an
  7102. // empty value appearing in NullFields will be sent to the server as
  7103. // null. It is an error if a field in this list has a non-empty value.
  7104. // This may be used to include null fields in Patch requests.
  7105. NullFields []string `json:"-"`
  7106. }
  7107. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  7108. type NoMethod LanguagesListResponse
  7109. raw := NoMethod(*s)
  7110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7111. }
  7112. // LastModifiedInfo: Modification timestamp.
  7113. type LastModifiedInfo struct {
  7114. // Time: Timestamp of the last change in milliseconds since epoch.
  7115. Time int64 `json:"time,omitempty,string"`
  7116. // ForceSendFields is a list of field names (e.g. "Time") to
  7117. // unconditionally include in API requests. By default, fields with
  7118. // empty values are omitted from API requests. However, any non-pointer,
  7119. // non-interface field appearing in ForceSendFields will be sent to the
  7120. // server regardless of whether the field is empty or not. This may be
  7121. // used to include empty fields in Patch requests.
  7122. ForceSendFields []string `json:"-"`
  7123. // NullFields is a list of field names (e.g. "Time") to include in API
  7124. // requests with the JSON null value. By default, fields with empty
  7125. // values are omitted from API requests. However, any field with an
  7126. // empty value appearing in NullFields will be sent to the server as
  7127. // null. It is an error if a field in this list has a non-empty value.
  7128. // This may be used to include null fields in Patch requests.
  7129. NullFields []string `json:"-"`
  7130. }
  7131. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  7132. type NoMethod LastModifiedInfo
  7133. raw := NoMethod(*s)
  7134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7135. }
  7136. // ListPopulationClause: A group clause made up of list population terms
  7137. // representing constraints joined by ORs.
  7138. type ListPopulationClause struct {
  7139. // Terms: Terms of this list population clause. Each clause is made up
  7140. // of list population terms representing constraints and are joined by
  7141. // ORs.
  7142. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  7143. // ForceSendFields is a list of field names (e.g. "Terms") to
  7144. // unconditionally include in API requests. By default, fields with
  7145. // empty values are omitted from API requests. However, any non-pointer,
  7146. // non-interface field appearing in ForceSendFields will be sent to the
  7147. // server regardless of whether the field is empty or not. This may be
  7148. // used to include empty fields in Patch requests.
  7149. ForceSendFields []string `json:"-"`
  7150. // NullFields is a list of field names (e.g. "Terms") to include in API
  7151. // requests with the JSON null value. By default, fields with empty
  7152. // values are omitted from API requests. However, any field with an
  7153. // empty value appearing in NullFields will be sent to the server as
  7154. // null. It is an error if a field in this list has a non-empty value.
  7155. // This may be used to include null fields in Patch requests.
  7156. NullFields []string `json:"-"`
  7157. }
  7158. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7159. type NoMethod ListPopulationClause
  7160. raw := NoMethod(*s)
  7161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7162. }
  7163. // ListPopulationRule: Remarketing List Population Rule.
  7164. type ListPopulationRule struct {
  7165. // FloodlightActivityId: Floodlight activity ID associated with this
  7166. // rule. This field can be left blank.
  7167. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7168. // FloodlightActivityName: Name of floodlight activity associated with
  7169. // this rule. This is a read-only, auto-generated field.
  7170. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7171. // ListPopulationClauses: Clauses that make up this list population
  7172. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7173. // up of list population terms which are joined by ORs.
  7174. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7175. // ForceSendFields is a list of field names (e.g.
  7176. // "FloodlightActivityId") to unconditionally include in API requests.
  7177. // By default, fields with empty values are omitted from API requests.
  7178. // However, any non-pointer, non-interface field appearing in
  7179. // ForceSendFields will be sent to the server regardless of whether the
  7180. // field is empty or not. This may be used to include empty fields in
  7181. // Patch requests.
  7182. ForceSendFields []string `json:"-"`
  7183. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7184. // include in API requests with the JSON null value. By default, fields
  7185. // with empty values are omitted from API requests. However, any field
  7186. // with an empty value appearing in NullFields will be sent to the
  7187. // server as null. It is an error if a field in this list has a
  7188. // non-empty value. This may be used to include null fields in Patch
  7189. // requests.
  7190. NullFields []string `json:"-"`
  7191. }
  7192. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7193. type NoMethod ListPopulationRule
  7194. raw := NoMethod(*s)
  7195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7196. }
  7197. // ListPopulationTerm: Remarketing List Population Rule Term.
  7198. type ListPopulationTerm struct {
  7199. // Contains: Will be true if the term should check if the user is in the
  7200. // list and false if the term should check if the user is not in the
  7201. // list. This field is only relevant when type is set to
  7202. // LIST_MEMBERSHIP_TERM. False by default.
  7203. Contains bool `json:"contains,omitempty"`
  7204. // Negation: Whether to negate the comparison result of this term during
  7205. // rule evaluation. This field is only relevant when type is left unset
  7206. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7207. Negation bool `json:"negation,omitempty"`
  7208. // Operator: Comparison operator of this term. This field is only
  7209. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7210. // REFERRER_TERM.
  7211. //
  7212. // Possible values:
  7213. // "NUM_EQUALS"
  7214. // "NUM_GREATER_THAN"
  7215. // "NUM_GREATER_THAN_EQUAL"
  7216. // "NUM_LESS_THAN"
  7217. // "NUM_LESS_THAN_EQUAL"
  7218. // "STRING_CONTAINS"
  7219. // "STRING_EQUALS"
  7220. Operator string `json:"operator,omitempty"`
  7221. // RemarketingListId: ID of the list in question. This field is only
  7222. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7223. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7224. // Type: List population term type determines the applicable fields in
  7225. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7226. // variableName, variableFriendlyName, operator, value, and negation are
  7227. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7228. // contains are applicable. If set to REFERRER_TERM then operator,
  7229. // value, and negation are applicable.
  7230. //
  7231. // Possible values:
  7232. // "CUSTOM_VARIABLE_TERM"
  7233. // "LIST_MEMBERSHIP_TERM"
  7234. // "REFERRER_TERM"
  7235. Type string `json:"type,omitempty"`
  7236. // Value: Literal to compare the variable to. This field is only
  7237. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7238. // REFERRER_TERM.
  7239. Value string `json:"value,omitempty"`
  7240. // VariableFriendlyName: Friendly name of this term's variable. This is
  7241. // a read-only, auto-generated field. This field is only relevant when
  7242. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7243. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7244. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7245. // this term. This field is only relevant when type is set to null,
  7246. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7247. VariableName string `json:"variableName,omitempty"`
  7248. // ForceSendFields is a list of field names (e.g. "Contains") to
  7249. // unconditionally include in API requests. By default, fields with
  7250. // empty values are omitted from API requests. However, any non-pointer,
  7251. // non-interface field appearing in ForceSendFields will be sent to the
  7252. // server regardless of whether the field is empty or not. This may be
  7253. // used to include empty fields in Patch requests.
  7254. ForceSendFields []string `json:"-"`
  7255. // NullFields is a list of field names (e.g. "Contains") to include in
  7256. // API requests with the JSON null value. By default, fields with empty
  7257. // values are omitted from API requests. However, any field with an
  7258. // empty value appearing in NullFields will be sent to the server as
  7259. // null. It is an error if a field in this list has a non-empty value.
  7260. // This may be used to include null fields in Patch requests.
  7261. NullFields []string `json:"-"`
  7262. }
  7263. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7264. type NoMethod ListPopulationTerm
  7265. raw := NoMethod(*s)
  7266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7267. }
  7268. // ListTargetingExpression: Remarketing List Targeting Expression.
  7269. type ListTargetingExpression struct {
  7270. // Expression: Expression describing which lists are being targeted by
  7271. // the ad.
  7272. Expression string `json:"expression,omitempty"`
  7273. // ForceSendFields is a list of field names (e.g. "Expression") to
  7274. // unconditionally include in API requests. By default, fields with
  7275. // empty values are omitted from API requests. However, any non-pointer,
  7276. // non-interface field appearing in ForceSendFields will be sent to the
  7277. // server regardless of whether the field is empty or not. This may be
  7278. // used to include empty fields in Patch requests.
  7279. ForceSendFields []string `json:"-"`
  7280. // NullFields is a list of field names (e.g. "Expression") to include in
  7281. // API requests with the JSON null value. By default, fields with empty
  7282. // values are omitted from API requests. However, any field with an
  7283. // empty value appearing in NullFields will be sent to the server as
  7284. // null. It is an error if a field in this list has a non-empty value.
  7285. // This may be used to include null fields in Patch requests.
  7286. NullFields []string `json:"-"`
  7287. }
  7288. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7289. type NoMethod ListTargetingExpression
  7290. raw := NoMethod(*s)
  7291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7292. }
  7293. // LookbackConfiguration: Lookback configuration settings.
  7294. type LookbackConfiguration struct {
  7295. // ClickDuration: Lookback window, in days, from the last time a given
  7296. // user clicked on one of your ads. If you enter 0, clicks will not be
  7297. // considered as triggering events for floodlight tracking. If you leave
  7298. // this field blank, the default value for your account will be used.
  7299. // Acceptable values are 0 to 90, inclusive.
  7300. ClickDuration int64 `json:"clickDuration,omitempty"`
  7301. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7302. // last time a given user viewed one of your ads. If you enter 0,
  7303. // impressions will not be considered as triggering events for
  7304. // floodlight tracking. If you leave this field blank, the default value
  7305. // for your account will be used. Acceptable values are 0 to 90,
  7306. // inclusive.
  7307. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7308. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7309. // unconditionally include in API requests. By default, fields with
  7310. // empty values are omitted from API requests. However, any non-pointer,
  7311. // non-interface field appearing in ForceSendFields will be sent to the
  7312. // server regardless of whether the field is empty or not. This may be
  7313. // used to include empty fields in Patch requests.
  7314. ForceSendFields []string `json:"-"`
  7315. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7316. // in API requests with the JSON null value. By default, fields with
  7317. // empty values are omitted from API requests. However, any field with
  7318. // an empty value appearing in NullFields will be sent to the server as
  7319. // null. It is an error if a field in this list has a non-empty value.
  7320. // This may be used to include null fields in Patch requests.
  7321. NullFields []string `json:"-"`
  7322. }
  7323. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7324. type NoMethod LookbackConfiguration
  7325. raw := NoMethod(*s)
  7326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7327. }
  7328. // Metric: Represents a metric.
  7329. type Metric struct {
  7330. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7331. Kind string `json:"kind,omitempty"`
  7332. // Name: The metric name, e.g. dfa:impressions
  7333. Name string `json:"name,omitempty"`
  7334. // ForceSendFields is a list of field names (e.g. "Kind") to
  7335. // unconditionally include in API requests. By default, fields with
  7336. // empty values are omitted from API requests. However, any non-pointer,
  7337. // non-interface field appearing in ForceSendFields will be sent to the
  7338. // server regardless of whether the field is empty or not. This may be
  7339. // used to include empty fields in Patch requests.
  7340. ForceSendFields []string `json:"-"`
  7341. // NullFields is a list of field names (e.g. "Kind") to include in API
  7342. // requests with the JSON null value. By default, fields with empty
  7343. // values are omitted from API requests. However, any field with an
  7344. // empty value appearing in NullFields will be sent to the server as
  7345. // null. It is an error if a field in this list has a non-empty value.
  7346. // This may be used to include null fields in Patch requests.
  7347. NullFields []string `json:"-"`
  7348. }
  7349. func (s *Metric) MarshalJSON() ([]byte, error) {
  7350. type NoMethod Metric
  7351. raw := NoMethod(*s)
  7352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7353. }
  7354. // Metro: Contains information about a metro region that can be targeted
  7355. // by ads.
  7356. type Metro struct {
  7357. // CountryCode: Country code of the country to which this metro region
  7358. // belongs.
  7359. CountryCode string `json:"countryCode,omitempty"`
  7360. // CountryDartId: DART ID of the country to which this metro region
  7361. // belongs.
  7362. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7363. // DartId: DART ID of this metro region.
  7364. DartId int64 `json:"dartId,omitempty,string"`
  7365. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7366. // and generating reports, and is equivalent to metro_code.
  7367. DmaId int64 `json:"dmaId,omitempty,string"`
  7368. // Kind: Identifies what kind of resource this is. Value: the fixed
  7369. // string "dfareporting#metro".
  7370. Kind string `json:"kind,omitempty"`
  7371. // MetroCode: Metro code of this metro region. This is equivalent to
  7372. // dma_id.
  7373. MetroCode string `json:"metroCode,omitempty"`
  7374. // Name: Name of this metro region.
  7375. Name string `json:"name,omitempty"`
  7376. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7377. // unconditionally include in API requests. By default, fields with
  7378. // empty values are omitted from API requests. However, any non-pointer,
  7379. // non-interface field appearing in ForceSendFields will be sent to the
  7380. // server regardless of whether the field is empty or not. This may be
  7381. // used to include empty fields in Patch requests.
  7382. ForceSendFields []string `json:"-"`
  7383. // NullFields is a list of field names (e.g. "CountryCode") to include
  7384. // in API requests with the JSON null value. By default, fields with
  7385. // empty values are omitted from API requests. However, any field with
  7386. // an empty value appearing in NullFields will be sent to the server as
  7387. // null. It is an error if a field in this list has a non-empty value.
  7388. // This may be used to include null fields in Patch requests.
  7389. NullFields []string `json:"-"`
  7390. }
  7391. func (s *Metro) MarshalJSON() ([]byte, error) {
  7392. type NoMethod Metro
  7393. raw := NoMethod(*s)
  7394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7395. }
  7396. // MetrosListResponse: Metro List Response
  7397. type MetrosListResponse struct {
  7398. // Kind: Identifies what kind of resource this is. Value: the fixed
  7399. // string "dfareporting#metrosListResponse".
  7400. Kind string `json:"kind,omitempty"`
  7401. // Metros: Metro collection.
  7402. Metros []*Metro `json:"metros,omitempty"`
  7403. // ServerResponse contains the HTTP response code and headers from the
  7404. // server.
  7405. googleapi.ServerResponse `json:"-"`
  7406. // ForceSendFields is a list of field names (e.g. "Kind") to
  7407. // unconditionally include in API requests. By default, fields with
  7408. // empty values are omitted from API requests. However, any non-pointer,
  7409. // non-interface field appearing in ForceSendFields will be sent to the
  7410. // server regardless of whether the field is empty or not. This may be
  7411. // used to include empty fields in Patch requests.
  7412. ForceSendFields []string `json:"-"`
  7413. // NullFields is a list of field names (e.g. "Kind") to include in API
  7414. // requests with the JSON null value. By default, fields with empty
  7415. // values are omitted from API requests. However, any field with an
  7416. // empty value appearing in NullFields will be sent to the server as
  7417. // null. It is an error if a field in this list has a non-empty value.
  7418. // This may be used to include null fields in Patch requests.
  7419. NullFields []string `json:"-"`
  7420. }
  7421. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7422. type NoMethod MetrosListResponse
  7423. raw := NoMethod(*s)
  7424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7425. }
  7426. // MobileApp: Contains information about a mobile app. Used as a landing
  7427. // page deep link.
  7428. type MobileApp struct {
  7429. // Directory: Mobile app directory.
  7430. //
  7431. // Possible values:
  7432. // "APPLE_APP_STORE"
  7433. // "GOOGLE_PLAY_STORE"
  7434. // "UNKNOWN"
  7435. Directory string `json:"directory,omitempty"`
  7436. // Id: ID of this mobile app.
  7437. Id string `json:"id,omitempty"`
  7438. // Kind: Identifies what kind of resource this is. Value: the fixed
  7439. // string "dfareporting#mobileApp".
  7440. Kind string `json:"kind,omitempty"`
  7441. // PublisherName: Publisher name.
  7442. PublisherName string `json:"publisherName,omitempty"`
  7443. // Title: Title of this mobile app.
  7444. Title string `json:"title,omitempty"`
  7445. // ServerResponse contains the HTTP response code and headers from the
  7446. // server.
  7447. googleapi.ServerResponse `json:"-"`
  7448. // ForceSendFields is a list of field names (e.g. "Directory") to
  7449. // unconditionally include in API requests. By default, fields with
  7450. // empty values are omitted from API requests. However, any non-pointer,
  7451. // non-interface field appearing in ForceSendFields will be sent to the
  7452. // server regardless of whether the field is empty or not. This may be
  7453. // used to include empty fields in Patch requests.
  7454. ForceSendFields []string `json:"-"`
  7455. // NullFields is a list of field names (e.g. "Directory") to include in
  7456. // API requests with the JSON null value. By default, fields with empty
  7457. // values are omitted from API requests. However, any field with an
  7458. // empty value appearing in NullFields will be sent to the server as
  7459. // null. It is an error if a field in this list has a non-empty value.
  7460. // This may be used to include null fields in Patch requests.
  7461. NullFields []string `json:"-"`
  7462. }
  7463. func (s *MobileApp) MarshalJSON() ([]byte, error) {
  7464. type NoMethod MobileApp
  7465. raw := NoMethod(*s)
  7466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7467. }
  7468. // MobileAppsListResponse: Mobile app List Response
  7469. type MobileAppsListResponse struct {
  7470. // Kind: Identifies what kind of resource this is. Value: the fixed
  7471. // string "dfareporting#mobileAppsListResponse".
  7472. Kind string `json:"kind,omitempty"`
  7473. // MobileApps: Mobile apps collection.
  7474. MobileApps []*MobileApp `json:"mobileApps,omitempty"`
  7475. // NextPageToken: Pagination token to be used for the next list
  7476. // operation.
  7477. NextPageToken string `json:"nextPageToken,omitempty"`
  7478. // ServerResponse contains the HTTP response code and headers from the
  7479. // server.
  7480. googleapi.ServerResponse `json:"-"`
  7481. // ForceSendFields is a list of field names (e.g. "Kind") to
  7482. // unconditionally include in API requests. By default, fields with
  7483. // empty values are omitted from API requests. However, any non-pointer,
  7484. // non-interface field appearing in ForceSendFields will be sent to the
  7485. // server regardless of whether the field is empty or not. This may be
  7486. // used to include empty fields in Patch requests.
  7487. ForceSendFields []string `json:"-"`
  7488. // NullFields is a list of field names (e.g. "Kind") to include in API
  7489. // requests with the JSON null value. By default, fields with empty
  7490. // values are omitted from API requests. However, any field with an
  7491. // empty value appearing in NullFields will be sent to the server as
  7492. // null. It is an error if a field in this list has a non-empty value.
  7493. // This may be used to include null fields in Patch requests.
  7494. NullFields []string `json:"-"`
  7495. }
  7496. func (s *MobileAppsListResponse) MarshalJSON() ([]byte, error) {
  7497. type NoMethod MobileAppsListResponse
  7498. raw := NoMethod(*s)
  7499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7500. }
  7501. // MobileCarrier: Contains information about a mobile carrier that can
  7502. // be targeted by ads.
  7503. type MobileCarrier struct {
  7504. // CountryCode: Country code of the country to which this mobile carrier
  7505. // belongs.
  7506. CountryCode string `json:"countryCode,omitempty"`
  7507. // CountryDartId: DART ID of the country to which this mobile carrier
  7508. // belongs.
  7509. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7510. // Id: ID of this mobile carrier.
  7511. Id int64 `json:"id,omitempty,string"`
  7512. // Kind: Identifies what kind of resource this is. Value: the fixed
  7513. // string "dfareporting#mobileCarrier".
  7514. Kind string `json:"kind,omitempty"`
  7515. // Name: Name of this mobile carrier.
  7516. Name string `json:"name,omitempty"`
  7517. // ServerResponse contains the HTTP response code and headers from the
  7518. // server.
  7519. googleapi.ServerResponse `json:"-"`
  7520. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7521. // unconditionally include in API requests. By default, fields with
  7522. // empty values are omitted from API requests. However, any non-pointer,
  7523. // non-interface field appearing in ForceSendFields will be sent to the
  7524. // server regardless of whether the field is empty or not. This may be
  7525. // used to include empty fields in Patch requests.
  7526. ForceSendFields []string `json:"-"`
  7527. // NullFields is a list of field names (e.g. "CountryCode") to include
  7528. // in API requests with the JSON null value. By default, fields with
  7529. // empty values are omitted from API requests. However, any field with
  7530. // an empty value appearing in NullFields will be sent to the server as
  7531. // null. It is an error if a field in this list has a non-empty value.
  7532. // This may be used to include null fields in Patch requests.
  7533. NullFields []string `json:"-"`
  7534. }
  7535. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7536. type NoMethod MobileCarrier
  7537. raw := NoMethod(*s)
  7538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7539. }
  7540. // MobileCarriersListResponse: Mobile Carrier List Response
  7541. type MobileCarriersListResponse struct {
  7542. // Kind: Identifies what kind of resource this is. Value: the fixed
  7543. // string "dfareporting#mobileCarriersListResponse".
  7544. Kind string `json:"kind,omitempty"`
  7545. // MobileCarriers: Mobile carrier collection.
  7546. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7547. // ServerResponse contains the HTTP response code and headers from the
  7548. // server.
  7549. googleapi.ServerResponse `json:"-"`
  7550. // ForceSendFields is a list of field names (e.g. "Kind") to
  7551. // unconditionally include in API requests. By default, fields with
  7552. // empty values are omitted from API requests. However, any non-pointer,
  7553. // non-interface field appearing in ForceSendFields will be sent to the
  7554. // server regardless of whether the field is empty or not. This may be
  7555. // used to include empty fields in Patch requests.
  7556. ForceSendFields []string `json:"-"`
  7557. // NullFields is a list of field names (e.g. "Kind") to include in API
  7558. // requests with the JSON null value. By default, fields with empty
  7559. // values are omitted from API requests. However, any field with an
  7560. // empty value appearing in NullFields will be sent to the server as
  7561. // null. It is an error if a field in this list has a non-empty value.
  7562. // This may be used to include null fields in Patch requests.
  7563. NullFields []string `json:"-"`
  7564. }
  7565. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7566. type NoMethod MobileCarriersListResponse
  7567. raw := NoMethod(*s)
  7568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7569. }
  7570. // ObjectFilter: Object Filter.
  7571. type ObjectFilter struct {
  7572. // Kind: Identifies what kind of resource this is. Value: the fixed
  7573. // string "dfareporting#objectFilter".
  7574. Kind string `json:"kind,omitempty"`
  7575. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7576. // objects with these object IDs.
  7577. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7578. // Status: Status of the filter. NONE means the user has access to none
  7579. // of the objects. ALL means the user has access to all objects.
  7580. // ASSIGNED means the user has access to the objects with IDs in the
  7581. // objectIds list.
  7582. //
  7583. // Possible values:
  7584. // "ALL"
  7585. // "ASSIGNED"
  7586. // "NONE"
  7587. Status string `json:"status,omitempty"`
  7588. // ForceSendFields is a list of field names (e.g. "Kind") to
  7589. // unconditionally include in API requests. By default, fields with
  7590. // empty values are omitted from API requests. However, any non-pointer,
  7591. // non-interface field appearing in ForceSendFields will be sent to the
  7592. // server regardless of whether the field is empty or not. This may be
  7593. // used to include empty fields in Patch requests.
  7594. ForceSendFields []string `json:"-"`
  7595. // NullFields is a list of field names (e.g. "Kind") to include in API
  7596. // requests with the JSON null value. By default, fields with empty
  7597. // values are omitted from API requests. However, any field with an
  7598. // empty value appearing in NullFields will be sent to the server as
  7599. // null. It is an error if a field in this list has a non-empty value.
  7600. // This may be used to include null fields in Patch requests.
  7601. NullFields []string `json:"-"`
  7602. }
  7603. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7604. type NoMethod ObjectFilter
  7605. raw := NoMethod(*s)
  7606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7607. }
  7608. // OffsetPosition: Offset Position.
  7609. type OffsetPosition struct {
  7610. // Left: Offset distance from left side of an asset or a window.
  7611. Left int64 `json:"left,omitempty"`
  7612. // Top: Offset distance from top side of an asset or a window.
  7613. Top int64 `json:"top,omitempty"`
  7614. // ForceSendFields is a list of field names (e.g. "Left") to
  7615. // unconditionally include in API requests. By default, fields with
  7616. // empty values are omitted from API requests. However, any non-pointer,
  7617. // non-interface field appearing in ForceSendFields will be sent to the
  7618. // server regardless of whether the field is empty or not. This may be
  7619. // used to include empty fields in Patch requests.
  7620. ForceSendFields []string `json:"-"`
  7621. // NullFields is a list of field names (e.g. "Left") to include in API
  7622. // requests with the JSON null value. By default, fields with empty
  7623. // values are omitted from API requests. However, any field with an
  7624. // empty value appearing in NullFields will be sent to the server as
  7625. // null. It is an error if a field in this list has a non-empty value.
  7626. // This may be used to include null fields in Patch requests.
  7627. NullFields []string `json:"-"`
  7628. }
  7629. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7630. type NoMethod OffsetPosition
  7631. raw := NoMethod(*s)
  7632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7633. }
  7634. // OmnitureSettings: Omniture Integration Settings.
  7635. type OmnitureSettings struct {
  7636. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7637. // Omniture. This property can be enabled only if
  7638. // omnitureIntegrationEnabled is true.
  7639. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7640. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7641. // This property can be enabled only when the "Advanced Ad Serving"
  7642. // account setting is enabled.
  7643. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7644. // ForceSendFields is a list of field names (e.g.
  7645. // "OmnitureCostDataEnabled") to unconditionally include in API
  7646. // requests. By default, fields with empty values are omitted from API
  7647. // requests. However, any non-pointer, non-interface field appearing in
  7648. // ForceSendFields will be sent to the server regardless of whether the
  7649. // field is empty or not. This may be used to include empty fields in
  7650. // Patch requests.
  7651. ForceSendFields []string `json:"-"`
  7652. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7653. // to include in API requests with the JSON null value. By default,
  7654. // fields with empty values are omitted from API requests. However, any
  7655. // field with an empty value appearing in NullFields will be sent to the
  7656. // server as null. It is an error if a field in this list has a
  7657. // non-empty value. This may be used to include null fields in Patch
  7658. // requests.
  7659. NullFields []string `json:"-"`
  7660. }
  7661. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7662. type NoMethod OmnitureSettings
  7663. raw := NoMethod(*s)
  7664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7665. }
  7666. // OperatingSystem: Contains information about an operating system that
  7667. // can be targeted by ads.
  7668. type OperatingSystem struct {
  7669. // DartId: DART ID of this operating system. This is the ID used for
  7670. // targeting.
  7671. DartId int64 `json:"dartId,omitempty,string"`
  7672. // Desktop: Whether this operating system is for desktop.
  7673. Desktop bool `json:"desktop,omitempty"`
  7674. // Kind: Identifies what kind of resource this is. Value: the fixed
  7675. // string "dfareporting#operatingSystem".
  7676. Kind string `json:"kind,omitempty"`
  7677. // Mobile: Whether this operating system is for mobile.
  7678. Mobile bool `json:"mobile,omitempty"`
  7679. // Name: Name of this operating system.
  7680. Name string `json:"name,omitempty"`
  7681. // ServerResponse contains the HTTP response code and headers from the
  7682. // server.
  7683. googleapi.ServerResponse `json:"-"`
  7684. // ForceSendFields is a list of field names (e.g. "DartId") to
  7685. // unconditionally include in API requests. By default, fields with
  7686. // empty values are omitted from API requests. However, any non-pointer,
  7687. // non-interface field appearing in ForceSendFields will be sent to the
  7688. // server regardless of whether the field is empty or not. This may be
  7689. // used to include empty fields in Patch requests.
  7690. ForceSendFields []string `json:"-"`
  7691. // NullFields is a list of field names (e.g. "DartId") to include in API
  7692. // requests with the JSON null value. By default, fields with empty
  7693. // values are omitted from API requests. However, any field with an
  7694. // empty value appearing in NullFields will be sent to the server as
  7695. // null. It is an error if a field in this list has a non-empty value.
  7696. // This may be used to include null fields in Patch requests.
  7697. NullFields []string `json:"-"`
  7698. }
  7699. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7700. type NoMethod OperatingSystem
  7701. raw := NoMethod(*s)
  7702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7703. }
  7704. // OperatingSystemVersion: Contains information about a particular
  7705. // version of an operating system that can be targeted by ads.
  7706. type OperatingSystemVersion struct {
  7707. // Id: ID of this operating system version.
  7708. Id int64 `json:"id,omitempty,string"`
  7709. // Kind: Identifies what kind of resource this is. Value: the fixed
  7710. // string "dfareporting#operatingSystemVersion".
  7711. Kind string `json:"kind,omitempty"`
  7712. // MajorVersion: Major version (leftmost number) of this operating
  7713. // system version.
  7714. MajorVersion string `json:"majorVersion,omitempty"`
  7715. // MinorVersion: Minor version (number after the first dot) of this
  7716. // operating system version.
  7717. MinorVersion string `json:"minorVersion,omitempty"`
  7718. // Name: Name of this operating system version.
  7719. Name string `json:"name,omitempty"`
  7720. // OperatingSystem: Operating system of this operating system version.
  7721. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7722. // ServerResponse contains the HTTP response code and headers from the
  7723. // server.
  7724. googleapi.ServerResponse `json:"-"`
  7725. // ForceSendFields is a list of field names (e.g. "Id") to
  7726. // unconditionally include in API requests. By default, fields with
  7727. // empty values are omitted from API requests. However, any non-pointer,
  7728. // non-interface field appearing in ForceSendFields will be sent to the
  7729. // server regardless of whether the field is empty or not. This may be
  7730. // used to include empty fields in Patch requests.
  7731. ForceSendFields []string `json:"-"`
  7732. // NullFields is a list of field names (e.g. "Id") to include in API
  7733. // requests with the JSON null value. By default, fields with empty
  7734. // values are omitted from API requests. However, any field with an
  7735. // empty value appearing in NullFields will be sent to the server as
  7736. // null. It is an error if a field in this list has a non-empty value.
  7737. // This may be used to include null fields in Patch requests.
  7738. NullFields []string `json:"-"`
  7739. }
  7740. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7741. type NoMethod OperatingSystemVersion
  7742. raw := NoMethod(*s)
  7743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7744. }
  7745. // OperatingSystemVersionsListResponse: Operating System Version List
  7746. // Response
  7747. type OperatingSystemVersionsListResponse struct {
  7748. // Kind: Identifies what kind of resource this is. Value: the fixed
  7749. // string "dfareporting#operatingSystemVersionsListResponse".
  7750. Kind string `json:"kind,omitempty"`
  7751. // OperatingSystemVersions: Operating system version collection.
  7752. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7753. // ServerResponse contains the HTTP response code and headers from the
  7754. // server.
  7755. googleapi.ServerResponse `json:"-"`
  7756. // ForceSendFields is a list of field names (e.g. "Kind") to
  7757. // unconditionally include in API requests. By default, fields with
  7758. // empty values are omitted from API requests. However, any non-pointer,
  7759. // non-interface field appearing in ForceSendFields will be sent to the
  7760. // server regardless of whether the field is empty or not. This may be
  7761. // used to include empty fields in Patch requests.
  7762. ForceSendFields []string `json:"-"`
  7763. // NullFields is a list of field names (e.g. "Kind") to include in API
  7764. // requests with the JSON null value. By default, fields with empty
  7765. // values are omitted from API requests. However, any field with an
  7766. // empty value appearing in NullFields will be sent to the server as
  7767. // null. It is an error if a field in this list has a non-empty value.
  7768. // This may be used to include null fields in Patch requests.
  7769. NullFields []string `json:"-"`
  7770. }
  7771. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7772. type NoMethod OperatingSystemVersionsListResponse
  7773. raw := NoMethod(*s)
  7774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7775. }
  7776. // OperatingSystemsListResponse: Operating System List Response
  7777. type OperatingSystemsListResponse struct {
  7778. // Kind: Identifies what kind of resource this is. Value: the fixed
  7779. // string "dfareporting#operatingSystemsListResponse".
  7780. Kind string `json:"kind,omitempty"`
  7781. // OperatingSystems: Operating system collection.
  7782. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7783. // ServerResponse contains the HTTP response code and headers from the
  7784. // server.
  7785. googleapi.ServerResponse `json:"-"`
  7786. // ForceSendFields is a list of field names (e.g. "Kind") to
  7787. // unconditionally include in API requests. By default, fields with
  7788. // empty values are omitted from API requests. However, any non-pointer,
  7789. // non-interface field appearing in ForceSendFields will be sent to the
  7790. // server regardless of whether the field is empty or not. This may be
  7791. // used to include empty fields in Patch requests.
  7792. ForceSendFields []string `json:"-"`
  7793. // NullFields is a list of field names (e.g. "Kind") to include in API
  7794. // requests with the JSON null value. By default, fields with empty
  7795. // values are omitted from API requests. However, any field with an
  7796. // empty value appearing in NullFields will be sent to the server as
  7797. // null. It is an error if a field in this list has a non-empty value.
  7798. // This may be used to include null fields in Patch requests.
  7799. NullFields []string `json:"-"`
  7800. }
  7801. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7802. type NoMethod OperatingSystemsListResponse
  7803. raw := NoMethod(*s)
  7804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7805. }
  7806. // OptimizationActivity: Creative optimization activity.
  7807. type OptimizationActivity struct {
  7808. // FloodlightActivityId: Floodlight activity ID of this optimization
  7809. // activity. This is a required field.
  7810. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7811. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7812. // floodlight activity. This is a read-only, auto-generated field.
  7813. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7814. // Weight: Weight associated with this optimization. The weight assigned
  7815. // will be understood in proportion to the weights assigned to the other
  7816. // optimization activities. Value must be greater than or equal to 1.
  7817. Weight int64 `json:"weight,omitempty"`
  7818. // ForceSendFields is a list of field names (e.g.
  7819. // "FloodlightActivityId") to unconditionally include in API requests.
  7820. // By default, fields with empty values are omitted from API requests.
  7821. // However, any non-pointer, non-interface field appearing in
  7822. // ForceSendFields will be sent to the server regardless of whether the
  7823. // field is empty or not. This may be used to include empty fields in
  7824. // Patch requests.
  7825. ForceSendFields []string `json:"-"`
  7826. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7827. // include in API requests with the JSON null value. By default, fields
  7828. // with empty values are omitted from API requests. However, any field
  7829. // with an empty value appearing in NullFields will be sent to the
  7830. // server as null. It is an error if a field in this list has a
  7831. // non-empty value. This may be used to include null fields in Patch
  7832. // requests.
  7833. NullFields []string `json:"-"`
  7834. }
  7835. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7836. type NoMethod OptimizationActivity
  7837. raw := NoMethod(*s)
  7838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7839. }
  7840. // Order: Describes properties of a Planning order.
  7841. type Order struct {
  7842. // AccountId: Account ID of this order.
  7843. AccountId int64 `json:"accountId,omitempty,string"`
  7844. // AdvertiserId: Advertiser ID of this order.
  7845. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7846. // ApproverUserProfileIds: IDs for users that have to approve documents
  7847. // created for this order.
  7848. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7849. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7850. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7851. // BuyerOrganizationName: Name of the buyer organization.
  7852. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7853. // Comments: Comments in this order.
  7854. Comments string `json:"comments,omitempty"`
  7855. // Contacts: Contacts for this order.
  7856. Contacts []*OrderContact `json:"contacts,omitempty"`
  7857. // Id: ID of this order. This is a read-only, auto-generated field.
  7858. Id int64 `json:"id,omitempty,string"`
  7859. // Kind: Identifies what kind of resource this is. Value: the fixed
  7860. // string "dfareporting#order".
  7861. Kind string `json:"kind,omitempty"`
  7862. // LastModifiedInfo: Information about the most recent modification of
  7863. // this order.
  7864. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7865. // Name: Name of this order.
  7866. Name string `json:"name,omitempty"`
  7867. // Notes: Notes of this order.
  7868. Notes string `json:"notes,omitempty"`
  7869. // PlanningTermId: ID of the terms and conditions template used in this
  7870. // order.
  7871. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  7872. // ProjectId: Project ID of this order.
  7873. ProjectId int64 `json:"projectId,omitempty,string"`
  7874. // SellerOrderId: Seller order ID associated with this order.
  7875. SellerOrderId string `json:"sellerOrderId,omitempty"`
  7876. // SellerOrganizationName: Name of the seller organization.
  7877. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  7878. // SiteId: Site IDs this order is associated with.
  7879. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  7880. // SiteNames: Free-form site names this order is associated with.
  7881. SiteNames []string `json:"siteNames,omitempty"`
  7882. // SubaccountId: Subaccount ID of this order.
  7883. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7884. // TermsAndConditions: Terms and conditions of this order.
  7885. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  7886. // ServerResponse contains the HTTP response code and headers from the
  7887. // server.
  7888. googleapi.ServerResponse `json:"-"`
  7889. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7890. // unconditionally include in API requests. By default, fields with
  7891. // empty values are omitted from API requests. However, any non-pointer,
  7892. // non-interface field appearing in ForceSendFields will be sent to the
  7893. // server regardless of whether the field is empty or not. This may be
  7894. // used to include empty fields in Patch requests.
  7895. ForceSendFields []string `json:"-"`
  7896. // NullFields is a list of field names (e.g. "AccountId") to include in
  7897. // API requests with the JSON null value. By default, fields with empty
  7898. // values are omitted from API requests. However, any field with an
  7899. // empty value appearing in NullFields will be sent to the server as
  7900. // null. It is an error if a field in this list has a non-empty value.
  7901. // This may be used to include null fields in Patch requests.
  7902. NullFields []string `json:"-"`
  7903. }
  7904. func (s *Order) MarshalJSON() ([]byte, error) {
  7905. type NoMethod Order
  7906. raw := NoMethod(*s)
  7907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7908. }
  7909. // OrderContact: Contact of an order.
  7910. type OrderContact struct {
  7911. // ContactInfo: Free-form information about this contact. It could be
  7912. // any information related to this contact in addition to type, title,
  7913. // name, and signature user profile ID.
  7914. ContactInfo string `json:"contactInfo,omitempty"`
  7915. // ContactName: Name of this contact.
  7916. ContactName string `json:"contactName,omitempty"`
  7917. // ContactTitle: Title of this contact.
  7918. ContactTitle string `json:"contactTitle,omitempty"`
  7919. // ContactType: Type of this contact.
  7920. //
  7921. // Possible values:
  7922. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  7923. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  7924. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  7925. ContactType string `json:"contactType,omitempty"`
  7926. // SignatureUserProfileId: ID of the user profile containing the
  7927. // signature that will be embedded into order documents.
  7928. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  7929. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  7930. // unconditionally include in API requests. By default, fields with
  7931. // empty values are omitted from API requests. However, any non-pointer,
  7932. // non-interface field appearing in ForceSendFields will be sent to the
  7933. // server regardless of whether the field is empty or not. This may be
  7934. // used to include empty fields in Patch requests.
  7935. ForceSendFields []string `json:"-"`
  7936. // NullFields is a list of field names (e.g. "ContactInfo") to include
  7937. // in API requests with the JSON null value. By default, fields with
  7938. // empty values are omitted from API requests. However, any field with
  7939. // an empty value appearing in NullFields will be sent to the server as
  7940. // null. It is an error if a field in this list has a non-empty value.
  7941. // This may be used to include null fields in Patch requests.
  7942. NullFields []string `json:"-"`
  7943. }
  7944. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  7945. type NoMethod OrderContact
  7946. raw := NoMethod(*s)
  7947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7948. }
  7949. // OrderDocument: Contains properties of a Planning order document.
  7950. type OrderDocument struct {
  7951. // AccountId: Account ID of this order document.
  7952. AccountId int64 `json:"accountId,omitempty,string"`
  7953. // AdvertiserId: Advertiser ID of this order document.
  7954. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7955. // AmendedOrderDocumentId: The amended order document ID of this order
  7956. // document. An order document can be created by optionally amending
  7957. // another order document so that the change history can be preserved.
  7958. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  7959. // ApprovedByUserProfileIds: IDs of users who have approved this order
  7960. // document.
  7961. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  7962. // Cancelled: Whether this order document is cancelled.
  7963. Cancelled bool `json:"cancelled,omitempty"`
  7964. // CreatedInfo: Information about the creation of this order document.
  7965. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  7966. // EffectiveDate: Effective date of this order document.
  7967. EffectiveDate string `json:"effectiveDate,omitempty"`
  7968. // Id: ID of this order document.
  7969. Id int64 `json:"id,omitempty,string"`
  7970. // Kind: Identifies what kind of resource this is. Value: the fixed
  7971. // string "dfareporting#orderDocument".
  7972. Kind string `json:"kind,omitempty"`
  7973. // LastSentRecipients: List of email addresses that received the last
  7974. // sent document.
  7975. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  7976. // LastSentTime: Timestamp of the last email sent with this order
  7977. // document.
  7978. LastSentTime string `json:"lastSentTime,omitempty"`
  7979. // OrderId: ID of the order from which this order document is created.
  7980. OrderId int64 `json:"orderId,omitempty,string"`
  7981. // ProjectId: Project ID of this order document.
  7982. ProjectId int64 `json:"projectId,omitempty,string"`
  7983. // Signed: Whether this order document has been signed.
  7984. Signed bool `json:"signed,omitempty"`
  7985. // SubaccountId: Subaccount ID of this order document.
  7986. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7987. // Title: Title of this order document.
  7988. Title string `json:"title,omitempty"`
  7989. // Type: Type of this order document
  7990. //
  7991. // Possible values:
  7992. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  7993. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  7994. Type string `json:"type,omitempty"`
  7995. // ServerResponse contains the HTTP response code and headers from the
  7996. // server.
  7997. googleapi.ServerResponse `json:"-"`
  7998. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7999. // unconditionally include in API requests. By default, fields with
  8000. // empty values are omitted from API requests. However, any non-pointer,
  8001. // non-interface field appearing in ForceSendFields will be sent to the
  8002. // server regardless of whether the field is empty or not. This may be
  8003. // used to include empty fields in Patch requests.
  8004. ForceSendFields []string `json:"-"`
  8005. // NullFields is a list of field names (e.g. "AccountId") to include in
  8006. // API requests with the JSON null value. By default, fields with empty
  8007. // values are omitted from API requests. However, any field with an
  8008. // empty value appearing in NullFields will be sent to the server as
  8009. // null. It is an error if a field in this list has a non-empty value.
  8010. // This may be used to include null fields in Patch requests.
  8011. NullFields []string `json:"-"`
  8012. }
  8013. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  8014. type NoMethod OrderDocument
  8015. raw := NoMethod(*s)
  8016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8017. }
  8018. // OrderDocumentsListResponse: Order document List Response
  8019. type OrderDocumentsListResponse struct {
  8020. // Kind: Identifies what kind of resource this is. Value: the fixed
  8021. // string "dfareporting#orderDocumentsListResponse".
  8022. Kind string `json:"kind,omitempty"`
  8023. // NextPageToken: Pagination token to be used for the next list
  8024. // operation.
  8025. NextPageToken string `json:"nextPageToken,omitempty"`
  8026. // OrderDocuments: Order document collection
  8027. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  8028. // ServerResponse contains the HTTP response code and headers from the
  8029. // server.
  8030. googleapi.ServerResponse `json:"-"`
  8031. // ForceSendFields is a list of field names (e.g. "Kind") to
  8032. // unconditionally include in API requests. By default, fields with
  8033. // empty values are omitted from API requests. However, any non-pointer,
  8034. // non-interface field appearing in ForceSendFields will be sent to the
  8035. // server regardless of whether the field is empty or not. This may be
  8036. // used to include empty fields in Patch requests.
  8037. ForceSendFields []string `json:"-"`
  8038. // NullFields is a list of field names (e.g. "Kind") to include in API
  8039. // requests with the JSON null value. By default, fields with empty
  8040. // values are omitted from API requests. However, any field with an
  8041. // empty value appearing in NullFields will be sent to the server as
  8042. // null. It is an error if a field in this list has a non-empty value.
  8043. // This may be used to include null fields in Patch requests.
  8044. NullFields []string `json:"-"`
  8045. }
  8046. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  8047. type NoMethod OrderDocumentsListResponse
  8048. raw := NoMethod(*s)
  8049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8050. }
  8051. // OrdersListResponse: Order List Response
  8052. type OrdersListResponse struct {
  8053. // Kind: Identifies what kind of resource this is. Value: the fixed
  8054. // string "dfareporting#ordersListResponse".
  8055. Kind string `json:"kind,omitempty"`
  8056. // NextPageToken: Pagination token to be used for the next list
  8057. // operation.
  8058. NextPageToken string `json:"nextPageToken,omitempty"`
  8059. // Orders: Order collection.
  8060. Orders []*Order `json:"orders,omitempty"`
  8061. // ServerResponse contains the HTTP response code and headers from the
  8062. // server.
  8063. googleapi.ServerResponse `json:"-"`
  8064. // ForceSendFields is a list of field names (e.g. "Kind") to
  8065. // unconditionally include in API requests. By default, fields with
  8066. // empty values are omitted from API requests. However, any non-pointer,
  8067. // non-interface field appearing in ForceSendFields will be sent to the
  8068. // server regardless of whether the field is empty or not. This may be
  8069. // used to include empty fields in Patch requests.
  8070. ForceSendFields []string `json:"-"`
  8071. // NullFields is a list of field names (e.g. "Kind") to include in API
  8072. // requests with the JSON null value. By default, fields with empty
  8073. // values are omitted from API requests. However, any field with an
  8074. // empty value appearing in NullFields will be sent to the server as
  8075. // null. It is an error if a field in this list has a non-empty value.
  8076. // This may be used to include null fields in Patch requests.
  8077. NullFields []string `json:"-"`
  8078. }
  8079. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  8080. type NoMethod OrdersListResponse
  8081. raw := NoMethod(*s)
  8082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8083. }
  8084. // PathToConversionReportCompatibleFields: Represents fields that are
  8085. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  8086. type PathToConversionReportCompatibleFields struct {
  8087. // ConversionDimensions: Conversion dimensions which are compatible to
  8088. // be selected in the "conversionDimensions" section of the report.
  8089. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  8090. // CustomFloodlightVariables: Custom floodlight variables which are
  8091. // compatible to be selected in the "customFloodlightVariables" section
  8092. // of the report.
  8093. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  8094. // Kind: The kind of resource this is, in this case
  8095. // dfareporting#pathToConversionReportCompatibleFields.
  8096. Kind string `json:"kind,omitempty"`
  8097. // Metrics: Metrics which are compatible to be selected in the
  8098. // "metricNames" section of the report.
  8099. Metrics []*Metric `json:"metrics,omitempty"`
  8100. // PerInteractionDimensions: Per-interaction dimensions which are
  8101. // compatible to be selected in the "perInteractionDimensions" section
  8102. // of the report.
  8103. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  8104. // ForceSendFields is a list of field names (e.g.
  8105. // "ConversionDimensions") to unconditionally include in API requests.
  8106. // By default, fields with empty values are omitted from API requests.
  8107. // However, any non-pointer, non-interface field appearing in
  8108. // ForceSendFields will be sent to the server regardless of whether the
  8109. // field is empty or not. This may be used to include empty fields in
  8110. // Patch requests.
  8111. ForceSendFields []string `json:"-"`
  8112. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  8113. // include in API requests with the JSON null value. By default, fields
  8114. // with empty values are omitted from API requests. However, any field
  8115. // with an empty value appearing in NullFields will be sent to the
  8116. // server as null. It is an error if a field in this list has a
  8117. // non-empty value. This may be used to include null fields in Patch
  8118. // requests.
  8119. NullFields []string `json:"-"`
  8120. }
  8121. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8122. type NoMethod PathToConversionReportCompatibleFields
  8123. raw := NoMethod(*s)
  8124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8125. }
  8126. // Placement: Contains properties of a placement.
  8127. type Placement struct {
  8128. // AccountId: Account ID of this placement. This field can be left
  8129. // blank.
  8130. AccountId int64 `json:"accountId,omitempty,string"`
  8131. // AdBlockingOptOut: Whether this placement opts out of ad blocking.
  8132. // When true, ad blocking is disabled for this placement. When false,
  8133. // the campaign and site settings take effect.
  8134. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  8135. // AdditionalSizes: Additional sizes associated with this placement.
  8136. // When inserting or updating a placement, only the size ID field is
  8137. // used.
  8138. AdditionalSizes []*Size `json:"additionalSizes,omitempty"`
  8139. // AdvertiserId: Advertiser ID of this placement. This field can be left
  8140. // blank.
  8141. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8142. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8143. // advertiser. This is a read-only, auto-generated field.
  8144. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8145. // Archived: Whether this placement is archived.
  8146. Archived bool `json:"archived,omitempty"`
  8147. // CampaignId: Campaign ID of this placement. This field is a required
  8148. // field on insertion.
  8149. CampaignId int64 `json:"campaignId,omitempty,string"`
  8150. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8151. // This is a read-only, auto-generated field.
  8152. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8153. // Comment: Comments for this placement.
  8154. Comment string `json:"comment,omitempty"`
  8155. // Compatibility: Placement compatibility. DISPLAY and
  8156. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  8157. // or in mobile apps for regular or interstitial ads respectively. APP
  8158. // and APP_INTERSTITIAL are no longer allowed for new placement
  8159. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  8160. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  8161. // with the VAST standard. This field is required on insertion.
  8162. //
  8163. // Possible values:
  8164. // "APP"
  8165. // "APP_INTERSTITIAL"
  8166. // "DISPLAY"
  8167. // "DISPLAY_INTERSTITIAL"
  8168. // "IN_STREAM_AUDIO"
  8169. // "IN_STREAM_VIDEO"
  8170. Compatibility string `json:"compatibility,omitempty"`
  8171. // ContentCategoryId: ID of the content category assigned to this
  8172. // placement.
  8173. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8174. // CreateInfo: Information about the creation of this placement. This is
  8175. // a read-only field.
  8176. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8177. // DirectorySiteId: Directory site ID of this placement. On insert, you
  8178. // must set either this field or the siteId field to specify the site
  8179. // associated with this placement. This is a required field that is
  8180. // read-only after insertion.
  8181. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8182. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8183. // directory site. This is a read-only, auto-generated field.
  8184. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8185. // ExternalId: External ID for this placement.
  8186. ExternalId string `json:"externalId,omitempty"`
  8187. // Id: ID of this placement. This is a read-only, auto-generated field.
  8188. Id int64 `json:"id,omitempty,string"`
  8189. // IdDimensionValue: Dimension value for the ID of this placement. This
  8190. // is a read-only, auto-generated field.
  8191. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8192. // KeyName: Key name of this placement. This is a read-only,
  8193. // auto-generated field.
  8194. KeyName string `json:"keyName,omitempty"`
  8195. // Kind: Identifies what kind of resource this is. Value: the fixed
  8196. // string "dfareporting#placement".
  8197. Kind string `json:"kind,omitempty"`
  8198. // LastModifiedInfo: Information about the most recent modification of
  8199. // this placement. This is a read-only field.
  8200. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8201. // LookbackConfiguration: Lookback window settings for this placement.
  8202. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  8203. // Name: Name of this placement.This is a required field and must be
  8204. // less than 256 characters long.
  8205. Name string `json:"name,omitempty"`
  8206. // PaymentApproved: Whether payment was approved for this placement.
  8207. // This is a read-only field relevant only to publisher-paid placements.
  8208. PaymentApproved bool `json:"paymentApproved,omitempty"`
  8209. // PaymentSource: Payment source for this placement. This is a required
  8210. // field that is read-only after insertion.
  8211. //
  8212. // Possible values:
  8213. // "PLACEMENT_AGENCY_PAID"
  8214. // "PLACEMENT_PUBLISHER_PAID"
  8215. PaymentSource string `json:"paymentSource,omitempty"`
  8216. // PlacementGroupId: ID of this placement's group, if applicable.
  8217. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  8218. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  8219. // placement group. This is a read-only, auto-generated field.
  8220. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  8221. // PlacementStrategyId: ID of the placement strategy assigned to this
  8222. // placement.
  8223. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8224. // PricingSchedule: Pricing schedule of this placement. This field is
  8225. // required on insertion, specifically subfields startDate, endDate and
  8226. // pricingType.
  8227. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8228. // Primary: Whether this placement is the primary placement of a
  8229. // roadblock (placement group). You cannot change this field from true
  8230. // to false. Setting this field to true will automatically set the
  8231. // primary field on the original primary placement of the roadblock to
  8232. // false, and it will automatically set the roadblock's
  8233. // primaryPlacementId field to the ID of this placement.
  8234. Primary bool `json:"primary,omitempty"`
  8235. // PublisherUpdateInfo: Information about the last publisher update.
  8236. // This is a read-only field.
  8237. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8238. // SiteId: Site ID associated with this placement. On insert, you must
  8239. // set either this field or the directorySiteId field to specify the
  8240. // site associated with this placement. This is a required field that is
  8241. // read-only after insertion.
  8242. SiteId int64 `json:"siteId,omitempty,string"`
  8243. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8244. // a read-only, auto-generated field.
  8245. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8246. // Size: Size associated with this placement. When inserting or updating
  8247. // a placement, only the size ID field is used. This field is required
  8248. // on insertion.
  8249. Size *Size `json:"size,omitempty"`
  8250. // SslRequired: Whether creatives assigned to this placement must be
  8251. // SSL-compliant.
  8252. SslRequired bool `json:"sslRequired,omitempty"`
  8253. // Status: Third-party placement status.
  8254. //
  8255. // Possible values:
  8256. // "ACKNOWLEDGE_ACCEPTANCE"
  8257. // "ACKNOWLEDGE_REJECTION"
  8258. // "DRAFT"
  8259. // "PAYMENT_ACCEPTED"
  8260. // "PAYMENT_REJECTED"
  8261. // "PENDING_REVIEW"
  8262. Status string `json:"status,omitempty"`
  8263. // SubaccountId: Subaccount ID of this placement. This field can be left
  8264. // blank.
  8265. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8266. // TagFormats: Tag formats to generate for this placement. This field is
  8267. // required on insertion.
  8268. // Acceptable values are:
  8269. // - "PLACEMENT_TAG_STANDARD"
  8270. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8271. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8272. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8273. // - "PLACEMENT_TAG_JAVASCRIPT"
  8274. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8275. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8276. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8277. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8278. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8279. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8280. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8281. // - "PLACEMENT_TAG_TRACKING"
  8282. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8283. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8284. //
  8285. // Possible values:
  8286. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8287. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8288. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8289. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8290. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8291. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8292. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8293. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8294. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8295. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8296. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8297. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8298. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8299. // "PLACEMENT_TAG_JAVASCRIPT"
  8300. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8301. // "PLACEMENT_TAG_STANDARD"
  8302. // "PLACEMENT_TAG_TRACKING"
  8303. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8304. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8305. TagFormats []string `json:"tagFormats,omitempty"`
  8306. // TagSetting: Tag settings for this placement.
  8307. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8308. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8309. // disabled for in-stream video creatives for this placement. The same
  8310. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8311. // occurs if either of these settings are true. These settings are
  8312. // distinct from DirectorySites.settings.activeViewOptOut or
  8313. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8314. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8315. // well as display ads, from Verification and ActiveView.
  8316. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8317. // VideoSettings: A collection of settings which affect video creatives
  8318. // served through this placement. Applicable to placements with
  8319. // IN_STREAM_VIDEO compatibility.
  8320. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8321. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8322. // Controls which VPAID format the measurement adapter will use for
  8323. // in-stream video creatives assigned to this placement.
  8324. //
  8325. // Note: Flash is no longer supported. This field now defaults to HTML5
  8326. // when the following values are provided: FLASH, BOTH.
  8327. //
  8328. // Possible values:
  8329. // "BOTH"
  8330. // "DEFAULT"
  8331. // "FLASH"
  8332. // "HTML5"
  8333. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8334. // ServerResponse contains the HTTP response code and headers from the
  8335. // server.
  8336. googleapi.ServerResponse `json:"-"`
  8337. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8338. // unconditionally include in API requests. By default, fields with
  8339. // empty values are omitted from API requests. However, any non-pointer,
  8340. // non-interface field appearing in ForceSendFields will be sent to the
  8341. // server regardless of whether the field is empty or not. This may be
  8342. // used to include empty fields in Patch requests.
  8343. ForceSendFields []string `json:"-"`
  8344. // NullFields is a list of field names (e.g. "AccountId") to include in
  8345. // API requests with the JSON null value. By default, fields with empty
  8346. // values are omitted from API requests. However, any field with an
  8347. // empty value appearing in NullFields will be sent to the server as
  8348. // null. It is an error if a field in this list has a non-empty value.
  8349. // This may be used to include null fields in Patch requests.
  8350. NullFields []string `json:"-"`
  8351. }
  8352. func (s *Placement) MarshalJSON() ([]byte, error) {
  8353. type NoMethod Placement
  8354. raw := NoMethod(*s)
  8355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8356. }
  8357. // PlacementAssignment: Placement Assignment.
  8358. type PlacementAssignment struct {
  8359. // Active: Whether this placement assignment is active. When true, the
  8360. // placement will be included in the ad's rotation.
  8361. Active bool `json:"active,omitempty"`
  8362. // PlacementId: ID of the placement to be assigned. This is a required
  8363. // field.
  8364. PlacementId int64 `json:"placementId,omitempty,string"`
  8365. // PlacementIdDimensionValue: Dimension value for the ID of the
  8366. // placement. This is a read-only, auto-generated field.
  8367. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8368. // SslRequired: Whether the placement to be assigned requires SSL. This
  8369. // is a read-only field that is auto-generated when the ad is inserted
  8370. // or updated.
  8371. SslRequired bool `json:"sslRequired,omitempty"`
  8372. // ForceSendFields is a list of field names (e.g. "Active") to
  8373. // unconditionally include in API requests. By default, fields with
  8374. // empty values are omitted from API requests. However, any non-pointer,
  8375. // non-interface field appearing in ForceSendFields will be sent to the
  8376. // server regardless of whether the field is empty or not. This may be
  8377. // used to include empty fields in Patch requests.
  8378. ForceSendFields []string `json:"-"`
  8379. // NullFields is a list of field names (e.g. "Active") to include in API
  8380. // requests with the JSON null value. By default, fields with empty
  8381. // values are omitted from API requests. However, any field with an
  8382. // empty value appearing in NullFields will be sent to the server as
  8383. // null. It is an error if a field in this list has a non-empty value.
  8384. // This may be used to include null fields in Patch requests.
  8385. NullFields []string `json:"-"`
  8386. }
  8387. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8388. type NoMethod PlacementAssignment
  8389. raw := NoMethod(*s)
  8390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8391. }
  8392. // PlacementGroup: Contains properties of a package or roadblock.
  8393. type PlacementGroup struct {
  8394. // AccountId: Account ID of this placement group. This is a read-only
  8395. // field that can be left blank.
  8396. AccountId int64 `json:"accountId,omitempty,string"`
  8397. // AdvertiserId: Advertiser ID of this placement group. This is a
  8398. // required field on insertion.
  8399. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8400. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8401. // advertiser. This is a read-only, auto-generated field.
  8402. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8403. // Archived: Whether this placement group is archived.
  8404. Archived bool `json:"archived,omitempty"`
  8405. // CampaignId: Campaign ID of this placement group. This field is
  8406. // required on insertion.
  8407. CampaignId int64 `json:"campaignId,omitempty,string"`
  8408. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8409. // This is a read-only, auto-generated field.
  8410. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8411. // ChildPlacementIds: IDs of placements which are assigned to this
  8412. // placement group. This is a read-only, auto-generated field.
  8413. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8414. // Comment: Comments for this placement group.
  8415. Comment string `json:"comment,omitempty"`
  8416. // ContentCategoryId: ID of the content category assigned to this
  8417. // placement group.
  8418. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8419. // CreateInfo: Information about the creation of this placement group.
  8420. // This is a read-only field.
  8421. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8422. // DirectorySiteId: Directory site ID associated with this placement
  8423. // group. On insert, you must set either this field or the site_id field
  8424. // to specify the site associated with this placement group. This is a
  8425. // required field that is read-only after insertion.
  8426. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8427. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8428. // directory site. This is a read-only, auto-generated field.
  8429. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8430. // ExternalId: External ID for this placement.
  8431. ExternalId string `json:"externalId,omitempty"`
  8432. // Id: ID of this placement group. This is a read-only, auto-generated
  8433. // field.
  8434. Id int64 `json:"id,omitempty,string"`
  8435. // IdDimensionValue: Dimension value for the ID of this placement group.
  8436. // This is a read-only, auto-generated field.
  8437. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8438. // Kind: Identifies what kind of resource this is. Value: the fixed
  8439. // string "dfareporting#placementGroup".
  8440. Kind string `json:"kind,omitempty"`
  8441. // LastModifiedInfo: Information about the most recent modification of
  8442. // this placement group. This is a read-only field.
  8443. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8444. // Name: Name of this placement group. This is a required field and must
  8445. // be less than 256 characters long.
  8446. Name string `json:"name,omitempty"`
  8447. // PlacementGroupType: Type of this placement group. A package is a
  8448. // simple group of placements that acts as a single pricing point for a
  8449. // group of tags. A roadblock is a group of placements that not only
  8450. // acts as a single pricing point, but also assumes that all the tags in
  8451. // it will be served at the same time. A roadblock requires one of its
  8452. // assigned placements to be marked as primary for reporting. This field
  8453. // is required on insertion.
  8454. //
  8455. // Possible values:
  8456. // "PLACEMENT_PACKAGE"
  8457. // "PLACEMENT_ROADBLOCK"
  8458. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8459. // PlacementStrategyId: ID of the placement strategy assigned to this
  8460. // placement group.
  8461. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8462. // PricingSchedule: Pricing schedule of this placement group. This field
  8463. // is required on insertion.
  8464. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8465. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8466. // the media cost of a roadblock (placement group). Modifying this field
  8467. // will automatically modify the primary field on all affected roadblock
  8468. // child placements.
  8469. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8470. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8471. // primary placement. This is a read-only, auto-generated field.
  8472. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8473. // SiteId: Site ID associated with this placement group. On insert, you
  8474. // must set either this field or the directorySiteId field to specify
  8475. // the site associated with this placement group. This is a required
  8476. // field that is read-only after insertion.
  8477. SiteId int64 `json:"siteId,omitempty,string"`
  8478. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8479. // a read-only, auto-generated field.
  8480. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8481. // SubaccountId: Subaccount ID of this placement group. This is a
  8482. // read-only field that can be left blank.
  8483. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8484. // ServerResponse contains the HTTP response code and headers from the
  8485. // server.
  8486. googleapi.ServerResponse `json:"-"`
  8487. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8488. // unconditionally include in API requests. By default, fields with
  8489. // empty values are omitted from API requests. However, any non-pointer,
  8490. // non-interface field appearing in ForceSendFields will be sent to the
  8491. // server regardless of whether the field is empty or not. This may be
  8492. // used to include empty fields in Patch requests.
  8493. ForceSendFields []string `json:"-"`
  8494. // NullFields is a list of field names (e.g. "AccountId") to include in
  8495. // API requests with the JSON null value. By default, fields with empty
  8496. // values are omitted from API requests. However, any field with an
  8497. // empty value appearing in NullFields will be sent to the server as
  8498. // null. It is an error if a field in this list has a non-empty value.
  8499. // This may be used to include null fields in Patch requests.
  8500. NullFields []string `json:"-"`
  8501. }
  8502. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8503. type NoMethod PlacementGroup
  8504. raw := NoMethod(*s)
  8505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8506. }
  8507. // PlacementGroupsListResponse: Placement Group List Response
  8508. type PlacementGroupsListResponse struct {
  8509. // Kind: Identifies what kind of resource this is. Value: the fixed
  8510. // string "dfareporting#placementGroupsListResponse".
  8511. Kind string `json:"kind,omitempty"`
  8512. // NextPageToken: Pagination token to be used for the next list
  8513. // operation.
  8514. NextPageToken string `json:"nextPageToken,omitempty"`
  8515. // PlacementGroups: Placement group collection.
  8516. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8517. // ServerResponse contains the HTTP response code and headers from the
  8518. // server.
  8519. googleapi.ServerResponse `json:"-"`
  8520. // ForceSendFields is a list of field names (e.g. "Kind") to
  8521. // unconditionally include in API requests. By default, fields with
  8522. // empty values are omitted from API requests. However, any non-pointer,
  8523. // non-interface field appearing in ForceSendFields will be sent to the
  8524. // server regardless of whether the field is empty or not. This may be
  8525. // used to include empty fields in Patch requests.
  8526. ForceSendFields []string `json:"-"`
  8527. // NullFields is a list of field names (e.g. "Kind") to include in API
  8528. // requests with the JSON null value. By default, fields with empty
  8529. // values are omitted from API requests. However, any field with an
  8530. // empty value appearing in NullFields will be sent to the server as
  8531. // null. It is an error if a field in this list has a non-empty value.
  8532. // This may be used to include null fields in Patch requests.
  8533. NullFields []string `json:"-"`
  8534. }
  8535. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8536. type NoMethod PlacementGroupsListResponse
  8537. raw := NoMethod(*s)
  8538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8539. }
  8540. // PlacementStrategiesListResponse: Placement Strategy List Response
  8541. type PlacementStrategiesListResponse struct {
  8542. // Kind: Identifies what kind of resource this is. Value: the fixed
  8543. // string "dfareporting#placementStrategiesListResponse".
  8544. Kind string `json:"kind,omitempty"`
  8545. // NextPageToken: Pagination token to be used for the next list
  8546. // operation.
  8547. NextPageToken string `json:"nextPageToken,omitempty"`
  8548. // PlacementStrategies: Placement strategy collection.
  8549. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8550. // ServerResponse contains the HTTP response code and headers from the
  8551. // server.
  8552. googleapi.ServerResponse `json:"-"`
  8553. // ForceSendFields is a list of field names (e.g. "Kind") to
  8554. // unconditionally include in API requests. By default, fields with
  8555. // empty values are omitted from API requests. However, any non-pointer,
  8556. // non-interface field appearing in ForceSendFields will be sent to the
  8557. // server regardless of whether the field is empty or not. This may be
  8558. // used to include empty fields in Patch requests.
  8559. ForceSendFields []string `json:"-"`
  8560. // NullFields is a list of field names (e.g. "Kind") to include in API
  8561. // requests with the JSON null value. By default, fields with empty
  8562. // values are omitted from API requests. However, any field with an
  8563. // empty value appearing in NullFields will be sent to the server as
  8564. // null. It is an error if a field in this list has a non-empty value.
  8565. // This may be used to include null fields in Patch requests.
  8566. NullFields []string `json:"-"`
  8567. }
  8568. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8569. type NoMethod PlacementStrategiesListResponse
  8570. raw := NoMethod(*s)
  8571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8572. }
  8573. // PlacementStrategy: Contains properties of a placement strategy.
  8574. type PlacementStrategy struct {
  8575. // AccountId: Account ID of this placement strategy.This is a read-only
  8576. // field that can be left blank.
  8577. AccountId int64 `json:"accountId,omitempty,string"`
  8578. // Id: ID of this placement strategy. This is a read-only,
  8579. // auto-generated field.
  8580. Id int64 `json:"id,omitempty,string"`
  8581. // Kind: Identifies what kind of resource this is. Value: the fixed
  8582. // string "dfareporting#placementStrategy".
  8583. Kind string `json:"kind,omitempty"`
  8584. // Name: Name of this placement strategy. This is a required field. It
  8585. // must be less than 256 characters long and unique among placement
  8586. // strategies of the same account.
  8587. Name string `json:"name,omitempty"`
  8588. // ServerResponse contains the HTTP response code and headers from the
  8589. // server.
  8590. googleapi.ServerResponse `json:"-"`
  8591. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8592. // unconditionally include in API requests. By default, fields with
  8593. // empty values are omitted from API requests. However, any non-pointer,
  8594. // non-interface field appearing in ForceSendFields will be sent to the
  8595. // server regardless of whether the field is empty or not. This may be
  8596. // used to include empty fields in Patch requests.
  8597. ForceSendFields []string `json:"-"`
  8598. // NullFields is a list of field names (e.g. "AccountId") to include in
  8599. // API requests with the JSON null value. By default, fields with empty
  8600. // values are omitted from API requests. However, any field with an
  8601. // empty value appearing in NullFields will be sent to the server as
  8602. // null. It is an error if a field in this list has a non-empty value.
  8603. // This may be used to include null fields in Patch requests.
  8604. NullFields []string `json:"-"`
  8605. }
  8606. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8607. type NoMethod PlacementStrategy
  8608. raw := NoMethod(*s)
  8609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8610. }
  8611. // PlacementTag: Placement Tag
  8612. type PlacementTag struct {
  8613. // PlacementId: Placement ID
  8614. PlacementId int64 `json:"placementId,omitempty,string"`
  8615. // TagDatas: Tags generated for this placement.
  8616. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8617. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8618. // unconditionally include in API requests. By default, fields with
  8619. // empty values are omitted from API requests. However, any non-pointer,
  8620. // non-interface field appearing in ForceSendFields will be sent to the
  8621. // server regardless of whether the field is empty or not. This may be
  8622. // used to include empty fields in Patch requests.
  8623. ForceSendFields []string `json:"-"`
  8624. // NullFields is a list of field names (e.g. "PlacementId") to include
  8625. // in API requests with the JSON null value. By default, fields with
  8626. // empty values are omitted from API requests. However, any field with
  8627. // an empty value appearing in NullFields will be sent to the server as
  8628. // null. It is an error if a field in this list has a non-empty value.
  8629. // This may be used to include null fields in Patch requests.
  8630. NullFields []string `json:"-"`
  8631. }
  8632. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8633. type NoMethod PlacementTag
  8634. raw := NoMethod(*s)
  8635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8636. }
  8637. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8638. type PlacementsGenerateTagsResponse struct {
  8639. // Kind: Identifies what kind of resource this is. Value: the fixed
  8640. // string "dfareporting#placementsGenerateTagsResponse".
  8641. Kind string `json:"kind,omitempty"`
  8642. // PlacementTags: Set of generated tags for the specified placements.
  8643. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8644. // ServerResponse contains the HTTP response code and headers from the
  8645. // server.
  8646. googleapi.ServerResponse `json:"-"`
  8647. // ForceSendFields is a list of field names (e.g. "Kind") to
  8648. // unconditionally include in API requests. By default, fields with
  8649. // empty values are omitted from API requests. However, any non-pointer,
  8650. // non-interface field appearing in ForceSendFields will be sent to the
  8651. // server regardless of whether the field is empty or not. This may be
  8652. // used to include empty fields in Patch requests.
  8653. ForceSendFields []string `json:"-"`
  8654. // NullFields is a list of field names (e.g. "Kind") to include in API
  8655. // requests with the JSON null value. By default, fields with empty
  8656. // values are omitted from API requests. However, any field with an
  8657. // empty value appearing in NullFields will be sent to the server as
  8658. // null. It is an error if a field in this list has a non-empty value.
  8659. // This may be used to include null fields in Patch requests.
  8660. NullFields []string `json:"-"`
  8661. }
  8662. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8663. type NoMethod PlacementsGenerateTagsResponse
  8664. raw := NoMethod(*s)
  8665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8666. }
  8667. // PlacementsListResponse: Placement List Response
  8668. type PlacementsListResponse struct {
  8669. // Kind: Identifies what kind of resource this is. Value: the fixed
  8670. // string "dfareporting#placementsListResponse".
  8671. Kind string `json:"kind,omitempty"`
  8672. // NextPageToken: Pagination token to be used for the next list
  8673. // operation.
  8674. NextPageToken string `json:"nextPageToken,omitempty"`
  8675. // Placements: Placement collection.
  8676. Placements []*Placement `json:"placements,omitempty"`
  8677. // ServerResponse contains the HTTP response code and headers from the
  8678. // server.
  8679. googleapi.ServerResponse `json:"-"`
  8680. // ForceSendFields is a list of field names (e.g. "Kind") to
  8681. // unconditionally include in API requests. By default, fields with
  8682. // empty values are omitted from API requests. However, any non-pointer,
  8683. // non-interface field appearing in ForceSendFields will be sent to the
  8684. // server regardless of whether the field is empty or not. This may be
  8685. // used to include empty fields in Patch requests.
  8686. ForceSendFields []string `json:"-"`
  8687. // NullFields is a list of field names (e.g. "Kind") to include in API
  8688. // requests with the JSON null value. By default, fields with empty
  8689. // values are omitted from API requests. However, any field with an
  8690. // empty value appearing in NullFields will be sent to the server as
  8691. // null. It is an error if a field in this list has a non-empty value.
  8692. // This may be used to include null fields in Patch requests.
  8693. NullFields []string `json:"-"`
  8694. }
  8695. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8696. type NoMethod PlacementsListResponse
  8697. raw := NoMethod(*s)
  8698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8699. }
  8700. // PlatformType: Contains information about a platform type that can be
  8701. // targeted by ads.
  8702. type PlatformType struct {
  8703. // Id: ID of this platform type.
  8704. Id int64 `json:"id,omitempty,string"`
  8705. // Kind: Identifies what kind of resource this is. Value: the fixed
  8706. // string "dfareporting#platformType".
  8707. Kind string `json:"kind,omitempty"`
  8708. // Name: Name of this platform type.
  8709. Name string `json:"name,omitempty"`
  8710. // ServerResponse contains the HTTP response code and headers from the
  8711. // server.
  8712. googleapi.ServerResponse `json:"-"`
  8713. // ForceSendFields is a list of field names (e.g. "Id") to
  8714. // unconditionally include in API requests. By default, fields with
  8715. // empty values are omitted from API requests. However, any non-pointer,
  8716. // non-interface field appearing in ForceSendFields will be sent to the
  8717. // server regardless of whether the field is empty or not. This may be
  8718. // used to include empty fields in Patch requests.
  8719. ForceSendFields []string `json:"-"`
  8720. // NullFields is a list of field names (e.g. "Id") to include in API
  8721. // requests with the JSON null value. By default, fields with empty
  8722. // values are omitted from API requests. However, any field with an
  8723. // empty value appearing in NullFields will be sent to the server as
  8724. // null. It is an error if a field in this list has a non-empty value.
  8725. // This may be used to include null fields in Patch requests.
  8726. NullFields []string `json:"-"`
  8727. }
  8728. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8729. type NoMethod PlatformType
  8730. raw := NoMethod(*s)
  8731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8732. }
  8733. // PlatformTypesListResponse: Platform Type List Response
  8734. type PlatformTypesListResponse struct {
  8735. // Kind: Identifies what kind of resource this is. Value: the fixed
  8736. // string "dfareporting#platformTypesListResponse".
  8737. Kind string `json:"kind,omitempty"`
  8738. // PlatformTypes: Platform type collection.
  8739. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8740. // ServerResponse contains the HTTP response code and headers from the
  8741. // server.
  8742. googleapi.ServerResponse `json:"-"`
  8743. // ForceSendFields is a list of field names (e.g. "Kind") to
  8744. // unconditionally include in API requests. By default, fields with
  8745. // empty values are omitted from API requests. However, any non-pointer,
  8746. // non-interface field appearing in ForceSendFields will be sent to the
  8747. // server regardless of whether the field is empty or not. This may be
  8748. // used to include empty fields in Patch requests.
  8749. ForceSendFields []string `json:"-"`
  8750. // NullFields is a list of field names (e.g. "Kind") to include in API
  8751. // requests with the JSON null value. By default, fields with empty
  8752. // values are omitted from API requests. However, any field with an
  8753. // empty value appearing in NullFields will be sent to the server as
  8754. // null. It is an error if a field in this list has a non-empty value.
  8755. // This may be used to include null fields in Patch requests.
  8756. NullFields []string `json:"-"`
  8757. }
  8758. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8759. type NoMethod PlatformTypesListResponse
  8760. raw := NoMethod(*s)
  8761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8762. }
  8763. // PopupWindowProperties: Popup Window Properties.
  8764. type PopupWindowProperties struct {
  8765. // Dimension: Popup dimension for a creative. This is a read-only field.
  8766. // Applicable to the following creative types: all RICH_MEDIA and all
  8767. // VPAID
  8768. Dimension *Size `json:"dimension,omitempty"`
  8769. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8770. // if positionType is COORDINATES.
  8771. Offset *OffsetPosition `json:"offset,omitempty"`
  8772. // PositionType: Popup window position either centered or at specific
  8773. // coordinate.
  8774. //
  8775. // Possible values:
  8776. // "CENTER"
  8777. // "COORDINATES"
  8778. PositionType string `json:"positionType,omitempty"`
  8779. // ShowAddressBar: Whether to display the browser address bar.
  8780. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8781. // ShowMenuBar: Whether to display the browser menu bar.
  8782. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8783. // ShowScrollBar: Whether to display the browser scroll bar.
  8784. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8785. // ShowStatusBar: Whether to display the browser status bar.
  8786. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8787. // ShowToolBar: Whether to display the browser tool bar.
  8788. ShowToolBar bool `json:"showToolBar,omitempty"`
  8789. // Title: Title of popup window.
  8790. Title string `json:"title,omitempty"`
  8791. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8792. // unconditionally include in API requests. By default, fields with
  8793. // empty values are omitted from API requests. However, any non-pointer,
  8794. // non-interface field appearing in ForceSendFields will be sent to the
  8795. // server regardless of whether the field is empty or not. This may be
  8796. // used to include empty fields in Patch requests.
  8797. ForceSendFields []string `json:"-"`
  8798. // NullFields is a list of field names (e.g. "Dimension") to include in
  8799. // API requests with the JSON null value. By default, fields with empty
  8800. // values are omitted from API requests. However, any field with an
  8801. // empty value appearing in NullFields will be sent to the server as
  8802. // null. It is an error if a field in this list has a non-empty value.
  8803. // This may be used to include null fields in Patch requests.
  8804. NullFields []string `json:"-"`
  8805. }
  8806. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8807. type NoMethod PopupWindowProperties
  8808. raw := NoMethod(*s)
  8809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8810. }
  8811. // PostalCode: Contains information about a postal code that can be
  8812. // targeted by ads.
  8813. type PostalCode struct {
  8814. // Code: Postal code. This is equivalent to the id field.
  8815. Code string `json:"code,omitempty"`
  8816. // CountryCode: Country code of the country to which this postal code
  8817. // belongs.
  8818. CountryCode string `json:"countryCode,omitempty"`
  8819. // CountryDartId: DART ID of the country to which this postal code
  8820. // belongs.
  8821. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8822. // Id: ID of this postal code.
  8823. Id string `json:"id,omitempty"`
  8824. // Kind: Identifies what kind of resource this is. Value: the fixed
  8825. // string "dfareporting#postalCode".
  8826. Kind string `json:"kind,omitempty"`
  8827. // ServerResponse contains the HTTP response code and headers from the
  8828. // server.
  8829. googleapi.ServerResponse `json:"-"`
  8830. // ForceSendFields is a list of field names (e.g. "Code") to
  8831. // unconditionally include in API requests. By default, fields with
  8832. // empty values are omitted from API requests. However, any non-pointer,
  8833. // non-interface field appearing in ForceSendFields will be sent to the
  8834. // server regardless of whether the field is empty or not. This may be
  8835. // used to include empty fields in Patch requests.
  8836. ForceSendFields []string `json:"-"`
  8837. // NullFields is a list of field names (e.g. "Code") to include in API
  8838. // requests with the JSON null value. By default, fields with empty
  8839. // values are omitted from API requests. However, any field with an
  8840. // empty value appearing in NullFields will be sent to the server as
  8841. // null. It is an error if a field in this list has a non-empty value.
  8842. // This may be used to include null fields in Patch requests.
  8843. NullFields []string `json:"-"`
  8844. }
  8845. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8846. type NoMethod PostalCode
  8847. raw := NoMethod(*s)
  8848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8849. }
  8850. // PostalCodesListResponse: Postal Code List Response
  8851. type PostalCodesListResponse struct {
  8852. // Kind: Identifies what kind of resource this is. Value: the fixed
  8853. // string "dfareporting#postalCodesListResponse".
  8854. Kind string `json:"kind,omitempty"`
  8855. // PostalCodes: Postal code collection.
  8856. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8857. // ServerResponse contains the HTTP response code and headers from the
  8858. // server.
  8859. googleapi.ServerResponse `json:"-"`
  8860. // ForceSendFields is a list of field names (e.g. "Kind") to
  8861. // unconditionally include in API requests. By default, fields with
  8862. // empty values are omitted from API requests. However, any non-pointer,
  8863. // non-interface field appearing in ForceSendFields will be sent to the
  8864. // server regardless of whether the field is empty or not. This may be
  8865. // used to include empty fields in Patch requests.
  8866. ForceSendFields []string `json:"-"`
  8867. // NullFields is a list of field names (e.g. "Kind") to include in API
  8868. // requests with the JSON null value. By default, fields with empty
  8869. // values are omitted from API requests. However, any field with an
  8870. // empty value appearing in NullFields will be sent to the server as
  8871. // null. It is an error if a field in this list has a non-empty value.
  8872. // This may be used to include null fields in Patch requests.
  8873. NullFields []string `json:"-"`
  8874. }
  8875. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  8876. type NoMethod PostalCodesListResponse
  8877. raw := NoMethod(*s)
  8878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8879. }
  8880. // Pricing: Pricing Information
  8881. type Pricing struct {
  8882. // CapCostType: Cap cost type of this inventory item.
  8883. //
  8884. // Possible values:
  8885. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  8886. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  8887. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  8888. CapCostType string `json:"capCostType,omitempty"`
  8889. // EndDate: End date of this inventory item.
  8890. EndDate string `json:"endDate,omitempty"`
  8891. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  8892. // period) represents the inventory item pricing information for a
  8893. // specific period of time.
  8894. Flights []*Flight `json:"flights,omitempty"`
  8895. // GroupType: Group type of this inventory item if it represents a
  8896. // placement group. Is null otherwise. There are two type of placement
  8897. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  8898. // inventory items that acts as a single pricing point for a group of
  8899. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  8900. // items that not only acts as a single pricing point, but also assumes
  8901. // that all the tags in it will be served at the same time. A roadblock
  8902. // requires one of its assigned inventory items to be marked as primary.
  8903. //
  8904. // Possible values:
  8905. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  8906. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  8907. GroupType string `json:"groupType,omitempty"`
  8908. // PricingType: Pricing type of this inventory item.
  8909. //
  8910. // Possible values:
  8911. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  8912. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  8913. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  8914. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  8915. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  8916. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  8917. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8918. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  8919. PricingType string `json:"pricingType,omitempty"`
  8920. // StartDate: Start date of this inventory item.
  8921. StartDate string `json:"startDate,omitempty"`
  8922. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  8923. // unconditionally include in API requests. By default, fields with
  8924. // empty values are omitted from API requests. However, any non-pointer,
  8925. // non-interface field appearing in ForceSendFields will be sent to the
  8926. // server regardless of whether the field is empty or not. This may be
  8927. // used to include empty fields in Patch requests.
  8928. ForceSendFields []string `json:"-"`
  8929. // NullFields is a list of field names (e.g. "CapCostType") to include
  8930. // in API requests with the JSON null value. By default, fields with
  8931. // empty values are omitted from API requests. However, any field with
  8932. // an empty value appearing in NullFields will be sent to the server as
  8933. // null. It is an error if a field in this list has a non-empty value.
  8934. // This may be used to include null fields in Patch requests.
  8935. NullFields []string `json:"-"`
  8936. }
  8937. func (s *Pricing) MarshalJSON() ([]byte, error) {
  8938. type NoMethod Pricing
  8939. raw := NoMethod(*s)
  8940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8941. }
  8942. // PricingSchedule: Pricing Schedule
  8943. type PricingSchedule struct {
  8944. // CapCostOption: Placement cap cost option.
  8945. //
  8946. // Possible values:
  8947. // "CAP_COST_CUMULATIVE"
  8948. // "CAP_COST_MONTHLY"
  8949. // "CAP_COST_NONE"
  8950. CapCostOption string `json:"capCostOption,omitempty"`
  8951. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  8952. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  8953. // EndDate: Placement end date. This date must be later than, or the
  8954. // same day as, the placement start date, but not later than the
  8955. // campaign end date. If, for example, you set 6/25/2015 as both the
  8956. // start and end dates, the effective placement date is just that day
  8957. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  8958. // should not be set, as doing so will result in an error. This field is
  8959. // required on insertion.
  8960. EndDate string `json:"endDate,omitempty"`
  8961. // Flighted: Whether this placement is flighted. If true, pricing
  8962. // periods will be computed automatically.
  8963. Flighted bool `json:"flighted,omitempty"`
  8964. // FloodlightActivityId: Floodlight activity ID associated with this
  8965. // placement. This field should be set when placement pricing type is
  8966. // set to PRICING_TYPE_CPA.
  8967. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  8968. // PricingPeriods: Pricing periods for this placement.
  8969. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  8970. // PricingType: Placement pricing type. This field is required on
  8971. // insertion.
  8972. //
  8973. // Possible values:
  8974. // "PRICING_TYPE_CPA"
  8975. // "PRICING_TYPE_CPC"
  8976. // "PRICING_TYPE_CPM"
  8977. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  8978. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  8979. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8980. PricingType string `json:"pricingType,omitempty"`
  8981. // StartDate: Placement start date. This date must be later than, or the
  8982. // same day as, the campaign start date. The hours, minutes, and seconds
  8983. // of the start date should not be set, as doing so will result in an
  8984. // error. This field is required on insertion.
  8985. StartDate string `json:"startDate,omitempty"`
  8986. // TestingStartDate: Testing start date of this placement. The hours,
  8987. // minutes, and seconds of the start date should not be set, as doing so
  8988. // will result in an error.
  8989. TestingStartDate string `json:"testingStartDate,omitempty"`
  8990. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  8991. // unconditionally include in API requests. By default, fields with
  8992. // empty values are omitted from API requests. However, any non-pointer,
  8993. // non-interface field appearing in ForceSendFields will be sent to the
  8994. // server regardless of whether the field is empty or not. This may be
  8995. // used to include empty fields in Patch requests.
  8996. ForceSendFields []string `json:"-"`
  8997. // NullFields is a list of field names (e.g. "CapCostOption") to include
  8998. // in API requests with the JSON null value. By default, fields with
  8999. // empty values are omitted from API requests. However, any field with
  9000. // an empty value appearing in NullFields will be sent to the server as
  9001. // null. It is an error if a field in this list has a non-empty value.
  9002. // This may be used to include null fields in Patch requests.
  9003. NullFields []string `json:"-"`
  9004. }
  9005. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  9006. type NoMethod PricingSchedule
  9007. raw := NoMethod(*s)
  9008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9009. }
  9010. // PricingSchedulePricingPeriod: Pricing Period
  9011. type PricingSchedulePricingPeriod struct {
  9012. // EndDate: Pricing period end date. This date must be later than, or
  9013. // the same day as, the pricing period start date, but not later than
  9014. // the placement end date. The period end date can be the same date as
  9015. // the period start date. If, for example, you set 6/25/2015 as both the
  9016. // start and end dates, the effective pricing period date is just that
  9017. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  9018. // should not be set, as doing so will result in an error.
  9019. EndDate string `json:"endDate,omitempty"`
  9020. // PricingComment: Comments for this pricing period.
  9021. PricingComment string `json:"pricingComment,omitempty"`
  9022. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  9023. // multipled by 1000000000). Acceptable values are 0 to
  9024. // 1000000000000000000, inclusive.
  9025. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  9026. // StartDate: Pricing period start date. This date must be later than,
  9027. // or the same day as, the placement start date. The hours, minutes, and
  9028. // seconds of the start date should not be set, as doing so will result
  9029. // in an error.
  9030. StartDate string `json:"startDate,omitempty"`
  9031. // Units: Units of this pricing period. Acceptable values are 0 to
  9032. // 10000000000, inclusive.
  9033. Units int64 `json:"units,omitempty,string"`
  9034. // ForceSendFields is a list of field names (e.g. "EndDate") to
  9035. // unconditionally include in API requests. By default, fields with
  9036. // empty values are omitted from API requests. However, any non-pointer,
  9037. // non-interface field appearing in ForceSendFields will be sent to the
  9038. // server regardless of whether the field is empty or not. This may be
  9039. // used to include empty fields in Patch requests.
  9040. ForceSendFields []string `json:"-"`
  9041. // NullFields is a list of field names (e.g. "EndDate") to include in
  9042. // API requests with the JSON null value. By default, fields with empty
  9043. // values are omitted from API requests. However, any field with an
  9044. // empty value appearing in NullFields will be sent to the server as
  9045. // null. It is an error if a field in this list has a non-empty value.
  9046. // This may be used to include null fields in Patch requests.
  9047. NullFields []string `json:"-"`
  9048. }
  9049. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  9050. type NoMethod PricingSchedulePricingPeriod
  9051. raw := NoMethod(*s)
  9052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9053. }
  9054. // Project: Contains properties of a Planning project.
  9055. type Project struct {
  9056. // AccountId: Account ID of this project.
  9057. AccountId int64 `json:"accountId,omitempty,string"`
  9058. // AdvertiserId: Advertiser ID of this project.
  9059. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9060. // AudienceAgeGroup: Audience age group of this project.
  9061. //
  9062. // Possible values:
  9063. // "PLANNING_AUDIENCE_AGE_18_24"
  9064. // "PLANNING_AUDIENCE_AGE_25_34"
  9065. // "PLANNING_AUDIENCE_AGE_35_44"
  9066. // "PLANNING_AUDIENCE_AGE_45_54"
  9067. // "PLANNING_AUDIENCE_AGE_55_64"
  9068. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  9069. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  9070. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  9071. // AudienceGender: Audience gender of this project.
  9072. //
  9073. // Possible values:
  9074. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  9075. // "PLANNING_AUDIENCE_GENDER_MALE"
  9076. AudienceGender string `json:"audienceGender,omitempty"`
  9077. // Budget: Budget of this project in the currency specified by the
  9078. // current account. The value stored in this field represents only the
  9079. // non-fractional amount. For example, for USD, the smallest value that
  9080. // can be represented by this field is 1 US dollar.
  9081. Budget int64 `json:"budget,omitempty,string"`
  9082. // ClientBillingCode: Client billing code of this project.
  9083. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  9084. // ClientName: Name of the project client.
  9085. ClientName string `json:"clientName,omitempty"`
  9086. // EndDate: End date of the project.
  9087. EndDate string `json:"endDate,omitempty"`
  9088. // Id: ID of this project. This is a read-only, auto-generated field.
  9089. Id int64 `json:"id,omitempty,string"`
  9090. // Kind: Identifies what kind of resource this is. Value: the fixed
  9091. // string "dfareporting#project".
  9092. Kind string `json:"kind,omitempty"`
  9093. // LastModifiedInfo: Information about the most recent modification of
  9094. // this project.
  9095. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  9096. // Name: Name of this project.
  9097. Name string `json:"name,omitempty"`
  9098. // Overview: Overview of this project.
  9099. Overview string `json:"overview,omitempty"`
  9100. // StartDate: Start date of the project.
  9101. StartDate string `json:"startDate,omitempty"`
  9102. // SubaccountId: Subaccount ID of this project.
  9103. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9104. // TargetClicks: Number of clicks that the advertiser is targeting.
  9105. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  9106. // TargetConversions: Number of conversions that the advertiser is
  9107. // targeting.
  9108. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  9109. // TargetCpaNanos: CPA that the advertiser is targeting.
  9110. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  9111. // TargetCpcNanos: CPC that the advertiser is targeting.
  9112. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  9113. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  9114. // is targeting.
  9115. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  9116. // TargetCpmNanos: CPM that the advertiser is targeting.
  9117. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  9118. // TargetImpressions: Number of impressions that the advertiser is
  9119. // targeting.
  9120. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  9121. // ServerResponse contains the HTTP response code and headers from the
  9122. // server.
  9123. googleapi.ServerResponse `json:"-"`
  9124. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9125. // unconditionally include in API requests. By default, fields with
  9126. // empty values are omitted from API requests. However, any non-pointer,
  9127. // non-interface field appearing in ForceSendFields will be sent to the
  9128. // server regardless of whether the field is empty or not. This may be
  9129. // used to include empty fields in Patch requests.
  9130. ForceSendFields []string `json:"-"`
  9131. // NullFields is a list of field names (e.g. "AccountId") to include in
  9132. // API requests with the JSON null value. By default, fields with empty
  9133. // values are omitted from API requests. However, any field with an
  9134. // empty value appearing in NullFields will be sent to the server as
  9135. // null. It is an error if a field in this list has a non-empty value.
  9136. // This may be used to include null fields in Patch requests.
  9137. NullFields []string `json:"-"`
  9138. }
  9139. func (s *Project) MarshalJSON() ([]byte, error) {
  9140. type NoMethod Project
  9141. raw := NoMethod(*s)
  9142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9143. }
  9144. // ProjectsListResponse: Project List Response
  9145. type ProjectsListResponse struct {
  9146. // Kind: Identifies what kind of resource this is. Value: the fixed
  9147. // string "dfareporting#projectsListResponse".
  9148. Kind string `json:"kind,omitempty"`
  9149. // NextPageToken: Pagination token to be used for the next list
  9150. // operation.
  9151. NextPageToken string `json:"nextPageToken,omitempty"`
  9152. // Projects: Project collection.
  9153. Projects []*Project `json:"projects,omitempty"`
  9154. // ServerResponse contains the HTTP response code and headers from the
  9155. // server.
  9156. googleapi.ServerResponse `json:"-"`
  9157. // ForceSendFields is a list of field names (e.g. "Kind") to
  9158. // unconditionally include in API requests. By default, fields with
  9159. // empty values are omitted from API requests. However, any non-pointer,
  9160. // non-interface field appearing in ForceSendFields will be sent to the
  9161. // server regardless of whether the field is empty or not. This may be
  9162. // used to include empty fields in Patch requests.
  9163. ForceSendFields []string `json:"-"`
  9164. // NullFields is a list of field names (e.g. "Kind") to include in API
  9165. // requests with the JSON null value. By default, fields with empty
  9166. // values are omitted from API requests. However, any field with an
  9167. // empty value appearing in NullFields will be sent to the server as
  9168. // null. It is an error if a field in this list has a non-empty value.
  9169. // This may be used to include null fields in Patch requests.
  9170. NullFields []string `json:"-"`
  9171. }
  9172. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  9173. type NoMethod ProjectsListResponse
  9174. raw := NoMethod(*s)
  9175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9176. }
  9177. // ReachReportCompatibleFields: Represents fields that are compatible to
  9178. // be selected for a report of type "REACH".
  9179. type ReachReportCompatibleFields struct {
  9180. // DimensionFilters: Dimensions which are compatible to be selected in
  9181. // the "dimensionFilters" section of the report.
  9182. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9183. // Dimensions: Dimensions which are compatible to be selected in the
  9184. // "dimensions" section of the report.
  9185. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9186. // Kind: The kind of resource this is, in this case
  9187. // dfareporting#reachReportCompatibleFields.
  9188. Kind string `json:"kind,omitempty"`
  9189. // Metrics: Metrics which are compatible to be selected in the
  9190. // "metricNames" section of the report.
  9191. Metrics []*Metric `json:"metrics,omitempty"`
  9192. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9193. // as activity metrics to pivot on in the "activities" section of the
  9194. // report.
  9195. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9196. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  9197. // in the "reachByFrequencyMetricNames" section of the report.
  9198. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  9199. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9200. // unconditionally include in API requests. By default, fields with
  9201. // empty values are omitted from API requests. However, any non-pointer,
  9202. // non-interface field appearing in ForceSendFields will be sent to the
  9203. // server regardless of whether the field is empty or not. This may be
  9204. // used to include empty fields in Patch requests.
  9205. ForceSendFields []string `json:"-"`
  9206. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9207. // include in API requests with the JSON null value. By default, fields
  9208. // with empty values are omitted from API requests. However, any field
  9209. // with an empty value appearing in NullFields will be sent to the
  9210. // server as null. It is an error if a field in this list has a
  9211. // non-empty value. This may be used to include null fields in Patch
  9212. // requests.
  9213. NullFields []string `json:"-"`
  9214. }
  9215. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9216. type NoMethod ReachReportCompatibleFields
  9217. raw := NoMethod(*s)
  9218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9219. }
  9220. // Recipient: Represents a recipient.
  9221. type Recipient struct {
  9222. // DeliveryType: The delivery type for the recipient.
  9223. //
  9224. // Possible values:
  9225. // "ATTACHMENT"
  9226. // "LINK"
  9227. DeliveryType string `json:"deliveryType,omitempty"`
  9228. // Email: The email address of the recipient.
  9229. Email string `json:"email,omitempty"`
  9230. // Kind: The kind of resource this is, in this case
  9231. // dfareporting#recipient.
  9232. Kind string `json:"kind,omitempty"`
  9233. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9234. // unconditionally include in API requests. By default, fields with
  9235. // empty values are omitted from API requests. However, any non-pointer,
  9236. // non-interface field appearing in ForceSendFields will be sent to the
  9237. // server regardless of whether the field is empty or not. This may be
  9238. // used to include empty fields in Patch requests.
  9239. ForceSendFields []string `json:"-"`
  9240. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9241. // in API requests with the JSON null value. By default, fields with
  9242. // empty values are omitted from API requests. However, any field with
  9243. // an empty value appearing in NullFields will be sent to the server as
  9244. // null. It is an error if a field in this list has a non-empty value.
  9245. // This may be used to include null fields in Patch requests.
  9246. NullFields []string `json:"-"`
  9247. }
  9248. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9249. type NoMethod Recipient
  9250. raw := NoMethod(*s)
  9251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9252. }
  9253. // Region: Contains information about a region that can be targeted by
  9254. // ads.
  9255. type Region struct {
  9256. // CountryCode: Country code of the country to which this region
  9257. // belongs.
  9258. CountryCode string `json:"countryCode,omitempty"`
  9259. // CountryDartId: DART ID of the country to which this region belongs.
  9260. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9261. // DartId: DART ID of this region.
  9262. DartId int64 `json:"dartId,omitempty,string"`
  9263. // Kind: Identifies what kind of resource this is. Value: the fixed
  9264. // string "dfareporting#region".
  9265. Kind string `json:"kind,omitempty"`
  9266. // Name: Name of this region.
  9267. Name string `json:"name,omitempty"`
  9268. // RegionCode: Region code.
  9269. RegionCode string `json:"regionCode,omitempty"`
  9270. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9271. // unconditionally include in API requests. By default, fields with
  9272. // empty values are omitted from API requests. However, any non-pointer,
  9273. // non-interface field appearing in ForceSendFields will be sent to the
  9274. // server regardless of whether the field is empty or not. This may be
  9275. // used to include empty fields in Patch requests.
  9276. ForceSendFields []string `json:"-"`
  9277. // NullFields is a list of field names (e.g. "CountryCode") to include
  9278. // in API requests with the JSON null value. By default, fields with
  9279. // empty values are omitted from API requests. However, any field with
  9280. // an empty value appearing in NullFields will be sent to the server as
  9281. // null. It is an error if a field in this list has a non-empty value.
  9282. // This may be used to include null fields in Patch requests.
  9283. NullFields []string `json:"-"`
  9284. }
  9285. func (s *Region) MarshalJSON() ([]byte, error) {
  9286. type NoMethod Region
  9287. raw := NoMethod(*s)
  9288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9289. }
  9290. // RegionsListResponse: Region List Response
  9291. type RegionsListResponse struct {
  9292. // Kind: Identifies what kind of resource this is. Value: the fixed
  9293. // string "dfareporting#regionsListResponse".
  9294. Kind string `json:"kind,omitempty"`
  9295. // Regions: Region collection.
  9296. Regions []*Region `json:"regions,omitempty"`
  9297. // ServerResponse contains the HTTP response code and headers from the
  9298. // server.
  9299. googleapi.ServerResponse `json:"-"`
  9300. // ForceSendFields is a list of field names (e.g. "Kind") to
  9301. // unconditionally include in API requests. By default, fields with
  9302. // empty values are omitted from API requests. However, any non-pointer,
  9303. // non-interface field appearing in ForceSendFields will be sent to the
  9304. // server regardless of whether the field is empty or not. This may be
  9305. // used to include empty fields in Patch requests.
  9306. ForceSendFields []string `json:"-"`
  9307. // NullFields is a list of field names (e.g. "Kind") to include in API
  9308. // requests with the JSON null value. By default, fields with empty
  9309. // values are omitted from API requests. However, any field with an
  9310. // empty value appearing in NullFields will be sent to the server as
  9311. // null. It is an error if a field in this list has a non-empty value.
  9312. // This may be used to include null fields in Patch requests.
  9313. NullFields []string `json:"-"`
  9314. }
  9315. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9316. type NoMethod RegionsListResponse
  9317. raw := NoMethod(*s)
  9318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9319. }
  9320. // RemarketingList: Contains properties of a remarketing list.
  9321. // Remarketing enables you to create lists of users who have performed
  9322. // specific actions on a site, then target ads to members of those
  9323. // lists. This resource can be used to manage remarketing lists that are
  9324. // owned by your advertisers. To see all remarketing lists that are
  9325. // visible to your advertisers, including those that are shared to your
  9326. // advertiser or account, use the TargetableRemarketingLists resource.
  9327. type RemarketingList struct {
  9328. // AccountId: Account ID of this remarketing list. This is a read-only,
  9329. // auto-generated field that is only returned in GET requests.
  9330. AccountId int64 `json:"accountId,omitempty,string"`
  9331. // Active: Whether this remarketing list is active.
  9332. Active bool `json:"active,omitempty"`
  9333. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9334. // remarketing list. This is a required field.
  9335. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9336. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9337. // advertiser. This is a read-only, auto-generated field.
  9338. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9339. // Description: Remarketing list description.
  9340. Description string `json:"description,omitempty"`
  9341. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9342. Id int64 `json:"id,omitempty,string"`
  9343. // Kind: Identifies what kind of resource this is. Value: the fixed
  9344. // string "dfareporting#remarketingList".
  9345. Kind string `json:"kind,omitempty"`
  9346. // LifeSpan: Number of days that a user should remain in the remarketing
  9347. // list without an impression. Acceptable values are 1 to 540,
  9348. // inclusive.
  9349. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9350. // ListPopulationRule: Rule used to populate the remarketing list with
  9351. // users.
  9352. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9353. // ListSize: Number of users currently in the list. This is a read-only
  9354. // field.
  9355. ListSize int64 `json:"listSize,omitempty,string"`
  9356. // ListSource: Product from which this remarketing list was originated.
  9357. //
  9358. // Possible values:
  9359. // "REMARKETING_LIST_SOURCE_ADX"
  9360. // "REMARKETING_LIST_SOURCE_DBM"
  9361. // "REMARKETING_LIST_SOURCE_DFA"
  9362. // "REMARKETING_LIST_SOURCE_DFP"
  9363. // "REMARKETING_LIST_SOURCE_DMP"
  9364. // "REMARKETING_LIST_SOURCE_GA"
  9365. // "REMARKETING_LIST_SOURCE_GPLUS"
  9366. // "REMARKETING_LIST_SOURCE_OTHER"
  9367. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9368. // "REMARKETING_LIST_SOURCE_XFP"
  9369. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9370. ListSource string `json:"listSource,omitempty"`
  9371. // Name: Name of the remarketing list. This is a required field. Must be
  9372. // no greater than 128 characters long.
  9373. Name string `json:"name,omitempty"`
  9374. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9375. // read-only, auto-generated field that is only returned in GET
  9376. // requests.
  9377. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9378. // ServerResponse contains the HTTP response code and headers from the
  9379. // server.
  9380. googleapi.ServerResponse `json:"-"`
  9381. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9382. // unconditionally include in API requests. By default, fields with
  9383. // empty values are omitted from API requests. However, any non-pointer,
  9384. // non-interface field appearing in ForceSendFields will be sent to the
  9385. // server regardless of whether the field is empty or not. This may be
  9386. // used to include empty fields in Patch requests.
  9387. ForceSendFields []string `json:"-"`
  9388. // NullFields is a list of field names (e.g. "AccountId") to include in
  9389. // API requests with the JSON null value. By default, fields with empty
  9390. // values are omitted from API requests. However, any field with an
  9391. // empty value appearing in NullFields will be sent to the server as
  9392. // null. It is an error if a field in this list has a non-empty value.
  9393. // This may be used to include null fields in Patch requests.
  9394. NullFields []string `json:"-"`
  9395. }
  9396. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9397. type NoMethod RemarketingList
  9398. raw := NoMethod(*s)
  9399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9400. }
  9401. // RemarketingListShare: Contains properties of a remarketing list's
  9402. // sharing information. Sharing allows other accounts or advertisers to
  9403. // target to your remarketing lists. This resource can be used to manage
  9404. // remarketing list sharing to other accounts and advertisers.
  9405. type RemarketingListShare struct {
  9406. // Kind: Identifies what kind of resource this is. Value: the fixed
  9407. // string "dfareporting#remarketingListShare".
  9408. Kind string `json:"kind,omitempty"`
  9409. // RemarketingListId: Remarketing list ID. This is a read-only,
  9410. // auto-generated field.
  9411. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9412. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9413. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9414. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9415. // with.
  9416. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9417. // ServerResponse contains the HTTP response code and headers from the
  9418. // server.
  9419. googleapi.ServerResponse `json:"-"`
  9420. // ForceSendFields is a list of field names (e.g. "Kind") to
  9421. // unconditionally include in API requests. By default, fields with
  9422. // empty values are omitted from API requests. However, any non-pointer,
  9423. // non-interface field appearing in ForceSendFields will be sent to the
  9424. // server regardless of whether the field is empty or not. This may be
  9425. // used to include empty fields in Patch requests.
  9426. ForceSendFields []string `json:"-"`
  9427. // NullFields is a list of field names (e.g. "Kind") to include in API
  9428. // requests with the JSON null value. By default, fields with empty
  9429. // values are omitted from API requests. However, any field with an
  9430. // empty value appearing in NullFields will be sent to the server as
  9431. // null. It is an error if a field in this list has a non-empty value.
  9432. // This may be used to include null fields in Patch requests.
  9433. NullFields []string `json:"-"`
  9434. }
  9435. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9436. type NoMethod RemarketingListShare
  9437. raw := NoMethod(*s)
  9438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9439. }
  9440. // RemarketingListsListResponse: Remarketing list response
  9441. type RemarketingListsListResponse struct {
  9442. // Kind: Identifies what kind of resource this is. Value: the fixed
  9443. // string "dfareporting#remarketingListsListResponse".
  9444. Kind string `json:"kind,omitempty"`
  9445. // NextPageToken: Pagination token to be used for the next list
  9446. // operation.
  9447. NextPageToken string `json:"nextPageToken,omitempty"`
  9448. // RemarketingLists: Remarketing list collection.
  9449. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9450. // ServerResponse contains the HTTP response code and headers from the
  9451. // server.
  9452. googleapi.ServerResponse `json:"-"`
  9453. // ForceSendFields is a list of field names (e.g. "Kind") to
  9454. // unconditionally include in API requests. By default, fields with
  9455. // empty values are omitted from API requests. However, any non-pointer,
  9456. // non-interface field appearing in ForceSendFields will be sent to the
  9457. // server regardless of whether the field is empty or not. This may be
  9458. // used to include empty fields in Patch requests.
  9459. ForceSendFields []string `json:"-"`
  9460. // NullFields is a list of field names (e.g. "Kind") to include in API
  9461. // requests with the JSON null value. By default, fields with empty
  9462. // values are omitted from API requests. However, any field with an
  9463. // empty value appearing in NullFields will be sent to the server as
  9464. // null. It is an error if a field in this list has a non-empty value.
  9465. // This may be used to include null fields in Patch requests.
  9466. NullFields []string `json:"-"`
  9467. }
  9468. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9469. type NoMethod RemarketingListsListResponse
  9470. raw := NoMethod(*s)
  9471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9472. }
  9473. // Report: Represents a Report resource.
  9474. type Report struct {
  9475. // AccountId: The account ID to which this report belongs.
  9476. AccountId int64 `json:"accountId,omitempty,string"`
  9477. // Criteria: The report criteria for a report of type "STANDARD".
  9478. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9479. // CrossDimensionReachCriteria: The report criteria for a report of type
  9480. // "CROSS_DIMENSION_REACH".
  9481. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9482. // Delivery: The report's email delivery settings.
  9483. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9484. // Etag: The eTag of this response for caching purposes.
  9485. Etag string `json:"etag,omitempty"`
  9486. // FileName: The filename used when generating report files for this
  9487. // report.
  9488. FileName string `json:"fileName,omitempty"`
  9489. // FloodlightCriteria: The report criteria for a report of type
  9490. // "FLOODLIGHT".
  9491. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9492. // Format: The output format of the report. If not specified, default
  9493. // format is "CSV". Note that the actual format in the completed report
  9494. // file might differ if for instance the report's size exceeds the
  9495. // format's capabilities. "CSV" will then be the fallback format.
  9496. //
  9497. // Possible values:
  9498. // "CSV"
  9499. // "EXCEL"
  9500. Format string `json:"format,omitempty"`
  9501. // Id: The unique ID identifying this report resource.
  9502. Id int64 `json:"id,omitempty,string"`
  9503. // Kind: The kind of resource this is, in this case dfareporting#report.
  9504. Kind string `json:"kind,omitempty"`
  9505. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9506. // this report was last modified.
  9507. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9508. // Name: The name of the report.
  9509. Name string `json:"name,omitempty"`
  9510. // OwnerProfileId: The user profile id of the owner of this report.
  9511. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9512. // PathToConversionCriteria: The report criteria for a report of type
  9513. // "PATH_TO_CONVERSION".
  9514. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9515. // ReachCriteria: The report criteria for a report of type "REACH".
  9516. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9517. // Schedule: The report's schedule. Can only be set if the report's
  9518. // 'dateRange' is a relative date range and the relative date range is
  9519. // not "TODAY".
  9520. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9521. // SubAccountId: The subaccount ID to which this report belongs if
  9522. // applicable.
  9523. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9524. // Type: The type of the report.
  9525. //
  9526. // Possible values:
  9527. // "CROSS_DIMENSION_REACH"
  9528. // "FLOODLIGHT"
  9529. // "PATH_TO_CONVERSION"
  9530. // "REACH"
  9531. // "STANDARD"
  9532. Type string `json:"type,omitempty"`
  9533. // ServerResponse contains the HTTP response code and headers from the
  9534. // server.
  9535. googleapi.ServerResponse `json:"-"`
  9536. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9537. // unconditionally include in API requests. By default, fields with
  9538. // empty values are omitted from API requests. However, any non-pointer,
  9539. // non-interface field appearing in ForceSendFields will be sent to the
  9540. // server regardless of whether the field is empty or not. This may be
  9541. // used to include empty fields in Patch requests.
  9542. ForceSendFields []string `json:"-"`
  9543. // NullFields is a list of field names (e.g. "AccountId") to include in
  9544. // API requests with the JSON null value. By default, fields with empty
  9545. // values are omitted from API requests. However, any field with an
  9546. // empty value appearing in NullFields will be sent to the server as
  9547. // null. It is an error if a field in this list has a non-empty value.
  9548. // This may be used to include null fields in Patch requests.
  9549. NullFields []string `json:"-"`
  9550. }
  9551. func (s *Report) MarshalJSON() ([]byte, error) {
  9552. type NoMethod Report
  9553. raw := NoMethod(*s)
  9554. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9555. }
  9556. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9557. type ReportCriteria struct {
  9558. // Activities: Activity group.
  9559. Activities *Activities `json:"activities,omitempty"`
  9560. // CustomRichMediaEvents: Custom Rich Media Events group.
  9561. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9562. // DateRange: The date range for which this report should be run.
  9563. DateRange *DateRange `json:"dateRange,omitempty"`
  9564. // DimensionFilters: The list of filters on which dimensions are
  9565. // filtered.
  9566. // Filters for different dimensions are ANDed, filters for the same
  9567. // dimension are grouped together and ORed.
  9568. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9569. // Dimensions: The list of standard dimensions the report should
  9570. // include.
  9571. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9572. // MetricNames: The list of names of metrics the report should include.
  9573. MetricNames []string `json:"metricNames,omitempty"`
  9574. // ForceSendFields is a list of field names (e.g. "Activities") to
  9575. // unconditionally include in API requests. By default, fields with
  9576. // empty values are omitted from API requests. However, any non-pointer,
  9577. // non-interface field appearing in ForceSendFields will be sent to the
  9578. // server regardless of whether the field is empty or not. This may be
  9579. // used to include empty fields in Patch requests.
  9580. ForceSendFields []string `json:"-"`
  9581. // NullFields is a list of field names (e.g. "Activities") to include in
  9582. // API requests with the JSON null value. By default, fields with empty
  9583. // values are omitted from API requests. However, any field with an
  9584. // empty value appearing in NullFields will be sent to the server as
  9585. // null. It is an error if a field in this list has a non-empty value.
  9586. // This may be used to include null fields in Patch requests.
  9587. NullFields []string `json:"-"`
  9588. }
  9589. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9590. type NoMethod ReportCriteria
  9591. raw := NoMethod(*s)
  9592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9593. }
  9594. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9595. // of type "CROSS_DIMENSION_REACH".
  9596. type ReportCrossDimensionReachCriteria struct {
  9597. // Breakdown: The list of dimensions the report should include.
  9598. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9599. // DateRange: The date range this report should be run for.
  9600. DateRange *DateRange `json:"dateRange,omitempty"`
  9601. // Dimension: The dimension option.
  9602. //
  9603. // Possible values:
  9604. // "ADVERTISER"
  9605. // "CAMPAIGN"
  9606. // "SITE_BY_ADVERTISER"
  9607. // "SITE_BY_CAMPAIGN"
  9608. Dimension string `json:"dimension,omitempty"`
  9609. // DimensionFilters: The list of filters on which dimensions are
  9610. // filtered.
  9611. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9612. // MetricNames: The list of names of metrics the report should include.
  9613. MetricNames []string `json:"metricNames,omitempty"`
  9614. // OverlapMetricNames: The list of names of overlap metrics the report
  9615. // should include.
  9616. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9617. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9618. Pivoted bool `json:"pivoted,omitempty"`
  9619. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9620. // unconditionally include in API requests. By default, fields with
  9621. // empty values are omitted from API requests. However, any non-pointer,
  9622. // non-interface field appearing in ForceSendFields will be sent to the
  9623. // server regardless of whether the field is empty or not. This may be
  9624. // used to include empty fields in Patch requests.
  9625. ForceSendFields []string `json:"-"`
  9626. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9627. // API requests with the JSON null value. By default, fields with empty
  9628. // values are omitted from API requests. However, any field with an
  9629. // empty value appearing in NullFields will be sent to the server as
  9630. // null. It is an error if a field in this list has a non-empty value.
  9631. // This may be used to include null fields in Patch requests.
  9632. NullFields []string `json:"-"`
  9633. }
  9634. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9635. type NoMethod ReportCrossDimensionReachCriteria
  9636. raw := NoMethod(*s)
  9637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9638. }
  9639. // ReportDelivery: The report's email delivery settings.
  9640. type ReportDelivery struct {
  9641. // EmailOwner: Whether the report should be emailed to the report owner.
  9642. EmailOwner bool `json:"emailOwner,omitempty"`
  9643. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9644. // receive, if enabled.
  9645. //
  9646. // Possible values:
  9647. // "ATTACHMENT"
  9648. // "LINK"
  9649. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9650. // Message: The message to be sent with each email.
  9651. Message string `json:"message,omitempty"`
  9652. // Recipients: The list of recipients to which to email the report.
  9653. Recipients []*Recipient `json:"recipients,omitempty"`
  9654. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9655. // unconditionally include in API requests. By default, fields with
  9656. // empty values are omitted from API requests. However, any non-pointer,
  9657. // non-interface field appearing in ForceSendFields will be sent to the
  9658. // server regardless of whether the field is empty or not. This may be
  9659. // used to include empty fields in Patch requests.
  9660. ForceSendFields []string `json:"-"`
  9661. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9662. // API requests with the JSON null value. By default, fields with empty
  9663. // values are omitted from API requests. However, any field with an
  9664. // empty value appearing in NullFields will be sent to the server as
  9665. // null. It is an error if a field in this list has a non-empty value.
  9666. // This may be used to include null fields in Patch requests.
  9667. NullFields []string `json:"-"`
  9668. }
  9669. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9670. type NoMethod ReportDelivery
  9671. raw := NoMethod(*s)
  9672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9673. }
  9674. // ReportFloodlightCriteria: The report criteria for a report of type
  9675. // "FLOODLIGHT".
  9676. type ReportFloodlightCriteria struct {
  9677. // CustomRichMediaEvents: The list of custom rich media events to
  9678. // include.
  9679. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9680. // DateRange: The date range this report should be run for.
  9681. DateRange *DateRange `json:"dateRange,omitempty"`
  9682. // DimensionFilters: The list of filters on which dimensions are
  9683. // filtered.
  9684. // Filters for different dimensions are ANDed, filters for the same
  9685. // dimension are grouped together and ORed.
  9686. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9687. // Dimensions: The list of dimensions the report should include.
  9688. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9689. // FloodlightConfigId: The floodlight ID for which to show data in this
  9690. // report. All advertisers associated with that ID will automatically be
  9691. // added. The dimension of the value needs to be
  9692. // 'dfa:floodlightConfigId'.
  9693. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9694. // MetricNames: The list of names of metrics the report should include.
  9695. MetricNames []string `json:"metricNames,omitempty"`
  9696. // ReportProperties: The properties of the report.
  9697. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9698. // ForceSendFields is a list of field names (e.g.
  9699. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9700. // By default, fields with empty values are omitted from API requests.
  9701. // However, any non-pointer, non-interface field appearing in
  9702. // ForceSendFields will be sent to the server regardless of whether the
  9703. // field is empty or not. This may be used to include empty fields in
  9704. // Patch requests.
  9705. ForceSendFields []string `json:"-"`
  9706. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9707. // include in API requests with the JSON null value. By default, fields
  9708. // with empty values are omitted from API requests. However, any field
  9709. // with an empty value appearing in NullFields will be sent to the
  9710. // server as null. It is an error if a field in this list has a
  9711. // non-empty value. This may be used to include null fields in Patch
  9712. // requests.
  9713. NullFields []string `json:"-"`
  9714. }
  9715. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9716. type NoMethod ReportFloodlightCriteria
  9717. raw := NoMethod(*s)
  9718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9719. }
  9720. // ReportFloodlightCriteriaReportProperties: The properties of the
  9721. // report.
  9722. type ReportFloodlightCriteriaReportProperties struct {
  9723. // IncludeAttributedIPConversions: Include conversions that have no
  9724. // cookie, but do have an exposure path.
  9725. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9726. // IncludeUnattributedCookieConversions: Include conversions of users
  9727. // with a DoubleClick cookie but without an exposure. That means the
  9728. // user did not click or see an ad from the advertiser within the
  9729. // Floodlight group, or that the interaction happened outside the
  9730. // lookback window.
  9731. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9732. // IncludeUnattributedIPConversions: Include conversions that have no
  9733. // associated cookies and no exposures. It’s therefore impossible to
  9734. // know how the user was exposed to your ads during the lookback window
  9735. // prior to a conversion.
  9736. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9737. // ForceSendFields is a list of field names (e.g.
  9738. // "IncludeAttributedIPConversions") to unconditionally include in API
  9739. // requests. By default, fields with empty values are omitted from API
  9740. // requests. However, any non-pointer, non-interface field appearing in
  9741. // ForceSendFields will be sent to the server regardless of whether the
  9742. // field is empty or not. This may be used to include empty fields in
  9743. // Patch requests.
  9744. ForceSendFields []string `json:"-"`
  9745. // NullFields is a list of field names (e.g.
  9746. // "IncludeAttributedIPConversions") to include in API requests with the
  9747. // JSON null value. By default, fields with empty values are omitted
  9748. // from API requests. However, any field with an empty value appearing
  9749. // in NullFields will be sent to the server as null. It is an error if a
  9750. // field in this list has a non-empty value. This may be used to include
  9751. // null fields in Patch requests.
  9752. NullFields []string `json:"-"`
  9753. }
  9754. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9755. type NoMethod ReportFloodlightCriteriaReportProperties
  9756. raw := NoMethod(*s)
  9757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9758. }
  9759. // ReportPathToConversionCriteria: The report criteria for a report of
  9760. // type "PATH_TO_CONVERSION".
  9761. type ReportPathToConversionCriteria struct {
  9762. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9763. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9764. // ConversionDimensions: The list of conversion dimensions the report
  9765. // should include.
  9766. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9767. // CustomFloodlightVariables: The list of custom floodlight variables
  9768. // the report should include.
  9769. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9770. // CustomRichMediaEvents: The list of custom rich media events to
  9771. // include.
  9772. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9773. // DateRange: The date range this report should be run for.
  9774. DateRange *DateRange `json:"dateRange,omitempty"`
  9775. // FloodlightConfigId: The floodlight ID for which to show data in this
  9776. // report. All advertisers associated with that ID will automatically be
  9777. // added. The dimension of the value needs to be
  9778. // 'dfa:floodlightConfigId'.
  9779. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9780. // MetricNames: The list of names of metrics the report should include.
  9781. MetricNames []string `json:"metricNames,omitempty"`
  9782. // PerInteractionDimensions: The list of per interaction dimensions the
  9783. // report should include.
  9784. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9785. // ReportProperties: The properties of the report.
  9786. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9787. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9788. // unconditionally include in API requests. By default, fields with
  9789. // empty values are omitted from API requests. However, any non-pointer,
  9790. // non-interface field appearing in ForceSendFields will be sent to the
  9791. // server regardless of whether the field is empty or not. This may be
  9792. // used to include empty fields in Patch requests.
  9793. ForceSendFields []string `json:"-"`
  9794. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9795. // include in API requests with the JSON null value. By default, fields
  9796. // with empty values are omitted from API requests. However, any field
  9797. // with an empty value appearing in NullFields will be sent to the
  9798. // server as null. It is an error if a field in this list has a
  9799. // non-empty value. This may be used to include null fields in Patch
  9800. // requests.
  9801. NullFields []string `json:"-"`
  9802. }
  9803. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9804. type NoMethod ReportPathToConversionCriteria
  9805. raw := NoMethod(*s)
  9806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9807. }
  9808. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9809. // report.
  9810. type ReportPathToConversionCriteriaReportProperties struct {
  9811. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9812. // occurred within the specified period of time before a conversion. By
  9813. // default the value is pulled from Floodlight or you can manually enter
  9814. // a custom value. Valid values: 1-90.
  9815. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9816. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9817. // interaction occurred within the specified period of time before a
  9818. // conversion. By default the value is pulled from Floodlight or you can
  9819. // manually enter a custom value. Valid values: 1-90.
  9820. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9821. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9822. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9823. // IncludeUnattributedCookieConversions: Include conversions of users
  9824. // with a DoubleClick cookie but without an exposure. That means the
  9825. // user did not click or see an ad from the advertiser within the
  9826. // Floodlight group, or that the interaction happened outside the
  9827. // lookback window.
  9828. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9829. // IncludeUnattributedIPConversions: Include conversions that have no
  9830. // associated cookies and no exposures. It’s therefore impossible to
  9831. // know how the user was exposed to your ads during the lookback window
  9832. // prior to a conversion.
  9833. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9834. // MaximumClickInteractions: The maximum number of click interactions to
  9835. // include in the report. Advertisers currently paying for E2C reports
  9836. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9837. // your network is paying for E2C, you can have up to 5 total exposures
  9838. // per report.
  9839. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9840. // MaximumImpressionInteractions: The maximum number of click
  9841. // interactions to include in the report. Advertisers currently paying
  9842. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9843. // another advertiser in your network is paying for E2C, you can have up
  9844. // to 5 total exposures per report.
  9845. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9846. // MaximumInteractionGap: The maximum amount of time that can take place
  9847. // between interactions (clicks or impressions) by the same user. Valid
  9848. // values: 1-90.
  9849. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9850. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9851. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9852. // ForceSendFields is a list of field names (e.g.
  9853. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9854. // By default, fields with empty values are omitted from API requests.
  9855. // However, any non-pointer, non-interface field appearing in
  9856. // ForceSendFields will be sent to the server regardless of whether the
  9857. // field is empty or not. This may be used to include empty fields in
  9858. // Patch requests.
  9859. ForceSendFields []string `json:"-"`
  9860. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  9861. // include in API requests with the JSON null value. By default, fields
  9862. // with empty values are omitted from API requests. However, any field
  9863. // with an empty value appearing in NullFields will be sent to the
  9864. // server as null. It is an error if a field in this list has a
  9865. // non-empty value. This may be used to include null fields in Patch
  9866. // requests.
  9867. NullFields []string `json:"-"`
  9868. }
  9869. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9870. type NoMethod ReportPathToConversionCriteriaReportProperties
  9871. raw := NoMethod(*s)
  9872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9873. }
  9874. // ReportReachCriteria: The report criteria for a report of type
  9875. // "REACH".
  9876. type ReportReachCriteria struct {
  9877. // Activities: Activity group.
  9878. Activities *Activities `json:"activities,omitempty"`
  9879. // CustomRichMediaEvents: Custom Rich Media Events group.
  9880. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9881. // DateRange: The date range this report should be run for.
  9882. DateRange *DateRange `json:"dateRange,omitempty"`
  9883. // DimensionFilters: The list of filters on which dimensions are
  9884. // filtered.
  9885. // Filters for different dimensions are ANDed, filters for the same
  9886. // dimension are grouped together and ORed.
  9887. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9888. // Dimensions: The list of dimensions the report should include.
  9889. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9890. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  9891. // combinations in the report. Defaults to false. If enabled, the date
  9892. // range of the report should be within the last 42 days.
  9893. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  9894. // MetricNames: The list of names of metrics the report should include.
  9895. MetricNames []string `json:"metricNames,omitempty"`
  9896. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  9897. // metrics the report should include.
  9898. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  9899. // ForceSendFields is a list of field names (e.g. "Activities") to
  9900. // unconditionally include in API requests. By default, fields with
  9901. // empty values are omitted from API requests. However, any non-pointer,
  9902. // non-interface field appearing in ForceSendFields will be sent to the
  9903. // server regardless of whether the field is empty or not. This may be
  9904. // used to include empty fields in Patch requests.
  9905. ForceSendFields []string `json:"-"`
  9906. // NullFields is a list of field names (e.g. "Activities") to include in
  9907. // API requests with the JSON null value. By default, fields with empty
  9908. // values are omitted from API requests. However, any field with an
  9909. // empty value appearing in NullFields will be sent to the server as
  9910. // null. It is an error if a field in this list has a non-empty value.
  9911. // This may be used to include null fields in Patch requests.
  9912. NullFields []string `json:"-"`
  9913. }
  9914. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  9915. type NoMethod ReportReachCriteria
  9916. raw := NoMethod(*s)
  9917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9918. }
  9919. // ReportSchedule: The report's schedule. Can only be set if the
  9920. // report's 'dateRange' is a relative date range and the relative date
  9921. // range is not "TODAY".
  9922. type ReportSchedule struct {
  9923. // Active: Whether the schedule is active or not. Must be set to either
  9924. // true or false.
  9925. Active bool `json:"active,omitempty"`
  9926. // Every: Defines every how many days, weeks or months the report should
  9927. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  9928. // "MONTHLY".
  9929. Every int64 `json:"every,omitempty"`
  9930. // ExpirationDate: The expiration date when the scheduled report stops
  9931. // running.
  9932. ExpirationDate string `json:"expirationDate,omitempty"`
  9933. // Repeats: The interval for which the report is repeated. Note:
  9934. // - "DAILY" also requires field "every" to be set.
  9935. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  9936. // set.
  9937. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  9938. // set.
  9939. Repeats string `json:"repeats,omitempty"`
  9940. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  9941. // reports should run.
  9942. //
  9943. // Possible values:
  9944. // "FRIDAY"
  9945. // "MONDAY"
  9946. // "SATURDAY"
  9947. // "SUNDAY"
  9948. // "THURSDAY"
  9949. // "TUESDAY"
  9950. // "WEDNESDAY"
  9951. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  9952. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  9953. // whether reports should be repeated on the same day of the month as
  9954. // "startDate" or the same day of the week of the month.
  9955. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  9956. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  9957. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  9958. // Monday of the month.
  9959. //
  9960. // Possible values:
  9961. // "DAY_OF_MONTH"
  9962. // "WEEK_OF_MONTH"
  9963. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  9964. // StartDate: Start date of date range for which scheduled reports
  9965. // should be run.
  9966. StartDate string `json:"startDate,omitempty"`
  9967. // ForceSendFields is a list of field names (e.g. "Active") to
  9968. // unconditionally include in API requests. By default, fields with
  9969. // empty values are omitted from API requests. However, any non-pointer,
  9970. // non-interface field appearing in ForceSendFields will be sent to the
  9971. // server regardless of whether the field is empty or not. This may be
  9972. // used to include empty fields in Patch requests.
  9973. ForceSendFields []string `json:"-"`
  9974. // NullFields is a list of field names (e.g. "Active") to include in API
  9975. // requests with the JSON null value. By default, fields with empty
  9976. // values are omitted from API requests. However, any field with an
  9977. // empty value appearing in NullFields will be sent to the server as
  9978. // null. It is an error if a field in this list has a non-empty value.
  9979. // This may be used to include null fields in Patch requests.
  9980. NullFields []string `json:"-"`
  9981. }
  9982. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  9983. type NoMethod ReportSchedule
  9984. raw := NoMethod(*s)
  9985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9986. }
  9987. // ReportCompatibleFields: Represents fields that are compatible to be
  9988. // selected for a report of type "STANDARD".
  9989. type ReportCompatibleFields struct {
  9990. // DimensionFilters: Dimensions which are compatible to be selected in
  9991. // the "dimensionFilters" section of the report.
  9992. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9993. // Dimensions: Dimensions which are compatible to be selected in the
  9994. // "dimensions" section of the report.
  9995. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9996. // Kind: The kind of resource this is, in this case
  9997. // dfareporting#reportCompatibleFields.
  9998. Kind string `json:"kind,omitempty"`
  9999. // Metrics: Metrics which are compatible to be selected in the
  10000. // "metricNames" section of the report.
  10001. Metrics []*Metric `json:"metrics,omitempty"`
  10002. // PivotedActivityMetrics: Metrics which are compatible to be selected
  10003. // as activity metrics to pivot on in the "activities" section of the
  10004. // report.
  10005. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  10006. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  10007. // unconditionally include in API requests. By default, fields with
  10008. // empty values are omitted from API requests. However, any non-pointer,
  10009. // non-interface field appearing in ForceSendFields will be sent to the
  10010. // server regardless of whether the field is empty or not. This may be
  10011. // used to include empty fields in Patch requests.
  10012. ForceSendFields []string `json:"-"`
  10013. // NullFields is a list of field names (e.g. "DimensionFilters") to
  10014. // include in API requests with the JSON null value. By default, fields
  10015. // with empty values are omitted from API requests. However, any field
  10016. // with an empty value appearing in NullFields will be sent to the
  10017. // server as null. It is an error if a field in this list has a
  10018. // non-empty value. This may be used to include null fields in Patch
  10019. // requests.
  10020. NullFields []string `json:"-"`
  10021. }
  10022. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  10023. type NoMethod ReportCompatibleFields
  10024. raw := NoMethod(*s)
  10025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10026. }
  10027. // ReportList: Represents the list of reports.
  10028. type ReportList struct {
  10029. // Etag: The eTag of this response for caching purposes.
  10030. Etag string `json:"etag,omitempty"`
  10031. // Items: The reports returned in this response.
  10032. Items []*Report `json:"items,omitempty"`
  10033. // Kind: The kind of list this is, in this case dfareporting#reportList.
  10034. Kind string `json:"kind,omitempty"`
  10035. // NextPageToken: Continuation token used to page through reports. To
  10036. // retrieve the next page of results, set the next request's "pageToken"
  10037. // to the value of this field. The page token is only valid for a
  10038. // limited amount of time and should not be persisted.
  10039. NextPageToken string `json:"nextPageToken,omitempty"`
  10040. // ServerResponse contains the HTTP response code and headers from the
  10041. // server.
  10042. googleapi.ServerResponse `json:"-"`
  10043. // ForceSendFields is a list of field names (e.g. "Etag") to
  10044. // unconditionally include in API requests. By default, fields with
  10045. // empty values are omitted from API requests. However, any non-pointer,
  10046. // non-interface field appearing in ForceSendFields will be sent to the
  10047. // server regardless of whether the field is empty or not. This may be
  10048. // used to include empty fields in Patch requests.
  10049. ForceSendFields []string `json:"-"`
  10050. // NullFields is a list of field names (e.g. "Etag") to include in API
  10051. // requests with the JSON null value. By default, fields with empty
  10052. // values are omitted from API requests. However, any field with an
  10053. // empty value appearing in NullFields will be sent to the server as
  10054. // null. It is an error if a field in this list has a non-empty value.
  10055. // This may be used to include null fields in Patch requests.
  10056. NullFields []string `json:"-"`
  10057. }
  10058. func (s *ReportList) MarshalJSON() ([]byte, error) {
  10059. type NoMethod ReportList
  10060. raw := NoMethod(*s)
  10061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10062. }
  10063. // ReportsConfiguration: Reporting Configuration
  10064. type ReportsConfiguration struct {
  10065. // ExposureToConversionEnabled: Whether the exposure to conversion
  10066. // report is enabled. This report shows detailed pathway information on
  10067. // up to 10 of the most recent ad exposures seen by a user before
  10068. // converting.
  10069. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  10070. // LookbackConfiguration: Default lookback windows for new advertisers
  10071. // in this account.
  10072. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10073. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  10074. // account. This is a required field that can only be changed by a
  10075. // superuser.
  10076. // Acceptable values are:
  10077. //
  10078. // - "1" for "America/New_York"
  10079. // - "2" for "Europe/London"
  10080. // - "3" for "Europe/Paris"
  10081. // - "4" for "Africa/Johannesburg"
  10082. // - "5" for "Asia/Jerusalem"
  10083. // - "6" for "Asia/Shanghai"
  10084. // - "7" for "Asia/Hong_Kong"
  10085. // - "8" for "Asia/Tokyo"
  10086. // - "9" for "Australia/Sydney"
  10087. // - "10" for "Asia/Dubai"
  10088. // - "11" for "America/Los_Angeles"
  10089. // - "12" for "Pacific/Auckland"
  10090. // - "13" for "America/Sao_Paulo"
  10091. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  10092. // ForceSendFields is a list of field names (e.g.
  10093. // "ExposureToConversionEnabled") to unconditionally include in API
  10094. // requests. By default, fields with empty values are omitted from API
  10095. // requests. However, any non-pointer, non-interface field appearing in
  10096. // ForceSendFields will be sent to the server regardless of whether the
  10097. // field is empty or not. This may be used to include empty fields in
  10098. // Patch requests.
  10099. ForceSendFields []string `json:"-"`
  10100. // NullFields is a list of field names (e.g.
  10101. // "ExposureToConversionEnabled") to include in API requests with the
  10102. // JSON null value. By default, fields with empty values are omitted
  10103. // from API requests. However, any field with an empty value appearing
  10104. // in NullFields will be sent to the server as null. It is an error if a
  10105. // field in this list has a non-empty value. This may be used to include
  10106. // null fields in Patch requests.
  10107. NullFields []string `json:"-"`
  10108. }
  10109. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  10110. type NoMethod ReportsConfiguration
  10111. raw := NoMethod(*s)
  10112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10113. }
  10114. // RichMediaExitOverride: Rich Media Exit Override.
  10115. type RichMediaExitOverride struct {
  10116. // ClickThroughUrl: Click-through URL of this rich media exit override.
  10117. // Applicable if the enabled field is set to true.
  10118. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  10119. // Enabled: Whether to use the clickThroughUrl. If false, the
  10120. // creative-level exit will be used.
  10121. Enabled bool `json:"enabled,omitempty"`
  10122. // ExitId: ID for the override to refer to a specific exit in the
  10123. // creative.
  10124. ExitId int64 `json:"exitId,omitempty,string"`
  10125. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  10126. // unconditionally include in API requests. By default, fields with
  10127. // empty values are omitted from API requests. However, any non-pointer,
  10128. // non-interface field appearing in ForceSendFields will be sent to the
  10129. // server regardless of whether the field is empty or not. This may be
  10130. // used to include empty fields in Patch requests.
  10131. ForceSendFields []string `json:"-"`
  10132. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  10133. // include in API requests with the JSON null value. By default, fields
  10134. // with empty values are omitted from API requests. However, any field
  10135. // with an empty value appearing in NullFields will be sent to the
  10136. // server as null. It is an error if a field in this list has a
  10137. // non-empty value. This may be used to include null fields in Patch
  10138. // requests.
  10139. NullFields []string `json:"-"`
  10140. }
  10141. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  10142. type NoMethod RichMediaExitOverride
  10143. raw := NoMethod(*s)
  10144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10145. }
  10146. // Rule: A rule associates an asset with a targeting template for
  10147. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  10148. type Rule struct {
  10149. // AssetId: A creativeAssets[].id. This should refer to one of the
  10150. // parent assets in this creative. This is a required field.
  10151. AssetId int64 `json:"assetId,omitempty,string"`
  10152. // Name: A user-friendly name for this rule. This is a required field.
  10153. Name string `json:"name,omitempty"`
  10154. // TargetingTemplateId: A targeting template ID. The targeting from the
  10155. // targeting template will be used to determine whether this asset
  10156. // should be served. This is a required field.
  10157. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  10158. // ForceSendFields is a list of field names (e.g. "AssetId") to
  10159. // unconditionally include in API requests. By default, fields with
  10160. // empty values are omitted from API requests. However, any non-pointer,
  10161. // non-interface field appearing in ForceSendFields will be sent to the
  10162. // server regardless of whether the field is empty or not. This may be
  10163. // used to include empty fields in Patch requests.
  10164. ForceSendFields []string `json:"-"`
  10165. // NullFields is a list of field names (e.g. "AssetId") to include in
  10166. // API requests with the JSON null value. By default, fields with empty
  10167. // values are omitted from API requests. However, any field with an
  10168. // empty value appearing in NullFields will be sent to the server as
  10169. // null. It is an error if a field in this list has a non-empty value.
  10170. // This may be used to include null fields in Patch requests.
  10171. NullFields []string `json:"-"`
  10172. }
  10173. func (s *Rule) MarshalJSON() ([]byte, error) {
  10174. type NoMethod Rule
  10175. raw := NoMethod(*s)
  10176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10177. }
  10178. // Site: Contains properties of a site.
  10179. type Site struct {
  10180. // AccountId: Account ID of this site. This is a read-only field that
  10181. // can be left blank.
  10182. AccountId int64 `json:"accountId,omitempty,string"`
  10183. // Approved: Whether this site is approved.
  10184. Approved bool `json:"approved,omitempty"`
  10185. // DirectorySiteId: Directory site associated with this site. This is a
  10186. // required field that is read-only after insertion.
  10187. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  10188. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  10189. // directory site. This is a read-only, auto-generated field.
  10190. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  10191. // Id: ID of this site. This is a read-only, auto-generated field.
  10192. Id int64 `json:"id,omitempty,string"`
  10193. // IdDimensionValue: Dimension value for the ID of this site. This is a
  10194. // read-only, auto-generated field.
  10195. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  10196. // KeyName: Key name of this site. This is a read-only, auto-generated
  10197. // field.
  10198. KeyName string `json:"keyName,omitempty"`
  10199. // Kind: Identifies what kind of resource this is. Value: the fixed
  10200. // string "dfareporting#site".
  10201. Kind string `json:"kind,omitempty"`
  10202. // Name: Name of this site.This is a required field. Must be less than
  10203. // 128 characters long. If this site is under a subaccount, the name
  10204. // must be unique among sites of the same subaccount. Otherwise, this
  10205. // site is a top-level site, and the name must be unique among top-level
  10206. // sites of the same account.
  10207. Name string `json:"name,omitempty"`
  10208. // SiteContacts: Site contacts.
  10209. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  10210. // SiteSettings: Site-wide settings.
  10211. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  10212. // SubaccountId: Subaccount ID of this site. This is a read-only field
  10213. // that can be left blank.
  10214. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10215. // VideoSettings: Default video settings for new placements created
  10216. // under this site. This value will be used to populate the
  10217. // placements.videoSettings field, when no value is specified for the
  10218. // new placement.
  10219. VideoSettings *SiteVideoSettings `json:"videoSettings,omitempty"`
  10220. // ServerResponse contains the HTTP response code and headers from the
  10221. // server.
  10222. googleapi.ServerResponse `json:"-"`
  10223. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10224. // unconditionally include in API requests. By default, fields with
  10225. // empty values are omitted from API requests. However, any non-pointer,
  10226. // non-interface field appearing in ForceSendFields will be sent to the
  10227. // server regardless of whether the field is empty or not. This may be
  10228. // used to include empty fields in Patch requests.
  10229. ForceSendFields []string `json:"-"`
  10230. // NullFields is a list of field names (e.g. "AccountId") to include in
  10231. // API requests with the JSON null value. By default, fields with empty
  10232. // values are omitted from API requests. However, any field with an
  10233. // empty value appearing in NullFields will be sent to the server as
  10234. // null. It is an error if a field in this list has a non-empty value.
  10235. // This may be used to include null fields in Patch requests.
  10236. NullFields []string `json:"-"`
  10237. }
  10238. func (s *Site) MarshalJSON() ([]byte, error) {
  10239. type NoMethod Site
  10240. raw := NoMethod(*s)
  10241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10242. }
  10243. // SiteCompanionSetting: Companion Settings
  10244. type SiteCompanionSetting struct {
  10245. // CompanionsDisabled: Whether companions are disabled for this site
  10246. // template.
  10247. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  10248. // EnabledSizes: Whitelist of companion sizes to be served via this site
  10249. // template. Set this list to null or empty to serve all companion
  10250. // sizes.
  10251. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  10252. // ImageOnly: Whether to serve only static images as companions.
  10253. ImageOnly bool `json:"imageOnly,omitempty"`
  10254. // Kind: Identifies what kind of resource this is. Value: the fixed
  10255. // string "dfareporting#siteCompanionSetting".
  10256. Kind string `json:"kind,omitempty"`
  10257. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  10258. // to unconditionally include in API requests. By default, fields with
  10259. // empty values are omitted from API requests. However, any non-pointer,
  10260. // non-interface field appearing in ForceSendFields will be sent to the
  10261. // server regardless of whether the field is empty or not. This may be
  10262. // used to include empty fields in Patch requests.
  10263. ForceSendFields []string `json:"-"`
  10264. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  10265. // include in API requests with the JSON null value. By default, fields
  10266. // with empty values are omitted from API requests. However, any field
  10267. // with an empty value appearing in NullFields will be sent to the
  10268. // server as null. It is an error if a field in this list has a
  10269. // non-empty value. This may be used to include null fields in Patch
  10270. // requests.
  10271. NullFields []string `json:"-"`
  10272. }
  10273. func (s *SiteCompanionSetting) MarshalJSON() ([]byte, error) {
  10274. type NoMethod SiteCompanionSetting
  10275. raw := NoMethod(*s)
  10276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10277. }
  10278. // SiteContact: Site Contact
  10279. type SiteContact struct {
  10280. // Address: Address of this site contact.
  10281. Address string `json:"address,omitempty"`
  10282. // ContactType: Site contact type.
  10283. //
  10284. // Possible values:
  10285. // "SALES_PERSON"
  10286. // "TRAFFICKER"
  10287. ContactType string `json:"contactType,omitempty"`
  10288. // Email: Email address of this site contact. This is a required field.
  10289. Email string `json:"email,omitempty"`
  10290. // FirstName: First name of this site contact.
  10291. FirstName string `json:"firstName,omitempty"`
  10292. // Id: ID of this site contact. This is a read-only, auto-generated
  10293. // field.
  10294. Id int64 `json:"id,omitempty,string"`
  10295. // LastName: Last name of this site contact.
  10296. LastName string `json:"lastName,omitempty"`
  10297. // Phone: Primary phone number of this site contact.
  10298. Phone string `json:"phone,omitempty"`
  10299. // Title: Title or designation of this site contact.
  10300. Title string `json:"title,omitempty"`
  10301. // ForceSendFields is a list of field names (e.g. "Address") 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. "Address") 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 *SiteContact) MarshalJSON() ([]byte, error) {
  10317. type NoMethod SiteContact
  10318. raw := NoMethod(*s)
  10319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10320. }
  10321. // SiteSettings: Site Settings
  10322. type SiteSettings struct {
  10323. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10324. // site.
  10325. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10326. // AdBlockingOptOut: Whether this site opts out of ad blocking. When
  10327. // true, ad blocking is disabled for all placements under the site,
  10328. // regardless of the individual placement settings. When false, the
  10329. // campaign and placement settings take effect.
  10330. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  10331. // DisableNewCookie: Whether new cookies are disabled for this site.
  10332. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10333. // TagSetting: Configuration settings for dynamic and image floodlight
  10334. // tags.
  10335. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10336. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10337. // for in-stream video creatives are disabled by default for new
  10338. // placements created under this site. This value will be used to
  10339. // populate the placement.videoActiveViewOptOut field, when no value is
  10340. // specified for the new placement.
  10341. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10342. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10343. // placements created under this site. This value will be used to
  10344. // populate the placements.vpaidAdapterChoice field, when no value is
  10345. // specified for the new placement. Controls which VPAID format the
  10346. // measurement adapter will use for in-stream video creatives assigned
  10347. // to the placement. The publisher's specifications will typically
  10348. // determine this setting. For VPAID creatives, the adapter format will
  10349. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10350. // adapter).
  10351. //
  10352. // Note: Flash is no longer supported. This field now defaults to HTML5
  10353. // when the following values are provided: FLASH, BOTH.
  10354. //
  10355. // Possible values:
  10356. // "BOTH"
  10357. // "DEFAULT"
  10358. // "FLASH"
  10359. // "HTML5"
  10360. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10361. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10362. // unconditionally include in API requests. By default, fields with
  10363. // empty values are omitted from API requests. However, any non-pointer,
  10364. // non-interface field appearing in ForceSendFields will be sent to the
  10365. // server regardless of whether the field is empty or not. This may be
  10366. // used to include empty fields in Patch requests.
  10367. ForceSendFields []string `json:"-"`
  10368. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10369. // include in API requests with the JSON null value. By default, fields
  10370. // with empty values are omitted from API requests. However, any field
  10371. // with an empty value appearing in NullFields will be sent to the
  10372. // server as null. It is an error if a field in this list has a
  10373. // non-empty value. This may be used to include null fields in Patch
  10374. // requests.
  10375. NullFields []string `json:"-"`
  10376. }
  10377. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10378. type NoMethod SiteSettings
  10379. raw := NoMethod(*s)
  10380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10381. }
  10382. // SiteSkippableSetting: Skippable Settings
  10383. type SiteSkippableSetting struct {
  10384. // Kind: Identifies what kind of resource this is. Value: the fixed
  10385. // string "dfareporting#siteSkippableSetting".
  10386. Kind string `json:"kind,omitempty"`
  10387. // ProgressOffset: Amount of time to play videos served to this site
  10388. // template before counting a view. Applicable when skippable is true.
  10389. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10390. // SkipOffset: Amount of time to play videos served to this site before
  10391. // the skip button should appear. Applicable when skippable is true.
  10392. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10393. // Skippable: Whether the user can skip creatives served to this site.
  10394. // This will act as default for new placements created under this site.
  10395. Skippable bool `json:"skippable,omitempty"`
  10396. // ForceSendFields is a list of field names (e.g. "Kind") to
  10397. // unconditionally include in API requests. By default, fields with
  10398. // empty values are omitted from API requests. However, any non-pointer,
  10399. // non-interface field appearing in ForceSendFields will be sent to the
  10400. // server regardless of whether the field is empty or not. This may be
  10401. // used to include empty fields in Patch requests.
  10402. ForceSendFields []string `json:"-"`
  10403. // NullFields is a list of field names (e.g. "Kind") to include in API
  10404. // requests with the JSON null value. By default, fields with empty
  10405. // values are omitted from API requests. However, any field with an
  10406. // empty value appearing in NullFields will be sent to the server as
  10407. // null. It is an error if a field in this list has a non-empty value.
  10408. // This may be used to include null fields in Patch requests.
  10409. NullFields []string `json:"-"`
  10410. }
  10411. func (s *SiteSkippableSetting) MarshalJSON() ([]byte, error) {
  10412. type NoMethod SiteSkippableSetting
  10413. raw := NoMethod(*s)
  10414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10415. }
  10416. // SiteTranscodeSetting: Transcode Settings
  10417. type SiteTranscodeSetting struct {
  10418. // EnabledVideoFormats: Whitelist of video formats to be served to this
  10419. // site template. Set this list to null or empty to serve all video
  10420. // formats.
  10421. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  10422. // Kind: Identifies what kind of resource this is. Value: the fixed
  10423. // string "dfareporting#siteTranscodeSetting".
  10424. Kind string `json:"kind,omitempty"`
  10425. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  10426. // to unconditionally include in API requests. By default, fields with
  10427. // empty values are omitted from API requests. However, any non-pointer,
  10428. // non-interface field appearing in ForceSendFields will be sent to the
  10429. // server regardless of whether the field is empty or not. This may be
  10430. // used to include empty fields in Patch requests.
  10431. ForceSendFields []string `json:"-"`
  10432. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  10433. // include in API requests with the JSON null value. By default, fields
  10434. // with empty values are omitted from API requests. However, any field
  10435. // with an empty value appearing in NullFields will be sent to the
  10436. // server as null. It is an error if a field in this list has a
  10437. // non-empty value. This may be used to include null fields in Patch
  10438. // requests.
  10439. NullFields []string `json:"-"`
  10440. }
  10441. func (s *SiteTranscodeSetting) MarshalJSON() ([]byte, error) {
  10442. type NoMethod SiteTranscodeSetting
  10443. raw := NoMethod(*s)
  10444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10445. }
  10446. // SiteVideoSettings: Video Settings
  10447. type SiteVideoSettings struct {
  10448. // CompanionSettings: Settings for the companion creatives of video
  10449. // creatives served to this site.
  10450. CompanionSettings *SiteCompanionSetting `json:"companionSettings,omitempty"`
  10451. // Kind: Identifies what kind of resource this is. Value: the fixed
  10452. // string "dfareporting#siteVideoSettings".
  10453. Kind string `json:"kind,omitempty"`
  10454. // Orientation: Orientation of a site template used for video. This will
  10455. // act as default for new placements created under this site.
  10456. //
  10457. // Possible values:
  10458. // "ANY"
  10459. // "LANDSCAPE"
  10460. // "PORTRAIT"
  10461. Orientation string `json:"orientation,omitempty"`
  10462. // SkippableSettings: Settings for the skippability of video creatives
  10463. // served to this site. This will act as default for new placements
  10464. // created under this site.
  10465. SkippableSettings *SiteSkippableSetting `json:"skippableSettings,omitempty"`
  10466. // TranscodeSettings: Settings for the transcodes of video creatives
  10467. // served to this site. This will act as default for new placements
  10468. // created under this site.
  10469. TranscodeSettings *SiteTranscodeSetting `json:"transcodeSettings,omitempty"`
  10470. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  10471. // to unconditionally include in API requests. By default, fields with
  10472. // empty values are omitted from API requests. However, any non-pointer,
  10473. // non-interface field appearing in ForceSendFields will be sent to the
  10474. // server regardless of whether the field is empty or not. This may be
  10475. // used to include empty fields in Patch requests.
  10476. ForceSendFields []string `json:"-"`
  10477. // NullFields is a list of field names (e.g. "CompanionSettings") to
  10478. // include in API requests with the JSON null value. By default, fields
  10479. // with empty values are omitted from API requests. However, any field
  10480. // with an empty value appearing in NullFields will be sent to the
  10481. // server as null. It is an error if a field in this list has a
  10482. // non-empty value. This may be used to include null fields in Patch
  10483. // requests.
  10484. NullFields []string `json:"-"`
  10485. }
  10486. func (s *SiteVideoSettings) MarshalJSON() ([]byte, error) {
  10487. type NoMethod SiteVideoSettings
  10488. raw := NoMethod(*s)
  10489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10490. }
  10491. // SitesListResponse: Site List Response
  10492. type SitesListResponse struct {
  10493. // Kind: Identifies what kind of resource this is. Value: the fixed
  10494. // string "dfareporting#sitesListResponse".
  10495. Kind string `json:"kind,omitempty"`
  10496. // NextPageToken: Pagination token to be used for the next list
  10497. // operation.
  10498. NextPageToken string `json:"nextPageToken,omitempty"`
  10499. // Sites: Site collection.
  10500. Sites []*Site `json:"sites,omitempty"`
  10501. // ServerResponse contains the HTTP response code and headers from the
  10502. // server.
  10503. googleapi.ServerResponse `json:"-"`
  10504. // ForceSendFields is a list of field names (e.g. "Kind") to
  10505. // unconditionally include in API requests. By default, fields with
  10506. // empty values are omitted from API requests. However, any non-pointer,
  10507. // non-interface field appearing in ForceSendFields will be sent to the
  10508. // server regardless of whether the field is empty or not. This may be
  10509. // used to include empty fields in Patch requests.
  10510. ForceSendFields []string `json:"-"`
  10511. // NullFields is a list of field names (e.g. "Kind") to include in API
  10512. // requests with the JSON null value. By default, fields with empty
  10513. // values are omitted from API requests. However, any field with an
  10514. // empty value appearing in NullFields will be sent to the server as
  10515. // null. It is an error if a field in this list has a non-empty value.
  10516. // This may be used to include null fields in Patch requests.
  10517. NullFields []string `json:"-"`
  10518. }
  10519. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10520. type NoMethod SitesListResponse
  10521. raw := NoMethod(*s)
  10522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10523. }
  10524. // Size: Represents the dimensions of ads, placements, creatives, or
  10525. // creative assets.
  10526. type Size struct {
  10527. // Height: Height of this size. Acceptable values are 0 to 32767,
  10528. // inclusive.
  10529. Height int64 `json:"height,omitempty"`
  10530. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10531. Iab bool `json:"iab,omitempty"`
  10532. // Id: ID of this size. This is a read-only, auto-generated field.
  10533. Id int64 `json:"id,omitempty,string"`
  10534. // Kind: Identifies what kind of resource this is. Value: the fixed
  10535. // string "dfareporting#size".
  10536. Kind string `json:"kind,omitempty"`
  10537. // Width: Width of this size. Acceptable values are 0 to 32767,
  10538. // inclusive.
  10539. Width int64 `json:"width,omitempty"`
  10540. // ServerResponse contains the HTTP response code and headers from the
  10541. // server.
  10542. googleapi.ServerResponse `json:"-"`
  10543. // ForceSendFields is a list of field names (e.g. "Height") to
  10544. // unconditionally include in API requests. By default, fields with
  10545. // empty values are omitted from API requests. However, any non-pointer,
  10546. // non-interface field appearing in ForceSendFields will be sent to the
  10547. // server regardless of whether the field is empty or not. This may be
  10548. // used to include empty fields in Patch requests.
  10549. ForceSendFields []string `json:"-"`
  10550. // NullFields is a list of field names (e.g. "Height") to include in API
  10551. // requests with the JSON null value. By default, fields with empty
  10552. // values are omitted from API requests. However, any field with an
  10553. // empty value appearing in NullFields will be sent to the server as
  10554. // null. It is an error if a field in this list has a non-empty value.
  10555. // This may be used to include null fields in Patch requests.
  10556. NullFields []string `json:"-"`
  10557. }
  10558. func (s *Size) MarshalJSON() ([]byte, error) {
  10559. type NoMethod Size
  10560. raw := NoMethod(*s)
  10561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10562. }
  10563. // SizesListResponse: Size List Response
  10564. type SizesListResponse struct {
  10565. // Kind: Identifies what kind of resource this is. Value: the fixed
  10566. // string "dfareporting#sizesListResponse".
  10567. Kind string `json:"kind,omitempty"`
  10568. // Sizes: Size collection.
  10569. Sizes []*Size `json:"sizes,omitempty"`
  10570. // ServerResponse contains the HTTP response code and headers from the
  10571. // server.
  10572. googleapi.ServerResponse `json:"-"`
  10573. // ForceSendFields is a list of field names (e.g. "Kind") to
  10574. // unconditionally include in API requests. By default, fields with
  10575. // empty values are omitted from API requests. However, any non-pointer,
  10576. // non-interface field appearing in ForceSendFields will be sent to the
  10577. // server regardless of whether the field is empty or not. This may be
  10578. // used to include empty fields in Patch requests.
  10579. ForceSendFields []string `json:"-"`
  10580. // NullFields is a list of field names (e.g. "Kind") to include in API
  10581. // requests with the JSON null value. By default, fields with empty
  10582. // values are omitted from API requests. However, any field with an
  10583. // empty value appearing in NullFields will be sent to the server as
  10584. // null. It is an error if a field in this list has a non-empty value.
  10585. // This may be used to include null fields in Patch requests.
  10586. NullFields []string `json:"-"`
  10587. }
  10588. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10589. type NoMethod SizesListResponse
  10590. raw := NoMethod(*s)
  10591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10592. }
  10593. // SkippableSetting: Skippable Settings
  10594. type SkippableSetting struct {
  10595. // Kind: Identifies what kind of resource this is. Value: the fixed
  10596. // string "dfareporting#skippableSetting".
  10597. Kind string `json:"kind,omitempty"`
  10598. // ProgressOffset: Amount of time to play videos served to this
  10599. // placement before counting a view. Applicable when skippable is true.
  10600. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10601. // SkipOffset: Amount of time to play videos served to this placement
  10602. // before the skip button should appear. Applicable when skippable is
  10603. // true.
  10604. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10605. // Skippable: Whether the user can skip creatives served to this
  10606. // placement.
  10607. Skippable bool `json:"skippable,omitempty"`
  10608. // ForceSendFields is a list of field names (e.g. "Kind") to
  10609. // unconditionally include in API requests. By default, fields with
  10610. // empty values are omitted from API requests. However, any non-pointer,
  10611. // non-interface field appearing in ForceSendFields will be sent to the
  10612. // server regardless of whether the field is empty or not. This may be
  10613. // used to include empty fields in Patch requests.
  10614. ForceSendFields []string `json:"-"`
  10615. // NullFields is a list of field names (e.g. "Kind") to include in API
  10616. // requests with the JSON null value. By default, fields with empty
  10617. // values are omitted from API requests. However, any field with an
  10618. // empty value appearing in NullFields will be sent to the server as
  10619. // null. It is an error if a field in this list has a non-empty value.
  10620. // This may be used to include null fields in Patch requests.
  10621. NullFields []string `json:"-"`
  10622. }
  10623. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10624. type NoMethod SkippableSetting
  10625. raw := NoMethod(*s)
  10626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10627. }
  10628. // SortedDimension: Represents a sorted dimension.
  10629. type SortedDimension struct {
  10630. // Kind: The kind of resource this is, in this case
  10631. // dfareporting#sortedDimension.
  10632. Kind string `json:"kind,omitempty"`
  10633. // Name: The name of the dimension.
  10634. Name string `json:"name,omitempty"`
  10635. // SortOrder: An optional sort order for the dimension column.
  10636. //
  10637. // Possible values:
  10638. // "ASCENDING"
  10639. // "DESCENDING"
  10640. SortOrder string `json:"sortOrder,omitempty"`
  10641. // ForceSendFields is a list of field names (e.g. "Kind") to
  10642. // unconditionally include in API requests. By default, fields with
  10643. // empty values are omitted from API requests. However, any non-pointer,
  10644. // non-interface field appearing in ForceSendFields will be sent to the
  10645. // server regardless of whether the field is empty or not. This may be
  10646. // used to include empty fields in Patch requests.
  10647. ForceSendFields []string `json:"-"`
  10648. // NullFields is a list of field names (e.g. "Kind") to include in API
  10649. // requests with the JSON null value. By default, fields with empty
  10650. // values are omitted from API requests. However, any field with an
  10651. // empty value appearing in NullFields will be sent to the server as
  10652. // null. It is an error if a field in this list has a non-empty value.
  10653. // This may be used to include null fields in Patch requests.
  10654. NullFields []string `json:"-"`
  10655. }
  10656. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10657. type NoMethod SortedDimension
  10658. raw := NoMethod(*s)
  10659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10660. }
  10661. // Subaccount: Contains properties of a Campaign Manager subaccount.
  10662. type Subaccount struct {
  10663. // AccountId: ID of the account that contains this subaccount. This is a
  10664. // read-only field that can be left blank.
  10665. AccountId int64 `json:"accountId,omitempty,string"`
  10666. // AvailablePermissionIds: IDs of the available user role permissions
  10667. // for this subaccount.
  10668. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10669. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10670. Id int64 `json:"id,omitempty,string"`
  10671. // Kind: Identifies what kind of resource this is. Value: the fixed
  10672. // string "dfareporting#subaccount".
  10673. Kind string `json:"kind,omitempty"`
  10674. // Name: Name of this subaccount. This is a required field. Must be less
  10675. // than 128 characters long and be unique among subaccounts of the same
  10676. // account.
  10677. Name string `json:"name,omitempty"`
  10678. // ServerResponse contains the HTTP response code and headers from the
  10679. // server.
  10680. googleapi.ServerResponse `json:"-"`
  10681. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10682. // unconditionally include in API requests. By default, fields with
  10683. // empty values are omitted from API requests. However, any non-pointer,
  10684. // non-interface field appearing in ForceSendFields will be sent to the
  10685. // server regardless of whether the field is empty or not. This may be
  10686. // used to include empty fields in Patch requests.
  10687. ForceSendFields []string `json:"-"`
  10688. // NullFields is a list of field names (e.g. "AccountId") to include in
  10689. // API requests with the JSON null value. By default, fields with empty
  10690. // values are omitted from API requests. However, any field with an
  10691. // empty value appearing in NullFields will be sent to the server as
  10692. // null. It is an error if a field in this list has a non-empty value.
  10693. // This may be used to include null fields in Patch requests.
  10694. NullFields []string `json:"-"`
  10695. }
  10696. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10697. type NoMethod Subaccount
  10698. raw := NoMethod(*s)
  10699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10700. }
  10701. // SubaccountsListResponse: Subaccount List Response
  10702. type SubaccountsListResponse struct {
  10703. // Kind: Identifies what kind of resource this is. Value: the fixed
  10704. // string "dfareporting#subaccountsListResponse".
  10705. Kind string `json:"kind,omitempty"`
  10706. // NextPageToken: Pagination token to be used for the next list
  10707. // operation.
  10708. NextPageToken string `json:"nextPageToken,omitempty"`
  10709. // Subaccounts: Subaccount collection.
  10710. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10711. // ServerResponse contains the HTTP response code and headers from the
  10712. // server.
  10713. googleapi.ServerResponse `json:"-"`
  10714. // ForceSendFields is a list of field names (e.g. "Kind") to
  10715. // unconditionally include in API requests. By default, fields with
  10716. // empty values are omitted from API requests. However, any non-pointer,
  10717. // non-interface field appearing in ForceSendFields will be sent to the
  10718. // server regardless of whether the field is empty or not. This may be
  10719. // used to include empty fields in Patch requests.
  10720. ForceSendFields []string `json:"-"`
  10721. // NullFields is a list of field names (e.g. "Kind") to include in API
  10722. // requests with the JSON null value. By default, fields with empty
  10723. // values are omitted from API requests. However, any field with an
  10724. // empty value appearing in NullFields will be sent to the server as
  10725. // null. It is an error if a field in this list has a non-empty value.
  10726. // This may be used to include null fields in Patch requests.
  10727. NullFields []string `json:"-"`
  10728. }
  10729. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10730. type NoMethod SubaccountsListResponse
  10731. raw := NoMethod(*s)
  10732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10733. }
  10734. // TagData: Placement Tag Data
  10735. type TagData struct {
  10736. // AdId: Ad associated with this placement tag. Applicable only when
  10737. // format is PLACEMENT_TAG_TRACKING.
  10738. AdId int64 `json:"adId,omitempty,string"`
  10739. // ClickTag: Tag string to record a click.
  10740. ClickTag string `json:"clickTag,omitempty"`
  10741. // CreativeId: Creative associated with this placement tag. Applicable
  10742. // only when format is PLACEMENT_TAG_TRACKING.
  10743. CreativeId int64 `json:"creativeId,omitempty,string"`
  10744. // Format: TagData tag format of this tag.
  10745. //
  10746. // Possible values:
  10747. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10748. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10749. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10750. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10751. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10752. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10753. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10754. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10755. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10756. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10757. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10758. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10759. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10760. // "PLACEMENT_TAG_JAVASCRIPT"
  10761. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10762. // "PLACEMENT_TAG_STANDARD"
  10763. // "PLACEMENT_TAG_TRACKING"
  10764. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10765. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10766. Format string `json:"format,omitempty"`
  10767. // ImpressionTag: Tag string for serving an ad.
  10768. ImpressionTag string `json:"impressionTag,omitempty"`
  10769. // ForceSendFields is a list of field names (e.g. "AdId") to
  10770. // unconditionally include in API requests. By default, fields with
  10771. // empty values are omitted from API requests. However, any non-pointer,
  10772. // non-interface field appearing in ForceSendFields will be sent to the
  10773. // server regardless of whether the field is empty or not. This may be
  10774. // used to include empty fields in Patch requests.
  10775. ForceSendFields []string `json:"-"`
  10776. // NullFields is a list of field names (e.g. "AdId") to include in API
  10777. // requests with the JSON null value. By default, fields with empty
  10778. // values are omitted from API requests. However, any field with an
  10779. // empty value appearing in NullFields will be sent to the server as
  10780. // null. It is an error if a field in this list has a non-empty value.
  10781. // This may be used to include null fields in Patch requests.
  10782. NullFields []string `json:"-"`
  10783. }
  10784. func (s *TagData) MarshalJSON() ([]byte, error) {
  10785. type NoMethod TagData
  10786. raw := NoMethod(*s)
  10787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10788. }
  10789. // TagSetting: Tag Settings
  10790. type TagSetting struct {
  10791. // AdditionalKeyValues: Additional key-values to be included in tags.
  10792. // Each key-value pair must be of the form key=value, and pairs must be
  10793. // separated by a semicolon (;). Keys and values must not contain
  10794. // commas. For example, id=2;color=red is a valid value for this field.
  10795. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10796. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10797. // included in the tags. This setting applies only to placements.
  10798. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10799. // IncludeClickTracking: Whether click-tracking string should be
  10800. // included in the tags.
  10801. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10802. // KeywordOption: Option specifying how keywords are embedded in ad
  10803. // tags. This setting can be used to specify whether keyword
  10804. // placeholders are inserted in placement tags for this site. Publishers
  10805. // can then add keywords to those placeholders.
  10806. //
  10807. // Possible values:
  10808. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10809. // "IGNORE"
  10810. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10811. KeywordOption string `json:"keywordOption,omitempty"`
  10812. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10813. // to unconditionally include in API requests. By default, fields with
  10814. // empty values are omitted from API requests. However, any non-pointer,
  10815. // non-interface field appearing in ForceSendFields will be sent to the
  10816. // server regardless of whether the field is empty or not. This may be
  10817. // used to include empty fields in Patch requests.
  10818. ForceSendFields []string `json:"-"`
  10819. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10820. // include in API requests with the JSON null value. By default, fields
  10821. // with empty values are omitted from API requests. However, any field
  10822. // with an empty value appearing in NullFields will be sent to the
  10823. // server as null. It is an error if a field in this list has a
  10824. // non-empty value. This may be used to include null fields in Patch
  10825. // requests.
  10826. NullFields []string `json:"-"`
  10827. }
  10828. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10829. type NoMethod TagSetting
  10830. raw := NoMethod(*s)
  10831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10832. }
  10833. // TagSettings: Dynamic and Image Tag Settings.
  10834. type TagSettings struct {
  10835. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10836. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10837. // ImageTagEnabled: Whether image tags are enabled.
  10838. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10839. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10840. // to unconditionally include in API requests. By default, fields with
  10841. // empty values are omitted from API requests. However, any non-pointer,
  10842. // non-interface field appearing in ForceSendFields will be sent to the
  10843. // server regardless of whether the field is empty or not. This may be
  10844. // used to include empty fields in Patch requests.
  10845. ForceSendFields []string `json:"-"`
  10846. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10847. // include in API requests with the JSON null value. By default, fields
  10848. // with empty values are omitted from API requests. However, any field
  10849. // with an empty value appearing in NullFields will be sent to the
  10850. // server as null. It is an error if a field in this list has a
  10851. // non-empty value. This may be used to include null fields in Patch
  10852. // requests.
  10853. NullFields []string `json:"-"`
  10854. }
  10855. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10856. type NoMethod TagSettings
  10857. raw := NoMethod(*s)
  10858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10859. }
  10860. // TargetWindow: Target Window.
  10861. type TargetWindow struct {
  10862. // CustomHtml: User-entered value.
  10863. CustomHtml string `json:"customHtml,omitempty"`
  10864. // TargetWindowOption: Type of browser window for which the backup image
  10865. // of the flash creative can be displayed.
  10866. //
  10867. // Possible values:
  10868. // "CURRENT_WINDOW"
  10869. // "CUSTOM"
  10870. // "NEW_WINDOW"
  10871. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10872. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10873. // unconditionally include in API requests. By default, fields with
  10874. // empty values are omitted from API requests. However, any non-pointer,
  10875. // non-interface field appearing in ForceSendFields will be sent to the
  10876. // server regardless of whether the field is empty or not. This may be
  10877. // used to include empty fields in Patch requests.
  10878. ForceSendFields []string `json:"-"`
  10879. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10880. // API requests with the JSON null value. By default, fields with empty
  10881. // values are omitted from API requests. However, any field with an
  10882. // empty value appearing in NullFields will be sent to the server as
  10883. // null. It is an error if a field in this list has a non-empty value.
  10884. // This may be used to include null fields in Patch requests.
  10885. NullFields []string `json:"-"`
  10886. }
  10887. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10888. type NoMethod TargetWindow
  10889. raw := NoMethod(*s)
  10890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10891. }
  10892. // TargetableRemarketingList: Contains properties of a targetable
  10893. // remarketing list. Remarketing enables you to create lists of users
  10894. // who have performed specific actions on a site, then target ads to
  10895. // members of those lists. This resource is a read-only view of a
  10896. // remarketing list to be used to faciliate targeting ads to specific
  10897. // lists. Remarketing lists that are owned by your advertisers and those
  10898. // that are shared to your advertisers or account are accessible via
  10899. // this resource. To manage remarketing lists that are owned by your
  10900. // advertisers, use the RemarketingLists resource.
  10901. type TargetableRemarketingList struct {
  10902. // AccountId: Account ID of this remarketing list. This is a read-only,
  10903. // auto-generated field that is only returned in GET requests.
  10904. AccountId int64 `json:"accountId,omitempty,string"`
  10905. // Active: Whether this targetable remarketing list is active.
  10906. Active bool `json:"active,omitempty"`
  10907. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10908. // targetable remarketing list.
  10909. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10910. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10911. // advertiser.
  10912. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10913. // Description: Targetable remarketing list description.
  10914. Description string `json:"description,omitempty"`
  10915. // Id: Targetable remarketing list ID.
  10916. Id int64 `json:"id,omitempty,string"`
  10917. // Kind: Identifies what kind of resource this is. Value: the fixed
  10918. // string "dfareporting#targetableRemarketingList".
  10919. Kind string `json:"kind,omitempty"`
  10920. // LifeSpan: Number of days that a user should remain in the targetable
  10921. // remarketing list without an impression.
  10922. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10923. // ListSize: Number of users currently in the list. This is a read-only
  10924. // field.
  10925. ListSize int64 `json:"listSize,omitempty,string"`
  10926. // ListSource: Product from which this targetable remarketing list was
  10927. // originated.
  10928. //
  10929. // Possible values:
  10930. // "REMARKETING_LIST_SOURCE_ADX"
  10931. // "REMARKETING_LIST_SOURCE_DBM"
  10932. // "REMARKETING_LIST_SOURCE_DFA"
  10933. // "REMARKETING_LIST_SOURCE_DFP"
  10934. // "REMARKETING_LIST_SOURCE_DMP"
  10935. // "REMARKETING_LIST_SOURCE_GA"
  10936. // "REMARKETING_LIST_SOURCE_GPLUS"
  10937. // "REMARKETING_LIST_SOURCE_OTHER"
  10938. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10939. // "REMARKETING_LIST_SOURCE_XFP"
  10940. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10941. ListSource string `json:"listSource,omitempty"`
  10942. // Name: Name of the targetable remarketing list. Is no greater than 128
  10943. // characters long.
  10944. Name string `json:"name,omitempty"`
  10945. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10946. // read-only, auto-generated field that is only returned in GET
  10947. // requests.
  10948. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10949. // ServerResponse contains the HTTP response code and headers from the
  10950. // server.
  10951. googleapi.ServerResponse `json:"-"`
  10952. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10953. // unconditionally include in API requests. By default, fields with
  10954. // empty values are omitted from API requests. However, any non-pointer,
  10955. // non-interface field appearing in ForceSendFields will be sent to the
  10956. // server regardless of whether the field is empty or not. This may be
  10957. // used to include empty fields in Patch requests.
  10958. ForceSendFields []string `json:"-"`
  10959. // NullFields is a list of field names (e.g. "AccountId") to include in
  10960. // API requests with the JSON null value. By default, fields with empty
  10961. // values are omitted from API requests. However, any field with an
  10962. // empty value appearing in NullFields will be sent to the server as
  10963. // null. It is an error if a field in this list has a non-empty value.
  10964. // This may be used to include null fields in Patch requests.
  10965. NullFields []string `json:"-"`
  10966. }
  10967. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10968. type NoMethod TargetableRemarketingList
  10969. raw := NoMethod(*s)
  10970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10971. }
  10972. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10973. // response
  10974. type TargetableRemarketingListsListResponse struct {
  10975. // Kind: Identifies what kind of resource this is. Value: the fixed
  10976. // string "dfareporting#targetableRemarketingListsListResponse".
  10977. Kind string `json:"kind,omitempty"`
  10978. // NextPageToken: Pagination token to be used for the next list
  10979. // operation.
  10980. NextPageToken string `json:"nextPageToken,omitempty"`
  10981. // TargetableRemarketingLists: Targetable remarketing list collection.
  10982. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10983. // ServerResponse contains the HTTP response code and headers from the
  10984. // server.
  10985. googleapi.ServerResponse `json:"-"`
  10986. // ForceSendFields is a list of field names (e.g. "Kind") to
  10987. // unconditionally include in API requests. By default, fields with
  10988. // empty values are omitted from API requests. However, any non-pointer,
  10989. // non-interface field appearing in ForceSendFields will be sent to the
  10990. // server regardless of whether the field is empty or not. This may be
  10991. // used to include empty fields in Patch requests.
  10992. ForceSendFields []string `json:"-"`
  10993. // NullFields is a list of field names (e.g. "Kind") to include in API
  10994. // requests with the JSON null value. By default, fields with empty
  10995. // values are omitted from API requests. However, any field with an
  10996. // empty value appearing in NullFields will be sent to the server as
  10997. // null. It is an error if a field in this list has a non-empty value.
  10998. // This may be used to include null fields in Patch requests.
  10999. NullFields []string `json:"-"`
  11000. }
  11001. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  11002. type NoMethod TargetableRemarketingListsListResponse
  11003. raw := NoMethod(*s)
  11004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11005. }
  11006. // TargetingTemplate: Contains properties of a targeting template. A
  11007. // targeting template encapsulates targeting information which can be
  11008. // reused across multiple ads.
  11009. type TargetingTemplate struct {
  11010. // AccountId: Account ID of this targeting template. This field, if left
  11011. // unset, will be auto-generated on insert and is read-only after
  11012. // insert.
  11013. AccountId int64 `json:"accountId,omitempty,string"`
  11014. // AdvertiserId: Advertiser ID of this targeting template. This is a
  11015. // required field on insert and is read-only after insert.
  11016. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  11017. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  11018. // advertiser. This is a read-only, auto-generated field.
  11019. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  11020. // DayPartTargeting: Time and day targeting criteria.
  11021. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  11022. // GeoTargeting: Geographical targeting criteria.
  11023. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  11024. // Id: ID of this targeting template. This is a read-only,
  11025. // auto-generated field.
  11026. Id int64 `json:"id,omitempty,string"`
  11027. // KeyValueTargetingExpression: Key-value targeting criteria.
  11028. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  11029. // Kind: Identifies what kind of resource this is. Value: the fixed
  11030. // string "dfareporting#targetingTemplate".
  11031. Kind string `json:"kind,omitempty"`
  11032. // LanguageTargeting: Language targeting criteria.
  11033. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  11034. // ListTargetingExpression: Remarketing list targeting criteria.
  11035. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  11036. // Name: Name of this targeting template. This field is required. It
  11037. // must be less than 256 characters long and unique within an
  11038. // advertiser.
  11039. Name string `json:"name,omitempty"`
  11040. // SubaccountId: Subaccount ID of this targeting template. This field,
  11041. // if left unset, will be auto-generated on insert and is read-only
  11042. // after insert.
  11043. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11044. // TechnologyTargeting: Technology platform targeting criteria.
  11045. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  11046. // ServerResponse contains the HTTP response code and headers from the
  11047. // server.
  11048. googleapi.ServerResponse `json:"-"`
  11049. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11050. // unconditionally include in API requests. By default, fields with
  11051. // empty values are omitted from API requests. However, any non-pointer,
  11052. // non-interface field appearing in ForceSendFields will be sent to the
  11053. // server regardless of whether the field is empty or not. This may be
  11054. // used to include empty fields in Patch requests.
  11055. ForceSendFields []string `json:"-"`
  11056. // NullFields is a list of field names (e.g. "AccountId") to include in
  11057. // API requests with the JSON null value. By default, fields with empty
  11058. // values are omitted from API requests. However, any field with an
  11059. // empty value appearing in NullFields will be sent to the server as
  11060. // null. It is an error if a field in this list has a non-empty value.
  11061. // This may be used to include null fields in Patch requests.
  11062. NullFields []string `json:"-"`
  11063. }
  11064. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  11065. type NoMethod TargetingTemplate
  11066. raw := NoMethod(*s)
  11067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11068. }
  11069. // TargetingTemplatesListResponse: Targeting Template List Response
  11070. type TargetingTemplatesListResponse struct {
  11071. // Kind: Identifies what kind of resource this is. Value: the fixed
  11072. // string "dfareporting#targetingTemplatesListResponse".
  11073. Kind string `json:"kind,omitempty"`
  11074. // NextPageToken: Pagination token to be used for the next list
  11075. // operation.
  11076. NextPageToken string `json:"nextPageToken,omitempty"`
  11077. // TargetingTemplates: Targeting template collection.
  11078. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  11079. // ServerResponse contains the HTTP response code and headers from the
  11080. // server.
  11081. googleapi.ServerResponse `json:"-"`
  11082. // ForceSendFields is a list of field names (e.g. "Kind") to
  11083. // unconditionally include in API requests. By default, fields with
  11084. // empty values are omitted from API requests. However, any non-pointer,
  11085. // non-interface field appearing in ForceSendFields will be sent to the
  11086. // server regardless of whether the field is empty or not. This may be
  11087. // used to include empty fields in Patch requests.
  11088. ForceSendFields []string `json:"-"`
  11089. // NullFields is a list of field names (e.g. "Kind") to include in API
  11090. // requests with the JSON null value. By default, fields with empty
  11091. // values are omitted from API requests. However, any field with an
  11092. // empty value appearing in NullFields will be sent to the server as
  11093. // null. It is an error if a field in this list has a non-empty value.
  11094. // This may be used to include null fields in Patch requests.
  11095. NullFields []string `json:"-"`
  11096. }
  11097. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  11098. type NoMethod TargetingTemplatesListResponse
  11099. raw := NoMethod(*s)
  11100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11101. }
  11102. // TechnologyTargeting: Technology Targeting.
  11103. type TechnologyTargeting struct {
  11104. // Browsers: Browsers that this ad targets. For each browser either set
  11105. // browserVersionId or dartId along with the version numbers. If both
  11106. // are specified, only browserVersionId will be used. The other fields
  11107. // are populated automatically when the ad is inserted or updated.
  11108. Browsers []*Browser `json:"browsers,omitempty"`
  11109. // ConnectionTypes: Connection types that this ad targets. For each
  11110. // connection type only id is required. The other fields are populated
  11111. // automatically when the ad is inserted or updated.
  11112. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  11113. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  11114. // carrier only id is required, and the other fields are populated
  11115. // automatically when the ad is inserted or updated. If targeting a
  11116. // mobile carrier, do not set targeting for any zip codes.
  11117. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  11118. // OperatingSystemVersions: Operating system versions that this ad
  11119. // targets. To target all versions, use operatingSystems. For each
  11120. // operating system version, only id is required. The other fields are
  11121. // populated automatically when the ad is inserted or updated. If
  11122. // targeting an operating system version, do not set targeting for the
  11123. // corresponding operating system in operatingSystems.
  11124. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  11125. // OperatingSystems: Operating systems that this ad targets. To target
  11126. // specific versions, use operatingSystemVersions. For each operating
  11127. // system only dartId is required. The other fields are populated
  11128. // automatically when the ad is inserted or updated. If targeting an
  11129. // operating system, do not set targeting for operating system versions
  11130. // for the same operating system.
  11131. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  11132. // PlatformTypes: Platform types that this ad targets. For example,
  11133. // desktop, mobile, or tablet. For each platform type, only id is
  11134. // required, and the other fields are populated automatically when the
  11135. // ad is inserted or updated.
  11136. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  11137. // ForceSendFields is a list of field names (e.g. "Browsers") to
  11138. // unconditionally include in API requests. By default, fields with
  11139. // empty values are omitted from API requests. However, any non-pointer,
  11140. // non-interface field appearing in ForceSendFields will be sent to the
  11141. // server regardless of whether the field is empty or not. This may be
  11142. // used to include empty fields in Patch requests.
  11143. ForceSendFields []string `json:"-"`
  11144. // NullFields is a list of field names (e.g. "Browsers") to include in
  11145. // API requests with the JSON null value. By default, fields with empty
  11146. // values are omitted from API requests. However, any field with an
  11147. // empty value appearing in NullFields will be sent to the server as
  11148. // null. It is an error if a field in this list has a non-empty value.
  11149. // This may be used to include null fields in Patch requests.
  11150. NullFields []string `json:"-"`
  11151. }
  11152. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  11153. type NoMethod TechnologyTargeting
  11154. raw := NoMethod(*s)
  11155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11156. }
  11157. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  11158. type ThirdPartyAuthenticationToken struct {
  11159. // Name: Name of the third-party authentication token.
  11160. Name string `json:"name,omitempty"`
  11161. // Value: Value of the third-party authentication token. This is a
  11162. // read-only, auto-generated field.
  11163. Value string `json:"value,omitempty"`
  11164. // ForceSendFields is a list of field names (e.g. "Name") to
  11165. // unconditionally include in API requests. By default, fields with
  11166. // empty values are omitted from API requests. However, any non-pointer,
  11167. // non-interface field appearing in ForceSendFields will be sent to the
  11168. // server regardless of whether the field is empty or not. This may be
  11169. // used to include empty fields in Patch requests.
  11170. ForceSendFields []string `json:"-"`
  11171. // NullFields is a list of field names (e.g. "Name") to include in API
  11172. // requests with the JSON null value. By default, fields with empty
  11173. // values are omitted from API requests. However, any field with an
  11174. // empty value appearing in NullFields will be sent to the server as
  11175. // null. It is an error if a field in this list has a non-empty value.
  11176. // This may be used to include null fields in Patch requests.
  11177. NullFields []string `json:"-"`
  11178. }
  11179. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  11180. type NoMethod ThirdPartyAuthenticationToken
  11181. raw := NoMethod(*s)
  11182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11183. }
  11184. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  11185. type ThirdPartyTrackingUrl struct {
  11186. // ThirdPartyUrlType: Third-party URL type for in-stream video and
  11187. // in-stream audio creatives.
  11188. //
  11189. // Possible values:
  11190. // "CLICK_TRACKING"
  11191. // "IMPRESSION"
  11192. // "RICH_MEDIA_BACKUP_IMPRESSION"
  11193. // "RICH_MEDIA_IMPRESSION"
  11194. // "RICH_MEDIA_RM_IMPRESSION"
  11195. // "SURVEY"
  11196. // "VIDEO_COMPLETE"
  11197. // "VIDEO_CUSTOM"
  11198. // "VIDEO_FIRST_QUARTILE"
  11199. // "VIDEO_FULLSCREEN"
  11200. // "VIDEO_MIDPOINT"
  11201. // "VIDEO_MUTE"
  11202. // "VIDEO_PAUSE"
  11203. // "VIDEO_PROGRESS"
  11204. // "VIDEO_REWIND"
  11205. // "VIDEO_SKIP"
  11206. // "VIDEO_START"
  11207. // "VIDEO_STOP"
  11208. // "VIDEO_THIRD_QUARTILE"
  11209. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  11210. // Url: URL for the specified third-party URL type.
  11211. Url string `json:"url,omitempty"`
  11212. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  11213. // to unconditionally include in API requests. By default, fields with
  11214. // empty values are omitted from API requests. However, any non-pointer,
  11215. // non-interface field appearing in ForceSendFields will be sent to the
  11216. // server regardless of whether the field is empty or not. This may be
  11217. // used to include empty fields in Patch requests.
  11218. ForceSendFields []string `json:"-"`
  11219. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  11220. // include in API requests with the JSON null value. By default, fields
  11221. // with empty values are omitted from API requests. However, any field
  11222. // with an empty value appearing in NullFields will be sent to the
  11223. // server as null. It is an error if a field in this list has a
  11224. // non-empty value. This may be used to include null fields in Patch
  11225. // requests.
  11226. NullFields []string `json:"-"`
  11227. }
  11228. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  11229. type NoMethod ThirdPartyTrackingUrl
  11230. raw := NoMethod(*s)
  11231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11232. }
  11233. // TranscodeSetting: Transcode Settings
  11234. type TranscodeSetting struct {
  11235. // EnabledVideoFormats: Whitelist of video formats to be served to this
  11236. // placement. Set this list to null or empty to serve all video formats.
  11237. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  11238. // Kind: Identifies what kind of resource this is. Value: the fixed
  11239. // string "dfareporting#transcodeSetting".
  11240. Kind string `json:"kind,omitempty"`
  11241. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  11242. // to unconditionally include in API requests. By default, fields with
  11243. // empty values are omitted from API requests. However, any non-pointer,
  11244. // non-interface field appearing in ForceSendFields will be sent to the
  11245. // server regardless of whether the field is empty or not. This may be
  11246. // used to include empty fields in Patch requests.
  11247. ForceSendFields []string `json:"-"`
  11248. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  11249. // include in API requests with the JSON null value. By default, fields
  11250. // with empty values are omitted from API requests. However, any field
  11251. // with an empty value appearing in NullFields will be sent to the
  11252. // server as null. It is an error if a field in this list has a
  11253. // non-empty value. This may be used to include null fields in Patch
  11254. // requests.
  11255. NullFields []string `json:"-"`
  11256. }
  11257. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  11258. type NoMethod TranscodeSetting
  11259. raw := NoMethod(*s)
  11260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11261. }
  11262. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  11263. // to the following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and
  11264. // VPAID.
  11265. type UniversalAdId struct {
  11266. // Registry: Registry used for the Ad ID value.
  11267. //
  11268. // Possible values:
  11269. // "AD_ID.ORG"
  11270. // "CLEARCAST"
  11271. // "DCM"
  11272. // "OTHER"
  11273. Registry string `json:"registry,omitempty"`
  11274. // Value: ID value for this creative. Only alphanumeric characters and
  11275. // the following symbols are valid: "_/\-". Maximum length is 64
  11276. // characters. Read only when registry is DCM.
  11277. Value string `json:"value,omitempty"`
  11278. // ForceSendFields is a list of field names (e.g. "Registry") to
  11279. // unconditionally include in API requests. By default, fields with
  11280. // empty values are omitted from API requests. However, any non-pointer,
  11281. // non-interface field appearing in ForceSendFields will be sent to the
  11282. // server regardless of whether the field is empty or not. This may be
  11283. // used to include empty fields in Patch requests.
  11284. ForceSendFields []string `json:"-"`
  11285. // NullFields is a list of field names (e.g. "Registry") to include in
  11286. // API requests with the JSON null value. By default, fields with empty
  11287. // values are omitted from API requests. However, any field with an
  11288. // empty value appearing in NullFields will be sent to the server as
  11289. // null. It is an error if a field in this list has a non-empty value.
  11290. // This may be used to include null fields in Patch requests.
  11291. NullFields []string `json:"-"`
  11292. }
  11293. func (s *UniversalAdId) MarshalJSON() ([]byte, error) {
  11294. type NoMethod UniversalAdId
  11295. raw := NoMethod(*s)
  11296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11297. }
  11298. // UserDefinedVariableConfiguration: User Defined Variable
  11299. // configuration.
  11300. type UserDefinedVariableConfiguration struct {
  11301. // DataType: Data type for the variable. This is a required field.
  11302. //
  11303. // Possible values:
  11304. // "NUMBER"
  11305. // "STRING"
  11306. DataType string `json:"dataType,omitempty"`
  11307. // ReportName: User-friendly name for the variable which will appear in
  11308. // reports. This is a required field, must be less than 64 characters
  11309. // long, and cannot contain the following characters: ""<>".
  11310. ReportName string `json:"reportName,omitempty"`
  11311. // VariableType: Variable name in the tag. This is a required field.
  11312. //
  11313. // Possible values:
  11314. // "U1"
  11315. // "U10"
  11316. // "U100"
  11317. // "U11"
  11318. // "U12"
  11319. // "U13"
  11320. // "U14"
  11321. // "U15"
  11322. // "U16"
  11323. // "U17"
  11324. // "U18"
  11325. // "U19"
  11326. // "U2"
  11327. // "U20"
  11328. // "U21"
  11329. // "U22"
  11330. // "U23"
  11331. // "U24"
  11332. // "U25"
  11333. // "U26"
  11334. // "U27"
  11335. // "U28"
  11336. // "U29"
  11337. // "U3"
  11338. // "U30"
  11339. // "U31"
  11340. // "U32"
  11341. // "U33"
  11342. // "U34"
  11343. // "U35"
  11344. // "U36"
  11345. // "U37"
  11346. // "U38"
  11347. // "U39"
  11348. // "U4"
  11349. // "U40"
  11350. // "U41"
  11351. // "U42"
  11352. // "U43"
  11353. // "U44"
  11354. // "U45"
  11355. // "U46"
  11356. // "U47"
  11357. // "U48"
  11358. // "U49"
  11359. // "U5"
  11360. // "U50"
  11361. // "U51"
  11362. // "U52"
  11363. // "U53"
  11364. // "U54"
  11365. // "U55"
  11366. // "U56"
  11367. // "U57"
  11368. // "U58"
  11369. // "U59"
  11370. // "U6"
  11371. // "U60"
  11372. // "U61"
  11373. // "U62"
  11374. // "U63"
  11375. // "U64"
  11376. // "U65"
  11377. // "U66"
  11378. // "U67"
  11379. // "U68"
  11380. // "U69"
  11381. // "U7"
  11382. // "U70"
  11383. // "U71"
  11384. // "U72"
  11385. // "U73"
  11386. // "U74"
  11387. // "U75"
  11388. // "U76"
  11389. // "U77"
  11390. // "U78"
  11391. // "U79"
  11392. // "U8"
  11393. // "U80"
  11394. // "U81"
  11395. // "U82"
  11396. // "U83"
  11397. // "U84"
  11398. // "U85"
  11399. // "U86"
  11400. // "U87"
  11401. // "U88"
  11402. // "U89"
  11403. // "U9"
  11404. // "U90"
  11405. // "U91"
  11406. // "U92"
  11407. // "U93"
  11408. // "U94"
  11409. // "U95"
  11410. // "U96"
  11411. // "U97"
  11412. // "U98"
  11413. // "U99"
  11414. VariableType string `json:"variableType,omitempty"`
  11415. // ForceSendFields is a list of field names (e.g. "DataType") to
  11416. // unconditionally include in API requests. By default, fields with
  11417. // empty values are omitted from API requests. However, any non-pointer,
  11418. // non-interface field appearing in ForceSendFields will be sent to the
  11419. // server regardless of whether the field is empty or not. This may be
  11420. // used to include empty fields in Patch requests.
  11421. ForceSendFields []string `json:"-"`
  11422. // NullFields is a list of field names (e.g. "DataType") to include in
  11423. // API requests with the JSON null value. By default, fields with empty
  11424. // values are omitted from API requests. However, any field with an
  11425. // empty value appearing in NullFields will be sent to the server as
  11426. // null. It is an error if a field in this list has a non-empty value.
  11427. // This may be used to include null fields in Patch requests.
  11428. NullFields []string `json:"-"`
  11429. }
  11430. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11431. type NoMethod UserDefinedVariableConfiguration
  11432. raw := NoMethod(*s)
  11433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11434. }
  11435. // UserProfile: Represents a UserProfile resource.
  11436. type UserProfile struct {
  11437. // AccountId: The account ID to which this profile belongs.
  11438. AccountId int64 `json:"accountId,omitempty,string"`
  11439. // AccountName: The account name this profile belongs to.
  11440. AccountName string `json:"accountName,omitempty"`
  11441. // Etag: The eTag of this response for caching purposes.
  11442. Etag string `json:"etag,omitempty"`
  11443. // Kind: The kind of resource this is, in this case
  11444. // dfareporting#userProfile.
  11445. Kind string `json:"kind,omitempty"`
  11446. // ProfileId: The unique ID of the user profile.
  11447. ProfileId int64 `json:"profileId,omitempty,string"`
  11448. // SubAccountId: The sub account ID this profile belongs to if
  11449. // applicable.
  11450. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11451. // SubAccountName: The sub account name this profile belongs to if
  11452. // applicable.
  11453. SubAccountName string `json:"subAccountName,omitempty"`
  11454. // UserName: The user name.
  11455. UserName string `json:"userName,omitempty"`
  11456. // ServerResponse contains the HTTP response code and headers from the
  11457. // server.
  11458. googleapi.ServerResponse `json:"-"`
  11459. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11460. // unconditionally include in API requests. By default, fields with
  11461. // empty values are omitted from API requests. However, any non-pointer,
  11462. // non-interface field appearing in ForceSendFields will be sent to the
  11463. // server regardless of whether the field is empty or not. This may be
  11464. // used to include empty fields in Patch requests.
  11465. ForceSendFields []string `json:"-"`
  11466. // NullFields is a list of field names (e.g. "AccountId") to include in
  11467. // API requests with the JSON null value. By default, fields with empty
  11468. // values are omitted from API requests. However, any field with an
  11469. // empty value appearing in NullFields will be sent to the server as
  11470. // null. It is an error if a field in this list has a non-empty value.
  11471. // This may be used to include null fields in Patch requests.
  11472. NullFields []string `json:"-"`
  11473. }
  11474. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11475. type NoMethod UserProfile
  11476. raw := NoMethod(*s)
  11477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11478. }
  11479. // UserProfileList: Represents the list of user profiles.
  11480. type UserProfileList struct {
  11481. // Etag: The eTag of this response for caching purposes.
  11482. Etag string `json:"etag,omitempty"`
  11483. // Items: The user profiles returned in this response.
  11484. Items []*UserProfile `json:"items,omitempty"`
  11485. // Kind: The kind of list this is, in this case
  11486. // dfareporting#userProfileList.
  11487. Kind string `json:"kind,omitempty"`
  11488. // ServerResponse contains the HTTP response code and headers from the
  11489. // server.
  11490. googleapi.ServerResponse `json:"-"`
  11491. // ForceSendFields is a list of field names (e.g. "Etag") to
  11492. // unconditionally include in API requests. By default, fields with
  11493. // empty values are omitted from API requests. However, any non-pointer,
  11494. // non-interface field appearing in ForceSendFields will be sent to the
  11495. // server regardless of whether the field is empty or not. This may be
  11496. // used to include empty fields in Patch requests.
  11497. ForceSendFields []string `json:"-"`
  11498. // NullFields is a list of field names (e.g. "Etag") to include in API
  11499. // requests with the JSON null value. By default, fields with empty
  11500. // values are omitted from API requests. However, any field with an
  11501. // empty value appearing in NullFields will be sent to the server as
  11502. // null. It is an error if a field in this list has a non-empty value.
  11503. // This may be used to include null fields in Patch requests.
  11504. NullFields []string `json:"-"`
  11505. }
  11506. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11507. type NoMethod UserProfileList
  11508. raw := NoMethod(*s)
  11509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11510. }
  11511. // UserRole: Contains properties of auser role, which is used to manage
  11512. // user access.
  11513. type UserRole struct {
  11514. // AccountId: Account ID of this user role. This is a read-only field
  11515. // that can be left blank.
  11516. AccountId int64 `json:"accountId,omitempty,string"`
  11517. // DefaultUserRole: Whether this is a default user role. Default user
  11518. // roles are created by the system for the account/subaccount and cannot
  11519. // be modified or deleted. Each default user role comes with a basic set
  11520. // of preassigned permissions.
  11521. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11522. // Id: ID of this user role. This is a read-only, auto-generated field.
  11523. Id int64 `json:"id,omitempty,string"`
  11524. // Kind: Identifies what kind of resource this is. Value: the fixed
  11525. // string "dfareporting#userRole".
  11526. Kind string `json:"kind,omitempty"`
  11527. // Name: Name of this user role. This is a required field. Must be less
  11528. // than 256 characters long. If this user role is under a subaccount,
  11529. // the name must be unique among sites of the same subaccount.
  11530. // Otherwise, this user role is a top-level user role, and the name must
  11531. // be unique among top-level user roles of the same account.
  11532. Name string `json:"name,omitempty"`
  11533. // ParentUserRoleId: ID of the user role that this user role is based on
  11534. // or copied from. This is a required field.
  11535. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11536. // Permissions: List of permissions associated with this user role.
  11537. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11538. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11539. // field that can be left blank.
  11540. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11541. // ServerResponse contains the HTTP response code and headers from the
  11542. // server.
  11543. googleapi.ServerResponse `json:"-"`
  11544. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11545. // unconditionally include in API requests. By default, fields with
  11546. // empty values are omitted from API requests. However, any non-pointer,
  11547. // non-interface field appearing in ForceSendFields will be sent to the
  11548. // server regardless of whether the field is empty or not. This may be
  11549. // used to include empty fields in Patch requests.
  11550. ForceSendFields []string `json:"-"`
  11551. // NullFields is a list of field names (e.g. "AccountId") to include in
  11552. // API requests with the JSON null value. By default, fields with empty
  11553. // values are omitted from API requests. However, any field with an
  11554. // empty value appearing in NullFields will be sent to the server as
  11555. // null. It is an error if a field in this list has a non-empty value.
  11556. // This may be used to include null fields in Patch requests.
  11557. NullFields []string `json:"-"`
  11558. }
  11559. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11560. type NoMethod UserRole
  11561. raw := NoMethod(*s)
  11562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11563. }
  11564. // UserRolePermission: Contains properties of a user role permission.
  11565. type UserRolePermission struct {
  11566. // Availability: Levels of availability for a user role permission.
  11567. //
  11568. // Possible values:
  11569. // "ACCOUNT_ALWAYS"
  11570. // "ACCOUNT_BY_DEFAULT"
  11571. // "NOT_AVAILABLE_BY_DEFAULT"
  11572. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11573. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11574. Availability string `json:"availability,omitempty"`
  11575. // Id: ID of this user role permission.
  11576. Id int64 `json:"id,omitempty,string"`
  11577. // Kind: Identifies what kind of resource this is. Value: the fixed
  11578. // string "dfareporting#userRolePermission".
  11579. Kind string `json:"kind,omitempty"`
  11580. // Name: Name of this user role permission.
  11581. Name string `json:"name,omitempty"`
  11582. // PermissionGroupId: ID of the permission group that this user role
  11583. // permission belongs to.
  11584. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11585. // ServerResponse contains the HTTP response code and headers from the
  11586. // server.
  11587. googleapi.ServerResponse `json:"-"`
  11588. // ForceSendFields is a list of field names (e.g. "Availability") to
  11589. // unconditionally include in API requests. By default, fields with
  11590. // empty values are omitted from API requests. However, any non-pointer,
  11591. // non-interface field appearing in ForceSendFields will be sent to the
  11592. // server regardless of whether the field is empty or not. This may be
  11593. // used to include empty fields in Patch requests.
  11594. ForceSendFields []string `json:"-"`
  11595. // NullFields is a list of field names (e.g. "Availability") to include
  11596. // in API requests with the JSON null value. By default, fields with
  11597. // empty values are omitted from API requests. However, any field with
  11598. // an empty value appearing in NullFields will be sent to the server as
  11599. // null. It is an error if a field in this list has a non-empty value.
  11600. // This may be used to include null fields in Patch requests.
  11601. NullFields []string `json:"-"`
  11602. }
  11603. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11604. type NoMethod UserRolePermission
  11605. raw := NoMethod(*s)
  11606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11607. }
  11608. // UserRolePermissionGroup: Represents a grouping of related user role
  11609. // permissions.
  11610. type UserRolePermissionGroup struct {
  11611. // Id: ID of this user role permission.
  11612. Id int64 `json:"id,omitempty,string"`
  11613. // Kind: Identifies what kind of resource this is. Value: the fixed
  11614. // string "dfareporting#userRolePermissionGroup".
  11615. Kind string `json:"kind,omitempty"`
  11616. // Name: Name of this user role permission group.
  11617. Name string `json:"name,omitempty"`
  11618. // ServerResponse contains the HTTP response code and headers from the
  11619. // server.
  11620. googleapi.ServerResponse `json:"-"`
  11621. // ForceSendFields is a list of field names (e.g. "Id") to
  11622. // unconditionally include in API requests. By default, fields with
  11623. // empty values are omitted from API requests. However, any non-pointer,
  11624. // non-interface field appearing in ForceSendFields will be sent to the
  11625. // server regardless of whether the field is empty or not. This may be
  11626. // used to include empty fields in Patch requests.
  11627. ForceSendFields []string `json:"-"`
  11628. // NullFields is a list of field names (e.g. "Id") to include in API
  11629. // requests with the JSON null value. By default, fields with empty
  11630. // values are omitted from API requests. However, any field with an
  11631. // empty value appearing in NullFields will be sent to the server as
  11632. // null. It is an error if a field in this list has a non-empty value.
  11633. // This may be used to include null fields in Patch requests.
  11634. NullFields []string `json:"-"`
  11635. }
  11636. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11637. type NoMethod UserRolePermissionGroup
  11638. raw := NoMethod(*s)
  11639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11640. }
  11641. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11642. // Response
  11643. type UserRolePermissionGroupsListResponse struct {
  11644. // Kind: Identifies what kind of resource this is. Value: the fixed
  11645. // string "dfareporting#userRolePermissionGroupsListResponse".
  11646. Kind string `json:"kind,omitempty"`
  11647. // UserRolePermissionGroups: User role permission group collection.
  11648. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11649. // ServerResponse contains the HTTP response code and headers from the
  11650. // server.
  11651. googleapi.ServerResponse `json:"-"`
  11652. // ForceSendFields is a list of field names (e.g. "Kind") to
  11653. // unconditionally include in API requests. By default, fields with
  11654. // empty values are omitted from API requests. However, any non-pointer,
  11655. // non-interface field appearing in ForceSendFields will be sent to the
  11656. // server regardless of whether the field is empty or not. This may be
  11657. // used to include empty fields in Patch requests.
  11658. ForceSendFields []string `json:"-"`
  11659. // NullFields is a list of field names (e.g. "Kind") to include in API
  11660. // requests with the JSON null value. By default, fields with empty
  11661. // values are omitted from API requests. However, any field with an
  11662. // empty value appearing in NullFields will be sent to the server as
  11663. // null. It is an error if a field in this list has a non-empty value.
  11664. // This may be used to include null fields in Patch requests.
  11665. NullFields []string `json:"-"`
  11666. }
  11667. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11668. type NoMethod UserRolePermissionGroupsListResponse
  11669. raw := NoMethod(*s)
  11670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11671. }
  11672. // UserRolePermissionsListResponse: User Role Permission List Response
  11673. type UserRolePermissionsListResponse struct {
  11674. // Kind: Identifies what kind of resource this is. Value: the fixed
  11675. // string "dfareporting#userRolePermissionsListResponse".
  11676. Kind string `json:"kind,omitempty"`
  11677. // UserRolePermissions: User role permission collection.
  11678. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11679. // ServerResponse contains the HTTP response code and headers from the
  11680. // server.
  11681. googleapi.ServerResponse `json:"-"`
  11682. // ForceSendFields is a list of field names (e.g. "Kind") to
  11683. // unconditionally include in API requests. By default, fields with
  11684. // empty values are omitted from API requests. However, any non-pointer,
  11685. // non-interface field appearing in ForceSendFields will be sent to the
  11686. // server regardless of whether the field is empty or not. This may be
  11687. // used to include empty fields in Patch requests.
  11688. ForceSendFields []string `json:"-"`
  11689. // NullFields is a list of field names (e.g. "Kind") to include in API
  11690. // requests with the JSON null value. By default, fields with empty
  11691. // values are omitted from API requests. However, any field with an
  11692. // empty value appearing in NullFields will be sent to the server as
  11693. // null. It is an error if a field in this list has a non-empty value.
  11694. // This may be used to include null fields in Patch requests.
  11695. NullFields []string `json:"-"`
  11696. }
  11697. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11698. type NoMethod UserRolePermissionsListResponse
  11699. raw := NoMethod(*s)
  11700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11701. }
  11702. // UserRolesListResponse: User Role List Response
  11703. type UserRolesListResponse struct {
  11704. // Kind: Identifies what kind of resource this is. Value: the fixed
  11705. // string "dfareporting#userRolesListResponse".
  11706. Kind string `json:"kind,omitempty"`
  11707. // NextPageToken: Pagination token to be used for the next list
  11708. // operation.
  11709. NextPageToken string `json:"nextPageToken,omitempty"`
  11710. // UserRoles: User role collection.
  11711. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11712. // ServerResponse contains the HTTP response code and headers from the
  11713. // server.
  11714. googleapi.ServerResponse `json:"-"`
  11715. // ForceSendFields is a list of field names (e.g. "Kind") to
  11716. // unconditionally include in API requests. By default, fields with
  11717. // empty values are omitted from API requests. However, any non-pointer,
  11718. // non-interface field appearing in ForceSendFields will be sent to the
  11719. // server regardless of whether the field is empty or not. This may be
  11720. // used to include empty fields in Patch requests.
  11721. ForceSendFields []string `json:"-"`
  11722. // NullFields is a list of field names (e.g. "Kind") to include in API
  11723. // requests with the JSON null value. By default, fields with empty
  11724. // values are omitted from API requests. However, any field with an
  11725. // empty value appearing in NullFields will be sent to the server as
  11726. // null. It is an error if a field in this list has a non-empty value.
  11727. // This may be used to include null fields in Patch requests.
  11728. NullFields []string `json:"-"`
  11729. }
  11730. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11731. type NoMethod UserRolesListResponse
  11732. raw := NoMethod(*s)
  11733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11734. }
  11735. // VideoFormat: Contains information about supported video formats.
  11736. type VideoFormat struct {
  11737. // FileType: File type of the video format.
  11738. //
  11739. // Possible values:
  11740. // "FLV"
  11741. // "M3U8"
  11742. // "MP4"
  11743. // "THREEGPP"
  11744. // "WEBM"
  11745. FileType string `json:"fileType,omitempty"`
  11746. // Id: ID of the video format.
  11747. Id int64 `json:"id,omitempty"`
  11748. // Kind: Identifies what kind of resource this is. Value: the fixed
  11749. // string "dfareporting#videoFormat".
  11750. Kind string `json:"kind,omitempty"`
  11751. // Resolution: The resolution of this video format.
  11752. Resolution *Size `json:"resolution,omitempty"`
  11753. // TargetBitRate: The target bit rate of this video format.
  11754. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11755. // ServerResponse contains the HTTP response code and headers from the
  11756. // server.
  11757. googleapi.ServerResponse `json:"-"`
  11758. // ForceSendFields is a list of field names (e.g. "FileType") to
  11759. // unconditionally include in API requests. By default, fields with
  11760. // empty values are omitted from API requests. However, any non-pointer,
  11761. // non-interface field appearing in ForceSendFields will be sent to the
  11762. // server regardless of whether the field is empty or not. This may be
  11763. // used to include empty fields in Patch requests.
  11764. ForceSendFields []string `json:"-"`
  11765. // NullFields is a list of field names (e.g. "FileType") to include in
  11766. // API requests with the JSON null value. By default, fields with empty
  11767. // values are omitted from API requests. However, any field with an
  11768. // empty value appearing in NullFields will be sent to the server as
  11769. // null. It is an error if a field in this list has a non-empty value.
  11770. // This may be used to include null fields in Patch requests.
  11771. NullFields []string `json:"-"`
  11772. }
  11773. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11774. type NoMethod VideoFormat
  11775. raw := NoMethod(*s)
  11776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11777. }
  11778. // VideoFormatsListResponse: Video Format List Response
  11779. type VideoFormatsListResponse struct {
  11780. // Kind: Identifies what kind of resource this is. Value: the fixed
  11781. // string "dfareporting#videoFormatsListResponse".
  11782. Kind string `json:"kind,omitempty"`
  11783. // VideoFormats: Video format collection.
  11784. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11785. // ServerResponse contains the HTTP response code and headers from the
  11786. // server.
  11787. googleapi.ServerResponse `json:"-"`
  11788. // ForceSendFields is a list of field names (e.g. "Kind") to
  11789. // unconditionally include in API requests. By default, fields with
  11790. // empty values are omitted from API requests. However, any non-pointer,
  11791. // non-interface field appearing in ForceSendFields will be sent to the
  11792. // server regardless of whether the field is empty or not. This may be
  11793. // used to include empty fields in Patch requests.
  11794. ForceSendFields []string `json:"-"`
  11795. // NullFields is a list of field names (e.g. "Kind") to include in API
  11796. // requests with the JSON null value. By default, fields with empty
  11797. // values are omitted from API requests. However, any field with an
  11798. // empty value appearing in NullFields will be sent to the server as
  11799. // null. It is an error if a field in this list has a non-empty value.
  11800. // This may be used to include null fields in Patch requests.
  11801. NullFields []string `json:"-"`
  11802. }
  11803. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11804. type NoMethod VideoFormatsListResponse
  11805. raw := NoMethod(*s)
  11806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11807. }
  11808. // VideoOffset: Video Offset
  11809. type VideoOffset struct {
  11810. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11811. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11812. // inclusive.
  11813. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11814. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11815. // is set. Acceptable values are 0 to 86399, inclusive.
  11816. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11817. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11818. // unconditionally include in API requests. By default, fields with
  11819. // empty values are omitted from API requests. However, any non-pointer,
  11820. // non-interface field appearing in ForceSendFields will be sent to the
  11821. // server regardless of whether the field is empty or not. This may be
  11822. // used to include empty fields in Patch requests.
  11823. ForceSendFields []string `json:"-"`
  11824. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11825. // include in API requests with the JSON null value. By default, fields
  11826. // with empty values are omitted from API requests. However, any field
  11827. // with an empty value appearing in NullFields will be sent to the
  11828. // server as null. It is an error if a field in this list has a
  11829. // non-empty value. This may be used to include null fields in Patch
  11830. // requests.
  11831. NullFields []string `json:"-"`
  11832. }
  11833. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11834. type NoMethod VideoOffset
  11835. raw := NoMethod(*s)
  11836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11837. }
  11838. // VideoSettings: Video Settings
  11839. type VideoSettings struct {
  11840. // CompanionSettings: Settings for the companion creatives of video
  11841. // creatives served to this placement.
  11842. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11843. // Kind: Identifies what kind of resource this is. Value: the fixed
  11844. // string "dfareporting#videoSettings".
  11845. Kind string `json:"kind,omitempty"`
  11846. // Orientation: Orientation of a video placement. If this value is set,
  11847. // placement will return assets matching the specified orientation.
  11848. //
  11849. // Possible values:
  11850. // "ANY"
  11851. // "LANDSCAPE"
  11852. // "PORTRAIT"
  11853. Orientation string `json:"orientation,omitempty"`
  11854. // SkippableSettings: Settings for the skippability of video creatives
  11855. // served to this placement. If this object is provided, the
  11856. // creative-level skippable settings will be overridden.
  11857. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11858. // TranscodeSettings: Settings for the transcodes of video creatives
  11859. // served to this placement. If this object is provided, the
  11860. // creative-level transcode settings will be overridden.
  11861. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11862. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11863. // to unconditionally include in API requests. By default, fields with
  11864. // empty values are omitted from API requests. However, any non-pointer,
  11865. // non-interface field appearing in ForceSendFields will be sent to the
  11866. // server regardless of whether the field is empty or not. This may be
  11867. // used to include empty fields in Patch requests.
  11868. ForceSendFields []string `json:"-"`
  11869. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11870. // include in API requests with the JSON null value. By default, fields
  11871. // with empty values are omitted from API requests. However, any field
  11872. // with an empty value appearing in NullFields will be sent to the
  11873. // server as null. It is an error if a field in this list has a
  11874. // non-empty value. This may be used to include null fields in Patch
  11875. // requests.
  11876. NullFields []string `json:"-"`
  11877. }
  11878. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11879. type NoMethod VideoSettings
  11880. raw := NoMethod(*s)
  11881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11882. }
  11883. // method id "dfareporting.accountActiveAdSummaries.get":
  11884. type AccountActiveAdSummariesGetCall struct {
  11885. s *Service
  11886. profileId int64
  11887. summaryAccountId int64
  11888. urlParams_ gensupport.URLParams
  11889. ifNoneMatch_ string
  11890. ctx_ context.Context
  11891. header_ http.Header
  11892. }
  11893. // Get: Gets the account's active ad summary by account ID.
  11894. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11895. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11896. c.profileId = profileId
  11897. c.summaryAccountId = summaryAccountId
  11898. return c
  11899. }
  11900. // Fields allows partial responses to be retrieved. See
  11901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11902. // for more information.
  11903. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11905. return c
  11906. }
  11907. // IfNoneMatch sets the optional parameter which makes the operation
  11908. // fail if the object's ETag matches the given value. This is useful for
  11909. // getting updates only after the object has changed since the last
  11910. // request. Use googleapi.IsNotModified to check whether the response
  11911. // error from Do is the result of In-None-Match.
  11912. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11913. c.ifNoneMatch_ = entityTag
  11914. return c
  11915. }
  11916. // Context sets the context to be used in this call's Do method. Any
  11917. // pending HTTP request will be aborted if the provided context is
  11918. // canceled.
  11919. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11920. c.ctx_ = ctx
  11921. return c
  11922. }
  11923. // Header returns an http.Header that can be modified by the caller to
  11924. // add HTTP headers to the request.
  11925. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11926. if c.header_ == nil {
  11927. c.header_ = make(http.Header)
  11928. }
  11929. return c.header_
  11930. }
  11931. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11932. reqHeaders := make(http.Header)
  11933. for k, v := range c.header_ {
  11934. reqHeaders[k] = v
  11935. }
  11936. reqHeaders.Set("User-Agent", c.s.userAgent())
  11937. if c.ifNoneMatch_ != "" {
  11938. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11939. }
  11940. var body io.Reader = nil
  11941. c.urlParams_.Set("alt", alt)
  11942. c.urlParams_.Set("prettyPrint", "false")
  11943. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11944. urls += "?" + c.urlParams_.Encode()
  11945. req, err := http.NewRequest("GET", urls, body)
  11946. if err != nil {
  11947. return nil, err
  11948. }
  11949. req.Header = reqHeaders
  11950. googleapi.Expand(req.URL, map[string]string{
  11951. "profileId": strconv.FormatInt(c.profileId, 10),
  11952. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11953. })
  11954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11955. }
  11956. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11957. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11958. // non-2xx status code is an error. Response headers are in either
  11959. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11960. // returned at all) in error.(*googleapi.Error).Header. Use
  11961. // googleapi.IsNotModified to check whether the returned error was
  11962. // because http.StatusNotModified was returned.
  11963. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11964. gensupport.SetOptions(c.urlParams_, opts...)
  11965. res, err := c.doRequest("json")
  11966. if res != nil && res.StatusCode == http.StatusNotModified {
  11967. if res.Body != nil {
  11968. res.Body.Close()
  11969. }
  11970. return nil, &googleapi.Error{
  11971. Code: res.StatusCode,
  11972. Header: res.Header,
  11973. }
  11974. }
  11975. if err != nil {
  11976. return nil, err
  11977. }
  11978. defer googleapi.CloseBody(res)
  11979. if err := googleapi.CheckResponse(res); err != nil {
  11980. return nil, err
  11981. }
  11982. ret := &AccountActiveAdSummary{
  11983. ServerResponse: googleapi.ServerResponse{
  11984. Header: res.Header,
  11985. HTTPStatusCode: res.StatusCode,
  11986. },
  11987. }
  11988. target := &ret
  11989. if err := gensupport.DecodeResponse(target, res); err != nil {
  11990. return nil, err
  11991. }
  11992. return ret, nil
  11993. // {
  11994. // "description": "Gets the account's active ad summary by account ID.",
  11995. // "httpMethod": "GET",
  11996. // "id": "dfareporting.accountActiveAdSummaries.get",
  11997. // "parameterOrder": [
  11998. // "profileId",
  11999. // "summaryAccountId"
  12000. // ],
  12001. // "parameters": {
  12002. // "profileId": {
  12003. // "description": "User profile ID associated with this request.",
  12004. // "format": "int64",
  12005. // "location": "path",
  12006. // "required": true,
  12007. // "type": "string"
  12008. // },
  12009. // "summaryAccountId": {
  12010. // "description": "Account ID.",
  12011. // "format": "int64",
  12012. // "location": "path",
  12013. // "required": true,
  12014. // "type": "string"
  12015. // }
  12016. // },
  12017. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  12018. // "response": {
  12019. // "$ref": "AccountActiveAdSummary"
  12020. // },
  12021. // "scopes": [
  12022. // "https://www.googleapis.com/auth/dfatrafficking"
  12023. // ]
  12024. // }
  12025. }
  12026. // method id "dfareporting.accountPermissionGroups.get":
  12027. type AccountPermissionGroupsGetCall struct {
  12028. s *Service
  12029. profileId int64
  12030. id int64
  12031. urlParams_ gensupport.URLParams
  12032. ifNoneMatch_ string
  12033. ctx_ context.Context
  12034. header_ http.Header
  12035. }
  12036. // Get: Gets one account permission group by ID.
  12037. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  12038. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12039. c.profileId = profileId
  12040. c.id = id
  12041. return c
  12042. }
  12043. // Fields allows partial responses to be retrieved. See
  12044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12045. // for more information.
  12046. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  12047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12048. return c
  12049. }
  12050. // IfNoneMatch sets the optional parameter which makes the operation
  12051. // fail if the object's ETag matches the given value. This is useful for
  12052. // getting updates only after the object has changed since the last
  12053. // request. Use googleapi.IsNotModified to check whether the response
  12054. // error from Do is the result of In-None-Match.
  12055. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  12056. c.ifNoneMatch_ = entityTag
  12057. return c
  12058. }
  12059. // Context sets the context to be used in this call's Do method. Any
  12060. // pending HTTP request will be aborted if the provided context is
  12061. // canceled.
  12062. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  12063. c.ctx_ = ctx
  12064. return c
  12065. }
  12066. // Header returns an http.Header that can be modified by the caller to
  12067. // add HTTP headers to the request.
  12068. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  12069. if c.header_ == nil {
  12070. c.header_ = make(http.Header)
  12071. }
  12072. return c.header_
  12073. }
  12074. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  12075. reqHeaders := make(http.Header)
  12076. for k, v := range c.header_ {
  12077. reqHeaders[k] = v
  12078. }
  12079. reqHeaders.Set("User-Agent", c.s.userAgent())
  12080. if c.ifNoneMatch_ != "" {
  12081. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12082. }
  12083. var body io.Reader = nil
  12084. c.urlParams_.Set("alt", alt)
  12085. c.urlParams_.Set("prettyPrint", "false")
  12086. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  12087. urls += "?" + c.urlParams_.Encode()
  12088. req, err := http.NewRequest("GET", urls, body)
  12089. if err != nil {
  12090. return nil, err
  12091. }
  12092. req.Header = reqHeaders
  12093. googleapi.Expand(req.URL, map[string]string{
  12094. "profileId": strconv.FormatInt(c.profileId, 10),
  12095. "id": strconv.FormatInt(c.id, 10),
  12096. })
  12097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12098. }
  12099. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  12100. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  12101. // non-2xx status code is an error. Response headers are in either
  12102. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  12103. // returned at all) in error.(*googleapi.Error).Header. Use
  12104. // googleapi.IsNotModified to check whether the returned error was
  12105. // because http.StatusNotModified was returned.
  12106. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  12107. gensupport.SetOptions(c.urlParams_, opts...)
  12108. res, err := c.doRequest("json")
  12109. if res != nil && res.StatusCode == http.StatusNotModified {
  12110. if res.Body != nil {
  12111. res.Body.Close()
  12112. }
  12113. return nil, &googleapi.Error{
  12114. Code: res.StatusCode,
  12115. Header: res.Header,
  12116. }
  12117. }
  12118. if err != nil {
  12119. return nil, err
  12120. }
  12121. defer googleapi.CloseBody(res)
  12122. if err := googleapi.CheckResponse(res); err != nil {
  12123. return nil, err
  12124. }
  12125. ret := &AccountPermissionGroup{
  12126. ServerResponse: googleapi.ServerResponse{
  12127. Header: res.Header,
  12128. HTTPStatusCode: res.StatusCode,
  12129. },
  12130. }
  12131. target := &ret
  12132. if err := gensupport.DecodeResponse(target, res); err != nil {
  12133. return nil, err
  12134. }
  12135. return ret, nil
  12136. // {
  12137. // "description": "Gets one account permission group by ID.",
  12138. // "httpMethod": "GET",
  12139. // "id": "dfareporting.accountPermissionGroups.get",
  12140. // "parameterOrder": [
  12141. // "profileId",
  12142. // "id"
  12143. // ],
  12144. // "parameters": {
  12145. // "id": {
  12146. // "description": "Account permission group ID.",
  12147. // "format": "int64",
  12148. // "location": "path",
  12149. // "required": true,
  12150. // "type": "string"
  12151. // },
  12152. // "profileId": {
  12153. // "description": "User profile ID associated with this request.",
  12154. // "format": "int64",
  12155. // "location": "path",
  12156. // "required": true,
  12157. // "type": "string"
  12158. // }
  12159. // },
  12160. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  12161. // "response": {
  12162. // "$ref": "AccountPermissionGroup"
  12163. // },
  12164. // "scopes": [
  12165. // "https://www.googleapis.com/auth/dfatrafficking"
  12166. // ]
  12167. // }
  12168. }
  12169. // method id "dfareporting.accountPermissionGroups.list":
  12170. type AccountPermissionGroupsListCall struct {
  12171. s *Service
  12172. profileId int64
  12173. urlParams_ gensupport.URLParams
  12174. ifNoneMatch_ string
  12175. ctx_ context.Context
  12176. header_ http.Header
  12177. }
  12178. // List: Retrieves the list of account permission groups.
  12179. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  12180. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12181. c.profileId = profileId
  12182. return c
  12183. }
  12184. // Fields allows partial responses to be retrieved. See
  12185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12186. // for more information.
  12187. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  12188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12189. return c
  12190. }
  12191. // IfNoneMatch sets the optional parameter which makes the operation
  12192. // fail if the object's ETag matches the given value. This is useful for
  12193. // getting updates only after the object has changed since the last
  12194. // request. Use googleapi.IsNotModified to check whether the response
  12195. // error from Do is the result of In-None-Match.
  12196. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  12197. c.ifNoneMatch_ = entityTag
  12198. return c
  12199. }
  12200. // Context sets the context to be used in this call's Do method. Any
  12201. // pending HTTP request will be aborted if the provided context is
  12202. // canceled.
  12203. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  12204. c.ctx_ = ctx
  12205. return c
  12206. }
  12207. // Header returns an http.Header that can be modified by the caller to
  12208. // add HTTP headers to the request.
  12209. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  12210. if c.header_ == nil {
  12211. c.header_ = make(http.Header)
  12212. }
  12213. return c.header_
  12214. }
  12215. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  12216. reqHeaders := make(http.Header)
  12217. for k, v := range c.header_ {
  12218. reqHeaders[k] = v
  12219. }
  12220. reqHeaders.Set("User-Agent", c.s.userAgent())
  12221. if c.ifNoneMatch_ != "" {
  12222. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12223. }
  12224. var body io.Reader = nil
  12225. c.urlParams_.Set("alt", alt)
  12226. c.urlParams_.Set("prettyPrint", "false")
  12227. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  12228. urls += "?" + c.urlParams_.Encode()
  12229. req, err := http.NewRequest("GET", urls, body)
  12230. if err != nil {
  12231. return nil, err
  12232. }
  12233. req.Header = reqHeaders
  12234. googleapi.Expand(req.URL, map[string]string{
  12235. "profileId": strconv.FormatInt(c.profileId, 10),
  12236. })
  12237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12238. }
  12239. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  12240. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  12241. // non-nil. Any non-2xx status code is an error. Response headers are in
  12242. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  12243. // (if a response was returned at all) in
  12244. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12245. // whether the returned error was because http.StatusNotModified was
  12246. // returned.
  12247. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  12248. gensupport.SetOptions(c.urlParams_, opts...)
  12249. res, err := c.doRequest("json")
  12250. if res != nil && res.StatusCode == http.StatusNotModified {
  12251. if res.Body != nil {
  12252. res.Body.Close()
  12253. }
  12254. return nil, &googleapi.Error{
  12255. Code: res.StatusCode,
  12256. Header: res.Header,
  12257. }
  12258. }
  12259. if err != nil {
  12260. return nil, err
  12261. }
  12262. defer googleapi.CloseBody(res)
  12263. if err := googleapi.CheckResponse(res); err != nil {
  12264. return nil, err
  12265. }
  12266. ret := &AccountPermissionGroupsListResponse{
  12267. ServerResponse: googleapi.ServerResponse{
  12268. Header: res.Header,
  12269. HTTPStatusCode: res.StatusCode,
  12270. },
  12271. }
  12272. target := &ret
  12273. if err := gensupport.DecodeResponse(target, res); err != nil {
  12274. return nil, err
  12275. }
  12276. return ret, nil
  12277. // {
  12278. // "description": "Retrieves the list of account permission groups.",
  12279. // "httpMethod": "GET",
  12280. // "id": "dfareporting.accountPermissionGroups.list",
  12281. // "parameterOrder": [
  12282. // "profileId"
  12283. // ],
  12284. // "parameters": {
  12285. // "profileId": {
  12286. // "description": "User profile ID associated with this request.",
  12287. // "format": "int64",
  12288. // "location": "path",
  12289. // "required": true,
  12290. // "type": "string"
  12291. // }
  12292. // },
  12293. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  12294. // "response": {
  12295. // "$ref": "AccountPermissionGroupsListResponse"
  12296. // },
  12297. // "scopes": [
  12298. // "https://www.googleapis.com/auth/dfatrafficking"
  12299. // ]
  12300. // }
  12301. }
  12302. // method id "dfareporting.accountPermissions.get":
  12303. type AccountPermissionsGetCall struct {
  12304. s *Service
  12305. profileId int64
  12306. id int64
  12307. urlParams_ gensupport.URLParams
  12308. ifNoneMatch_ string
  12309. ctx_ context.Context
  12310. header_ http.Header
  12311. }
  12312. // Get: Gets one account permission by ID.
  12313. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  12314. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12315. c.profileId = profileId
  12316. c.id = id
  12317. return c
  12318. }
  12319. // Fields allows partial responses to be retrieved. See
  12320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12321. // for more information.
  12322. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  12323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12324. return c
  12325. }
  12326. // IfNoneMatch sets the optional parameter which makes the operation
  12327. // fail if the object's ETag matches the given value. This is useful for
  12328. // getting updates only after the object has changed since the last
  12329. // request. Use googleapi.IsNotModified to check whether the response
  12330. // error from Do is the result of In-None-Match.
  12331. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  12332. c.ifNoneMatch_ = entityTag
  12333. return c
  12334. }
  12335. // Context sets the context to be used in this call's Do method. Any
  12336. // pending HTTP request will be aborted if the provided context is
  12337. // canceled.
  12338. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  12339. c.ctx_ = ctx
  12340. return c
  12341. }
  12342. // Header returns an http.Header that can be modified by the caller to
  12343. // add HTTP headers to the request.
  12344. func (c *AccountPermissionsGetCall) Header() http.Header {
  12345. if c.header_ == nil {
  12346. c.header_ = make(http.Header)
  12347. }
  12348. return c.header_
  12349. }
  12350. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12351. reqHeaders := make(http.Header)
  12352. for k, v := range c.header_ {
  12353. reqHeaders[k] = v
  12354. }
  12355. reqHeaders.Set("User-Agent", c.s.userAgent())
  12356. if c.ifNoneMatch_ != "" {
  12357. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12358. }
  12359. var body io.Reader = nil
  12360. c.urlParams_.Set("alt", alt)
  12361. c.urlParams_.Set("prettyPrint", "false")
  12362. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  12363. urls += "?" + c.urlParams_.Encode()
  12364. req, err := http.NewRequest("GET", urls, body)
  12365. if err != nil {
  12366. return nil, err
  12367. }
  12368. req.Header = reqHeaders
  12369. googleapi.Expand(req.URL, map[string]string{
  12370. "profileId": strconv.FormatInt(c.profileId, 10),
  12371. "id": strconv.FormatInt(c.id, 10),
  12372. })
  12373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12374. }
  12375. // Do executes the "dfareporting.accountPermissions.get" call.
  12376. // Exactly one of *AccountPermission or error will be non-nil. Any
  12377. // non-2xx status code is an error. Response headers are in either
  12378. // *AccountPermission.ServerResponse.Header or (if a response was
  12379. // returned at all) in error.(*googleapi.Error).Header. Use
  12380. // googleapi.IsNotModified to check whether the returned error was
  12381. // because http.StatusNotModified was returned.
  12382. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  12383. gensupport.SetOptions(c.urlParams_, opts...)
  12384. res, err := c.doRequest("json")
  12385. if res != nil && res.StatusCode == http.StatusNotModified {
  12386. if res.Body != nil {
  12387. res.Body.Close()
  12388. }
  12389. return nil, &googleapi.Error{
  12390. Code: res.StatusCode,
  12391. Header: res.Header,
  12392. }
  12393. }
  12394. if err != nil {
  12395. return nil, err
  12396. }
  12397. defer googleapi.CloseBody(res)
  12398. if err := googleapi.CheckResponse(res); err != nil {
  12399. return nil, err
  12400. }
  12401. ret := &AccountPermission{
  12402. ServerResponse: googleapi.ServerResponse{
  12403. Header: res.Header,
  12404. HTTPStatusCode: res.StatusCode,
  12405. },
  12406. }
  12407. target := &ret
  12408. if err := gensupport.DecodeResponse(target, res); err != nil {
  12409. return nil, err
  12410. }
  12411. return ret, nil
  12412. // {
  12413. // "description": "Gets one account permission by ID.",
  12414. // "httpMethod": "GET",
  12415. // "id": "dfareporting.accountPermissions.get",
  12416. // "parameterOrder": [
  12417. // "profileId",
  12418. // "id"
  12419. // ],
  12420. // "parameters": {
  12421. // "id": {
  12422. // "description": "Account permission ID.",
  12423. // "format": "int64",
  12424. // "location": "path",
  12425. // "required": true,
  12426. // "type": "string"
  12427. // },
  12428. // "profileId": {
  12429. // "description": "User profile ID associated with this request.",
  12430. // "format": "int64",
  12431. // "location": "path",
  12432. // "required": true,
  12433. // "type": "string"
  12434. // }
  12435. // },
  12436. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  12437. // "response": {
  12438. // "$ref": "AccountPermission"
  12439. // },
  12440. // "scopes": [
  12441. // "https://www.googleapis.com/auth/dfatrafficking"
  12442. // ]
  12443. // }
  12444. }
  12445. // method id "dfareporting.accountPermissions.list":
  12446. type AccountPermissionsListCall struct {
  12447. s *Service
  12448. profileId int64
  12449. urlParams_ gensupport.URLParams
  12450. ifNoneMatch_ string
  12451. ctx_ context.Context
  12452. header_ http.Header
  12453. }
  12454. // List: Retrieves the list of account permissions.
  12455. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12456. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12457. c.profileId = profileId
  12458. return c
  12459. }
  12460. // Fields allows partial responses to be retrieved. See
  12461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12462. // for more information.
  12463. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12465. return c
  12466. }
  12467. // IfNoneMatch sets the optional parameter which makes the operation
  12468. // fail if the object's ETag matches the given value. This is useful for
  12469. // getting updates only after the object has changed since the last
  12470. // request. Use googleapi.IsNotModified to check whether the response
  12471. // error from Do is the result of In-None-Match.
  12472. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12473. c.ifNoneMatch_ = entityTag
  12474. return c
  12475. }
  12476. // Context sets the context to be used in this call's Do method. Any
  12477. // pending HTTP request will be aborted if the provided context is
  12478. // canceled.
  12479. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12480. c.ctx_ = ctx
  12481. return c
  12482. }
  12483. // Header returns an http.Header that can be modified by the caller to
  12484. // add HTTP headers to the request.
  12485. func (c *AccountPermissionsListCall) Header() http.Header {
  12486. if c.header_ == nil {
  12487. c.header_ = make(http.Header)
  12488. }
  12489. return c.header_
  12490. }
  12491. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12492. reqHeaders := make(http.Header)
  12493. for k, v := range c.header_ {
  12494. reqHeaders[k] = v
  12495. }
  12496. reqHeaders.Set("User-Agent", c.s.userAgent())
  12497. if c.ifNoneMatch_ != "" {
  12498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12499. }
  12500. var body io.Reader = nil
  12501. c.urlParams_.Set("alt", alt)
  12502. c.urlParams_.Set("prettyPrint", "false")
  12503. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12504. urls += "?" + c.urlParams_.Encode()
  12505. req, err := http.NewRequest("GET", urls, body)
  12506. if err != nil {
  12507. return nil, err
  12508. }
  12509. req.Header = reqHeaders
  12510. googleapi.Expand(req.URL, map[string]string{
  12511. "profileId": strconv.FormatInt(c.profileId, 10),
  12512. })
  12513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12514. }
  12515. // Do executes the "dfareporting.accountPermissions.list" call.
  12516. // Exactly one of *AccountPermissionsListResponse or error will be
  12517. // non-nil. Any non-2xx status code is an error. Response headers are in
  12518. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12519. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12520. // googleapi.IsNotModified to check whether the returned error was
  12521. // because http.StatusNotModified was returned.
  12522. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12523. gensupport.SetOptions(c.urlParams_, opts...)
  12524. res, err := c.doRequest("json")
  12525. if res != nil && res.StatusCode == http.StatusNotModified {
  12526. if res.Body != nil {
  12527. res.Body.Close()
  12528. }
  12529. return nil, &googleapi.Error{
  12530. Code: res.StatusCode,
  12531. Header: res.Header,
  12532. }
  12533. }
  12534. if err != nil {
  12535. return nil, err
  12536. }
  12537. defer googleapi.CloseBody(res)
  12538. if err := googleapi.CheckResponse(res); err != nil {
  12539. return nil, err
  12540. }
  12541. ret := &AccountPermissionsListResponse{
  12542. ServerResponse: googleapi.ServerResponse{
  12543. Header: res.Header,
  12544. HTTPStatusCode: res.StatusCode,
  12545. },
  12546. }
  12547. target := &ret
  12548. if err := gensupport.DecodeResponse(target, res); err != nil {
  12549. return nil, err
  12550. }
  12551. return ret, nil
  12552. // {
  12553. // "description": "Retrieves the list of account permissions.",
  12554. // "httpMethod": "GET",
  12555. // "id": "dfareporting.accountPermissions.list",
  12556. // "parameterOrder": [
  12557. // "profileId"
  12558. // ],
  12559. // "parameters": {
  12560. // "profileId": {
  12561. // "description": "User profile ID associated with this request.",
  12562. // "format": "int64",
  12563. // "location": "path",
  12564. // "required": true,
  12565. // "type": "string"
  12566. // }
  12567. // },
  12568. // "path": "userprofiles/{profileId}/accountPermissions",
  12569. // "response": {
  12570. // "$ref": "AccountPermissionsListResponse"
  12571. // },
  12572. // "scopes": [
  12573. // "https://www.googleapis.com/auth/dfatrafficking"
  12574. // ]
  12575. // }
  12576. }
  12577. // method id "dfareporting.accountUserProfiles.get":
  12578. type AccountUserProfilesGetCall struct {
  12579. s *Service
  12580. profileId int64
  12581. id int64
  12582. urlParams_ gensupport.URLParams
  12583. ifNoneMatch_ string
  12584. ctx_ context.Context
  12585. header_ http.Header
  12586. }
  12587. // Get: Gets one account user profile by ID.
  12588. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12589. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12590. c.profileId = profileId
  12591. c.id = id
  12592. return c
  12593. }
  12594. // Fields allows partial responses to be retrieved. See
  12595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12596. // for more information.
  12597. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12599. return c
  12600. }
  12601. // IfNoneMatch sets the optional parameter which makes the operation
  12602. // fail if the object's ETag matches the given value. This is useful for
  12603. // getting updates only after the object has changed since the last
  12604. // request. Use googleapi.IsNotModified to check whether the response
  12605. // error from Do is the result of In-None-Match.
  12606. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12607. c.ifNoneMatch_ = entityTag
  12608. return c
  12609. }
  12610. // Context sets the context to be used in this call's Do method. Any
  12611. // pending HTTP request will be aborted if the provided context is
  12612. // canceled.
  12613. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12614. c.ctx_ = ctx
  12615. return c
  12616. }
  12617. // Header returns an http.Header that can be modified by the caller to
  12618. // add HTTP headers to the request.
  12619. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12620. if c.header_ == nil {
  12621. c.header_ = make(http.Header)
  12622. }
  12623. return c.header_
  12624. }
  12625. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12626. reqHeaders := make(http.Header)
  12627. for k, v := range c.header_ {
  12628. reqHeaders[k] = v
  12629. }
  12630. reqHeaders.Set("User-Agent", c.s.userAgent())
  12631. if c.ifNoneMatch_ != "" {
  12632. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12633. }
  12634. var body io.Reader = nil
  12635. c.urlParams_.Set("alt", alt)
  12636. c.urlParams_.Set("prettyPrint", "false")
  12637. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12638. urls += "?" + c.urlParams_.Encode()
  12639. req, err := http.NewRequest("GET", urls, body)
  12640. if err != nil {
  12641. return nil, err
  12642. }
  12643. req.Header = reqHeaders
  12644. googleapi.Expand(req.URL, map[string]string{
  12645. "profileId": strconv.FormatInt(c.profileId, 10),
  12646. "id": strconv.FormatInt(c.id, 10),
  12647. })
  12648. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12649. }
  12650. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12651. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12652. // non-2xx status code is an error. Response headers are in either
  12653. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12654. // returned at all) in error.(*googleapi.Error).Header. Use
  12655. // googleapi.IsNotModified to check whether the returned error was
  12656. // because http.StatusNotModified was returned.
  12657. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12658. gensupport.SetOptions(c.urlParams_, opts...)
  12659. res, err := c.doRequest("json")
  12660. if res != nil && res.StatusCode == http.StatusNotModified {
  12661. if res.Body != nil {
  12662. res.Body.Close()
  12663. }
  12664. return nil, &googleapi.Error{
  12665. Code: res.StatusCode,
  12666. Header: res.Header,
  12667. }
  12668. }
  12669. if err != nil {
  12670. return nil, err
  12671. }
  12672. defer googleapi.CloseBody(res)
  12673. if err := googleapi.CheckResponse(res); err != nil {
  12674. return nil, err
  12675. }
  12676. ret := &AccountUserProfile{
  12677. ServerResponse: googleapi.ServerResponse{
  12678. Header: res.Header,
  12679. HTTPStatusCode: res.StatusCode,
  12680. },
  12681. }
  12682. target := &ret
  12683. if err := gensupport.DecodeResponse(target, res); err != nil {
  12684. return nil, err
  12685. }
  12686. return ret, nil
  12687. // {
  12688. // "description": "Gets one account user profile by ID.",
  12689. // "httpMethod": "GET",
  12690. // "id": "dfareporting.accountUserProfiles.get",
  12691. // "parameterOrder": [
  12692. // "profileId",
  12693. // "id"
  12694. // ],
  12695. // "parameters": {
  12696. // "id": {
  12697. // "description": "User profile ID.",
  12698. // "format": "int64",
  12699. // "location": "path",
  12700. // "required": true,
  12701. // "type": "string"
  12702. // },
  12703. // "profileId": {
  12704. // "description": "User profile ID associated with this request.",
  12705. // "format": "int64",
  12706. // "location": "path",
  12707. // "required": true,
  12708. // "type": "string"
  12709. // }
  12710. // },
  12711. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12712. // "response": {
  12713. // "$ref": "AccountUserProfile"
  12714. // },
  12715. // "scopes": [
  12716. // "https://www.googleapis.com/auth/dfatrafficking"
  12717. // ]
  12718. // }
  12719. }
  12720. // method id "dfareporting.accountUserProfiles.insert":
  12721. type AccountUserProfilesInsertCall struct {
  12722. s *Service
  12723. profileId int64
  12724. accountuserprofile *AccountUserProfile
  12725. urlParams_ gensupport.URLParams
  12726. ctx_ context.Context
  12727. header_ http.Header
  12728. }
  12729. // Insert: Inserts a new account user profile.
  12730. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12731. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12732. c.profileId = profileId
  12733. c.accountuserprofile = accountuserprofile
  12734. return c
  12735. }
  12736. // Fields allows partial responses to be retrieved. See
  12737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12738. // for more information.
  12739. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12741. return c
  12742. }
  12743. // Context sets the context to be used in this call's Do method. Any
  12744. // pending HTTP request will be aborted if the provided context is
  12745. // canceled.
  12746. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12747. c.ctx_ = ctx
  12748. return c
  12749. }
  12750. // Header returns an http.Header that can be modified by the caller to
  12751. // add HTTP headers to the request.
  12752. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12753. if c.header_ == nil {
  12754. c.header_ = make(http.Header)
  12755. }
  12756. return c.header_
  12757. }
  12758. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12759. reqHeaders := make(http.Header)
  12760. for k, v := range c.header_ {
  12761. reqHeaders[k] = v
  12762. }
  12763. reqHeaders.Set("User-Agent", c.s.userAgent())
  12764. var body io.Reader = nil
  12765. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12766. if err != nil {
  12767. return nil, err
  12768. }
  12769. reqHeaders.Set("Content-Type", "application/json")
  12770. c.urlParams_.Set("alt", alt)
  12771. c.urlParams_.Set("prettyPrint", "false")
  12772. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12773. urls += "?" + c.urlParams_.Encode()
  12774. req, err := http.NewRequest("POST", urls, body)
  12775. if err != nil {
  12776. return nil, err
  12777. }
  12778. req.Header = reqHeaders
  12779. googleapi.Expand(req.URL, map[string]string{
  12780. "profileId": strconv.FormatInt(c.profileId, 10),
  12781. })
  12782. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12783. }
  12784. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12785. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12786. // non-2xx status code is an error. Response headers are in either
  12787. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12788. // returned at all) in error.(*googleapi.Error).Header. Use
  12789. // googleapi.IsNotModified to check whether the returned error was
  12790. // because http.StatusNotModified was returned.
  12791. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12792. gensupport.SetOptions(c.urlParams_, opts...)
  12793. res, err := c.doRequest("json")
  12794. if res != nil && res.StatusCode == http.StatusNotModified {
  12795. if res.Body != nil {
  12796. res.Body.Close()
  12797. }
  12798. return nil, &googleapi.Error{
  12799. Code: res.StatusCode,
  12800. Header: res.Header,
  12801. }
  12802. }
  12803. if err != nil {
  12804. return nil, err
  12805. }
  12806. defer googleapi.CloseBody(res)
  12807. if err := googleapi.CheckResponse(res); err != nil {
  12808. return nil, err
  12809. }
  12810. ret := &AccountUserProfile{
  12811. ServerResponse: googleapi.ServerResponse{
  12812. Header: res.Header,
  12813. HTTPStatusCode: res.StatusCode,
  12814. },
  12815. }
  12816. target := &ret
  12817. if err := gensupport.DecodeResponse(target, res); err != nil {
  12818. return nil, err
  12819. }
  12820. return ret, nil
  12821. // {
  12822. // "description": "Inserts a new account user profile.",
  12823. // "httpMethod": "POST",
  12824. // "id": "dfareporting.accountUserProfiles.insert",
  12825. // "parameterOrder": [
  12826. // "profileId"
  12827. // ],
  12828. // "parameters": {
  12829. // "profileId": {
  12830. // "description": "User profile ID associated with this request.",
  12831. // "format": "int64",
  12832. // "location": "path",
  12833. // "required": true,
  12834. // "type": "string"
  12835. // }
  12836. // },
  12837. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12838. // "request": {
  12839. // "$ref": "AccountUserProfile"
  12840. // },
  12841. // "response": {
  12842. // "$ref": "AccountUserProfile"
  12843. // },
  12844. // "scopes": [
  12845. // "https://www.googleapis.com/auth/dfatrafficking"
  12846. // ]
  12847. // }
  12848. }
  12849. // method id "dfareporting.accountUserProfiles.list":
  12850. type AccountUserProfilesListCall struct {
  12851. s *Service
  12852. profileId int64
  12853. urlParams_ gensupport.URLParams
  12854. ifNoneMatch_ string
  12855. ctx_ context.Context
  12856. header_ http.Header
  12857. }
  12858. // List: Retrieves a list of account user profiles, possibly filtered.
  12859. // This method supports paging.
  12860. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12861. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12862. c.profileId = profileId
  12863. return c
  12864. }
  12865. // Active sets the optional parameter "active": Select only active user
  12866. // profiles.
  12867. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12868. c.urlParams_.Set("active", fmt.Sprint(active))
  12869. return c
  12870. }
  12871. // Ids sets the optional parameter "ids": Select only user profiles with
  12872. // these IDs.
  12873. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12874. var ids_ []string
  12875. for _, v := range ids {
  12876. ids_ = append(ids_, fmt.Sprint(v))
  12877. }
  12878. c.urlParams_.SetMulti("ids", ids_)
  12879. return c
  12880. }
  12881. // MaxResults sets the optional parameter "maxResults": Maximum number
  12882. // of results to return.
  12883. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12884. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12885. return c
  12886. }
  12887. // PageToken sets the optional parameter "pageToken": Value of the
  12888. // nextPageToken from the previous result page.
  12889. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12890. c.urlParams_.Set("pageToken", pageToken)
  12891. return c
  12892. }
  12893. // SearchString sets the optional parameter "searchString": Allows
  12894. // searching for objects by name, ID or email. Wildcards (*) are
  12895. // allowed. For example, "user profile*2015" will return objects with
  12896. // names like "user profile June 2015", "user profile April 2015", or
  12897. // simply "user profile 2015". Most of the searches also add wildcards
  12898. // implicitly at the start and the end of the search string. For
  12899. // example, a search string of "user profile" will match objects with
  12900. // name "my user profile", "user profile 2015", or simply "user
  12901. // profile".
  12902. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12903. c.urlParams_.Set("searchString", searchString)
  12904. return c
  12905. }
  12906. // SortField sets the optional parameter "sortField": Field by which to
  12907. // sort the list.
  12908. //
  12909. // Possible values:
  12910. // "ID" (default)
  12911. // "NAME"
  12912. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12913. c.urlParams_.Set("sortField", sortField)
  12914. return c
  12915. }
  12916. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12917. // results.
  12918. //
  12919. // Possible values:
  12920. // "ASCENDING" (default)
  12921. // "DESCENDING"
  12922. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12923. c.urlParams_.Set("sortOrder", sortOrder)
  12924. return c
  12925. }
  12926. // SubaccountId sets the optional parameter "subaccountId": Select only
  12927. // user profiles with the specified subaccount ID.
  12928. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12929. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12930. return c
  12931. }
  12932. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12933. // profiles with the specified user role ID.
  12934. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12935. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12936. return c
  12937. }
  12938. // Fields allows partial responses to be retrieved. See
  12939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12940. // for more information.
  12941. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12943. return c
  12944. }
  12945. // IfNoneMatch sets the optional parameter which makes the operation
  12946. // fail if the object's ETag matches the given value. This is useful for
  12947. // getting updates only after the object has changed since the last
  12948. // request. Use googleapi.IsNotModified to check whether the response
  12949. // error from Do is the result of In-None-Match.
  12950. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12951. c.ifNoneMatch_ = entityTag
  12952. return c
  12953. }
  12954. // Context sets the context to be used in this call's Do method. Any
  12955. // pending HTTP request will be aborted if the provided context is
  12956. // canceled.
  12957. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12958. c.ctx_ = ctx
  12959. return c
  12960. }
  12961. // Header returns an http.Header that can be modified by the caller to
  12962. // add HTTP headers to the request.
  12963. func (c *AccountUserProfilesListCall) Header() http.Header {
  12964. if c.header_ == nil {
  12965. c.header_ = make(http.Header)
  12966. }
  12967. return c.header_
  12968. }
  12969. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12970. reqHeaders := make(http.Header)
  12971. for k, v := range c.header_ {
  12972. reqHeaders[k] = v
  12973. }
  12974. reqHeaders.Set("User-Agent", c.s.userAgent())
  12975. if c.ifNoneMatch_ != "" {
  12976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12977. }
  12978. var body io.Reader = nil
  12979. c.urlParams_.Set("alt", alt)
  12980. c.urlParams_.Set("prettyPrint", "false")
  12981. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12982. urls += "?" + c.urlParams_.Encode()
  12983. req, err := http.NewRequest("GET", urls, body)
  12984. if err != nil {
  12985. return nil, err
  12986. }
  12987. req.Header = reqHeaders
  12988. googleapi.Expand(req.URL, map[string]string{
  12989. "profileId": strconv.FormatInt(c.profileId, 10),
  12990. })
  12991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12992. }
  12993. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12994. // Exactly one of *AccountUserProfilesListResponse or error will be
  12995. // non-nil. Any non-2xx status code is an error. Response headers are in
  12996. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12997. // a response was returned at all) in error.(*googleapi.Error).Header.
  12998. // Use googleapi.IsNotModified to check whether the returned error was
  12999. // because http.StatusNotModified was returned.
  13000. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  13001. gensupport.SetOptions(c.urlParams_, opts...)
  13002. res, err := c.doRequest("json")
  13003. if res != nil && res.StatusCode == http.StatusNotModified {
  13004. if res.Body != nil {
  13005. res.Body.Close()
  13006. }
  13007. return nil, &googleapi.Error{
  13008. Code: res.StatusCode,
  13009. Header: res.Header,
  13010. }
  13011. }
  13012. if err != nil {
  13013. return nil, err
  13014. }
  13015. defer googleapi.CloseBody(res)
  13016. if err := googleapi.CheckResponse(res); err != nil {
  13017. return nil, err
  13018. }
  13019. ret := &AccountUserProfilesListResponse{
  13020. ServerResponse: googleapi.ServerResponse{
  13021. Header: res.Header,
  13022. HTTPStatusCode: res.StatusCode,
  13023. },
  13024. }
  13025. target := &ret
  13026. if err := gensupport.DecodeResponse(target, res); err != nil {
  13027. return nil, err
  13028. }
  13029. return ret, nil
  13030. // {
  13031. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  13032. // "httpMethod": "GET",
  13033. // "id": "dfareporting.accountUserProfiles.list",
  13034. // "parameterOrder": [
  13035. // "profileId"
  13036. // ],
  13037. // "parameters": {
  13038. // "active": {
  13039. // "description": "Select only active user profiles.",
  13040. // "location": "query",
  13041. // "type": "boolean"
  13042. // },
  13043. // "ids": {
  13044. // "description": "Select only user profiles with these IDs.",
  13045. // "format": "int64",
  13046. // "location": "query",
  13047. // "repeated": true,
  13048. // "type": "string"
  13049. // },
  13050. // "maxResults": {
  13051. // "default": "1000",
  13052. // "description": "Maximum number of results to return.",
  13053. // "format": "int32",
  13054. // "location": "query",
  13055. // "maximum": "1000",
  13056. // "minimum": "0",
  13057. // "type": "integer"
  13058. // },
  13059. // "pageToken": {
  13060. // "description": "Value of the nextPageToken from the previous result page.",
  13061. // "location": "query",
  13062. // "type": "string"
  13063. // },
  13064. // "profileId": {
  13065. // "description": "User profile ID associated with this request.",
  13066. // "format": "int64",
  13067. // "location": "path",
  13068. // "required": true,
  13069. // "type": "string"
  13070. // },
  13071. // "searchString": {
  13072. // "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\".",
  13073. // "location": "query",
  13074. // "type": "string"
  13075. // },
  13076. // "sortField": {
  13077. // "default": "ID",
  13078. // "description": "Field by which to sort the list.",
  13079. // "enum": [
  13080. // "ID",
  13081. // "NAME"
  13082. // ],
  13083. // "enumDescriptions": [
  13084. // "",
  13085. // ""
  13086. // ],
  13087. // "location": "query",
  13088. // "type": "string"
  13089. // },
  13090. // "sortOrder": {
  13091. // "default": "ASCENDING",
  13092. // "description": "Order of sorted results.",
  13093. // "enum": [
  13094. // "ASCENDING",
  13095. // "DESCENDING"
  13096. // ],
  13097. // "enumDescriptions": [
  13098. // "",
  13099. // ""
  13100. // ],
  13101. // "location": "query",
  13102. // "type": "string"
  13103. // },
  13104. // "subaccountId": {
  13105. // "description": "Select only user profiles with the specified subaccount ID.",
  13106. // "format": "int64",
  13107. // "location": "query",
  13108. // "type": "string"
  13109. // },
  13110. // "userRoleId": {
  13111. // "description": "Select only user profiles with the specified user role ID.",
  13112. // "format": "int64",
  13113. // "location": "query",
  13114. // "type": "string"
  13115. // }
  13116. // },
  13117. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13118. // "response": {
  13119. // "$ref": "AccountUserProfilesListResponse"
  13120. // },
  13121. // "scopes": [
  13122. // "https://www.googleapis.com/auth/dfatrafficking"
  13123. // ]
  13124. // }
  13125. }
  13126. // Pages invokes f for each page of results.
  13127. // A non-nil error returned from f will halt the iteration.
  13128. // The provided context supersedes any context provided to the Context method.
  13129. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  13130. c.ctx_ = ctx
  13131. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13132. for {
  13133. x, err := c.Do()
  13134. if err != nil {
  13135. return err
  13136. }
  13137. if err := f(x); err != nil {
  13138. return err
  13139. }
  13140. if x.NextPageToken == "" {
  13141. return nil
  13142. }
  13143. c.PageToken(x.NextPageToken)
  13144. }
  13145. }
  13146. // method id "dfareporting.accountUserProfiles.patch":
  13147. type AccountUserProfilesPatchCall struct {
  13148. s *Service
  13149. profileId int64
  13150. accountuserprofile *AccountUserProfile
  13151. urlParams_ gensupport.URLParams
  13152. ctx_ context.Context
  13153. header_ http.Header
  13154. }
  13155. // Patch: Updates an existing account user profile. This method supports
  13156. // patch semantics.
  13157. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  13158. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13159. c.profileId = profileId
  13160. c.urlParams_.Set("id", fmt.Sprint(id))
  13161. c.accountuserprofile = accountuserprofile
  13162. return c
  13163. }
  13164. // Fields allows partial responses to be retrieved. See
  13165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13166. // for more information.
  13167. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  13168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13169. return c
  13170. }
  13171. // Context sets the context to be used in this call's Do method. Any
  13172. // pending HTTP request will be aborted if the provided context is
  13173. // canceled.
  13174. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  13175. c.ctx_ = ctx
  13176. return c
  13177. }
  13178. // Header returns an http.Header that can be modified by the caller to
  13179. // add HTTP headers to the request.
  13180. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  13181. if c.header_ == nil {
  13182. c.header_ = make(http.Header)
  13183. }
  13184. return c.header_
  13185. }
  13186. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  13187. reqHeaders := make(http.Header)
  13188. for k, v := range c.header_ {
  13189. reqHeaders[k] = v
  13190. }
  13191. reqHeaders.Set("User-Agent", c.s.userAgent())
  13192. var body io.Reader = nil
  13193. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13194. if err != nil {
  13195. return nil, err
  13196. }
  13197. reqHeaders.Set("Content-Type", "application/json")
  13198. c.urlParams_.Set("alt", alt)
  13199. c.urlParams_.Set("prettyPrint", "false")
  13200. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13201. urls += "?" + c.urlParams_.Encode()
  13202. req, err := http.NewRequest("PATCH", urls, body)
  13203. if err != nil {
  13204. return nil, err
  13205. }
  13206. req.Header = reqHeaders
  13207. googleapi.Expand(req.URL, map[string]string{
  13208. "profileId": strconv.FormatInt(c.profileId, 10),
  13209. })
  13210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13211. }
  13212. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  13213. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13214. // non-2xx status code is an error. Response headers are in either
  13215. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13216. // returned at all) in error.(*googleapi.Error).Header. Use
  13217. // googleapi.IsNotModified to check whether the returned error was
  13218. // because http.StatusNotModified was returned.
  13219. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13220. gensupport.SetOptions(c.urlParams_, opts...)
  13221. res, err := c.doRequest("json")
  13222. if res != nil && res.StatusCode == http.StatusNotModified {
  13223. if res.Body != nil {
  13224. res.Body.Close()
  13225. }
  13226. return nil, &googleapi.Error{
  13227. Code: res.StatusCode,
  13228. Header: res.Header,
  13229. }
  13230. }
  13231. if err != nil {
  13232. return nil, err
  13233. }
  13234. defer googleapi.CloseBody(res)
  13235. if err := googleapi.CheckResponse(res); err != nil {
  13236. return nil, err
  13237. }
  13238. ret := &AccountUserProfile{
  13239. ServerResponse: googleapi.ServerResponse{
  13240. Header: res.Header,
  13241. HTTPStatusCode: res.StatusCode,
  13242. },
  13243. }
  13244. target := &ret
  13245. if err := gensupport.DecodeResponse(target, res); err != nil {
  13246. return nil, err
  13247. }
  13248. return ret, nil
  13249. // {
  13250. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  13251. // "httpMethod": "PATCH",
  13252. // "id": "dfareporting.accountUserProfiles.patch",
  13253. // "parameterOrder": [
  13254. // "profileId",
  13255. // "id"
  13256. // ],
  13257. // "parameters": {
  13258. // "id": {
  13259. // "description": "User profile ID.",
  13260. // "format": "int64",
  13261. // "location": "query",
  13262. // "required": true,
  13263. // "type": "string"
  13264. // },
  13265. // "profileId": {
  13266. // "description": "User profile ID associated with this request.",
  13267. // "format": "int64",
  13268. // "location": "path",
  13269. // "required": true,
  13270. // "type": "string"
  13271. // }
  13272. // },
  13273. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13274. // "request": {
  13275. // "$ref": "AccountUserProfile"
  13276. // },
  13277. // "response": {
  13278. // "$ref": "AccountUserProfile"
  13279. // },
  13280. // "scopes": [
  13281. // "https://www.googleapis.com/auth/dfatrafficking"
  13282. // ]
  13283. // }
  13284. }
  13285. // method id "dfareporting.accountUserProfiles.update":
  13286. type AccountUserProfilesUpdateCall struct {
  13287. s *Service
  13288. profileId int64
  13289. accountuserprofile *AccountUserProfile
  13290. urlParams_ gensupport.URLParams
  13291. ctx_ context.Context
  13292. header_ http.Header
  13293. }
  13294. // Update: Updates an existing account user profile.
  13295. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  13296. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13297. c.profileId = profileId
  13298. c.accountuserprofile = accountuserprofile
  13299. return c
  13300. }
  13301. // Fields allows partial responses to be retrieved. See
  13302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13303. // for more information.
  13304. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  13305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13306. return c
  13307. }
  13308. // Context sets the context to be used in this call's Do method. Any
  13309. // pending HTTP request will be aborted if the provided context is
  13310. // canceled.
  13311. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  13312. c.ctx_ = ctx
  13313. return c
  13314. }
  13315. // Header returns an http.Header that can be modified by the caller to
  13316. // add HTTP headers to the request.
  13317. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  13318. if c.header_ == nil {
  13319. c.header_ = make(http.Header)
  13320. }
  13321. return c.header_
  13322. }
  13323. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13324. reqHeaders := make(http.Header)
  13325. for k, v := range c.header_ {
  13326. reqHeaders[k] = v
  13327. }
  13328. reqHeaders.Set("User-Agent", c.s.userAgent())
  13329. var body io.Reader = nil
  13330. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13331. if err != nil {
  13332. return nil, err
  13333. }
  13334. reqHeaders.Set("Content-Type", "application/json")
  13335. c.urlParams_.Set("alt", alt)
  13336. c.urlParams_.Set("prettyPrint", "false")
  13337. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13338. urls += "?" + c.urlParams_.Encode()
  13339. req, err := http.NewRequest("PUT", urls, body)
  13340. if err != nil {
  13341. return nil, err
  13342. }
  13343. req.Header = reqHeaders
  13344. googleapi.Expand(req.URL, map[string]string{
  13345. "profileId": strconv.FormatInt(c.profileId, 10),
  13346. })
  13347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13348. }
  13349. // Do executes the "dfareporting.accountUserProfiles.update" call.
  13350. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13351. // non-2xx status code is an error. Response headers are in either
  13352. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13353. // returned at all) in error.(*googleapi.Error).Header. Use
  13354. // googleapi.IsNotModified to check whether the returned error was
  13355. // because http.StatusNotModified was returned.
  13356. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13357. gensupport.SetOptions(c.urlParams_, opts...)
  13358. res, err := c.doRequest("json")
  13359. if res != nil && res.StatusCode == http.StatusNotModified {
  13360. if res.Body != nil {
  13361. res.Body.Close()
  13362. }
  13363. return nil, &googleapi.Error{
  13364. Code: res.StatusCode,
  13365. Header: res.Header,
  13366. }
  13367. }
  13368. if err != nil {
  13369. return nil, err
  13370. }
  13371. defer googleapi.CloseBody(res)
  13372. if err := googleapi.CheckResponse(res); err != nil {
  13373. return nil, err
  13374. }
  13375. ret := &AccountUserProfile{
  13376. ServerResponse: googleapi.ServerResponse{
  13377. Header: res.Header,
  13378. HTTPStatusCode: res.StatusCode,
  13379. },
  13380. }
  13381. target := &ret
  13382. if err := gensupport.DecodeResponse(target, res); err != nil {
  13383. return nil, err
  13384. }
  13385. return ret, nil
  13386. // {
  13387. // "description": "Updates an existing account user profile.",
  13388. // "httpMethod": "PUT",
  13389. // "id": "dfareporting.accountUserProfiles.update",
  13390. // "parameterOrder": [
  13391. // "profileId"
  13392. // ],
  13393. // "parameters": {
  13394. // "profileId": {
  13395. // "description": "User profile ID associated with this request.",
  13396. // "format": "int64",
  13397. // "location": "path",
  13398. // "required": true,
  13399. // "type": "string"
  13400. // }
  13401. // },
  13402. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13403. // "request": {
  13404. // "$ref": "AccountUserProfile"
  13405. // },
  13406. // "response": {
  13407. // "$ref": "AccountUserProfile"
  13408. // },
  13409. // "scopes": [
  13410. // "https://www.googleapis.com/auth/dfatrafficking"
  13411. // ]
  13412. // }
  13413. }
  13414. // method id "dfareporting.accounts.get":
  13415. type AccountsGetCall struct {
  13416. s *Service
  13417. profileId int64
  13418. id int64
  13419. urlParams_ gensupport.URLParams
  13420. ifNoneMatch_ string
  13421. ctx_ context.Context
  13422. header_ http.Header
  13423. }
  13424. // Get: Gets one account by ID.
  13425. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  13426. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13427. c.profileId = profileId
  13428. c.id = id
  13429. return c
  13430. }
  13431. // Fields allows partial responses to be retrieved. See
  13432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13433. // for more information.
  13434. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  13435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13436. return c
  13437. }
  13438. // IfNoneMatch sets the optional parameter which makes the operation
  13439. // fail if the object's ETag matches the given value. This is useful for
  13440. // getting updates only after the object has changed since the last
  13441. // request. Use googleapi.IsNotModified to check whether the response
  13442. // error from Do is the result of In-None-Match.
  13443. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  13444. c.ifNoneMatch_ = entityTag
  13445. return c
  13446. }
  13447. // Context sets the context to be used in this call's Do method. Any
  13448. // pending HTTP request will be aborted if the provided context is
  13449. // canceled.
  13450. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  13451. c.ctx_ = ctx
  13452. return c
  13453. }
  13454. // Header returns an http.Header that can be modified by the caller to
  13455. // add HTTP headers to the request.
  13456. func (c *AccountsGetCall) Header() http.Header {
  13457. if c.header_ == nil {
  13458. c.header_ = make(http.Header)
  13459. }
  13460. return c.header_
  13461. }
  13462. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  13463. reqHeaders := make(http.Header)
  13464. for k, v := range c.header_ {
  13465. reqHeaders[k] = v
  13466. }
  13467. reqHeaders.Set("User-Agent", c.s.userAgent())
  13468. if c.ifNoneMatch_ != "" {
  13469. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13470. }
  13471. var body io.Reader = nil
  13472. c.urlParams_.Set("alt", alt)
  13473. c.urlParams_.Set("prettyPrint", "false")
  13474. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13475. urls += "?" + c.urlParams_.Encode()
  13476. req, err := http.NewRequest("GET", urls, body)
  13477. if err != nil {
  13478. return nil, err
  13479. }
  13480. req.Header = reqHeaders
  13481. googleapi.Expand(req.URL, map[string]string{
  13482. "profileId": strconv.FormatInt(c.profileId, 10),
  13483. "id": strconv.FormatInt(c.id, 10),
  13484. })
  13485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13486. }
  13487. // Do executes the "dfareporting.accounts.get" call.
  13488. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13489. // code is an error. Response headers are in either
  13490. // *Account.ServerResponse.Header or (if a response was returned at all)
  13491. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13492. // check whether the returned error was because http.StatusNotModified
  13493. // was returned.
  13494. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13495. gensupport.SetOptions(c.urlParams_, opts...)
  13496. res, err := c.doRequest("json")
  13497. if res != nil && res.StatusCode == http.StatusNotModified {
  13498. if res.Body != nil {
  13499. res.Body.Close()
  13500. }
  13501. return nil, &googleapi.Error{
  13502. Code: res.StatusCode,
  13503. Header: res.Header,
  13504. }
  13505. }
  13506. if err != nil {
  13507. return nil, err
  13508. }
  13509. defer googleapi.CloseBody(res)
  13510. if err := googleapi.CheckResponse(res); err != nil {
  13511. return nil, err
  13512. }
  13513. ret := &Account{
  13514. ServerResponse: googleapi.ServerResponse{
  13515. Header: res.Header,
  13516. HTTPStatusCode: res.StatusCode,
  13517. },
  13518. }
  13519. target := &ret
  13520. if err := gensupport.DecodeResponse(target, res); err != nil {
  13521. return nil, err
  13522. }
  13523. return ret, nil
  13524. // {
  13525. // "description": "Gets one account by ID.",
  13526. // "httpMethod": "GET",
  13527. // "id": "dfareporting.accounts.get",
  13528. // "parameterOrder": [
  13529. // "profileId",
  13530. // "id"
  13531. // ],
  13532. // "parameters": {
  13533. // "id": {
  13534. // "description": "Account ID.",
  13535. // "format": "int64",
  13536. // "location": "path",
  13537. // "required": true,
  13538. // "type": "string"
  13539. // },
  13540. // "profileId": {
  13541. // "description": "User profile ID associated with this request.",
  13542. // "format": "int64",
  13543. // "location": "path",
  13544. // "required": true,
  13545. // "type": "string"
  13546. // }
  13547. // },
  13548. // "path": "userprofiles/{profileId}/accounts/{id}",
  13549. // "response": {
  13550. // "$ref": "Account"
  13551. // },
  13552. // "scopes": [
  13553. // "https://www.googleapis.com/auth/dfatrafficking"
  13554. // ]
  13555. // }
  13556. }
  13557. // method id "dfareporting.accounts.list":
  13558. type AccountsListCall struct {
  13559. s *Service
  13560. profileId int64
  13561. urlParams_ gensupport.URLParams
  13562. ifNoneMatch_ string
  13563. ctx_ context.Context
  13564. header_ http.Header
  13565. }
  13566. // List: Retrieves the list of accounts, possibly filtered. This method
  13567. // supports paging.
  13568. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13569. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13570. c.profileId = profileId
  13571. return c
  13572. }
  13573. // Active sets the optional parameter "active": Select only active
  13574. // accounts. Don't set this field to select both active and non-active
  13575. // accounts.
  13576. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13577. c.urlParams_.Set("active", fmt.Sprint(active))
  13578. return c
  13579. }
  13580. // Ids sets the optional parameter "ids": Select only accounts with
  13581. // these IDs.
  13582. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13583. var ids_ []string
  13584. for _, v := range ids {
  13585. ids_ = append(ids_, fmt.Sprint(v))
  13586. }
  13587. c.urlParams_.SetMulti("ids", ids_)
  13588. return c
  13589. }
  13590. // MaxResults sets the optional parameter "maxResults": Maximum number
  13591. // of results to return.
  13592. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13593. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13594. return c
  13595. }
  13596. // PageToken sets the optional parameter "pageToken": Value of the
  13597. // nextPageToken from the previous result page.
  13598. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13599. c.urlParams_.Set("pageToken", pageToken)
  13600. return c
  13601. }
  13602. // SearchString sets the optional parameter "searchString": Allows
  13603. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13604. // example, "account*2015" will return objects with names like "account
  13605. // June 2015", "account April 2015", or simply "account 2015". Most of
  13606. // the searches also add wildcards implicitly at the start and the end
  13607. // of the search string. For example, a search string of "account" will
  13608. // match objects with name "my account", "account 2015", or simply
  13609. // "account".
  13610. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13611. c.urlParams_.Set("searchString", searchString)
  13612. return c
  13613. }
  13614. // SortField sets the optional parameter "sortField": Field by which to
  13615. // sort the list.
  13616. //
  13617. // Possible values:
  13618. // "ID" (default)
  13619. // "NAME"
  13620. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13621. c.urlParams_.Set("sortField", sortField)
  13622. return c
  13623. }
  13624. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13625. // results.
  13626. //
  13627. // Possible values:
  13628. // "ASCENDING" (default)
  13629. // "DESCENDING"
  13630. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13631. c.urlParams_.Set("sortOrder", sortOrder)
  13632. return c
  13633. }
  13634. // Fields allows partial responses to be retrieved. See
  13635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13636. // for more information.
  13637. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13639. return c
  13640. }
  13641. // IfNoneMatch sets the optional parameter which makes the operation
  13642. // fail if the object's ETag matches the given value. This is useful for
  13643. // getting updates only after the object has changed since the last
  13644. // request. Use googleapi.IsNotModified to check whether the response
  13645. // error from Do is the result of In-None-Match.
  13646. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13647. c.ifNoneMatch_ = entityTag
  13648. return c
  13649. }
  13650. // Context sets the context to be used in this call's Do method. Any
  13651. // pending HTTP request will be aborted if the provided context is
  13652. // canceled.
  13653. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13654. c.ctx_ = ctx
  13655. return c
  13656. }
  13657. // Header returns an http.Header that can be modified by the caller to
  13658. // add HTTP headers to the request.
  13659. func (c *AccountsListCall) Header() http.Header {
  13660. if c.header_ == nil {
  13661. c.header_ = make(http.Header)
  13662. }
  13663. return c.header_
  13664. }
  13665. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13666. reqHeaders := make(http.Header)
  13667. for k, v := range c.header_ {
  13668. reqHeaders[k] = v
  13669. }
  13670. reqHeaders.Set("User-Agent", c.s.userAgent())
  13671. if c.ifNoneMatch_ != "" {
  13672. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13673. }
  13674. var body io.Reader = nil
  13675. c.urlParams_.Set("alt", alt)
  13676. c.urlParams_.Set("prettyPrint", "false")
  13677. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13678. urls += "?" + c.urlParams_.Encode()
  13679. req, err := http.NewRequest("GET", urls, body)
  13680. if err != nil {
  13681. return nil, err
  13682. }
  13683. req.Header = reqHeaders
  13684. googleapi.Expand(req.URL, map[string]string{
  13685. "profileId": strconv.FormatInt(c.profileId, 10),
  13686. })
  13687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13688. }
  13689. // Do executes the "dfareporting.accounts.list" call.
  13690. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13691. // non-2xx status code is an error. Response headers are in either
  13692. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13693. // returned at all) in error.(*googleapi.Error).Header. Use
  13694. // googleapi.IsNotModified to check whether the returned error was
  13695. // because http.StatusNotModified was returned.
  13696. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13697. gensupport.SetOptions(c.urlParams_, opts...)
  13698. res, err := c.doRequest("json")
  13699. if res != nil && res.StatusCode == http.StatusNotModified {
  13700. if res.Body != nil {
  13701. res.Body.Close()
  13702. }
  13703. return nil, &googleapi.Error{
  13704. Code: res.StatusCode,
  13705. Header: res.Header,
  13706. }
  13707. }
  13708. if err != nil {
  13709. return nil, err
  13710. }
  13711. defer googleapi.CloseBody(res)
  13712. if err := googleapi.CheckResponse(res); err != nil {
  13713. return nil, err
  13714. }
  13715. ret := &AccountsListResponse{
  13716. ServerResponse: googleapi.ServerResponse{
  13717. Header: res.Header,
  13718. HTTPStatusCode: res.StatusCode,
  13719. },
  13720. }
  13721. target := &ret
  13722. if err := gensupport.DecodeResponse(target, res); err != nil {
  13723. return nil, err
  13724. }
  13725. return ret, nil
  13726. // {
  13727. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13728. // "httpMethod": "GET",
  13729. // "id": "dfareporting.accounts.list",
  13730. // "parameterOrder": [
  13731. // "profileId"
  13732. // ],
  13733. // "parameters": {
  13734. // "active": {
  13735. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13736. // "location": "query",
  13737. // "type": "boolean"
  13738. // },
  13739. // "ids": {
  13740. // "description": "Select only accounts with these IDs.",
  13741. // "format": "int64",
  13742. // "location": "query",
  13743. // "repeated": true,
  13744. // "type": "string"
  13745. // },
  13746. // "maxResults": {
  13747. // "default": "1000",
  13748. // "description": "Maximum number of results to return.",
  13749. // "format": "int32",
  13750. // "location": "query",
  13751. // "maximum": "1000",
  13752. // "minimum": "0",
  13753. // "type": "integer"
  13754. // },
  13755. // "pageToken": {
  13756. // "description": "Value of the nextPageToken from the previous result page.",
  13757. // "location": "query",
  13758. // "type": "string"
  13759. // },
  13760. // "profileId": {
  13761. // "description": "User profile ID associated with this request.",
  13762. // "format": "int64",
  13763. // "location": "path",
  13764. // "required": true,
  13765. // "type": "string"
  13766. // },
  13767. // "searchString": {
  13768. // "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\".",
  13769. // "location": "query",
  13770. // "type": "string"
  13771. // },
  13772. // "sortField": {
  13773. // "default": "ID",
  13774. // "description": "Field by which to sort the list.",
  13775. // "enum": [
  13776. // "ID",
  13777. // "NAME"
  13778. // ],
  13779. // "enumDescriptions": [
  13780. // "",
  13781. // ""
  13782. // ],
  13783. // "location": "query",
  13784. // "type": "string"
  13785. // },
  13786. // "sortOrder": {
  13787. // "default": "ASCENDING",
  13788. // "description": "Order of sorted results.",
  13789. // "enum": [
  13790. // "ASCENDING",
  13791. // "DESCENDING"
  13792. // ],
  13793. // "enumDescriptions": [
  13794. // "",
  13795. // ""
  13796. // ],
  13797. // "location": "query",
  13798. // "type": "string"
  13799. // }
  13800. // },
  13801. // "path": "userprofiles/{profileId}/accounts",
  13802. // "response": {
  13803. // "$ref": "AccountsListResponse"
  13804. // },
  13805. // "scopes": [
  13806. // "https://www.googleapis.com/auth/dfatrafficking"
  13807. // ]
  13808. // }
  13809. }
  13810. // Pages invokes f for each page of results.
  13811. // A non-nil error returned from f will halt the iteration.
  13812. // The provided context supersedes any context provided to the Context method.
  13813. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13814. c.ctx_ = ctx
  13815. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13816. for {
  13817. x, err := c.Do()
  13818. if err != nil {
  13819. return err
  13820. }
  13821. if err := f(x); err != nil {
  13822. return err
  13823. }
  13824. if x.NextPageToken == "" {
  13825. return nil
  13826. }
  13827. c.PageToken(x.NextPageToken)
  13828. }
  13829. }
  13830. // method id "dfareporting.accounts.patch":
  13831. type AccountsPatchCall struct {
  13832. s *Service
  13833. profileId int64
  13834. account *Account
  13835. urlParams_ gensupport.URLParams
  13836. ctx_ context.Context
  13837. header_ http.Header
  13838. }
  13839. // Patch: Updates an existing account. This method supports patch
  13840. // semantics.
  13841. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13842. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13843. c.profileId = profileId
  13844. c.urlParams_.Set("id", fmt.Sprint(id))
  13845. c.account = account
  13846. return c
  13847. }
  13848. // Fields allows partial responses to be retrieved. See
  13849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13850. // for more information.
  13851. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13853. return c
  13854. }
  13855. // Context sets the context to be used in this call's Do method. Any
  13856. // pending HTTP request will be aborted if the provided context is
  13857. // canceled.
  13858. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13859. c.ctx_ = ctx
  13860. return c
  13861. }
  13862. // Header returns an http.Header that can be modified by the caller to
  13863. // add HTTP headers to the request.
  13864. func (c *AccountsPatchCall) Header() http.Header {
  13865. if c.header_ == nil {
  13866. c.header_ = make(http.Header)
  13867. }
  13868. return c.header_
  13869. }
  13870. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13871. reqHeaders := make(http.Header)
  13872. for k, v := range c.header_ {
  13873. reqHeaders[k] = v
  13874. }
  13875. reqHeaders.Set("User-Agent", c.s.userAgent())
  13876. var body io.Reader = nil
  13877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13878. if err != nil {
  13879. return nil, err
  13880. }
  13881. reqHeaders.Set("Content-Type", "application/json")
  13882. c.urlParams_.Set("alt", alt)
  13883. c.urlParams_.Set("prettyPrint", "false")
  13884. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13885. urls += "?" + c.urlParams_.Encode()
  13886. req, err := http.NewRequest("PATCH", urls, body)
  13887. if err != nil {
  13888. return nil, err
  13889. }
  13890. req.Header = reqHeaders
  13891. googleapi.Expand(req.URL, map[string]string{
  13892. "profileId": strconv.FormatInt(c.profileId, 10),
  13893. })
  13894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13895. }
  13896. // Do executes the "dfareporting.accounts.patch" call.
  13897. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13898. // code is an error. Response headers are in either
  13899. // *Account.ServerResponse.Header or (if a response was returned at all)
  13900. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13901. // check whether the returned error was because http.StatusNotModified
  13902. // was returned.
  13903. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13904. gensupport.SetOptions(c.urlParams_, opts...)
  13905. res, err := c.doRequest("json")
  13906. if res != nil && res.StatusCode == http.StatusNotModified {
  13907. if res.Body != nil {
  13908. res.Body.Close()
  13909. }
  13910. return nil, &googleapi.Error{
  13911. Code: res.StatusCode,
  13912. Header: res.Header,
  13913. }
  13914. }
  13915. if err != nil {
  13916. return nil, err
  13917. }
  13918. defer googleapi.CloseBody(res)
  13919. if err := googleapi.CheckResponse(res); err != nil {
  13920. return nil, err
  13921. }
  13922. ret := &Account{
  13923. ServerResponse: googleapi.ServerResponse{
  13924. Header: res.Header,
  13925. HTTPStatusCode: res.StatusCode,
  13926. },
  13927. }
  13928. target := &ret
  13929. if err := gensupport.DecodeResponse(target, res); err != nil {
  13930. return nil, err
  13931. }
  13932. return ret, nil
  13933. // {
  13934. // "description": "Updates an existing account. This method supports patch semantics.",
  13935. // "httpMethod": "PATCH",
  13936. // "id": "dfareporting.accounts.patch",
  13937. // "parameterOrder": [
  13938. // "profileId",
  13939. // "id"
  13940. // ],
  13941. // "parameters": {
  13942. // "id": {
  13943. // "description": "Account ID.",
  13944. // "format": "int64",
  13945. // "location": "query",
  13946. // "required": true,
  13947. // "type": "string"
  13948. // },
  13949. // "profileId": {
  13950. // "description": "User profile ID associated with this request.",
  13951. // "format": "int64",
  13952. // "location": "path",
  13953. // "required": true,
  13954. // "type": "string"
  13955. // }
  13956. // },
  13957. // "path": "userprofiles/{profileId}/accounts",
  13958. // "request": {
  13959. // "$ref": "Account"
  13960. // },
  13961. // "response": {
  13962. // "$ref": "Account"
  13963. // },
  13964. // "scopes": [
  13965. // "https://www.googleapis.com/auth/dfatrafficking"
  13966. // ]
  13967. // }
  13968. }
  13969. // method id "dfareporting.accounts.update":
  13970. type AccountsUpdateCall struct {
  13971. s *Service
  13972. profileId int64
  13973. account *Account
  13974. urlParams_ gensupport.URLParams
  13975. ctx_ context.Context
  13976. header_ http.Header
  13977. }
  13978. // Update: Updates an existing account.
  13979. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13980. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13981. c.profileId = profileId
  13982. c.account = account
  13983. return c
  13984. }
  13985. // Fields allows partial responses to be retrieved. See
  13986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13987. // for more information.
  13988. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13990. return c
  13991. }
  13992. // Context sets the context to be used in this call's Do method. Any
  13993. // pending HTTP request will be aborted if the provided context is
  13994. // canceled.
  13995. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13996. c.ctx_ = ctx
  13997. return c
  13998. }
  13999. // Header returns an http.Header that can be modified by the caller to
  14000. // add HTTP headers to the request.
  14001. func (c *AccountsUpdateCall) Header() http.Header {
  14002. if c.header_ == nil {
  14003. c.header_ = make(http.Header)
  14004. }
  14005. return c.header_
  14006. }
  14007. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14008. reqHeaders := make(http.Header)
  14009. for k, v := range c.header_ {
  14010. reqHeaders[k] = v
  14011. }
  14012. reqHeaders.Set("User-Agent", c.s.userAgent())
  14013. var body io.Reader = nil
  14014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  14015. if err != nil {
  14016. return nil, err
  14017. }
  14018. reqHeaders.Set("Content-Type", "application/json")
  14019. c.urlParams_.Set("alt", alt)
  14020. c.urlParams_.Set("prettyPrint", "false")
  14021. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  14022. urls += "?" + c.urlParams_.Encode()
  14023. req, err := http.NewRequest("PUT", urls, body)
  14024. if err != nil {
  14025. return nil, err
  14026. }
  14027. req.Header = reqHeaders
  14028. googleapi.Expand(req.URL, map[string]string{
  14029. "profileId": strconv.FormatInt(c.profileId, 10),
  14030. })
  14031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14032. }
  14033. // Do executes the "dfareporting.accounts.update" call.
  14034. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  14035. // code is an error. Response headers are in either
  14036. // *Account.ServerResponse.Header or (if a response was returned at all)
  14037. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14038. // check whether the returned error was because http.StatusNotModified
  14039. // was returned.
  14040. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  14041. gensupport.SetOptions(c.urlParams_, opts...)
  14042. res, err := c.doRequest("json")
  14043. if res != nil && res.StatusCode == http.StatusNotModified {
  14044. if res.Body != nil {
  14045. res.Body.Close()
  14046. }
  14047. return nil, &googleapi.Error{
  14048. Code: res.StatusCode,
  14049. Header: res.Header,
  14050. }
  14051. }
  14052. if err != nil {
  14053. return nil, err
  14054. }
  14055. defer googleapi.CloseBody(res)
  14056. if err := googleapi.CheckResponse(res); err != nil {
  14057. return nil, err
  14058. }
  14059. ret := &Account{
  14060. ServerResponse: googleapi.ServerResponse{
  14061. Header: res.Header,
  14062. HTTPStatusCode: res.StatusCode,
  14063. },
  14064. }
  14065. target := &ret
  14066. if err := gensupport.DecodeResponse(target, res); err != nil {
  14067. return nil, err
  14068. }
  14069. return ret, nil
  14070. // {
  14071. // "description": "Updates an existing account.",
  14072. // "httpMethod": "PUT",
  14073. // "id": "dfareporting.accounts.update",
  14074. // "parameterOrder": [
  14075. // "profileId"
  14076. // ],
  14077. // "parameters": {
  14078. // "profileId": {
  14079. // "description": "User profile ID associated with this request.",
  14080. // "format": "int64",
  14081. // "location": "path",
  14082. // "required": true,
  14083. // "type": "string"
  14084. // }
  14085. // },
  14086. // "path": "userprofiles/{profileId}/accounts",
  14087. // "request": {
  14088. // "$ref": "Account"
  14089. // },
  14090. // "response": {
  14091. // "$ref": "Account"
  14092. // },
  14093. // "scopes": [
  14094. // "https://www.googleapis.com/auth/dfatrafficking"
  14095. // ]
  14096. // }
  14097. }
  14098. // method id "dfareporting.ads.get":
  14099. type AdsGetCall struct {
  14100. s *Service
  14101. profileId int64
  14102. id int64
  14103. urlParams_ gensupport.URLParams
  14104. ifNoneMatch_ string
  14105. ctx_ context.Context
  14106. header_ http.Header
  14107. }
  14108. // Get: Gets one ad by ID.
  14109. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  14110. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14111. c.profileId = profileId
  14112. c.id = id
  14113. return c
  14114. }
  14115. // Fields allows partial responses to be retrieved. See
  14116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14117. // for more information.
  14118. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  14119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14120. return c
  14121. }
  14122. // IfNoneMatch sets the optional parameter which makes the operation
  14123. // fail if the object's ETag matches the given value. This is useful for
  14124. // getting updates only after the object has changed since the last
  14125. // request. Use googleapi.IsNotModified to check whether the response
  14126. // error from Do is the result of In-None-Match.
  14127. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  14128. c.ifNoneMatch_ = entityTag
  14129. return c
  14130. }
  14131. // Context sets the context to be used in this call's Do method. Any
  14132. // pending HTTP request will be aborted if the provided context is
  14133. // canceled.
  14134. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  14135. c.ctx_ = ctx
  14136. return c
  14137. }
  14138. // Header returns an http.Header that can be modified by the caller to
  14139. // add HTTP headers to the request.
  14140. func (c *AdsGetCall) Header() http.Header {
  14141. if c.header_ == nil {
  14142. c.header_ = make(http.Header)
  14143. }
  14144. return c.header_
  14145. }
  14146. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  14147. reqHeaders := make(http.Header)
  14148. for k, v := range c.header_ {
  14149. reqHeaders[k] = v
  14150. }
  14151. reqHeaders.Set("User-Agent", c.s.userAgent())
  14152. if c.ifNoneMatch_ != "" {
  14153. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14154. }
  14155. var body io.Reader = nil
  14156. c.urlParams_.Set("alt", alt)
  14157. c.urlParams_.Set("prettyPrint", "false")
  14158. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  14159. urls += "?" + c.urlParams_.Encode()
  14160. req, err := http.NewRequest("GET", urls, body)
  14161. if err != nil {
  14162. return nil, err
  14163. }
  14164. req.Header = reqHeaders
  14165. googleapi.Expand(req.URL, map[string]string{
  14166. "profileId": strconv.FormatInt(c.profileId, 10),
  14167. "id": strconv.FormatInt(c.id, 10),
  14168. })
  14169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14170. }
  14171. // Do executes the "dfareporting.ads.get" call.
  14172. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14173. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14174. // or (if a response was returned at all) in
  14175. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14176. // whether the returned error was because http.StatusNotModified was
  14177. // returned.
  14178. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14179. gensupport.SetOptions(c.urlParams_, opts...)
  14180. res, err := c.doRequest("json")
  14181. if res != nil && res.StatusCode == http.StatusNotModified {
  14182. if res.Body != nil {
  14183. res.Body.Close()
  14184. }
  14185. return nil, &googleapi.Error{
  14186. Code: res.StatusCode,
  14187. Header: res.Header,
  14188. }
  14189. }
  14190. if err != nil {
  14191. return nil, err
  14192. }
  14193. defer googleapi.CloseBody(res)
  14194. if err := googleapi.CheckResponse(res); err != nil {
  14195. return nil, err
  14196. }
  14197. ret := &Ad{
  14198. ServerResponse: googleapi.ServerResponse{
  14199. Header: res.Header,
  14200. HTTPStatusCode: res.StatusCode,
  14201. },
  14202. }
  14203. target := &ret
  14204. if err := gensupport.DecodeResponse(target, res); err != nil {
  14205. return nil, err
  14206. }
  14207. return ret, nil
  14208. // {
  14209. // "description": "Gets one ad by ID.",
  14210. // "httpMethod": "GET",
  14211. // "id": "dfareporting.ads.get",
  14212. // "parameterOrder": [
  14213. // "profileId",
  14214. // "id"
  14215. // ],
  14216. // "parameters": {
  14217. // "id": {
  14218. // "description": "Ad ID.",
  14219. // "format": "int64",
  14220. // "location": "path",
  14221. // "required": true,
  14222. // "type": "string"
  14223. // },
  14224. // "profileId": {
  14225. // "description": "User profile ID associated with this request.",
  14226. // "format": "int64",
  14227. // "location": "path",
  14228. // "required": true,
  14229. // "type": "string"
  14230. // }
  14231. // },
  14232. // "path": "userprofiles/{profileId}/ads/{id}",
  14233. // "response": {
  14234. // "$ref": "Ad"
  14235. // },
  14236. // "scopes": [
  14237. // "https://www.googleapis.com/auth/dfatrafficking"
  14238. // ]
  14239. // }
  14240. }
  14241. // method id "dfareporting.ads.insert":
  14242. type AdsInsertCall struct {
  14243. s *Service
  14244. profileId int64
  14245. ad *Ad
  14246. urlParams_ gensupport.URLParams
  14247. ctx_ context.Context
  14248. header_ http.Header
  14249. }
  14250. // Insert: Inserts a new ad.
  14251. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  14252. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14253. c.profileId = profileId
  14254. c.ad = ad
  14255. return c
  14256. }
  14257. // Fields allows partial responses to be retrieved. See
  14258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14259. // for more information.
  14260. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  14261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14262. return c
  14263. }
  14264. // Context sets the context to be used in this call's Do method. Any
  14265. // pending HTTP request will be aborted if the provided context is
  14266. // canceled.
  14267. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  14268. c.ctx_ = ctx
  14269. return c
  14270. }
  14271. // Header returns an http.Header that can be modified by the caller to
  14272. // add HTTP headers to the request.
  14273. func (c *AdsInsertCall) Header() http.Header {
  14274. if c.header_ == nil {
  14275. c.header_ = make(http.Header)
  14276. }
  14277. return c.header_
  14278. }
  14279. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  14280. reqHeaders := make(http.Header)
  14281. for k, v := range c.header_ {
  14282. reqHeaders[k] = v
  14283. }
  14284. reqHeaders.Set("User-Agent", c.s.userAgent())
  14285. var body io.Reader = nil
  14286. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14287. if err != nil {
  14288. return nil, err
  14289. }
  14290. reqHeaders.Set("Content-Type", "application/json")
  14291. c.urlParams_.Set("alt", alt)
  14292. c.urlParams_.Set("prettyPrint", "false")
  14293. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14294. urls += "?" + c.urlParams_.Encode()
  14295. req, err := http.NewRequest("POST", urls, body)
  14296. if err != nil {
  14297. return nil, err
  14298. }
  14299. req.Header = reqHeaders
  14300. googleapi.Expand(req.URL, map[string]string{
  14301. "profileId": strconv.FormatInt(c.profileId, 10),
  14302. })
  14303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14304. }
  14305. // Do executes the "dfareporting.ads.insert" call.
  14306. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14307. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14308. // or (if a response was returned at all) in
  14309. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14310. // whether the returned error was because http.StatusNotModified was
  14311. // returned.
  14312. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14313. gensupport.SetOptions(c.urlParams_, opts...)
  14314. res, err := c.doRequest("json")
  14315. if res != nil && res.StatusCode == http.StatusNotModified {
  14316. if res.Body != nil {
  14317. res.Body.Close()
  14318. }
  14319. return nil, &googleapi.Error{
  14320. Code: res.StatusCode,
  14321. Header: res.Header,
  14322. }
  14323. }
  14324. if err != nil {
  14325. return nil, err
  14326. }
  14327. defer googleapi.CloseBody(res)
  14328. if err := googleapi.CheckResponse(res); err != nil {
  14329. return nil, err
  14330. }
  14331. ret := &Ad{
  14332. ServerResponse: googleapi.ServerResponse{
  14333. Header: res.Header,
  14334. HTTPStatusCode: res.StatusCode,
  14335. },
  14336. }
  14337. target := &ret
  14338. if err := gensupport.DecodeResponse(target, res); err != nil {
  14339. return nil, err
  14340. }
  14341. return ret, nil
  14342. // {
  14343. // "description": "Inserts a new ad.",
  14344. // "httpMethod": "POST",
  14345. // "id": "dfareporting.ads.insert",
  14346. // "parameterOrder": [
  14347. // "profileId"
  14348. // ],
  14349. // "parameters": {
  14350. // "profileId": {
  14351. // "description": "User profile ID associated with this request.",
  14352. // "format": "int64",
  14353. // "location": "path",
  14354. // "required": true,
  14355. // "type": "string"
  14356. // }
  14357. // },
  14358. // "path": "userprofiles/{profileId}/ads",
  14359. // "request": {
  14360. // "$ref": "Ad"
  14361. // },
  14362. // "response": {
  14363. // "$ref": "Ad"
  14364. // },
  14365. // "scopes": [
  14366. // "https://www.googleapis.com/auth/dfatrafficking"
  14367. // ]
  14368. // }
  14369. }
  14370. // method id "dfareporting.ads.list":
  14371. type AdsListCall struct {
  14372. s *Service
  14373. profileId int64
  14374. urlParams_ gensupport.URLParams
  14375. ifNoneMatch_ string
  14376. ctx_ context.Context
  14377. header_ http.Header
  14378. }
  14379. // List: Retrieves a list of ads, possibly filtered. This method
  14380. // supports paging.
  14381. func (r *AdsService) List(profileId int64) *AdsListCall {
  14382. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14383. c.profileId = profileId
  14384. return c
  14385. }
  14386. // Active sets the optional parameter "active": Select only active ads.
  14387. func (c *AdsListCall) Active(active bool) *AdsListCall {
  14388. c.urlParams_.Set("active", fmt.Sprint(active))
  14389. return c
  14390. }
  14391. // AdvertiserId sets the optional parameter "advertiserId": Select only
  14392. // ads with this advertiser ID.
  14393. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  14394. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  14395. return c
  14396. }
  14397. // Archived sets the optional parameter "archived": Select only archived
  14398. // ads.
  14399. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  14400. c.urlParams_.Set("archived", fmt.Sprint(archived))
  14401. return c
  14402. }
  14403. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  14404. // Select only ads with these audience segment IDs.
  14405. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  14406. var audienceSegmentIds_ []string
  14407. for _, v := range audienceSegmentIds {
  14408. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  14409. }
  14410. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  14411. return c
  14412. }
  14413. // CampaignIds sets the optional parameter "campaignIds": Select only
  14414. // ads with these campaign IDs.
  14415. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  14416. var campaignIds_ []string
  14417. for _, v := range campaignIds {
  14418. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  14419. }
  14420. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  14421. return c
  14422. }
  14423. // Compatibility sets the optional parameter "compatibility": Select
  14424. // default ads with the specified compatibility. Applicable when type is
  14425. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  14426. // rendering either on desktop or on mobile devices for regular or
  14427. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  14428. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  14429. // in-stream video ads developed with the VAST standard.
  14430. //
  14431. // Possible values:
  14432. // "APP"
  14433. // "APP_INTERSTITIAL"
  14434. // "DISPLAY"
  14435. // "DISPLAY_INTERSTITIAL"
  14436. // "IN_STREAM_AUDIO"
  14437. // "IN_STREAM_VIDEO"
  14438. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  14439. c.urlParams_.Set("compatibility", compatibility)
  14440. return c
  14441. }
  14442. // CreativeIds sets the optional parameter "creativeIds": Select only
  14443. // ads with these creative IDs assigned.
  14444. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  14445. var creativeIds_ []string
  14446. for _, v := range creativeIds {
  14447. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  14448. }
  14449. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  14450. return c
  14451. }
  14452. // CreativeOptimizationConfigurationIds sets the optional parameter
  14453. // "creativeOptimizationConfigurationIds": Select only ads with these
  14454. // creative optimization configuration IDs.
  14455. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  14456. var creativeOptimizationConfigurationIds_ []string
  14457. for _, v := range creativeOptimizationConfigurationIds {
  14458. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  14459. }
  14460. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  14461. return c
  14462. }
  14463. // DynamicClickTracker sets the optional parameter
  14464. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  14465. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  14466. // trackers. If false, select static click trackers. Leave unset to
  14467. // select both.
  14468. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  14469. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  14470. return c
  14471. }
  14472. // Ids sets the optional parameter "ids": Select only ads with these
  14473. // IDs.
  14474. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  14475. var ids_ []string
  14476. for _, v := range ids {
  14477. ids_ = append(ids_, fmt.Sprint(v))
  14478. }
  14479. c.urlParams_.SetMulti("ids", ids_)
  14480. return c
  14481. }
  14482. // LandingPageIds sets the optional parameter "landingPageIds": Select
  14483. // only ads with these landing page IDs.
  14484. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  14485. var landingPageIds_ []string
  14486. for _, v := range landingPageIds {
  14487. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  14488. }
  14489. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14490. return c
  14491. }
  14492. // MaxResults sets the optional parameter "maxResults": Maximum number
  14493. // of results to return.
  14494. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14495. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14496. return c
  14497. }
  14498. // OverriddenEventTagId sets the optional parameter
  14499. // "overriddenEventTagId": Select only ads with this event tag override
  14500. // ID.
  14501. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14502. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14503. return c
  14504. }
  14505. // PageToken sets the optional parameter "pageToken": Value of the
  14506. // nextPageToken from the previous result page.
  14507. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14508. c.urlParams_.Set("pageToken", pageToken)
  14509. return c
  14510. }
  14511. // PlacementIds sets the optional parameter "placementIds": Select only
  14512. // ads with these placement IDs assigned.
  14513. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14514. var placementIds_ []string
  14515. for _, v := range placementIds {
  14516. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14517. }
  14518. c.urlParams_.SetMulti("placementIds", placementIds_)
  14519. return c
  14520. }
  14521. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14522. // Select only ads whose list targeting expression use these remarketing
  14523. // list IDs.
  14524. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14525. var remarketingListIds_ []string
  14526. for _, v := range remarketingListIds {
  14527. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14528. }
  14529. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14530. return c
  14531. }
  14532. // SearchString sets the optional parameter "searchString": Allows
  14533. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14534. // example, "ad*2015" will return objects with names like "ad June
  14535. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14536. // also add wildcards implicitly at the start and the end of the search
  14537. // string. For example, a search string of "ad" will match objects with
  14538. // name "my ad", "ad 2015", or simply "ad".
  14539. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14540. c.urlParams_.Set("searchString", searchString)
  14541. return c
  14542. }
  14543. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14544. // these size IDs.
  14545. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14546. var sizeIds_ []string
  14547. for _, v := range sizeIds {
  14548. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14549. }
  14550. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14551. return c
  14552. }
  14553. // SortField sets the optional parameter "sortField": Field by which to
  14554. // sort the list.
  14555. //
  14556. // Possible values:
  14557. // "ID" (default)
  14558. // "NAME"
  14559. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14560. c.urlParams_.Set("sortField", sortField)
  14561. return c
  14562. }
  14563. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14564. // results.
  14565. //
  14566. // Possible values:
  14567. // "ASCENDING" (default)
  14568. // "DESCENDING"
  14569. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14570. c.urlParams_.Set("sortOrder", sortOrder)
  14571. return c
  14572. }
  14573. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14574. // ads that are SSL-compliant.
  14575. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14576. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14577. return c
  14578. }
  14579. // SslRequired sets the optional parameter "sslRequired": Select only
  14580. // ads that require SSL.
  14581. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14582. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14583. return c
  14584. }
  14585. // Type sets the optional parameter "type": Select only ads with these
  14586. // types.
  14587. //
  14588. // Possible values:
  14589. // "AD_SERVING_CLICK_TRACKER"
  14590. // "AD_SERVING_DEFAULT_AD"
  14591. // "AD_SERVING_STANDARD_AD"
  14592. // "AD_SERVING_TRACKING"
  14593. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14594. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14595. return c
  14596. }
  14597. // Fields allows partial responses to be retrieved. See
  14598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14599. // for more information.
  14600. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14602. return c
  14603. }
  14604. // IfNoneMatch sets the optional parameter which makes the operation
  14605. // fail if the object's ETag matches the given value. This is useful for
  14606. // getting updates only after the object has changed since the last
  14607. // request. Use googleapi.IsNotModified to check whether the response
  14608. // error from Do is the result of In-None-Match.
  14609. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14610. c.ifNoneMatch_ = entityTag
  14611. return c
  14612. }
  14613. // Context sets the context to be used in this call's Do method. Any
  14614. // pending HTTP request will be aborted if the provided context is
  14615. // canceled.
  14616. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14617. c.ctx_ = ctx
  14618. return c
  14619. }
  14620. // Header returns an http.Header that can be modified by the caller to
  14621. // add HTTP headers to the request.
  14622. func (c *AdsListCall) Header() http.Header {
  14623. if c.header_ == nil {
  14624. c.header_ = make(http.Header)
  14625. }
  14626. return c.header_
  14627. }
  14628. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14629. reqHeaders := make(http.Header)
  14630. for k, v := range c.header_ {
  14631. reqHeaders[k] = v
  14632. }
  14633. reqHeaders.Set("User-Agent", c.s.userAgent())
  14634. if c.ifNoneMatch_ != "" {
  14635. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14636. }
  14637. var body io.Reader = nil
  14638. c.urlParams_.Set("alt", alt)
  14639. c.urlParams_.Set("prettyPrint", "false")
  14640. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14641. urls += "?" + c.urlParams_.Encode()
  14642. req, err := http.NewRequest("GET", urls, body)
  14643. if err != nil {
  14644. return nil, err
  14645. }
  14646. req.Header = reqHeaders
  14647. googleapi.Expand(req.URL, map[string]string{
  14648. "profileId": strconv.FormatInt(c.profileId, 10),
  14649. })
  14650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14651. }
  14652. // Do executes the "dfareporting.ads.list" call.
  14653. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14654. // status code is an error. Response headers are in either
  14655. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14656. // at all) in error.(*googleapi.Error).Header. Use
  14657. // googleapi.IsNotModified to check whether the returned error was
  14658. // because http.StatusNotModified was returned.
  14659. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14660. gensupport.SetOptions(c.urlParams_, opts...)
  14661. res, err := c.doRequest("json")
  14662. if res != nil && res.StatusCode == http.StatusNotModified {
  14663. if res.Body != nil {
  14664. res.Body.Close()
  14665. }
  14666. return nil, &googleapi.Error{
  14667. Code: res.StatusCode,
  14668. Header: res.Header,
  14669. }
  14670. }
  14671. if err != nil {
  14672. return nil, err
  14673. }
  14674. defer googleapi.CloseBody(res)
  14675. if err := googleapi.CheckResponse(res); err != nil {
  14676. return nil, err
  14677. }
  14678. ret := &AdsListResponse{
  14679. ServerResponse: googleapi.ServerResponse{
  14680. Header: res.Header,
  14681. HTTPStatusCode: res.StatusCode,
  14682. },
  14683. }
  14684. target := &ret
  14685. if err := gensupport.DecodeResponse(target, res); err != nil {
  14686. return nil, err
  14687. }
  14688. return ret, nil
  14689. // {
  14690. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14691. // "httpMethod": "GET",
  14692. // "id": "dfareporting.ads.list",
  14693. // "parameterOrder": [
  14694. // "profileId"
  14695. // ],
  14696. // "parameters": {
  14697. // "active": {
  14698. // "description": "Select only active ads.",
  14699. // "location": "query",
  14700. // "type": "boolean"
  14701. // },
  14702. // "advertiserId": {
  14703. // "description": "Select only ads with this advertiser ID.",
  14704. // "format": "int64",
  14705. // "location": "query",
  14706. // "type": "string"
  14707. // },
  14708. // "archived": {
  14709. // "description": "Select only archived ads.",
  14710. // "location": "query",
  14711. // "type": "boolean"
  14712. // },
  14713. // "audienceSegmentIds": {
  14714. // "description": "Select only ads with these audience segment IDs.",
  14715. // "format": "int64",
  14716. // "location": "query",
  14717. // "repeated": true,
  14718. // "type": "string"
  14719. // },
  14720. // "campaignIds": {
  14721. // "description": "Select only ads with these campaign IDs.",
  14722. // "format": "int64",
  14723. // "location": "query",
  14724. // "repeated": true,
  14725. // "type": "string"
  14726. // },
  14727. // "compatibility": {
  14728. // "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.",
  14729. // "enum": [
  14730. // "APP",
  14731. // "APP_INTERSTITIAL",
  14732. // "DISPLAY",
  14733. // "DISPLAY_INTERSTITIAL",
  14734. // "IN_STREAM_AUDIO",
  14735. // "IN_STREAM_VIDEO"
  14736. // ],
  14737. // "enumDescriptions": [
  14738. // "",
  14739. // "",
  14740. // "",
  14741. // "",
  14742. // "",
  14743. // ""
  14744. // ],
  14745. // "location": "query",
  14746. // "type": "string"
  14747. // },
  14748. // "creativeIds": {
  14749. // "description": "Select only ads with these creative IDs assigned.",
  14750. // "format": "int64",
  14751. // "location": "query",
  14752. // "repeated": true,
  14753. // "type": "string"
  14754. // },
  14755. // "creativeOptimizationConfigurationIds": {
  14756. // "description": "Select only ads with these creative optimization configuration IDs.",
  14757. // "format": "int64",
  14758. // "location": "query",
  14759. // "repeated": true,
  14760. // "type": "string"
  14761. // },
  14762. // "dynamicClickTracker": {
  14763. // "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.",
  14764. // "location": "query",
  14765. // "type": "boolean"
  14766. // },
  14767. // "ids": {
  14768. // "description": "Select only ads with these IDs.",
  14769. // "format": "int64",
  14770. // "location": "query",
  14771. // "repeated": true,
  14772. // "type": "string"
  14773. // },
  14774. // "landingPageIds": {
  14775. // "description": "Select only ads with these landing page IDs.",
  14776. // "format": "int64",
  14777. // "location": "query",
  14778. // "repeated": true,
  14779. // "type": "string"
  14780. // },
  14781. // "maxResults": {
  14782. // "default": "1000",
  14783. // "description": "Maximum number of results to return.",
  14784. // "format": "int32",
  14785. // "location": "query",
  14786. // "maximum": "1000",
  14787. // "minimum": "0",
  14788. // "type": "integer"
  14789. // },
  14790. // "overriddenEventTagId": {
  14791. // "description": "Select only ads with this event tag override ID.",
  14792. // "format": "int64",
  14793. // "location": "query",
  14794. // "type": "string"
  14795. // },
  14796. // "pageToken": {
  14797. // "description": "Value of the nextPageToken from the previous result page.",
  14798. // "location": "query",
  14799. // "type": "string"
  14800. // },
  14801. // "placementIds": {
  14802. // "description": "Select only ads with these placement IDs assigned.",
  14803. // "format": "int64",
  14804. // "location": "query",
  14805. // "repeated": true,
  14806. // "type": "string"
  14807. // },
  14808. // "profileId": {
  14809. // "description": "User profile ID associated with this request.",
  14810. // "format": "int64",
  14811. // "location": "path",
  14812. // "required": true,
  14813. // "type": "string"
  14814. // },
  14815. // "remarketingListIds": {
  14816. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14817. // "format": "int64",
  14818. // "location": "query",
  14819. // "repeated": true,
  14820. // "type": "string"
  14821. // },
  14822. // "searchString": {
  14823. // "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\".",
  14824. // "location": "query",
  14825. // "type": "string"
  14826. // },
  14827. // "sizeIds": {
  14828. // "description": "Select only ads with these size IDs.",
  14829. // "format": "int64",
  14830. // "location": "query",
  14831. // "repeated": true,
  14832. // "type": "string"
  14833. // },
  14834. // "sortField": {
  14835. // "default": "ID",
  14836. // "description": "Field by which to sort the list.",
  14837. // "enum": [
  14838. // "ID",
  14839. // "NAME"
  14840. // ],
  14841. // "enumDescriptions": [
  14842. // "",
  14843. // ""
  14844. // ],
  14845. // "location": "query",
  14846. // "type": "string"
  14847. // },
  14848. // "sortOrder": {
  14849. // "default": "ASCENDING",
  14850. // "description": "Order of sorted results.",
  14851. // "enum": [
  14852. // "ASCENDING",
  14853. // "DESCENDING"
  14854. // ],
  14855. // "enumDescriptions": [
  14856. // "",
  14857. // ""
  14858. // ],
  14859. // "location": "query",
  14860. // "type": "string"
  14861. // },
  14862. // "sslCompliant": {
  14863. // "description": "Select only ads that are SSL-compliant.",
  14864. // "location": "query",
  14865. // "type": "boolean"
  14866. // },
  14867. // "sslRequired": {
  14868. // "description": "Select only ads that require SSL.",
  14869. // "location": "query",
  14870. // "type": "boolean"
  14871. // },
  14872. // "type": {
  14873. // "description": "Select only ads with these types.",
  14874. // "enum": [
  14875. // "AD_SERVING_CLICK_TRACKER",
  14876. // "AD_SERVING_DEFAULT_AD",
  14877. // "AD_SERVING_STANDARD_AD",
  14878. // "AD_SERVING_TRACKING"
  14879. // ],
  14880. // "enumDescriptions": [
  14881. // "",
  14882. // "",
  14883. // "",
  14884. // ""
  14885. // ],
  14886. // "location": "query",
  14887. // "repeated": true,
  14888. // "type": "string"
  14889. // }
  14890. // },
  14891. // "path": "userprofiles/{profileId}/ads",
  14892. // "response": {
  14893. // "$ref": "AdsListResponse"
  14894. // },
  14895. // "scopes": [
  14896. // "https://www.googleapis.com/auth/dfatrafficking"
  14897. // ]
  14898. // }
  14899. }
  14900. // Pages invokes f for each page of results.
  14901. // A non-nil error returned from f will halt the iteration.
  14902. // The provided context supersedes any context provided to the Context method.
  14903. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14904. c.ctx_ = ctx
  14905. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14906. for {
  14907. x, err := c.Do()
  14908. if err != nil {
  14909. return err
  14910. }
  14911. if err := f(x); err != nil {
  14912. return err
  14913. }
  14914. if x.NextPageToken == "" {
  14915. return nil
  14916. }
  14917. c.PageToken(x.NextPageToken)
  14918. }
  14919. }
  14920. // method id "dfareporting.ads.patch":
  14921. type AdsPatchCall struct {
  14922. s *Service
  14923. profileId int64
  14924. ad *Ad
  14925. urlParams_ gensupport.URLParams
  14926. ctx_ context.Context
  14927. header_ http.Header
  14928. }
  14929. // Patch: Updates an existing ad. This method supports patch semantics.
  14930. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14931. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14932. c.profileId = profileId
  14933. c.urlParams_.Set("id", fmt.Sprint(id))
  14934. c.ad = ad
  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 *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  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 *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  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 *AdsPatchCall) Header() http.Header {
  14954. if c.header_ == nil {
  14955. c.header_ = make(http.Header)
  14956. }
  14957. return c.header_
  14958. }
  14959. func (c *AdsPatchCall) 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.ad)
  14967. if err != nil {
  14968. return nil, err
  14969. }
  14970. reqHeaders.Set("Content-Type", "application/json")
  14971. c.urlParams_.Set("alt", alt)
  14972. c.urlParams_.Set("prettyPrint", "false")
  14973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14974. urls += "?" + c.urlParams_.Encode()
  14975. req, err := http.NewRequest("PATCH", urls, body)
  14976. if err != nil {
  14977. return nil, err
  14978. }
  14979. req.Header = reqHeaders
  14980. googleapi.Expand(req.URL, map[string]string{
  14981. "profileId": strconv.FormatInt(c.profileId, 10),
  14982. })
  14983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14984. }
  14985. // Do executes the "dfareporting.ads.patch" call.
  14986. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14987. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14988. // or (if a response was returned at all) in
  14989. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14990. // whether the returned error was because http.StatusNotModified was
  14991. // returned.
  14992. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14993. gensupport.SetOptions(c.urlParams_, opts...)
  14994. res, err := c.doRequest("json")
  14995. if res != nil && res.StatusCode == http.StatusNotModified {
  14996. if res.Body != nil {
  14997. res.Body.Close()
  14998. }
  14999. return nil, &googleapi.Error{
  15000. Code: res.StatusCode,
  15001. Header: res.Header,
  15002. }
  15003. }
  15004. if err != nil {
  15005. return nil, err
  15006. }
  15007. defer googleapi.CloseBody(res)
  15008. if err := googleapi.CheckResponse(res); err != nil {
  15009. return nil, err
  15010. }
  15011. ret := &Ad{
  15012. ServerResponse: googleapi.ServerResponse{
  15013. Header: res.Header,
  15014. HTTPStatusCode: res.StatusCode,
  15015. },
  15016. }
  15017. target := &ret
  15018. if err := gensupport.DecodeResponse(target, res); err != nil {
  15019. return nil, err
  15020. }
  15021. return ret, nil
  15022. // {
  15023. // "description": "Updates an existing ad. This method supports patch semantics.",
  15024. // "httpMethod": "PATCH",
  15025. // "id": "dfareporting.ads.patch",
  15026. // "parameterOrder": [
  15027. // "profileId",
  15028. // "id"
  15029. // ],
  15030. // "parameters": {
  15031. // "id": {
  15032. // "description": "Ad ID.",
  15033. // "format": "int64",
  15034. // "location": "query",
  15035. // "required": true,
  15036. // "type": "string"
  15037. // },
  15038. // "profileId": {
  15039. // "description": "User profile ID associated with this request.",
  15040. // "format": "int64",
  15041. // "location": "path",
  15042. // "required": true,
  15043. // "type": "string"
  15044. // }
  15045. // },
  15046. // "path": "userprofiles/{profileId}/ads",
  15047. // "request": {
  15048. // "$ref": "Ad"
  15049. // },
  15050. // "response": {
  15051. // "$ref": "Ad"
  15052. // },
  15053. // "scopes": [
  15054. // "https://www.googleapis.com/auth/dfatrafficking"
  15055. // ]
  15056. // }
  15057. }
  15058. // method id "dfareporting.ads.update":
  15059. type AdsUpdateCall struct {
  15060. s *Service
  15061. profileId int64
  15062. ad *Ad
  15063. urlParams_ gensupport.URLParams
  15064. ctx_ context.Context
  15065. header_ http.Header
  15066. }
  15067. // Update: Updates an existing ad.
  15068. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  15069. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15070. c.profileId = profileId
  15071. c.ad = ad
  15072. return c
  15073. }
  15074. // Fields allows partial responses to be retrieved. See
  15075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15076. // for more information.
  15077. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  15078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15079. return c
  15080. }
  15081. // Context sets the context to be used in this call's Do method. Any
  15082. // pending HTTP request will be aborted if the provided context is
  15083. // canceled.
  15084. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  15085. c.ctx_ = ctx
  15086. return c
  15087. }
  15088. // Header returns an http.Header that can be modified by the caller to
  15089. // add HTTP headers to the request.
  15090. func (c *AdsUpdateCall) Header() http.Header {
  15091. if c.header_ == nil {
  15092. c.header_ = make(http.Header)
  15093. }
  15094. return c.header_
  15095. }
  15096. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15097. reqHeaders := make(http.Header)
  15098. for k, v := range c.header_ {
  15099. reqHeaders[k] = v
  15100. }
  15101. reqHeaders.Set("User-Agent", c.s.userAgent())
  15102. var body io.Reader = nil
  15103. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  15104. if err != nil {
  15105. return nil, err
  15106. }
  15107. reqHeaders.Set("Content-Type", "application/json")
  15108. c.urlParams_.Set("alt", alt)
  15109. c.urlParams_.Set("prettyPrint", "false")
  15110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  15111. urls += "?" + c.urlParams_.Encode()
  15112. req, err := http.NewRequest("PUT", urls, body)
  15113. if err != nil {
  15114. return nil, err
  15115. }
  15116. req.Header = reqHeaders
  15117. googleapi.Expand(req.URL, map[string]string{
  15118. "profileId": strconv.FormatInt(c.profileId, 10),
  15119. })
  15120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15121. }
  15122. // Do executes the "dfareporting.ads.update" call.
  15123. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  15124. // is an error. Response headers are in either *Ad.ServerResponse.Header
  15125. // or (if a response was returned at all) in
  15126. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15127. // whether the returned error was because http.StatusNotModified was
  15128. // returned.
  15129. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  15130. gensupport.SetOptions(c.urlParams_, opts...)
  15131. res, err := c.doRequest("json")
  15132. if res != nil && res.StatusCode == http.StatusNotModified {
  15133. if res.Body != nil {
  15134. res.Body.Close()
  15135. }
  15136. return nil, &googleapi.Error{
  15137. Code: res.StatusCode,
  15138. Header: res.Header,
  15139. }
  15140. }
  15141. if err != nil {
  15142. return nil, err
  15143. }
  15144. defer googleapi.CloseBody(res)
  15145. if err := googleapi.CheckResponse(res); err != nil {
  15146. return nil, err
  15147. }
  15148. ret := &Ad{
  15149. ServerResponse: googleapi.ServerResponse{
  15150. Header: res.Header,
  15151. HTTPStatusCode: res.StatusCode,
  15152. },
  15153. }
  15154. target := &ret
  15155. if err := gensupport.DecodeResponse(target, res); err != nil {
  15156. return nil, err
  15157. }
  15158. return ret, nil
  15159. // {
  15160. // "description": "Updates an existing ad.",
  15161. // "httpMethod": "PUT",
  15162. // "id": "dfareporting.ads.update",
  15163. // "parameterOrder": [
  15164. // "profileId"
  15165. // ],
  15166. // "parameters": {
  15167. // "profileId": {
  15168. // "description": "User profile ID associated with this request.",
  15169. // "format": "int64",
  15170. // "location": "path",
  15171. // "required": true,
  15172. // "type": "string"
  15173. // }
  15174. // },
  15175. // "path": "userprofiles/{profileId}/ads",
  15176. // "request": {
  15177. // "$ref": "Ad"
  15178. // },
  15179. // "response": {
  15180. // "$ref": "Ad"
  15181. // },
  15182. // "scopes": [
  15183. // "https://www.googleapis.com/auth/dfatrafficking"
  15184. // ]
  15185. // }
  15186. }
  15187. // method id "dfareporting.advertiserGroups.delete":
  15188. type AdvertiserGroupsDeleteCall struct {
  15189. s *Service
  15190. profileId int64
  15191. id int64
  15192. urlParams_ gensupport.URLParams
  15193. ctx_ context.Context
  15194. header_ http.Header
  15195. }
  15196. // Delete: Deletes an existing advertiser group.
  15197. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  15198. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15199. c.profileId = profileId
  15200. c.id = id
  15201. return c
  15202. }
  15203. // Fields allows partial responses to be retrieved. See
  15204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15205. // for more information.
  15206. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  15207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15208. return c
  15209. }
  15210. // Context sets the context to be used in this call's Do method. Any
  15211. // pending HTTP request will be aborted if the provided context is
  15212. // canceled.
  15213. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  15214. c.ctx_ = ctx
  15215. return c
  15216. }
  15217. // Header returns an http.Header that can be modified by the caller to
  15218. // add HTTP headers to the request.
  15219. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  15220. if c.header_ == nil {
  15221. c.header_ = make(http.Header)
  15222. }
  15223. return c.header_
  15224. }
  15225. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15226. reqHeaders := make(http.Header)
  15227. for k, v := range c.header_ {
  15228. reqHeaders[k] = v
  15229. }
  15230. reqHeaders.Set("User-Agent", c.s.userAgent())
  15231. var body io.Reader = nil
  15232. c.urlParams_.Set("alt", alt)
  15233. c.urlParams_.Set("prettyPrint", "false")
  15234. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15235. urls += "?" + c.urlParams_.Encode()
  15236. req, err := http.NewRequest("DELETE", urls, body)
  15237. if err != nil {
  15238. return nil, err
  15239. }
  15240. req.Header = reqHeaders
  15241. googleapi.Expand(req.URL, map[string]string{
  15242. "profileId": strconv.FormatInt(c.profileId, 10),
  15243. "id": strconv.FormatInt(c.id, 10),
  15244. })
  15245. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15246. }
  15247. // Do executes the "dfareporting.advertiserGroups.delete" call.
  15248. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15249. gensupport.SetOptions(c.urlParams_, opts...)
  15250. res, err := c.doRequest("json")
  15251. if err != nil {
  15252. return err
  15253. }
  15254. defer googleapi.CloseBody(res)
  15255. if err := googleapi.CheckResponse(res); err != nil {
  15256. return err
  15257. }
  15258. return nil
  15259. // {
  15260. // "description": "Deletes an existing advertiser group.",
  15261. // "httpMethod": "DELETE",
  15262. // "id": "dfareporting.advertiserGroups.delete",
  15263. // "parameterOrder": [
  15264. // "profileId",
  15265. // "id"
  15266. // ],
  15267. // "parameters": {
  15268. // "id": {
  15269. // "description": "Advertiser group ID.",
  15270. // "format": "int64",
  15271. // "location": "path",
  15272. // "required": true,
  15273. // "type": "string"
  15274. // },
  15275. // "profileId": {
  15276. // "description": "User profile ID associated with this request.",
  15277. // "format": "int64",
  15278. // "location": "path",
  15279. // "required": true,
  15280. // "type": "string"
  15281. // }
  15282. // },
  15283. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15284. // "scopes": [
  15285. // "https://www.googleapis.com/auth/dfatrafficking"
  15286. // ]
  15287. // }
  15288. }
  15289. // method id "dfareporting.advertiserGroups.get":
  15290. type AdvertiserGroupsGetCall struct {
  15291. s *Service
  15292. profileId int64
  15293. id int64
  15294. urlParams_ gensupport.URLParams
  15295. ifNoneMatch_ string
  15296. ctx_ context.Context
  15297. header_ http.Header
  15298. }
  15299. // Get: Gets one advertiser group by ID.
  15300. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  15301. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15302. c.profileId = profileId
  15303. c.id = id
  15304. return c
  15305. }
  15306. // Fields allows partial responses to be retrieved. See
  15307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15308. // for more information.
  15309. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  15310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15311. return c
  15312. }
  15313. // IfNoneMatch sets the optional parameter which makes the operation
  15314. // fail if the object's ETag matches the given value. This is useful for
  15315. // getting updates only after the object has changed since the last
  15316. // request. Use googleapi.IsNotModified to check whether the response
  15317. // error from Do is the result of In-None-Match.
  15318. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  15319. c.ifNoneMatch_ = entityTag
  15320. return c
  15321. }
  15322. // Context sets the context to be used in this call's Do method. Any
  15323. // pending HTTP request will be aborted if the provided context is
  15324. // canceled.
  15325. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  15326. c.ctx_ = ctx
  15327. return c
  15328. }
  15329. // Header returns an http.Header that can be modified by the caller to
  15330. // add HTTP headers to the request.
  15331. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  15332. if c.header_ == nil {
  15333. c.header_ = make(http.Header)
  15334. }
  15335. return c.header_
  15336. }
  15337. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  15338. reqHeaders := make(http.Header)
  15339. for k, v := range c.header_ {
  15340. reqHeaders[k] = v
  15341. }
  15342. reqHeaders.Set("User-Agent", c.s.userAgent())
  15343. if c.ifNoneMatch_ != "" {
  15344. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15345. }
  15346. var body io.Reader = nil
  15347. c.urlParams_.Set("alt", alt)
  15348. c.urlParams_.Set("prettyPrint", "false")
  15349. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15350. urls += "?" + c.urlParams_.Encode()
  15351. req, err := http.NewRequest("GET", urls, body)
  15352. if err != nil {
  15353. return nil, err
  15354. }
  15355. req.Header = reqHeaders
  15356. googleapi.Expand(req.URL, map[string]string{
  15357. "profileId": strconv.FormatInt(c.profileId, 10),
  15358. "id": strconv.FormatInt(c.id, 10),
  15359. })
  15360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15361. }
  15362. // Do executes the "dfareporting.advertiserGroups.get" call.
  15363. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15364. // status code is an error. Response headers are in either
  15365. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15366. // at all) in error.(*googleapi.Error).Header. Use
  15367. // googleapi.IsNotModified to check whether the returned error was
  15368. // because http.StatusNotModified was returned.
  15369. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15370. gensupport.SetOptions(c.urlParams_, opts...)
  15371. res, err := c.doRequest("json")
  15372. if res != nil && res.StatusCode == http.StatusNotModified {
  15373. if res.Body != nil {
  15374. res.Body.Close()
  15375. }
  15376. return nil, &googleapi.Error{
  15377. Code: res.StatusCode,
  15378. Header: res.Header,
  15379. }
  15380. }
  15381. if err != nil {
  15382. return nil, err
  15383. }
  15384. defer googleapi.CloseBody(res)
  15385. if err := googleapi.CheckResponse(res); err != nil {
  15386. return nil, err
  15387. }
  15388. ret := &AdvertiserGroup{
  15389. ServerResponse: googleapi.ServerResponse{
  15390. Header: res.Header,
  15391. HTTPStatusCode: res.StatusCode,
  15392. },
  15393. }
  15394. target := &ret
  15395. if err := gensupport.DecodeResponse(target, res); err != nil {
  15396. return nil, err
  15397. }
  15398. return ret, nil
  15399. // {
  15400. // "description": "Gets one advertiser group by ID.",
  15401. // "httpMethod": "GET",
  15402. // "id": "dfareporting.advertiserGroups.get",
  15403. // "parameterOrder": [
  15404. // "profileId",
  15405. // "id"
  15406. // ],
  15407. // "parameters": {
  15408. // "id": {
  15409. // "description": "Advertiser group ID.",
  15410. // "format": "int64",
  15411. // "location": "path",
  15412. // "required": true,
  15413. // "type": "string"
  15414. // },
  15415. // "profileId": {
  15416. // "description": "User profile ID associated with this request.",
  15417. // "format": "int64",
  15418. // "location": "path",
  15419. // "required": true,
  15420. // "type": "string"
  15421. // }
  15422. // },
  15423. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15424. // "response": {
  15425. // "$ref": "AdvertiserGroup"
  15426. // },
  15427. // "scopes": [
  15428. // "https://www.googleapis.com/auth/dfatrafficking"
  15429. // ]
  15430. // }
  15431. }
  15432. // method id "dfareporting.advertiserGroups.insert":
  15433. type AdvertiserGroupsInsertCall struct {
  15434. s *Service
  15435. profileId int64
  15436. advertisergroup *AdvertiserGroup
  15437. urlParams_ gensupport.URLParams
  15438. ctx_ context.Context
  15439. header_ http.Header
  15440. }
  15441. // Insert: Inserts a new advertiser group.
  15442. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  15443. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15444. c.profileId = profileId
  15445. c.advertisergroup = advertisergroup
  15446. return c
  15447. }
  15448. // Fields allows partial responses to be retrieved. See
  15449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15450. // for more information.
  15451. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  15452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15453. return c
  15454. }
  15455. // Context sets the context to be used in this call's Do method. Any
  15456. // pending HTTP request will be aborted if the provided context is
  15457. // canceled.
  15458. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  15459. c.ctx_ = ctx
  15460. return c
  15461. }
  15462. // Header returns an http.Header that can be modified by the caller to
  15463. // add HTTP headers to the request.
  15464. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  15465. if c.header_ == nil {
  15466. c.header_ = make(http.Header)
  15467. }
  15468. return c.header_
  15469. }
  15470. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  15471. reqHeaders := make(http.Header)
  15472. for k, v := range c.header_ {
  15473. reqHeaders[k] = v
  15474. }
  15475. reqHeaders.Set("User-Agent", c.s.userAgent())
  15476. var body io.Reader = nil
  15477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15478. if err != nil {
  15479. return nil, err
  15480. }
  15481. reqHeaders.Set("Content-Type", "application/json")
  15482. c.urlParams_.Set("alt", alt)
  15483. c.urlParams_.Set("prettyPrint", "false")
  15484. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15485. urls += "?" + c.urlParams_.Encode()
  15486. req, err := http.NewRequest("POST", urls, body)
  15487. if err != nil {
  15488. return nil, err
  15489. }
  15490. req.Header = reqHeaders
  15491. googleapi.Expand(req.URL, map[string]string{
  15492. "profileId": strconv.FormatInt(c.profileId, 10),
  15493. })
  15494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15495. }
  15496. // Do executes the "dfareporting.advertiserGroups.insert" call.
  15497. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15498. // status code is an error. Response headers are in either
  15499. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15500. // at all) in error.(*googleapi.Error).Header. Use
  15501. // googleapi.IsNotModified to check whether the returned error was
  15502. // because http.StatusNotModified was returned.
  15503. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15504. gensupport.SetOptions(c.urlParams_, opts...)
  15505. res, err := c.doRequest("json")
  15506. if res != nil && res.StatusCode == http.StatusNotModified {
  15507. if res.Body != nil {
  15508. res.Body.Close()
  15509. }
  15510. return nil, &googleapi.Error{
  15511. Code: res.StatusCode,
  15512. Header: res.Header,
  15513. }
  15514. }
  15515. if err != nil {
  15516. return nil, err
  15517. }
  15518. defer googleapi.CloseBody(res)
  15519. if err := googleapi.CheckResponse(res); err != nil {
  15520. return nil, err
  15521. }
  15522. ret := &AdvertiserGroup{
  15523. ServerResponse: googleapi.ServerResponse{
  15524. Header: res.Header,
  15525. HTTPStatusCode: res.StatusCode,
  15526. },
  15527. }
  15528. target := &ret
  15529. if err := gensupport.DecodeResponse(target, res); err != nil {
  15530. return nil, err
  15531. }
  15532. return ret, nil
  15533. // {
  15534. // "description": "Inserts a new advertiser group.",
  15535. // "httpMethod": "POST",
  15536. // "id": "dfareporting.advertiserGroups.insert",
  15537. // "parameterOrder": [
  15538. // "profileId"
  15539. // ],
  15540. // "parameters": {
  15541. // "profileId": {
  15542. // "description": "User profile ID associated with this request.",
  15543. // "format": "int64",
  15544. // "location": "path",
  15545. // "required": true,
  15546. // "type": "string"
  15547. // }
  15548. // },
  15549. // "path": "userprofiles/{profileId}/advertiserGroups",
  15550. // "request": {
  15551. // "$ref": "AdvertiserGroup"
  15552. // },
  15553. // "response": {
  15554. // "$ref": "AdvertiserGroup"
  15555. // },
  15556. // "scopes": [
  15557. // "https://www.googleapis.com/auth/dfatrafficking"
  15558. // ]
  15559. // }
  15560. }
  15561. // method id "dfareporting.advertiserGroups.list":
  15562. type AdvertiserGroupsListCall struct {
  15563. s *Service
  15564. profileId int64
  15565. urlParams_ gensupport.URLParams
  15566. ifNoneMatch_ string
  15567. ctx_ context.Context
  15568. header_ http.Header
  15569. }
  15570. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15571. // method supports paging.
  15572. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15573. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15574. c.profileId = profileId
  15575. return c
  15576. }
  15577. // Ids sets the optional parameter "ids": Select only advertiser groups
  15578. // with these IDs.
  15579. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15580. var ids_ []string
  15581. for _, v := range ids {
  15582. ids_ = append(ids_, fmt.Sprint(v))
  15583. }
  15584. c.urlParams_.SetMulti("ids", ids_)
  15585. return c
  15586. }
  15587. // MaxResults sets the optional parameter "maxResults": Maximum number
  15588. // of results to return.
  15589. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15590. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15591. return c
  15592. }
  15593. // PageToken sets the optional parameter "pageToken": Value of the
  15594. // nextPageToken from the previous result page.
  15595. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15596. c.urlParams_.Set("pageToken", pageToken)
  15597. return c
  15598. }
  15599. // SearchString sets the optional parameter "searchString": Allows
  15600. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15601. // example, "advertiser*2015" will return objects with names like
  15602. // "advertiser group June 2015", "advertiser group April 2015", or
  15603. // simply "advertiser group 2015". Most of the searches also add
  15604. // wildcards implicitly at the start and the end of the search string.
  15605. // For example, a search string of "advertisergroup" will match objects
  15606. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15607. // "advertisergroup".
  15608. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15609. c.urlParams_.Set("searchString", searchString)
  15610. return c
  15611. }
  15612. // SortField sets the optional parameter "sortField": Field by which to
  15613. // sort the list.
  15614. //
  15615. // Possible values:
  15616. // "ID" (default)
  15617. // "NAME"
  15618. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15619. c.urlParams_.Set("sortField", sortField)
  15620. return c
  15621. }
  15622. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15623. // results.
  15624. //
  15625. // Possible values:
  15626. // "ASCENDING" (default)
  15627. // "DESCENDING"
  15628. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15629. c.urlParams_.Set("sortOrder", sortOrder)
  15630. return c
  15631. }
  15632. // Fields allows partial responses to be retrieved. See
  15633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15634. // for more information.
  15635. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15637. return c
  15638. }
  15639. // IfNoneMatch sets the optional parameter which makes the operation
  15640. // fail if the object's ETag matches the given value. This is useful for
  15641. // getting updates only after the object has changed since the last
  15642. // request. Use googleapi.IsNotModified to check whether the response
  15643. // error from Do is the result of In-None-Match.
  15644. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15645. c.ifNoneMatch_ = entityTag
  15646. return c
  15647. }
  15648. // Context sets the context to be used in this call's Do method. Any
  15649. // pending HTTP request will be aborted if the provided context is
  15650. // canceled.
  15651. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15652. c.ctx_ = ctx
  15653. return c
  15654. }
  15655. // Header returns an http.Header that can be modified by the caller to
  15656. // add HTTP headers to the request.
  15657. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15658. if c.header_ == nil {
  15659. c.header_ = make(http.Header)
  15660. }
  15661. return c.header_
  15662. }
  15663. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15664. reqHeaders := make(http.Header)
  15665. for k, v := range c.header_ {
  15666. reqHeaders[k] = v
  15667. }
  15668. reqHeaders.Set("User-Agent", c.s.userAgent())
  15669. if c.ifNoneMatch_ != "" {
  15670. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15671. }
  15672. var body io.Reader = nil
  15673. c.urlParams_.Set("alt", alt)
  15674. c.urlParams_.Set("prettyPrint", "false")
  15675. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15676. urls += "?" + c.urlParams_.Encode()
  15677. req, err := http.NewRequest("GET", urls, body)
  15678. if err != nil {
  15679. return nil, err
  15680. }
  15681. req.Header = reqHeaders
  15682. googleapi.Expand(req.URL, map[string]string{
  15683. "profileId": strconv.FormatInt(c.profileId, 10),
  15684. })
  15685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15686. }
  15687. // Do executes the "dfareporting.advertiserGroups.list" call.
  15688. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15689. // non-nil. Any non-2xx status code is an error. Response headers are in
  15690. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15691. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15692. // googleapi.IsNotModified to check whether the returned error was
  15693. // because http.StatusNotModified was returned.
  15694. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15695. gensupport.SetOptions(c.urlParams_, opts...)
  15696. res, err := c.doRequest("json")
  15697. if res != nil && res.StatusCode == http.StatusNotModified {
  15698. if res.Body != nil {
  15699. res.Body.Close()
  15700. }
  15701. return nil, &googleapi.Error{
  15702. Code: res.StatusCode,
  15703. Header: res.Header,
  15704. }
  15705. }
  15706. if err != nil {
  15707. return nil, err
  15708. }
  15709. defer googleapi.CloseBody(res)
  15710. if err := googleapi.CheckResponse(res); err != nil {
  15711. return nil, err
  15712. }
  15713. ret := &AdvertiserGroupsListResponse{
  15714. ServerResponse: googleapi.ServerResponse{
  15715. Header: res.Header,
  15716. HTTPStatusCode: res.StatusCode,
  15717. },
  15718. }
  15719. target := &ret
  15720. if err := gensupport.DecodeResponse(target, res); err != nil {
  15721. return nil, err
  15722. }
  15723. return ret, nil
  15724. // {
  15725. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15726. // "httpMethod": "GET",
  15727. // "id": "dfareporting.advertiserGroups.list",
  15728. // "parameterOrder": [
  15729. // "profileId"
  15730. // ],
  15731. // "parameters": {
  15732. // "ids": {
  15733. // "description": "Select only advertiser groups with these IDs.",
  15734. // "format": "int64",
  15735. // "location": "query",
  15736. // "repeated": true,
  15737. // "type": "string"
  15738. // },
  15739. // "maxResults": {
  15740. // "default": "1000",
  15741. // "description": "Maximum number of results to return.",
  15742. // "format": "int32",
  15743. // "location": "query",
  15744. // "maximum": "1000",
  15745. // "minimum": "0",
  15746. // "type": "integer"
  15747. // },
  15748. // "pageToken": {
  15749. // "description": "Value of the nextPageToken from the previous result page.",
  15750. // "location": "query",
  15751. // "type": "string"
  15752. // },
  15753. // "profileId": {
  15754. // "description": "User profile ID associated with this request.",
  15755. // "format": "int64",
  15756. // "location": "path",
  15757. // "required": true,
  15758. // "type": "string"
  15759. // },
  15760. // "searchString": {
  15761. // "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\".",
  15762. // "location": "query",
  15763. // "type": "string"
  15764. // },
  15765. // "sortField": {
  15766. // "default": "ID",
  15767. // "description": "Field by which to sort the list.",
  15768. // "enum": [
  15769. // "ID",
  15770. // "NAME"
  15771. // ],
  15772. // "enumDescriptions": [
  15773. // "",
  15774. // ""
  15775. // ],
  15776. // "location": "query",
  15777. // "type": "string"
  15778. // },
  15779. // "sortOrder": {
  15780. // "default": "ASCENDING",
  15781. // "description": "Order of sorted results.",
  15782. // "enum": [
  15783. // "ASCENDING",
  15784. // "DESCENDING"
  15785. // ],
  15786. // "enumDescriptions": [
  15787. // "",
  15788. // ""
  15789. // ],
  15790. // "location": "query",
  15791. // "type": "string"
  15792. // }
  15793. // },
  15794. // "path": "userprofiles/{profileId}/advertiserGroups",
  15795. // "response": {
  15796. // "$ref": "AdvertiserGroupsListResponse"
  15797. // },
  15798. // "scopes": [
  15799. // "https://www.googleapis.com/auth/dfatrafficking"
  15800. // ]
  15801. // }
  15802. }
  15803. // Pages invokes f for each page of results.
  15804. // A non-nil error returned from f will halt the iteration.
  15805. // The provided context supersedes any context provided to the Context method.
  15806. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15807. c.ctx_ = ctx
  15808. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15809. for {
  15810. x, err := c.Do()
  15811. if err != nil {
  15812. return err
  15813. }
  15814. if err := f(x); err != nil {
  15815. return err
  15816. }
  15817. if x.NextPageToken == "" {
  15818. return nil
  15819. }
  15820. c.PageToken(x.NextPageToken)
  15821. }
  15822. }
  15823. // method id "dfareporting.advertiserGroups.patch":
  15824. type AdvertiserGroupsPatchCall struct {
  15825. s *Service
  15826. profileId int64
  15827. advertisergroup *AdvertiserGroup
  15828. urlParams_ gensupport.URLParams
  15829. ctx_ context.Context
  15830. header_ http.Header
  15831. }
  15832. // Patch: Updates an existing advertiser group. This method supports
  15833. // patch semantics.
  15834. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15835. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15836. c.profileId = profileId
  15837. c.urlParams_.Set("id", fmt.Sprint(id))
  15838. c.advertisergroup = advertisergroup
  15839. return c
  15840. }
  15841. // Fields allows partial responses to be retrieved. See
  15842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15843. // for more information.
  15844. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15846. return c
  15847. }
  15848. // Context sets the context to be used in this call's Do method. Any
  15849. // pending HTTP request will be aborted if the provided context is
  15850. // canceled.
  15851. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15852. c.ctx_ = ctx
  15853. return c
  15854. }
  15855. // Header returns an http.Header that can be modified by the caller to
  15856. // add HTTP headers to the request.
  15857. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15858. if c.header_ == nil {
  15859. c.header_ = make(http.Header)
  15860. }
  15861. return c.header_
  15862. }
  15863. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15864. reqHeaders := make(http.Header)
  15865. for k, v := range c.header_ {
  15866. reqHeaders[k] = v
  15867. }
  15868. reqHeaders.Set("User-Agent", c.s.userAgent())
  15869. var body io.Reader = nil
  15870. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15871. if err != nil {
  15872. return nil, err
  15873. }
  15874. reqHeaders.Set("Content-Type", "application/json")
  15875. c.urlParams_.Set("alt", alt)
  15876. c.urlParams_.Set("prettyPrint", "false")
  15877. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15878. urls += "?" + c.urlParams_.Encode()
  15879. req, err := http.NewRequest("PATCH", urls, body)
  15880. if err != nil {
  15881. return nil, err
  15882. }
  15883. req.Header = reqHeaders
  15884. googleapi.Expand(req.URL, map[string]string{
  15885. "profileId": strconv.FormatInt(c.profileId, 10),
  15886. })
  15887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15888. }
  15889. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15890. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15891. // status code is an error. Response headers are in either
  15892. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15893. // at all) in error.(*googleapi.Error).Header. Use
  15894. // googleapi.IsNotModified to check whether the returned error was
  15895. // because http.StatusNotModified was returned.
  15896. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15897. gensupport.SetOptions(c.urlParams_, opts...)
  15898. res, err := c.doRequest("json")
  15899. if res != nil && res.StatusCode == http.StatusNotModified {
  15900. if res.Body != nil {
  15901. res.Body.Close()
  15902. }
  15903. return nil, &googleapi.Error{
  15904. Code: res.StatusCode,
  15905. Header: res.Header,
  15906. }
  15907. }
  15908. if err != nil {
  15909. return nil, err
  15910. }
  15911. defer googleapi.CloseBody(res)
  15912. if err := googleapi.CheckResponse(res); err != nil {
  15913. return nil, err
  15914. }
  15915. ret := &AdvertiserGroup{
  15916. ServerResponse: googleapi.ServerResponse{
  15917. Header: res.Header,
  15918. HTTPStatusCode: res.StatusCode,
  15919. },
  15920. }
  15921. target := &ret
  15922. if err := gensupport.DecodeResponse(target, res); err != nil {
  15923. return nil, err
  15924. }
  15925. return ret, nil
  15926. // {
  15927. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15928. // "httpMethod": "PATCH",
  15929. // "id": "dfareporting.advertiserGroups.patch",
  15930. // "parameterOrder": [
  15931. // "profileId",
  15932. // "id"
  15933. // ],
  15934. // "parameters": {
  15935. // "id": {
  15936. // "description": "Advertiser group ID.",
  15937. // "format": "int64",
  15938. // "location": "query",
  15939. // "required": true,
  15940. // "type": "string"
  15941. // },
  15942. // "profileId": {
  15943. // "description": "User profile ID associated with this request.",
  15944. // "format": "int64",
  15945. // "location": "path",
  15946. // "required": true,
  15947. // "type": "string"
  15948. // }
  15949. // },
  15950. // "path": "userprofiles/{profileId}/advertiserGroups",
  15951. // "request": {
  15952. // "$ref": "AdvertiserGroup"
  15953. // },
  15954. // "response": {
  15955. // "$ref": "AdvertiserGroup"
  15956. // },
  15957. // "scopes": [
  15958. // "https://www.googleapis.com/auth/dfatrafficking"
  15959. // ]
  15960. // }
  15961. }
  15962. // method id "dfareporting.advertiserGroups.update":
  15963. type AdvertiserGroupsUpdateCall struct {
  15964. s *Service
  15965. profileId int64
  15966. advertisergroup *AdvertiserGroup
  15967. urlParams_ gensupport.URLParams
  15968. ctx_ context.Context
  15969. header_ http.Header
  15970. }
  15971. // Update: Updates an existing advertiser group.
  15972. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15973. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15974. c.profileId = profileId
  15975. c.advertisergroup = advertisergroup
  15976. return c
  15977. }
  15978. // Fields allows partial responses to be retrieved. See
  15979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15980. // for more information.
  15981. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15983. return c
  15984. }
  15985. // Context sets the context to be used in this call's Do method. Any
  15986. // pending HTTP request will be aborted if the provided context is
  15987. // canceled.
  15988. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15989. c.ctx_ = ctx
  15990. return c
  15991. }
  15992. // Header returns an http.Header that can be modified by the caller to
  15993. // add HTTP headers to the request.
  15994. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15995. if c.header_ == nil {
  15996. c.header_ = make(http.Header)
  15997. }
  15998. return c.header_
  15999. }
  16000. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  16001. reqHeaders := make(http.Header)
  16002. for k, v := range c.header_ {
  16003. reqHeaders[k] = v
  16004. }
  16005. reqHeaders.Set("User-Agent", c.s.userAgent())
  16006. var body io.Reader = nil
  16007. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  16008. if err != nil {
  16009. return nil, err
  16010. }
  16011. reqHeaders.Set("Content-Type", "application/json")
  16012. c.urlParams_.Set("alt", alt)
  16013. c.urlParams_.Set("prettyPrint", "false")
  16014. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  16015. urls += "?" + c.urlParams_.Encode()
  16016. req, err := http.NewRequest("PUT", urls, body)
  16017. if err != nil {
  16018. return nil, err
  16019. }
  16020. req.Header = reqHeaders
  16021. googleapi.Expand(req.URL, map[string]string{
  16022. "profileId": strconv.FormatInt(c.profileId, 10),
  16023. })
  16024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16025. }
  16026. // Do executes the "dfareporting.advertiserGroups.update" call.
  16027. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  16028. // status code is an error. Response headers are in either
  16029. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  16030. // at all) in error.(*googleapi.Error).Header. Use
  16031. // googleapi.IsNotModified to check whether the returned error was
  16032. // because http.StatusNotModified was returned.
  16033. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  16034. gensupport.SetOptions(c.urlParams_, opts...)
  16035. res, err := c.doRequest("json")
  16036. if res != nil && res.StatusCode == http.StatusNotModified {
  16037. if res.Body != nil {
  16038. res.Body.Close()
  16039. }
  16040. return nil, &googleapi.Error{
  16041. Code: res.StatusCode,
  16042. Header: res.Header,
  16043. }
  16044. }
  16045. if err != nil {
  16046. return nil, err
  16047. }
  16048. defer googleapi.CloseBody(res)
  16049. if err := googleapi.CheckResponse(res); err != nil {
  16050. return nil, err
  16051. }
  16052. ret := &AdvertiserGroup{
  16053. ServerResponse: googleapi.ServerResponse{
  16054. Header: res.Header,
  16055. HTTPStatusCode: res.StatusCode,
  16056. },
  16057. }
  16058. target := &ret
  16059. if err := gensupport.DecodeResponse(target, res); err != nil {
  16060. return nil, err
  16061. }
  16062. return ret, nil
  16063. // {
  16064. // "description": "Updates an existing advertiser group.",
  16065. // "httpMethod": "PUT",
  16066. // "id": "dfareporting.advertiserGroups.update",
  16067. // "parameterOrder": [
  16068. // "profileId"
  16069. // ],
  16070. // "parameters": {
  16071. // "profileId": {
  16072. // "description": "User profile ID associated with this request.",
  16073. // "format": "int64",
  16074. // "location": "path",
  16075. // "required": true,
  16076. // "type": "string"
  16077. // }
  16078. // },
  16079. // "path": "userprofiles/{profileId}/advertiserGroups",
  16080. // "request": {
  16081. // "$ref": "AdvertiserGroup"
  16082. // },
  16083. // "response": {
  16084. // "$ref": "AdvertiserGroup"
  16085. // },
  16086. // "scopes": [
  16087. // "https://www.googleapis.com/auth/dfatrafficking"
  16088. // ]
  16089. // }
  16090. }
  16091. // method id "dfareporting.advertiserLandingPages.get":
  16092. type AdvertiserLandingPagesGetCall struct {
  16093. s *Service
  16094. profileId int64
  16095. id int64
  16096. urlParams_ gensupport.URLParams
  16097. ifNoneMatch_ string
  16098. ctx_ context.Context
  16099. header_ http.Header
  16100. }
  16101. // Get: Gets one landing page by ID.
  16102. func (r *AdvertiserLandingPagesService) Get(profileId int64, id int64) *AdvertiserLandingPagesGetCall {
  16103. c := &AdvertiserLandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16104. c.profileId = profileId
  16105. c.id = id
  16106. return c
  16107. }
  16108. // Fields allows partial responses to be retrieved. See
  16109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16110. // for more information.
  16111. func (c *AdvertiserLandingPagesGetCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesGetCall {
  16112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16113. return c
  16114. }
  16115. // IfNoneMatch sets the optional parameter which makes the operation
  16116. // fail if the object's ETag matches the given value. This is useful for
  16117. // getting updates only after the object has changed since the last
  16118. // request. Use googleapi.IsNotModified to check whether the response
  16119. // error from Do is the result of In-None-Match.
  16120. func (c *AdvertiserLandingPagesGetCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesGetCall {
  16121. c.ifNoneMatch_ = entityTag
  16122. return c
  16123. }
  16124. // Context sets the context to be used in this call's Do method. Any
  16125. // pending HTTP request will be aborted if the provided context is
  16126. // canceled.
  16127. func (c *AdvertiserLandingPagesGetCall) Context(ctx context.Context) *AdvertiserLandingPagesGetCall {
  16128. c.ctx_ = ctx
  16129. return c
  16130. }
  16131. // Header returns an http.Header that can be modified by the caller to
  16132. // add HTTP headers to the request.
  16133. func (c *AdvertiserLandingPagesGetCall) Header() http.Header {
  16134. if c.header_ == nil {
  16135. c.header_ = make(http.Header)
  16136. }
  16137. return c.header_
  16138. }
  16139. func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  16140. reqHeaders := make(http.Header)
  16141. for k, v := range c.header_ {
  16142. reqHeaders[k] = v
  16143. }
  16144. reqHeaders.Set("User-Agent", c.s.userAgent())
  16145. if c.ifNoneMatch_ != "" {
  16146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16147. }
  16148. var body io.Reader = nil
  16149. c.urlParams_.Set("alt", alt)
  16150. c.urlParams_.Set("prettyPrint", "false")
  16151. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages/{id}")
  16152. urls += "?" + c.urlParams_.Encode()
  16153. req, err := http.NewRequest("GET", urls, body)
  16154. if err != nil {
  16155. return nil, err
  16156. }
  16157. req.Header = reqHeaders
  16158. googleapi.Expand(req.URL, map[string]string{
  16159. "profileId": strconv.FormatInt(c.profileId, 10),
  16160. "id": strconv.FormatInt(c.id, 10),
  16161. })
  16162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16163. }
  16164. // Do executes the "dfareporting.advertiserLandingPages.get" call.
  16165. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16166. // status code is an error. Response headers are in either
  16167. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16169. // to check whether the returned error was because
  16170. // http.StatusNotModified was returned.
  16171. func (c *AdvertiserLandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16172. gensupport.SetOptions(c.urlParams_, opts...)
  16173. res, err := c.doRequest("json")
  16174. if res != nil && res.StatusCode == http.StatusNotModified {
  16175. if res.Body != nil {
  16176. res.Body.Close()
  16177. }
  16178. return nil, &googleapi.Error{
  16179. Code: res.StatusCode,
  16180. Header: res.Header,
  16181. }
  16182. }
  16183. if err != nil {
  16184. return nil, err
  16185. }
  16186. defer googleapi.CloseBody(res)
  16187. if err := googleapi.CheckResponse(res); err != nil {
  16188. return nil, err
  16189. }
  16190. ret := &LandingPage{
  16191. ServerResponse: googleapi.ServerResponse{
  16192. Header: res.Header,
  16193. HTTPStatusCode: res.StatusCode,
  16194. },
  16195. }
  16196. target := &ret
  16197. if err := gensupport.DecodeResponse(target, res); err != nil {
  16198. return nil, err
  16199. }
  16200. return ret, nil
  16201. // {
  16202. // "description": "Gets one landing page by ID.",
  16203. // "httpMethod": "GET",
  16204. // "id": "dfareporting.advertiserLandingPages.get",
  16205. // "parameterOrder": [
  16206. // "profileId",
  16207. // "id"
  16208. // ],
  16209. // "parameters": {
  16210. // "id": {
  16211. // "description": "Landing page ID.",
  16212. // "format": "int64",
  16213. // "location": "path",
  16214. // "required": true,
  16215. // "type": "string"
  16216. // },
  16217. // "profileId": {
  16218. // "description": "User profile ID associated with this request.",
  16219. // "format": "int64",
  16220. // "location": "path",
  16221. // "required": true,
  16222. // "type": "string"
  16223. // }
  16224. // },
  16225. // "path": "userprofiles/{profileId}/advertiserLandingPages/{id}",
  16226. // "response": {
  16227. // "$ref": "LandingPage"
  16228. // },
  16229. // "scopes": [
  16230. // "https://www.googleapis.com/auth/dfatrafficking"
  16231. // ]
  16232. // }
  16233. }
  16234. // method id "dfareporting.advertiserLandingPages.insert":
  16235. type AdvertiserLandingPagesInsertCall struct {
  16236. s *Service
  16237. profileId int64
  16238. landingpage *LandingPage
  16239. urlParams_ gensupport.URLParams
  16240. ctx_ context.Context
  16241. header_ http.Header
  16242. }
  16243. // Insert: Inserts a new landing page.
  16244. func (r *AdvertiserLandingPagesService) Insert(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesInsertCall {
  16245. c := &AdvertiserLandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16246. c.profileId = profileId
  16247. c.landingpage = landingpage
  16248. return c
  16249. }
  16250. // Fields allows partial responses to be retrieved. See
  16251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16252. // for more information.
  16253. func (c *AdvertiserLandingPagesInsertCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesInsertCall {
  16254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16255. return c
  16256. }
  16257. // Context sets the context to be used in this call's Do method. Any
  16258. // pending HTTP request will be aborted if the provided context is
  16259. // canceled.
  16260. func (c *AdvertiserLandingPagesInsertCall) Context(ctx context.Context) *AdvertiserLandingPagesInsertCall {
  16261. c.ctx_ = ctx
  16262. return c
  16263. }
  16264. // Header returns an http.Header that can be modified by the caller to
  16265. // add HTTP headers to the request.
  16266. func (c *AdvertiserLandingPagesInsertCall) Header() http.Header {
  16267. if c.header_ == nil {
  16268. c.header_ = make(http.Header)
  16269. }
  16270. return c.header_
  16271. }
  16272. func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  16273. reqHeaders := make(http.Header)
  16274. for k, v := range c.header_ {
  16275. reqHeaders[k] = v
  16276. }
  16277. reqHeaders.Set("User-Agent", c.s.userAgent())
  16278. var body io.Reader = nil
  16279. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16280. if err != nil {
  16281. return nil, err
  16282. }
  16283. reqHeaders.Set("Content-Type", "application/json")
  16284. c.urlParams_.Set("alt", alt)
  16285. c.urlParams_.Set("prettyPrint", "false")
  16286. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16287. urls += "?" + c.urlParams_.Encode()
  16288. req, err := http.NewRequest("POST", urls, body)
  16289. if err != nil {
  16290. return nil, err
  16291. }
  16292. req.Header = reqHeaders
  16293. googleapi.Expand(req.URL, map[string]string{
  16294. "profileId": strconv.FormatInt(c.profileId, 10),
  16295. })
  16296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16297. }
  16298. // Do executes the "dfareporting.advertiserLandingPages.insert" call.
  16299. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16300. // status code is an error. Response headers are in either
  16301. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16303. // to check whether the returned error was because
  16304. // http.StatusNotModified was returned.
  16305. func (c *AdvertiserLandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16306. gensupport.SetOptions(c.urlParams_, opts...)
  16307. res, err := c.doRequest("json")
  16308. if res != nil && res.StatusCode == http.StatusNotModified {
  16309. if res.Body != nil {
  16310. res.Body.Close()
  16311. }
  16312. return nil, &googleapi.Error{
  16313. Code: res.StatusCode,
  16314. Header: res.Header,
  16315. }
  16316. }
  16317. if err != nil {
  16318. return nil, err
  16319. }
  16320. defer googleapi.CloseBody(res)
  16321. if err := googleapi.CheckResponse(res); err != nil {
  16322. return nil, err
  16323. }
  16324. ret := &LandingPage{
  16325. ServerResponse: googleapi.ServerResponse{
  16326. Header: res.Header,
  16327. HTTPStatusCode: res.StatusCode,
  16328. },
  16329. }
  16330. target := &ret
  16331. if err := gensupport.DecodeResponse(target, res); err != nil {
  16332. return nil, err
  16333. }
  16334. return ret, nil
  16335. // {
  16336. // "description": "Inserts a new landing page.",
  16337. // "httpMethod": "POST",
  16338. // "id": "dfareporting.advertiserLandingPages.insert",
  16339. // "parameterOrder": [
  16340. // "profileId"
  16341. // ],
  16342. // "parameters": {
  16343. // "profileId": {
  16344. // "description": "User profile ID associated with this request.",
  16345. // "format": "int64",
  16346. // "location": "path",
  16347. // "required": true,
  16348. // "type": "string"
  16349. // }
  16350. // },
  16351. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16352. // "request": {
  16353. // "$ref": "LandingPage"
  16354. // },
  16355. // "response": {
  16356. // "$ref": "LandingPage"
  16357. // },
  16358. // "scopes": [
  16359. // "https://www.googleapis.com/auth/dfatrafficking"
  16360. // ]
  16361. // }
  16362. }
  16363. // method id "dfareporting.advertiserLandingPages.list":
  16364. type AdvertiserLandingPagesListCall struct {
  16365. s *Service
  16366. profileId int64
  16367. urlParams_ gensupport.URLParams
  16368. ifNoneMatch_ string
  16369. ctx_ context.Context
  16370. header_ http.Header
  16371. }
  16372. // List: Retrieves a list of landing pages.
  16373. func (r *AdvertiserLandingPagesService) List(profileId int64) *AdvertiserLandingPagesListCall {
  16374. c := &AdvertiserLandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16375. c.profileId = profileId
  16376. return c
  16377. }
  16378. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  16379. // only landing pages that belong to these advertisers.
  16380. func (c *AdvertiserLandingPagesListCall) AdvertiserIds(advertiserIds ...int64) *AdvertiserLandingPagesListCall {
  16381. var advertiserIds_ []string
  16382. for _, v := range advertiserIds {
  16383. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  16384. }
  16385. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  16386. return c
  16387. }
  16388. // Archived sets the optional parameter "archived": Select only archived
  16389. // landing pages. Don't set this field to select both archived and
  16390. // non-archived landing pages.
  16391. func (c *AdvertiserLandingPagesListCall) Archived(archived bool) *AdvertiserLandingPagesListCall {
  16392. c.urlParams_.Set("archived", fmt.Sprint(archived))
  16393. return c
  16394. }
  16395. // CampaignIds sets the optional parameter "campaignIds": Select only
  16396. // landing pages that are associated with these campaigns.
  16397. func (c *AdvertiserLandingPagesListCall) CampaignIds(campaignIds ...int64) *AdvertiserLandingPagesListCall {
  16398. var campaignIds_ []string
  16399. for _, v := range campaignIds {
  16400. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  16401. }
  16402. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  16403. return c
  16404. }
  16405. // Ids sets the optional parameter "ids": Select only landing pages with
  16406. // these IDs.
  16407. func (c *AdvertiserLandingPagesListCall) Ids(ids ...int64) *AdvertiserLandingPagesListCall {
  16408. var ids_ []string
  16409. for _, v := range ids {
  16410. ids_ = append(ids_, fmt.Sprint(v))
  16411. }
  16412. c.urlParams_.SetMulti("ids", ids_)
  16413. return c
  16414. }
  16415. // MaxResults sets the optional parameter "maxResults": Maximum number
  16416. // of results to return.
  16417. func (c *AdvertiserLandingPagesListCall) MaxResults(maxResults int64) *AdvertiserLandingPagesListCall {
  16418. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16419. return c
  16420. }
  16421. // PageToken sets the optional parameter "pageToken": Value of the
  16422. // nextPageToken from the previous result page.
  16423. func (c *AdvertiserLandingPagesListCall) PageToken(pageToken string) *AdvertiserLandingPagesListCall {
  16424. c.urlParams_.Set("pageToken", pageToken)
  16425. return c
  16426. }
  16427. // SearchString sets the optional parameter "searchString": Allows
  16428. // searching for landing pages by name or ID. Wildcards (*) are allowed.
  16429. // For example, "landingpage*2017" will return landing pages with names
  16430. // like "landingpage July 2017", "landingpage March 2017", or simply
  16431. // "landingpage 2017". Most of the searches also add wildcards
  16432. // implicitly at the start and the end of the search string. For
  16433. // example, a search string of "landingpage" will match campaigns with
  16434. // name "my landingpage", "landingpage 2015", or simply "landingpage".
  16435. func (c *AdvertiserLandingPagesListCall) SearchString(searchString string) *AdvertiserLandingPagesListCall {
  16436. c.urlParams_.Set("searchString", searchString)
  16437. return c
  16438. }
  16439. // SortField sets the optional parameter "sortField": Field by which to
  16440. // sort the list.
  16441. //
  16442. // Possible values:
  16443. // "ID" (default)
  16444. // "NAME"
  16445. func (c *AdvertiserLandingPagesListCall) SortField(sortField string) *AdvertiserLandingPagesListCall {
  16446. c.urlParams_.Set("sortField", sortField)
  16447. return c
  16448. }
  16449. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16450. // results.
  16451. //
  16452. // Possible values:
  16453. // "ASCENDING" (default)
  16454. // "DESCENDING"
  16455. func (c *AdvertiserLandingPagesListCall) SortOrder(sortOrder string) *AdvertiserLandingPagesListCall {
  16456. c.urlParams_.Set("sortOrder", sortOrder)
  16457. return c
  16458. }
  16459. // SubaccountId sets the optional parameter "subaccountId": Select only
  16460. // landing pages that belong to this subaccount.
  16461. func (c *AdvertiserLandingPagesListCall) SubaccountId(subaccountId int64) *AdvertiserLandingPagesListCall {
  16462. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16463. return c
  16464. }
  16465. // Fields allows partial responses to be retrieved. See
  16466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16467. // for more information.
  16468. func (c *AdvertiserLandingPagesListCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesListCall {
  16469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16470. return c
  16471. }
  16472. // IfNoneMatch sets the optional parameter which makes the operation
  16473. // fail if the object's ETag matches the given value. This is useful for
  16474. // getting updates only after the object has changed since the last
  16475. // request. Use googleapi.IsNotModified to check whether the response
  16476. // error from Do is the result of In-None-Match.
  16477. func (c *AdvertiserLandingPagesListCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesListCall {
  16478. c.ifNoneMatch_ = entityTag
  16479. return c
  16480. }
  16481. // Context sets the context to be used in this call's Do method. Any
  16482. // pending HTTP request will be aborted if the provided context is
  16483. // canceled.
  16484. func (c *AdvertiserLandingPagesListCall) Context(ctx context.Context) *AdvertiserLandingPagesListCall {
  16485. c.ctx_ = ctx
  16486. return c
  16487. }
  16488. // Header returns an http.Header that can be modified by the caller to
  16489. // add HTTP headers to the request.
  16490. func (c *AdvertiserLandingPagesListCall) Header() http.Header {
  16491. if c.header_ == nil {
  16492. c.header_ = make(http.Header)
  16493. }
  16494. return c.header_
  16495. }
  16496. func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  16497. reqHeaders := make(http.Header)
  16498. for k, v := range c.header_ {
  16499. reqHeaders[k] = v
  16500. }
  16501. reqHeaders.Set("User-Agent", c.s.userAgent())
  16502. if c.ifNoneMatch_ != "" {
  16503. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16504. }
  16505. var body io.Reader = nil
  16506. c.urlParams_.Set("alt", alt)
  16507. c.urlParams_.Set("prettyPrint", "false")
  16508. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16509. urls += "?" + c.urlParams_.Encode()
  16510. req, err := http.NewRequest("GET", urls, body)
  16511. if err != nil {
  16512. return nil, err
  16513. }
  16514. req.Header = reqHeaders
  16515. googleapi.Expand(req.URL, map[string]string{
  16516. "profileId": strconv.FormatInt(c.profileId, 10),
  16517. })
  16518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16519. }
  16520. // Do executes the "dfareporting.advertiserLandingPages.list" call.
  16521. // Exactly one of *AdvertiserLandingPagesListResponse or error will be
  16522. // non-nil. Any non-2xx status code is an error. Response headers are in
  16523. // either *AdvertiserLandingPagesListResponse.ServerResponse.Header or
  16524. // (if a response was returned at all) in
  16525. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16526. // whether the returned error was because http.StatusNotModified was
  16527. // returned.
  16528. func (c *AdvertiserLandingPagesListCall) Do(opts ...googleapi.CallOption) (*AdvertiserLandingPagesListResponse, error) {
  16529. gensupport.SetOptions(c.urlParams_, opts...)
  16530. res, err := c.doRequest("json")
  16531. if res != nil && res.StatusCode == http.StatusNotModified {
  16532. if res.Body != nil {
  16533. res.Body.Close()
  16534. }
  16535. return nil, &googleapi.Error{
  16536. Code: res.StatusCode,
  16537. Header: res.Header,
  16538. }
  16539. }
  16540. if err != nil {
  16541. return nil, err
  16542. }
  16543. defer googleapi.CloseBody(res)
  16544. if err := googleapi.CheckResponse(res); err != nil {
  16545. return nil, err
  16546. }
  16547. ret := &AdvertiserLandingPagesListResponse{
  16548. ServerResponse: googleapi.ServerResponse{
  16549. Header: res.Header,
  16550. HTTPStatusCode: res.StatusCode,
  16551. },
  16552. }
  16553. target := &ret
  16554. if err := gensupport.DecodeResponse(target, res); err != nil {
  16555. return nil, err
  16556. }
  16557. return ret, nil
  16558. // {
  16559. // "description": "Retrieves a list of landing pages.",
  16560. // "httpMethod": "GET",
  16561. // "id": "dfareporting.advertiserLandingPages.list",
  16562. // "parameterOrder": [
  16563. // "profileId"
  16564. // ],
  16565. // "parameters": {
  16566. // "advertiserIds": {
  16567. // "description": "Select only landing pages that belong to these advertisers.",
  16568. // "format": "int64",
  16569. // "location": "query",
  16570. // "repeated": true,
  16571. // "type": "string"
  16572. // },
  16573. // "archived": {
  16574. // "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.",
  16575. // "location": "query",
  16576. // "type": "boolean"
  16577. // },
  16578. // "campaignIds": {
  16579. // "description": "Select only landing pages that are associated with these campaigns.",
  16580. // "format": "int64",
  16581. // "location": "query",
  16582. // "repeated": true,
  16583. // "type": "string"
  16584. // },
  16585. // "ids": {
  16586. // "description": "Select only landing pages with these IDs.",
  16587. // "format": "int64",
  16588. // "location": "query",
  16589. // "repeated": true,
  16590. // "type": "string"
  16591. // },
  16592. // "maxResults": {
  16593. // "default": "1000",
  16594. // "description": "Maximum number of results to return.",
  16595. // "format": "int32",
  16596. // "location": "query",
  16597. // "maximum": "1000",
  16598. // "minimum": "0",
  16599. // "type": "integer"
  16600. // },
  16601. // "pageToken": {
  16602. // "description": "Value of the nextPageToken from the previous result page.",
  16603. // "location": "query",
  16604. // "type": "string"
  16605. // },
  16606. // "profileId": {
  16607. // "description": "User profile ID associated with this request.",
  16608. // "format": "int64",
  16609. // "location": "path",
  16610. // "required": true,
  16611. // "type": "string"
  16612. // },
  16613. // "searchString": {
  16614. // "description": "Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, \"landingpage*2017\" will return landing pages with names like \"landingpage July 2017\", \"landingpage March 2017\", or simply \"landingpage 2017\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"landingpage\" will match campaigns with name \"my landingpage\", \"landingpage 2015\", or simply \"landingpage\".",
  16615. // "location": "query",
  16616. // "type": "string"
  16617. // },
  16618. // "sortField": {
  16619. // "default": "ID",
  16620. // "description": "Field by which to sort the list.",
  16621. // "enum": [
  16622. // "ID",
  16623. // "NAME"
  16624. // ],
  16625. // "enumDescriptions": [
  16626. // "",
  16627. // ""
  16628. // ],
  16629. // "location": "query",
  16630. // "type": "string"
  16631. // },
  16632. // "sortOrder": {
  16633. // "default": "ASCENDING",
  16634. // "description": "Order of sorted results.",
  16635. // "enum": [
  16636. // "ASCENDING",
  16637. // "DESCENDING"
  16638. // ],
  16639. // "enumDescriptions": [
  16640. // "",
  16641. // ""
  16642. // ],
  16643. // "location": "query",
  16644. // "type": "string"
  16645. // },
  16646. // "subaccountId": {
  16647. // "description": "Select only landing pages that belong to this subaccount.",
  16648. // "format": "int64",
  16649. // "location": "query",
  16650. // "type": "string"
  16651. // }
  16652. // },
  16653. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16654. // "response": {
  16655. // "$ref": "AdvertiserLandingPagesListResponse"
  16656. // },
  16657. // "scopes": [
  16658. // "https://www.googleapis.com/auth/dfatrafficking"
  16659. // ]
  16660. // }
  16661. }
  16662. // Pages invokes f for each page of results.
  16663. // A non-nil error returned from f will halt the iteration.
  16664. // The provided context supersedes any context provided to the Context method.
  16665. func (c *AdvertiserLandingPagesListCall) Pages(ctx context.Context, f func(*AdvertiserLandingPagesListResponse) error) error {
  16666. c.ctx_ = ctx
  16667. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16668. for {
  16669. x, err := c.Do()
  16670. if err != nil {
  16671. return err
  16672. }
  16673. if err := f(x); err != nil {
  16674. return err
  16675. }
  16676. if x.NextPageToken == "" {
  16677. return nil
  16678. }
  16679. c.PageToken(x.NextPageToken)
  16680. }
  16681. }
  16682. // method id "dfareporting.advertiserLandingPages.patch":
  16683. type AdvertiserLandingPagesPatchCall struct {
  16684. s *Service
  16685. profileId int64
  16686. landingpage *LandingPage
  16687. urlParams_ gensupport.URLParams
  16688. ctx_ context.Context
  16689. header_ http.Header
  16690. }
  16691. // Patch: Updates an existing landing page. This method supports patch
  16692. // semantics.
  16693. func (r *AdvertiserLandingPagesService) Patch(profileId int64, id int64, landingpage *LandingPage) *AdvertiserLandingPagesPatchCall {
  16694. c := &AdvertiserLandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16695. c.profileId = profileId
  16696. c.urlParams_.Set("id", fmt.Sprint(id))
  16697. c.landingpage = landingpage
  16698. return c
  16699. }
  16700. // Fields allows partial responses to be retrieved. See
  16701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16702. // for more information.
  16703. func (c *AdvertiserLandingPagesPatchCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesPatchCall {
  16704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16705. return c
  16706. }
  16707. // Context sets the context to be used in this call's Do method. Any
  16708. // pending HTTP request will be aborted if the provided context is
  16709. // canceled.
  16710. func (c *AdvertiserLandingPagesPatchCall) Context(ctx context.Context) *AdvertiserLandingPagesPatchCall {
  16711. c.ctx_ = ctx
  16712. return c
  16713. }
  16714. // Header returns an http.Header that can be modified by the caller to
  16715. // add HTTP headers to the request.
  16716. func (c *AdvertiserLandingPagesPatchCall) Header() http.Header {
  16717. if c.header_ == nil {
  16718. c.header_ = make(http.Header)
  16719. }
  16720. return c.header_
  16721. }
  16722. func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  16723. reqHeaders := make(http.Header)
  16724. for k, v := range c.header_ {
  16725. reqHeaders[k] = v
  16726. }
  16727. reqHeaders.Set("User-Agent", c.s.userAgent())
  16728. var body io.Reader = nil
  16729. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16730. if err != nil {
  16731. return nil, err
  16732. }
  16733. reqHeaders.Set("Content-Type", "application/json")
  16734. c.urlParams_.Set("alt", alt)
  16735. c.urlParams_.Set("prettyPrint", "false")
  16736. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16737. urls += "?" + c.urlParams_.Encode()
  16738. req, err := http.NewRequest("PATCH", urls, body)
  16739. if err != nil {
  16740. return nil, err
  16741. }
  16742. req.Header = reqHeaders
  16743. googleapi.Expand(req.URL, map[string]string{
  16744. "profileId": strconv.FormatInt(c.profileId, 10),
  16745. })
  16746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16747. }
  16748. // Do executes the "dfareporting.advertiserLandingPages.patch" call.
  16749. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16750. // status code is an error. Response headers are in either
  16751. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16753. // to check whether the returned error was because
  16754. // http.StatusNotModified was returned.
  16755. func (c *AdvertiserLandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16756. gensupport.SetOptions(c.urlParams_, opts...)
  16757. res, err := c.doRequest("json")
  16758. if res != nil && res.StatusCode == http.StatusNotModified {
  16759. if res.Body != nil {
  16760. res.Body.Close()
  16761. }
  16762. return nil, &googleapi.Error{
  16763. Code: res.StatusCode,
  16764. Header: res.Header,
  16765. }
  16766. }
  16767. if err != nil {
  16768. return nil, err
  16769. }
  16770. defer googleapi.CloseBody(res)
  16771. if err := googleapi.CheckResponse(res); err != nil {
  16772. return nil, err
  16773. }
  16774. ret := &LandingPage{
  16775. ServerResponse: googleapi.ServerResponse{
  16776. Header: res.Header,
  16777. HTTPStatusCode: res.StatusCode,
  16778. },
  16779. }
  16780. target := &ret
  16781. if err := gensupport.DecodeResponse(target, res); err != nil {
  16782. return nil, err
  16783. }
  16784. return ret, nil
  16785. // {
  16786. // "description": "Updates an existing landing page. This method supports patch semantics.",
  16787. // "httpMethod": "PATCH",
  16788. // "id": "dfareporting.advertiserLandingPages.patch",
  16789. // "parameterOrder": [
  16790. // "profileId",
  16791. // "id"
  16792. // ],
  16793. // "parameters": {
  16794. // "id": {
  16795. // "description": "Landing page ID.",
  16796. // "format": "int64",
  16797. // "location": "query",
  16798. // "required": true,
  16799. // "type": "string"
  16800. // },
  16801. // "profileId": {
  16802. // "description": "User profile ID associated with this request.",
  16803. // "format": "int64",
  16804. // "location": "path",
  16805. // "required": true,
  16806. // "type": "string"
  16807. // }
  16808. // },
  16809. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16810. // "request": {
  16811. // "$ref": "LandingPage"
  16812. // },
  16813. // "response": {
  16814. // "$ref": "LandingPage"
  16815. // },
  16816. // "scopes": [
  16817. // "https://www.googleapis.com/auth/dfatrafficking"
  16818. // ]
  16819. // }
  16820. }
  16821. // method id "dfareporting.advertiserLandingPages.update":
  16822. type AdvertiserLandingPagesUpdateCall struct {
  16823. s *Service
  16824. profileId int64
  16825. landingpage *LandingPage
  16826. urlParams_ gensupport.URLParams
  16827. ctx_ context.Context
  16828. header_ http.Header
  16829. }
  16830. // Update: Updates an existing landing page.
  16831. func (r *AdvertiserLandingPagesService) Update(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesUpdateCall {
  16832. c := &AdvertiserLandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16833. c.profileId = profileId
  16834. c.landingpage = landingpage
  16835. return c
  16836. }
  16837. // Fields allows partial responses to be retrieved. See
  16838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16839. // for more information.
  16840. func (c *AdvertiserLandingPagesUpdateCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesUpdateCall {
  16841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16842. return c
  16843. }
  16844. // Context sets the context to be used in this call's Do method. Any
  16845. // pending HTTP request will be aborted if the provided context is
  16846. // canceled.
  16847. func (c *AdvertiserLandingPagesUpdateCall) Context(ctx context.Context) *AdvertiserLandingPagesUpdateCall {
  16848. c.ctx_ = ctx
  16849. return c
  16850. }
  16851. // Header returns an http.Header that can be modified by the caller to
  16852. // add HTTP headers to the request.
  16853. func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header {
  16854. if c.header_ == nil {
  16855. c.header_ = make(http.Header)
  16856. }
  16857. return c.header_
  16858. }
  16859. func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16860. reqHeaders := make(http.Header)
  16861. for k, v := range c.header_ {
  16862. reqHeaders[k] = v
  16863. }
  16864. reqHeaders.Set("User-Agent", c.s.userAgent())
  16865. var body io.Reader = nil
  16866. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16867. if err != nil {
  16868. return nil, err
  16869. }
  16870. reqHeaders.Set("Content-Type", "application/json")
  16871. c.urlParams_.Set("alt", alt)
  16872. c.urlParams_.Set("prettyPrint", "false")
  16873. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16874. urls += "?" + c.urlParams_.Encode()
  16875. req, err := http.NewRequest("PUT", urls, body)
  16876. if err != nil {
  16877. return nil, err
  16878. }
  16879. req.Header = reqHeaders
  16880. googleapi.Expand(req.URL, map[string]string{
  16881. "profileId": strconv.FormatInt(c.profileId, 10),
  16882. })
  16883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16884. }
  16885. // Do executes the "dfareporting.advertiserLandingPages.update" call.
  16886. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16887. // status code is an error. Response headers are in either
  16888. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16889. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16890. // to check whether the returned error was because
  16891. // http.StatusNotModified was returned.
  16892. func (c *AdvertiserLandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16893. gensupport.SetOptions(c.urlParams_, opts...)
  16894. res, err := c.doRequest("json")
  16895. if res != nil && res.StatusCode == http.StatusNotModified {
  16896. if res.Body != nil {
  16897. res.Body.Close()
  16898. }
  16899. return nil, &googleapi.Error{
  16900. Code: res.StatusCode,
  16901. Header: res.Header,
  16902. }
  16903. }
  16904. if err != nil {
  16905. return nil, err
  16906. }
  16907. defer googleapi.CloseBody(res)
  16908. if err := googleapi.CheckResponse(res); err != nil {
  16909. return nil, err
  16910. }
  16911. ret := &LandingPage{
  16912. ServerResponse: googleapi.ServerResponse{
  16913. Header: res.Header,
  16914. HTTPStatusCode: res.StatusCode,
  16915. },
  16916. }
  16917. target := &ret
  16918. if err := gensupport.DecodeResponse(target, res); err != nil {
  16919. return nil, err
  16920. }
  16921. return ret, nil
  16922. // {
  16923. // "description": "Updates an existing landing page.",
  16924. // "httpMethod": "PUT",
  16925. // "id": "dfareporting.advertiserLandingPages.update",
  16926. // "parameterOrder": [
  16927. // "profileId"
  16928. // ],
  16929. // "parameters": {
  16930. // "profileId": {
  16931. // "description": "User profile ID associated with this request.",
  16932. // "format": "int64",
  16933. // "location": "path",
  16934. // "required": true,
  16935. // "type": "string"
  16936. // }
  16937. // },
  16938. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16939. // "request": {
  16940. // "$ref": "LandingPage"
  16941. // },
  16942. // "response": {
  16943. // "$ref": "LandingPage"
  16944. // },
  16945. // "scopes": [
  16946. // "https://www.googleapis.com/auth/dfatrafficking"
  16947. // ]
  16948. // }
  16949. }
  16950. // method id "dfareporting.advertisers.get":
  16951. type AdvertisersGetCall struct {
  16952. s *Service
  16953. profileId int64
  16954. id int64
  16955. urlParams_ gensupport.URLParams
  16956. ifNoneMatch_ string
  16957. ctx_ context.Context
  16958. header_ http.Header
  16959. }
  16960. // Get: Gets one advertiser by ID.
  16961. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  16962. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16963. c.profileId = profileId
  16964. c.id = id
  16965. return c
  16966. }
  16967. // Fields allows partial responses to be retrieved. See
  16968. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16969. // for more information.
  16970. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  16971. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16972. return c
  16973. }
  16974. // IfNoneMatch sets the optional parameter which makes the operation
  16975. // fail if the object's ETag matches the given value. This is useful for
  16976. // getting updates only after the object has changed since the last
  16977. // request. Use googleapi.IsNotModified to check whether the response
  16978. // error from Do is the result of In-None-Match.
  16979. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  16980. c.ifNoneMatch_ = entityTag
  16981. return c
  16982. }
  16983. // Context sets the context to be used in this call's Do method. Any
  16984. // pending HTTP request will be aborted if the provided context is
  16985. // canceled.
  16986. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  16987. c.ctx_ = ctx
  16988. return c
  16989. }
  16990. // Header returns an http.Header that can be modified by the caller to
  16991. // add HTTP headers to the request.
  16992. func (c *AdvertisersGetCall) Header() http.Header {
  16993. if c.header_ == nil {
  16994. c.header_ = make(http.Header)
  16995. }
  16996. return c.header_
  16997. }
  16998. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  16999. reqHeaders := make(http.Header)
  17000. for k, v := range c.header_ {
  17001. reqHeaders[k] = v
  17002. }
  17003. reqHeaders.Set("User-Agent", c.s.userAgent())
  17004. if c.ifNoneMatch_ != "" {
  17005. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17006. }
  17007. var body io.Reader = nil
  17008. c.urlParams_.Set("alt", alt)
  17009. c.urlParams_.Set("prettyPrint", "false")
  17010. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  17011. urls += "?" + c.urlParams_.Encode()
  17012. req, err := http.NewRequest("GET", urls, body)
  17013. if err != nil {
  17014. return nil, err
  17015. }
  17016. req.Header = reqHeaders
  17017. googleapi.Expand(req.URL, map[string]string{
  17018. "profileId": strconv.FormatInt(c.profileId, 10),
  17019. "id": strconv.FormatInt(c.id, 10),
  17020. })
  17021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17022. }
  17023. // Do executes the "dfareporting.advertisers.get" call.
  17024. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17025. // status code is an error. Response headers are in either
  17026. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17027. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17028. // to check whether the returned error was because
  17029. // http.StatusNotModified was returned.
  17030. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17031. gensupport.SetOptions(c.urlParams_, opts...)
  17032. res, err := c.doRequest("json")
  17033. if res != nil && res.StatusCode == http.StatusNotModified {
  17034. if res.Body != nil {
  17035. res.Body.Close()
  17036. }
  17037. return nil, &googleapi.Error{
  17038. Code: res.StatusCode,
  17039. Header: res.Header,
  17040. }
  17041. }
  17042. if err != nil {
  17043. return nil, err
  17044. }
  17045. defer googleapi.CloseBody(res)
  17046. if err := googleapi.CheckResponse(res); err != nil {
  17047. return nil, err
  17048. }
  17049. ret := &Advertiser{
  17050. ServerResponse: googleapi.ServerResponse{
  17051. Header: res.Header,
  17052. HTTPStatusCode: res.StatusCode,
  17053. },
  17054. }
  17055. target := &ret
  17056. if err := gensupport.DecodeResponse(target, res); err != nil {
  17057. return nil, err
  17058. }
  17059. return ret, nil
  17060. // {
  17061. // "description": "Gets one advertiser by ID.",
  17062. // "httpMethod": "GET",
  17063. // "id": "dfareporting.advertisers.get",
  17064. // "parameterOrder": [
  17065. // "profileId",
  17066. // "id"
  17067. // ],
  17068. // "parameters": {
  17069. // "id": {
  17070. // "description": "Advertiser ID.",
  17071. // "format": "int64",
  17072. // "location": "path",
  17073. // "required": true,
  17074. // "type": "string"
  17075. // },
  17076. // "profileId": {
  17077. // "description": "User profile ID associated with this request.",
  17078. // "format": "int64",
  17079. // "location": "path",
  17080. // "required": true,
  17081. // "type": "string"
  17082. // }
  17083. // },
  17084. // "path": "userprofiles/{profileId}/advertisers/{id}",
  17085. // "response": {
  17086. // "$ref": "Advertiser"
  17087. // },
  17088. // "scopes": [
  17089. // "https://www.googleapis.com/auth/dfatrafficking"
  17090. // ]
  17091. // }
  17092. }
  17093. // method id "dfareporting.advertisers.insert":
  17094. type AdvertisersInsertCall struct {
  17095. s *Service
  17096. profileId int64
  17097. advertiser *Advertiser
  17098. urlParams_ gensupport.URLParams
  17099. ctx_ context.Context
  17100. header_ http.Header
  17101. }
  17102. // Insert: Inserts a new advertiser.
  17103. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  17104. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17105. c.profileId = profileId
  17106. c.advertiser = advertiser
  17107. return c
  17108. }
  17109. // Fields allows partial responses to be retrieved. See
  17110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17111. // for more information.
  17112. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  17113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17114. return c
  17115. }
  17116. // Context sets the context to be used in this call's Do method. Any
  17117. // pending HTTP request will be aborted if the provided context is
  17118. // canceled.
  17119. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  17120. c.ctx_ = ctx
  17121. return c
  17122. }
  17123. // Header returns an http.Header that can be modified by the caller to
  17124. // add HTTP headers to the request.
  17125. func (c *AdvertisersInsertCall) Header() http.Header {
  17126. if c.header_ == nil {
  17127. c.header_ = make(http.Header)
  17128. }
  17129. return c.header_
  17130. }
  17131. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  17132. reqHeaders := make(http.Header)
  17133. for k, v := range c.header_ {
  17134. reqHeaders[k] = v
  17135. }
  17136. reqHeaders.Set("User-Agent", c.s.userAgent())
  17137. var body io.Reader = nil
  17138. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17139. if err != nil {
  17140. return nil, err
  17141. }
  17142. reqHeaders.Set("Content-Type", "application/json")
  17143. c.urlParams_.Set("alt", alt)
  17144. c.urlParams_.Set("prettyPrint", "false")
  17145. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17146. urls += "?" + c.urlParams_.Encode()
  17147. req, err := http.NewRequest("POST", urls, body)
  17148. if err != nil {
  17149. return nil, err
  17150. }
  17151. req.Header = reqHeaders
  17152. googleapi.Expand(req.URL, map[string]string{
  17153. "profileId": strconv.FormatInt(c.profileId, 10),
  17154. })
  17155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17156. }
  17157. // Do executes the "dfareporting.advertisers.insert" call.
  17158. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17159. // status code is an error. Response headers are in either
  17160. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17162. // to check whether the returned error was because
  17163. // http.StatusNotModified was returned.
  17164. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17165. gensupport.SetOptions(c.urlParams_, opts...)
  17166. res, err := c.doRequest("json")
  17167. if res != nil && res.StatusCode == http.StatusNotModified {
  17168. if res.Body != nil {
  17169. res.Body.Close()
  17170. }
  17171. return nil, &googleapi.Error{
  17172. Code: res.StatusCode,
  17173. Header: res.Header,
  17174. }
  17175. }
  17176. if err != nil {
  17177. return nil, err
  17178. }
  17179. defer googleapi.CloseBody(res)
  17180. if err := googleapi.CheckResponse(res); err != nil {
  17181. return nil, err
  17182. }
  17183. ret := &Advertiser{
  17184. ServerResponse: googleapi.ServerResponse{
  17185. Header: res.Header,
  17186. HTTPStatusCode: res.StatusCode,
  17187. },
  17188. }
  17189. target := &ret
  17190. if err := gensupport.DecodeResponse(target, res); err != nil {
  17191. return nil, err
  17192. }
  17193. return ret, nil
  17194. // {
  17195. // "description": "Inserts a new advertiser.",
  17196. // "httpMethod": "POST",
  17197. // "id": "dfareporting.advertisers.insert",
  17198. // "parameterOrder": [
  17199. // "profileId"
  17200. // ],
  17201. // "parameters": {
  17202. // "profileId": {
  17203. // "description": "User profile ID associated with this request.",
  17204. // "format": "int64",
  17205. // "location": "path",
  17206. // "required": true,
  17207. // "type": "string"
  17208. // }
  17209. // },
  17210. // "path": "userprofiles/{profileId}/advertisers",
  17211. // "request": {
  17212. // "$ref": "Advertiser"
  17213. // },
  17214. // "response": {
  17215. // "$ref": "Advertiser"
  17216. // },
  17217. // "scopes": [
  17218. // "https://www.googleapis.com/auth/dfatrafficking"
  17219. // ]
  17220. // }
  17221. }
  17222. // method id "dfareporting.advertisers.list":
  17223. type AdvertisersListCall struct {
  17224. s *Service
  17225. profileId int64
  17226. urlParams_ gensupport.URLParams
  17227. ifNoneMatch_ string
  17228. ctx_ context.Context
  17229. header_ http.Header
  17230. }
  17231. // List: Retrieves a list of advertisers, possibly filtered. This method
  17232. // supports paging.
  17233. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  17234. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17235. c.profileId = profileId
  17236. return c
  17237. }
  17238. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17239. // Select only advertisers with these advertiser group IDs.
  17240. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  17241. var advertiserGroupIds_ []string
  17242. for _, v := range advertiserGroupIds {
  17243. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17244. }
  17245. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17246. return c
  17247. }
  17248. // FloodlightConfigurationIds sets the optional parameter
  17249. // "floodlightConfigurationIds": Select only advertisers with these
  17250. // floodlight configuration IDs.
  17251. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  17252. var floodlightConfigurationIds_ []string
  17253. for _, v := range floodlightConfigurationIds {
  17254. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  17255. }
  17256. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  17257. return c
  17258. }
  17259. // Ids sets the optional parameter "ids": Select only advertisers with
  17260. // these IDs.
  17261. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  17262. var ids_ []string
  17263. for _, v := range ids {
  17264. ids_ = append(ids_, fmt.Sprint(v))
  17265. }
  17266. c.urlParams_.SetMulti("ids", ids_)
  17267. return c
  17268. }
  17269. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  17270. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  17271. // do not belong to any advertiser group.
  17272. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  17273. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  17274. return c
  17275. }
  17276. // MaxResults sets the optional parameter "maxResults": Maximum number
  17277. // of results to return.
  17278. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  17279. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17280. return c
  17281. }
  17282. // OnlyParent sets the optional parameter "onlyParent": Select only
  17283. // advertisers which use another advertiser's floodlight configuration.
  17284. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  17285. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  17286. return c
  17287. }
  17288. // PageToken sets the optional parameter "pageToken": Value of the
  17289. // nextPageToken from the previous result page.
  17290. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  17291. c.urlParams_.Set("pageToken", pageToken)
  17292. return c
  17293. }
  17294. // SearchString sets the optional parameter "searchString": Allows
  17295. // searching for objects by name or ID. Wildcards (*) are allowed. For
  17296. // example, "advertiser*2015" will return objects with names like
  17297. // "advertiser June 2015", "advertiser April 2015", or simply
  17298. // "advertiser 2015". Most of the searches also add wildcards implicitly
  17299. // at the start and the end of the search string. For example, a search
  17300. // string of "advertiser" will match objects with name "my advertiser",
  17301. // "advertiser 2015", or simply "advertiser".
  17302. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  17303. c.urlParams_.Set("searchString", searchString)
  17304. return c
  17305. }
  17306. // SortField sets the optional parameter "sortField": Field by which to
  17307. // sort the list.
  17308. //
  17309. // Possible values:
  17310. // "ID" (default)
  17311. // "NAME"
  17312. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  17313. c.urlParams_.Set("sortField", sortField)
  17314. return c
  17315. }
  17316. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17317. // results.
  17318. //
  17319. // Possible values:
  17320. // "ASCENDING" (default)
  17321. // "DESCENDING"
  17322. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  17323. c.urlParams_.Set("sortOrder", sortOrder)
  17324. return c
  17325. }
  17326. // Status sets the optional parameter "status": Select only advertisers
  17327. // with the specified status.
  17328. //
  17329. // Possible values:
  17330. // "APPROVED"
  17331. // "ON_HOLD"
  17332. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  17333. c.urlParams_.Set("status", status)
  17334. return c
  17335. }
  17336. // SubaccountId sets the optional parameter "subaccountId": Select only
  17337. // advertisers with these subaccount IDs.
  17338. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  17339. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17340. return c
  17341. }
  17342. // Fields allows partial responses to be retrieved. See
  17343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17344. // for more information.
  17345. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  17346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17347. return c
  17348. }
  17349. // IfNoneMatch sets the optional parameter which makes the operation
  17350. // fail if the object's ETag matches the given value. This is useful for
  17351. // getting updates only after the object has changed since the last
  17352. // request. Use googleapi.IsNotModified to check whether the response
  17353. // error from Do is the result of In-None-Match.
  17354. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  17355. c.ifNoneMatch_ = entityTag
  17356. return c
  17357. }
  17358. // Context sets the context to be used in this call's Do method. Any
  17359. // pending HTTP request will be aborted if the provided context is
  17360. // canceled.
  17361. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  17362. c.ctx_ = ctx
  17363. return c
  17364. }
  17365. // Header returns an http.Header that can be modified by the caller to
  17366. // add HTTP headers to the request.
  17367. func (c *AdvertisersListCall) Header() http.Header {
  17368. if c.header_ == nil {
  17369. c.header_ = make(http.Header)
  17370. }
  17371. return c.header_
  17372. }
  17373. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  17374. reqHeaders := make(http.Header)
  17375. for k, v := range c.header_ {
  17376. reqHeaders[k] = v
  17377. }
  17378. reqHeaders.Set("User-Agent", c.s.userAgent())
  17379. if c.ifNoneMatch_ != "" {
  17380. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17381. }
  17382. var body io.Reader = nil
  17383. c.urlParams_.Set("alt", alt)
  17384. c.urlParams_.Set("prettyPrint", "false")
  17385. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17386. urls += "?" + c.urlParams_.Encode()
  17387. req, err := http.NewRequest("GET", urls, body)
  17388. if err != nil {
  17389. return nil, err
  17390. }
  17391. req.Header = reqHeaders
  17392. googleapi.Expand(req.URL, map[string]string{
  17393. "profileId": strconv.FormatInt(c.profileId, 10),
  17394. })
  17395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17396. }
  17397. // Do executes the "dfareporting.advertisers.list" call.
  17398. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  17399. // non-2xx status code is an error. Response headers are in either
  17400. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  17401. // returned at all) in error.(*googleapi.Error).Header. Use
  17402. // googleapi.IsNotModified to check whether the returned error was
  17403. // because http.StatusNotModified was returned.
  17404. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  17405. gensupport.SetOptions(c.urlParams_, opts...)
  17406. res, err := c.doRequest("json")
  17407. if res != nil && res.StatusCode == http.StatusNotModified {
  17408. if res.Body != nil {
  17409. res.Body.Close()
  17410. }
  17411. return nil, &googleapi.Error{
  17412. Code: res.StatusCode,
  17413. Header: res.Header,
  17414. }
  17415. }
  17416. if err != nil {
  17417. return nil, err
  17418. }
  17419. defer googleapi.CloseBody(res)
  17420. if err := googleapi.CheckResponse(res); err != nil {
  17421. return nil, err
  17422. }
  17423. ret := &AdvertisersListResponse{
  17424. ServerResponse: googleapi.ServerResponse{
  17425. Header: res.Header,
  17426. HTTPStatusCode: res.StatusCode,
  17427. },
  17428. }
  17429. target := &ret
  17430. if err := gensupport.DecodeResponse(target, res); err != nil {
  17431. return nil, err
  17432. }
  17433. return ret, nil
  17434. // {
  17435. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  17436. // "httpMethod": "GET",
  17437. // "id": "dfareporting.advertisers.list",
  17438. // "parameterOrder": [
  17439. // "profileId"
  17440. // ],
  17441. // "parameters": {
  17442. // "advertiserGroupIds": {
  17443. // "description": "Select only advertisers with these advertiser group IDs.",
  17444. // "format": "int64",
  17445. // "location": "query",
  17446. // "repeated": true,
  17447. // "type": "string"
  17448. // },
  17449. // "floodlightConfigurationIds": {
  17450. // "description": "Select only advertisers with these floodlight configuration IDs.",
  17451. // "format": "int64",
  17452. // "location": "query",
  17453. // "repeated": true,
  17454. // "type": "string"
  17455. // },
  17456. // "ids": {
  17457. // "description": "Select only advertisers with these IDs.",
  17458. // "format": "int64",
  17459. // "location": "query",
  17460. // "repeated": true,
  17461. // "type": "string"
  17462. // },
  17463. // "includeAdvertisersWithoutGroupsOnly": {
  17464. // "description": "Select only advertisers which do not belong to any advertiser group.",
  17465. // "location": "query",
  17466. // "type": "boolean"
  17467. // },
  17468. // "maxResults": {
  17469. // "default": "1000",
  17470. // "description": "Maximum number of results to return.",
  17471. // "format": "int32",
  17472. // "location": "query",
  17473. // "maximum": "1000",
  17474. // "minimum": "0",
  17475. // "type": "integer"
  17476. // },
  17477. // "onlyParent": {
  17478. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  17479. // "location": "query",
  17480. // "type": "boolean"
  17481. // },
  17482. // "pageToken": {
  17483. // "description": "Value of the nextPageToken from the previous result page.",
  17484. // "location": "query",
  17485. // "type": "string"
  17486. // },
  17487. // "profileId": {
  17488. // "description": "User profile ID associated with this request.",
  17489. // "format": "int64",
  17490. // "location": "path",
  17491. // "required": true,
  17492. // "type": "string"
  17493. // },
  17494. // "searchString": {
  17495. // "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\".",
  17496. // "location": "query",
  17497. // "type": "string"
  17498. // },
  17499. // "sortField": {
  17500. // "default": "ID",
  17501. // "description": "Field by which to sort the list.",
  17502. // "enum": [
  17503. // "ID",
  17504. // "NAME"
  17505. // ],
  17506. // "enumDescriptions": [
  17507. // "",
  17508. // ""
  17509. // ],
  17510. // "location": "query",
  17511. // "type": "string"
  17512. // },
  17513. // "sortOrder": {
  17514. // "default": "ASCENDING",
  17515. // "description": "Order of sorted results.",
  17516. // "enum": [
  17517. // "ASCENDING",
  17518. // "DESCENDING"
  17519. // ],
  17520. // "enumDescriptions": [
  17521. // "",
  17522. // ""
  17523. // ],
  17524. // "location": "query",
  17525. // "type": "string"
  17526. // },
  17527. // "status": {
  17528. // "description": "Select only advertisers with the specified status.",
  17529. // "enum": [
  17530. // "APPROVED",
  17531. // "ON_HOLD"
  17532. // ],
  17533. // "enumDescriptions": [
  17534. // "",
  17535. // ""
  17536. // ],
  17537. // "location": "query",
  17538. // "type": "string"
  17539. // },
  17540. // "subaccountId": {
  17541. // "description": "Select only advertisers with these subaccount IDs.",
  17542. // "format": "int64",
  17543. // "location": "query",
  17544. // "type": "string"
  17545. // }
  17546. // },
  17547. // "path": "userprofiles/{profileId}/advertisers",
  17548. // "response": {
  17549. // "$ref": "AdvertisersListResponse"
  17550. // },
  17551. // "scopes": [
  17552. // "https://www.googleapis.com/auth/dfatrafficking"
  17553. // ]
  17554. // }
  17555. }
  17556. // Pages invokes f for each page of results.
  17557. // A non-nil error returned from f will halt the iteration.
  17558. // The provided context supersedes any context provided to the Context method.
  17559. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  17560. c.ctx_ = ctx
  17561. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17562. for {
  17563. x, err := c.Do()
  17564. if err != nil {
  17565. return err
  17566. }
  17567. if err := f(x); err != nil {
  17568. return err
  17569. }
  17570. if x.NextPageToken == "" {
  17571. return nil
  17572. }
  17573. c.PageToken(x.NextPageToken)
  17574. }
  17575. }
  17576. // method id "dfareporting.advertisers.patch":
  17577. type AdvertisersPatchCall struct {
  17578. s *Service
  17579. profileId int64
  17580. advertiser *Advertiser
  17581. urlParams_ gensupport.URLParams
  17582. ctx_ context.Context
  17583. header_ http.Header
  17584. }
  17585. // Patch: Updates an existing advertiser. This method supports patch
  17586. // semantics.
  17587. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  17588. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17589. c.profileId = profileId
  17590. c.urlParams_.Set("id", fmt.Sprint(id))
  17591. c.advertiser = advertiser
  17592. return c
  17593. }
  17594. // Fields allows partial responses to be retrieved. See
  17595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17596. // for more information.
  17597. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  17598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17599. return c
  17600. }
  17601. // Context sets the context to be used in this call's Do method. Any
  17602. // pending HTTP request will be aborted if the provided context is
  17603. // canceled.
  17604. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  17605. c.ctx_ = ctx
  17606. return c
  17607. }
  17608. // Header returns an http.Header that can be modified by the caller to
  17609. // add HTTP headers to the request.
  17610. func (c *AdvertisersPatchCall) Header() http.Header {
  17611. if c.header_ == nil {
  17612. c.header_ = make(http.Header)
  17613. }
  17614. return c.header_
  17615. }
  17616. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  17617. reqHeaders := make(http.Header)
  17618. for k, v := range c.header_ {
  17619. reqHeaders[k] = v
  17620. }
  17621. reqHeaders.Set("User-Agent", c.s.userAgent())
  17622. var body io.Reader = nil
  17623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17624. if err != nil {
  17625. return nil, err
  17626. }
  17627. reqHeaders.Set("Content-Type", "application/json")
  17628. c.urlParams_.Set("alt", alt)
  17629. c.urlParams_.Set("prettyPrint", "false")
  17630. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17631. urls += "?" + c.urlParams_.Encode()
  17632. req, err := http.NewRequest("PATCH", urls, body)
  17633. if err != nil {
  17634. return nil, err
  17635. }
  17636. req.Header = reqHeaders
  17637. googleapi.Expand(req.URL, map[string]string{
  17638. "profileId": strconv.FormatInt(c.profileId, 10),
  17639. })
  17640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17641. }
  17642. // Do executes the "dfareporting.advertisers.patch" call.
  17643. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17644. // status code is an error. Response headers are in either
  17645. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17647. // to check whether the returned error was because
  17648. // http.StatusNotModified was returned.
  17649. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17650. gensupport.SetOptions(c.urlParams_, opts...)
  17651. res, err := c.doRequest("json")
  17652. if res != nil && res.StatusCode == http.StatusNotModified {
  17653. if res.Body != nil {
  17654. res.Body.Close()
  17655. }
  17656. return nil, &googleapi.Error{
  17657. Code: res.StatusCode,
  17658. Header: res.Header,
  17659. }
  17660. }
  17661. if err != nil {
  17662. return nil, err
  17663. }
  17664. defer googleapi.CloseBody(res)
  17665. if err := googleapi.CheckResponse(res); err != nil {
  17666. return nil, err
  17667. }
  17668. ret := &Advertiser{
  17669. ServerResponse: googleapi.ServerResponse{
  17670. Header: res.Header,
  17671. HTTPStatusCode: res.StatusCode,
  17672. },
  17673. }
  17674. target := &ret
  17675. if err := gensupport.DecodeResponse(target, res); err != nil {
  17676. return nil, err
  17677. }
  17678. return ret, nil
  17679. // {
  17680. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  17681. // "httpMethod": "PATCH",
  17682. // "id": "dfareporting.advertisers.patch",
  17683. // "parameterOrder": [
  17684. // "profileId",
  17685. // "id"
  17686. // ],
  17687. // "parameters": {
  17688. // "id": {
  17689. // "description": "Advertiser ID.",
  17690. // "format": "int64",
  17691. // "location": "query",
  17692. // "required": true,
  17693. // "type": "string"
  17694. // },
  17695. // "profileId": {
  17696. // "description": "User profile ID associated with this request.",
  17697. // "format": "int64",
  17698. // "location": "path",
  17699. // "required": true,
  17700. // "type": "string"
  17701. // }
  17702. // },
  17703. // "path": "userprofiles/{profileId}/advertisers",
  17704. // "request": {
  17705. // "$ref": "Advertiser"
  17706. // },
  17707. // "response": {
  17708. // "$ref": "Advertiser"
  17709. // },
  17710. // "scopes": [
  17711. // "https://www.googleapis.com/auth/dfatrafficking"
  17712. // ]
  17713. // }
  17714. }
  17715. // method id "dfareporting.advertisers.update":
  17716. type AdvertisersUpdateCall struct {
  17717. s *Service
  17718. profileId int64
  17719. advertiser *Advertiser
  17720. urlParams_ gensupport.URLParams
  17721. ctx_ context.Context
  17722. header_ http.Header
  17723. }
  17724. // Update: Updates an existing advertiser.
  17725. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  17726. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17727. c.profileId = profileId
  17728. c.advertiser = advertiser
  17729. return c
  17730. }
  17731. // Fields allows partial responses to be retrieved. See
  17732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17733. // for more information.
  17734. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  17735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17736. return c
  17737. }
  17738. // Context sets the context to be used in this call's Do method. Any
  17739. // pending HTTP request will be aborted if the provided context is
  17740. // canceled.
  17741. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  17742. c.ctx_ = ctx
  17743. return c
  17744. }
  17745. // Header returns an http.Header that can be modified by the caller to
  17746. // add HTTP headers to the request.
  17747. func (c *AdvertisersUpdateCall) Header() http.Header {
  17748. if c.header_ == nil {
  17749. c.header_ = make(http.Header)
  17750. }
  17751. return c.header_
  17752. }
  17753. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  17754. reqHeaders := make(http.Header)
  17755. for k, v := range c.header_ {
  17756. reqHeaders[k] = v
  17757. }
  17758. reqHeaders.Set("User-Agent", c.s.userAgent())
  17759. var body io.Reader = nil
  17760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17761. if err != nil {
  17762. return nil, err
  17763. }
  17764. reqHeaders.Set("Content-Type", "application/json")
  17765. c.urlParams_.Set("alt", alt)
  17766. c.urlParams_.Set("prettyPrint", "false")
  17767. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17768. urls += "?" + c.urlParams_.Encode()
  17769. req, err := http.NewRequest("PUT", urls, body)
  17770. if err != nil {
  17771. return nil, err
  17772. }
  17773. req.Header = reqHeaders
  17774. googleapi.Expand(req.URL, map[string]string{
  17775. "profileId": strconv.FormatInt(c.profileId, 10),
  17776. })
  17777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17778. }
  17779. // Do executes the "dfareporting.advertisers.update" call.
  17780. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17781. // status code is an error. Response headers are in either
  17782. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17783. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17784. // to check whether the returned error was because
  17785. // http.StatusNotModified was returned.
  17786. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17787. gensupport.SetOptions(c.urlParams_, opts...)
  17788. res, err := c.doRequest("json")
  17789. if res != nil && res.StatusCode == http.StatusNotModified {
  17790. if res.Body != nil {
  17791. res.Body.Close()
  17792. }
  17793. return nil, &googleapi.Error{
  17794. Code: res.StatusCode,
  17795. Header: res.Header,
  17796. }
  17797. }
  17798. if err != nil {
  17799. return nil, err
  17800. }
  17801. defer googleapi.CloseBody(res)
  17802. if err := googleapi.CheckResponse(res); err != nil {
  17803. return nil, err
  17804. }
  17805. ret := &Advertiser{
  17806. ServerResponse: googleapi.ServerResponse{
  17807. Header: res.Header,
  17808. HTTPStatusCode: res.StatusCode,
  17809. },
  17810. }
  17811. target := &ret
  17812. if err := gensupport.DecodeResponse(target, res); err != nil {
  17813. return nil, err
  17814. }
  17815. return ret, nil
  17816. // {
  17817. // "description": "Updates an existing advertiser.",
  17818. // "httpMethod": "PUT",
  17819. // "id": "dfareporting.advertisers.update",
  17820. // "parameterOrder": [
  17821. // "profileId"
  17822. // ],
  17823. // "parameters": {
  17824. // "profileId": {
  17825. // "description": "User profile ID associated with this request.",
  17826. // "format": "int64",
  17827. // "location": "path",
  17828. // "required": true,
  17829. // "type": "string"
  17830. // }
  17831. // },
  17832. // "path": "userprofiles/{profileId}/advertisers",
  17833. // "request": {
  17834. // "$ref": "Advertiser"
  17835. // },
  17836. // "response": {
  17837. // "$ref": "Advertiser"
  17838. // },
  17839. // "scopes": [
  17840. // "https://www.googleapis.com/auth/dfatrafficking"
  17841. // ]
  17842. // }
  17843. }
  17844. // method id "dfareporting.browsers.list":
  17845. type BrowsersListCall struct {
  17846. s *Service
  17847. profileId int64
  17848. urlParams_ gensupport.URLParams
  17849. ifNoneMatch_ string
  17850. ctx_ context.Context
  17851. header_ http.Header
  17852. }
  17853. // List: Retrieves a list of browsers.
  17854. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  17855. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17856. c.profileId = profileId
  17857. return c
  17858. }
  17859. // Fields allows partial responses to be retrieved. See
  17860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17861. // for more information.
  17862. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  17863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17864. return c
  17865. }
  17866. // IfNoneMatch sets the optional parameter which makes the operation
  17867. // fail if the object's ETag matches the given value. This is useful for
  17868. // getting updates only after the object has changed since the last
  17869. // request. Use googleapi.IsNotModified to check whether the response
  17870. // error from Do is the result of In-None-Match.
  17871. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  17872. c.ifNoneMatch_ = entityTag
  17873. return c
  17874. }
  17875. // Context sets the context to be used in this call's Do method. Any
  17876. // pending HTTP request will be aborted if the provided context is
  17877. // canceled.
  17878. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  17879. c.ctx_ = ctx
  17880. return c
  17881. }
  17882. // Header returns an http.Header that can be modified by the caller to
  17883. // add HTTP headers to the request.
  17884. func (c *BrowsersListCall) Header() http.Header {
  17885. if c.header_ == nil {
  17886. c.header_ = make(http.Header)
  17887. }
  17888. return c.header_
  17889. }
  17890. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  17891. reqHeaders := make(http.Header)
  17892. for k, v := range c.header_ {
  17893. reqHeaders[k] = v
  17894. }
  17895. reqHeaders.Set("User-Agent", c.s.userAgent())
  17896. if c.ifNoneMatch_ != "" {
  17897. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17898. }
  17899. var body io.Reader = nil
  17900. c.urlParams_.Set("alt", alt)
  17901. c.urlParams_.Set("prettyPrint", "false")
  17902. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  17903. urls += "?" + c.urlParams_.Encode()
  17904. req, err := http.NewRequest("GET", urls, body)
  17905. if err != nil {
  17906. return nil, err
  17907. }
  17908. req.Header = reqHeaders
  17909. googleapi.Expand(req.URL, map[string]string{
  17910. "profileId": strconv.FormatInt(c.profileId, 10),
  17911. })
  17912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17913. }
  17914. // Do executes the "dfareporting.browsers.list" call.
  17915. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  17916. // non-2xx status code is an error. Response headers are in either
  17917. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  17918. // returned at all) in error.(*googleapi.Error).Header. Use
  17919. // googleapi.IsNotModified to check whether the returned error was
  17920. // because http.StatusNotModified was returned.
  17921. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  17922. gensupport.SetOptions(c.urlParams_, opts...)
  17923. res, err := c.doRequest("json")
  17924. if res != nil && res.StatusCode == http.StatusNotModified {
  17925. if res.Body != nil {
  17926. res.Body.Close()
  17927. }
  17928. return nil, &googleapi.Error{
  17929. Code: res.StatusCode,
  17930. Header: res.Header,
  17931. }
  17932. }
  17933. if err != nil {
  17934. return nil, err
  17935. }
  17936. defer googleapi.CloseBody(res)
  17937. if err := googleapi.CheckResponse(res); err != nil {
  17938. return nil, err
  17939. }
  17940. ret := &BrowsersListResponse{
  17941. ServerResponse: googleapi.ServerResponse{
  17942. Header: res.Header,
  17943. HTTPStatusCode: res.StatusCode,
  17944. },
  17945. }
  17946. target := &ret
  17947. if err := gensupport.DecodeResponse(target, res); err != nil {
  17948. return nil, err
  17949. }
  17950. return ret, nil
  17951. // {
  17952. // "description": "Retrieves a list of browsers.",
  17953. // "httpMethod": "GET",
  17954. // "id": "dfareporting.browsers.list",
  17955. // "parameterOrder": [
  17956. // "profileId"
  17957. // ],
  17958. // "parameters": {
  17959. // "profileId": {
  17960. // "description": "User profile ID associated with this request.",
  17961. // "format": "int64",
  17962. // "location": "path",
  17963. // "required": true,
  17964. // "type": "string"
  17965. // }
  17966. // },
  17967. // "path": "userprofiles/{profileId}/browsers",
  17968. // "response": {
  17969. // "$ref": "BrowsersListResponse"
  17970. // },
  17971. // "scopes": [
  17972. // "https://www.googleapis.com/auth/dfatrafficking"
  17973. // ]
  17974. // }
  17975. }
  17976. // method id "dfareporting.campaignCreativeAssociations.insert":
  17977. type CampaignCreativeAssociationsInsertCall struct {
  17978. s *Service
  17979. profileId int64
  17980. campaignId int64
  17981. campaigncreativeassociation *CampaignCreativeAssociation
  17982. urlParams_ gensupport.URLParams
  17983. ctx_ context.Context
  17984. header_ http.Header
  17985. }
  17986. // Insert: Associates a creative with the specified campaign. This
  17987. // method creates a default ad with dimensions matching the creative in
  17988. // the campaign if such a default ad does not exist already.
  17989. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  17990. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17991. c.profileId = profileId
  17992. c.campaignId = campaignId
  17993. c.campaigncreativeassociation = campaigncreativeassociation
  17994. return c
  17995. }
  17996. // Fields allows partial responses to be retrieved. See
  17997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17998. // for more information.
  17999. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  18000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18001. return c
  18002. }
  18003. // Context sets the context to be used in this call's Do method. Any
  18004. // pending HTTP request will be aborted if the provided context is
  18005. // canceled.
  18006. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  18007. c.ctx_ = ctx
  18008. return c
  18009. }
  18010. // Header returns an http.Header that can be modified by the caller to
  18011. // add HTTP headers to the request.
  18012. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  18013. if c.header_ == nil {
  18014. c.header_ = make(http.Header)
  18015. }
  18016. return c.header_
  18017. }
  18018. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  18019. reqHeaders := make(http.Header)
  18020. for k, v := range c.header_ {
  18021. reqHeaders[k] = v
  18022. }
  18023. reqHeaders.Set("User-Agent", c.s.userAgent())
  18024. var body io.Reader = nil
  18025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  18026. if err != nil {
  18027. return nil, err
  18028. }
  18029. reqHeaders.Set("Content-Type", "application/json")
  18030. c.urlParams_.Set("alt", alt)
  18031. c.urlParams_.Set("prettyPrint", "false")
  18032. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  18033. urls += "?" + c.urlParams_.Encode()
  18034. req, err := http.NewRequest("POST", urls, body)
  18035. if err != nil {
  18036. return nil, err
  18037. }
  18038. req.Header = reqHeaders
  18039. googleapi.Expand(req.URL, map[string]string{
  18040. "profileId": strconv.FormatInt(c.profileId, 10),
  18041. "campaignId": strconv.FormatInt(c.campaignId, 10),
  18042. })
  18043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18044. }
  18045. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  18046. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  18047. // Any non-2xx status code is an error. Response headers are in either
  18048. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  18049. // was returned at all) in error.(*googleapi.Error).Header. Use
  18050. // googleapi.IsNotModified to check whether the returned error was
  18051. // because http.StatusNotModified was returned.
  18052. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  18053. gensupport.SetOptions(c.urlParams_, opts...)
  18054. res, err := c.doRequest("json")
  18055. if res != nil && res.StatusCode == http.StatusNotModified {
  18056. if res.Body != nil {
  18057. res.Body.Close()
  18058. }
  18059. return nil, &googleapi.Error{
  18060. Code: res.StatusCode,
  18061. Header: res.Header,
  18062. }
  18063. }
  18064. if err != nil {
  18065. return nil, err
  18066. }
  18067. defer googleapi.CloseBody(res)
  18068. if err := googleapi.CheckResponse(res); err != nil {
  18069. return nil, err
  18070. }
  18071. ret := &CampaignCreativeAssociation{
  18072. ServerResponse: googleapi.ServerResponse{
  18073. Header: res.Header,
  18074. HTTPStatusCode: res.StatusCode,
  18075. },
  18076. }
  18077. target := &ret
  18078. if err := gensupport.DecodeResponse(target, res); err != nil {
  18079. return nil, err
  18080. }
  18081. return ret, nil
  18082. // {
  18083. // "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.",
  18084. // "httpMethod": "POST",
  18085. // "id": "dfareporting.campaignCreativeAssociations.insert",
  18086. // "parameterOrder": [
  18087. // "profileId",
  18088. // "campaignId"
  18089. // ],
  18090. // "parameters": {
  18091. // "campaignId": {
  18092. // "description": "Campaign ID in this association.",
  18093. // "format": "int64",
  18094. // "location": "path",
  18095. // "required": true,
  18096. // "type": "string"
  18097. // },
  18098. // "profileId": {
  18099. // "description": "User profile ID associated with this request.",
  18100. // "format": "int64",
  18101. // "location": "path",
  18102. // "required": true,
  18103. // "type": "string"
  18104. // }
  18105. // },
  18106. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18107. // "request": {
  18108. // "$ref": "CampaignCreativeAssociation"
  18109. // },
  18110. // "response": {
  18111. // "$ref": "CampaignCreativeAssociation"
  18112. // },
  18113. // "scopes": [
  18114. // "https://www.googleapis.com/auth/dfatrafficking"
  18115. // ]
  18116. // }
  18117. }
  18118. // method id "dfareporting.campaignCreativeAssociations.list":
  18119. type CampaignCreativeAssociationsListCall struct {
  18120. s *Service
  18121. profileId int64
  18122. campaignId int64
  18123. urlParams_ gensupport.URLParams
  18124. ifNoneMatch_ string
  18125. ctx_ context.Context
  18126. header_ http.Header
  18127. }
  18128. // List: Retrieves the list of creative IDs associated with the
  18129. // specified campaign. This method supports paging.
  18130. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  18131. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18132. c.profileId = profileId
  18133. c.campaignId = campaignId
  18134. return c
  18135. }
  18136. // MaxResults sets the optional parameter "maxResults": Maximum number
  18137. // of results to return.
  18138. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  18139. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18140. return c
  18141. }
  18142. // PageToken sets the optional parameter "pageToken": Value of the
  18143. // nextPageToken from the previous result page.
  18144. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  18145. c.urlParams_.Set("pageToken", pageToken)
  18146. return c
  18147. }
  18148. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18149. // results.
  18150. //
  18151. // Possible values:
  18152. // "ASCENDING" (default)
  18153. // "DESCENDING"
  18154. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  18155. c.urlParams_.Set("sortOrder", sortOrder)
  18156. return c
  18157. }
  18158. // Fields allows partial responses to be retrieved. See
  18159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18160. // for more information.
  18161. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  18162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18163. return c
  18164. }
  18165. // IfNoneMatch sets the optional parameter which makes the operation
  18166. // fail if the object's ETag matches the given value. This is useful for
  18167. // getting updates only after the object has changed since the last
  18168. // request. Use googleapi.IsNotModified to check whether the response
  18169. // error from Do is the result of In-None-Match.
  18170. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  18171. c.ifNoneMatch_ = entityTag
  18172. return c
  18173. }
  18174. // Context sets the context to be used in this call's Do method. Any
  18175. // pending HTTP request will be aborted if the provided context is
  18176. // canceled.
  18177. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  18178. c.ctx_ = ctx
  18179. return c
  18180. }
  18181. // Header returns an http.Header that can be modified by the caller to
  18182. // add HTTP headers to the request.
  18183. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  18184. if c.header_ == nil {
  18185. c.header_ = make(http.Header)
  18186. }
  18187. return c.header_
  18188. }
  18189. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  18190. reqHeaders := make(http.Header)
  18191. for k, v := range c.header_ {
  18192. reqHeaders[k] = v
  18193. }
  18194. reqHeaders.Set("User-Agent", c.s.userAgent())
  18195. if c.ifNoneMatch_ != "" {
  18196. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18197. }
  18198. var body io.Reader = nil
  18199. c.urlParams_.Set("alt", alt)
  18200. c.urlParams_.Set("prettyPrint", "false")
  18201. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  18202. urls += "?" + c.urlParams_.Encode()
  18203. req, err := http.NewRequest("GET", urls, body)
  18204. if err != nil {
  18205. return nil, err
  18206. }
  18207. req.Header = reqHeaders
  18208. googleapi.Expand(req.URL, map[string]string{
  18209. "profileId": strconv.FormatInt(c.profileId, 10),
  18210. "campaignId": strconv.FormatInt(c.campaignId, 10),
  18211. })
  18212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18213. }
  18214. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  18215. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  18216. // will be non-nil. Any non-2xx status code is an error. Response
  18217. // headers are in either
  18218. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  18219. // (if a response was returned at all) in
  18220. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18221. // whether the returned error was because http.StatusNotModified was
  18222. // returned.
  18223. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  18224. gensupport.SetOptions(c.urlParams_, opts...)
  18225. res, err := c.doRequest("json")
  18226. if res != nil && res.StatusCode == http.StatusNotModified {
  18227. if res.Body != nil {
  18228. res.Body.Close()
  18229. }
  18230. return nil, &googleapi.Error{
  18231. Code: res.StatusCode,
  18232. Header: res.Header,
  18233. }
  18234. }
  18235. if err != nil {
  18236. return nil, err
  18237. }
  18238. defer googleapi.CloseBody(res)
  18239. if err := googleapi.CheckResponse(res); err != nil {
  18240. return nil, err
  18241. }
  18242. ret := &CampaignCreativeAssociationsListResponse{
  18243. ServerResponse: googleapi.ServerResponse{
  18244. Header: res.Header,
  18245. HTTPStatusCode: res.StatusCode,
  18246. },
  18247. }
  18248. target := &ret
  18249. if err := gensupport.DecodeResponse(target, res); err != nil {
  18250. return nil, err
  18251. }
  18252. return ret, nil
  18253. // {
  18254. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  18255. // "httpMethod": "GET",
  18256. // "id": "dfareporting.campaignCreativeAssociations.list",
  18257. // "parameterOrder": [
  18258. // "profileId",
  18259. // "campaignId"
  18260. // ],
  18261. // "parameters": {
  18262. // "campaignId": {
  18263. // "description": "Campaign ID in this association.",
  18264. // "format": "int64",
  18265. // "location": "path",
  18266. // "required": true,
  18267. // "type": "string"
  18268. // },
  18269. // "maxResults": {
  18270. // "default": "1000",
  18271. // "description": "Maximum number of results to return.",
  18272. // "format": "int32",
  18273. // "location": "query",
  18274. // "maximum": "1000",
  18275. // "minimum": "0",
  18276. // "type": "integer"
  18277. // },
  18278. // "pageToken": {
  18279. // "description": "Value of the nextPageToken from the previous result page.",
  18280. // "location": "query",
  18281. // "type": "string"
  18282. // },
  18283. // "profileId": {
  18284. // "description": "User profile ID associated with this request.",
  18285. // "format": "int64",
  18286. // "location": "path",
  18287. // "required": true,
  18288. // "type": "string"
  18289. // },
  18290. // "sortOrder": {
  18291. // "default": "ASCENDING",
  18292. // "description": "Order of sorted results.",
  18293. // "enum": [
  18294. // "ASCENDING",
  18295. // "DESCENDING"
  18296. // ],
  18297. // "enumDescriptions": [
  18298. // "",
  18299. // ""
  18300. // ],
  18301. // "location": "query",
  18302. // "type": "string"
  18303. // }
  18304. // },
  18305. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18306. // "response": {
  18307. // "$ref": "CampaignCreativeAssociationsListResponse"
  18308. // },
  18309. // "scopes": [
  18310. // "https://www.googleapis.com/auth/dfatrafficking"
  18311. // ]
  18312. // }
  18313. }
  18314. // Pages invokes f for each page of results.
  18315. // A non-nil error returned from f will halt the iteration.
  18316. // The provided context supersedes any context provided to the Context method.
  18317. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  18318. c.ctx_ = ctx
  18319. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18320. for {
  18321. x, err := c.Do()
  18322. if err != nil {
  18323. return err
  18324. }
  18325. if err := f(x); err != nil {
  18326. return err
  18327. }
  18328. if x.NextPageToken == "" {
  18329. return nil
  18330. }
  18331. c.PageToken(x.NextPageToken)
  18332. }
  18333. }
  18334. // method id "dfareporting.campaigns.get":
  18335. type CampaignsGetCall struct {
  18336. s *Service
  18337. profileId int64
  18338. id int64
  18339. urlParams_ gensupport.URLParams
  18340. ifNoneMatch_ string
  18341. ctx_ context.Context
  18342. header_ http.Header
  18343. }
  18344. // Get: Gets one campaign by ID.
  18345. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  18346. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18347. c.profileId = profileId
  18348. c.id = id
  18349. return c
  18350. }
  18351. // Fields allows partial responses to be retrieved. See
  18352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18353. // for more information.
  18354. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  18355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18356. return c
  18357. }
  18358. // IfNoneMatch sets the optional parameter which makes the operation
  18359. // fail if the object's ETag matches the given value. This is useful for
  18360. // getting updates only after the object has changed since the last
  18361. // request. Use googleapi.IsNotModified to check whether the response
  18362. // error from Do is the result of In-None-Match.
  18363. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  18364. c.ifNoneMatch_ = entityTag
  18365. return c
  18366. }
  18367. // Context sets the context to be used in this call's Do method. Any
  18368. // pending HTTP request will be aborted if the provided context is
  18369. // canceled.
  18370. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  18371. c.ctx_ = ctx
  18372. return c
  18373. }
  18374. // Header returns an http.Header that can be modified by the caller to
  18375. // add HTTP headers to the request.
  18376. func (c *CampaignsGetCall) Header() http.Header {
  18377. if c.header_ == nil {
  18378. c.header_ = make(http.Header)
  18379. }
  18380. return c.header_
  18381. }
  18382. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  18383. reqHeaders := make(http.Header)
  18384. for k, v := range c.header_ {
  18385. reqHeaders[k] = v
  18386. }
  18387. reqHeaders.Set("User-Agent", c.s.userAgent())
  18388. if c.ifNoneMatch_ != "" {
  18389. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18390. }
  18391. var body io.Reader = nil
  18392. c.urlParams_.Set("alt", alt)
  18393. c.urlParams_.Set("prettyPrint", "false")
  18394. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  18395. urls += "?" + c.urlParams_.Encode()
  18396. req, err := http.NewRequest("GET", urls, body)
  18397. if err != nil {
  18398. return nil, err
  18399. }
  18400. req.Header = reqHeaders
  18401. googleapi.Expand(req.URL, map[string]string{
  18402. "profileId": strconv.FormatInt(c.profileId, 10),
  18403. "id": strconv.FormatInt(c.id, 10),
  18404. })
  18405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18406. }
  18407. // Do executes the "dfareporting.campaigns.get" call.
  18408. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18409. // code is an error. Response headers are in either
  18410. // *Campaign.ServerResponse.Header or (if a response was returned at
  18411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18412. // to check whether the returned error was because
  18413. // http.StatusNotModified was returned.
  18414. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18415. gensupport.SetOptions(c.urlParams_, opts...)
  18416. res, err := c.doRequest("json")
  18417. if res != nil && res.StatusCode == http.StatusNotModified {
  18418. if res.Body != nil {
  18419. res.Body.Close()
  18420. }
  18421. return nil, &googleapi.Error{
  18422. Code: res.StatusCode,
  18423. Header: res.Header,
  18424. }
  18425. }
  18426. if err != nil {
  18427. return nil, err
  18428. }
  18429. defer googleapi.CloseBody(res)
  18430. if err := googleapi.CheckResponse(res); err != nil {
  18431. return nil, err
  18432. }
  18433. ret := &Campaign{
  18434. ServerResponse: googleapi.ServerResponse{
  18435. Header: res.Header,
  18436. HTTPStatusCode: res.StatusCode,
  18437. },
  18438. }
  18439. target := &ret
  18440. if err := gensupport.DecodeResponse(target, res); err != nil {
  18441. return nil, err
  18442. }
  18443. return ret, nil
  18444. // {
  18445. // "description": "Gets one campaign by ID.",
  18446. // "httpMethod": "GET",
  18447. // "id": "dfareporting.campaigns.get",
  18448. // "parameterOrder": [
  18449. // "profileId",
  18450. // "id"
  18451. // ],
  18452. // "parameters": {
  18453. // "id": {
  18454. // "description": "Campaign ID.",
  18455. // "format": "int64",
  18456. // "location": "path",
  18457. // "required": true,
  18458. // "type": "string"
  18459. // },
  18460. // "profileId": {
  18461. // "description": "User profile ID associated with this request.",
  18462. // "format": "int64",
  18463. // "location": "path",
  18464. // "required": true,
  18465. // "type": "string"
  18466. // }
  18467. // },
  18468. // "path": "userprofiles/{profileId}/campaigns/{id}",
  18469. // "response": {
  18470. // "$ref": "Campaign"
  18471. // },
  18472. // "scopes": [
  18473. // "https://www.googleapis.com/auth/dfatrafficking"
  18474. // ]
  18475. // }
  18476. }
  18477. // method id "dfareporting.campaigns.insert":
  18478. type CampaignsInsertCall struct {
  18479. s *Service
  18480. profileId int64
  18481. campaign *Campaign
  18482. urlParams_ gensupport.URLParams
  18483. ctx_ context.Context
  18484. header_ http.Header
  18485. }
  18486. // Insert: Inserts a new campaign.
  18487. func (r *CampaignsService) Insert(profileId int64, campaign *Campaign) *CampaignsInsertCall {
  18488. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18489. c.profileId = profileId
  18490. c.campaign = campaign
  18491. return c
  18492. }
  18493. // Fields allows partial responses to be retrieved. See
  18494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18495. // for more information.
  18496. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  18497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18498. return c
  18499. }
  18500. // Context sets the context to be used in this call's Do method. Any
  18501. // pending HTTP request will be aborted if the provided context is
  18502. // canceled.
  18503. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  18504. c.ctx_ = ctx
  18505. return c
  18506. }
  18507. // Header returns an http.Header that can be modified by the caller to
  18508. // add HTTP headers to the request.
  18509. func (c *CampaignsInsertCall) Header() http.Header {
  18510. if c.header_ == nil {
  18511. c.header_ = make(http.Header)
  18512. }
  18513. return c.header_
  18514. }
  18515. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  18516. reqHeaders := make(http.Header)
  18517. for k, v := range c.header_ {
  18518. reqHeaders[k] = v
  18519. }
  18520. reqHeaders.Set("User-Agent", c.s.userAgent())
  18521. var body io.Reader = nil
  18522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18523. if err != nil {
  18524. return nil, err
  18525. }
  18526. reqHeaders.Set("Content-Type", "application/json")
  18527. c.urlParams_.Set("alt", alt)
  18528. c.urlParams_.Set("prettyPrint", "false")
  18529. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18530. urls += "?" + c.urlParams_.Encode()
  18531. req, err := http.NewRequest("POST", urls, body)
  18532. if err != nil {
  18533. return nil, err
  18534. }
  18535. req.Header = reqHeaders
  18536. googleapi.Expand(req.URL, map[string]string{
  18537. "profileId": strconv.FormatInt(c.profileId, 10),
  18538. })
  18539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18540. }
  18541. // Do executes the "dfareporting.campaigns.insert" call.
  18542. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18543. // code is an error. Response headers are in either
  18544. // *Campaign.ServerResponse.Header or (if a response was returned at
  18545. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18546. // to check whether the returned error was because
  18547. // http.StatusNotModified was returned.
  18548. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18549. gensupport.SetOptions(c.urlParams_, opts...)
  18550. res, err := c.doRequest("json")
  18551. if res != nil && res.StatusCode == http.StatusNotModified {
  18552. if res.Body != nil {
  18553. res.Body.Close()
  18554. }
  18555. return nil, &googleapi.Error{
  18556. Code: res.StatusCode,
  18557. Header: res.Header,
  18558. }
  18559. }
  18560. if err != nil {
  18561. return nil, err
  18562. }
  18563. defer googleapi.CloseBody(res)
  18564. if err := googleapi.CheckResponse(res); err != nil {
  18565. return nil, err
  18566. }
  18567. ret := &Campaign{
  18568. ServerResponse: googleapi.ServerResponse{
  18569. Header: res.Header,
  18570. HTTPStatusCode: res.StatusCode,
  18571. },
  18572. }
  18573. target := &ret
  18574. if err := gensupport.DecodeResponse(target, res); err != nil {
  18575. return nil, err
  18576. }
  18577. return ret, nil
  18578. // {
  18579. // "description": "Inserts a new campaign.",
  18580. // "httpMethod": "POST",
  18581. // "id": "dfareporting.campaigns.insert",
  18582. // "parameterOrder": [
  18583. // "profileId"
  18584. // ],
  18585. // "parameters": {
  18586. // "profileId": {
  18587. // "description": "User profile ID associated with this request.",
  18588. // "format": "int64",
  18589. // "location": "path",
  18590. // "required": true,
  18591. // "type": "string"
  18592. // }
  18593. // },
  18594. // "path": "userprofiles/{profileId}/campaigns",
  18595. // "request": {
  18596. // "$ref": "Campaign"
  18597. // },
  18598. // "response": {
  18599. // "$ref": "Campaign"
  18600. // },
  18601. // "scopes": [
  18602. // "https://www.googleapis.com/auth/dfatrafficking"
  18603. // ]
  18604. // }
  18605. }
  18606. // method id "dfareporting.campaigns.list":
  18607. type CampaignsListCall struct {
  18608. s *Service
  18609. profileId int64
  18610. urlParams_ gensupport.URLParams
  18611. ifNoneMatch_ string
  18612. ctx_ context.Context
  18613. header_ http.Header
  18614. }
  18615. // List: Retrieves a list of campaigns, possibly filtered. This method
  18616. // supports paging.
  18617. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  18618. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18619. c.profileId = profileId
  18620. return c
  18621. }
  18622. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  18623. // Select only campaigns whose advertisers belong to these advertiser
  18624. // groups.
  18625. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  18626. var advertiserGroupIds_ []string
  18627. for _, v := range advertiserGroupIds {
  18628. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  18629. }
  18630. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  18631. return c
  18632. }
  18633. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  18634. // only campaigns that belong to these advertisers.
  18635. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  18636. var advertiserIds_ []string
  18637. for _, v := range advertiserIds {
  18638. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  18639. }
  18640. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  18641. return c
  18642. }
  18643. // Archived sets the optional parameter "archived": Select only archived
  18644. // campaigns. Don't set this field to select both archived and
  18645. // non-archived campaigns.
  18646. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  18647. c.urlParams_.Set("archived", fmt.Sprint(archived))
  18648. return c
  18649. }
  18650. // AtLeastOneOptimizationActivity sets the optional parameter
  18651. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  18652. // least one optimization activity.
  18653. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  18654. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  18655. return c
  18656. }
  18657. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  18658. // campaigns with these IDs.
  18659. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  18660. var excludedIds_ []string
  18661. for _, v := range excludedIds {
  18662. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  18663. }
  18664. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  18665. return c
  18666. }
  18667. // Ids sets the optional parameter "ids": Select only campaigns with
  18668. // these IDs.
  18669. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  18670. var ids_ []string
  18671. for _, v := range ids {
  18672. ids_ = append(ids_, fmt.Sprint(v))
  18673. }
  18674. c.urlParams_.SetMulti("ids", ids_)
  18675. return c
  18676. }
  18677. // MaxResults sets the optional parameter "maxResults": Maximum number
  18678. // of results to return.
  18679. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  18680. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18681. return c
  18682. }
  18683. // OverriddenEventTagId sets the optional parameter
  18684. // "overriddenEventTagId": Select only campaigns that have overridden
  18685. // this event tag ID.
  18686. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  18687. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  18688. return c
  18689. }
  18690. // PageToken sets the optional parameter "pageToken": Value of the
  18691. // nextPageToken from the previous result page.
  18692. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  18693. c.urlParams_.Set("pageToken", pageToken)
  18694. return c
  18695. }
  18696. // SearchString sets the optional parameter "searchString": Allows
  18697. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  18698. // example, "campaign*2015" will return campaigns with names like
  18699. // "campaign June 2015", "campaign April 2015", or simply "campaign
  18700. // 2015". Most of the searches also add wildcards implicitly at the
  18701. // start and the end of the search string. For example, a search string
  18702. // of "campaign" will match campaigns with name "my campaign", "campaign
  18703. // 2015", or simply "campaign".
  18704. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  18705. c.urlParams_.Set("searchString", searchString)
  18706. return c
  18707. }
  18708. // SortField sets the optional parameter "sortField": Field by which to
  18709. // sort the list.
  18710. //
  18711. // Possible values:
  18712. // "ID" (default)
  18713. // "NAME"
  18714. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  18715. c.urlParams_.Set("sortField", sortField)
  18716. return c
  18717. }
  18718. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18719. // results.
  18720. //
  18721. // Possible values:
  18722. // "ASCENDING" (default)
  18723. // "DESCENDING"
  18724. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  18725. c.urlParams_.Set("sortOrder", sortOrder)
  18726. return c
  18727. }
  18728. // SubaccountId sets the optional parameter "subaccountId": Select only
  18729. // campaigns that belong to this subaccount.
  18730. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  18731. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  18732. return c
  18733. }
  18734. // Fields allows partial responses to be retrieved. See
  18735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18736. // for more information.
  18737. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  18738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18739. return c
  18740. }
  18741. // IfNoneMatch sets the optional parameter which makes the operation
  18742. // fail if the object's ETag matches the given value. This is useful for
  18743. // getting updates only after the object has changed since the last
  18744. // request. Use googleapi.IsNotModified to check whether the response
  18745. // error from Do is the result of In-None-Match.
  18746. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  18747. c.ifNoneMatch_ = entityTag
  18748. return c
  18749. }
  18750. // Context sets the context to be used in this call's Do method. Any
  18751. // pending HTTP request will be aborted if the provided context is
  18752. // canceled.
  18753. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  18754. c.ctx_ = ctx
  18755. return c
  18756. }
  18757. // Header returns an http.Header that can be modified by the caller to
  18758. // add HTTP headers to the request.
  18759. func (c *CampaignsListCall) Header() http.Header {
  18760. if c.header_ == nil {
  18761. c.header_ = make(http.Header)
  18762. }
  18763. return c.header_
  18764. }
  18765. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  18766. reqHeaders := make(http.Header)
  18767. for k, v := range c.header_ {
  18768. reqHeaders[k] = v
  18769. }
  18770. reqHeaders.Set("User-Agent", c.s.userAgent())
  18771. if c.ifNoneMatch_ != "" {
  18772. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18773. }
  18774. var body io.Reader = nil
  18775. c.urlParams_.Set("alt", alt)
  18776. c.urlParams_.Set("prettyPrint", "false")
  18777. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18778. urls += "?" + c.urlParams_.Encode()
  18779. req, err := http.NewRequest("GET", urls, body)
  18780. if err != nil {
  18781. return nil, err
  18782. }
  18783. req.Header = reqHeaders
  18784. googleapi.Expand(req.URL, map[string]string{
  18785. "profileId": strconv.FormatInt(c.profileId, 10),
  18786. })
  18787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18788. }
  18789. // Do executes the "dfareporting.campaigns.list" call.
  18790. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  18791. // non-2xx status code is an error. Response headers are in either
  18792. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  18793. // returned at all) in error.(*googleapi.Error).Header. Use
  18794. // googleapi.IsNotModified to check whether the returned error was
  18795. // because http.StatusNotModified was returned.
  18796. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  18797. gensupport.SetOptions(c.urlParams_, opts...)
  18798. res, err := c.doRequest("json")
  18799. if res != nil && res.StatusCode == http.StatusNotModified {
  18800. if res.Body != nil {
  18801. res.Body.Close()
  18802. }
  18803. return nil, &googleapi.Error{
  18804. Code: res.StatusCode,
  18805. Header: res.Header,
  18806. }
  18807. }
  18808. if err != nil {
  18809. return nil, err
  18810. }
  18811. defer googleapi.CloseBody(res)
  18812. if err := googleapi.CheckResponse(res); err != nil {
  18813. return nil, err
  18814. }
  18815. ret := &CampaignsListResponse{
  18816. ServerResponse: googleapi.ServerResponse{
  18817. Header: res.Header,
  18818. HTTPStatusCode: res.StatusCode,
  18819. },
  18820. }
  18821. target := &ret
  18822. if err := gensupport.DecodeResponse(target, res); err != nil {
  18823. return nil, err
  18824. }
  18825. return ret, nil
  18826. // {
  18827. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  18828. // "httpMethod": "GET",
  18829. // "id": "dfareporting.campaigns.list",
  18830. // "parameterOrder": [
  18831. // "profileId"
  18832. // ],
  18833. // "parameters": {
  18834. // "advertiserGroupIds": {
  18835. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  18836. // "format": "int64",
  18837. // "location": "query",
  18838. // "repeated": true,
  18839. // "type": "string"
  18840. // },
  18841. // "advertiserIds": {
  18842. // "description": "Select only campaigns that belong to these advertisers.",
  18843. // "format": "int64",
  18844. // "location": "query",
  18845. // "repeated": true,
  18846. // "type": "string"
  18847. // },
  18848. // "archived": {
  18849. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  18850. // "location": "query",
  18851. // "type": "boolean"
  18852. // },
  18853. // "atLeastOneOptimizationActivity": {
  18854. // "description": "Select only campaigns that have at least one optimization activity.",
  18855. // "location": "query",
  18856. // "type": "boolean"
  18857. // },
  18858. // "excludedIds": {
  18859. // "description": "Exclude campaigns with these IDs.",
  18860. // "format": "int64",
  18861. // "location": "query",
  18862. // "repeated": true,
  18863. // "type": "string"
  18864. // },
  18865. // "ids": {
  18866. // "description": "Select only campaigns with these IDs.",
  18867. // "format": "int64",
  18868. // "location": "query",
  18869. // "repeated": true,
  18870. // "type": "string"
  18871. // },
  18872. // "maxResults": {
  18873. // "default": "1000",
  18874. // "description": "Maximum number of results to return.",
  18875. // "format": "int32",
  18876. // "location": "query",
  18877. // "maximum": "1000",
  18878. // "minimum": "0",
  18879. // "type": "integer"
  18880. // },
  18881. // "overriddenEventTagId": {
  18882. // "description": "Select only campaigns that have overridden this event tag ID.",
  18883. // "format": "int64",
  18884. // "location": "query",
  18885. // "type": "string"
  18886. // },
  18887. // "pageToken": {
  18888. // "description": "Value of the nextPageToken from the previous result page.",
  18889. // "location": "query",
  18890. // "type": "string"
  18891. // },
  18892. // "profileId": {
  18893. // "description": "User profile ID associated with this request.",
  18894. // "format": "int64",
  18895. // "location": "path",
  18896. // "required": true,
  18897. // "type": "string"
  18898. // },
  18899. // "searchString": {
  18900. // "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\".",
  18901. // "location": "query",
  18902. // "type": "string"
  18903. // },
  18904. // "sortField": {
  18905. // "default": "ID",
  18906. // "description": "Field by which to sort the list.",
  18907. // "enum": [
  18908. // "ID",
  18909. // "NAME"
  18910. // ],
  18911. // "enumDescriptions": [
  18912. // "",
  18913. // ""
  18914. // ],
  18915. // "location": "query",
  18916. // "type": "string"
  18917. // },
  18918. // "sortOrder": {
  18919. // "default": "ASCENDING",
  18920. // "description": "Order of sorted results.",
  18921. // "enum": [
  18922. // "ASCENDING",
  18923. // "DESCENDING"
  18924. // ],
  18925. // "enumDescriptions": [
  18926. // "",
  18927. // ""
  18928. // ],
  18929. // "location": "query",
  18930. // "type": "string"
  18931. // },
  18932. // "subaccountId": {
  18933. // "description": "Select only campaigns that belong to this subaccount.",
  18934. // "format": "int64",
  18935. // "location": "query",
  18936. // "type": "string"
  18937. // }
  18938. // },
  18939. // "path": "userprofiles/{profileId}/campaigns",
  18940. // "response": {
  18941. // "$ref": "CampaignsListResponse"
  18942. // },
  18943. // "scopes": [
  18944. // "https://www.googleapis.com/auth/dfatrafficking"
  18945. // ]
  18946. // }
  18947. }
  18948. // Pages invokes f for each page of results.
  18949. // A non-nil error returned from f will halt the iteration.
  18950. // The provided context supersedes any context provided to the Context method.
  18951. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  18952. c.ctx_ = ctx
  18953. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18954. for {
  18955. x, err := c.Do()
  18956. if err != nil {
  18957. return err
  18958. }
  18959. if err := f(x); err != nil {
  18960. return err
  18961. }
  18962. if x.NextPageToken == "" {
  18963. return nil
  18964. }
  18965. c.PageToken(x.NextPageToken)
  18966. }
  18967. }
  18968. // method id "dfareporting.campaigns.patch":
  18969. type CampaignsPatchCall struct {
  18970. s *Service
  18971. profileId int64
  18972. campaign *Campaign
  18973. urlParams_ gensupport.URLParams
  18974. ctx_ context.Context
  18975. header_ http.Header
  18976. }
  18977. // Patch: Updates an existing campaign. This method supports patch
  18978. // semantics.
  18979. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  18980. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18981. c.profileId = profileId
  18982. c.urlParams_.Set("id", fmt.Sprint(id))
  18983. c.campaign = campaign
  18984. return c
  18985. }
  18986. // Fields allows partial responses to be retrieved. See
  18987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18988. // for more information.
  18989. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  18990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18991. return c
  18992. }
  18993. // Context sets the context to be used in this call's Do method. Any
  18994. // pending HTTP request will be aborted if the provided context is
  18995. // canceled.
  18996. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  18997. c.ctx_ = ctx
  18998. return c
  18999. }
  19000. // Header returns an http.Header that can be modified by the caller to
  19001. // add HTTP headers to the request.
  19002. func (c *CampaignsPatchCall) Header() http.Header {
  19003. if c.header_ == nil {
  19004. c.header_ = make(http.Header)
  19005. }
  19006. return c.header_
  19007. }
  19008. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  19009. reqHeaders := make(http.Header)
  19010. for k, v := range c.header_ {
  19011. reqHeaders[k] = v
  19012. }
  19013. reqHeaders.Set("User-Agent", c.s.userAgent())
  19014. var body io.Reader = nil
  19015. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  19016. if err != nil {
  19017. return nil, err
  19018. }
  19019. reqHeaders.Set("Content-Type", "application/json")
  19020. c.urlParams_.Set("alt", alt)
  19021. c.urlParams_.Set("prettyPrint", "false")
  19022. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  19023. urls += "?" + c.urlParams_.Encode()
  19024. req, err := http.NewRequest("PATCH", urls, body)
  19025. if err != nil {
  19026. return nil, err
  19027. }
  19028. req.Header = reqHeaders
  19029. googleapi.Expand(req.URL, map[string]string{
  19030. "profileId": strconv.FormatInt(c.profileId, 10),
  19031. })
  19032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19033. }
  19034. // Do executes the "dfareporting.campaigns.patch" call.
  19035. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  19036. // code is an error. Response headers are in either
  19037. // *Campaign.ServerResponse.Header or (if a response was returned at
  19038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19039. // to check whether the returned error was because
  19040. // http.StatusNotModified was returned.
  19041. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  19042. gensupport.SetOptions(c.urlParams_, opts...)
  19043. res, err := c.doRequest("json")
  19044. if res != nil && res.StatusCode == http.StatusNotModified {
  19045. if res.Body != nil {
  19046. res.Body.Close()
  19047. }
  19048. return nil, &googleapi.Error{
  19049. Code: res.StatusCode,
  19050. Header: res.Header,
  19051. }
  19052. }
  19053. if err != nil {
  19054. return nil, err
  19055. }
  19056. defer googleapi.CloseBody(res)
  19057. if err := googleapi.CheckResponse(res); err != nil {
  19058. return nil, err
  19059. }
  19060. ret := &Campaign{
  19061. ServerResponse: googleapi.ServerResponse{
  19062. Header: res.Header,
  19063. HTTPStatusCode: res.StatusCode,
  19064. },
  19065. }
  19066. target := &ret
  19067. if err := gensupport.DecodeResponse(target, res); err != nil {
  19068. return nil, err
  19069. }
  19070. return ret, nil
  19071. // {
  19072. // "description": "Updates an existing campaign. This method supports patch semantics.",
  19073. // "httpMethod": "PATCH",
  19074. // "id": "dfareporting.campaigns.patch",
  19075. // "parameterOrder": [
  19076. // "profileId",
  19077. // "id"
  19078. // ],
  19079. // "parameters": {
  19080. // "id": {
  19081. // "description": "Campaign ID.",
  19082. // "format": "int64",
  19083. // "location": "query",
  19084. // "required": true,
  19085. // "type": "string"
  19086. // },
  19087. // "profileId": {
  19088. // "description": "User profile ID associated with this request.",
  19089. // "format": "int64",
  19090. // "location": "path",
  19091. // "required": true,
  19092. // "type": "string"
  19093. // }
  19094. // },
  19095. // "path": "userprofiles/{profileId}/campaigns",
  19096. // "request": {
  19097. // "$ref": "Campaign"
  19098. // },
  19099. // "response": {
  19100. // "$ref": "Campaign"
  19101. // },
  19102. // "scopes": [
  19103. // "https://www.googleapis.com/auth/dfatrafficking"
  19104. // ]
  19105. // }
  19106. }
  19107. // method id "dfareporting.campaigns.update":
  19108. type CampaignsUpdateCall struct {
  19109. s *Service
  19110. profileId int64
  19111. campaign *Campaign
  19112. urlParams_ gensupport.URLParams
  19113. ctx_ context.Context
  19114. header_ http.Header
  19115. }
  19116. // Update: Updates an existing campaign.
  19117. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  19118. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19119. c.profileId = profileId
  19120. c.campaign = campaign
  19121. return c
  19122. }
  19123. // Fields allows partial responses to be retrieved. See
  19124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19125. // for more information.
  19126. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  19127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19128. return c
  19129. }
  19130. // Context sets the context to be used in this call's Do method. Any
  19131. // pending HTTP request will be aborted if the provided context is
  19132. // canceled.
  19133. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  19134. c.ctx_ = ctx
  19135. return c
  19136. }
  19137. // Header returns an http.Header that can be modified by the caller to
  19138. // add HTTP headers to the request.
  19139. func (c *CampaignsUpdateCall) Header() http.Header {
  19140. if c.header_ == nil {
  19141. c.header_ = make(http.Header)
  19142. }
  19143. return c.header_
  19144. }
  19145. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  19146. reqHeaders := make(http.Header)
  19147. for k, v := range c.header_ {
  19148. reqHeaders[k] = v
  19149. }
  19150. reqHeaders.Set("User-Agent", c.s.userAgent())
  19151. var body io.Reader = nil
  19152. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  19153. if err != nil {
  19154. return nil, err
  19155. }
  19156. reqHeaders.Set("Content-Type", "application/json")
  19157. c.urlParams_.Set("alt", alt)
  19158. c.urlParams_.Set("prettyPrint", "false")
  19159. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  19160. urls += "?" + c.urlParams_.Encode()
  19161. req, err := http.NewRequest("PUT", urls, body)
  19162. if err != nil {
  19163. return nil, err
  19164. }
  19165. req.Header = reqHeaders
  19166. googleapi.Expand(req.URL, map[string]string{
  19167. "profileId": strconv.FormatInt(c.profileId, 10),
  19168. })
  19169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19170. }
  19171. // Do executes the "dfareporting.campaigns.update" call.
  19172. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  19173. // code is an error. Response headers are in either
  19174. // *Campaign.ServerResponse.Header or (if a response was returned at
  19175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19176. // to check whether the returned error was because
  19177. // http.StatusNotModified was returned.
  19178. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  19179. gensupport.SetOptions(c.urlParams_, opts...)
  19180. res, err := c.doRequest("json")
  19181. if res != nil && res.StatusCode == http.StatusNotModified {
  19182. if res.Body != nil {
  19183. res.Body.Close()
  19184. }
  19185. return nil, &googleapi.Error{
  19186. Code: res.StatusCode,
  19187. Header: res.Header,
  19188. }
  19189. }
  19190. if err != nil {
  19191. return nil, err
  19192. }
  19193. defer googleapi.CloseBody(res)
  19194. if err := googleapi.CheckResponse(res); err != nil {
  19195. return nil, err
  19196. }
  19197. ret := &Campaign{
  19198. ServerResponse: googleapi.ServerResponse{
  19199. Header: res.Header,
  19200. HTTPStatusCode: res.StatusCode,
  19201. },
  19202. }
  19203. target := &ret
  19204. if err := gensupport.DecodeResponse(target, res); err != nil {
  19205. return nil, err
  19206. }
  19207. return ret, nil
  19208. // {
  19209. // "description": "Updates an existing campaign.",
  19210. // "httpMethod": "PUT",
  19211. // "id": "dfareporting.campaigns.update",
  19212. // "parameterOrder": [
  19213. // "profileId"
  19214. // ],
  19215. // "parameters": {
  19216. // "profileId": {
  19217. // "description": "User profile ID associated with this request.",
  19218. // "format": "int64",
  19219. // "location": "path",
  19220. // "required": true,
  19221. // "type": "string"
  19222. // }
  19223. // },
  19224. // "path": "userprofiles/{profileId}/campaigns",
  19225. // "request": {
  19226. // "$ref": "Campaign"
  19227. // },
  19228. // "response": {
  19229. // "$ref": "Campaign"
  19230. // },
  19231. // "scopes": [
  19232. // "https://www.googleapis.com/auth/dfatrafficking"
  19233. // ]
  19234. // }
  19235. }
  19236. // method id "dfareporting.changeLogs.get":
  19237. type ChangeLogsGetCall struct {
  19238. s *Service
  19239. profileId int64
  19240. id int64
  19241. urlParams_ gensupport.URLParams
  19242. ifNoneMatch_ string
  19243. ctx_ context.Context
  19244. header_ http.Header
  19245. }
  19246. // Get: Gets one change log by ID.
  19247. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  19248. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19249. c.profileId = profileId
  19250. c.id = id
  19251. return c
  19252. }
  19253. // Fields allows partial responses to be retrieved. See
  19254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19255. // for more information.
  19256. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  19257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19258. return c
  19259. }
  19260. // IfNoneMatch sets the optional parameter which makes the operation
  19261. // fail if the object's ETag matches the given value. This is useful for
  19262. // getting updates only after the object has changed since the last
  19263. // request. Use googleapi.IsNotModified to check whether the response
  19264. // error from Do is the result of In-None-Match.
  19265. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  19266. c.ifNoneMatch_ = entityTag
  19267. return c
  19268. }
  19269. // Context sets the context to be used in this call's Do method. Any
  19270. // pending HTTP request will be aborted if the provided context is
  19271. // canceled.
  19272. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  19273. c.ctx_ = ctx
  19274. return c
  19275. }
  19276. // Header returns an http.Header that can be modified by the caller to
  19277. // add HTTP headers to the request.
  19278. func (c *ChangeLogsGetCall) Header() http.Header {
  19279. if c.header_ == nil {
  19280. c.header_ = make(http.Header)
  19281. }
  19282. return c.header_
  19283. }
  19284. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  19285. reqHeaders := make(http.Header)
  19286. for k, v := range c.header_ {
  19287. reqHeaders[k] = v
  19288. }
  19289. reqHeaders.Set("User-Agent", c.s.userAgent())
  19290. if c.ifNoneMatch_ != "" {
  19291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19292. }
  19293. var body io.Reader = nil
  19294. c.urlParams_.Set("alt", alt)
  19295. c.urlParams_.Set("prettyPrint", "false")
  19296. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  19297. urls += "?" + c.urlParams_.Encode()
  19298. req, err := http.NewRequest("GET", urls, body)
  19299. if err != nil {
  19300. return nil, err
  19301. }
  19302. req.Header = reqHeaders
  19303. googleapi.Expand(req.URL, map[string]string{
  19304. "profileId": strconv.FormatInt(c.profileId, 10),
  19305. "id": strconv.FormatInt(c.id, 10),
  19306. })
  19307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19308. }
  19309. // Do executes the "dfareporting.changeLogs.get" call.
  19310. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  19311. // status code is an error. Response headers are in either
  19312. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  19313. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19314. // to check whether the returned error was because
  19315. // http.StatusNotModified was returned.
  19316. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  19317. gensupport.SetOptions(c.urlParams_, opts...)
  19318. res, err := c.doRequest("json")
  19319. if res != nil && res.StatusCode == http.StatusNotModified {
  19320. if res.Body != nil {
  19321. res.Body.Close()
  19322. }
  19323. return nil, &googleapi.Error{
  19324. Code: res.StatusCode,
  19325. Header: res.Header,
  19326. }
  19327. }
  19328. if err != nil {
  19329. return nil, err
  19330. }
  19331. defer googleapi.CloseBody(res)
  19332. if err := googleapi.CheckResponse(res); err != nil {
  19333. return nil, err
  19334. }
  19335. ret := &ChangeLog{
  19336. ServerResponse: googleapi.ServerResponse{
  19337. Header: res.Header,
  19338. HTTPStatusCode: res.StatusCode,
  19339. },
  19340. }
  19341. target := &ret
  19342. if err := gensupport.DecodeResponse(target, res); err != nil {
  19343. return nil, err
  19344. }
  19345. return ret, nil
  19346. // {
  19347. // "description": "Gets one change log by ID.",
  19348. // "httpMethod": "GET",
  19349. // "id": "dfareporting.changeLogs.get",
  19350. // "parameterOrder": [
  19351. // "profileId",
  19352. // "id"
  19353. // ],
  19354. // "parameters": {
  19355. // "id": {
  19356. // "description": "Change log ID.",
  19357. // "format": "int64",
  19358. // "location": "path",
  19359. // "required": true,
  19360. // "type": "string"
  19361. // },
  19362. // "profileId": {
  19363. // "description": "User profile ID associated with this request.",
  19364. // "format": "int64",
  19365. // "location": "path",
  19366. // "required": true,
  19367. // "type": "string"
  19368. // }
  19369. // },
  19370. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  19371. // "response": {
  19372. // "$ref": "ChangeLog"
  19373. // },
  19374. // "scopes": [
  19375. // "https://www.googleapis.com/auth/dfatrafficking"
  19376. // ]
  19377. // }
  19378. }
  19379. // method id "dfareporting.changeLogs.list":
  19380. type ChangeLogsListCall struct {
  19381. s *Service
  19382. profileId int64
  19383. urlParams_ gensupport.URLParams
  19384. ifNoneMatch_ string
  19385. ctx_ context.Context
  19386. header_ http.Header
  19387. }
  19388. // List: Retrieves a list of change logs. This method supports paging.
  19389. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  19390. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19391. c.profileId = profileId
  19392. return c
  19393. }
  19394. // Action sets the optional parameter "action": Select only change logs
  19395. // with the specified action.
  19396. //
  19397. // Possible values:
  19398. // "ACTION_ADD"
  19399. // "ACTION_ASSIGN"
  19400. // "ACTION_ASSOCIATE"
  19401. // "ACTION_CREATE"
  19402. // "ACTION_DELETE"
  19403. // "ACTION_DISABLE"
  19404. // "ACTION_EMAIL_TAGS"
  19405. // "ACTION_ENABLE"
  19406. // "ACTION_LINK"
  19407. // "ACTION_MARK_AS_DEFAULT"
  19408. // "ACTION_PUSH"
  19409. // "ACTION_REMOVE"
  19410. // "ACTION_SEND"
  19411. // "ACTION_SHARE"
  19412. // "ACTION_UNASSIGN"
  19413. // "ACTION_UNLINK"
  19414. // "ACTION_UPDATE"
  19415. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  19416. c.urlParams_.Set("action", action)
  19417. return c
  19418. }
  19419. // Ids sets the optional parameter "ids": Select only change logs with
  19420. // these IDs.
  19421. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  19422. var ids_ []string
  19423. for _, v := range ids {
  19424. ids_ = append(ids_, fmt.Sprint(v))
  19425. }
  19426. c.urlParams_.SetMulti("ids", ids_)
  19427. return c
  19428. }
  19429. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  19430. // only change logs whose change time is before the specified
  19431. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  19432. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19433. // America/New York time zone, the format is
  19434. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19435. // the letter T, the hour (24-hour clock system), minute, second, and
  19436. // then the time zone offset.
  19437. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  19438. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  19439. return c
  19440. }
  19441. // MaxResults sets the optional parameter "maxResults": Maximum number
  19442. // of results to return.
  19443. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  19444. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19445. return c
  19446. }
  19447. // MinChangeTime sets the optional parameter "minChangeTime": Select
  19448. // only change logs whose change time is before the specified
  19449. // minChangeTime.The time should be formatted as an RFC3339 date/time
  19450. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19451. // America/New York time zone, the format is
  19452. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19453. // the letter T, the hour (24-hour clock system), minute, second, and
  19454. // then the time zone offset.
  19455. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  19456. c.urlParams_.Set("minChangeTime", minChangeTime)
  19457. return c
  19458. }
  19459. // ObjectIds sets the optional parameter "objectIds": Select only change
  19460. // logs with these object IDs.
  19461. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  19462. var objectIds_ []string
  19463. for _, v := range objectIds {
  19464. objectIds_ = append(objectIds_, fmt.Sprint(v))
  19465. }
  19466. c.urlParams_.SetMulti("objectIds", objectIds_)
  19467. return c
  19468. }
  19469. // ObjectType sets the optional parameter "objectType": Select only
  19470. // change logs with the specified object type.
  19471. //
  19472. // Possible values:
  19473. // "OBJECT_ACCOUNT"
  19474. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  19475. // "OBJECT_AD"
  19476. // "OBJECT_ADVERTISER"
  19477. // "OBJECT_ADVERTISER_GROUP"
  19478. // "OBJECT_BILLING_ACCOUNT_GROUP"
  19479. // "OBJECT_BILLING_FEATURE"
  19480. // "OBJECT_BILLING_MINIMUM_FEE"
  19481. // "OBJECT_BILLING_PROFILE"
  19482. // "OBJECT_CAMPAIGN"
  19483. // "OBJECT_CONTENT_CATEGORY"
  19484. // "OBJECT_CREATIVE"
  19485. // "OBJECT_CREATIVE_ASSET"
  19486. // "OBJECT_CREATIVE_BUNDLE"
  19487. // "OBJECT_CREATIVE_FIELD"
  19488. // "OBJECT_CREATIVE_GROUP"
  19489. // "OBJECT_DFA_SITE"
  19490. // "OBJECT_EVENT_TAG"
  19491. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  19492. // "OBJECT_FLOODLIGHT_ACTVITY"
  19493. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  19494. // "OBJECT_INSTREAM_CREATIVE"
  19495. // "OBJECT_LANDING_PAGE"
  19496. // "OBJECT_MEDIA_ORDER"
  19497. // "OBJECT_PLACEMENT"
  19498. // "OBJECT_PLACEMENT_STRATEGY"
  19499. // "OBJECT_PLAYSTORE_LINK"
  19500. // "OBJECT_PROVIDED_LIST_CLIENT"
  19501. // "OBJECT_RATE_CARD"
  19502. // "OBJECT_REMARKETING_LIST"
  19503. // "OBJECT_RICHMEDIA_CREATIVE"
  19504. // "OBJECT_SD_SITE"
  19505. // "OBJECT_SEARCH_LIFT_STUDY"
  19506. // "OBJECT_SIZE"
  19507. // "OBJECT_SUBACCOUNT"
  19508. // "OBJECT_TARGETING_TEMPLATE"
  19509. // "OBJECT_USER_PROFILE"
  19510. // "OBJECT_USER_PROFILE_FILTER"
  19511. // "OBJECT_USER_ROLE"
  19512. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  19513. c.urlParams_.Set("objectType", objectType)
  19514. return c
  19515. }
  19516. // PageToken sets the optional parameter "pageToken": Value of the
  19517. // nextPageToken from the previous result page.
  19518. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  19519. c.urlParams_.Set("pageToken", pageToken)
  19520. return c
  19521. }
  19522. // SearchString sets the optional parameter "searchString": Select only
  19523. // change logs whose object ID, user name, old or new values match the
  19524. // search string.
  19525. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  19526. c.urlParams_.Set("searchString", searchString)
  19527. return c
  19528. }
  19529. // UserProfileIds sets the optional parameter "userProfileIds": Select
  19530. // only change logs with these user profile IDs.
  19531. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  19532. var userProfileIds_ []string
  19533. for _, v := range userProfileIds {
  19534. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  19535. }
  19536. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  19537. return c
  19538. }
  19539. // Fields allows partial responses to be retrieved. See
  19540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19541. // for more information.
  19542. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  19543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19544. return c
  19545. }
  19546. // IfNoneMatch sets the optional parameter which makes the operation
  19547. // fail if the object's ETag matches the given value. This is useful for
  19548. // getting updates only after the object has changed since the last
  19549. // request. Use googleapi.IsNotModified to check whether the response
  19550. // error from Do is the result of In-None-Match.
  19551. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  19552. c.ifNoneMatch_ = entityTag
  19553. return c
  19554. }
  19555. // Context sets the context to be used in this call's Do method. Any
  19556. // pending HTTP request will be aborted if the provided context is
  19557. // canceled.
  19558. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  19559. c.ctx_ = ctx
  19560. return c
  19561. }
  19562. // Header returns an http.Header that can be modified by the caller to
  19563. // add HTTP headers to the request.
  19564. func (c *ChangeLogsListCall) Header() http.Header {
  19565. if c.header_ == nil {
  19566. c.header_ = make(http.Header)
  19567. }
  19568. return c.header_
  19569. }
  19570. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  19571. reqHeaders := make(http.Header)
  19572. for k, v := range c.header_ {
  19573. reqHeaders[k] = v
  19574. }
  19575. reqHeaders.Set("User-Agent", c.s.userAgent())
  19576. if c.ifNoneMatch_ != "" {
  19577. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19578. }
  19579. var body io.Reader = nil
  19580. c.urlParams_.Set("alt", alt)
  19581. c.urlParams_.Set("prettyPrint", "false")
  19582. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  19583. urls += "?" + c.urlParams_.Encode()
  19584. req, err := http.NewRequest("GET", urls, body)
  19585. if err != nil {
  19586. return nil, err
  19587. }
  19588. req.Header = reqHeaders
  19589. googleapi.Expand(req.URL, map[string]string{
  19590. "profileId": strconv.FormatInt(c.profileId, 10),
  19591. })
  19592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19593. }
  19594. // Do executes the "dfareporting.changeLogs.list" call.
  19595. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  19596. // non-2xx status code is an error. Response headers are in either
  19597. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  19598. // returned at all) in error.(*googleapi.Error).Header. Use
  19599. // googleapi.IsNotModified to check whether the returned error was
  19600. // because http.StatusNotModified was returned.
  19601. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  19602. gensupport.SetOptions(c.urlParams_, opts...)
  19603. res, err := c.doRequest("json")
  19604. if res != nil && res.StatusCode == http.StatusNotModified {
  19605. if res.Body != nil {
  19606. res.Body.Close()
  19607. }
  19608. return nil, &googleapi.Error{
  19609. Code: res.StatusCode,
  19610. Header: res.Header,
  19611. }
  19612. }
  19613. if err != nil {
  19614. return nil, err
  19615. }
  19616. defer googleapi.CloseBody(res)
  19617. if err := googleapi.CheckResponse(res); err != nil {
  19618. return nil, err
  19619. }
  19620. ret := &ChangeLogsListResponse{
  19621. ServerResponse: googleapi.ServerResponse{
  19622. Header: res.Header,
  19623. HTTPStatusCode: res.StatusCode,
  19624. },
  19625. }
  19626. target := &ret
  19627. if err := gensupport.DecodeResponse(target, res); err != nil {
  19628. return nil, err
  19629. }
  19630. return ret, nil
  19631. // {
  19632. // "description": "Retrieves a list of change logs. This method supports paging.",
  19633. // "httpMethod": "GET",
  19634. // "id": "dfareporting.changeLogs.list",
  19635. // "parameterOrder": [
  19636. // "profileId"
  19637. // ],
  19638. // "parameters": {
  19639. // "action": {
  19640. // "description": "Select only change logs with the specified action.",
  19641. // "enum": [
  19642. // "ACTION_ADD",
  19643. // "ACTION_ASSIGN",
  19644. // "ACTION_ASSOCIATE",
  19645. // "ACTION_CREATE",
  19646. // "ACTION_DELETE",
  19647. // "ACTION_DISABLE",
  19648. // "ACTION_EMAIL_TAGS",
  19649. // "ACTION_ENABLE",
  19650. // "ACTION_LINK",
  19651. // "ACTION_MARK_AS_DEFAULT",
  19652. // "ACTION_PUSH",
  19653. // "ACTION_REMOVE",
  19654. // "ACTION_SEND",
  19655. // "ACTION_SHARE",
  19656. // "ACTION_UNASSIGN",
  19657. // "ACTION_UNLINK",
  19658. // "ACTION_UPDATE"
  19659. // ],
  19660. // "enumDescriptions": [
  19661. // "",
  19662. // "",
  19663. // "",
  19664. // "",
  19665. // "",
  19666. // "",
  19667. // "",
  19668. // "",
  19669. // "",
  19670. // "",
  19671. // "",
  19672. // "",
  19673. // "",
  19674. // "",
  19675. // "",
  19676. // "",
  19677. // ""
  19678. // ],
  19679. // "location": "query",
  19680. // "type": "string"
  19681. // },
  19682. // "ids": {
  19683. // "description": "Select only change logs with these IDs.",
  19684. // "format": "int64",
  19685. // "location": "query",
  19686. // "repeated": true,
  19687. // "type": "string"
  19688. // },
  19689. // "maxChangeTime": {
  19690. // "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.",
  19691. // "location": "query",
  19692. // "type": "string"
  19693. // },
  19694. // "maxResults": {
  19695. // "default": "1000",
  19696. // "description": "Maximum number of results to return.",
  19697. // "format": "int32",
  19698. // "location": "query",
  19699. // "maximum": "1000",
  19700. // "minimum": "0",
  19701. // "type": "integer"
  19702. // },
  19703. // "minChangeTime": {
  19704. // "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.",
  19705. // "location": "query",
  19706. // "type": "string"
  19707. // },
  19708. // "objectIds": {
  19709. // "description": "Select only change logs with these object IDs.",
  19710. // "format": "int64",
  19711. // "location": "query",
  19712. // "repeated": true,
  19713. // "type": "string"
  19714. // },
  19715. // "objectType": {
  19716. // "description": "Select only change logs with the specified object type.",
  19717. // "enum": [
  19718. // "OBJECT_ACCOUNT",
  19719. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  19720. // "OBJECT_AD",
  19721. // "OBJECT_ADVERTISER",
  19722. // "OBJECT_ADVERTISER_GROUP",
  19723. // "OBJECT_BILLING_ACCOUNT_GROUP",
  19724. // "OBJECT_BILLING_FEATURE",
  19725. // "OBJECT_BILLING_MINIMUM_FEE",
  19726. // "OBJECT_BILLING_PROFILE",
  19727. // "OBJECT_CAMPAIGN",
  19728. // "OBJECT_CONTENT_CATEGORY",
  19729. // "OBJECT_CREATIVE",
  19730. // "OBJECT_CREATIVE_ASSET",
  19731. // "OBJECT_CREATIVE_BUNDLE",
  19732. // "OBJECT_CREATIVE_FIELD",
  19733. // "OBJECT_CREATIVE_GROUP",
  19734. // "OBJECT_DFA_SITE",
  19735. // "OBJECT_EVENT_TAG",
  19736. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  19737. // "OBJECT_FLOODLIGHT_ACTVITY",
  19738. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  19739. // "OBJECT_INSTREAM_CREATIVE",
  19740. // "OBJECT_LANDING_PAGE",
  19741. // "OBJECT_MEDIA_ORDER",
  19742. // "OBJECT_PLACEMENT",
  19743. // "OBJECT_PLACEMENT_STRATEGY",
  19744. // "OBJECT_PLAYSTORE_LINK",
  19745. // "OBJECT_PROVIDED_LIST_CLIENT",
  19746. // "OBJECT_RATE_CARD",
  19747. // "OBJECT_REMARKETING_LIST",
  19748. // "OBJECT_RICHMEDIA_CREATIVE",
  19749. // "OBJECT_SD_SITE",
  19750. // "OBJECT_SEARCH_LIFT_STUDY",
  19751. // "OBJECT_SIZE",
  19752. // "OBJECT_SUBACCOUNT",
  19753. // "OBJECT_TARGETING_TEMPLATE",
  19754. // "OBJECT_USER_PROFILE",
  19755. // "OBJECT_USER_PROFILE_FILTER",
  19756. // "OBJECT_USER_ROLE"
  19757. // ],
  19758. // "enumDescriptions": [
  19759. // "",
  19760. // "",
  19761. // "",
  19762. // "",
  19763. // "",
  19764. // "",
  19765. // "",
  19766. // "",
  19767. // "",
  19768. // "",
  19769. // "",
  19770. // "",
  19771. // "",
  19772. // "",
  19773. // "",
  19774. // "",
  19775. // "",
  19776. // "",
  19777. // "",
  19778. // "",
  19779. // "",
  19780. // "",
  19781. // "",
  19782. // "",
  19783. // "",
  19784. // "",
  19785. // "",
  19786. // "",
  19787. // "",
  19788. // "",
  19789. // "",
  19790. // "",
  19791. // "",
  19792. // "",
  19793. // "",
  19794. // "",
  19795. // "",
  19796. // "",
  19797. // ""
  19798. // ],
  19799. // "location": "query",
  19800. // "type": "string"
  19801. // },
  19802. // "pageToken": {
  19803. // "description": "Value of the nextPageToken from the previous result page.",
  19804. // "location": "query",
  19805. // "type": "string"
  19806. // },
  19807. // "profileId": {
  19808. // "description": "User profile ID associated with this request.",
  19809. // "format": "int64",
  19810. // "location": "path",
  19811. // "required": true,
  19812. // "type": "string"
  19813. // },
  19814. // "searchString": {
  19815. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  19816. // "location": "query",
  19817. // "type": "string"
  19818. // },
  19819. // "userProfileIds": {
  19820. // "description": "Select only change logs with these user profile IDs.",
  19821. // "format": "int64",
  19822. // "location": "query",
  19823. // "repeated": true,
  19824. // "type": "string"
  19825. // }
  19826. // },
  19827. // "path": "userprofiles/{profileId}/changeLogs",
  19828. // "response": {
  19829. // "$ref": "ChangeLogsListResponse"
  19830. // },
  19831. // "scopes": [
  19832. // "https://www.googleapis.com/auth/dfatrafficking"
  19833. // ]
  19834. // }
  19835. }
  19836. // Pages invokes f for each page of results.
  19837. // A non-nil error returned from f will halt the iteration.
  19838. // The provided context supersedes any context provided to the Context method.
  19839. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  19840. c.ctx_ = ctx
  19841. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19842. for {
  19843. x, err := c.Do()
  19844. if err != nil {
  19845. return err
  19846. }
  19847. if err := f(x); err != nil {
  19848. return err
  19849. }
  19850. if x.NextPageToken == "" {
  19851. return nil
  19852. }
  19853. c.PageToken(x.NextPageToken)
  19854. }
  19855. }
  19856. // method id "dfareporting.cities.list":
  19857. type CitiesListCall struct {
  19858. s *Service
  19859. profileId int64
  19860. urlParams_ gensupport.URLParams
  19861. ifNoneMatch_ string
  19862. ctx_ context.Context
  19863. header_ http.Header
  19864. }
  19865. // List: Retrieves a list of cities, possibly filtered.
  19866. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  19867. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19868. c.profileId = profileId
  19869. return c
  19870. }
  19871. // CountryDartIds sets the optional parameter "countryDartIds": Select
  19872. // only cities from these countries.
  19873. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  19874. var countryDartIds_ []string
  19875. for _, v := range countryDartIds {
  19876. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  19877. }
  19878. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  19879. return c
  19880. }
  19881. // DartIds sets the optional parameter "dartIds": Select only cities
  19882. // with these DART IDs.
  19883. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  19884. var dartIds_ []string
  19885. for _, v := range dartIds {
  19886. dartIds_ = append(dartIds_, fmt.Sprint(v))
  19887. }
  19888. c.urlParams_.SetMulti("dartIds", dartIds_)
  19889. return c
  19890. }
  19891. // NamePrefix sets the optional parameter "namePrefix": Select only
  19892. // cities with names starting with this prefix.
  19893. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  19894. c.urlParams_.Set("namePrefix", namePrefix)
  19895. return c
  19896. }
  19897. // RegionDartIds sets the optional parameter "regionDartIds": Select
  19898. // only cities from these regions.
  19899. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  19900. var regionDartIds_ []string
  19901. for _, v := range regionDartIds {
  19902. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  19903. }
  19904. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  19905. return c
  19906. }
  19907. // Fields allows partial responses to be retrieved. See
  19908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19909. // for more information.
  19910. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  19911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19912. return c
  19913. }
  19914. // IfNoneMatch sets the optional parameter which makes the operation
  19915. // fail if the object's ETag matches the given value. This is useful for
  19916. // getting updates only after the object has changed since the last
  19917. // request. Use googleapi.IsNotModified to check whether the response
  19918. // error from Do is the result of In-None-Match.
  19919. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  19920. c.ifNoneMatch_ = entityTag
  19921. return c
  19922. }
  19923. // Context sets the context to be used in this call's Do method. Any
  19924. // pending HTTP request will be aborted if the provided context is
  19925. // canceled.
  19926. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  19927. c.ctx_ = ctx
  19928. return c
  19929. }
  19930. // Header returns an http.Header that can be modified by the caller to
  19931. // add HTTP headers to the request.
  19932. func (c *CitiesListCall) Header() http.Header {
  19933. if c.header_ == nil {
  19934. c.header_ = make(http.Header)
  19935. }
  19936. return c.header_
  19937. }
  19938. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  19939. reqHeaders := make(http.Header)
  19940. for k, v := range c.header_ {
  19941. reqHeaders[k] = v
  19942. }
  19943. reqHeaders.Set("User-Agent", c.s.userAgent())
  19944. if c.ifNoneMatch_ != "" {
  19945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19946. }
  19947. var body io.Reader = nil
  19948. c.urlParams_.Set("alt", alt)
  19949. c.urlParams_.Set("prettyPrint", "false")
  19950. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  19951. urls += "?" + c.urlParams_.Encode()
  19952. req, err := http.NewRequest("GET", urls, body)
  19953. if err != nil {
  19954. return nil, err
  19955. }
  19956. req.Header = reqHeaders
  19957. googleapi.Expand(req.URL, map[string]string{
  19958. "profileId": strconv.FormatInt(c.profileId, 10),
  19959. })
  19960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19961. }
  19962. // Do executes the "dfareporting.cities.list" call.
  19963. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  19964. // non-2xx status code is an error. Response headers are in either
  19965. // *CitiesListResponse.ServerResponse.Header or (if a response was
  19966. // returned at all) in error.(*googleapi.Error).Header. Use
  19967. // googleapi.IsNotModified to check whether the returned error was
  19968. // because http.StatusNotModified was returned.
  19969. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  19970. gensupport.SetOptions(c.urlParams_, opts...)
  19971. res, err := c.doRequest("json")
  19972. if res != nil && res.StatusCode == http.StatusNotModified {
  19973. if res.Body != nil {
  19974. res.Body.Close()
  19975. }
  19976. return nil, &googleapi.Error{
  19977. Code: res.StatusCode,
  19978. Header: res.Header,
  19979. }
  19980. }
  19981. if err != nil {
  19982. return nil, err
  19983. }
  19984. defer googleapi.CloseBody(res)
  19985. if err := googleapi.CheckResponse(res); err != nil {
  19986. return nil, err
  19987. }
  19988. ret := &CitiesListResponse{
  19989. ServerResponse: googleapi.ServerResponse{
  19990. Header: res.Header,
  19991. HTTPStatusCode: res.StatusCode,
  19992. },
  19993. }
  19994. target := &ret
  19995. if err := gensupport.DecodeResponse(target, res); err != nil {
  19996. return nil, err
  19997. }
  19998. return ret, nil
  19999. // {
  20000. // "description": "Retrieves a list of cities, possibly filtered.",
  20001. // "httpMethod": "GET",
  20002. // "id": "dfareporting.cities.list",
  20003. // "parameterOrder": [
  20004. // "profileId"
  20005. // ],
  20006. // "parameters": {
  20007. // "countryDartIds": {
  20008. // "description": "Select only cities from these countries.",
  20009. // "format": "int64",
  20010. // "location": "query",
  20011. // "repeated": true,
  20012. // "type": "string"
  20013. // },
  20014. // "dartIds": {
  20015. // "description": "Select only cities with these DART IDs.",
  20016. // "format": "int64",
  20017. // "location": "query",
  20018. // "repeated": true,
  20019. // "type": "string"
  20020. // },
  20021. // "namePrefix": {
  20022. // "description": "Select only cities with names starting with this prefix.",
  20023. // "location": "query",
  20024. // "type": "string"
  20025. // },
  20026. // "profileId": {
  20027. // "description": "User profile ID associated with this request.",
  20028. // "format": "int64",
  20029. // "location": "path",
  20030. // "required": true,
  20031. // "type": "string"
  20032. // },
  20033. // "regionDartIds": {
  20034. // "description": "Select only cities from these regions.",
  20035. // "format": "int64",
  20036. // "location": "query",
  20037. // "repeated": true,
  20038. // "type": "string"
  20039. // }
  20040. // },
  20041. // "path": "userprofiles/{profileId}/cities",
  20042. // "response": {
  20043. // "$ref": "CitiesListResponse"
  20044. // },
  20045. // "scopes": [
  20046. // "https://www.googleapis.com/auth/dfatrafficking"
  20047. // ]
  20048. // }
  20049. }
  20050. // method id "dfareporting.connectionTypes.get":
  20051. type ConnectionTypesGetCall struct {
  20052. s *Service
  20053. profileId int64
  20054. id int64
  20055. urlParams_ gensupport.URLParams
  20056. ifNoneMatch_ string
  20057. ctx_ context.Context
  20058. header_ http.Header
  20059. }
  20060. // Get: Gets one connection type by ID.
  20061. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  20062. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20063. c.profileId = profileId
  20064. c.id = id
  20065. return c
  20066. }
  20067. // Fields allows partial responses to be retrieved. See
  20068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20069. // for more information.
  20070. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  20071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20072. return c
  20073. }
  20074. // IfNoneMatch sets the optional parameter which makes the operation
  20075. // fail if the object's ETag matches the given value. This is useful for
  20076. // getting updates only after the object has changed since the last
  20077. // request. Use googleapi.IsNotModified to check whether the response
  20078. // error from Do is the result of In-None-Match.
  20079. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  20080. c.ifNoneMatch_ = entityTag
  20081. return c
  20082. }
  20083. // Context sets the context to be used in this call's Do method. Any
  20084. // pending HTTP request will be aborted if the provided context is
  20085. // canceled.
  20086. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  20087. c.ctx_ = ctx
  20088. return c
  20089. }
  20090. // Header returns an http.Header that can be modified by the caller to
  20091. // add HTTP headers to the request.
  20092. func (c *ConnectionTypesGetCall) Header() http.Header {
  20093. if c.header_ == nil {
  20094. c.header_ = make(http.Header)
  20095. }
  20096. return c.header_
  20097. }
  20098. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  20099. reqHeaders := make(http.Header)
  20100. for k, v := range c.header_ {
  20101. reqHeaders[k] = v
  20102. }
  20103. reqHeaders.Set("User-Agent", c.s.userAgent())
  20104. if c.ifNoneMatch_ != "" {
  20105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20106. }
  20107. var body io.Reader = nil
  20108. c.urlParams_.Set("alt", alt)
  20109. c.urlParams_.Set("prettyPrint", "false")
  20110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  20111. urls += "?" + c.urlParams_.Encode()
  20112. req, err := http.NewRequest("GET", urls, body)
  20113. if err != nil {
  20114. return nil, err
  20115. }
  20116. req.Header = reqHeaders
  20117. googleapi.Expand(req.URL, map[string]string{
  20118. "profileId": strconv.FormatInt(c.profileId, 10),
  20119. "id": strconv.FormatInt(c.id, 10),
  20120. })
  20121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20122. }
  20123. // Do executes the "dfareporting.connectionTypes.get" call.
  20124. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  20125. // status code is an error. Response headers are in either
  20126. // *ConnectionType.ServerResponse.Header or (if a response was returned
  20127. // at all) in error.(*googleapi.Error).Header. Use
  20128. // googleapi.IsNotModified to check whether the returned error was
  20129. // because http.StatusNotModified was returned.
  20130. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  20131. gensupport.SetOptions(c.urlParams_, opts...)
  20132. res, err := c.doRequest("json")
  20133. if res != nil && res.StatusCode == http.StatusNotModified {
  20134. if res.Body != nil {
  20135. res.Body.Close()
  20136. }
  20137. return nil, &googleapi.Error{
  20138. Code: res.StatusCode,
  20139. Header: res.Header,
  20140. }
  20141. }
  20142. if err != nil {
  20143. return nil, err
  20144. }
  20145. defer googleapi.CloseBody(res)
  20146. if err := googleapi.CheckResponse(res); err != nil {
  20147. return nil, err
  20148. }
  20149. ret := &ConnectionType{
  20150. ServerResponse: googleapi.ServerResponse{
  20151. Header: res.Header,
  20152. HTTPStatusCode: res.StatusCode,
  20153. },
  20154. }
  20155. target := &ret
  20156. if err := gensupport.DecodeResponse(target, res); err != nil {
  20157. return nil, err
  20158. }
  20159. return ret, nil
  20160. // {
  20161. // "description": "Gets one connection type by ID.",
  20162. // "httpMethod": "GET",
  20163. // "id": "dfareporting.connectionTypes.get",
  20164. // "parameterOrder": [
  20165. // "profileId",
  20166. // "id"
  20167. // ],
  20168. // "parameters": {
  20169. // "id": {
  20170. // "description": "Connection type ID.",
  20171. // "format": "int64",
  20172. // "location": "path",
  20173. // "required": true,
  20174. // "type": "string"
  20175. // },
  20176. // "profileId": {
  20177. // "description": "User profile ID associated with this request.",
  20178. // "format": "int64",
  20179. // "location": "path",
  20180. // "required": true,
  20181. // "type": "string"
  20182. // }
  20183. // },
  20184. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  20185. // "response": {
  20186. // "$ref": "ConnectionType"
  20187. // },
  20188. // "scopes": [
  20189. // "https://www.googleapis.com/auth/dfatrafficking"
  20190. // ]
  20191. // }
  20192. }
  20193. // method id "dfareporting.connectionTypes.list":
  20194. type ConnectionTypesListCall struct {
  20195. s *Service
  20196. profileId int64
  20197. urlParams_ gensupport.URLParams
  20198. ifNoneMatch_ string
  20199. ctx_ context.Context
  20200. header_ http.Header
  20201. }
  20202. // List: Retrieves a list of connection types.
  20203. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  20204. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20205. c.profileId = profileId
  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 *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  20212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20213. return c
  20214. }
  20215. // IfNoneMatch sets the optional parameter which makes the operation
  20216. // fail if the object's ETag matches the given value. This is useful for
  20217. // getting updates only after the object has changed since the last
  20218. // request. Use googleapi.IsNotModified to check whether the response
  20219. // error from Do is the result of In-None-Match.
  20220. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  20221. c.ifNoneMatch_ = entityTag
  20222. return c
  20223. }
  20224. // Context sets the context to be used in this call's Do method. Any
  20225. // pending HTTP request will be aborted if the provided context is
  20226. // canceled.
  20227. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  20228. c.ctx_ = ctx
  20229. return c
  20230. }
  20231. // Header returns an http.Header that can be modified by the caller to
  20232. // add HTTP headers to the request.
  20233. func (c *ConnectionTypesListCall) Header() http.Header {
  20234. if c.header_ == nil {
  20235. c.header_ = make(http.Header)
  20236. }
  20237. return c.header_
  20238. }
  20239. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  20240. reqHeaders := make(http.Header)
  20241. for k, v := range c.header_ {
  20242. reqHeaders[k] = v
  20243. }
  20244. reqHeaders.Set("User-Agent", c.s.userAgent())
  20245. if c.ifNoneMatch_ != "" {
  20246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20247. }
  20248. var body io.Reader = nil
  20249. c.urlParams_.Set("alt", alt)
  20250. c.urlParams_.Set("prettyPrint", "false")
  20251. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  20252. urls += "?" + c.urlParams_.Encode()
  20253. req, err := http.NewRequest("GET", urls, body)
  20254. if err != nil {
  20255. return nil, err
  20256. }
  20257. req.Header = reqHeaders
  20258. googleapi.Expand(req.URL, map[string]string{
  20259. "profileId": strconv.FormatInt(c.profileId, 10),
  20260. })
  20261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20262. }
  20263. // Do executes the "dfareporting.connectionTypes.list" call.
  20264. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  20265. // Any non-2xx status code is an error. Response headers are in either
  20266. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  20267. // was returned at all) in error.(*googleapi.Error).Header. Use
  20268. // googleapi.IsNotModified to check whether the returned error was
  20269. // because http.StatusNotModified was returned.
  20270. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  20271. gensupport.SetOptions(c.urlParams_, opts...)
  20272. res, err := c.doRequest("json")
  20273. if res != nil && res.StatusCode == http.StatusNotModified {
  20274. if res.Body != nil {
  20275. res.Body.Close()
  20276. }
  20277. return nil, &googleapi.Error{
  20278. Code: res.StatusCode,
  20279. Header: res.Header,
  20280. }
  20281. }
  20282. if err != nil {
  20283. return nil, err
  20284. }
  20285. defer googleapi.CloseBody(res)
  20286. if err := googleapi.CheckResponse(res); err != nil {
  20287. return nil, err
  20288. }
  20289. ret := &ConnectionTypesListResponse{
  20290. ServerResponse: googleapi.ServerResponse{
  20291. Header: res.Header,
  20292. HTTPStatusCode: res.StatusCode,
  20293. },
  20294. }
  20295. target := &ret
  20296. if err := gensupport.DecodeResponse(target, res); err != nil {
  20297. return nil, err
  20298. }
  20299. return ret, nil
  20300. // {
  20301. // "description": "Retrieves a list of connection types.",
  20302. // "httpMethod": "GET",
  20303. // "id": "dfareporting.connectionTypes.list",
  20304. // "parameterOrder": [
  20305. // "profileId"
  20306. // ],
  20307. // "parameters": {
  20308. // "profileId": {
  20309. // "description": "User profile ID associated with this request.",
  20310. // "format": "int64",
  20311. // "location": "path",
  20312. // "required": true,
  20313. // "type": "string"
  20314. // }
  20315. // },
  20316. // "path": "userprofiles/{profileId}/connectionTypes",
  20317. // "response": {
  20318. // "$ref": "ConnectionTypesListResponse"
  20319. // },
  20320. // "scopes": [
  20321. // "https://www.googleapis.com/auth/dfatrafficking"
  20322. // ]
  20323. // }
  20324. }
  20325. // method id "dfareporting.contentCategories.delete":
  20326. type ContentCategoriesDeleteCall struct {
  20327. s *Service
  20328. profileId int64
  20329. id int64
  20330. urlParams_ gensupport.URLParams
  20331. ctx_ context.Context
  20332. header_ http.Header
  20333. }
  20334. // Delete: Deletes an existing content category.
  20335. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  20336. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20337. c.profileId = profileId
  20338. c.id = id
  20339. return c
  20340. }
  20341. // Fields allows partial responses to be retrieved. See
  20342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20343. // for more information.
  20344. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  20345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20346. return c
  20347. }
  20348. // Context sets the context to be used in this call's Do method. Any
  20349. // pending HTTP request will be aborted if the provided context is
  20350. // canceled.
  20351. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  20352. c.ctx_ = ctx
  20353. return c
  20354. }
  20355. // Header returns an http.Header that can be modified by the caller to
  20356. // add HTTP headers to the request.
  20357. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  20358. if c.header_ == nil {
  20359. c.header_ = make(http.Header)
  20360. }
  20361. return c.header_
  20362. }
  20363. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20364. reqHeaders := make(http.Header)
  20365. for k, v := range c.header_ {
  20366. reqHeaders[k] = v
  20367. }
  20368. reqHeaders.Set("User-Agent", c.s.userAgent())
  20369. var body io.Reader = nil
  20370. c.urlParams_.Set("alt", alt)
  20371. c.urlParams_.Set("prettyPrint", "false")
  20372. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20373. urls += "?" + c.urlParams_.Encode()
  20374. req, err := http.NewRequest("DELETE", urls, body)
  20375. if err != nil {
  20376. return nil, err
  20377. }
  20378. req.Header = reqHeaders
  20379. googleapi.Expand(req.URL, map[string]string{
  20380. "profileId": strconv.FormatInt(c.profileId, 10),
  20381. "id": strconv.FormatInt(c.id, 10),
  20382. })
  20383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20384. }
  20385. // Do executes the "dfareporting.contentCategories.delete" call.
  20386. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20387. gensupport.SetOptions(c.urlParams_, opts...)
  20388. res, err := c.doRequest("json")
  20389. if err != nil {
  20390. return err
  20391. }
  20392. defer googleapi.CloseBody(res)
  20393. if err := googleapi.CheckResponse(res); err != nil {
  20394. return err
  20395. }
  20396. return nil
  20397. // {
  20398. // "description": "Deletes an existing content category.",
  20399. // "httpMethod": "DELETE",
  20400. // "id": "dfareporting.contentCategories.delete",
  20401. // "parameterOrder": [
  20402. // "profileId",
  20403. // "id"
  20404. // ],
  20405. // "parameters": {
  20406. // "id": {
  20407. // "description": "Content category ID.",
  20408. // "format": "int64",
  20409. // "location": "path",
  20410. // "required": true,
  20411. // "type": "string"
  20412. // },
  20413. // "profileId": {
  20414. // "description": "User profile ID associated with this request.",
  20415. // "format": "int64",
  20416. // "location": "path",
  20417. // "required": true,
  20418. // "type": "string"
  20419. // }
  20420. // },
  20421. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20422. // "scopes": [
  20423. // "https://www.googleapis.com/auth/dfatrafficking"
  20424. // ]
  20425. // }
  20426. }
  20427. // method id "dfareporting.contentCategories.get":
  20428. type ContentCategoriesGetCall struct {
  20429. s *Service
  20430. profileId int64
  20431. id int64
  20432. urlParams_ gensupport.URLParams
  20433. ifNoneMatch_ string
  20434. ctx_ context.Context
  20435. header_ http.Header
  20436. }
  20437. // Get: Gets one content category by ID.
  20438. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  20439. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20440. c.profileId = profileId
  20441. c.id = id
  20442. return c
  20443. }
  20444. // Fields allows partial responses to be retrieved. See
  20445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20446. // for more information.
  20447. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  20448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20449. return c
  20450. }
  20451. // IfNoneMatch sets the optional parameter which makes the operation
  20452. // fail if the object's ETag matches the given value. This is useful for
  20453. // getting updates only after the object has changed since the last
  20454. // request. Use googleapi.IsNotModified to check whether the response
  20455. // error from Do is the result of In-None-Match.
  20456. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  20457. c.ifNoneMatch_ = entityTag
  20458. return c
  20459. }
  20460. // Context sets the context to be used in this call's Do method. Any
  20461. // pending HTTP request will be aborted if the provided context is
  20462. // canceled.
  20463. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  20464. c.ctx_ = ctx
  20465. return c
  20466. }
  20467. // Header returns an http.Header that can be modified by the caller to
  20468. // add HTTP headers to the request.
  20469. func (c *ContentCategoriesGetCall) Header() http.Header {
  20470. if c.header_ == nil {
  20471. c.header_ = make(http.Header)
  20472. }
  20473. return c.header_
  20474. }
  20475. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  20476. reqHeaders := make(http.Header)
  20477. for k, v := range c.header_ {
  20478. reqHeaders[k] = v
  20479. }
  20480. reqHeaders.Set("User-Agent", c.s.userAgent())
  20481. if c.ifNoneMatch_ != "" {
  20482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20483. }
  20484. var body io.Reader = nil
  20485. c.urlParams_.Set("alt", alt)
  20486. c.urlParams_.Set("prettyPrint", "false")
  20487. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20488. urls += "?" + c.urlParams_.Encode()
  20489. req, err := http.NewRequest("GET", urls, body)
  20490. if err != nil {
  20491. return nil, err
  20492. }
  20493. req.Header = reqHeaders
  20494. googleapi.Expand(req.URL, map[string]string{
  20495. "profileId": strconv.FormatInt(c.profileId, 10),
  20496. "id": strconv.FormatInt(c.id, 10),
  20497. })
  20498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20499. }
  20500. // Do executes the "dfareporting.contentCategories.get" call.
  20501. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20502. // status code is an error. Response headers are in either
  20503. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20504. // at all) in error.(*googleapi.Error).Header. Use
  20505. // googleapi.IsNotModified to check whether the returned error was
  20506. // because http.StatusNotModified was returned.
  20507. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20508. gensupport.SetOptions(c.urlParams_, opts...)
  20509. res, err := c.doRequest("json")
  20510. if res != nil && res.StatusCode == http.StatusNotModified {
  20511. if res.Body != nil {
  20512. res.Body.Close()
  20513. }
  20514. return nil, &googleapi.Error{
  20515. Code: res.StatusCode,
  20516. Header: res.Header,
  20517. }
  20518. }
  20519. if err != nil {
  20520. return nil, err
  20521. }
  20522. defer googleapi.CloseBody(res)
  20523. if err := googleapi.CheckResponse(res); err != nil {
  20524. return nil, err
  20525. }
  20526. ret := &ContentCategory{
  20527. ServerResponse: googleapi.ServerResponse{
  20528. Header: res.Header,
  20529. HTTPStatusCode: res.StatusCode,
  20530. },
  20531. }
  20532. target := &ret
  20533. if err := gensupport.DecodeResponse(target, res); err != nil {
  20534. return nil, err
  20535. }
  20536. return ret, nil
  20537. // {
  20538. // "description": "Gets one content category by ID.",
  20539. // "httpMethod": "GET",
  20540. // "id": "dfareporting.contentCategories.get",
  20541. // "parameterOrder": [
  20542. // "profileId",
  20543. // "id"
  20544. // ],
  20545. // "parameters": {
  20546. // "id": {
  20547. // "description": "Content category ID.",
  20548. // "format": "int64",
  20549. // "location": "path",
  20550. // "required": true,
  20551. // "type": "string"
  20552. // },
  20553. // "profileId": {
  20554. // "description": "User profile ID associated with this request.",
  20555. // "format": "int64",
  20556. // "location": "path",
  20557. // "required": true,
  20558. // "type": "string"
  20559. // }
  20560. // },
  20561. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20562. // "response": {
  20563. // "$ref": "ContentCategory"
  20564. // },
  20565. // "scopes": [
  20566. // "https://www.googleapis.com/auth/dfatrafficking"
  20567. // ]
  20568. // }
  20569. }
  20570. // method id "dfareporting.contentCategories.insert":
  20571. type ContentCategoriesInsertCall struct {
  20572. s *Service
  20573. profileId int64
  20574. contentcategory *ContentCategory
  20575. urlParams_ gensupport.URLParams
  20576. ctx_ context.Context
  20577. header_ http.Header
  20578. }
  20579. // Insert: Inserts a new content category.
  20580. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  20581. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20582. c.profileId = profileId
  20583. c.contentcategory = contentcategory
  20584. return c
  20585. }
  20586. // Fields allows partial responses to be retrieved. See
  20587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20588. // for more information.
  20589. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  20590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20591. return c
  20592. }
  20593. // Context sets the context to be used in this call's Do method. Any
  20594. // pending HTTP request will be aborted if the provided context is
  20595. // canceled.
  20596. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  20597. c.ctx_ = ctx
  20598. return c
  20599. }
  20600. // Header returns an http.Header that can be modified by the caller to
  20601. // add HTTP headers to the request.
  20602. func (c *ContentCategoriesInsertCall) Header() http.Header {
  20603. if c.header_ == nil {
  20604. c.header_ = make(http.Header)
  20605. }
  20606. return c.header_
  20607. }
  20608. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  20609. reqHeaders := make(http.Header)
  20610. for k, v := range c.header_ {
  20611. reqHeaders[k] = v
  20612. }
  20613. reqHeaders.Set("User-Agent", c.s.userAgent())
  20614. var body io.Reader = nil
  20615. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20616. if err != nil {
  20617. return nil, err
  20618. }
  20619. reqHeaders.Set("Content-Type", "application/json")
  20620. c.urlParams_.Set("alt", alt)
  20621. c.urlParams_.Set("prettyPrint", "false")
  20622. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20623. urls += "?" + c.urlParams_.Encode()
  20624. req, err := http.NewRequest("POST", urls, body)
  20625. if err != nil {
  20626. return nil, err
  20627. }
  20628. req.Header = reqHeaders
  20629. googleapi.Expand(req.URL, map[string]string{
  20630. "profileId": strconv.FormatInt(c.profileId, 10),
  20631. })
  20632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20633. }
  20634. // Do executes the "dfareporting.contentCategories.insert" call.
  20635. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20636. // status code is an error. Response headers are in either
  20637. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20638. // at all) in error.(*googleapi.Error).Header. Use
  20639. // googleapi.IsNotModified to check whether the returned error was
  20640. // because http.StatusNotModified was returned.
  20641. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20642. gensupport.SetOptions(c.urlParams_, opts...)
  20643. res, err := c.doRequest("json")
  20644. if res != nil && res.StatusCode == http.StatusNotModified {
  20645. if res.Body != nil {
  20646. res.Body.Close()
  20647. }
  20648. return nil, &googleapi.Error{
  20649. Code: res.StatusCode,
  20650. Header: res.Header,
  20651. }
  20652. }
  20653. if err != nil {
  20654. return nil, err
  20655. }
  20656. defer googleapi.CloseBody(res)
  20657. if err := googleapi.CheckResponse(res); err != nil {
  20658. return nil, err
  20659. }
  20660. ret := &ContentCategory{
  20661. ServerResponse: googleapi.ServerResponse{
  20662. Header: res.Header,
  20663. HTTPStatusCode: res.StatusCode,
  20664. },
  20665. }
  20666. target := &ret
  20667. if err := gensupport.DecodeResponse(target, res); err != nil {
  20668. return nil, err
  20669. }
  20670. return ret, nil
  20671. // {
  20672. // "description": "Inserts a new content category.",
  20673. // "httpMethod": "POST",
  20674. // "id": "dfareporting.contentCategories.insert",
  20675. // "parameterOrder": [
  20676. // "profileId"
  20677. // ],
  20678. // "parameters": {
  20679. // "profileId": {
  20680. // "description": "User profile ID associated with this request.",
  20681. // "format": "int64",
  20682. // "location": "path",
  20683. // "required": true,
  20684. // "type": "string"
  20685. // }
  20686. // },
  20687. // "path": "userprofiles/{profileId}/contentCategories",
  20688. // "request": {
  20689. // "$ref": "ContentCategory"
  20690. // },
  20691. // "response": {
  20692. // "$ref": "ContentCategory"
  20693. // },
  20694. // "scopes": [
  20695. // "https://www.googleapis.com/auth/dfatrafficking"
  20696. // ]
  20697. // }
  20698. }
  20699. // method id "dfareporting.contentCategories.list":
  20700. type ContentCategoriesListCall struct {
  20701. s *Service
  20702. profileId int64
  20703. urlParams_ gensupport.URLParams
  20704. ifNoneMatch_ string
  20705. ctx_ context.Context
  20706. header_ http.Header
  20707. }
  20708. // List: Retrieves a list of content categories, possibly filtered. This
  20709. // method supports paging.
  20710. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  20711. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20712. c.profileId = profileId
  20713. return c
  20714. }
  20715. // Ids sets the optional parameter "ids": Select only content categories
  20716. // with these IDs.
  20717. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  20718. var ids_ []string
  20719. for _, v := range ids {
  20720. ids_ = append(ids_, fmt.Sprint(v))
  20721. }
  20722. c.urlParams_.SetMulti("ids", ids_)
  20723. return c
  20724. }
  20725. // MaxResults sets the optional parameter "maxResults": Maximum number
  20726. // of results to return.
  20727. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  20728. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20729. return c
  20730. }
  20731. // PageToken sets the optional parameter "pageToken": Value of the
  20732. // nextPageToken from the previous result page.
  20733. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  20734. c.urlParams_.Set("pageToken", pageToken)
  20735. return c
  20736. }
  20737. // SearchString sets the optional parameter "searchString": Allows
  20738. // searching for objects by name or ID. Wildcards (*) are allowed. For
  20739. // example, "contentcategory*2015" will return objects with names like
  20740. // "contentcategory June 2015", "contentcategory April 2015", or simply
  20741. // "contentcategory 2015". Most of the searches also add wildcards
  20742. // implicitly at the start and the end of the search string. For
  20743. // example, a search string of "contentcategory" will match objects with
  20744. // name "my contentcategory", "contentcategory 2015", or simply
  20745. // "contentcategory".
  20746. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  20747. c.urlParams_.Set("searchString", searchString)
  20748. return c
  20749. }
  20750. // SortField sets the optional parameter "sortField": Field by which to
  20751. // sort the list.
  20752. //
  20753. // Possible values:
  20754. // "ID" (default)
  20755. // "NAME"
  20756. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  20757. c.urlParams_.Set("sortField", sortField)
  20758. return c
  20759. }
  20760. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20761. // results.
  20762. //
  20763. // Possible values:
  20764. // "ASCENDING" (default)
  20765. // "DESCENDING"
  20766. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  20767. c.urlParams_.Set("sortOrder", sortOrder)
  20768. return c
  20769. }
  20770. // Fields allows partial responses to be retrieved. See
  20771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20772. // for more information.
  20773. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  20774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20775. return c
  20776. }
  20777. // IfNoneMatch sets the optional parameter which makes the operation
  20778. // fail if the object's ETag matches the given value. This is useful for
  20779. // getting updates only after the object has changed since the last
  20780. // request. Use googleapi.IsNotModified to check whether the response
  20781. // error from Do is the result of In-None-Match.
  20782. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  20783. c.ifNoneMatch_ = entityTag
  20784. return c
  20785. }
  20786. // Context sets the context to be used in this call's Do method. Any
  20787. // pending HTTP request will be aborted if the provided context is
  20788. // canceled.
  20789. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  20790. c.ctx_ = ctx
  20791. return c
  20792. }
  20793. // Header returns an http.Header that can be modified by the caller to
  20794. // add HTTP headers to the request.
  20795. func (c *ContentCategoriesListCall) Header() http.Header {
  20796. if c.header_ == nil {
  20797. c.header_ = make(http.Header)
  20798. }
  20799. return c.header_
  20800. }
  20801. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  20802. reqHeaders := make(http.Header)
  20803. for k, v := range c.header_ {
  20804. reqHeaders[k] = v
  20805. }
  20806. reqHeaders.Set("User-Agent", c.s.userAgent())
  20807. if c.ifNoneMatch_ != "" {
  20808. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20809. }
  20810. var body io.Reader = nil
  20811. c.urlParams_.Set("alt", alt)
  20812. c.urlParams_.Set("prettyPrint", "false")
  20813. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20814. urls += "?" + c.urlParams_.Encode()
  20815. req, err := http.NewRequest("GET", urls, body)
  20816. if err != nil {
  20817. return nil, err
  20818. }
  20819. req.Header = reqHeaders
  20820. googleapi.Expand(req.URL, map[string]string{
  20821. "profileId": strconv.FormatInt(c.profileId, 10),
  20822. })
  20823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20824. }
  20825. // Do executes the "dfareporting.contentCategories.list" call.
  20826. // Exactly one of *ContentCategoriesListResponse or error will be
  20827. // non-nil. Any non-2xx status code is an error. Response headers are in
  20828. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  20829. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20830. // googleapi.IsNotModified to check whether the returned error was
  20831. // because http.StatusNotModified was returned.
  20832. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  20833. gensupport.SetOptions(c.urlParams_, opts...)
  20834. res, err := c.doRequest("json")
  20835. if res != nil && res.StatusCode == http.StatusNotModified {
  20836. if res.Body != nil {
  20837. res.Body.Close()
  20838. }
  20839. return nil, &googleapi.Error{
  20840. Code: res.StatusCode,
  20841. Header: res.Header,
  20842. }
  20843. }
  20844. if err != nil {
  20845. return nil, err
  20846. }
  20847. defer googleapi.CloseBody(res)
  20848. if err := googleapi.CheckResponse(res); err != nil {
  20849. return nil, err
  20850. }
  20851. ret := &ContentCategoriesListResponse{
  20852. ServerResponse: googleapi.ServerResponse{
  20853. Header: res.Header,
  20854. HTTPStatusCode: res.StatusCode,
  20855. },
  20856. }
  20857. target := &ret
  20858. if err := gensupport.DecodeResponse(target, res); err != nil {
  20859. return nil, err
  20860. }
  20861. return ret, nil
  20862. // {
  20863. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  20864. // "httpMethod": "GET",
  20865. // "id": "dfareporting.contentCategories.list",
  20866. // "parameterOrder": [
  20867. // "profileId"
  20868. // ],
  20869. // "parameters": {
  20870. // "ids": {
  20871. // "description": "Select only content categories with these IDs.",
  20872. // "format": "int64",
  20873. // "location": "query",
  20874. // "repeated": true,
  20875. // "type": "string"
  20876. // },
  20877. // "maxResults": {
  20878. // "default": "1000",
  20879. // "description": "Maximum number of results to return.",
  20880. // "format": "int32",
  20881. // "location": "query",
  20882. // "maximum": "1000",
  20883. // "minimum": "0",
  20884. // "type": "integer"
  20885. // },
  20886. // "pageToken": {
  20887. // "description": "Value of the nextPageToken from the previous result page.",
  20888. // "location": "query",
  20889. // "type": "string"
  20890. // },
  20891. // "profileId": {
  20892. // "description": "User profile ID associated with this request.",
  20893. // "format": "int64",
  20894. // "location": "path",
  20895. // "required": true,
  20896. // "type": "string"
  20897. // },
  20898. // "searchString": {
  20899. // "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\".",
  20900. // "location": "query",
  20901. // "type": "string"
  20902. // },
  20903. // "sortField": {
  20904. // "default": "ID",
  20905. // "description": "Field by which to sort the list.",
  20906. // "enum": [
  20907. // "ID",
  20908. // "NAME"
  20909. // ],
  20910. // "enumDescriptions": [
  20911. // "",
  20912. // ""
  20913. // ],
  20914. // "location": "query",
  20915. // "type": "string"
  20916. // },
  20917. // "sortOrder": {
  20918. // "default": "ASCENDING",
  20919. // "description": "Order of sorted results.",
  20920. // "enum": [
  20921. // "ASCENDING",
  20922. // "DESCENDING"
  20923. // ],
  20924. // "enumDescriptions": [
  20925. // "",
  20926. // ""
  20927. // ],
  20928. // "location": "query",
  20929. // "type": "string"
  20930. // }
  20931. // },
  20932. // "path": "userprofiles/{profileId}/contentCategories",
  20933. // "response": {
  20934. // "$ref": "ContentCategoriesListResponse"
  20935. // },
  20936. // "scopes": [
  20937. // "https://www.googleapis.com/auth/dfatrafficking"
  20938. // ]
  20939. // }
  20940. }
  20941. // Pages invokes f for each page of results.
  20942. // A non-nil error returned from f will halt the iteration.
  20943. // The provided context supersedes any context provided to the Context method.
  20944. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  20945. c.ctx_ = ctx
  20946. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20947. for {
  20948. x, err := c.Do()
  20949. if err != nil {
  20950. return err
  20951. }
  20952. if err := f(x); err != nil {
  20953. return err
  20954. }
  20955. if x.NextPageToken == "" {
  20956. return nil
  20957. }
  20958. c.PageToken(x.NextPageToken)
  20959. }
  20960. }
  20961. // method id "dfareporting.contentCategories.patch":
  20962. type ContentCategoriesPatchCall struct {
  20963. s *Service
  20964. profileId int64
  20965. contentcategory *ContentCategory
  20966. urlParams_ gensupport.URLParams
  20967. ctx_ context.Context
  20968. header_ http.Header
  20969. }
  20970. // Patch: Updates an existing content category. This method supports
  20971. // patch semantics.
  20972. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  20973. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20974. c.profileId = profileId
  20975. c.urlParams_.Set("id", fmt.Sprint(id))
  20976. c.contentcategory = contentcategory
  20977. return c
  20978. }
  20979. // Fields allows partial responses to be retrieved. See
  20980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20981. // for more information.
  20982. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  20983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20984. return c
  20985. }
  20986. // Context sets the context to be used in this call's Do method. Any
  20987. // pending HTTP request will be aborted if the provided context is
  20988. // canceled.
  20989. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  20990. c.ctx_ = ctx
  20991. return c
  20992. }
  20993. // Header returns an http.Header that can be modified by the caller to
  20994. // add HTTP headers to the request.
  20995. func (c *ContentCategoriesPatchCall) Header() http.Header {
  20996. if c.header_ == nil {
  20997. c.header_ = make(http.Header)
  20998. }
  20999. return c.header_
  21000. }
  21001. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  21002. reqHeaders := make(http.Header)
  21003. for k, v := range c.header_ {
  21004. reqHeaders[k] = v
  21005. }
  21006. reqHeaders.Set("User-Agent", c.s.userAgent())
  21007. var body io.Reader = nil
  21008. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  21009. if err != nil {
  21010. return nil, err
  21011. }
  21012. reqHeaders.Set("Content-Type", "application/json")
  21013. c.urlParams_.Set("alt", alt)
  21014. c.urlParams_.Set("prettyPrint", "false")
  21015. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  21016. urls += "?" + c.urlParams_.Encode()
  21017. req, err := http.NewRequest("PATCH", urls, body)
  21018. if err != nil {
  21019. return nil, err
  21020. }
  21021. req.Header = reqHeaders
  21022. googleapi.Expand(req.URL, map[string]string{
  21023. "profileId": strconv.FormatInt(c.profileId, 10),
  21024. })
  21025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21026. }
  21027. // Do executes the "dfareporting.contentCategories.patch" call.
  21028. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  21029. // status code is an error. Response headers are in either
  21030. // *ContentCategory.ServerResponse.Header or (if a response was returned
  21031. // at all) in error.(*googleapi.Error).Header. Use
  21032. // googleapi.IsNotModified to check whether the returned error was
  21033. // because http.StatusNotModified was returned.
  21034. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  21035. gensupport.SetOptions(c.urlParams_, opts...)
  21036. res, err := c.doRequest("json")
  21037. if res != nil && res.StatusCode == http.StatusNotModified {
  21038. if res.Body != nil {
  21039. res.Body.Close()
  21040. }
  21041. return nil, &googleapi.Error{
  21042. Code: res.StatusCode,
  21043. Header: res.Header,
  21044. }
  21045. }
  21046. if err != nil {
  21047. return nil, err
  21048. }
  21049. defer googleapi.CloseBody(res)
  21050. if err := googleapi.CheckResponse(res); err != nil {
  21051. return nil, err
  21052. }
  21053. ret := &ContentCategory{
  21054. ServerResponse: googleapi.ServerResponse{
  21055. Header: res.Header,
  21056. HTTPStatusCode: res.StatusCode,
  21057. },
  21058. }
  21059. target := &ret
  21060. if err := gensupport.DecodeResponse(target, res); err != nil {
  21061. return nil, err
  21062. }
  21063. return ret, nil
  21064. // {
  21065. // "description": "Updates an existing content category. This method supports patch semantics.",
  21066. // "httpMethod": "PATCH",
  21067. // "id": "dfareporting.contentCategories.patch",
  21068. // "parameterOrder": [
  21069. // "profileId",
  21070. // "id"
  21071. // ],
  21072. // "parameters": {
  21073. // "id": {
  21074. // "description": "Content category ID.",
  21075. // "format": "int64",
  21076. // "location": "query",
  21077. // "required": true,
  21078. // "type": "string"
  21079. // },
  21080. // "profileId": {
  21081. // "description": "User profile ID associated with this request.",
  21082. // "format": "int64",
  21083. // "location": "path",
  21084. // "required": true,
  21085. // "type": "string"
  21086. // }
  21087. // },
  21088. // "path": "userprofiles/{profileId}/contentCategories",
  21089. // "request": {
  21090. // "$ref": "ContentCategory"
  21091. // },
  21092. // "response": {
  21093. // "$ref": "ContentCategory"
  21094. // },
  21095. // "scopes": [
  21096. // "https://www.googleapis.com/auth/dfatrafficking"
  21097. // ]
  21098. // }
  21099. }
  21100. // method id "dfareporting.contentCategories.update":
  21101. type ContentCategoriesUpdateCall struct {
  21102. s *Service
  21103. profileId int64
  21104. contentcategory *ContentCategory
  21105. urlParams_ gensupport.URLParams
  21106. ctx_ context.Context
  21107. header_ http.Header
  21108. }
  21109. // Update: Updates an existing content category.
  21110. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  21111. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21112. c.profileId = profileId
  21113. c.contentcategory = contentcategory
  21114. return c
  21115. }
  21116. // Fields allows partial responses to be retrieved. See
  21117. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21118. // for more information.
  21119. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  21120. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21121. return c
  21122. }
  21123. // Context sets the context to be used in this call's Do method. Any
  21124. // pending HTTP request will be aborted if the provided context is
  21125. // canceled.
  21126. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  21127. c.ctx_ = ctx
  21128. return c
  21129. }
  21130. // Header returns an http.Header that can be modified by the caller to
  21131. // add HTTP headers to the request.
  21132. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  21133. if c.header_ == nil {
  21134. c.header_ = make(http.Header)
  21135. }
  21136. return c.header_
  21137. }
  21138. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  21139. reqHeaders := make(http.Header)
  21140. for k, v := range c.header_ {
  21141. reqHeaders[k] = v
  21142. }
  21143. reqHeaders.Set("User-Agent", c.s.userAgent())
  21144. var body io.Reader = nil
  21145. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  21146. if err != nil {
  21147. return nil, err
  21148. }
  21149. reqHeaders.Set("Content-Type", "application/json")
  21150. c.urlParams_.Set("alt", alt)
  21151. c.urlParams_.Set("prettyPrint", "false")
  21152. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  21153. urls += "?" + c.urlParams_.Encode()
  21154. req, err := http.NewRequest("PUT", urls, body)
  21155. if err != nil {
  21156. return nil, err
  21157. }
  21158. req.Header = reqHeaders
  21159. googleapi.Expand(req.URL, map[string]string{
  21160. "profileId": strconv.FormatInt(c.profileId, 10),
  21161. })
  21162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21163. }
  21164. // Do executes the "dfareporting.contentCategories.update" call.
  21165. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  21166. // status code is an error. Response headers are in either
  21167. // *ContentCategory.ServerResponse.Header or (if a response was returned
  21168. // at all) in error.(*googleapi.Error).Header. Use
  21169. // googleapi.IsNotModified to check whether the returned error was
  21170. // because http.StatusNotModified was returned.
  21171. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  21172. gensupport.SetOptions(c.urlParams_, opts...)
  21173. res, err := c.doRequest("json")
  21174. if res != nil && res.StatusCode == http.StatusNotModified {
  21175. if res.Body != nil {
  21176. res.Body.Close()
  21177. }
  21178. return nil, &googleapi.Error{
  21179. Code: res.StatusCode,
  21180. Header: res.Header,
  21181. }
  21182. }
  21183. if err != nil {
  21184. return nil, err
  21185. }
  21186. defer googleapi.CloseBody(res)
  21187. if err := googleapi.CheckResponse(res); err != nil {
  21188. return nil, err
  21189. }
  21190. ret := &ContentCategory{
  21191. ServerResponse: googleapi.ServerResponse{
  21192. Header: res.Header,
  21193. HTTPStatusCode: res.StatusCode,
  21194. },
  21195. }
  21196. target := &ret
  21197. if err := gensupport.DecodeResponse(target, res); err != nil {
  21198. return nil, err
  21199. }
  21200. return ret, nil
  21201. // {
  21202. // "description": "Updates an existing content category.",
  21203. // "httpMethod": "PUT",
  21204. // "id": "dfareporting.contentCategories.update",
  21205. // "parameterOrder": [
  21206. // "profileId"
  21207. // ],
  21208. // "parameters": {
  21209. // "profileId": {
  21210. // "description": "User profile ID associated with this request.",
  21211. // "format": "int64",
  21212. // "location": "path",
  21213. // "required": true,
  21214. // "type": "string"
  21215. // }
  21216. // },
  21217. // "path": "userprofiles/{profileId}/contentCategories",
  21218. // "request": {
  21219. // "$ref": "ContentCategory"
  21220. // },
  21221. // "response": {
  21222. // "$ref": "ContentCategory"
  21223. // },
  21224. // "scopes": [
  21225. // "https://www.googleapis.com/auth/dfatrafficking"
  21226. // ]
  21227. // }
  21228. }
  21229. // method id "dfareporting.conversions.batchinsert":
  21230. type ConversionsBatchinsertCall struct {
  21231. s *Service
  21232. profileId int64
  21233. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  21234. urlParams_ gensupport.URLParams
  21235. ctx_ context.Context
  21236. header_ http.Header
  21237. }
  21238. // Batchinsert: Inserts conversions.
  21239. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  21240. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21241. c.profileId = profileId
  21242. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  21243. return c
  21244. }
  21245. // Fields allows partial responses to be retrieved. See
  21246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21247. // for more information.
  21248. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  21249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21250. return c
  21251. }
  21252. // Context sets the context to be used in this call's Do method. Any
  21253. // pending HTTP request will be aborted if the provided context is
  21254. // canceled.
  21255. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  21256. c.ctx_ = ctx
  21257. return c
  21258. }
  21259. // Header returns an http.Header that can be modified by the caller to
  21260. // add HTTP headers to the request.
  21261. func (c *ConversionsBatchinsertCall) Header() http.Header {
  21262. if c.header_ == nil {
  21263. c.header_ = make(http.Header)
  21264. }
  21265. return c.header_
  21266. }
  21267. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  21268. reqHeaders := make(http.Header)
  21269. for k, v := range c.header_ {
  21270. reqHeaders[k] = v
  21271. }
  21272. reqHeaders.Set("User-Agent", c.s.userAgent())
  21273. var body io.Reader = nil
  21274. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  21275. if err != nil {
  21276. return nil, err
  21277. }
  21278. reqHeaders.Set("Content-Type", "application/json")
  21279. c.urlParams_.Set("alt", alt)
  21280. c.urlParams_.Set("prettyPrint", "false")
  21281. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  21282. urls += "?" + c.urlParams_.Encode()
  21283. req, err := http.NewRequest("POST", urls, body)
  21284. if err != nil {
  21285. return nil, err
  21286. }
  21287. req.Header = reqHeaders
  21288. googleapi.Expand(req.URL, map[string]string{
  21289. "profileId": strconv.FormatInt(c.profileId, 10),
  21290. })
  21291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21292. }
  21293. // Do executes the "dfareporting.conversions.batchinsert" call.
  21294. // Exactly one of *ConversionsBatchInsertResponse or error will be
  21295. // non-nil. Any non-2xx status code is an error. Response headers are in
  21296. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  21297. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21298. // googleapi.IsNotModified to check whether the returned error was
  21299. // because http.StatusNotModified was returned.
  21300. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  21301. gensupport.SetOptions(c.urlParams_, opts...)
  21302. res, err := c.doRequest("json")
  21303. if res != nil && res.StatusCode == http.StatusNotModified {
  21304. if res.Body != nil {
  21305. res.Body.Close()
  21306. }
  21307. return nil, &googleapi.Error{
  21308. Code: res.StatusCode,
  21309. Header: res.Header,
  21310. }
  21311. }
  21312. if err != nil {
  21313. return nil, err
  21314. }
  21315. defer googleapi.CloseBody(res)
  21316. if err := googleapi.CheckResponse(res); err != nil {
  21317. return nil, err
  21318. }
  21319. ret := &ConversionsBatchInsertResponse{
  21320. ServerResponse: googleapi.ServerResponse{
  21321. Header: res.Header,
  21322. HTTPStatusCode: res.StatusCode,
  21323. },
  21324. }
  21325. target := &ret
  21326. if err := gensupport.DecodeResponse(target, res); err != nil {
  21327. return nil, err
  21328. }
  21329. return ret, nil
  21330. // {
  21331. // "description": "Inserts conversions.",
  21332. // "httpMethod": "POST",
  21333. // "id": "dfareporting.conversions.batchinsert",
  21334. // "parameterOrder": [
  21335. // "profileId"
  21336. // ],
  21337. // "parameters": {
  21338. // "profileId": {
  21339. // "description": "User profile ID associated with this request.",
  21340. // "format": "int64",
  21341. // "location": "path",
  21342. // "required": true,
  21343. // "type": "string"
  21344. // }
  21345. // },
  21346. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  21347. // "request": {
  21348. // "$ref": "ConversionsBatchInsertRequest"
  21349. // },
  21350. // "response": {
  21351. // "$ref": "ConversionsBatchInsertResponse"
  21352. // },
  21353. // "scopes": [
  21354. // "https://www.googleapis.com/auth/ddmconversions"
  21355. // ]
  21356. // }
  21357. }
  21358. // method id "dfareporting.conversions.batchupdate":
  21359. type ConversionsBatchupdateCall struct {
  21360. s *Service
  21361. profileId int64
  21362. conversionsbatchupdaterequest *ConversionsBatchUpdateRequest
  21363. urlParams_ gensupport.URLParams
  21364. ctx_ context.Context
  21365. header_ http.Header
  21366. }
  21367. // Batchupdate: Updates existing conversions.
  21368. func (r *ConversionsService) Batchupdate(profileId int64, conversionsbatchupdaterequest *ConversionsBatchUpdateRequest) *ConversionsBatchupdateCall {
  21369. c := &ConversionsBatchupdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21370. c.profileId = profileId
  21371. c.conversionsbatchupdaterequest = conversionsbatchupdaterequest
  21372. return c
  21373. }
  21374. // Fields allows partial responses to be retrieved. See
  21375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21376. // for more information.
  21377. func (c *ConversionsBatchupdateCall) Fields(s ...googleapi.Field) *ConversionsBatchupdateCall {
  21378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21379. return c
  21380. }
  21381. // Context sets the context to be used in this call's Do method. Any
  21382. // pending HTTP request will be aborted if the provided context is
  21383. // canceled.
  21384. func (c *ConversionsBatchupdateCall) Context(ctx context.Context) *ConversionsBatchupdateCall {
  21385. c.ctx_ = ctx
  21386. return c
  21387. }
  21388. // Header returns an http.Header that can be modified by the caller to
  21389. // add HTTP headers to the request.
  21390. func (c *ConversionsBatchupdateCall) Header() http.Header {
  21391. if c.header_ == nil {
  21392. c.header_ = make(http.Header)
  21393. }
  21394. return c.header_
  21395. }
  21396. func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) {
  21397. reqHeaders := make(http.Header)
  21398. for k, v := range c.header_ {
  21399. reqHeaders[k] = v
  21400. }
  21401. reqHeaders.Set("User-Agent", c.s.userAgent())
  21402. var body io.Reader = nil
  21403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest)
  21404. if err != nil {
  21405. return nil, err
  21406. }
  21407. reqHeaders.Set("Content-Type", "application/json")
  21408. c.urlParams_.Set("alt", alt)
  21409. c.urlParams_.Set("prettyPrint", "false")
  21410. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchupdate")
  21411. urls += "?" + c.urlParams_.Encode()
  21412. req, err := http.NewRequest("POST", urls, body)
  21413. if err != nil {
  21414. return nil, err
  21415. }
  21416. req.Header = reqHeaders
  21417. googleapi.Expand(req.URL, map[string]string{
  21418. "profileId": strconv.FormatInt(c.profileId, 10),
  21419. })
  21420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21421. }
  21422. // Do executes the "dfareporting.conversions.batchupdate" call.
  21423. // Exactly one of *ConversionsBatchUpdateResponse or error will be
  21424. // non-nil. Any non-2xx status code is an error. Response headers are in
  21425. // either *ConversionsBatchUpdateResponse.ServerResponse.Header or (if a
  21426. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21427. // googleapi.IsNotModified to check whether the returned error was
  21428. // because http.StatusNotModified was returned.
  21429. func (c *ConversionsBatchupdateCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchUpdateResponse, error) {
  21430. gensupport.SetOptions(c.urlParams_, opts...)
  21431. res, err := c.doRequest("json")
  21432. if res != nil && res.StatusCode == http.StatusNotModified {
  21433. if res.Body != nil {
  21434. res.Body.Close()
  21435. }
  21436. return nil, &googleapi.Error{
  21437. Code: res.StatusCode,
  21438. Header: res.Header,
  21439. }
  21440. }
  21441. if err != nil {
  21442. return nil, err
  21443. }
  21444. defer googleapi.CloseBody(res)
  21445. if err := googleapi.CheckResponse(res); err != nil {
  21446. return nil, err
  21447. }
  21448. ret := &ConversionsBatchUpdateResponse{
  21449. ServerResponse: googleapi.ServerResponse{
  21450. Header: res.Header,
  21451. HTTPStatusCode: res.StatusCode,
  21452. },
  21453. }
  21454. target := &ret
  21455. if err := gensupport.DecodeResponse(target, res); err != nil {
  21456. return nil, err
  21457. }
  21458. return ret, nil
  21459. // {
  21460. // "description": "Updates existing conversions.",
  21461. // "httpMethod": "POST",
  21462. // "id": "dfareporting.conversions.batchupdate",
  21463. // "parameterOrder": [
  21464. // "profileId"
  21465. // ],
  21466. // "parameters": {
  21467. // "profileId": {
  21468. // "description": "User profile ID associated with this request.",
  21469. // "format": "int64",
  21470. // "location": "path",
  21471. // "required": true,
  21472. // "type": "string"
  21473. // }
  21474. // },
  21475. // "path": "userprofiles/{profileId}/conversions/batchupdate",
  21476. // "request": {
  21477. // "$ref": "ConversionsBatchUpdateRequest"
  21478. // },
  21479. // "response": {
  21480. // "$ref": "ConversionsBatchUpdateResponse"
  21481. // },
  21482. // "scopes": [
  21483. // "https://www.googleapis.com/auth/ddmconversions"
  21484. // ]
  21485. // }
  21486. }
  21487. // method id "dfareporting.countries.get":
  21488. type CountriesGetCall struct {
  21489. s *Service
  21490. profileId int64
  21491. dartId int64
  21492. urlParams_ gensupport.URLParams
  21493. ifNoneMatch_ string
  21494. ctx_ context.Context
  21495. header_ http.Header
  21496. }
  21497. // Get: Gets one country by ID.
  21498. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  21499. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21500. c.profileId = profileId
  21501. c.dartId = dartId
  21502. return c
  21503. }
  21504. // Fields allows partial responses to be retrieved. See
  21505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21506. // for more information.
  21507. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  21508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21509. return c
  21510. }
  21511. // IfNoneMatch sets the optional parameter which makes the operation
  21512. // fail if the object's ETag matches the given value. This is useful for
  21513. // getting updates only after the object has changed since the last
  21514. // request. Use googleapi.IsNotModified to check whether the response
  21515. // error from Do is the result of In-None-Match.
  21516. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  21517. c.ifNoneMatch_ = entityTag
  21518. return c
  21519. }
  21520. // Context sets the context to be used in this call's Do method. Any
  21521. // pending HTTP request will be aborted if the provided context is
  21522. // canceled.
  21523. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  21524. c.ctx_ = ctx
  21525. return c
  21526. }
  21527. // Header returns an http.Header that can be modified by the caller to
  21528. // add HTTP headers to the request.
  21529. func (c *CountriesGetCall) Header() http.Header {
  21530. if c.header_ == nil {
  21531. c.header_ = make(http.Header)
  21532. }
  21533. return c.header_
  21534. }
  21535. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  21536. reqHeaders := make(http.Header)
  21537. for k, v := range c.header_ {
  21538. reqHeaders[k] = v
  21539. }
  21540. reqHeaders.Set("User-Agent", c.s.userAgent())
  21541. if c.ifNoneMatch_ != "" {
  21542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21543. }
  21544. var body io.Reader = nil
  21545. c.urlParams_.Set("alt", alt)
  21546. c.urlParams_.Set("prettyPrint", "false")
  21547. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  21548. urls += "?" + c.urlParams_.Encode()
  21549. req, err := http.NewRequest("GET", urls, body)
  21550. if err != nil {
  21551. return nil, err
  21552. }
  21553. req.Header = reqHeaders
  21554. googleapi.Expand(req.URL, map[string]string{
  21555. "profileId": strconv.FormatInt(c.profileId, 10),
  21556. "dartId": strconv.FormatInt(c.dartId, 10),
  21557. })
  21558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21559. }
  21560. // Do executes the "dfareporting.countries.get" call.
  21561. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  21562. // code is an error. Response headers are in either
  21563. // *Country.ServerResponse.Header or (if a response was returned at all)
  21564. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21565. // check whether the returned error was because http.StatusNotModified
  21566. // was returned.
  21567. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  21568. gensupport.SetOptions(c.urlParams_, opts...)
  21569. res, err := c.doRequest("json")
  21570. if res != nil && res.StatusCode == http.StatusNotModified {
  21571. if res.Body != nil {
  21572. res.Body.Close()
  21573. }
  21574. return nil, &googleapi.Error{
  21575. Code: res.StatusCode,
  21576. Header: res.Header,
  21577. }
  21578. }
  21579. if err != nil {
  21580. return nil, err
  21581. }
  21582. defer googleapi.CloseBody(res)
  21583. if err := googleapi.CheckResponse(res); err != nil {
  21584. return nil, err
  21585. }
  21586. ret := &Country{
  21587. ServerResponse: googleapi.ServerResponse{
  21588. Header: res.Header,
  21589. HTTPStatusCode: res.StatusCode,
  21590. },
  21591. }
  21592. target := &ret
  21593. if err := gensupport.DecodeResponse(target, res); err != nil {
  21594. return nil, err
  21595. }
  21596. return ret, nil
  21597. // {
  21598. // "description": "Gets one country by ID.",
  21599. // "httpMethod": "GET",
  21600. // "id": "dfareporting.countries.get",
  21601. // "parameterOrder": [
  21602. // "profileId",
  21603. // "dartId"
  21604. // ],
  21605. // "parameters": {
  21606. // "dartId": {
  21607. // "description": "Country DART ID.",
  21608. // "format": "int64",
  21609. // "location": "path",
  21610. // "required": true,
  21611. // "type": "string"
  21612. // },
  21613. // "profileId": {
  21614. // "description": "User profile ID associated with this request.",
  21615. // "format": "int64",
  21616. // "location": "path",
  21617. // "required": true,
  21618. // "type": "string"
  21619. // }
  21620. // },
  21621. // "path": "userprofiles/{profileId}/countries/{dartId}",
  21622. // "response": {
  21623. // "$ref": "Country"
  21624. // },
  21625. // "scopes": [
  21626. // "https://www.googleapis.com/auth/dfatrafficking"
  21627. // ]
  21628. // }
  21629. }
  21630. // method id "dfareporting.countries.list":
  21631. type CountriesListCall struct {
  21632. s *Service
  21633. profileId int64
  21634. urlParams_ gensupport.URLParams
  21635. ifNoneMatch_ string
  21636. ctx_ context.Context
  21637. header_ http.Header
  21638. }
  21639. // List: Retrieves a list of countries.
  21640. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  21641. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21642. c.profileId = profileId
  21643. return c
  21644. }
  21645. // Fields allows partial responses to be retrieved. See
  21646. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21647. // for more information.
  21648. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  21649. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21650. return c
  21651. }
  21652. // IfNoneMatch sets the optional parameter which makes the operation
  21653. // fail if the object's ETag matches the given value. This is useful for
  21654. // getting updates only after the object has changed since the last
  21655. // request. Use googleapi.IsNotModified to check whether the response
  21656. // error from Do is the result of In-None-Match.
  21657. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  21658. c.ifNoneMatch_ = entityTag
  21659. return c
  21660. }
  21661. // Context sets the context to be used in this call's Do method. Any
  21662. // pending HTTP request will be aborted if the provided context is
  21663. // canceled.
  21664. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  21665. c.ctx_ = ctx
  21666. return c
  21667. }
  21668. // Header returns an http.Header that can be modified by the caller to
  21669. // add HTTP headers to the request.
  21670. func (c *CountriesListCall) Header() http.Header {
  21671. if c.header_ == nil {
  21672. c.header_ = make(http.Header)
  21673. }
  21674. return c.header_
  21675. }
  21676. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  21677. reqHeaders := make(http.Header)
  21678. for k, v := range c.header_ {
  21679. reqHeaders[k] = v
  21680. }
  21681. reqHeaders.Set("User-Agent", c.s.userAgent())
  21682. if c.ifNoneMatch_ != "" {
  21683. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21684. }
  21685. var body io.Reader = nil
  21686. c.urlParams_.Set("alt", alt)
  21687. c.urlParams_.Set("prettyPrint", "false")
  21688. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  21689. urls += "?" + c.urlParams_.Encode()
  21690. req, err := http.NewRequest("GET", urls, body)
  21691. if err != nil {
  21692. return nil, err
  21693. }
  21694. req.Header = reqHeaders
  21695. googleapi.Expand(req.URL, map[string]string{
  21696. "profileId": strconv.FormatInt(c.profileId, 10),
  21697. })
  21698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21699. }
  21700. // Do executes the "dfareporting.countries.list" call.
  21701. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  21702. // non-2xx status code is an error. Response headers are in either
  21703. // *CountriesListResponse.ServerResponse.Header or (if a response was
  21704. // returned at all) in error.(*googleapi.Error).Header. Use
  21705. // googleapi.IsNotModified to check whether the returned error was
  21706. // because http.StatusNotModified was returned.
  21707. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  21708. gensupport.SetOptions(c.urlParams_, opts...)
  21709. res, err := c.doRequest("json")
  21710. if res != nil && res.StatusCode == http.StatusNotModified {
  21711. if res.Body != nil {
  21712. res.Body.Close()
  21713. }
  21714. return nil, &googleapi.Error{
  21715. Code: res.StatusCode,
  21716. Header: res.Header,
  21717. }
  21718. }
  21719. if err != nil {
  21720. return nil, err
  21721. }
  21722. defer googleapi.CloseBody(res)
  21723. if err := googleapi.CheckResponse(res); err != nil {
  21724. return nil, err
  21725. }
  21726. ret := &CountriesListResponse{
  21727. ServerResponse: googleapi.ServerResponse{
  21728. Header: res.Header,
  21729. HTTPStatusCode: res.StatusCode,
  21730. },
  21731. }
  21732. target := &ret
  21733. if err := gensupport.DecodeResponse(target, res); err != nil {
  21734. return nil, err
  21735. }
  21736. return ret, nil
  21737. // {
  21738. // "description": "Retrieves a list of countries.",
  21739. // "httpMethod": "GET",
  21740. // "id": "dfareporting.countries.list",
  21741. // "parameterOrder": [
  21742. // "profileId"
  21743. // ],
  21744. // "parameters": {
  21745. // "profileId": {
  21746. // "description": "User profile ID associated with this request.",
  21747. // "format": "int64",
  21748. // "location": "path",
  21749. // "required": true,
  21750. // "type": "string"
  21751. // }
  21752. // },
  21753. // "path": "userprofiles/{profileId}/countries",
  21754. // "response": {
  21755. // "$ref": "CountriesListResponse"
  21756. // },
  21757. // "scopes": [
  21758. // "https://www.googleapis.com/auth/dfatrafficking"
  21759. // ]
  21760. // }
  21761. }
  21762. // method id "dfareporting.creativeAssets.insert":
  21763. type CreativeAssetsInsertCall struct {
  21764. s *Service
  21765. profileId int64
  21766. advertiserId int64
  21767. creativeassetmetadata *CreativeAssetMetadata
  21768. urlParams_ gensupport.URLParams
  21769. mediaInfo_ *gensupport.MediaInfo
  21770. ctx_ context.Context
  21771. header_ http.Header
  21772. }
  21773. // Insert: Inserts a new creative asset.
  21774. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  21775. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21776. c.profileId = profileId
  21777. c.advertiserId = advertiserId
  21778. c.creativeassetmetadata = creativeassetmetadata
  21779. return c
  21780. }
  21781. // Media specifies the media to upload in one or more chunks. The chunk
  21782. // size may be controlled by supplying a MediaOption generated by
  21783. // googleapi.ChunkSize. The chunk size defaults to
  21784. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21785. // upload request will be determined by sniffing the contents of r,
  21786. // unless a MediaOption generated by googleapi.ContentType is
  21787. // supplied.
  21788. // At most one of Media and ResumableMedia may be set.
  21789. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  21790. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21791. return c
  21792. }
  21793. // ResumableMedia specifies the media to upload in chunks and can be
  21794. // canceled with ctx.
  21795. //
  21796. // Deprecated: use Media instead.
  21797. //
  21798. // At most one of Media and ResumableMedia may be set. mediaType
  21799. // identifies the MIME media type of the upload, such as "image/png". If
  21800. // mediaType is "", it will be auto-detected. The provided ctx will
  21801. // supersede any context previously provided to the Context method.
  21802. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  21803. c.ctx_ = ctx
  21804. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21805. return c
  21806. }
  21807. // ProgressUpdater provides a callback function that will be called
  21808. // after every chunk. It should be a low-latency function in order to
  21809. // not slow down the upload operation. This should only be called when
  21810. // using ResumableMedia (as opposed to Media).
  21811. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  21812. c.mediaInfo_.SetProgressUpdater(pu)
  21813. return c
  21814. }
  21815. // Fields allows partial responses to be retrieved. See
  21816. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21817. // for more information.
  21818. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  21819. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21820. return c
  21821. }
  21822. // Context sets the context to be used in this call's Do method. Any
  21823. // pending HTTP request will be aborted if the provided context is
  21824. // canceled.
  21825. // This context will supersede any context previously provided to the
  21826. // ResumableMedia method.
  21827. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  21828. c.ctx_ = ctx
  21829. return c
  21830. }
  21831. // Header returns an http.Header that can be modified by the caller to
  21832. // add HTTP headers to the request.
  21833. func (c *CreativeAssetsInsertCall) Header() http.Header {
  21834. if c.header_ == nil {
  21835. c.header_ = make(http.Header)
  21836. }
  21837. return c.header_
  21838. }
  21839. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  21840. reqHeaders := make(http.Header)
  21841. for k, v := range c.header_ {
  21842. reqHeaders[k] = v
  21843. }
  21844. reqHeaders.Set("User-Agent", c.s.userAgent())
  21845. var body io.Reader = nil
  21846. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  21847. if err != nil {
  21848. return nil, err
  21849. }
  21850. reqHeaders.Set("Content-Type", "application/json")
  21851. c.urlParams_.Set("alt", alt)
  21852. c.urlParams_.Set("prettyPrint", "false")
  21853. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  21854. if c.mediaInfo_ != nil {
  21855. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21856. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21857. }
  21858. if body == nil {
  21859. body = new(bytes.Buffer)
  21860. reqHeaders.Set("Content-Type", "application/json")
  21861. }
  21862. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21863. defer cleanup()
  21864. urls += "?" + c.urlParams_.Encode()
  21865. req, err := http.NewRequest("POST", urls, body)
  21866. if err != nil {
  21867. return nil, err
  21868. }
  21869. req.Header = reqHeaders
  21870. req.GetBody = getBody
  21871. googleapi.Expand(req.URL, map[string]string{
  21872. "profileId": strconv.FormatInt(c.profileId, 10),
  21873. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  21874. })
  21875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21876. }
  21877. // Do executes the "dfareporting.creativeAssets.insert" call.
  21878. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  21879. // non-2xx status code is an error. Response headers are in either
  21880. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  21881. // returned at all) in error.(*googleapi.Error).Header. Use
  21882. // googleapi.IsNotModified to check whether the returned error was
  21883. // because http.StatusNotModified was returned.
  21884. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  21885. gensupport.SetOptions(c.urlParams_, opts...)
  21886. res, err := c.doRequest("json")
  21887. if res != nil && res.StatusCode == http.StatusNotModified {
  21888. if res.Body != nil {
  21889. res.Body.Close()
  21890. }
  21891. return nil, &googleapi.Error{
  21892. Code: res.StatusCode,
  21893. Header: res.Header,
  21894. }
  21895. }
  21896. if err != nil {
  21897. return nil, err
  21898. }
  21899. defer googleapi.CloseBody(res)
  21900. if err := googleapi.CheckResponse(res); err != nil {
  21901. return nil, err
  21902. }
  21903. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21904. if rx != nil {
  21905. rx.Client = c.s.client
  21906. rx.UserAgent = c.s.userAgent()
  21907. ctx := c.ctx_
  21908. if ctx == nil {
  21909. ctx = context.TODO()
  21910. }
  21911. res, err = rx.Upload(ctx)
  21912. if err != nil {
  21913. return nil, err
  21914. }
  21915. defer res.Body.Close()
  21916. if err := googleapi.CheckResponse(res); err != nil {
  21917. return nil, err
  21918. }
  21919. }
  21920. ret := &CreativeAssetMetadata{
  21921. ServerResponse: googleapi.ServerResponse{
  21922. Header: res.Header,
  21923. HTTPStatusCode: res.StatusCode,
  21924. },
  21925. }
  21926. target := &ret
  21927. if err := gensupport.DecodeResponse(target, res); err != nil {
  21928. return nil, err
  21929. }
  21930. return ret, nil
  21931. // {
  21932. // "description": "Inserts a new creative asset.",
  21933. // "httpMethod": "POST",
  21934. // "id": "dfareporting.creativeAssets.insert",
  21935. // "mediaUpload": {
  21936. // "accept": [
  21937. // "*/*"
  21938. // ],
  21939. // "maxSize": "1024MB",
  21940. // "protocols": {
  21941. // "resumable": {
  21942. // "multipart": true,
  21943. // "path": "/resumable/upload/dfareporting/v3.3/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21944. // },
  21945. // "simple": {
  21946. // "multipart": true,
  21947. // "path": "/upload/dfareporting/v3.3/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21948. // }
  21949. // }
  21950. // },
  21951. // "parameterOrder": [
  21952. // "profileId",
  21953. // "advertiserId"
  21954. // ],
  21955. // "parameters": {
  21956. // "advertiserId": {
  21957. // "description": "Advertiser ID of this creative. This is a required field.",
  21958. // "format": "int64",
  21959. // "location": "path",
  21960. // "required": true,
  21961. // "type": "string"
  21962. // },
  21963. // "profileId": {
  21964. // "description": "User profile ID associated with this request.",
  21965. // "format": "int64",
  21966. // "location": "path",
  21967. // "required": true,
  21968. // "type": "string"
  21969. // }
  21970. // },
  21971. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  21972. // "request": {
  21973. // "$ref": "CreativeAssetMetadata"
  21974. // },
  21975. // "response": {
  21976. // "$ref": "CreativeAssetMetadata"
  21977. // },
  21978. // "scopes": [
  21979. // "https://www.googleapis.com/auth/dfatrafficking"
  21980. // ],
  21981. // "supportsMediaUpload": true
  21982. // }
  21983. }
  21984. // method id "dfareporting.creativeFieldValues.delete":
  21985. type CreativeFieldValuesDeleteCall struct {
  21986. s *Service
  21987. profileId int64
  21988. creativeFieldId int64
  21989. id int64
  21990. urlParams_ gensupport.URLParams
  21991. ctx_ context.Context
  21992. header_ http.Header
  21993. }
  21994. // Delete: Deletes an existing creative field value.
  21995. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  21996. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21997. c.profileId = profileId
  21998. c.creativeFieldId = creativeFieldId
  21999. c.id = id
  22000. return c
  22001. }
  22002. // Fields allows partial responses to be retrieved. See
  22003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22004. // for more information.
  22005. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  22006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22007. return c
  22008. }
  22009. // Context sets the context to be used in this call's Do method. Any
  22010. // pending HTTP request will be aborted if the provided context is
  22011. // canceled.
  22012. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  22013. c.ctx_ = ctx
  22014. return c
  22015. }
  22016. // Header returns an http.Header that can be modified by the caller to
  22017. // add HTTP headers to the request.
  22018. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  22019. if c.header_ == nil {
  22020. c.header_ = make(http.Header)
  22021. }
  22022. return c.header_
  22023. }
  22024. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  22025. reqHeaders := make(http.Header)
  22026. for k, v := range c.header_ {
  22027. reqHeaders[k] = v
  22028. }
  22029. reqHeaders.Set("User-Agent", c.s.userAgent())
  22030. var body io.Reader = nil
  22031. c.urlParams_.Set("alt", alt)
  22032. c.urlParams_.Set("prettyPrint", "false")
  22033. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  22034. urls += "?" + c.urlParams_.Encode()
  22035. req, err := http.NewRequest("DELETE", urls, body)
  22036. if err != nil {
  22037. return nil, err
  22038. }
  22039. req.Header = reqHeaders
  22040. googleapi.Expand(req.URL, map[string]string{
  22041. "profileId": strconv.FormatInt(c.profileId, 10),
  22042. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22043. "id": strconv.FormatInt(c.id, 10),
  22044. })
  22045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22046. }
  22047. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  22048. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  22049. gensupport.SetOptions(c.urlParams_, opts...)
  22050. res, err := c.doRequest("json")
  22051. if err != nil {
  22052. return err
  22053. }
  22054. defer googleapi.CloseBody(res)
  22055. if err := googleapi.CheckResponse(res); err != nil {
  22056. return err
  22057. }
  22058. return nil
  22059. // {
  22060. // "description": "Deletes an existing creative field value.",
  22061. // "httpMethod": "DELETE",
  22062. // "id": "dfareporting.creativeFieldValues.delete",
  22063. // "parameterOrder": [
  22064. // "profileId",
  22065. // "creativeFieldId",
  22066. // "id"
  22067. // ],
  22068. // "parameters": {
  22069. // "creativeFieldId": {
  22070. // "description": "Creative field ID for this creative field value.",
  22071. // "format": "int64",
  22072. // "location": "path",
  22073. // "required": true,
  22074. // "type": "string"
  22075. // },
  22076. // "id": {
  22077. // "description": "Creative Field Value ID",
  22078. // "format": "int64",
  22079. // "location": "path",
  22080. // "required": true,
  22081. // "type": "string"
  22082. // },
  22083. // "profileId": {
  22084. // "description": "User profile ID associated with this request.",
  22085. // "format": "int64",
  22086. // "location": "path",
  22087. // "required": true,
  22088. // "type": "string"
  22089. // }
  22090. // },
  22091. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22092. // "scopes": [
  22093. // "https://www.googleapis.com/auth/dfatrafficking"
  22094. // ]
  22095. // }
  22096. }
  22097. // method id "dfareporting.creativeFieldValues.get":
  22098. type CreativeFieldValuesGetCall struct {
  22099. s *Service
  22100. profileId int64
  22101. creativeFieldId int64
  22102. id int64
  22103. urlParams_ gensupport.URLParams
  22104. ifNoneMatch_ string
  22105. ctx_ context.Context
  22106. header_ http.Header
  22107. }
  22108. // Get: Gets one creative field value by ID.
  22109. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  22110. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22111. c.profileId = profileId
  22112. c.creativeFieldId = creativeFieldId
  22113. c.id = id
  22114. return c
  22115. }
  22116. // Fields allows partial responses to be retrieved. See
  22117. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22118. // for more information.
  22119. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  22120. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22121. return c
  22122. }
  22123. // IfNoneMatch sets the optional parameter which makes the operation
  22124. // fail if the object's ETag matches the given value. This is useful for
  22125. // getting updates only after the object has changed since the last
  22126. // request. Use googleapi.IsNotModified to check whether the response
  22127. // error from Do is the result of In-None-Match.
  22128. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  22129. c.ifNoneMatch_ = entityTag
  22130. return c
  22131. }
  22132. // Context sets the context to be used in this call's Do method. Any
  22133. // pending HTTP request will be aborted if the provided context is
  22134. // canceled.
  22135. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  22136. c.ctx_ = ctx
  22137. return c
  22138. }
  22139. // Header returns an http.Header that can be modified by the caller to
  22140. // add HTTP headers to the request.
  22141. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  22142. if c.header_ == nil {
  22143. c.header_ = make(http.Header)
  22144. }
  22145. return c.header_
  22146. }
  22147. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  22148. reqHeaders := make(http.Header)
  22149. for k, v := range c.header_ {
  22150. reqHeaders[k] = v
  22151. }
  22152. reqHeaders.Set("User-Agent", c.s.userAgent())
  22153. if c.ifNoneMatch_ != "" {
  22154. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22155. }
  22156. var body io.Reader = nil
  22157. c.urlParams_.Set("alt", alt)
  22158. c.urlParams_.Set("prettyPrint", "false")
  22159. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  22160. urls += "?" + c.urlParams_.Encode()
  22161. req, err := http.NewRequest("GET", urls, body)
  22162. if err != nil {
  22163. return nil, err
  22164. }
  22165. req.Header = reqHeaders
  22166. googleapi.Expand(req.URL, map[string]string{
  22167. "profileId": strconv.FormatInt(c.profileId, 10),
  22168. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22169. "id": strconv.FormatInt(c.id, 10),
  22170. })
  22171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22172. }
  22173. // Do executes the "dfareporting.creativeFieldValues.get" call.
  22174. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22175. // non-2xx status code is an error. Response headers are in either
  22176. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22177. // returned at all) in error.(*googleapi.Error).Header. Use
  22178. // googleapi.IsNotModified to check whether the returned error was
  22179. // because http.StatusNotModified was returned.
  22180. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22181. gensupport.SetOptions(c.urlParams_, opts...)
  22182. res, err := c.doRequest("json")
  22183. if res != nil && res.StatusCode == http.StatusNotModified {
  22184. if res.Body != nil {
  22185. res.Body.Close()
  22186. }
  22187. return nil, &googleapi.Error{
  22188. Code: res.StatusCode,
  22189. Header: res.Header,
  22190. }
  22191. }
  22192. if err != nil {
  22193. return nil, err
  22194. }
  22195. defer googleapi.CloseBody(res)
  22196. if err := googleapi.CheckResponse(res); err != nil {
  22197. return nil, err
  22198. }
  22199. ret := &CreativeFieldValue{
  22200. ServerResponse: googleapi.ServerResponse{
  22201. Header: res.Header,
  22202. HTTPStatusCode: res.StatusCode,
  22203. },
  22204. }
  22205. target := &ret
  22206. if err := gensupport.DecodeResponse(target, res); err != nil {
  22207. return nil, err
  22208. }
  22209. return ret, nil
  22210. // {
  22211. // "description": "Gets one creative field value by ID.",
  22212. // "httpMethod": "GET",
  22213. // "id": "dfareporting.creativeFieldValues.get",
  22214. // "parameterOrder": [
  22215. // "profileId",
  22216. // "creativeFieldId",
  22217. // "id"
  22218. // ],
  22219. // "parameters": {
  22220. // "creativeFieldId": {
  22221. // "description": "Creative field ID for this creative field value.",
  22222. // "format": "int64",
  22223. // "location": "path",
  22224. // "required": true,
  22225. // "type": "string"
  22226. // },
  22227. // "id": {
  22228. // "description": "Creative Field Value ID",
  22229. // "format": "int64",
  22230. // "location": "path",
  22231. // "required": true,
  22232. // "type": "string"
  22233. // },
  22234. // "profileId": {
  22235. // "description": "User profile ID associated with this request.",
  22236. // "format": "int64",
  22237. // "location": "path",
  22238. // "required": true,
  22239. // "type": "string"
  22240. // }
  22241. // },
  22242. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22243. // "response": {
  22244. // "$ref": "CreativeFieldValue"
  22245. // },
  22246. // "scopes": [
  22247. // "https://www.googleapis.com/auth/dfatrafficking"
  22248. // ]
  22249. // }
  22250. }
  22251. // method id "dfareporting.creativeFieldValues.insert":
  22252. type CreativeFieldValuesInsertCall struct {
  22253. s *Service
  22254. profileId int64
  22255. creativeFieldId int64
  22256. creativefieldvalue *CreativeFieldValue
  22257. urlParams_ gensupport.URLParams
  22258. ctx_ context.Context
  22259. header_ http.Header
  22260. }
  22261. // Insert: Inserts a new creative field value.
  22262. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  22263. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22264. c.profileId = profileId
  22265. c.creativeFieldId = creativeFieldId
  22266. c.creativefieldvalue = creativefieldvalue
  22267. return c
  22268. }
  22269. // Fields allows partial responses to be retrieved. See
  22270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22271. // for more information.
  22272. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  22273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22274. return c
  22275. }
  22276. // Context sets the context to be used in this call's Do method. Any
  22277. // pending HTTP request will be aborted if the provided context is
  22278. // canceled.
  22279. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  22280. c.ctx_ = ctx
  22281. return c
  22282. }
  22283. // Header returns an http.Header that can be modified by the caller to
  22284. // add HTTP headers to the request.
  22285. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  22286. if c.header_ == nil {
  22287. c.header_ = make(http.Header)
  22288. }
  22289. return c.header_
  22290. }
  22291. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  22292. reqHeaders := make(http.Header)
  22293. for k, v := range c.header_ {
  22294. reqHeaders[k] = v
  22295. }
  22296. reqHeaders.Set("User-Agent", c.s.userAgent())
  22297. var body io.Reader = nil
  22298. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22299. if err != nil {
  22300. return nil, err
  22301. }
  22302. reqHeaders.Set("Content-Type", "application/json")
  22303. c.urlParams_.Set("alt", alt)
  22304. c.urlParams_.Set("prettyPrint", "false")
  22305. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22306. urls += "?" + c.urlParams_.Encode()
  22307. req, err := http.NewRequest("POST", urls, body)
  22308. if err != nil {
  22309. return nil, err
  22310. }
  22311. req.Header = reqHeaders
  22312. googleapi.Expand(req.URL, map[string]string{
  22313. "profileId": strconv.FormatInt(c.profileId, 10),
  22314. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22315. })
  22316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22317. }
  22318. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  22319. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22320. // non-2xx status code is an error. Response headers are in either
  22321. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22322. // returned at all) in error.(*googleapi.Error).Header. Use
  22323. // googleapi.IsNotModified to check whether the returned error was
  22324. // because http.StatusNotModified was returned.
  22325. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22326. gensupport.SetOptions(c.urlParams_, opts...)
  22327. res, err := c.doRequest("json")
  22328. if res != nil && res.StatusCode == http.StatusNotModified {
  22329. if res.Body != nil {
  22330. res.Body.Close()
  22331. }
  22332. return nil, &googleapi.Error{
  22333. Code: res.StatusCode,
  22334. Header: res.Header,
  22335. }
  22336. }
  22337. if err != nil {
  22338. return nil, err
  22339. }
  22340. defer googleapi.CloseBody(res)
  22341. if err := googleapi.CheckResponse(res); err != nil {
  22342. return nil, err
  22343. }
  22344. ret := &CreativeFieldValue{
  22345. ServerResponse: googleapi.ServerResponse{
  22346. Header: res.Header,
  22347. HTTPStatusCode: res.StatusCode,
  22348. },
  22349. }
  22350. target := &ret
  22351. if err := gensupport.DecodeResponse(target, res); err != nil {
  22352. return nil, err
  22353. }
  22354. return ret, nil
  22355. // {
  22356. // "description": "Inserts a new creative field value.",
  22357. // "httpMethod": "POST",
  22358. // "id": "dfareporting.creativeFieldValues.insert",
  22359. // "parameterOrder": [
  22360. // "profileId",
  22361. // "creativeFieldId"
  22362. // ],
  22363. // "parameters": {
  22364. // "creativeFieldId": {
  22365. // "description": "Creative field ID for this creative field value.",
  22366. // "format": "int64",
  22367. // "location": "path",
  22368. // "required": true,
  22369. // "type": "string"
  22370. // },
  22371. // "profileId": {
  22372. // "description": "User profile ID associated with this request.",
  22373. // "format": "int64",
  22374. // "location": "path",
  22375. // "required": true,
  22376. // "type": "string"
  22377. // }
  22378. // },
  22379. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22380. // "request": {
  22381. // "$ref": "CreativeFieldValue"
  22382. // },
  22383. // "response": {
  22384. // "$ref": "CreativeFieldValue"
  22385. // },
  22386. // "scopes": [
  22387. // "https://www.googleapis.com/auth/dfatrafficking"
  22388. // ]
  22389. // }
  22390. }
  22391. // method id "dfareporting.creativeFieldValues.list":
  22392. type CreativeFieldValuesListCall struct {
  22393. s *Service
  22394. profileId int64
  22395. creativeFieldId int64
  22396. urlParams_ gensupport.URLParams
  22397. ifNoneMatch_ string
  22398. ctx_ context.Context
  22399. header_ http.Header
  22400. }
  22401. // List: Retrieves a list of creative field values, possibly filtered.
  22402. // This method supports paging.
  22403. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  22404. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22405. c.profileId = profileId
  22406. c.creativeFieldId = creativeFieldId
  22407. return c
  22408. }
  22409. // Ids sets the optional parameter "ids": Select only creative field
  22410. // values with these IDs.
  22411. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  22412. var ids_ []string
  22413. for _, v := range ids {
  22414. ids_ = append(ids_, fmt.Sprint(v))
  22415. }
  22416. c.urlParams_.SetMulti("ids", ids_)
  22417. return c
  22418. }
  22419. // MaxResults sets the optional parameter "maxResults": Maximum number
  22420. // of results to return.
  22421. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  22422. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22423. return c
  22424. }
  22425. // PageToken sets the optional parameter "pageToken": Value of the
  22426. // nextPageToken from the previous result page.
  22427. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  22428. c.urlParams_.Set("pageToken", pageToken)
  22429. return c
  22430. }
  22431. // SearchString sets the optional parameter "searchString": Allows
  22432. // searching for creative field values by their values. Wildcards (e.g.
  22433. // *) are not allowed.
  22434. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  22435. c.urlParams_.Set("searchString", searchString)
  22436. return c
  22437. }
  22438. // SortField sets the optional parameter "sortField": Field by which to
  22439. // sort the list.
  22440. //
  22441. // Possible values:
  22442. // "ID" (default)
  22443. // "VALUE"
  22444. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  22445. c.urlParams_.Set("sortField", sortField)
  22446. return c
  22447. }
  22448. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22449. // results.
  22450. //
  22451. // Possible values:
  22452. // "ASCENDING" (default)
  22453. // "DESCENDING"
  22454. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  22455. c.urlParams_.Set("sortOrder", sortOrder)
  22456. return c
  22457. }
  22458. // Fields allows partial responses to be retrieved. See
  22459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22460. // for more information.
  22461. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  22462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22463. return c
  22464. }
  22465. // IfNoneMatch sets the optional parameter which makes the operation
  22466. // fail if the object's ETag matches the given value. This is useful for
  22467. // getting updates only after the object has changed since the last
  22468. // request. Use googleapi.IsNotModified to check whether the response
  22469. // error from Do is the result of In-None-Match.
  22470. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  22471. c.ifNoneMatch_ = entityTag
  22472. return c
  22473. }
  22474. // Context sets the context to be used in this call's Do method. Any
  22475. // pending HTTP request will be aborted if the provided context is
  22476. // canceled.
  22477. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  22478. c.ctx_ = ctx
  22479. return c
  22480. }
  22481. // Header returns an http.Header that can be modified by the caller to
  22482. // add HTTP headers to the request.
  22483. func (c *CreativeFieldValuesListCall) Header() http.Header {
  22484. if c.header_ == nil {
  22485. c.header_ = make(http.Header)
  22486. }
  22487. return c.header_
  22488. }
  22489. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  22490. reqHeaders := make(http.Header)
  22491. for k, v := range c.header_ {
  22492. reqHeaders[k] = v
  22493. }
  22494. reqHeaders.Set("User-Agent", c.s.userAgent())
  22495. if c.ifNoneMatch_ != "" {
  22496. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22497. }
  22498. var body io.Reader = nil
  22499. c.urlParams_.Set("alt", alt)
  22500. c.urlParams_.Set("prettyPrint", "false")
  22501. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22502. urls += "?" + c.urlParams_.Encode()
  22503. req, err := http.NewRequest("GET", urls, body)
  22504. if err != nil {
  22505. return nil, err
  22506. }
  22507. req.Header = reqHeaders
  22508. googleapi.Expand(req.URL, map[string]string{
  22509. "profileId": strconv.FormatInt(c.profileId, 10),
  22510. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22511. })
  22512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22513. }
  22514. // Do executes the "dfareporting.creativeFieldValues.list" call.
  22515. // Exactly one of *CreativeFieldValuesListResponse or error will be
  22516. // non-nil. Any non-2xx status code is an error. Response headers are in
  22517. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  22518. // a response was returned at all) in error.(*googleapi.Error).Header.
  22519. // Use googleapi.IsNotModified to check whether the returned error was
  22520. // because http.StatusNotModified was returned.
  22521. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  22522. gensupport.SetOptions(c.urlParams_, opts...)
  22523. res, err := c.doRequest("json")
  22524. if res != nil && res.StatusCode == http.StatusNotModified {
  22525. if res.Body != nil {
  22526. res.Body.Close()
  22527. }
  22528. return nil, &googleapi.Error{
  22529. Code: res.StatusCode,
  22530. Header: res.Header,
  22531. }
  22532. }
  22533. if err != nil {
  22534. return nil, err
  22535. }
  22536. defer googleapi.CloseBody(res)
  22537. if err := googleapi.CheckResponse(res); err != nil {
  22538. return nil, err
  22539. }
  22540. ret := &CreativeFieldValuesListResponse{
  22541. ServerResponse: googleapi.ServerResponse{
  22542. Header: res.Header,
  22543. HTTPStatusCode: res.StatusCode,
  22544. },
  22545. }
  22546. target := &ret
  22547. if err := gensupport.DecodeResponse(target, res); err != nil {
  22548. return nil, err
  22549. }
  22550. return ret, nil
  22551. // {
  22552. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  22553. // "httpMethod": "GET",
  22554. // "id": "dfareporting.creativeFieldValues.list",
  22555. // "parameterOrder": [
  22556. // "profileId",
  22557. // "creativeFieldId"
  22558. // ],
  22559. // "parameters": {
  22560. // "creativeFieldId": {
  22561. // "description": "Creative field ID for this creative field value.",
  22562. // "format": "int64",
  22563. // "location": "path",
  22564. // "required": true,
  22565. // "type": "string"
  22566. // },
  22567. // "ids": {
  22568. // "description": "Select only creative field values with these IDs.",
  22569. // "format": "int64",
  22570. // "location": "query",
  22571. // "repeated": true,
  22572. // "type": "string"
  22573. // },
  22574. // "maxResults": {
  22575. // "default": "1000",
  22576. // "description": "Maximum number of results to return.",
  22577. // "format": "int32",
  22578. // "location": "query",
  22579. // "maximum": "1000",
  22580. // "minimum": "0",
  22581. // "type": "integer"
  22582. // },
  22583. // "pageToken": {
  22584. // "description": "Value of the nextPageToken from the previous result page.",
  22585. // "location": "query",
  22586. // "type": "string"
  22587. // },
  22588. // "profileId": {
  22589. // "description": "User profile ID associated with this request.",
  22590. // "format": "int64",
  22591. // "location": "path",
  22592. // "required": true,
  22593. // "type": "string"
  22594. // },
  22595. // "searchString": {
  22596. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  22597. // "location": "query",
  22598. // "type": "string"
  22599. // },
  22600. // "sortField": {
  22601. // "default": "ID",
  22602. // "description": "Field by which to sort the list.",
  22603. // "enum": [
  22604. // "ID",
  22605. // "VALUE"
  22606. // ],
  22607. // "enumDescriptions": [
  22608. // "",
  22609. // ""
  22610. // ],
  22611. // "location": "query",
  22612. // "type": "string"
  22613. // },
  22614. // "sortOrder": {
  22615. // "default": "ASCENDING",
  22616. // "description": "Order of sorted results.",
  22617. // "enum": [
  22618. // "ASCENDING",
  22619. // "DESCENDING"
  22620. // ],
  22621. // "enumDescriptions": [
  22622. // "",
  22623. // ""
  22624. // ],
  22625. // "location": "query",
  22626. // "type": "string"
  22627. // }
  22628. // },
  22629. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22630. // "response": {
  22631. // "$ref": "CreativeFieldValuesListResponse"
  22632. // },
  22633. // "scopes": [
  22634. // "https://www.googleapis.com/auth/dfatrafficking"
  22635. // ]
  22636. // }
  22637. }
  22638. // Pages invokes f for each page of results.
  22639. // A non-nil error returned from f will halt the iteration.
  22640. // The provided context supersedes any context provided to the Context method.
  22641. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  22642. c.ctx_ = ctx
  22643. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22644. for {
  22645. x, err := c.Do()
  22646. if err != nil {
  22647. return err
  22648. }
  22649. if err := f(x); err != nil {
  22650. return err
  22651. }
  22652. if x.NextPageToken == "" {
  22653. return nil
  22654. }
  22655. c.PageToken(x.NextPageToken)
  22656. }
  22657. }
  22658. // method id "dfareporting.creativeFieldValues.patch":
  22659. type CreativeFieldValuesPatchCall struct {
  22660. s *Service
  22661. profileId int64
  22662. creativeFieldId int64
  22663. creativefieldvalue *CreativeFieldValue
  22664. urlParams_ gensupport.URLParams
  22665. ctx_ context.Context
  22666. header_ http.Header
  22667. }
  22668. // Patch: Updates an existing creative field value. This method supports
  22669. // patch semantics.
  22670. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  22671. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22672. c.profileId = profileId
  22673. c.creativeFieldId = creativeFieldId
  22674. c.urlParams_.Set("id", fmt.Sprint(id))
  22675. c.creativefieldvalue = creativefieldvalue
  22676. return c
  22677. }
  22678. // Fields allows partial responses to be retrieved. See
  22679. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22680. // for more information.
  22681. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  22682. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22683. return c
  22684. }
  22685. // Context sets the context to be used in this call's Do method. Any
  22686. // pending HTTP request will be aborted if the provided context is
  22687. // canceled.
  22688. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  22689. c.ctx_ = ctx
  22690. return c
  22691. }
  22692. // Header returns an http.Header that can be modified by the caller to
  22693. // add HTTP headers to the request.
  22694. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  22695. if c.header_ == nil {
  22696. c.header_ = make(http.Header)
  22697. }
  22698. return c.header_
  22699. }
  22700. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  22701. reqHeaders := make(http.Header)
  22702. for k, v := range c.header_ {
  22703. reqHeaders[k] = v
  22704. }
  22705. reqHeaders.Set("User-Agent", c.s.userAgent())
  22706. var body io.Reader = nil
  22707. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22708. if err != nil {
  22709. return nil, err
  22710. }
  22711. reqHeaders.Set("Content-Type", "application/json")
  22712. c.urlParams_.Set("alt", alt)
  22713. c.urlParams_.Set("prettyPrint", "false")
  22714. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22715. urls += "?" + c.urlParams_.Encode()
  22716. req, err := http.NewRequest("PATCH", urls, body)
  22717. if err != nil {
  22718. return nil, err
  22719. }
  22720. req.Header = reqHeaders
  22721. googleapi.Expand(req.URL, map[string]string{
  22722. "profileId": strconv.FormatInt(c.profileId, 10),
  22723. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22724. })
  22725. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22726. }
  22727. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  22728. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22729. // non-2xx status code is an error. Response headers are in either
  22730. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22731. // returned at all) in error.(*googleapi.Error).Header. Use
  22732. // googleapi.IsNotModified to check whether the returned error was
  22733. // because http.StatusNotModified was returned.
  22734. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22735. gensupport.SetOptions(c.urlParams_, opts...)
  22736. res, err := c.doRequest("json")
  22737. if res != nil && res.StatusCode == http.StatusNotModified {
  22738. if res.Body != nil {
  22739. res.Body.Close()
  22740. }
  22741. return nil, &googleapi.Error{
  22742. Code: res.StatusCode,
  22743. Header: res.Header,
  22744. }
  22745. }
  22746. if err != nil {
  22747. return nil, err
  22748. }
  22749. defer googleapi.CloseBody(res)
  22750. if err := googleapi.CheckResponse(res); err != nil {
  22751. return nil, err
  22752. }
  22753. ret := &CreativeFieldValue{
  22754. ServerResponse: googleapi.ServerResponse{
  22755. Header: res.Header,
  22756. HTTPStatusCode: res.StatusCode,
  22757. },
  22758. }
  22759. target := &ret
  22760. if err := gensupport.DecodeResponse(target, res); err != nil {
  22761. return nil, err
  22762. }
  22763. return ret, nil
  22764. // {
  22765. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  22766. // "httpMethod": "PATCH",
  22767. // "id": "dfareporting.creativeFieldValues.patch",
  22768. // "parameterOrder": [
  22769. // "profileId",
  22770. // "creativeFieldId",
  22771. // "id"
  22772. // ],
  22773. // "parameters": {
  22774. // "creativeFieldId": {
  22775. // "description": "Creative field ID for this creative field value.",
  22776. // "format": "int64",
  22777. // "location": "path",
  22778. // "required": true,
  22779. // "type": "string"
  22780. // },
  22781. // "id": {
  22782. // "description": "Creative Field Value ID",
  22783. // "format": "int64",
  22784. // "location": "query",
  22785. // "required": true,
  22786. // "type": "string"
  22787. // },
  22788. // "profileId": {
  22789. // "description": "User profile ID associated with this request.",
  22790. // "format": "int64",
  22791. // "location": "path",
  22792. // "required": true,
  22793. // "type": "string"
  22794. // }
  22795. // },
  22796. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22797. // "request": {
  22798. // "$ref": "CreativeFieldValue"
  22799. // },
  22800. // "response": {
  22801. // "$ref": "CreativeFieldValue"
  22802. // },
  22803. // "scopes": [
  22804. // "https://www.googleapis.com/auth/dfatrafficking"
  22805. // ]
  22806. // }
  22807. }
  22808. // method id "dfareporting.creativeFieldValues.update":
  22809. type CreativeFieldValuesUpdateCall struct {
  22810. s *Service
  22811. profileId int64
  22812. creativeFieldId int64
  22813. creativefieldvalue *CreativeFieldValue
  22814. urlParams_ gensupport.URLParams
  22815. ctx_ context.Context
  22816. header_ http.Header
  22817. }
  22818. // Update: Updates an existing creative field value.
  22819. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  22820. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22821. c.profileId = profileId
  22822. c.creativeFieldId = creativeFieldId
  22823. c.creativefieldvalue = creativefieldvalue
  22824. return c
  22825. }
  22826. // Fields allows partial responses to be retrieved. See
  22827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22828. // for more information.
  22829. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  22830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22831. return c
  22832. }
  22833. // Context sets the context to be used in this call's Do method. Any
  22834. // pending HTTP request will be aborted if the provided context is
  22835. // canceled.
  22836. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  22837. c.ctx_ = ctx
  22838. return c
  22839. }
  22840. // Header returns an http.Header that can be modified by the caller to
  22841. // add HTTP headers to the request.
  22842. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  22843. if c.header_ == nil {
  22844. c.header_ = make(http.Header)
  22845. }
  22846. return c.header_
  22847. }
  22848. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  22849. reqHeaders := make(http.Header)
  22850. for k, v := range c.header_ {
  22851. reqHeaders[k] = v
  22852. }
  22853. reqHeaders.Set("User-Agent", c.s.userAgent())
  22854. var body io.Reader = nil
  22855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22856. if err != nil {
  22857. return nil, err
  22858. }
  22859. reqHeaders.Set("Content-Type", "application/json")
  22860. c.urlParams_.Set("alt", alt)
  22861. c.urlParams_.Set("prettyPrint", "false")
  22862. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22863. urls += "?" + c.urlParams_.Encode()
  22864. req, err := http.NewRequest("PUT", urls, body)
  22865. if err != nil {
  22866. return nil, err
  22867. }
  22868. req.Header = reqHeaders
  22869. googleapi.Expand(req.URL, map[string]string{
  22870. "profileId": strconv.FormatInt(c.profileId, 10),
  22871. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22872. })
  22873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22874. }
  22875. // Do executes the "dfareporting.creativeFieldValues.update" call.
  22876. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22877. // non-2xx status code is an error. Response headers are in either
  22878. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22879. // returned at all) in error.(*googleapi.Error).Header. Use
  22880. // googleapi.IsNotModified to check whether the returned error was
  22881. // because http.StatusNotModified was returned.
  22882. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22883. gensupport.SetOptions(c.urlParams_, opts...)
  22884. res, err := c.doRequest("json")
  22885. if res != nil && res.StatusCode == http.StatusNotModified {
  22886. if res.Body != nil {
  22887. res.Body.Close()
  22888. }
  22889. return nil, &googleapi.Error{
  22890. Code: res.StatusCode,
  22891. Header: res.Header,
  22892. }
  22893. }
  22894. if err != nil {
  22895. return nil, err
  22896. }
  22897. defer googleapi.CloseBody(res)
  22898. if err := googleapi.CheckResponse(res); err != nil {
  22899. return nil, err
  22900. }
  22901. ret := &CreativeFieldValue{
  22902. ServerResponse: googleapi.ServerResponse{
  22903. Header: res.Header,
  22904. HTTPStatusCode: res.StatusCode,
  22905. },
  22906. }
  22907. target := &ret
  22908. if err := gensupport.DecodeResponse(target, res); err != nil {
  22909. return nil, err
  22910. }
  22911. return ret, nil
  22912. // {
  22913. // "description": "Updates an existing creative field value.",
  22914. // "httpMethod": "PUT",
  22915. // "id": "dfareporting.creativeFieldValues.update",
  22916. // "parameterOrder": [
  22917. // "profileId",
  22918. // "creativeFieldId"
  22919. // ],
  22920. // "parameters": {
  22921. // "creativeFieldId": {
  22922. // "description": "Creative field ID for this creative field value.",
  22923. // "format": "int64",
  22924. // "location": "path",
  22925. // "required": true,
  22926. // "type": "string"
  22927. // },
  22928. // "profileId": {
  22929. // "description": "User profile ID associated with this request.",
  22930. // "format": "int64",
  22931. // "location": "path",
  22932. // "required": true,
  22933. // "type": "string"
  22934. // }
  22935. // },
  22936. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22937. // "request": {
  22938. // "$ref": "CreativeFieldValue"
  22939. // },
  22940. // "response": {
  22941. // "$ref": "CreativeFieldValue"
  22942. // },
  22943. // "scopes": [
  22944. // "https://www.googleapis.com/auth/dfatrafficking"
  22945. // ]
  22946. // }
  22947. }
  22948. // method id "dfareporting.creativeFields.delete":
  22949. type CreativeFieldsDeleteCall struct {
  22950. s *Service
  22951. profileId int64
  22952. id int64
  22953. urlParams_ gensupport.URLParams
  22954. ctx_ context.Context
  22955. header_ http.Header
  22956. }
  22957. // Delete: Deletes an existing creative field.
  22958. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  22959. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22960. c.profileId = profileId
  22961. c.id = id
  22962. return c
  22963. }
  22964. // Fields allows partial responses to be retrieved. See
  22965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22966. // for more information.
  22967. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  22968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22969. return c
  22970. }
  22971. // Context sets the context to be used in this call's Do method. Any
  22972. // pending HTTP request will be aborted if the provided context is
  22973. // canceled.
  22974. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  22975. c.ctx_ = ctx
  22976. return c
  22977. }
  22978. // Header returns an http.Header that can be modified by the caller to
  22979. // add HTTP headers to the request.
  22980. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  22981. if c.header_ == nil {
  22982. c.header_ = make(http.Header)
  22983. }
  22984. return c.header_
  22985. }
  22986. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  22987. reqHeaders := make(http.Header)
  22988. for k, v := range c.header_ {
  22989. reqHeaders[k] = v
  22990. }
  22991. reqHeaders.Set("User-Agent", c.s.userAgent())
  22992. var body io.Reader = nil
  22993. c.urlParams_.Set("alt", alt)
  22994. c.urlParams_.Set("prettyPrint", "false")
  22995. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22996. urls += "?" + c.urlParams_.Encode()
  22997. req, err := http.NewRequest("DELETE", urls, body)
  22998. if err != nil {
  22999. return nil, err
  23000. }
  23001. req.Header = reqHeaders
  23002. googleapi.Expand(req.URL, map[string]string{
  23003. "profileId": strconv.FormatInt(c.profileId, 10),
  23004. "id": strconv.FormatInt(c.id, 10),
  23005. })
  23006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23007. }
  23008. // Do executes the "dfareporting.creativeFields.delete" call.
  23009. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  23010. gensupport.SetOptions(c.urlParams_, opts...)
  23011. res, err := c.doRequest("json")
  23012. if err != nil {
  23013. return err
  23014. }
  23015. defer googleapi.CloseBody(res)
  23016. if err := googleapi.CheckResponse(res); err != nil {
  23017. return err
  23018. }
  23019. return nil
  23020. // {
  23021. // "description": "Deletes an existing creative field.",
  23022. // "httpMethod": "DELETE",
  23023. // "id": "dfareporting.creativeFields.delete",
  23024. // "parameterOrder": [
  23025. // "profileId",
  23026. // "id"
  23027. // ],
  23028. // "parameters": {
  23029. // "id": {
  23030. // "description": "Creative Field ID",
  23031. // "format": "int64",
  23032. // "location": "path",
  23033. // "required": true,
  23034. // "type": "string"
  23035. // },
  23036. // "profileId": {
  23037. // "description": "User profile ID associated with this request.",
  23038. // "format": "int64",
  23039. // "location": "path",
  23040. // "required": true,
  23041. // "type": "string"
  23042. // }
  23043. // },
  23044. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  23045. // "scopes": [
  23046. // "https://www.googleapis.com/auth/dfatrafficking"
  23047. // ]
  23048. // }
  23049. }
  23050. // method id "dfareporting.creativeFields.get":
  23051. type CreativeFieldsGetCall struct {
  23052. s *Service
  23053. profileId int64
  23054. id int64
  23055. urlParams_ gensupport.URLParams
  23056. ifNoneMatch_ string
  23057. ctx_ context.Context
  23058. header_ http.Header
  23059. }
  23060. // Get: Gets one creative field by ID.
  23061. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  23062. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23063. c.profileId = profileId
  23064. c.id = id
  23065. return c
  23066. }
  23067. // Fields allows partial responses to be retrieved. See
  23068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23069. // for more information.
  23070. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  23071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23072. return c
  23073. }
  23074. // IfNoneMatch sets the optional parameter which makes the operation
  23075. // fail if the object's ETag matches the given value. This is useful for
  23076. // getting updates only after the object has changed since the last
  23077. // request. Use googleapi.IsNotModified to check whether the response
  23078. // error from Do is the result of In-None-Match.
  23079. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  23080. c.ifNoneMatch_ = entityTag
  23081. return c
  23082. }
  23083. // Context sets the context to be used in this call's Do method. Any
  23084. // pending HTTP request will be aborted if the provided context is
  23085. // canceled.
  23086. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  23087. c.ctx_ = ctx
  23088. return c
  23089. }
  23090. // Header returns an http.Header that can be modified by the caller to
  23091. // add HTTP headers to the request.
  23092. func (c *CreativeFieldsGetCall) Header() http.Header {
  23093. if c.header_ == nil {
  23094. c.header_ = make(http.Header)
  23095. }
  23096. return c.header_
  23097. }
  23098. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  23099. reqHeaders := make(http.Header)
  23100. for k, v := range c.header_ {
  23101. reqHeaders[k] = v
  23102. }
  23103. reqHeaders.Set("User-Agent", c.s.userAgent())
  23104. if c.ifNoneMatch_ != "" {
  23105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23106. }
  23107. var body io.Reader = nil
  23108. c.urlParams_.Set("alt", alt)
  23109. c.urlParams_.Set("prettyPrint", "false")
  23110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  23111. urls += "?" + c.urlParams_.Encode()
  23112. req, err := http.NewRequest("GET", urls, body)
  23113. if err != nil {
  23114. return nil, err
  23115. }
  23116. req.Header = reqHeaders
  23117. googleapi.Expand(req.URL, map[string]string{
  23118. "profileId": strconv.FormatInt(c.profileId, 10),
  23119. "id": strconv.FormatInt(c.id, 10),
  23120. })
  23121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23122. }
  23123. // Do executes the "dfareporting.creativeFields.get" call.
  23124. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23125. // status code is an error. Response headers are in either
  23126. // *CreativeField.ServerResponse.Header or (if a response was returned
  23127. // at all) in error.(*googleapi.Error).Header. Use
  23128. // googleapi.IsNotModified to check whether the returned error was
  23129. // because http.StatusNotModified was returned.
  23130. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23131. gensupport.SetOptions(c.urlParams_, opts...)
  23132. res, err := c.doRequest("json")
  23133. if res != nil && res.StatusCode == http.StatusNotModified {
  23134. if res.Body != nil {
  23135. res.Body.Close()
  23136. }
  23137. return nil, &googleapi.Error{
  23138. Code: res.StatusCode,
  23139. Header: res.Header,
  23140. }
  23141. }
  23142. if err != nil {
  23143. return nil, err
  23144. }
  23145. defer googleapi.CloseBody(res)
  23146. if err := googleapi.CheckResponse(res); err != nil {
  23147. return nil, err
  23148. }
  23149. ret := &CreativeField{
  23150. ServerResponse: googleapi.ServerResponse{
  23151. Header: res.Header,
  23152. HTTPStatusCode: res.StatusCode,
  23153. },
  23154. }
  23155. target := &ret
  23156. if err := gensupport.DecodeResponse(target, res); err != nil {
  23157. return nil, err
  23158. }
  23159. return ret, nil
  23160. // {
  23161. // "description": "Gets one creative field by ID.",
  23162. // "httpMethod": "GET",
  23163. // "id": "dfareporting.creativeFields.get",
  23164. // "parameterOrder": [
  23165. // "profileId",
  23166. // "id"
  23167. // ],
  23168. // "parameters": {
  23169. // "id": {
  23170. // "description": "Creative Field ID",
  23171. // "format": "int64",
  23172. // "location": "path",
  23173. // "required": true,
  23174. // "type": "string"
  23175. // },
  23176. // "profileId": {
  23177. // "description": "User profile ID associated with this request.",
  23178. // "format": "int64",
  23179. // "location": "path",
  23180. // "required": true,
  23181. // "type": "string"
  23182. // }
  23183. // },
  23184. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  23185. // "response": {
  23186. // "$ref": "CreativeField"
  23187. // },
  23188. // "scopes": [
  23189. // "https://www.googleapis.com/auth/dfatrafficking"
  23190. // ]
  23191. // }
  23192. }
  23193. // method id "dfareporting.creativeFields.insert":
  23194. type CreativeFieldsInsertCall struct {
  23195. s *Service
  23196. profileId int64
  23197. creativefield *CreativeField
  23198. urlParams_ gensupport.URLParams
  23199. ctx_ context.Context
  23200. header_ http.Header
  23201. }
  23202. // Insert: Inserts a new creative field.
  23203. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  23204. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23205. c.profileId = profileId
  23206. c.creativefield = creativefield
  23207. return c
  23208. }
  23209. // Fields allows partial responses to be retrieved. See
  23210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23211. // for more information.
  23212. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  23213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23214. return c
  23215. }
  23216. // Context sets the context to be used in this call's Do method. Any
  23217. // pending HTTP request will be aborted if the provided context is
  23218. // canceled.
  23219. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  23220. c.ctx_ = ctx
  23221. return c
  23222. }
  23223. // Header returns an http.Header that can be modified by the caller to
  23224. // add HTTP headers to the request.
  23225. func (c *CreativeFieldsInsertCall) Header() http.Header {
  23226. if c.header_ == nil {
  23227. c.header_ = make(http.Header)
  23228. }
  23229. return c.header_
  23230. }
  23231. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  23232. reqHeaders := make(http.Header)
  23233. for k, v := range c.header_ {
  23234. reqHeaders[k] = v
  23235. }
  23236. reqHeaders.Set("User-Agent", c.s.userAgent())
  23237. var body io.Reader = nil
  23238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23239. if err != nil {
  23240. return nil, err
  23241. }
  23242. reqHeaders.Set("Content-Type", "application/json")
  23243. c.urlParams_.Set("alt", alt)
  23244. c.urlParams_.Set("prettyPrint", "false")
  23245. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23246. urls += "?" + c.urlParams_.Encode()
  23247. req, err := http.NewRequest("POST", urls, body)
  23248. if err != nil {
  23249. return nil, err
  23250. }
  23251. req.Header = reqHeaders
  23252. googleapi.Expand(req.URL, map[string]string{
  23253. "profileId": strconv.FormatInt(c.profileId, 10),
  23254. })
  23255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23256. }
  23257. // Do executes the "dfareporting.creativeFields.insert" call.
  23258. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23259. // status code is an error. Response headers are in either
  23260. // *CreativeField.ServerResponse.Header or (if a response was returned
  23261. // at all) in error.(*googleapi.Error).Header. Use
  23262. // googleapi.IsNotModified to check whether the returned error was
  23263. // because http.StatusNotModified was returned.
  23264. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23265. gensupport.SetOptions(c.urlParams_, opts...)
  23266. res, err := c.doRequest("json")
  23267. if res != nil && res.StatusCode == http.StatusNotModified {
  23268. if res.Body != nil {
  23269. res.Body.Close()
  23270. }
  23271. return nil, &googleapi.Error{
  23272. Code: res.StatusCode,
  23273. Header: res.Header,
  23274. }
  23275. }
  23276. if err != nil {
  23277. return nil, err
  23278. }
  23279. defer googleapi.CloseBody(res)
  23280. if err := googleapi.CheckResponse(res); err != nil {
  23281. return nil, err
  23282. }
  23283. ret := &CreativeField{
  23284. ServerResponse: googleapi.ServerResponse{
  23285. Header: res.Header,
  23286. HTTPStatusCode: res.StatusCode,
  23287. },
  23288. }
  23289. target := &ret
  23290. if err := gensupport.DecodeResponse(target, res); err != nil {
  23291. return nil, err
  23292. }
  23293. return ret, nil
  23294. // {
  23295. // "description": "Inserts a new creative field.",
  23296. // "httpMethod": "POST",
  23297. // "id": "dfareporting.creativeFields.insert",
  23298. // "parameterOrder": [
  23299. // "profileId"
  23300. // ],
  23301. // "parameters": {
  23302. // "profileId": {
  23303. // "description": "User profile ID associated with this request.",
  23304. // "format": "int64",
  23305. // "location": "path",
  23306. // "required": true,
  23307. // "type": "string"
  23308. // }
  23309. // },
  23310. // "path": "userprofiles/{profileId}/creativeFields",
  23311. // "request": {
  23312. // "$ref": "CreativeField"
  23313. // },
  23314. // "response": {
  23315. // "$ref": "CreativeField"
  23316. // },
  23317. // "scopes": [
  23318. // "https://www.googleapis.com/auth/dfatrafficking"
  23319. // ]
  23320. // }
  23321. }
  23322. // method id "dfareporting.creativeFields.list":
  23323. type CreativeFieldsListCall struct {
  23324. s *Service
  23325. profileId int64
  23326. urlParams_ gensupport.URLParams
  23327. ifNoneMatch_ string
  23328. ctx_ context.Context
  23329. header_ http.Header
  23330. }
  23331. // List: Retrieves a list of creative fields, possibly filtered. This
  23332. // method supports paging.
  23333. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  23334. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23335. c.profileId = profileId
  23336. return c
  23337. }
  23338. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23339. // only creative fields that belong to these advertisers.
  23340. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  23341. var advertiserIds_ []string
  23342. for _, v := range advertiserIds {
  23343. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23344. }
  23345. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23346. return c
  23347. }
  23348. // Ids sets the optional parameter "ids": Select only creative fields
  23349. // with these IDs.
  23350. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  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 *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  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 *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  23367. c.urlParams_.Set("pageToken", pageToken)
  23368. return c
  23369. }
  23370. // SearchString sets the optional parameter "searchString": Allows
  23371. // searching for creative fields by name or ID. Wildcards (*) are
  23372. // allowed. For example, "creativefield*2015" will return creative
  23373. // fields with names like "creativefield June 2015", "creativefield
  23374. // April 2015", or simply "creativefield 2015". Most of the searches
  23375. // also add wild-cards implicitly at the start and the end of the search
  23376. // string. For example, a search string of "creativefield" will match
  23377. // creative fields with the name "my creativefield", "creativefield
  23378. // 2015", or simply "creativefield".
  23379. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  23380. c.urlParams_.Set("searchString", searchString)
  23381. return c
  23382. }
  23383. // SortField sets the optional parameter "sortField": Field by which to
  23384. // sort the list.
  23385. //
  23386. // Possible values:
  23387. // "ID" (default)
  23388. // "NAME"
  23389. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  23390. c.urlParams_.Set("sortField", sortField)
  23391. return c
  23392. }
  23393. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23394. // results.
  23395. //
  23396. // Possible values:
  23397. // "ASCENDING" (default)
  23398. // "DESCENDING"
  23399. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  23400. c.urlParams_.Set("sortOrder", sortOrder)
  23401. return c
  23402. }
  23403. // Fields allows partial responses to be retrieved. See
  23404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23405. // for more information.
  23406. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  23407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23408. return c
  23409. }
  23410. // IfNoneMatch sets the optional parameter which makes the operation
  23411. // fail if the object's ETag matches the given value. This is useful for
  23412. // getting updates only after the object has changed since the last
  23413. // request. Use googleapi.IsNotModified to check whether the response
  23414. // error from Do is the result of In-None-Match.
  23415. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  23416. c.ifNoneMatch_ = entityTag
  23417. return c
  23418. }
  23419. // Context sets the context to be used in this call's Do method. Any
  23420. // pending HTTP request will be aborted if the provided context is
  23421. // canceled.
  23422. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  23423. c.ctx_ = ctx
  23424. return c
  23425. }
  23426. // Header returns an http.Header that can be modified by the caller to
  23427. // add HTTP headers to the request.
  23428. func (c *CreativeFieldsListCall) Header() http.Header {
  23429. if c.header_ == nil {
  23430. c.header_ = make(http.Header)
  23431. }
  23432. return c.header_
  23433. }
  23434. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  23435. reqHeaders := make(http.Header)
  23436. for k, v := range c.header_ {
  23437. reqHeaders[k] = v
  23438. }
  23439. reqHeaders.Set("User-Agent", c.s.userAgent())
  23440. if c.ifNoneMatch_ != "" {
  23441. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23442. }
  23443. var body io.Reader = nil
  23444. c.urlParams_.Set("alt", alt)
  23445. c.urlParams_.Set("prettyPrint", "false")
  23446. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23447. urls += "?" + c.urlParams_.Encode()
  23448. req, err := http.NewRequest("GET", urls, body)
  23449. if err != nil {
  23450. return nil, err
  23451. }
  23452. req.Header = reqHeaders
  23453. googleapi.Expand(req.URL, map[string]string{
  23454. "profileId": strconv.FormatInt(c.profileId, 10),
  23455. })
  23456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23457. }
  23458. // Do executes the "dfareporting.creativeFields.list" call.
  23459. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  23460. // Any non-2xx status code is an error. Response headers are in either
  23461. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  23462. // was returned at all) in error.(*googleapi.Error).Header. Use
  23463. // googleapi.IsNotModified to check whether the returned error was
  23464. // because http.StatusNotModified was returned.
  23465. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  23466. gensupport.SetOptions(c.urlParams_, opts...)
  23467. res, err := c.doRequest("json")
  23468. if res != nil && res.StatusCode == http.StatusNotModified {
  23469. if res.Body != nil {
  23470. res.Body.Close()
  23471. }
  23472. return nil, &googleapi.Error{
  23473. Code: res.StatusCode,
  23474. Header: res.Header,
  23475. }
  23476. }
  23477. if err != nil {
  23478. return nil, err
  23479. }
  23480. defer googleapi.CloseBody(res)
  23481. if err := googleapi.CheckResponse(res); err != nil {
  23482. return nil, err
  23483. }
  23484. ret := &CreativeFieldsListResponse{
  23485. ServerResponse: googleapi.ServerResponse{
  23486. Header: res.Header,
  23487. HTTPStatusCode: res.StatusCode,
  23488. },
  23489. }
  23490. target := &ret
  23491. if err := gensupport.DecodeResponse(target, res); err != nil {
  23492. return nil, err
  23493. }
  23494. return ret, nil
  23495. // {
  23496. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  23497. // "httpMethod": "GET",
  23498. // "id": "dfareporting.creativeFields.list",
  23499. // "parameterOrder": [
  23500. // "profileId"
  23501. // ],
  23502. // "parameters": {
  23503. // "advertiserIds": {
  23504. // "description": "Select only creative fields that belong to these advertisers.",
  23505. // "format": "int64",
  23506. // "location": "query",
  23507. // "repeated": true,
  23508. // "type": "string"
  23509. // },
  23510. // "ids": {
  23511. // "description": "Select only creative fields with these IDs.",
  23512. // "format": "int64",
  23513. // "location": "query",
  23514. // "repeated": true,
  23515. // "type": "string"
  23516. // },
  23517. // "maxResults": {
  23518. // "default": "1000",
  23519. // "description": "Maximum number of results to return.",
  23520. // "format": "int32",
  23521. // "location": "query",
  23522. // "maximum": "1000",
  23523. // "minimum": "0",
  23524. // "type": "integer"
  23525. // },
  23526. // "pageToken": {
  23527. // "description": "Value of the nextPageToken from the previous result page.",
  23528. // "location": "query",
  23529. // "type": "string"
  23530. // },
  23531. // "profileId": {
  23532. // "description": "User profile ID associated with this request.",
  23533. // "format": "int64",
  23534. // "location": "path",
  23535. // "required": true,
  23536. // "type": "string"
  23537. // },
  23538. // "searchString": {
  23539. // "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\".",
  23540. // "location": "query",
  23541. // "type": "string"
  23542. // },
  23543. // "sortField": {
  23544. // "default": "ID",
  23545. // "description": "Field by which to sort the list.",
  23546. // "enum": [
  23547. // "ID",
  23548. // "NAME"
  23549. // ],
  23550. // "enumDescriptions": [
  23551. // "",
  23552. // ""
  23553. // ],
  23554. // "location": "query",
  23555. // "type": "string"
  23556. // },
  23557. // "sortOrder": {
  23558. // "default": "ASCENDING",
  23559. // "description": "Order of sorted results.",
  23560. // "enum": [
  23561. // "ASCENDING",
  23562. // "DESCENDING"
  23563. // ],
  23564. // "enumDescriptions": [
  23565. // "",
  23566. // ""
  23567. // ],
  23568. // "location": "query",
  23569. // "type": "string"
  23570. // }
  23571. // },
  23572. // "path": "userprofiles/{profileId}/creativeFields",
  23573. // "response": {
  23574. // "$ref": "CreativeFieldsListResponse"
  23575. // },
  23576. // "scopes": [
  23577. // "https://www.googleapis.com/auth/dfatrafficking"
  23578. // ]
  23579. // }
  23580. }
  23581. // Pages invokes f for each page of results.
  23582. // A non-nil error returned from f will halt the iteration.
  23583. // The provided context supersedes any context provided to the Context method.
  23584. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  23585. c.ctx_ = ctx
  23586. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23587. for {
  23588. x, err := c.Do()
  23589. if err != nil {
  23590. return err
  23591. }
  23592. if err := f(x); err != nil {
  23593. return err
  23594. }
  23595. if x.NextPageToken == "" {
  23596. return nil
  23597. }
  23598. c.PageToken(x.NextPageToken)
  23599. }
  23600. }
  23601. // method id "dfareporting.creativeFields.patch":
  23602. type CreativeFieldsPatchCall struct {
  23603. s *Service
  23604. profileId int64
  23605. creativefield *CreativeField
  23606. urlParams_ gensupport.URLParams
  23607. ctx_ context.Context
  23608. header_ http.Header
  23609. }
  23610. // Patch: Updates an existing creative field. This method supports patch
  23611. // semantics.
  23612. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  23613. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23614. c.profileId = profileId
  23615. c.urlParams_.Set("id", fmt.Sprint(id))
  23616. c.creativefield = creativefield
  23617. return c
  23618. }
  23619. // Fields allows partial responses to be retrieved. See
  23620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23621. // for more information.
  23622. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  23623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23624. return c
  23625. }
  23626. // Context sets the context to be used in this call's Do method. Any
  23627. // pending HTTP request will be aborted if the provided context is
  23628. // canceled.
  23629. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  23630. c.ctx_ = ctx
  23631. return c
  23632. }
  23633. // Header returns an http.Header that can be modified by the caller to
  23634. // add HTTP headers to the request.
  23635. func (c *CreativeFieldsPatchCall) Header() http.Header {
  23636. if c.header_ == nil {
  23637. c.header_ = make(http.Header)
  23638. }
  23639. return c.header_
  23640. }
  23641. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  23642. reqHeaders := make(http.Header)
  23643. for k, v := range c.header_ {
  23644. reqHeaders[k] = v
  23645. }
  23646. reqHeaders.Set("User-Agent", c.s.userAgent())
  23647. var body io.Reader = nil
  23648. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23649. if err != nil {
  23650. return nil, err
  23651. }
  23652. reqHeaders.Set("Content-Type", "application/json")
  23653. c.urlParams_.Set("alt", alt)
  23654. c.urlParams_.Set("prettyPrint", "false")
  23655. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23656. urls += "?" + c.urlParams_.Encode()
  23657. req, err := http.NewRequest("PATCH", urls, body)
  23658. if err != nil {
  23659. return nil, err
  23660. }
  23661. req.Header = reqHeaders
  23662. googleapi.Expand(req.URL, map[string]string{
  23663. "profileId": strconv.FormatInt(c.profileId, 10),
  23664. })
  23665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23666. }
  23667. // Do executes the "dfareporting.creativeFields.patch" call.
  23668. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23669. // status code is an error. Response headers are in either
  23670. // *CreativeField.ServerResponse.Header or (if a response was returned
  23671. // at all) in error.(*googleapi.Error).Header. Use
  23672. // googleapi.IsNotModified to check whether the returned error was
  23673. // because http.StatusNotModified was returned.
  23674. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23675. gensupport.SetOptions(c.urlParams_, opts...)
  23676. res, err := c.doRequest("json")
  23677. if res != nil && res.StatusCode == http.StatusNotModified {
  23678. if res.Body != nil {
  23679. res.Body.Close()
  23680. }
  23681. return nil, &googleapi.Error{
  23682. Code: res.StatusCode,
  23683. Header: res.Header,
  23684. }
  23685. }
  23686. if err != nil {
  23687. return nil, err
  23688. }
  23689. defer googleapi.CloseBody(res)
  23690. if err := googleapi.CheckResponse(res); err != nil {
  23691. return nil, err
  23692. }
  23693. ret := &CreativeField{
  23694. ServerResponse: googleapi.ServerResponse{
  23695. Header: res.Header,
  23696. HTTPStatusCode: res.StatusCode,
  23697. },
  23698. }
  23699. target := &ret
  23700. if err := gensupport.DecodeResponse(target, res); err != nil {
  23701. return nil, err
  23702. }
  23703. return ret, nil
  23704. // {
  23705. // "description": "Updates an existing creative field. This method supports patch semantics.",
  23706. // "httpMethod": "PATCH",
  23707. // "id": "dfareporting.creativeFields.patch",
  23708. // "parameterOrder": [
  23709. // "profileId",
  23710. // "id"
  23711. // ],
  23712. // "parameters": {
  23713. // "id": {
  23714. // "description": "Creative Field ID",
  23715. // "format": "int64",
  23716. // "location": "query",
  23717. // "required": true,
  23718. // "type": "string"
  23719. // },
  23720. // "profileId": {
  23721. // "description": "User profile ID associated with this request.",
  23722. // "format": "int64",
  23723. // "location": "path",
  23724. // "required": true,
  23725. // "type": "string"
  23726. // }
  23727. // },
  23728. // "path": "userprofiles/{profileId}/creativeFields",
  23729. // "request": {
  23730. // "$ref": "CreativeField"
  23731. // },
  23732. // "response": {
  23733. // "$ref": "CreativeField"
  23734. // },
  23735. // "scopes": [
  23736. // "https://www.googleapis.com/auth/dfatrafficking"
  23737. // ]
  23738. // }
  23739. }
  23740. // method id "dfareporting.creativeFields.update":
  23741. type CreativeFieldsUpdateCall struct {
  23742. s *Service
  23743. profileId int64
  23744. creativefield *CreativeField
  23745. urlParams_ gensupport.URLParams
  23746. ctx_ context.Context
  23747. header_ http.Header
  23748. }
  23749. // Update: Updates an existing creative field.
  23750. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  23751. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23752. c.profileId = profileId
  23753. c.creativefield = creativefield
  23754. return c
  23755. }
  23756. // Fields allows partial responses to be retrieved. See
  23757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23758. // for more information.
  23759. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  23760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23761. return c
  23762. }
  23763. // Context sets the context to be used in this call's Do method. Any
  23764. // pending HTTP request will be aborted if the provided context is
  23765. // canceled.
  23766. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  23767. c.ctx_ = ctx
  23768. return c
  23769. }
  23770. // Header returns an http.Header that can be modified by the caller to
  23771. // add HTTP headers to the request.
  23772. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  23773. if c.header_ == nil {
  23774. c.header_ = make(http.Header)
  23775. }
  23776. return c.header_
  23777. }
  23778. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23779. reqHeaders := make(http.Header)
  23780. for k, v := range c.header_ {
  23781. reqHeaders[k] = v
  23782. }
  23783. reqHeaders.Set("User-Agent", c.s.userAgent())
  23784. var body io.Reader = nil
  23785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23786. if err != nil {
  23787. return nil, err
  23788. }
  23789. reqHeaders.Set("Content-Type", "application/json")
  23790. c.urlParams_.Set("alt", alt)
  23791. c.urlParams_.Set("prettyPrint", "false")
  23792. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23793. urls += "?" + c.urlParams_.Encode()
  23794. req, err := http.NewRequest("PUT", urls, body)
  23795. if err != nil {
  23796. return nil, err
  23797. }
  23798. req.Header = reqHeaders
  23799. googleapi.Expand(req.URL, map[string]string{
  23800. "profileId": strconv.FormatInt(c.profileId, 10),
  23801. })
  23802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23803. }
  23804. // Do executes the "dfareporting.creativeFields.update" call.
  23805. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23806. // status code is an error. Response headers are in either
  23807. // *CreativeField.ServerResponse.Header or (if a response was returned
  23808. // at all) in error.(*googleapi.Error).Header. Use
  23809. // googleapi.IsNotModified to check whether the returned error was
  23810. // because http.StatusNotModified was returned.
  23811. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23812. gensupport.SetOptions(c.urlParams_, opts...)
  23813. res, err := c.doRequest("json")
  23814. if res != nil && res.StatusCode == http.StatusNotModified {
  23815. if res.Body != nil {
  23816. res.Body.Close()
  23817. }
  23818. return nil, &googleapi.Error{
  23819. Code: res.StatusCode,
  23820. Header: res.Header,
  23821. }
  23822. }
  23823. if err != nil {
  23824. return nil, err
  23825. }
  23826. defer googleapi.CloseBody(res)
  23827. if err := googleapi.CheckResponse(res); err != nil {
  23828. return nil, err
  23829. }
  23830. ret := &CreativeField{
  23831. ServerResponse: googleapi.ServerResponse{
  23832. Header: res.Header,
  23833. HTTPStatusCode: res.StatusCode,
  23834. },
  23835. }
  23836. target := &ret
  23837. if err := gensupport.DecodeResponse(target, res); err != nil {
  23838. return nil, err
  23839. }
  23840. return ret, nil
  23841. // {
  23842. // "description": "Updates an existing creative field.",
  23843. // "httpMethod": "PUT",
  23844. // "id": "dfareporting.creativeFields.update",
  23845. // "parameterOrder": [
  23846. // "profileId"
  23847. // ],
  23848. // "parameters": {
  23849. // "profileId": {
  23850. // "description": "User profile ID associated with this request.",
  23851. // "format": "int64",
  23852. // "location": "path",
  23853. // "required": true,
  23854. // "type": "string"
  23855. // }
  23856. // },
  23857. // "path": "userprofiles/{profileId}/creativeFields",
  23858. // "request": {
  23859. // "$ref": "CreativeField"
  23860. // },
  23861. // "response": {
  23862. // "$ref": "CreativeField"
  23863. // },
  23864. // "scopes": [
  23865. // "https://www.googleapis.com/auth/dfatrafficking"
  23866. // ]
  23867. // }
  23868. }
  23869. // method id "dfareporting.creativeGroups.get":
  23870. type CreativeGroupsGetCall struct {
  23871. s *Service
  23872. profileId int64
  23873. id int64
  23874. urlParams_ gensupport.URLParams
  23875. ifNoneMatch_ string
  23876. ctx_ context.Context
  23877. header_ http.Header
  23878. }
  23879. // Get: Gets one creative group by ID.
  23880. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  23881. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23882. c.profileId = profileId
  23883. c.id = id
  23884. return c
  23885. }
  23886. // Fields allows partial responses to be retrieved. See
  23887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23888. // for more information.
  23889. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  23890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23891. return c
  23892. }
  23893. // IfNoneMatch sets the optional parameter which makes the operation
  23894. // fail if the object's ETag matches the given value. This is useful for
  23895. // getting updates only after the object has changed since the last
  23896. // request. Use googleapi.IsNotModified to check whether the response
  23897. // error from Do is the result of In-None-Match.
  23898. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  23899. c.ifNoneMatch_ = entityTag
  23900. return c
  23901. }
  23902. // Context sets the context to be used in this call's Do method. Any
  23903. // pending HTTP request will be aborted if the provided context is
  23904. // canceled.
  23905. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  23906. c.ctx_ = ctx
  23907. return c
  23908. }
  23909. // Header returns an http.Header that can be modified by the caller to
  23910. // add HTTP headers to the request.
  23911. func (c *CreativeGroupsGetCall) Header() http.Header {
  23912. if c.header_ == nil {
  23913. c.header_ = make(http.Header)
  23914. }
  23915. return c.header_
  23916. }
  23917. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  23918. reqHeaders := make(http.Header)
  23919. for k, v := range c.header_ {
  23920. reqHeaders[k] = v
  23921. }
  23922. reqHeaders.Set("User-Agent", c.s.userAgent())
  23923. if c.ifNoneMatch_ != "" {
  23924. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23925. }
  23926. var body io.Reader = nil
  23927. c.urlParams_.Set("alt", alt)
  23928. c.urlParams_.Set("prettyPrint", "false")
  23929. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  23930. urls += "?" + c.urlParams_.Encode()
  23931. req, err := http.NewRequest("GET", urls, body)
  23932. if err != nil {
  23933. return nil, err
  23934. }
  23935. req.Header = reqHeaders
  23936. googleapi.Expand(req.URL, map[string]string{
  23937. "profileId": strconv.FormatInt(c.profileId, 10),
  23938. "id": strconv.FormatInt(c.id, 10),
  23939. })
  23940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23941. }
  23942. // Do executes the "dfareporting.creativeGroups.get" call.
  23943. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23944. // status code is an error. Response headers are in either
  23945. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23946. // at all) in error.(*googleapi.Error).Header. Use
  23947. // googleapi.IsNotModified to check whether the returned error was
  23948. // because http.StatusNotModified was returned.
  23949. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23950. gensupport.SetOptions(c.urlParams_, opts...)
  23951. res, err := c.doRequest("json")
  23952. if res != nil && res.StatusCode == http.StatusNotModified {
  23953. if res.Body != nil {
  23954. res.Body.Close()
  23955. }
  23956. return nil, &googleapi.Error{
  23957. Code: res.StatusCode,
  23958. Header: res.Header,
  23959. }
  23960. }
  23961. if err != nil {
  23962. return nil, err
  23963. }
  23964. defer googleapi.CloseBody(res)
  23965. if err := googleapi.CheckResponse(res); err != nil {
  23966. return nil, err
  23967. }
  23968. ret := &CreativeGroup{
  23969. ServerResponse: googleapi.ServerResponse{
  23970. Header: res.Header,
  23971. HTTPStatusCode: res.StatusCode,
  23972. },
  23973. }
  23974. target := &ret
  23975. if err := gensupport.DecodeResponse(target, res); err != nil {
  23976. return nil, err
  23977. }
  23978. return ret, nil
  23979. // {
  23980. // "description": "Gets one creative group by ID.",
  23981. // "httpMethod": "GET",
  23982. // "id": "dfareporting.creativeGroups.get",
  23983. // "parameterOrder": [
  23984. // "profileId",
  23985. // "id"
  23986. // ],
  23987. // "parameters": {
  23988. // "id": {
  23989. // "description": "Creative group ID.",
  23990. // "format": "int64",
  23991. // "location": "path",
  23992. // "required": true,
  23993. // "type": "string"
  23994. // },
  23995. // "profileId": {
  23996. // "description": "User profile ID associated with this request.",
  23997. // "format": "int64",
  23998. // "location": "path",
  23999. // "required": true,
  24000. // "type": "string"
  24001. // }
  24002. // },
  24003. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  24004. // "response": {
  24005. // "$ref": "CreativeGroup"
  24006. // },
  24007. // "scopes": [
  24008. // "https://www.googleapis.com/auth/dfatrafficking"
  24009. // ]
  24010. // }
  24011. }
  24012. // method id "dfareporting.creativeGroups.insert":
  24013. type CreativeGroupsInsertCall struct {
  24014. s *Service
  24015. profileId int64
  24016. creativegroup *CreativeGroup
  24017. urlParams_ gensupport.URLParams
  24018. ctx_ context.Context
  24019. header_ http.Header
  24020. }
  24021. // Insert: Inserts a new creative group.
  24022. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  24023. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24024. c.profileId = profileId
  24025. c.creativegroup = creativegroup
  24026. return c
  24027. }
  24028. // Fields allows partial responses to be retrieved. See
  24029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24030. // for more information.
  24031. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  24032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24033. return c
  24034. }
  24035. // Context sets the context to be used in this call's Do method. Any
  24036. // pending HTTP request will be aborted if the provided context is
  24037. // canceled.
  24038. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  24039. c.ctx_ = ctx
  24040. return c
  24041. }
  24042. // Header returns an http.Header that can be modified by the caller to
  24043. // add HTTP headers to the request.
  24044. func (c *CreativeGroupsInsertCall) Header() http.Header {
  24045. if c.header_ == nil {
  24046. c.header_ = make(http.Header)
  24047. }
  24048. return c.header_
  24049. }
  24050. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  24051. reqHeaders := make(http.Header)
  24052. for k, v := range c.header_ {
  24053. reqHeaders[k] = v
  24054. }
  24055. reqHeaders.Set("User-Agent", c.s.userAgent())
  24056. var body io.Reader = nil
  24057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24058. if err != nil {
  24059. return nil, err
  24060. }
  24061. reqHeaders.Set("Content-Type", "application/json")
  24062. c.urlParams_.Set("alt", alt)
  24063. c.urlParams_.Set("prettyPrint", "false")
  24064. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24065. urls += "?" + c.urlParams_.Encode()
  24066. req, err := http.NewRequest("POST", urls, body)
  24067. if err != nil {
  24068. return nil, err
  24069. }
  24070. req.Header = reqHeaders
  24071. googleapi.Expand(req.URL, map[string]string{
  24072. "profileId": strconv.FormatInt(c.profileId, 10),
  24073. })
  24074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24075. }
  24076. // Do executes the "dfareporting.creativeGroups.insert" call.
  24077. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24078. // status code is an error. Response headers are in either
  24079. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24080. // at all) in error.(*googleapi.Error).Header. Use
  24081. // googleapi.IsNotModified to check whether the returned error was
  24082. // because http.StatusNotModified was returned.
  24083. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24084. gensupport.SetOptions(c.urlParams_, opts...)
  24085. res, err := c.doRequest("json")
  24086. if res != nil && res.StatusCode == http.StatusNotModified {
  24087. if res.Body != nil {
  24088. res.Body.Close()
  24089. }
  24090. return nil, &googleapi.Error{
  24091. Code: res.StatusCode,
  24092. Header: res.Header,
  24093. }
  24094. }
  24095. if err != nil {
  24096. return nil, err
  24097. }
  24098. defer googleapi.CloseBody(res)
  24099. if err := googleapi.CheckResponse(res); err != nil {
  24100. return nil, err
  24101. }
  24102. ret := &CreativeGroup{
  24103. ServerResponse: googleapi.ServerResponse{
  24104. Header: res.Header,
  24105. HTTPStatusCode: res.StatusCode,
  24106. },
  24107. }
  24108. target := &ret
  24109. if err := gensupport.DecodeResponse(target, res); err != nil {
  24110. return nil, err
  24111. }
  24112. return ret, nil
  24113. // {
  24114. // "description": "Inserts a new creative group.",
  24115. // "httpMethod": "POST",
  24116. // "id": "dfareporting.creativeGroups.insert",
  24117. // "parameterOrder": [
  24118. // "profileId"
  24119. // ],
  24120. // "parameters": {
  24121. // "profileId": {
  24122. // "description": "User profile ID associated with this request.",
  24123. // "format": "int64",
  24124. // "location": "path",
  24125. // "required": true,
  24126. // "type": "string"
  24127. // }
  24128. // },
  24129. // "path": "userprofiles/{profileId}/creativeGroups",
  24130. // "request": {
  24131. // "$ref": "CreativeGroup"
  24132. // },
  24133. // "response": {
  24134. // "$ref": "CreativeGroup"
  24135. // },
  24136. // "scopes": [
  24137. // "https://www.googleapis.com/auth/dfatrafficking"
  24138. // ]
  24139. // }
  24140. }
  24141. // method id "dfareporting.creativeGroups.list":
  24142. type CreativeGroupsListCall struct {
  24143. s *Service
  24144. profileId int64
  24145. urlParams_ gensupport.URLParams
  24146. ifNoneMatch_ string
  24147. ctx_ context.Context
  24148. header_ http.Header
  24149. }
  24150. // List: Retrieves a list of creative groups, possibly filtered. This
  24151. // method supports paging.
  24152. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  24153. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24154. c.profileId = profileId
  24155. return c
  24156. }
  24157. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  24158. // only creative groups that belong to these advertisers.
  24159. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  24160. var advertiserIds_ []string
  24161. for _, v := range advertiserIds {
  24162. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  24163. }
  24164. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  24165. return c
  24166. }
  24167. // GroupNumber sets the optional parameter "groupNumber": Select only
  24168. // creative groups that belong to this subgroup.
  24169. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  24170. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  24171. return c
  24172. }
  24173. // Ids sets the optional parameter "ids": Select only creative groups
  24174. // with these IDs.
  24175. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  24176. var ids_ []string
  24177. for _, v := range ids {
  24178. ids_ = append(ids_, fmt.Sprint(v))
  24179. }
  24180. c.urlParams_.SetMulti("ids", ids_)
  24181. return c
  24182. }
  24183. // MaxResults sets the optional parameter "maxResults": Maximum number
  24184. // of results to return.
  24185. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  24186. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24187. return c
  24188. }
  24189. // PageToken sets the optional parameter "pageToken": Value of the
  24190. // nextPageToken from the previous result page.
  24191. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  24192. c.urlParams_.Set("pageToken", pageToken)
  24193. return c
  24194. }
  24195. // SearchString sets the optional parameter "searchString": Allows
  24196. // searching for creative groups by name or ID. Wildcards (*) are
  24197. // allowed. For example, "creativegroup*2015" will return creative
  24198. // groups with names like "creativegroup June 2015", "creativegroup
  24199. // April 2015", or simply "creativegroup 2015". Most of the searches
  24200. // also add wild-cards implicitly at the start and the end of the search
  24201. // string. For example, a search string of "creativegroup" will match
  24202. // creative groups with the name "my creativegroup", "creativegroup
  24203. // 2015", or simply "creativegroup".
  24204. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  24205. c.urlParams_.Set("searchString", searchString)
  24206. return c
  24207. }
  24208. // SortField sets the optional parameter "sortField": Field by which to
  24209. // sort the list.
  24210. //
  24211. // Possible values:
  24212. // "ID" (default)
  24213. // "NAME"
  24214. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  24215. c.urlParams_.Set("sortField", sortField)
  24216. return c
  24217. }
  24218. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24219. // results.
  24220. //
  24221. // Possible values:
  24222. // "ASCENDING" (default)
  24223. // "DESCENDING"
  24224. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  24225. c.urlParams_.Set("sortOrder", sortOrder)
  24226. return c
  24227. }
  24228. // Fields allows partial responses to be retrieved. See
  24229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24230. // for more information.
  24231. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  24232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24233. return c
  24234. }
  24235. // IfNoneMatch sets the optional parameter which makes the operation
  24236. // fail if the object's ETag matches the given value. This is useful for
  24237. // getting updates only after the object has changed since the last
  24238. // request. Use googleapi.IsNotModified to check whether the response
  24239. // error from Do is the result of In-None-Match.
  24240. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  24241. c.ifNoneMatch_ = entityTag
  24242. return c
  24243. }
  24244. // Context sets the context to be used in this call's Do method. Any
  24245. // pending HTTP request will be aborted if the provided context is
  24246. // canceled.
  24247. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  24248. c.ctx_ = ctx
  24249. return c
  24250. }
  24251. // Header returns an http.Header that can be modified by the caller to
  24252. // add HTTP headers to the request.
  24253. func (c *CreativeGroupsListCall) Header() http.Header {
  24254. if c.header_ == nil {
  24255. c.header_ = make(http.Header)
  24256. }
  24257. return c.header_
  24258. }
  24259. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  24260. reqHeaders := make(http.Header)
  24261. for k, v := range c.header_ {
  24262. reqHeaders[k] = v
  24263. }
  24264. reqHeaders.Set("User-Agent", c.s.userAgent())
  24265. if c.ifNoneMatch_ != "" {
  24266. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24267. }
  24268. var body io.Reader = nil
  24269. c.urlParams_.Set("alt", alt)
  24270. c.urlParams_.Set("prettyPrint", "false")
  24271. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24272. urls += "?" + c.urlParams_.Encode()
  24273. req, err := http.NewRequest("GET", urls, body)
  24274. if err != nil {
  24275. return nil, err
  24276. }
  24277. req.Header = reqHeaders
  24278. googleapi.Expand(req.URL, map[string]string{
  24279. "profileId": strconv.FormatInt(c.profileId, 10),
  24280. })
  24281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24282. }
  24283. // Do executes the "dfareporting.creativeGroups.list" call.
  24284. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  24285. // Any non-2xx status code is an error. Response headers are in either
  24286. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  24287. // was returned at all) in error.(*googleapi.Error).Header. Use
  24288. // googleapi.IsNotModified to check whether the returned error was
  24289. // because http.StatusNotModified was returned.
  24290. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  24291. gensupport.SetOptions(c.urlParams_, opts...)
  24292. res, err := c.doRequest("json")
  24293. if res != nil && res.StatusCode == http.StatusNotModified {
  24294. if res.Body != nil {
  24295. res.Body.Close()
  24296. }
  24297. return nil, &googleapi.Error{
  24298. Code: res.StatusCode,
  24299. Header: res.Header,
  24300. }
  24301. }
  24302. if err != nil {
  24303. return nil, err
  24304. }
  24305. defer googleapi.CloseBody(res)
  24306. if err := googleapi.CheckResponse(res); err != nil {
  24307. return nil, err
  24308. }
  24309. ret := &CreativeGroupsListResponse{
  24310. ServerResponse: googleapi.ServerResponse{
  24311. Header: res.Header,
  24312. HTTPStatusCode: res.StatusCode,
  24313. },
  24314. }
  24315. target := &ret
  24316. if err := gensupport.DecodeResponse(target, res); err != nil {
  24317. return nil, err
  24318. }
  24319. return ret, nil
  24320. // {
  24321. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  24322. // "httpMethod": "GET",
  24323. // "id": "dfareporting.creativeGroups.list",
  24324. // "parameterOrder": [
  24325. // "profileId"
  24326. // ],
  24327. // "parameters": {
  24328. // "advertiserIds": {
  24329. // "description": "Select only creative groups that belong to these advertisers.",
  24330. // "format": "int64",
  24331. // "location": "query",
  24332. // "repeated": true,
  24333. // "type": "string"
  24334. // },
  24335. // "groupNumber": {
  24336. // "description": "Select only creative groups that belong to this subgroup.",
  24337. // "format": "int32",
  24338. // "location": "query",
  24339. // "maximum": "2",
  24340. // "minimum": "1",
  24341. // "type": "integer"
  24342. // },
  24343. // "ids": {
  24344. // "description": "Select only creative groups with these IDs.",
  24345. // "format": "int64",
  24346. // "location": "query",
  24347. // "repeated": true,
  24348. // "type": "string"
  24349. // },
  24350. // "maxResults": {
  24351. // "default": "1000",
  24352. // "description": "Maximum number of results to return.",
  24353. // "format": "int32",
  24354. // "location": "query",
  24355. // "maximum": "1000",
  24356. // "minimum": "0",
  24357. // "type": "integer"
  24358. // },
  24359. // "pageToken": {
  24360. // "description": "Value of the nextPageToken from the previous result page.",
  24361. // "location": "query",
  24362. // "type": "string"
  24363. // },
  24364. // "profileId": {
  24365. // "description": "User profile ID associated with this request.",
  24366. // "format": "int64",
  24367. // "location": "path",
  24368. // "required": true,
  24369. // "type": "string"
  24370. // },
  24371. // "searchString": {
  24372. // "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\".",
  24373. // "location": "query",
  24374. // "type": "string"
  24375. // },
  24376. // "sortField": {
  24377. // "default": "ID",
  24378. // "description": "Field by which to sort the list.",
  24379. // "enum": [
  24380. // "ID",
  24381. // "NAME"
  24382. // ],
  24383. // "enumDescriptions": [
  24384. // "",
  24385. // ""
  24386. // ],
  24387. // "location": "query",
  24388. // "type": "string"
  24389. // },
  24390. // "sortOrder": {
  24391. // "default": "ASCENDING",
  24392. // "description": "Order of sorted results.",
  24393. // "enum": [
  24394. // "ASCENDING",
  24395. // "DESCENDING"
  24396. // ],
  24397. // "enumDescriptions": [
  24398. // "",
  24399. // ""
  24400. // ],
  24401. // "location": "query",
  24402. // "type": "string"
  24403. // }
  24404. // },
  24405. // "path": "userprofiles/{profileId}/creativeGroups",
  24406. // "response": {
  24407. // "$ref": "CreativeGroupsListResponse"
  24408. // },
  24409. // "scopes": [
  24410. // "https://www.googleapis.com/auth/dfatrafficking"
  24411. // ]
  24412. // }
  24413. }
  24414. // Pages invokes f for each page of results.
  24415. // A non-nil error returned from f will halt the iteration.
  24416. // The provided context supersedes any context provided to the Context method.
  24417. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  24418. c.ctx_ = ctx
  24419. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24420. for {
  24421. x, err := c.Do()
  24422. if err != nil {
  24423. return err
  24424. }
  24425. if err := f(x); err != nil {
  24426. return err
  24427. }
  24428. if x.NextPageToken == "" {
  24429. return nil
  24430. }
  24431. c.PageToken(x.NextPageToken)
  24432. }
  24433. }
  24434. // method id "dfareporting.creativeGroups.patch":
  24435. type CreativeGroupsPatchCall struct {
  24436. s *Service
  24437. profileId int64
  24438. creativegroup *CreativeGroup
  24439. urlParams_ gensupport.URLParams
  24440. ctx_ context.Context
  24441. header_ http.Header
  24442. }
  24443. // Patch: Updates an existing creative group. This method supports patch
  24444. // semantics.
  24445. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  24446. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24447. c.profileId = profileId
  24448. c.urlParams_.Set("id", fmt.Sprint(id))
  24449. c.creativegroup = creativegroup
  24450. return c
  24451. }
  24452. // Fields allows partial responses to be retrieved. See
  24453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24454. // for more information.
  24455. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  24456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24457. return c
  24458. }
  24459. // Context sets the context to be used in this call's Do method. Any
  24460. // pending HTTP request will be aborted if the provided context is
  24461. // canceled.
  24462. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  24463. c.ctx_ = ctx
  24464. return c
  24465. }
  24466. // Header returns an http.Header that can be modified by the caller to
  24467. // add HTTP headers to the request.
  24468. func (c *CreativeGroupsPatchCall) Header() http.Header {
  24469. if c.header_ == nil {
  24470. c.header_ = make(http.Header)
  24471. }
  24472. return c.header_
  24473. }
  24474. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  24475. reqHeaders := make(http.Header)
  24476. for k, v := range c.header_ {
  24477. reqHeaders[k] = v
  24478. }
  24479. reqHeaders.Set("User-Agent", c.s.userAgent())
  24480. var body io.Reader = nil
  24481. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24482. if err != nil {
  24483. return nil, err
  24484. }
  24485. reqHeaders.Set("Content-Type", "application/json")
  24486. c.urlParams_.Set("alt", alt)
  24487. c.urlParams_.Set("prettyPrint", "false")
  24488. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24489. urls += "?" + c.urlParams_.Encode()
  24490. req, err := http.NewRequest("PATCH", urls, body)
  24491. if err != nil {
  24492. return nil, err
  24493. }
  24494. req.Header = reqHeaders
  24495. googleapi.Expand(req.URL, map[string]string{
  24496. "profileId": strconv.FormatInt(c.profileId, 10),
  24497. })
  24498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24499. }
  24500. // Do executes the "dfareporting.creativeGroups.patch" call.
  24501. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24502. // status code is an error. Response headers are in either
  24503. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24504. // at all) in error.(*googleapi.Error).Header. Use
  24505. // googleapi.IsNotModified to check whether the returned error was
  24506. // because http.StatusNotModified was returned.
  24507. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24508. gensupport.SetOptions(c.urlParams_, opts...)
  24509. res, err := c.doRequest("json")
  24510. if res != nil && res.StatusCode == http.StatusNotModified {
  24511. if res.Body != nil {
  24512. res.Body.Close()
  24513. }
  24514. return nil, &googleapi.Error{
  24515. Code: res.StatusCode,
  24516. Header: res.Header,
  24517. }
  24518. }
  24519. if err != nil {
  24520. return nil, err
  24521. }
  24522. defer googleapi.CloseBody(res)
  24523. if err := googleapi.CheckResponse(res); err != nil {
  24524. return nil, err
  24525. }
  24526. ret := &CreativeGroup{
  24527. ServerResponse: googleapi.ServerResponse{
  24528. Header: res.Header,
  24529. HTTPStatusCode: res.StatusCode,
  24530. },
  24531. }
  24532. target := &ret
  24533. if err := gensupport.DecodeResponse(target, res); err != nil {
  24534. return nil, err
  24535. }
  24536. return ret, nil
  24537. // {
  24538. // "description": "Updates an existing creative group. This method supports patch semantics.",
  24539. // "httpMethod": "PATCH",
  24540. // "id": "dfareporting.creativeGroups.patch",
  24541. // "parameterOrder": [
  24542. // "profileId",
  24543. // "id"
  24544. // ],
  24545. // "parameters": {
  24546. // "id": {
  24547. // "description": "Creative group ID.",
  24548. // "format": "int64",
  24549. // "location": "query",
  24550. // "required": true,
  24551. // "type": "string"
  24552. // },
  24553. // "profileId": {
  24554. // "description": "User profile ID associated with this request.",
  24555. // "format": "int64",
  24556. // "location": "path",
  24557. // "required": true,
  24558. // "type": "string"
  24559. // }
  24560. // },
  24561. // "path": "userprofiles/{profileId}/creativeGroups",
  24562. // "request": {
  24563. // "$ref": "CreativeGroup"
  24564. // },
  24565. // "response": {
  24566. // "$ref": "CreativeGroup"
  24567. // },
  24568. // "scopes": [
  24569. // "https://www.googleapis.com/auth/dfatrafficking"
  24570. // ]
  24571. // }
  24572. }
  24573. // method id "dfareporting.creativeGroups.update":
  24574. type CreativeGroupsUpdateCall struct {
  24575. s *Service
  24576. profileId int64
  24577. creativegroup *CreativeGroup
  24578. urlParams_ gensupport.URLParams
  24579. ctx_ context.Context
  24580. header_ http.Header
  24581. }
  24582. // Update: Updates an existing creative group.
  24583. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  24584. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24585. c.profileId = profileId
  24586. c.creativegroup = creativegroup
  24587. return c
  24588. }
  24589. // Fields allows partial responses to be retrieved. See
  24590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24591. // for more information.
  24592. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  24593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24594. return c
  24595. }
  24596. // Context sets the context to be used in this call's Do method. Any
  24597. // pending HTTP request will be aborted if the provided context is
  24598. // canceled.
  24599. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  24600. c.ctx_ = ctx
  24601. return c
  24602. }
  24603. // Header returns an http.Header that can be modified by the caller to
  24604. // add HTTP headers to the request.
  24605. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  24606. if c.header_ == nil {
  24607. c.header_ = make(http.Header)
  24608. }
  24609. return c.header_
  24610. }
  24611. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  24612. reqHeaders := make(http.Header)
  24613. for k, v := range c.header_ {
  24614. reqHeaders[k] = v
  24615. }
  24616. reqHeaders.Set("User-Agent", c.s.userAgent())
  24617. var body io.Reader = nil
  24618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24619. if err != nil {
  24620. return nil, err
  24621. }
  24622. reqHeaders.Set("Content-Type", "application/json")
  24623. c.urlParams_.Set("alt", alt)
  24624. c.urlParams_.Set("prettyPrint", "false")
  24625. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24626. urls += "?" + c.urlParams_.Encode()
  24627. req, err := http.NewRequest("PUT", urls, body)
  24628. if err != nil {
  24629. return nil, err
  24630. }
  24631. req.Header = reqHeaders
  24632. googleapi.Expand(req.URL, map[string]string{
  24633. "profileId": strconv.FormatInt(c.profileId, 10),
  24634. })
  24635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24636. }
  24637. // Do executes the "dfareporting.creativeGroups.update" call.
  24638. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24639. // status code is an error. Response headers are in either
  24640. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24641. // at all) in error.(*googleapi.Error).Header. Use
  24642. // googleapi.IsNotModified to check whether the returned error was
  24643. // because http.StatusNotModified was returned.
  24644. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24645. gensupport.SetOptions(c.urlParams_, opts...)
  24646. res, err := c.doRequest("json")
  24647. if res != nil && res.StatusCode == http.StatusNotModified {
  24648. if res.Body != nil {
  24649. res.Body.Close()
  24650. }
  24651. return nil, &googleapi.Error{
  24652. Code: res.StatusCode,
  24653. Header: res.Header,
  24654. }
  24655. }
  24656. if err != nil {
  24657. return nil, err
  24658. }
  24659. defer googleapi.CloseBody(res)
  24660. if err := googleapi.CheckResponse(res); err != nil {
  24661. return nil, err
  24662. }
  24663. ret := &CreativeGroup{
  24664. ServerResponse: googleapi.ServerResponse{
  24665. Header: res.Header,
  24666. HTTPStatusCode: res.StatusCode,
  24667. },
  24668. }
  24669. target := &ret
  24670. if err := gensupport.DecodeResponse(target, res); err != nil {
  24671. return nil, err
  24672. }
  24673. return ret, nil
  24674. // {
  24675. // "description": "Updates an existing creative group.",
  24676. // "httpMethod": "PUT",
  24677. // "id": "dfareporting.creativeGroups.update",
  24678. // "parameterOrder": [
  24679. // "profileId"
  24680. // ],
  24681. // "parameters": {
  24682. // "profileId": {
  24683. // "description": "User profile ID associated with this request.",
  24684. // "format": "int64",
  24685. // "location": "path",
  24686. // "required": true,
  24687. // "type": "string"
  24688. // }
  24689. // },
  24690. // "path": "userprofiles/{profileId}/creativeGroups",
  24691. // "request": {
  24692. // "$ref": "CreativeGroup"
  24693. // },
  24694. // "response": {
  24695. // "$ref": "CreativeGroup"
  24696. // },
  24697. // "scopes": [
  24698. // "https://www.googleapis.com/auth/dfatrafficking"
  24699. // ]
  24700. // }
  24701. }
  24702. // method id "dfareporting.creatives.get":
  24703. type CreativesGetCall struct {
  24704. s *Service
  24705. profileId int64
  24706. id int64
  24707. urlParams_ gensupport.URLParams
  24708. ifNoneMatch_ string
  24709. ctx_ context.Context
  24710. header_ http.Header
  24711. }
  24712. // Get: Gets one creative by ID.
  24713. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  24714. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24715. c.profileId = profileId
  24716. c.id = id
  24717. return c
  24718. }
  24719. // Fields allows partial responses to be retrieved. See
  24720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24721. // for more information.
  24722. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  24723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24724. return c
  24725. }
  24726. // IfNoneMatch sets the optional parameter which makes the operation
  24727. // fail if the object's ETag matches the given value. This is useful for
  24728. // getting updates only after the object has changed since the last
  24729. // request. Use googleapi.IsNotModified to check whether the response
  24730. // error from Do is the result of In-None-Match.
  24731. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  24732. c.ifNoneMatch_ = entityTag
  24733. return c
  24734. }
  24735. // Context sets the context to be used in this call's Do method. Any
  24736. // pending HTTP request will be aborted if the provided context is
  24737. // canceled.
  24738. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  24739. c.ctx_ = ctx
  24740. return c
  24741. }
  24742. // Header returns an http.Header that can be modified by the caller to
  24743. // add HTTP headers to the request.
  24744. func (c *CreativesGetCall) Header() http.Header {
  24745. if c.header_ == nil {
  24746. c.header_ = make(http.Header)
  24747. }
  24748. return c.header_
  24749. }
  24750. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  24751. reqHeaders := make(http.Header)
  24752. for k, v := range c.header_ {
  24753. reqHeaders[k] = v
  24754. }
  24755. reqHeaders.Set("User-Agent", c.s.userAgent())
  24756. if c.ifNoneMatch_ != "" {
  24757. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24758. }
  24759. var body io.Reader = nil
  24760. c.urlParams_.Set("alt", alt)
  24761. c.urlParams_.Set("prettyPrint", "false")
  24762. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  24763. urls += "?" + c.urlParams_.Encode()
  24764. req, err := http.NewRequest("GET", urls, body)
  24765. if err != nil {
  24766. return nil, err
  24767. }
  24768. req.Header = reqHeaders
  24769. googleapi.Expand(req.URL, map[string]string{
  24770. "profileId": strconv.FormatInt(c.profileId, 10),
  24771. "id": strconv.FormatInt(c.id, 10),
  24772. })
  24773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24774. }
  24775. // Do executes the "dfareporting.creatives.get" call.
  24776. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24777. // code is an error. Response headers are in either
  24778. // *Creative.ServerResponse.Header or (if a response was returned at
  24779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24780. // to check whether the returned error was because
  24781. // http.StatusNotModified was returned.
  24782. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24783. gensupport.SetOptions(c.urlParams_, opts...)
  24784. res, err := c.doRequest("json")
  24785. if res != nil && res.StatusCode == http.StatusNotModified {
  24786. if res.Body != nil {
  24787. res.Body.Close()
  24788. }
  24789. return nil, &googleapi.Error{
  24790. Code: res.StatusCode,
  24791. Header: res.Header,
  24792. }
  24793. }
  24794. if err != nil {
  24795. return nil, err
  24796. }
  24797. defer googleapi.CloseBody(res)
  24798. if err := googleapi.CheckResponse(res); err != nil {
  24799. return nil, err
  24800. }
  24801. ret := &Creative{
  24802. ServerResponse: googleapi.ServerResponse{
  24803. Header: res.Header,
  24804. HTTPStatusCode: res.StatusCode,
  24805. },
  24806. }
  24807. target := &ret
  24808. if err := gensupport.DecodeResponse(target, res); err != nil {
  24809. return nil, err
  24810. }
  24811. return ret, nil
  24812. // {
  24813. // "description": "Gets one creative by ID.",
  24814. // "httpMethod": "GET",
  24815. // "id": "dfareporting.creatives.get",
  24816. // "parameterOrder": [
  24817. // "profileId",
  24818. // "id"
  24819. // ],
  24820. // "parameters": {
  24821. // "id": {
  24822. // "description": "Creative ID.",
  24823. // "format": "int64",
  24824. // "location": "path",
  24825. // "required": true,
  24826. // "type": "string"
  24827. // },
  24828. // "profileId": {
  24829. // "description": "User profile ID associated with this request.",
  24830. // "format": "int64",
  24831. // "location": "path",
  24832. // "required": true,
  24833. // "type": "string"
  24834. // }
  24835. // },
  24836. // "path": "userprofiles/{profileId}/creatives/{id}",
  24837. // "response": {
  24838. // "$ref": "Creative"
  24839. // },
  24840. // "scopes": [
  24841. // "https://www.googleapis.com/auth/dfatrafficking"
  24842. // ]
  24843. // }
  24844. }
  24845. // method id "dfareporting.creatives.insert":
  24846. type CreativesInsertCall struct {
  24847. s *Service
  24848. profileId int64
  24849. creative *Creative
  24850. urlParams_ gensupport.URLParams
  24851. ctx_ context.Context
  24852. header_ http.Header
  24853. }
  24854. // Insert: Inserts a new creative.
  24855. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  24856. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24857. c.profileId = profileId
  24858. c.creative = creative
  24859. return c
  24860. }
  24861. // Fields allows partial responses to be retrieved. See
  24862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24863. // for more information.
  24864. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  24865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24866. return c
  24867. }
  24868. // Context sets the context to be used in this call's Do method. Any
  24869. // pending HTTP request will be aborted if the provided context is
  24870. // canceled.
  24871. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  24872. c.ctx_ = ctx
  24873. return c
  24874. }
  24875. // Header returns an http.Header that can be modified by the caller to
  24876. // add HTTP headers to the request.
  24877. func (c *CreativesInsertCall) Header() http.Header {
  24878. if c.header_ == nil {
  24879. c.header_ = make(http.Header)
  24880. }
  24881. return c.header_
  24882. }
  24883. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  24884. reqHeaders := make(http.Header)
  24885. for k, v := range c.header_ {
  24886. reqHeaders[k] = v
  24887. }
  24888. reqHeaders.Set("User-Agent", c.s.userAgent())
  24889. var body io.Reader = nil
  24890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24891. if err != nil {
  24892. return nil, err
  24893. }
  24894. reqHeaders.Set("Content-Type", "application/json")
  24895. c.urlParams_.Set("alt", alt)
  24896. c.urlParams_.Set("prettyPrint", "false")
  24897. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24898. urls += "?" + c.urlParams_.Encode()
  24899. req, err := http.NewRequest("POST", urls, body)
  24900. if err != nil {
  24901. return nil, err
  24902. }
  24903. req.Header = reqHeaders
  24904. googleapi.Expand(req.URL, map[string]string{
  24905. "profileId": strconv.FormatInt(c.profileId, 10),
  24906. })
  24907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24908. }
  24909. // Do executes the "dfareporting.creatives.insert" call.
  24910. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24911. // code is an error. Response headers are in either
  24912. // *Creative.ServerResponse.Header or (if a response was returned at
  24913. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24914. // to check whether the returned error was because
  24915. // http.StatusNotModified was returned.
  24916. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24917. gensupport.SetOptions(c.urlParams_, opts...)
  24918. res, err := c.doRequest("json")
  24919. if res != nil && res.StatusCode == http.StatusNotModified {
  24920. if res.Body != nil {
  24921. res.Body.Close()
  24922. }
  24923. return nil, &googleapi.Error{
  24924. Code: res.StatusCode,
  24925. Header: res.Header,
  24926. }
  24927. }
  24928. if err != nil {
  24929. return nil, err
  24930. }
  24931. defer googleapi.CloseBody(res)
  24932. if err := googleapi.CheckResponse(res); err != nil {
  24933. return nil, err
  24934. }
  24935. ret := &Creative{
  24936. ServerResponse: googleapi.ServerResponse{
  24937. Header: res.Header,
  24938. HTTPStatusCode: res.StatusCode,
  24939. },
  24940. }
  24941. target := &ret
  24942. if err := gensupport.DecodeResponse(target, res); err != nil {
  24943. return nil, err
  24944. }
  24945. return ret, nil
  24946. // {
  24947. // "description": "Inserts a new creative.",
  24948. // "httpMethod": "POST",
  24949. // "id": "dfareporting.creatives.insert",
  24950. // "parameterOrder": [
  24951. // "profileId"
  24952. // ],
  24953. // "parameters": {
  24954. // "profileId": {
  24955. // "description": "User profile ID associated with this request.",
  24956. // "format": "int64",
  24957. // "location": "path",
  24958. // "required": true,
  24959. // "type": "string"
  24960. // }
  24961. // },
  24962. // "path": "userprofiles/{profileId}/creatives",
  24963. // "request": {
  24964. // "$ref": "Creative"
  24965. // },
  24966. // "response": {
  24967. // "$ref": "Creative"
  24968. // },
  24969. // "scopes": [
  24970. // "https://www.googleapis.com/auth/dfatrafficking"
  24971. // ]
  24972. // }
  24973. }
  24974. // method id "dfareporting.creatives.list":
  24975. type CreativesListCall struct {
  24976. s *Service
  24977. profileId int64
  24978. urlParams_ gensupport.URLParams
  24979. ifNoneMatch_ string
  24980. ctx_ context.Context
  24981. header_ http.Header
  24982. }
  24983. // List: Retrieves a list of creatives, possibly filtered. This method
  24984. // supports paging.
  24985. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  24986. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24987. c.profileId = profileId
  24988. return c
  24989. }
  24990. // Active sets the optional parameter "active": Select only active
  24991. // creatives. Leave blank to select active and inactive creatives.
  24992. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  24993. c.urlParams_.Set("active", fmt.Sprint(active))
  24994. return c
  24995. }
  24996. // AdvertiserId sets the optional parameter "advertiserId": Select only
  24997. // creatives with this advertiser ID.
  24998. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  24999. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  25000. return c
  25001. }
  25002. // Archived sets the optional parameter "archived": Select only archived
  25003. // creatives. Leave blank to select archived and unarchived creatives.
  25004. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  25005. c.urlParams_.Set("archived", fmt.Sprint(archived))
  25006. return c
  25007. }
  25008. // CampaignId sets the optional parameter "campaignId": Select only
  25009. // creatives with this campaign ID.
  25010. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  25011. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  25012. return c
  25013. }
  25014. // CompanionCreativeIds sets the optional parameter
  25015. // "companionCreativeIds": Select only in-stream video creatives with
  25016. // these companion IDs.
  25017. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  25018. var companionCreativeIds_ []string
  25019. for _, v := range companionCreativeIds {
  25020. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  25021. }
  25022. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  25023. return c
  25024. }
  25025. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  25026. // Select only creatives with these creative field IDs.
  25027. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  25028. var creativeFieldIds_ []string
  25029. for _, v := range creativeFieldIds {
  25030. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  25031. }
  25032. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  25033. return c
  25034. }
  25035. // Ids sets the optional parameter "ids": Select only creatives with
  25036. // these IDs.
  25037. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  25038. var ids_ []string
  25039. for _, v := range ids {
  25040. ids_ = append(ids_, fmt.Sprint(v))
  25041. }
  25042. c.urlParams_.SetMulti("ids", ids_)
  25043. return c
  25044. }
  25045. // MaxResults sets the optional parameter "maxResults": Maximum number
  25046. // of results to return.
  25047. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  25048. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25049. return c
  25050. }
  25051. // PageToken sets the optional parameter "pageToken": Value of the
  25052. // nextPageToken from the previous result page.
  25053. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  25054. c.urlParams_.Set("pageToken", pageToken)
  25055. return c
  25056. }
  25057. // RenderingIds sets the optional parameter "renderingIds": Select only
  25058. // creatives with these rendering IDs.
  25059. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  25060. var renderingIds_ []string
  25061. for _, v := range renderingIds {
  25062. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  25063. }
  25064. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  25065. return c
  25066. }
  25067. // SearchString sets the optional parameter "searchString": Allows
  25068. // searching for objects by name or ID. Wildcards (*) are allowed. For
  25069. // example, "creative*2015" will return objects with names like
  25070. // "creative June 2015", "creative April 2015", or simply "creative
  25071. // 2015". Most of the searches also add wildcards implicitly at the
  25072. // start and the end of the search string. For example, a search string
  25073. // of "creative" will match objects with name "my creative", "creative
  25074. // 2015", or simply "creative".
  25075. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  25076. c.urlParams_.Set("searchString", searchString)
  25077. return c
  25078. }
  25079. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  25080. // with these size IDs.
  25081. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  25082. var sizeIds_ []string
  25083. for _, v := range sizeIds {
  25084. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  25085. }
  25086. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  25087. return c
  25088. }
  25089. // SortField sets the optional parameter "sortField": Field by which to
  25090. // sort the list.
  25091. //
  25092. // Possible values:
  25093. // "ID" (default)
  25094. // "NAME"
  25095. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  25096. c.urlParams_.Set("sortField", sortField)
  25097. return c
  25098. }
  25099. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  25100. // results.
  25101. //
  25102. // Possible values:
  25103. // "ASCENDING" (default)
  25104. // "DESCENDING"
  25105. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  25106. c.urlParams_.Set("sortOrder", sortOrder)
  25107. return c
  25108. }
  25109. // StudioCreativeId sets the optional parameter "studioCreativeId":
  25110. // Select only creatives corresponding to this Studio creative ID.
  25111. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  25112. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  25113. return c
  25114. }
  25115. // Types sets the optional parameter "types": Select only creatives with
  25116. // these creative types.
  25117. //
  25118. // Possible values:
  25119. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  25120. // "CUSTOM_DISPLAY"
  25121. // "CUSTOM_DISPLAY_INTERSTITIAL"
  25122. // "DISPLAY"
  25123. // "DISPLAY_IMAGE_GALLERY"
  25124. // "DISPLAY_REDIRECT"
  25125. // "FLASH_INPAGE"
  25126. // "HTML5_BANNER"
  25127. // "IMAGE"
  25128. // "INSTREAM_AUDIO"
  25129. // "INSTREAM_VIDEO"
  25130. // "INSTREAM_VIDEO_REDIRECT"
  25131. // "INTERNAL_REDIRECT"
  25132. // "INTERSTITIAL_INTERNAL_REDIRECT"
  25133. // "RICH_MEDIA_DISPLAY_BANNER"
  25134. // "RICH_MEDIA_DISPLAY_EXPANDING"
  25135. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  25136. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  25137. // "RICH_MEDIA_IM_EXPAND"
  25138. // "RICH_MEDIA_INPAGE_FLOATING"
  25139. // "RICH_MEDIA_MOBILE_IN_APP"
  25140. // "RICH_MEDIA_PEEL_DOWN"
  25141. // "TRACKING_TEXT"
  25142. // "VPAID_LINEAR_VIDEO"
  25143. // "VPAID_NON_LINEAR_VIDEO"
  25144. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  25145. c.urlParams_.SetMulti("types", append([]string{}, types...))
  25146. return c
  25147. }
  25148. // Fields allows partial responses to be retrieved. See
  25149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25150. // for more information.
  25151. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  25152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25153. return c
  25154. }
  25155. // IfNoneMatch sets the optional parameter which makes the operation
  25156. // fail if the object's ETag matches the given value. This is useful for
  25157. // getting updates only after the object has changed since the last
  25158. // request. Use googleapi.IsNotModified to check whether the response
  25159. // error from Do is the result of In-None-Match.
  25160. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  25161. c.ifNoneMatch_ = entityTag
  25162. return c
  25163. }
  25164. // Context sets the context to be used in this call's Do method. Any
  25165. // pending HTTP request will be aborted if the provided context is
  25166. // canceled.
  25167. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  25168. c.ctx_ = ctx
  25169. return c
  25170. }
  25171. // Header returns an http.Header that can be modified by the caller to
  25172. // add HTTP headers to the request.
  25173. func (c *CreativesListCall) Header() http.Header {
  25174. if c.header_ == nil {
  25175. c.header_ = make(http.Header)
  25176. }
  25177. return c.header_
  25178. }
  25179. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  25180. reqHeaders := make(http.Header)
  25181. for k, v := range c.header_ {
  25182. reqHeaders[k] = v
  25183. }
  25184. reqHeaders.Set("User-Agent", c.s.userAgent())
  25185. if c.ifNoneMatch_ != "" {
  25186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25187. }
  25188. var body io.Reader = nil
  25189. c.urlParams_.Set("alt", alt)
  25190. c.urlParams_.Set("prettyPrint", "false")
  25191. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25192. urls += "?" + c.urlParams_.Encode()
  25193. req, err := http.NewRequest("GET", urls, body)
  25194. if err != nil {
  25195. return nil, err
  25196. }
  25197. req.Header = reqHeaders
  25198. googleapi.Expand(req.URL, map[string]string{
  25199. "profileId": strconv.FormatInt(c.profileId, 10),
  25200. })
  25201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25202. }
  25203. // Do executes the "dfareporting.creatives.list" call.
  25204. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  25205. // non-2xx status code is an error. Response headers are in either
  25206. // *CreativesListResponse.ServerResponse.Header or (if a response was
  25207. // returned at all) in error.(*googleapi.Error).Header. Use
  25208. // googleapi.IsNotModified to check whether the returned error was
  25209. // because http.StatusNotModified was returned.
  25210. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  25211. gensupport.SetOptions(c.urlParams_, opts...)
  25212. res, err := c.doRequest("json")
  25213. if res != nil && res.StatusCode == http.StatusNotModified {
  25214. if res.Body != nil {
  25215. res.Body.Close()
  25216. }
  25217. return nil, &googleapi.Error{
  25218. Code: res.StatusCode,
  25219. Header: res.Header,
  25220. }
  25221. }
  25222. if err != nil {
  25223. return nil, err
  25224. }
  25225. defer googleapi.CloseBody(res)
  25226. if err := googleapi.CheckResponse(res); err != nil {
  25227. return nil, err
  25228. }
  25229. ret := &CreativesListResponse{
  25230. ServerResponse: googleapi.ServerResponse{
  25231. Header: res.Header,
  25232. HTTPStatusCode: res.StatusCode,
  25233. },
  25234. }
  25235. target := &ret
  25236. if err := gensupport.DecodeResponse(target, res); err != nil {
  25237. return nil, err
  25238. }
  25239. return ret, nil
  25240. // {
  25241. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  25242. // "httpMethod": "GET",
  25243. // "id": "dfareporting.creatives.list",
  25244. // "parameterOrder": [
  25245. // "profileId"
  25246. // ],
  25247. // "parameters": {
  25248. // "active": {
  25249. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  25250. // "location": "query",
  25251. // "type": "boolean"
  25252. // },
  25253. // "advertiserId": {
  25254. // "description": "Select only creatives with this advertiser ID.",
  25255. // "format": "int64",
  25256. // "location": "query",
  25257. // "type": "string"
  25258. // },
  25259. // "archived": {
  25260. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  25261. // "location": "query",
  25262. // "type": "boolean"
  25263. // },
  25264. // "campaignId": {
  25265. // "description": "Select only creatives with this campaign ID.",
  25266. // "format": "int64",
  25267. // "location": "query",
  25268. // "type": "string"
  25269. // },
  25270. // "companionCreativeIds": {
  25271. // "description": "Select only in-stream video creatives with these companion IDs.",
  25272. // "format": "int64",
  25273. // "location": "query",
  25274. // "repeated": true,
  25275. // "type": "string"
  25276. // },
  25277. // "creativeFieldIds": {
  25278. // "description": "Select only creatives with these creative field IDs.",
  25279. // "format": "int64",
  25280. // "location": "query",
  25281. // "repeated": true,
  25282. // "type": "string"
  25283. // },
  25284. // "ids": {
  25285. // "description": "Select only creatives with these IDs.",
  25286. // "format": "int64",
  25287. // "location": "query",
  25288. // "repeated": true,
  25289. // "type": "string"
  25290. // },
  25291. // "maxResults": {
  25292. // "default": "1000",
  25293. // "description": "Maximum number of results to return.",
  25294. // "format": "int32",
  25295. // "location": "query",
  25296. // "maximum": "1000",
  25297. // "minimum": "0",
  25298. // "type": "integer"
  25299. // },
  25300. // "pageToken": {
  25301. // "description": "Value of the nextPageToken from the previous result page.",
  25302. // "location": "query",
  25303. // "type": "string"
  25304. // },
  25305. // "profileId": {
  25306. // "description": "User profile ID associated with this request.",
  25307. // "format": "int64",
  25308. // "location": "path",
  25309. // "required": true,
  25310. // "type": "string"
  25311. // },
  25312. // "renderingIds": {
  25313. // "description": "Select only creatives with these rendering IDs.",
  25314. // "format": "int64",
  25315. // "location": "query",
  25316. // "repeated": true,
  25317. // "type": "string"
  25318. // },
  25319. // "searchString": {
  25320. // "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\".",
  25321. // "location": "query",
  25322. // "type": "string"
  25323. // },
  25324. // "sizeIds": {
  25325. // "description": "Select only creatives with these size IDs.",
  25326. // "format": "int64",
  25327. // "location": "query",
  25328. // "repeated": true,
  25329. // "type": "string"
  25330. // },
  25331. // "sortField": {
  25332. // "default": "ID",
  25333. // "description": "Field by which to sort the list.",
  25334. // "enum": [
  25335. // "ID",
  25336. // "NAME"
  25337. // ],
  25338. // "enumDescriptions": [
  25339. // "",
  25340. // ""
  25341. // ],
  25342. // "location": "query",
  25343. // "type": "string"
  25344. // },
  25345. // "sortOrder": {
  25346. // "default": "ASCENDING",
  25347. // "description": "Order of sorted results.",
  25348. // "enum": [
  25349. // "ASCENDING",
  25350. // "DESCENDING"
  25351. // ],
  25352. // "enumDescriptions": [
  25353. // "",
  25354. // ""
  25355. // ],
  25356. // "location": "query",
  25357. // "type": "string"
  25358. // },
  25359. // "studioCreativeId": {
  25360. // "description": "Select only creatives corresponding to this Studio creative ID.",
  25361. // "format": "int64",
  25362. // "location": "query",
  25363. // "type": "string"
  25364. // },
  25365. // "types": {
  25366. // "description": "Select only creatives with these creative types.",
  25367. // "enum": [
  25368. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  25369. // "CUSTOM_DISPLAY",
  25370. // "CUSTOM_DISPLAY_INTERSTITIAL",
  25371. // "DISPLAY",
  25372. // "DISPLAY_IMAGE_GALLERY",
  25373. // "DISPLAY_REDIRECT",
  25374. // "FLASH_INPAGE",
  25375. // "HTML5_BANNER",
  25376. // "IMAGE",
  25377. // "INSTREAM_AUDIO",
  25378. // "INSTREAM_VIDEO",
  25379. // "INSTREAM_VIDEO_REDIRECT",
  25380. // "INTERNAL_REDIRECT",
  25381. // "INTERSTITIAL_INTERNAL_REDIRECT",
  25382. // "RICH_MEDIA_DISPLAY_BANNER",
  25383. // "RICH_MEDIA_DISPLAY_EXPANDING",
  25384. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  25385. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  25386. // "RICH_MEDIA_IM_EXPAND",
  25387. // "RICH_MEDIA_INPAGE_FLOATING",
  25388. // "RICH_MEDIA_MOBILE_IN_APP",
  25389. // "RICH_MEDIA_PEEL_DOWN",
  25390. // "TRACKING_TEXT",
  25391. // "VPAID_LINEAR_VIDEO",
  25392. // "VPAID_NON_LINEAR_VIDEO"
  25393. // ],
  25394. // "enumDescriptions": [
  25395. // "",
  25396. // "",
  25397. // "",
  25398. // "",
  25399. // "",
  25400. // "",
  25401. // "",
  25402. // "",
  25403. // "",
  25404. // "",
  25405. // "",
  25406. // "",
  25407. // "",
  25408. // "",
  25409. // "",
  25410. // "",
  25411. // "",
  25412. // "",
  25413. // "",
  25414. // "",
  25415. // "",
  25416. // "",
  25417. // "",
  25418. // "",
  25419. // ""
  25420. // ],
  25421. // "location": "query",
  25422. // "repeated": true,
  25423. // "type": "string"
  25424. // }
  25425. // },
  25426. // "path": "userprofiles/{profileId}/creatives",
  25427. // "response": {
  25428. // "$ref": "CreativesListResponse"
  25429. // },
  25430. // "scopes": [
  25431. // "https://www.googleapis.com/auth/dfatrafficking"
  25432. // ]
  25433. // }
  25434. }
  25435. // Pages invokes f for each page of results.
  25436. // A non-nil error returned from f will halt the iteration.
  25437. // The provided context supersedes any context provided to the Context method.
  25438. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  25439. c.ctx_ = ctx
  25440. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25441. for {
  25442. x, err := c.Do()
  25443. if err != nil {
  25444. return err
  25445. }
  25446. if err := f(x); err != nil {
  25447. return err
  25448. }
  25449. if x.NextPageToken == "" {
  25450. return nil
  25451. }
  25452. c.PageToken(x.NextPageToken)
  25453. }
  25454. }
  25455. // method id "dfareporting.creatives.patch":
  25456. type CreativesPatchCall struct {
  25457. s *Service
  25458. profileId int64
  25459. creative *Creative
  25460. urlParams_ gensupport.URLParams
  25461. ctx_ context.Context
  25462. header_ http.Header
  25463. }
  25464. // Patch: Updates an existing creative. This method supports patch
  25465. // semantics.
  25466. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  25467. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25468. c.profileId = profileId
  25469. c.urlParams_.Set("id", fmt.Sprint(id))
  25470. c.creative = creative
  25471. return c
  25472. }
  25473. // Fields allows partial responses to be retrieved. See
  25474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25475. // for more information.
  25476. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  25477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25478. return c
  25479. }
  25480. // Context sets the context to be used in this call's Do method. Any
  25481. // pending HTTP request will be aborted if the provided context is
  25482. // canceled.
  25483. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  25484. c.ctx_ = ctx
  25485. return c
  25486. }
  25487. // Header returns an http.Header that can be modified by the caller to
  25488. // add HTTP headers to the request.
  25489. func (c *CreativesPatchCall) Header() http.Header {
  25490. if c.header_ == nil {
  25491. c.header_ = make(http.Header)
  25492. }
  25493. return c.header_
  25494. }
  25495. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  25496. reqHeaders := make(http.Header)
  25497. for k, v := range c.header_ {
  25498. reqHeaders[k] = v
  25499. }
  25500. reqHeaders.Set("User-Agent", c.s.userAgent())
  25501. var body io.Reader = nil
  25502. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25503. if err != nil {
  25504. return nil, err
  25505. }
  25506. reqHeaders.Set("Content-Type", "application/json")
  25507. c.urlParams_.Set("alt", alt)
  25508. c.urlParams_.Set("prettyPrint", "false")
  25509. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25510. urls += "?" + c.urlParams_.Encode()
  25511. req, err := http.NewRequest("PATCH", urls, body)
  25512. if err != nil {
  25513. return nil, err
  25514. }
  25515. req.Header = reqHeaders
  25516. googleapi.Expand(req.URL, map[string]string{
  25517. "profileId": strconv.FormatInt(c.profileId, 10),
  25518. })
  25519. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25520. }
  25521. // Do executes the "dfareporting.creatives.patch" call.
  25522. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25523. // code is an error. Response headers are in either
  25524. // *Creative.ServerResponse.Header or (if a response was returned at
  25525. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25526. // to check whether the returned error was because
  25527. // http.StatusNotModified was returned.
  25528. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25529. gensupport.SetOptions(c.urlParams_, opts...)
  25530. res, err := c.doRequest("json")
  25531. if res != nil && res.StatusCode == http.StatusNotModified {
  25532. if res.Body != nil {
  25533. res.Body.Close()
  25534. }
  25535. return nil, &googleapi.Error{
  25536. Code: res.StatusCode,
  25537. Header: res.Header,
  25538. }
  25539. }
  25540. if err != nil {
  25541. return nil, err
  25542. }
  25543. defer googleapi.CloseBody(res)
  25544. if err := googleapi.CheckResponse(res); err != nil {
  25545. return nil, err
  25546. }
  25547. ret := &Creative{
  25548. ServerResponse: googleapi.ServerResponse{
  25549. Header: res.Header,
  25550. HTTPStatusCode: res.StatusCode,
  25551. },
  25552. }
  25553. target := &ret
  25554. if err := gensupport.DecodeResponse(target, res); err != nil {
  25555. return nil, err
  25556. }
  25557. return ret, nil
  25558. // {
  25559. // "description": "Updates an existing creative. This method supports patch semantics.",
  25560. // "httpMethod": "PATCH",
  25561. // "id": "dfareporting.creatives.patch",
  25562. // "parameterOrder": [
  25563. // "profileId",
  25564. // "id"
  25565. // ],
  25566. // "parameters": {
  25567. // "id": {
  25568. // "description": "Creative ID.",
  25569. // "format": "int64",
  25570. // "location": "query",
  25571. // "required": true,
  25572. // "type": "string"
  25573. // },
  25574. // "profileId": {
  25575. // "description": "User profile ID associated with this request.",
  25576. // "format": "int64",
  25577. // "location": "path",
  25578. // "required": true,
  25579. // "type": "string"
  25580. // }
  25581. // },
  25582. // "path": "userprofiles/{profileId}/creatives",
  25583. // "request": {
  25584. // "$ref": "Creative"
  25585. // },
  25586. // "response": {
  25587. // "$ref": "Creative"
  25588. // },
  25589. // "scopes": [
  25590. // "https://www.googleapis.com/auth/dfatrafficking"
  25591. // ]
  25592. // }
  25593. }
  25594. // method id "dfareporting.creatives.update":
  25595. type CreativesUpdateCall struct {
  25596. s *Service
  25597. profileId int64
  25598. creative *Creative
  25599. urlParams_ gensupport.URLParams
  25600. ctx_ context.Context
  25601. header_ http.Header
  25602. }
  25603. // Update: Updates an existing creative.
  25604. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  25605. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25606. c.profileId = profileId
  25607. c.creative = creative
  25608. return c
  25609. }
  25610. // Fields allows partial responses to be retrieved. See
  25611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25612. // for more information.
  25613. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  25614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25615. return c
  25616. }
  25617. // Context sets the context to be used in this call's Do method. Any
  25618. // pending HTTP request will be aborted if the provided context is
  25619. // canceled.
  25620. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  25621. c.ctx_ = ctx
  25622. return c
  25623. }
  25624. // Header returns an http.Header that can be modified by the caller to
  25625. // add HTTP headers to the request.
  25626. func (c *CreativesUpdateCall) Header() http.Header {
  25627. if c.header_ == nil {
  25628. c.header_ = make(http.Header)
  25629. }
  25630. return c.header_
  25631. }
  25632. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  25633. reqHeaders := make(http.Header)
  25634. for k, v := range c.header_ {
  25635. reqHeaders[k] = v
  25636. }
  25637. reqHeaders.Set("User-Agent", c.s.userAgent())
  25638. var body io.Reader = nil
  25639. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25640. if err != nil {
  25641. return nil, err
  25642. }
  25643. reqHeaders.Set("Content-Type", "application/json")
  25644. c.urlParams_.Set("alt", alt)
  25645. c.urlParams_.Set("prettyPrint", "false")
  25646. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25647. urls += "?" + c.urlParams_.Encode()
  25648. req, err := http.NewRequest("PUT", urls, body)
  25649. if err != nil {
  25650. return nil, err
  25651. }
  25652. req.Header = reqHeaders
  25653. googleapi.Expand(req.URL, map[string]string{
  25654. "profileId": strconv.FormatInt(c.profileId, 10),
  25655. })
  25656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25657. }
  25658. // Do executes the "dfareporting.creatives.update" call.
  25659. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25660. // code is an error. Response headers are in either
  25661. // *Creative.ServerResponse.Header or (if a response was returned at
  25662. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25663. // to check whether the returned error was because
  25664. // http.StatusNotModified was returned.
  25665. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25666. gensupport.SetOptions(c.urlParams_, opts...)
  25667. res, err := c.doRequest("json")
  25668. if res != nil && res.StatusCode == http.StatusNotModified {
  25669. if res.Body != nil {
  25670. res.Body.Close()
  25671. }
  25672. return nil, &googleapi.Error{
  25673. Code: res.StatusCode,
  25674. Header: res.Header,
  25675. }
  25676. }
  25677. if err != nil {
  25678. return nil, err
  25679. }
  25680. defer googleapi.CloseBody(res)
  25681. if err := googleapi.CheckResponse(res); err != nil {
  25682. return nil, err
  25683. }
  25684. ret := &Creative{
  25685. ServerResponse: googleapi.ServerResponse{
  25686. Header: res.Header,
  25687. HTTPStatusCode: res.StatusCode,
  25688. },
  25689. }
  25690. target := &ret
  25691. if err := gensupport.DecodeResponse(target, res); err != nil {
  25692. return nil, err
  25693. }
  25694. return ret, nil
  25695. // {
  25696. // "description": "Updates an existing creative.",
  25697. // "httpMethod": "PUT",
  25698. // "id": "dfareporting.creatives.update",
  25699. // "parameterOrder": [
  25700. // "profileId"
  25701. // ],
  25702. // "parameters": {
  25703. // "profileId": {
  25704. // "description": "User profile ID associated with this request.",
  25705. // "format": "int64",
  25706. // "location": "path",
  25707. // "required": true,
  25708. // "type": "string"
  25709. // }
  25710. // },
  25711. // "path": "userprofiles/{profileId}/creatives",
  25712. // "request": {
  25713. // "$ref": "Creative"
  25714. // },
  25715. // "response": {
  25716. // "$ref": "Creative"
  25717. // },
  25718. // "scopes": [
  25719. // "https://www.googleapis.com/auth/dfatrafficking"
  25720. // ]
  25721. // }
  25722. }
  25723. // method id "dfareporting.dimensionValues.query":
  25724. type DimensionValuesQueryCall struct {
  25725. s *Service
  25726. profileId int64
  25727. dimensionvaluerequest *DimensionValueRequest
  25728. urlParams_ gensupport.URLParams
  25729. ctx_ context.Context
  25730. header_ http.Header
  25731. }
  25732. // Query: Retrieves list of report dimension values for a list of
  25733. // filters.
  25734. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  25735. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25736. c.profileId = profileId
  25737. c.dimensionvaluerequest = dimensionvaluerequest
  25738. return c
  25739. }
  25740. // MaxResults sets the optional parameter "maxResults": Maximum number
  25741. // of results to return.
  25742. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  25743. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25744. return c
  25745. }
  25746. // PageToken sets the optional parameter "pageToken": The value of the
  25747. // nextToken from the previous result page.
  25748. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  25749. c.urlParams_.Set("pageToken", pageToken)
  25750. return c
  25751. }
  25752. // Fields allows partial responses to be retrieved. See
  25753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25754. // for more information.
  25755. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  25756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25757. return c
  25758. }
  25759. // Context sets the context to be used in this call's Do method. Any
  25760. // pending HTTP request will be aborted if the provided context is
  25761. // canceled.
  25762. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  25763. c.ctx_ = ctx
  25764. return c
  25765. }
  25766. // Header returns an http.Header that can be modified by the caller to
  25767. // add HTTP headers to the request.
  25768. func (c *DimensionValuesQueryCall) Header() http.Header {
  25769. if c.header_ == nil {
  25770. c.header_ = make(http.Header)
  25771. }
  25772. return c.header_
  25773. }
  25774. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  25775. reqHeaders := make(http.Header)
  25776. for k, v := range c.header_ {
  25777. reqHeaders[k] = v
  25778. }
  25779. reqHeaders.Set("User-Agent", c.s.userAgent())
  25780. var body io.Reader = nil
  25781. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  25782. if err != nil {
  25783. return nil, err
  25784. }
  25785. reqHeaders.Set("Content-Type", "application/json")
  25786. c.urlParams_.Set("alt", alt)
  25787. c.urlParams_.Set("prettyPrint", "false")
  25788. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  25789. urls += "?" + c.urlParams_.Encode()
  25790. req, err := http.NewRequest("POST", urls, body)
  25791. if err != nil {
  25792. return nil, err
  25793. }
  25794. req.Header = reqHeaders
  25795. googleapi.Expand(req.URL, map[string]string{
  25796. "profileId": strconv.FormatInt(c.profileId, 10),
  25797. })
  25798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25799. }
  25800. // Do executes the "dfareporting.dimensionValues.query" call.
  25801. // Exactly one of *DimensionValueList or error will be non-nil. Any
  25802. // non-2xx status code is an error. Response headers are in either
  25803. // *DimensionValueList.ServerResponse.Header or (if a response was
  25804. // returned at all) in error.(*googleapi.Error).Header. Use
  25805. // googleapi.IsNotModified to check whether the returned error was
  25806. // because http.StatusNotModified was returned.
  25807. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  25808. gensupport.SetOptions(c.urlParams_, opts...)
  25809. res, err := c.doRequest("json")
  25810. if res != nil && res.StatusCode == http.StatusNotModified {
  25811. if res.Body != nil {
  25812. res.Body.Close()
  25813. }
  25814. return nil, &googleapi.Error{
  25815. Code: res.StatusCode,
  25816. Header: res.Header,
  25817. }
  25818. }
  25819. if err != nil {
  25820. return nil, err
  25821. }
  25822. defer googleapi.CloseBody(res)
  25823. if err := googleapi.CheckResponse(res); err != nil {
  25824. return nil, err
  25825. }
  25826. ret := &DimensionValueList{
  25827. ServerResponse: googleapi.ServerResponse{
  25828. Header: res.Header,
  25829. HTTPStatusCode: res.StatusCode,
  25830. },
  25831. }
  25832. target := &ret
  25833. if err := gensupport.DecodeResponse(target, res); err != nil {
  25834. return nil, err
  25835. }
  25836. return ret, nil
  25837. // {
  25838. // "description": "Retrieves list of report dimension values for a list of filters.",
  25839. // "httpMethod": "POST",
  25840. // "id": "dfareporting.dimensionValues.query",
  25841. // "parameterOrder": [
  25842. // "profileId"
  25843. // ],
  25844. // "parameters": {
  25845. // "maxResults": {
  25846. // "default": "100",
  25847. // "description": "Maximum number of results to return.",
  25848. // "format": "int32",
  25849. // "location": "query",
  25850. // "maximum": "100",
  25851. // "minimum": "0",
  25852. // "type": "integer"
  25853. // },
  25854. // "pageToken": {
  25855. // "description": "The value of the nextToken from the previous result page.",
  25856. // "location": "query",
  25857. // "type": "string"
  25858. // },
  25859. // "profileId": {
  25860. // "description": "The DFA user profile ID.",
  25861. // "format": "int64",
  25862. // "location": "path",
  25863. // "required": true,
  25864. // "type": "string"
  25865. // }
  25866. // },
  25867. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  25868. // "request": {
  25869. // "$ref": "DimensionValueRequest"
  25870. // },
  25871. // "response": {
  25872. // "$ref": "DimensionValueList"
  25873. // },
  25874. // "scopes": [
  25875. // "https://www.googleapis.com/auth/dfareporting"
  25876. // ]
  25877. // }
  25878. }
  25879. // Pages invokes f for each page of results.
  25880. // A non-nil error returned from f will halt the iteration.
  25881. // The provided context supersedes any context provided to the Context method.
  25882. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  25883. c.ctx_ = ctx
  25884. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25885. for {
  25886. x, err := c.Do()
  25887. if err != nil {
  25888. return err
  25889. }
  25890. if err := f(x); err != nil {
  25891. return err
  25892. }
  25893. if x.NextPageToken == "" {
  25894. return nil
  25895. }
  25896. c.PageToken(x.NextPageToken)
  25897. }
  25898. }
  25899. // method id "dfareporting.directorySites.get":
  25900. type DirectorySitesGetCall struct {
  25901. s *Service
  25902. profileId int64
  25903. id int64
  25904. urlParams_ gensupport.URLParams
  25905. ifNoneMatch_ string
  25906. ctx_ context.Context
  25907. header_ http.Header
  25908. }
  25909. // Get: Gets one directory site by ID.
  25910. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  25911. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25912. c.profileId = profileId
  25913. c.id = id
  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 *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  25920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25921. return c
  25922. }
  25923. // IfNoneMatch sets the optional parameter which makes the operation
  25924. // fail if the object's ETag matches the given value. This is useful for
  25925. // getting updates only after the object has changed since the last
  25926. // request. Use googleapi.IsNotModified to check whether the response
  25927. // error from Do is the result of In-None-Match.
  25928. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  25929. c.ifNoneMatch_ = entityTag
  25930. return c
  25931. }
  25932. // Context sets the context to be used in this call's Do method. Any
  25933. // pending HTTP request will be aborted if the provided context is
  25934. // canceled.
  25935. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  25936. c.ctx_ = ctx
  25937. return c
  25938. }
  25939. // Header returns an http.Header that can be modified by the caller to
  25940. // add HTTP headers to the request.
  25941. func (c *DirectorySitesGetCall) Header() http.Header {
  25942. if c.header_ == nil {
  25943. c.header_ = make(http.Header)
  25944. }
  25945. return c.header_
  25946. }
  25947. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  25948. reqHeaders := make(http.Header)
  25949. for k, v := range c.header_ {
  25950. reqHeaders[k] = v
  25951. }
  25952. reqHeaders.Set("User-Agent", c.s.userAgent())
  25953. if c.ifNoneMatch_ != "" {
  25954. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25955. }
  25956. var body io.Reader = nil
  25957. c.urlParams_.Set("alt", alt)
  25958. c.urlParams_.Set("prettyPrint", "false")
  25959. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  25960. urls += "?" + c.urlParams_.Encode()
  25961. req, err := http.NewRequest("GET", urls, body)
  25962. if err != nil {
  25963. return nil, err
  25964. }
  25965. req.Header = reqHeaders
  25966. googleapi.Expand(req.URL, map[string]string{
  25967. "profileId": strconv.FormatInt(c.profileId, 10),
  25968. "id": strconv.FormatInt(c.id, 10),
  25969. })
  25970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25971. }
  25972. // Do executes the "dfareporting.directorySites.get" call.
  25973. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  25974. // status code is an error. Response headers are in either
  25975. // *DirectorySite.ServerResponse.Header or (if a response was returned
  25976. // at all) in error.(*googleapi.Error).Header. Use
  25977. // googleapi.IsNotModified to check whether the returned error was
  25978. // because http.StatusNotModified was returned.
  25979. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  25980. gensupport.SetOptions(c.urlParams_, opts...)
  25981. res, err := c.doRequest("json")
  25982. if res != nil && res.StatusCode == http.StatusNotModified {
  25983. if res.Body != nil {
  25984. res.Body.Close()
  25985. }
  25986. return nil, &googleapi.Error{
  25987. Code: res.StatusCode,
  25988. Header: res.Header,
  25989. }
  25990. }
  25991. if err != nil {
  25992. return nil, err
  25993. }
  25994. defer googleapi.CloseBody(res)
  25995. if err := googleapi.CheckResponse(res); err != nil {
  25996. return nil, err
  25997. }
  25998. ret := &DirectorySite{
  25999. ServerResponse: googleapi.ServerResponse{
  26000. Header: res.Header,
  26001. HTTPStatusCode: res.StatusCode,
  26002. },
  26003. }
  26004. target := &ret
  26005. if err := gensupport.DecodeResponse(target, res); err != nil {
  26006. return nil, err
  26007. }
  26008. return ret, nil
  26009. // {
  26010. // "description": "Gets one directory site by ID.",
  26011. // "httpMethod": "GET",
  26012. // "id": "dfareporting.directorySites.get",
  26013. // "parameterOrder": [
  26014. // "profileId",
  26015. // "id"
  26016. // ],
  26017. // "parameters": {
  26018. // "id": {
  26019. // "description": "Directory site ID.",
  26020. // "format": "int64",
  26021. // "location": "path",
  26022. // "required": true,
  26023. // "type": "string"
  26024. // },
  26025. // "profileId": {
  26026. // "description": "User profile ID associated with this request.",
  26027. // "format": "int64",
  26028. // "location": "path",
  26029. // "required": true,
  26030. // "type": "string"
  26031. // }
  26032. // },
  26033. // "path": "userprofiles/{profileId}/directorySites/{id}",
  26034. // "response": {
  26035. // "$ref": "DirectorySite"
  26036. // },
  26037. // "scopes": [
  26038. // "https://www.googleapis.com/auth/dfatrafficking"
  26039. // ]
  26040. // }
  26041. }
  26042. // method id "dfareporting.directorySites.insert":
  26043. type DirectorySitesInsertCall struct {
  26044. s *Service
  26045. profileId int64
  26046. directorysite *DirectorySite
  26047. urlParams_ gensupport.URLParams
  26048. ctx_ context.Context
  26049. header_ http.Header
  26050. }
  26051. // Insert: Inserts a new directory site.
  26052. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  26053. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26054. c.profileId = profileId
  26055. c.directorysite = directorysite
  26056. return c
  26057. }
  26058. // Fields allows partial responses to be retrieved. See
  26059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26060. // for more information.
  26061. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  26062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26063. return c
  26064. }
  26065. // Context sets the context to be used in this call's Do method. Any
  26066. // pending HTTP request will be aborted if the provided context is
  26067. // canceled.
  26068. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  26069. c.ctx_ = ctx
  26070. return c
  26071. }
  26072. // Header returns an http.Header that can be modified by the caller to
  26073. // add HTTP headers to the request.
  26074. func (c *DirectorySitesInsertCall) Header() http.Header {
  26075. if c.header_ == nil {
  26076. c.header_ = make(http.Header)
  26077. }
  26078. return c.header_
  26079. }
  26080. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  26081. reqHeaders := make(http.Header)
  26082. for k, v := range c.header_ {
  26083. reqHeaders[k] = v
  26084. }
  26085. reqHeaders.Set("User-Agent", c.s.userAgent())
  26086. var body io.Reader = nil
  26087. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  26088. if err != nil {
  26089. return nil, err
  26090. }
  26091. reqHeaders.Set("Content-Type", "application/json")
  26092. c.urlParams_.Set("alt", alt)
  26093. c.urlParams_.Set("prettyPrint", "false")
  26094. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26095. urls += "?" + c.urlParams_.Encode()
  26096. req, err := http.NewRequest("POST", urls, body)
  26097. if err != nil {
  26098. return nil, err
  26099. }
  26100. req.Header = reqHeaders
  26101. googleapi.Expand(req.URL, map[string]string{
  26102. "profileId": strconv.FormatInt(c.profileId, 10),
  26103. })
  26104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26105. }
  26106. // Do executes the "dfareporting.directorySites.insert" call.
  26107. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26108. // status code is an error. Response headers are in either
  26109. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26110. // at all) in error.(*googleapi.Error).Header. Use
  26111. // googleapi.IsNotModified to check whether the returned error was
  26112. // because http.StatusNotModified was returned.
  26113. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26114. gensupport.SetOptions(c.urlParams_, opts...)
  26115. res, err := c.doRequest("json")
  26116. if res != nil && res.StatusCode == http.StatusNotModified {
  26117. if res.Body != nil {
  26118. res.Body.Close()
  26119. }
  26120. return nil, &googleapi.Error{
  26121. Code: res.StatusCode,
  26122. Header: res.Header,
  26123. }
  26124. }
  26125. if err != nil {
  26126. return nil, err
  26127. }
  26128. defer googleapi.CloseBody(res)
  26129. if err := googleapi.CheckResponse(res); err != nil {
  26130. return nil, err
  26131. }
  26132. ret := &DirectorySite{
  26133. ServerResponse: googleapi.ServerResponse{
  26134. Header: res.Header,
  26135. HTTPStatusCode: res.StatusCode,
  26136. },
  26137. }
  26138. target := &ret
  26139. if err := gensupport.DecodeResponse(target, res); err != nil {
  26140. return nil, err
  26141. }
  26142. return ret, nil
  26143. // {
  26144. // "description": "Inserts a new directory site.",
  26145. // "httpMethod": "POST",
  26146. // "id": "dfareporting.directorySites.insert",
  26147. // "parameterOrder": [
  26148. // "profileId"
  26149. // ],
  26150. // "parameters": {
  26151. // "profileId": {
  26152. // "description": "User profile ID associated with this request.",
  26153. // "format": "int64",
  26154. // "location": "path",
  26155. // "required": true,
  26156. // "type": "string"
  26157. // }
  26158. // },
  26159. // "path": "userprofiles/{profileId}/directorySites",
  26160. // "request": {
  26161. // "$ref": "DirectorySite"
  26162. // },
  26163. // "response": {
  26164. // "$ref": "DirectorySite"
  26165. // },
  26166. // "scopes": [
  26167. // "https://www.googleapis.com/auth/dfatrafficking"
  26168. // ]
  26169. // }
  26170. }
  26171. // method id "dfareporting.directorySites.list":
  26172. type DirectorySitesListCall struct {
  26173. s *Service
  26174. profileId int64
  26175. urlParams_ gensupport.URLParams
  26176. ifNoneMatch_ string
  26177. ctx_ context.Context
  26178. header_ http.Header
  26179. }
  26180. // List: Retrieves a list of directory sites, possibly filtered. This
  26181. // method supports paging.
  26182. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  26183. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26184. c.profileId = profileId
  26185. return c
  26186. }
  26187. // AcceptsInStreamVideoPlacements sets the optional parameter
  26188. // "acceptsInStreamVideoPlacements": This search filter is no longer
  26189. // supported and will have no effect on the results returned.
  26190. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  26191. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  26192. return c
  26193. }
  26194. // AcceptsInterstitialPlacements sets the optional parameter
  26195. // "acceptsInterstitialPlacements": This search filter is no longer
  26196. // supported and will have no effect on the results returned.
  26197. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  26198. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  26199. return c
  26200. }
  26201. // AcceptsPublisherPaidPlacements sets the optional parameter
  26202. // "acceptsPublisherPaidPlacements": Select only directory sites that
  26203. // accept publisher paid placements. This field can be left blank.
  26204. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  26205. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  26206. return c
  26207. }
  26208. // Active sets the optional parameter "active": Select only active
  26209. // directory sites. Leave blank to retrieve both active and inactive
  26210. // directory sites.
  26211. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  26212. c.urlParams_.Set("active", fmt.Sprint(active))
  26213. return c
  26214. }
  26215. // DfpNetworkCode sets the optional parameter "dfpNetworkCode": Select
  26216. // only directory sites with this Ad Manager network code.
  26217. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  26218. c.urlParams_.Set("dfpNetworkCode", dfpNetworkCode)
  26219. return c
  26220. }
  26221. // Ids sets the optional parameter "ids": Select only directory sites
  26222. // with these IDs.
  26223. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  26224. var ids_ []string
  26225. for _, v := range ids {
  26226. ids_ = append(ids_, fmt.Sprint(v))
  26227. }
  26228. c.urlParams_.SetMulti("ids", ids_)
  26229. return c
  26230. }
  26231. // MaxResults sets the optional parameter "maxResults": Maximum number
  26232. // of results to return.
  26233. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  26234. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26235. return c
  26236. }
  26237. // PageToken sets the optional parameter "pageToken": Value of the
  26238. // nextPageToken from the previous result page.
  26239. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  26240. c.urlParams_.Set("pageToken", pageToken)
  26241. return c
  26242. }
  26243. // SearchString sets the optional parameter "searchString": Allows
  26244. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  26245. // For example, "directory site*2015" will return objects with names
  26246. // like "directory site June 2015", "directory site April 2015", or
  26247. // simply "directory site 2015". Most of the searches also add wildcards
  26248. // implicitly at the start and the end of the search string. For
  26249. // example, a search string of "directory site" will match objects with
  26250. // name "my directory site", "directory site 2015" or simply, "directory
  26251. // site".
  26252. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  26253. c.urlParams_.Set("searchString", searchString)
  26254. return c
  26255. }
  26256. // SortField sets the optional parameter "sortField": Field by which to
  26257. // sort the list.
  26258. //
  26259. // Possible values:
  26260. // "ID" (default)
  26261. // "NAME"
  26262. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  26263. c.urlParams_.Set("sortField", sortField)
  26264. return c
  26265. }
  26266. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26267. // results.
  26268. //
  26269. // Possible values:
  26270. // "ASCENDING" (default)
  26271. // "DESCENDING"
  26272. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  26273. c.urlParams_.Set("sortOrder", sortOrder)
  26274. return c
  26275. }
  26276. // Fields allows partial responses to be retrieved. See
  26277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26278. // for more information.
  26279. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  26280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26281. return c
  26282. }
  26283. // IfNoneMatch sets the optional parameter which makes the operation
  26284. // fail if the object's ETag matches the given value. This is useful for
  26285. // getting updates only after the object has changed since the last
  26286. // request. Use googleapi.IsNotModified to check whether the response
  26287. // error from Do is the result of In-None-Match.
  26288. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  26289. c.ifNoneMatch_ = entityTag
  26290. return c
  26291. }
  26292. // Context sets the context to be used in this call's Do method. Any
  26293. // pending HTTP request will be aborted if the provided context is
  26294. // canceled.
  26295. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  26296. c.ctx_ = ctx
  26297. return c
  26298. }
  26299. // Header returns an http.Header that can be modified by the caller to
  26300. // add HTTP headers to the request.
  26301. func (c *DirectorySitesListCall) Header() http.Header {
  26302. if c.header_ == nil {
  26303. c.header_ = make(http.Header)
  26304. }
  26305. return c.header_
  26306. }
  26307. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  26308. reqHeaders := make(http.Header)
  26309. for k, v := range c.header_ {
  26310. reqHeaders[k] = v
  26311. }
  26312. reqHeaders.Set("User-Agent", c.s.userAgent())
  26313. if c.ifNoneMatch_ != "" {
  26314. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26315. }
  26316. var body io.Reader = nil
  26317. c.urlParams_.Set("alt", alt)
  26318. c.urlParams_.Set("prettyPrint", "false")
  26319. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26320. urls += "?" + c.urlParams_.Encode()
  26321. req, err := http.NewRequest("GET", urls, body)
  26322. if err != nil {
  26323. return nil, err
  26324. }
  26325. req.Header = reqHeaders
  26326. googleapi.Expand(req.URL, map[string]string{
  26327. "profileId": strconv.FormatInt(c.profileId, 10),
  26328. })
  26329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26330. }
  26331. // Do executes the "dfareporting.directorySites.list" call.
  26332. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  26333. // Any non-2xx status code is an error. Response headers are in either
  26334. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  26335. // was returned at all) in error.(*googleapi.Error).Header. Use
  26336. // googleapi.IsNotModified to check whether the returned error was
  26337. // because http.StatusNotModified was returned.
  26338. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  26339. gensupport.SetOptions(c.urlParams_, opts...)
  26340. res, err := c.doRequest("json")
  26341. if res != nil && res.StatusCode == http.StatusNotModified {
  26342. if res.Body != nil {
  26343. res.Body.Close()
  26344. }
  26345. return nil, &googleapi.Error{
  26346. Code: res.StatusCode,
  26347. Header: res.Header,
  26348. }
  26349. }
  26350. if err != nil {
  26351. return nil, err
  26352. }
  26353. defer googleapi.CloseBody(res)
  26354. if err := googleapi.CheckResponse(res); err != nil {
  26355. return nil, err
  26356. }
  26357. ret := &DirectorySitesListResponse{
  26358. ServerResponse: googleapi.ServerResponse{
  26359. Header: res.Header,
  26360. HTTPStatusCode: res.StatusCode,
  26361. },
  26362. }
  26363. target := &ret
  26364. if err := gensupport.DecodeResponse(target, res); err != nil {
  26365. return nil, err
  26366. }
  26367. return ret, nil
  26368. // {
  26369. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  26370. // "httpMethod": "GET",
  26371. // "id": "dfareporting.directorySites.list",
  26372. // "parameterOrder": [
  26373. // "profileId"
  26374. // ],
  26375. // "parameters": {
  26376. // "acceptsInStreamVideoPlacements": {
  26377. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26378. // "location": "query",
  26379. // "type": "boolean"
  26380. // },
  26381. // "acceptsInterstitialPlacements": {
  26382. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26383. // "location": "query",
  26384. // "type": "boolean"
  26385. // },
  26386. // "acceptsPublisherPaidPlacements": {
  26387. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  26388. // "location": "query",
  26389. // "type": "boolean"
  26390. // },
  26391. // "active": {
  26392. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  26393. // "location": "query",
  26394. // "type": "boolean"
  26395. // },
  26396. // "dfpNetworkCode": {
  26397. // "description": "Select only directory sites with this Ad Manager network code.",
  26398. // "location": "query",
  26399. // "type": "string"
  26400. // },
  26401. // "ids": {
  26402. // "description": "Select only directory sites with these IDs.",
  26403. // "format": "int64",
  26404. // "location": "query",
  26405. // "repeated": true,
  26406. // "type": "string"
  26407. // },
  26408. // "maxResults": {
  26409. // "default": "1000",
  26410. // "description": "Maximum number of results to return.",
  26411. // "format": "int32",
  26412. // "location": "query",
  26413. // "maximum": "1000",
  26414. // "minimum": "0",
  26415. // "type": "integer"
  26416. // },
  26417. // "pageToken": {
  26418. // "description": "Value of the nextPageToken from the previous result page.",
  26419. // "location": "query",
  26420. // "type": "string"
  26421. // },
  26422. // "profileId": {
  26423. // "description": "User profile ID associated with this request.",
  26424. // "format": "int64",
  26425. // "location": "path",
  26426. // "required": true,
  26427. // "type": "string"
  26428. // },
  26429. // "searchString": {
  26430. // "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\".",
  26431. // "location": "query",
  26432. // "type": "string"
  26433. // },
  26434. // "sortField": {
  26435. // "default": "ID",
  26436. // "description": "Field by which to sort the list.",
  26437. // "enum": [
  26438. // "ID",
  26439. // "NAME"
  26440. // ],
  26441. // "enumDescriptions": [
  26442. // "",
  26443. // ""
  26444. // ],
  26445. // "location": "query",
  26446. // "type": "string"
  26447. // },
  26448. // "sortOrder": {
  26449. // "default": "ASCENDING",
  26450. // "description": "Order of sorted results.",
  26451. // "enum": [
  26452. // "ASCENDING",
  26453. // "DESCENDING"
  26454. // ],
  26455. // "enumDescriptions": [
  26456. // "",
  26457. // ""
  26458. // ],
  26459. // "location": "query",
  26460. // "type": "string"
  26461. // }
  26462. // },
  26463. // "path": "userprofiles/{profileId}/directorySites",
  26464. // "response": {
  26465. // "$ref": "DirectorySitesListResponse"
  26466. // },
  26467. // "scopes": [
  26468. // "https://www.googleapis.com/auth/dfatrafficking"
  26469. // ]
  26470. // }
  26471. }
  26472. // Pages invokes f for each page of results.
  26473. // A non-nil error returned from f will halt the iteration.
  26474. // The provided context supersedes any context provided to the Context method.
  26475. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  26476. c.ctx_ = ctx
  26477. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26478. for {
  26479. x, err := c.Do()
  26480. if err != nil {
  26481. return err
  26482. }
  26483. if err := f(x); err != nil {
  26484. return err
  26485. }
  26486. if x.NextPageToken == "" {
  26487. return nil
  26488. }
  26489. c.PageToken(x.NextPageToken)
  26490. }
  26491. }
  26492. // method id "dfareporting.dynamicTargetingKeys.delete":
  26493. type DynamicTargetingKeysDeleteCall struct {
  26494. s *Service
  26495. profileId int64
  26496. objectId int64
  26497. urlParams_ gensupport.URLParams
  26498. ctx_ context.Context
  26499. header_ http.Header
  26500. }
  26501. // Delete: Deletes an existing dynamic targeting key.
  26502. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  26503. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26504. c.profileId = profileId
  26505. c.objectId = objectId
  26506. c.urlParams_.Set("name", name)
  26507. c.urlParams_.Set("objectType", objectType)
  26508. return c
  26509. }
  26510. // Fields allows partial responses to be retrieved. See
  26511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26512. // for more information.
  26513. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  26514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26515. return c
  26516. }
  26517. // Context sets the context to be used in this call's Do method. Any
  26518. // pending HTTP request will be aborted if the provided context is
  26519. // canceled.
  26520. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  26521. c.ctx_ = ctx
  26522. return c
  26523. }
  26524. // Header returns an http.Header that can be modified by the caller to
  26525. // add HTTP headers to the request.
  26526. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  26527. if c.header_ == nil {
  26528. c.header_ = make(http.Header)
  26529. }
  26530. return c.header_
  26531. }
  26532. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  26533. reqHeaders := make(http.Header)
  26534. for k, v := range c.header_ {
  26535. reqHeaders[k] = v
  26536. }
  26537. reqHeaders.Set("User-Agent", c.s.userAgent())
  26538. var body io.Reader = nil
  26539. c.urlParams_.Set("alt", alt)
  26540. c.urlParams_.Set("prettyPrint", "false")
  26541. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  26542. urls += "?" + c.urlParams_.Encode()
  26543. req, err := http.NewRequest("DELETE", urls, body)
  26544. if err != nil {
  26545. return nil, err
  26546. }
  26547. req.Header = reqHeaders
  26548. googleapi.Expand(req.URL, map[string]string{
  26549. "profileId": strconv.FormatInt(c.profileId, 10),
  26550. "objectId": strconv.FormatInt(c.objectId, 10),
  26551. })
  26552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26553. }
  26554. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  26555. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  26556. gensupport.SetOptions(c.urlParams_, opts...)
  26557. res, err := c.doRequest("json")
  26558. if err != nil {
  26559. return err
  26560. }
  26561. defer googleapi.CloseBody(res)
  26562. if err := googleapi.CheckResponse(res); err != nil {
  26563. return err
  26564. }
  26565. return nil
  26566. // {
  26567. // "description": "Deletes an existing dynamic targeting key.",
  26568. // "httpMethod": "DELETE",
  26569. // "id": "dfareporting.dynamicTargetingKeys.delete",
  26570. // "parameterOrder": [
  26571. // "profileId",
  26572. // "objectId",
  26573. // "name",
  26574. // "objectType"
  26575. // ],
  26576. // "parameters": {
  26577. // "name": {
  26578. // "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.",
  26579. // "location": "query",
  26580. // "required": true,
  26581. // "type": "string"
  26582. // },
  26583. // "objectId": {
  26584. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  26585. // "format": "int64",
  26586. // "location": "path",
  26587. // "required": true,
  26588. // "type": "string"
  26589. // },
  26590. // "objectType": {
  26591. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  26592. // "enum": [
  26593. // "OBJECT_AD",
  26594. // "OBJECT_ADVERTISER",
  26595. // "OBJECT_CREATIVE",
  26596. // "OBJECT_PLACEMENT"
  26597. // ],
  26598. // "enumDescriptions": [
  26599. // "",
  26600. // "",
  26601. // "",
  26602. // ""
  26603. // ],
  26604. // "location": "query",
  26605. // "required": true,
  26606. // "type": "string"
  26607. // },
  26608. // "profileId": {
  26609. // "description": "User profile ID associated with this request.",
  26610. // "format": "int64",
  26611. // "location": "path",
  26612. // "required": true,
  26613. // "type": "string"
  26614. // }
  26615. // },
  26616. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  26617. // "scopes": [
  26618. // "https://www.googleapis.com/auth/dfatrafficking"
  26619. // ]
  26620. // }
  26621. }
  26622. // method id "dfareporting.dynamicTargetingKeys.insert":
  26623. type DynamicTargetingKeysInsertCall struct {
  26624. s *Service
  26625. profileId int64
  26626. dynamictargetingkey *DynamicTargetingKey
  26627. urlParams_ gensupport.URLParams
  26628. ctx_ context.Context
  26629. header_ http.Header
  26630. }
  26631. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  26632. // the advertiser level before being assigned to the advertiser's ads,
  26633. // creatives, or placements. There is a maximum of 1000 keys per
  26634. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  26635. // creative, or placement.
  26636. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  26637. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26638. c.profileId = profileId
  26639. c.dynamictargetingkey = dynamictargetingkey
  26640. return c
  26641. }
  26642. // Fields allows partial responses to be retrieved. See
  26643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26644. // for more information.
  26645. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  26646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26647. return c
  26648. }
  26649. // Context sets the context to be used in this call's Do method. Any
  26650. // pending HTTP request will be aborted if the provided context is
  26651. // canceled.
  26652. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  26653. c.ctx_ = ctx
  26654. return c
  26655. }
  26656. // Header returns an http.Header that can be modified by the caller to
  26657. // add HTTP headers to the request.
  26658. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  26659. if c.header_ == nil {
  26660. c.header_ = make(http.Header)
  26661. }
  26662. return c.header_
  26663. }
  26664. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  26665. reqHeaders := make(http.Header)
  26666. for k, v := range c.header_ {
  26667. reqHeaders[k] = v
  26668. }
  26669. reqHeaders.Set("User-Agent", c.s.userAgent())
  26670. var body io.Reader = nil
  26671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  26672. if err != nil {
  26673. return nil, err
  26674. }
  26675. reqHeaders.Set("Content-Type", "application/json")
  26676. c.urlParams_.Set("alt", alt)
  26677. c.urlParams_.Set("prettyPrint", "false")
  26678. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26679. urls += "?" + c.urlParams_.Encode()
  26680. req, err := http.NewRequest("POST", urls, body)
  26681. if err != nil {
  26682. return nil, err
  26683. }
  26684. req.Header = reqHeaders
  26685. googleapi.Expand(req.URL, map[string]string{
  26686. "profileId": strconv.FormatInt(c.profileId, 10),
  26687. })
  26688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26689. }
  26690. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  26691. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  26692. // non-2xx status code is an error. Response headers are in either
  26693. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  26694. // returned at all) in error.(*googleapi.Error).Header. Use
  26695. // googleapi.IsNotModified to check whether the returned error was
  26696. // because http.StatusNotModified was returned.
  26697. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  26698. gensupport.SetOptions(c.urlParams_, opts...)
  26699. res, err := c.doRequest("json")
  26700. if res != nil && res.StatusCode == http.StatusNotModified {
  26701. if res.Body != nil {
  26702. res.Body.Close()
  26703. }
  26704. return nil, &googleapi.Error{
  26705. Code: res.StatusCode,
  26706. Header: res.Header,
  26707. }
  26708. }
  26709. if err != nil {
  26710. return nil, err
  26711. }
  26712. defer googleapi.CloseBody(res)
  26713. if err := googleapi.CheckResponse(res); err != nil {
  26714. return nil, err
  26715. }
  26716. ret := &DynamicTargetingKey{
  26717. ServerResponse: googleapi.ServerResponse{
  26718. Header: res.Header,
  26719. HTTPStatusCode: res.StatusCode,
  26720. },
  26721. }
  26722. target := &ret
  26723. if err := gensupport.DecodeResponse(target, res); err != nil {
  26724. return nil, err
  26725. }
  26726. return ret, nil
  26727. // {
  26728. // "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.",
  26729. // "httpMethod": "POST",
  26730. // "id": "dfareporting.dynamicTargetingKeys.insert",
  26731. // "parameterOrder": [
  26732. // "profileId"
  26733. // ],
  26734. // "parameters": {
  26735. // "profileId": {
  26736. // "description": "User profile ID associated with this request.",
  26737. // "format": "int64",
  26738. // "location": "path",
  26739. // "required": true,
  26740. // "type": "string"
  26741. // }
  26742. // },
  26743. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26744. // "request": {
  26745. // "$ref": "DynamicTargetingKey"
  26746. // },
  26747. // "response": {
  26748. // "$ref": "DynamicTargetingKey"
  26749. // },
  26750. // "scopes": [
  26751. // "https://www.googleapis.com/auth/dfatrafficking"
  26752. // ]
  26753. // }
  26754. }
  26755. // method id "dfareporting.dynamicTargetingKeys.list":
  26756. type DynamicTargetingKeysListCall struct {
  26757. s *Service
  26758. profileId int64
  26759. urlParams_ gensupport.URLParams
  26760. ifNoneMatch_ string
  26761. ctx_ context.Context
  26762. header_ http.Header
  26763. }
  26764. // List: Retrieves a list of dynamic targeting keys.
  26765. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  26766. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26767. c.profileId = profileId
  26768. return c
  26769. }
  26770. // AdvertiserId sets the optional parameter "advertiserId": Select only
  26771. // dynamic targeting keys whose object has this advertiser ID.
  26772. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  26773. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  26774. return c
  26775. }
  26776. // Names sets the optional parameter "names": Select only dynamic
  26777. // targeting keys exactly matching these names.
  26778. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  26779. c.urlParams_.SetMulti("names", append([]string{}, names...))
  26780. return c
  26781. }
  26782. // ObjectId sets the optional parameter "objectId": Select only dynamic
  26783. // targeting keys with this object ID.
  26784. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  26785. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  26786. return c
  26787. }
  26788. // ObjectType sets the optional parameter "objectType": Select only
  26789. // dynamic targeting keys with this object type.
  26790. //
  26791. // Possible values:
  26792. // "OBJECT_AD"
  26793. // "OBJECT_ADVERTISER"
  26794. // "OBJECT_CREATIVE"
  26795. // "OBJECT_PLACEMENT"
  26796. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  26797. c.urlParams_.Set("objectType", objectType)
  26798. return c
  26799. }
  26800. // Fields allows partial responses to be retrieved. See
  26801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26802. // for more information.
  26803. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  26804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26805. return c
  26806. }
  26807. // IfNoneMatch sets the optional parameter which makes the operation
  26808. // fail if the object's ETag matches the given value. This is useful for
  26809. // getting updates only after the object has changed since the last
  26810. // request. Use googleapi.IsNotModified to check whether the response
  26811. // error from Do is the result of In-None-Match.
  26812. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  26813. c.ifNoneMatch_ = entityTag
  26814. return c
  26815. }
  26816. // Context sets the context to be used in this call's Do method. Any
  26817. // pending HTTP request will be aborted if the provided context is
  26818. // canceled.
  26819. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  26820. c.ctx_ = ctx
  26821. return c
  26822. }
  26823. // Header returns an http.Header that can be modified by the caller to
  26824. // add HTTP headers to the request.
  26825. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  26826. if c.header_ == nil {
  26827. c.header_ = make(http.Header)
  26828. }
  26829. return c.header_
  26830. }
  26831. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  26832. reqHeaders := make(http.Header)
  26833. for k, v := range c.header_ {
  26834. reqHeaders[k] = v
  26835. }
  26836. reqHeaders.Set("User-Agent", c.s.userAgent())
  26837. if c.ifNoneMatch_ != "" {
  26838. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26839. }
  26840. var body io.Reader = nil
  26841. c.urlParams_.Set("alt", alt)
  26842. c.urlParams_.Set("prettyPrint", "false")
  26843. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26844. urls += "?" + c.urlParams_.Encode()
  26845. req, err := http.NewRequest("GET", urls, body)
  26846. if err != nil {
  26847. return nil, err
  26848. }
  26849. req.Header = reqHeaders
  26850. googleapi.Expand(req.URL, map[string]string{
  26851. "profileId": strconv.FormatInt(c.profileId, 10),
  26852. })
  26853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26854. }
  26855. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  26856. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  26857. // non-nil. Any non-2xx status code is an error. Response headers are in
  26858. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  26859. // a response was returned at all) in error.(*googleapi.Error).Header.
  26860. // Use googleapi.IsNotModified to check whether the returned error was
  26861. // because http.StatusNotModified was returned.
  26862. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  26863. gensupport.SetOptions(c.urlParams_, opts...)
  26864. res, err := c.doRequest("json")
  26865. if res != nil && res.StatusCode == http.StatusNotModified {
  26866. if res.Body != nil {
  26867. res.Body.Close()
  26868. }
  26869. return nil, &googleapi.Error{
  26870. Code: res.StatusCode,
  26871. Header: res.Header,
  26872. }
  26873. }
  26874. if err != nil {
  26875. return nil, err
  26876. }
  26877. defer googleapi.CloseBody(res)
  26878. if err := googleapi.CheckResponse(res); err != nil {
  26879. return nil, err
  26880. }
  26881. ret := &DynamicTargetingKeysListResponse{
  26882. ServerResponse: googleapi.ServerResponse{
  26883. Header: res.Header,
  26884. HTTPStatusCode: res.StatusCode,
  26885. },
  26886. }
  26887. target := &ret
  26888. if err := gensupport.DecodeResponse(target, res); err != nil {
  26889. return nil, err
  26890. }
  26891. return ret, nil
  26892. // {
  26893. // "description": "Retrieves a list of dynamic targeting keys.",
  26894. // "httpMethod": "GET",
  26895. // "id": "dfareporting.dynamicTargetingKeys.list",
  26896. // "parameterOrder": [
  26897. // "profileId"
  26898. // ],
  26899. // "parameters": {
  26900. // "advertiserId": {
  26901. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  26902. // "format": "int64",
  26903. // "location": "query",
  26904. // "type": "string"
  26905. // },
  26906. // "names": {
  26907. // "description": "Select only dynamic targeting keys exactly matching these names.",
  26908. // "location": "query",
  26909. // "repeated": true,
  26910. // "type": "string"
  26911. // },
  26912. // "objectId": {
  26913. // "description": "Select only dynamic targeting keys with this object ID.",
  26914. // "format": "int64",
  26915. // "location": "query",
  26916. // "type": "string"
  26917. // },
  26918. // "objectType": {
  26919. // "description": "Select only dynamic targeting keys with this object type.",
  26920. // "enum": [
  26921. // "OBJECT_AD",
  26922. // "OBJECT_ADVERTISER",
  26923. // "OBJECT_CREATIVE",
  26924. // "OBJECT_PLACEMENT"
  26925. // ],
  26926. // "enumDescriptions": [
  26927. // "",
  26928. // "",
  26929. // "",
  26930. // ""
  26931. // ],
  26932. // "location": "query",
  26933. // "type": "string"
  26934. // },
  26935. // "profileId": {
  26936. // "description": "User profile ID associated with this request.",
  26937. // "format": "int64",
  26938. // "location": "path",
  26939. // "required": true,
  26940. // "type": "string"
  26941. // }
  26942. // },
  26943. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26944. // "response": {
  26945. // "$ref": "DynamicTargetingKeysListResponse"
  26946. // },
  26947. // "scopes": [
  26948. // "https://www.googleapis.com/auth/dfatrafficking"
  26949. // ]
  26950. // }
  26951. }
  26952. // method id "dfareporting.eventTags.delete":
  26953. type EventTagsDeleteCall struct {
  26954. s *Service
  26955. profileId int64
  26956. id int64
  26957. urlParams_ gensupport.URLParams
  26958. ctx_ context.Context
  26959. header_ http.Header
  26960. }
  26961. // Delete: Deletes an existing event tag.
  26962. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  26963. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26964. c.profileId = profileId
  26965. c.id = id
  26966. return c
  26967. }
  26968. // Fields allows partial responses to be retrieved. See
  26969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26970. // for more information.
  26971. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  26972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26973. return c
  26974. }
  26975. // Context sets the context to be used in this call's Do method. Any
  26976. // pending HTTP request will be aborted if the provided context is
  26977. // canceled.
  26978. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  26979. c.ctx_ = ctx
  26980. return c
  26981. }
  26982. // Header returns an http.Header that can be modified by the caller to
  26983. // add HTTP headers to the request.
  26984. func (c *EventTagsDeleteCall) Header() http.Header {
  26985. if c.header_ == nil {
  26986. c.header_ = make(http.Header)
  26987. }
  26988. return c.header_
  26989. }
  26990. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  26991. reqHeaders := make(http.Header)
  26992. for k, v := range c.header_ {
  26993. reqHeaders[k] = v
  26994. }
  26995. reqHeaders.Set("User-Agent", c.s.userAgent())
  26996. var body io.Reader = nil
  26997. c.urlParams_.Set("alt", alt)
  26998. c.urlParams_.Set("prettyPrint", "false")
  26999. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27000. urls += "?" + c.urlParams_.Encode()
  27001. req, err := http.NewRequest("DELETE", urls, body)
  27002. if err != nil {
  27003. return nil, err
  27004. }
  27005. req.Header = reqHeaders
  27006. googleapi.Expand(req.URL, map[string]string{
  27007. "profileId": strconv.FormatInt(c.profileId, 10),
  27008. "id": strconv.FormatInt(c.id, 10),
  27009. })
  27010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27011. }
  27012. // Do executes the "dfareporting.eventTags.delete" call.
  27013. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  27014. gensupport.SetOptions(c.urlParams_, opts...)
  27015. res, err := c.doRequest("json")
  27016. if err != nil {
  27017. return err
  27018. }
  27019. defer googleapi.CloseBody(res)
  27020. if err := googleapi.CheckResponse(res); err != nil {
  27021. return err
  27022. }
  27023. return nil
  27024. // {
  27025. // "description": "Deletes an existing event tag.",
  27026. // "httpMethod": "DELETE",
  27027. // "id": "dfareporting.eventTags.delete",
  27028. // "parameterOrder": [
  27029. // "profileId",
  27030. // "id"
  27031. // ],
  27032. // "parameters": {
  27033. // "id": {
  27034. // "description": "Event tag ID.",
  27035. // "format": "int64",
  27036. // "location": "path",
  27037. // "required": true,
  27038. // "type": "string"
  27039. // },
  27040. // "profileId": {
  27041. // "description": "User profile ID associated with this request.",
  27042. // "format": "int64",
  27043. // "location": "path",
  27044. // "required": true,
  27045. // "type": "string"
  27046. // }
  27047. // },
  27048. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27049. // "scopes": [
  27050. // "https://www.googleapis.com/auth/dfatrafficking"
  27051. // ]
  27052. // }
  27053. }
  27054. // method id "dfareporting.eventTags.get":
  27055. type EventTagsGetCall struct {
  27056. s *Service
  27057. profileId int64
  27058. id int64
  27059. urlParams_ gensupport.URLParams
  27060. ifNoneMatch_ string
  27061. ctx_ context.Context
  27062. header_ http.Header
  27063. }
  27064. // Get: Gets one event tag by ID.
  27065. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  27066. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27067. c.profileId = profileId
  27068. c.id = id
  27069. return c
  27070. }
  27071. // Fields allows partial responses to be retrieved. See
  27072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27073. // for more information.
  27074. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  27075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27076. return c
  27077. }
  27078. // IfNoneMatch sets the optional parameter which makes the operation
  27079. // fail if the object's ETag matches the given value. This is useful for
  27080. // getting updates only after the object has changed since the last
  27081. // request. Use googleapi.IsNotModified to check whether the response
  27082. // error from Do is the result of In-None-Match.
  27083. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  27084. c.ifNoneMatch_ = entityTag
  27085. return c
  27086. }
  27087. // Context sets the context to be used in this call's Do method. Any
  27088. // pending HTTP request will be aborted if the provided context is
  27089. // canceled.
  27090. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  27091. c.ctx_ = ctx
  27092. return c
  27093. }
  27094. // Header returns an http.Header that can be modified by the caller to
  27095. // add HTTP headers to the request.
  27096. func (c *EventTagsGetCall) Header() http.Header {
  27097. if c.header_ == nil {
  27098. c.header_ = make(http.Header)
  27099. }
  27100. return c.header_
  27101. }
  27102. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  27103. reqHeaders := make(http.Header)
  27104. for k, v := range c.header_ {
  27105. reqHeaders[k] = v
  27106. }
  27107. reqHeaders.Set("User-Agent", c.s.userAgent())
  27108. if c.ifNoneMatch_ != "" {
  27109. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27110. }
  27111. var body io.Reader = nil
  27112. c.urlParams_.Set("alt", alt)
  27113. c.urlParams_.Set("prettyPrint", "false")
  27114. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27115. urls += "?" + c.urlParams_.Encode()
  27116. req, err := http.NewRequest("GET", urls, body)
  27117. if err != nil {
  27118. return nil, err
  27119. }
  27120. req.Header = reqHeaders
  27121. googleapi.Expand(req.URL, map[string]string{
  27122. "profileId": strconv.FormatInt(c.profileId, 10),
  27123. "id": strconv.FormatInt(c.id, 10),
  27124. })
  27125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27126. }
  27127. // Do executes the "dfareporting.eventTags.get" call.
  27128. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27129. // code is an error. Response headers are in either
  27130. // *EventTag.ServerResponse.Header or (if a response was returned at
  27131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27132. // to check whether the returned error was because
  27133. // http.StatusNotModified was returned.
  27134. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27135. gensupport.SetOptions(c.urlParams_, opts...)
  27136. res, err := c.doRequest("json")
  27137. if res != nil && res.StatusCode == http.StatusNotModified {
  27138. if res.Body != nil {
  27139. res.Body.Close()
  27140. }
  27141. return nil, &googleapi.Error{
  27142. Code: res.StatusCode,
  27143. Header: res.Header,
  27144. }
  27145. }
  27146. if err != nil {
  27147. return nil, err
  27148. }
  27149. defer googleapi.CloseBody(res)
  27150. if err := googleapi.CheckResponse(res); err != nil {
  27151. return nil, err
  27152. }
  27153. ret := &EventTag{
  27154. ServerResponse: googleapi.ServerResponse{
  27155. Header: res.Header,
  27156. HTTPStatusCode: res.StatusCode,
  27157. },
  27158. }
  27159. target := &ret
  27160. if err := gensupport.DecodeResponse(target, res); err != nil {
  27161. return nil, err
  27162. }
  27163. return ret, nil
  27164. // {
  27165. // "description": "Gets one event tag by ID.",
  27166. // "httpMethod": "GET",
  27167. // "id": "dfareporting.eventTags.get",
  27168. // "parameterOrder": [
  27169. // "profileId",
  27170. // "id"
  27171. // ],
  27172. // "parameters": {
  27173. // "id": {
  27174. // "description": "Event tag ID.",
  27175. // "format": "int64",
  27176. // "location": "path",
  27177. // "required": true,
  27178. // "type": "string"
  27179. // },
  27180. // "profileId": {
  27181. // "description": "User profile ID associated with this request.",
  27182. // "format": "int64",
  27183. // "location": "path",
  27184. // "required": true,
  27185. // "type": "string"
  27186. // }
  27187. // },
  27188. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27189. // "response": {
  27190. // "$ref": "EventTag"
  27191. // },
  27192. // "scopes": [
  27193. // "https://www.googleapis.com/auth/dfatrafficking"
  27194. // ]
  27195. // }
  27196. }
  27197. // method id "dfareporting.eventTags.insert":
  27198. type EventTagsInsertCall struct {
  27199. s *Service
  27200. profileId int64
  27201. eventtag *EventTag
  27202. urlParams_ gensupport.URLParams
  27203. ctx_ context.Context
  27204. header_ http.Header
  27205. }
  27206. // Insert: Inserts a new event tag.
  27207. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  27208. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27209. c.profileId = profileId
  27210. c.eventtag = eventtag
  27211. return c
  27212. }
  27213. // Fields allows partial responses to be retrieved. See
  27214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27215. // for more information.
  27216. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  27217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27218. return c
  27219. }
  27220. // Context sets the context to be used in this call's Do method. Any
  27221. // pending HTTP request will be aborted if the provided context is
  27222. // canceled.
  27223. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  27224. c.ctx_ = ctx
  27225. return c
  27226. }
  27227. // Header returns an http.Header that can be modified by the caller to
  27228. // add HTTP headers to the request.
  27229. func (c *EventTagsInsertCall) Header() http.Header {
  27230. if c.header_ == nil {
  27231. c.header_ = make(http.Header)
  27232. }
  27233. return c.header_
  27234. }
  27235. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  27236. reqHeaders := make(http.Header)
  27237. for k, v := range c.header_ {
  27238. reqHeaders[k] = v
  27239. }
  27240. reqHeaders.Set("User-Agent", c.s.userAgent())
  27241. var body io.Reader = nil
  27242. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27243. if err != nil {
  27244. return nil, err
  27245. }
  27246. reqHeaders.Set("Content-Type", "application/json")
  27247. c.urlParams_.Set("alt", alt)
  27248. c.urlParams_.Set("prettyPrint", "false")
  27249. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27250. urls += "?" + c.urlParams_.Encode()
  27251. req, err := http.NewRequest("POST", urls, body)
  27252. if err != nil {
  27253. return nil, err
  27254. }
  27255. req.Header = reqHeaders
  27256. googleapi.Expand(req.URL, map[string]string{
  27257. "profileId": strconv.FormatInt(c.profileId, 10),
  27258. })
  27259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27260. }
  27261. // Do executes the "dfareporting.eventTags.insert" call.
  27262. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27263. // code is an error. Response headers are in either
  27264. // *EventTag.ServerResponse.Header or (if a response was returned at
  27265. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27266. // to check whether the returned error was because
  27267. // http.StatusNotModified was returned.
  27268. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27269. gensupport.SetOptions(c.urlParams_, opts...)
  27270. res, err := c.doRequest("json")
  27271. if res != nil && res.StatusCode == http.StatusNotModified {
  27272. if res.Body != nil {
  27273. res.Body.Close()
  27274. }
  27275. return nil, &googleapi.Error{
  27276. Code: res.StatusCode,
  27277. Header: res.Header,
  27278. }
  27279. }
  27280. if err != nil {
  27281. return nil, err
  27282. }
  27283. defer googleapi.CloseBody(res)
  27284. if err := googleapi.CheckResponse(res); err != nil {
  27285. return nil, err
  27286. }
  27287. ret := &EventTag{
  27288. ServerResponse: googleapi.ServerResponse{
  27289. Header: res.Header,
  27290. HTTPStatusCode: res.StatusCode,
  27291. },
  27292. }
  27293. target := &ret
  27294. if err := gensupport.DecodeResponse(target, res); err != nil {
  27295. return nil, err
  27296. }
  27297. return ret, nil
  27298. // {
  27299. // "description": "Inserts a new event tag.",
  27300. // "httpMethod": "POST",
  27301. // "id": "dfareporting.eventTags.insert",
  27302. // "parameterOrder": [
  27303. // "profileId"
  27304. // ],
  27305. // "parameters": {
  27306. // "profileId": {
  27307. // "description": "User profile ID associated with this request.",
  27308. // "format": "int64",
  27309. // "location": "path",
  27310. // "required": true,
  27311. // "type": "string"
  27312. // }
  27313. // },
  27314. // "path": "userprofiles/{profileId}/eventTags",
  27315. // "request": {
  27316. // "$ref": "EventTag"
  27317. // },
  27318. // "response": {
  27319. // "$ref": "EventTag"
  27320. // },
  27321. // "scopes": [
  27322. // "https://www.googleapis.com/auth/dfatrafficking"
  27323. // ]
  27324. // }
  27325. }
  27326. // method id "dfareporting.eventTags.list":
  27327. type EventTagsListCall struct {
  27328. s *Service
  27329. profileId int64
  27330. urlParams_ gensupport.URLParams
  27331. ifNoneMatch_ string
  27332. ctx_ context.Context
  27333. header_ http.Header
  27334. }
  27335. // List: Retrieves a list of event tags, possibly filtered.
  27336. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  27337. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27338. c.profileId = profileId
  27339. return c
  27340. }
  27341. // AdId sets the optional parameter "adId": Select only event tags that
  27342. // belong to this ad.
  27343. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  27344. c.urlParams_.Set("adId", fmt.Sprint(adId))
  27345. return c
  27346. }
  27347. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27348. // event tags that belong to this advertiser.
  27349. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  27350. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27351. return c
  27352. }
  27353. // CampaignId sets the optional parameter "campaignId": Select only
  27354. // event tags that belong to this campaign.
  27355. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  27356. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  27357. return c
  27358. }
  27359. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  27360. // Examine only the specified campaign or advertiser's event tags for
  27361. // matching selector criteria. When set to false, the parent advertiser
  27362. // and parent campaign of the specified ad or campaign is examined as
  27363. // well. In addition, when set to false, the status field is examined as
  27364. // well, along with the enabledByDefault field. This parameter can not
  27365. // be set to true when adId is specified as ads do not define their own
  27366. // even tags.
  27367. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  27368. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  27369. return c
  27370. }
  27371. // Enabled sets the optional parameter "enabled": Select only enabled
  27372. // event tags. What is considered enabled or disabled depends on the
  27373. // definitionsOnly parameter. When definitionsOnly is set to true, only
  27374. // the specified advertiser or campaign's event tags' enabledByDefault
  27375. // field is examined. When definitionsOnly is set to false, the
  27376. // specified ad or specified campaign's parent advertiser's or parent
  27377. // campaign's event tags' enabledByDefault and status fields are
  27378. // examined as well.
  27379. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  27380. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  27381. return c
  27382. }
  27383. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  27384. // only event tags with the specified event tag types. Event tag types
  27385. // can be used to specify whether to use a third-party pixel, a
  27386. // third-party JavaScript URL, or a third-party click-through URL for
  27387. // either impression or click tracking.
  27388. //
  27389. // Possible values:
  27390. // "CLICK_THROUGH_EVENT_TAG"
  27391. // "IMPRESSION_IMAGE_EVENT_TAG"
  27392. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27393. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  27394. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  27395. return c
  27396. }
  27397. // Ids sets the optional parameter "ids": Select only event tags with
  27398. // these IDs.
  27399. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  27400. var ids_ []string
  27401. for _, v := range ids {
  27402. ids_ = append(ids_, fmt.Sprint(v))
  27403. }
  27404. c.urlParams_.SetMulti("ids", ids_)
  27405. return c
  27406. }
  27407. // SearchString sets the optional parameter "searchString": Allows
  27408. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27409. // example, "eventtag*2015" will return objects with names like
  27410. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  27411. // 2015". Most of the searches also add wildcards implicitly at the
  27412. // start and the end of the search string. For example, a search string
  27413. // of "eventtag" will match objects with name "my eventtag", "eventtag
  27414. // 2015", or simply "eventtag".
  27415. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  27416. c.urlParams_.Set("searchString", searchString)
  27417. return c
  27418. }
  27419. // SortField sets the optional parameter "sortField": Field by which to
  27420. // sort the list.
  27421. //
  27422. // Possible values:
  27423. // "ID" (default)
  27424. // "NAME"
  27425. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  27426. c.urlParams_.Set("sortField", sortField)
  27427. return c
  27428. }
  27429. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27430. // results.
  27431. //
  27432. // Possible values:
  27433. // "ASCENDING" (default)
  27434. // "DESCENDING"
  27435. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  27436. c.urlParams_.Set("sortOrder", sortOrder)
  27437. return c
  27438. }
  27439. // Fields allows partial responses to be retrieved. See
  27440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27441. // for more information.
  27442. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  27443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27444. return c
  27445. }
  27446. // IfNoneMatch sets the optional parameter which makes the operation
  27447. // fail if the object's ETag matches the given value. This is useful for
  27448. // getting updates only after the object has changed since the last
  27449. // request. Use googleapi.IsNotModified to check whether the response
  27450. // error from Do is the result of In-None-Match.
  27451. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  27452. c.ifNoneMatch_ = entityTag
  27453. return c
  27454. }
  27455. // Context sets the context to be used in this call's Do method. Any
  27456. // pending HTTP request will be aborted if the provided context is
  27457. // canceled.
  27458. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  27459. c.ctx_ = ctx
  27460. return c
  27461. }
  27462. // Header returns an http.Header that can be modified by the caller to
  27463. // add HTTP headers to the request.
  27464. func (c *EventTagsListCall) Header() http.Header {
  27465. if c.header_ == nil {
  27466. c.header_ = make(http.Header)
  27467. }
  27468. return c.header_
  27469. }
  27470. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  27471. reqHeaders := make(http.Header)
  27472. for k, v := range c.header_ {
  27473. reqHeaders[k] = v
  27474. }
  27475. reqHeaders.Set("User-Agent", c.s.userAgent())
  27476. if c.ifNoneMatch_ != "" {
  27477. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27478. }
  27479. var body io.Reader = nil
  27480. c.urlParams_.Set("alt", alt)
  27481. c.urlParams_.Set("prettyPrint", "false")
  27482. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27483. urls += "?" + c.urlParams_.Encode()
  27484. req, err := http.NewRequest("GET", urls, body)
  27485. if err != nil {
  27486. return nil, err
  27487. }
  27488. req.Header = reqHeaders
  27489. googleapi.Expand(req.URL, map[string]string{
  27490. "profileId": strconv.FormatInt(c.profileId, 10),
  27491. })
  27492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27493. }
  27494. // Do executes the "dfareporting.eventTags.list" call.
  27495. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  27496. // non-2xx status code is an error. Response headers are in either
  27497. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  27498. // returned at all) in error.(*googleapi.Error).Header. Use
  27499. // googleapi.IsNotModified to check whether the returned error was
  27500. // because http.StatusNotModified was returned.
  27501. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  27502. gensupport.SetOptions(c.urlParams_, opts...)
  27503. res, err := c.doRequest("json")
  27504. if res != nil && res.StatusCode == http.StatusNotModified {
  27505. if res.Body != nil {
  27506. res.Body.Close()
  27507. }
  27508. return nil, &googleapi.Error{
  27509. Code: res.StatusCode,
  27510. Header: res.Header,
  27511. }
  27512. }
  27513. if err != nil {
  27514. return nil, err
  27515. }
  27516. defer googleapi.CloseBody(res)
  27517. if err := googleapi.CheckResponse(res); err != nil {
  27518. return nil, err
  27519. }
  27520. ret := &EventTagsListResponse{
  27521. ServerResponse: googleapi.ServerResponse{
  27522. Header: res.Header,
  27523. HTTPStatusCode: res.StatusCode,
  27524. },
  27525. }
  27526. target := &ret
  27527. if err := gensupport.DecodeResponse(target, res); err != nil {
  27528. return nil, err
  27529. }
  27530. return ret, nil
  27531. // {
  27532. // "description": "Retrieves a list of event tags, possibly filtered.",
  27533. // "httpMethod": "GET",
  27534. // "id": "dfareporting.eventTags.list",
  27535. // "parameterOrder": [
  27536. // "profileId"
  27537. // ],
  27538. // "parameters": {
  27539. // "adId": {
  27540. // "description": "Select only event tags that belong to this ad.",
  27541. // "format": "int64",
  27542. // "location": "query",
  27543. // "type": "string"
  27544. // },
  27545. // "advertiserId": {
  27546. // "description": "Select only event tags that belong to this advertiser.",
  27547. // "format": "int64",
  27548. // "location": "query",
  27549. // "type": "string"
  27550. // },
  27551. // "campaignId": {
  27552. // "description": "Select only event tags that belong to this campaign.",
  27553. // "format": "int64",
  27554. // "location": "query",
  27555. // "type": "string"
  27556. // },
  27557. // "definitionsOnly": {
  27558. // "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.",
  27559. // "location": "query",
  27560. // "type": "boolean"
  27561. // },
  27562. // "enabled": {
  27563. // "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.",
  27564. // "location": "query",
  27565. // "type": "boolean"
  27566. // },
  27567. // "eventTagTypes": {
  27568. // "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.",
  27569. // "enum": [
  27570. // "CLICK_THROUGH_EVENT_TAG",
  27571. // "IMPRESSION_IMAGE_EVENT_TAG",
  27572. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27573. // ],
  27574. // "enumDescriptions": [
  27575. // "",
  27576. // "",
  27577. // ""
  27578. // ],
  27579. // "location": "query",
  27580. // "repeated": true,
  27581. // "type": "string"
  27582. // },
  27583. // "ids": {
  27584. // "description": "Select only event tags with these IDs.",
  27585. // "format": "int64",
  27586. // "location": "query",
  27587. // "repeated": true,
  27588. // "type": "string"
  27589. // },
  27590. // "profileId": {
  27591. // "description": "User profile ID associated with this request.",
  27592. // "format": "int64",
  27593. // "location": "path",
  27594. // "required": true,
  27595. // "type": "string"
  27596. // },
  27597. // "searchString": {
  27598. // "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\".",
  27599. // "location": "query",
  27600. // "type": "string"
  27601. // },
  27602. // "sortField": {
  27603. // "default": "ID",
  27604. // "description": "Field by which to sort the list.",
  27605. // "enum": [
  27606. // "ID",
  27607. // "NAME"
  27608. // ],
  27609. // "enumDescriptions": [
  27610. // "",
  27611. // ""
  27612. // ],
  27613. // "location": "query",
  27614. // "type": "string"
  27615. // },
  27616. // "sortOrder": {
  27617. // "default": "ASCENDING",
  27618. // "description": "Order of sorted results.",
  27619. // "enum": [
  27620. // "ASCENDING",
  27621. // "DESCENDING"
  27622. // ],
  27623. // "enumDescriptions": [
  27624. // "",
  27625. // ""
  27626. // ],
  27627. // "location": "query",
  27628. // "type": "string"
  27629. // }
  27630. // },
  27631. // "path": "userprofiles/{profileId}/eventTags",
  27632. // "response": {
  27633. // "$ref": "EventTagsListResponse"
  27634. // },
  27635. // "scopes": [
  27636. // "https://www.googleapis.com/auth/dfatrafficking"
  27637. // ]
  27638. // }
  27639. }
  27640. // method id "dfareporting.eventTags.patch":
  27641. type EventTagsPatchCall struct {
  27642. s *Service
  27643. profileId int64
  27644. eventtag *EventTag
  27645. urlParams_ gensupport.URLParams
  27646. ctx_ context.Context
  27647. header_ http.Header
  27648. }
  27649. // Patch: Updates an existing event tag. This method supports patch
  27650. // semantics.
  27651. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  27652. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27653. c.profileId = profileId
  27654. c.urlParams_.Set("id", fmt.Sprint(id))
  27655. c.eventtag = eventtag
  27656. return c
  27657. }
  27658. // Fields allows partial responses to be retrieved. See
  27659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27660. // for more information.
  27661. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  27662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27663. return c
  27664. }
  27665. // Context sets the context to be used in this call's Do method. Any
  27666. // pending HTTP request will be aborted if the provided context is
  27667. // canceled.
  27668. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  27669. c.ctx_ = ctx
  27670. return c
  27671. }
  27672. // Header returns an http.Header that can be modified by the caller to
  27673. // add HTTP headers to the request.
  27674. func (c *EventTagsPatchCall) Header() http.Header {
  27675. if c.header_ == nil {
  27676. c.header_ = make(http.Header)
  27677. }
  27678. return c.header_
  27679. }
  27680. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  27681. reqHeaders := make(http.Header)
  27682. for k, v := range c.header_ {
  27683. reqHeaders[k] = v
  27684. }
  27685. reqHeaders.Set("User-Agent", c.s.userAgent())
  27686. var body io.Reader = nil
  27687. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27688. if err != nil {
  27689. return nil, err
  27690. }
  27691. reqHeaders.Set("Content-Type", "application/json")
  27692. c.urlParams_.Set("alt", alt)
  27693. c.urlParams_.Set("prettyPrint", "false")
  27694. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27695. urls += "?" + c.urlParams_.Encode()
  27696. req, err := http.NewRequest("PATCH", urls, body)
  27697. if err != nil {
  27698. return nil, err
  27699. }
  27700. req.Header = reqHeaders
  27701. googleapi.Expand(req.URL, map[string]string{
  27702. "profileId": strconv.FormatInt(c.profileId, 10),
  27703. })
  27704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27705. }
  27706. // Do executes the "dfareporting.eventTags.patch" call.
  27707. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27708. // code is an error. Response headers are in either
  27709. // *EventTag.ServerResponse.Header or (if a response was returned at
  27710. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27711. // to check whether the returned error was because
  27712. // http.StatusNotModified was returned.
  27713. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27714. gensupport.SetOptions(c.urlParams_, opts...)
  27715. res, err := c.doRequest("json")
  27716. if res != nil && res.StatusCode == http.StatusNotModified {
  27717. if res.Body != nil {
  27718. res.Body.Close()
  27719. }
  27720. return nil, &googleapi.Error{
  27721. Code: res.StatusCode,
  27722. Header: res.Header,
  27723. }
  27724. }
  27725. if err != nil {
  27726. return nil, err
  27727. }
  27728. defer googleapi.CloseBody(res)
  27729. if err := googleapi.CheckResponse(res); err != nil {
  27730. return nil, err
  27731. }
  27732. ret := &EventTag{
  27733. ServerResponse: googleapi.ServerResponse{
  27734. Header: res.Header,
  27735. HTTPStatusCode: res.StatusCode,
  27736. },
  27737. }
  27738. target := &ret
  27739. if err := gensupport.DecodeResponse(target, res); err != nil {
  27740. return nil, err
  27741. }
  27742. return ret, nil
  27743. // {
  27744. // "description": "Updates an existing event tag. This method supports patch semantics.",
  27745. // "httpMethod": "PATCH",
  27746. // "id": "dfareporting.eventTags.patch",
  27747. // "parameterOrder": [
  27748. // "profileId",
  27749. // "id"
  27750. // ],
  27751. // "parameters": {
  27752. // "id": {
  27753. // "description": "Event tag ID.",
  27754. // "format": "int64",
  27755. // "location": "query",
  27756. // "required": true,
  27757. // "type": "string"
  27758. // },
  27759. // "profileId": {
  27760. // "description": "User profile ID associated with this request.",
  27761. // "format": "int64",
  27762. // "location": "path",
  27763. // "required": true,
  27764. // "type": "string"
  27765. // }
  27766. // },
  27767. // "path": "userprofiles/{profileId}/eventTags",
  27768. // "request": {
  27769. // "$ref": "EventTag"
  27770. // },
  27771. // "response": {
  27772. // "$ref": "EventTag"
  27773. // },
  27774. // "scopes": [
  27775. // "https://www.googleapis.com/auth/dfatrafficking"
  27776. // ]
  27777. // }
  27778. }
  27779. // method id "dfareporting.eventTags.update":
  27780. type EventTagsUpdateCall struct {
  27781. s *Service
  27782. profileId int64
  27783. eventtag *EventTag
  27784. urlParams_ gensupport.URLParams
  27785. ctx_ context.Context
  27786. header_ http.Header
  27787. }
  27788. // Update: Updates an existing event tag.
  27789. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  27790. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27791. c.profileId = profileId
  27792. c.eventtag = eventtag
  27793. return c
  27794. }
  27795. // Fields allows partial responses to be retrieved. See
  27796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27797. // for more information.
  27798. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  27799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27800. return c
  27801. }
  27802. // Context sets the context to be used in this call's Do method. Any
  27803. // pending HTTP request will be aborted if the provided context is
  27804. // canceled.
  27805. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  27806. c.ctx_ = ctx
  27807. return c
  27808. }
  27809. // Header returns an http.Header that can be modified by the caller to
  27810. // add HTTP headers to the request.
  27811. func (c *EventTagsUpdateCall) Header() http.Header {
  27812. if c.header_ == nil {
  27813. c.header_ = make(http.Header)
  27814. }
  27815. return c.header_
  27816. }
  27817. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  27818. reqHeaders := make(http.Header)
  27819. for k, v := range c.header_ {
  27820. reqHeaders[k] = v
  27821. }
  27822. reqHeaders.Set("User-Agent", c.s.userAgent())
  27823. var body io.Reader = nil
  27824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27825. if err != nil {
  27826. return nil, err
  27827. }
  27828. reqHeaders.Set("Content-Type", "application/json")
  27829. c.urlParams_.Set("alt", alt)
  27830. c.urlParams_.Set("prettyPrint", "false")
  27831. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27832. urls += "?" + c.urlParams_.Encode()
  27833. req, err := http.NewRequest("PUT", urls, body)
  27834. if err != nil {
  27835. return nil, err
  27836. }
  27837. req.Header = reqHeaders
  27838. googleapi.Expand(req.URL, map[string]string{
  27839. "profileId": strconv.FormatInt(c.profileId, 10),
  27840. })
  27841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27842. }
  27843. // Do executes the "dfareporting.eventTags.update" call.
  27844. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27845. // code is an error. Response headers are in either
  27846. // *EventTag.ServerResponse.Header or (if a response was returned at
  27847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27848. // to check whether the returned error was because
  27849. // http.StatusNotModified was returned.
  27850. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27851. gensupport.SetOptions(c.urlParams_, opts...)
  27852. res, err := c.doRequest("json")
  27853. if res != nil && res.StatusCode == http.StatusNotModified {
  27854. if res.Body != nil {
  27855. res.Body.Close()
  27856. }
  27857. return nil, &googleapi.Error{
  27858. Code: res.StatusCode,
  27859. Header: res.Header,
  27860. }
  27861. }
  27862. if err != nil {
  27863. return nil, err
  27864. }
  27865. defer googleapi.CloseBody(res)
  27866. if err := googleapi.CheckResponse(res); err != nil {
  27867. return nil, err
  27868. }
  27869. ret := &EventTag{
  27870. ServerResponse: googleapi.ServerResponse{
  27871. Header: res.Header,
  27872. HTTPStatusCode: res.StatusCode,
  27873. },
  27874. }
  27875. target := &ret
  27876. if err := gensupport.DecodeResponse(target, res); err != nil {
  27877. return nil, err
  27878. }
  27879. return ret, nil
  27880. // {
  27881. // "description": "Updates an existing event tag.",
  27882. // "httpMethod": "PUT",
  27883. // "id": "dfareporting.eventTags.update",
  27884. // "parameterOrder": [
  27885. // "profileId"
  27886. // ],
  27887. // "parameters": {
  27888. // "profileId": {
  27889. // "description": "User profile ID associated with this request.",
  27890. // "format": "int64",
  27891. // "location": "path",
  27892. // "required": true,
  27893. // "type": "string"
  27894. // }
  27895. // },
  27896. // "path": "userprofiles/{profileId}/eventTags",
  27897. // "request": {
  27898. // "$ref": "EventTag"
  27899. // },
  27900. // "response": {
  27901. // "$ref": "EventTag"
  27902. // },
  27903. // "scopes": [
  27904. // "https://www.googleapis.com/auth/dfatrafficking"
  27905. // ]
  27906. // }
  27907. }
  27908. // method id "dfareporting.files.get":
  27909. type FilesGetCall struct {
  27910. s *Service
  27911. reportId int64
  27912. fileId int64
  27913. urlParams_ gensupport.URLParams
  27914. ifNoneMatch_ string
  27915. ctx_ context.Context
  27916. header_ http.Header
  27917. }
  27918. // Get: Retrieves a report file by its report ID and file ID. This
  27919. // method supports media download.
  27920. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  27921. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27922. c.reportId = reportId
  27923. c.fileId = fileId
  27924. return c
  27925. }
  27926. // Fields allows partial responses to be retrieved. See
  27927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27928. // for more information.
  27929. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  27930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27931. return c
  27932. }
  27933. // IfNoneMatch sets the optional parameter which makes the operation
  27934. // fail if the object's ETag matches the given value. This is useful for
  27935. // getting updates only after the object has changed since the last
  27936. // request. Use googleapi.IsNotModified to check whether the response
  27937. // error from Do is the result of In-None-Match.
  27938. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  27939. c.ifNoneMatch_ = entityTag
  27940. return c
  27941. }
  27942. // Context sets the context to be used in this call's Do and Download
  27943. // methods. Any pending HTTP request will be aborted if the provided
  27944. // context is canceled.
  27945. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  27946. c.ctx_ = ctx
  27947. return c
  27948. }
  27949. // Header returns an http.Header that can be modified by the caller to
  27950. // add HTTP headers to the request.
  27951. func (c *FilesGetCall) Header() http.Header {
  27952. if c.header_ == nil {
  27953. c.header_ = make(http.Header)
  27954. }
  27955. return c.header_
  27956. }
  27957. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  27958. reqHeaders := make(http.Header)
  27959. for k, v := range c.header_ {
  27960. reqHeaders[k] = v
  27961. }
  27962. reqHeaders.Set("User-Agent", c.s.userAgent())
  27963. if c.ifNoneMatch_ != "" {
  27964. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27965. }
  27966. var body io.Reader = nil
  27967. c.urlParams_.Set("alt", alt)
  27968. c.urlParams_.Set("prettyPrint", "false")
  27969. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  27970. urls += "?" + c.urlParams_.Encode()
  27971. req, err := http.NewRequest("GET", urls, body)
  27972. if err != nil {
  27973. return nil, err
  27974. }
  27975. req.Header = reqHeaders
  27976. googleapi.Expand(req.URL, map[string]string{
  27977. "reportId": strconv.FormatInt(c.reportId, 10),
  27978. "fileId": strconv.FormatInt(c.fileId, 10),
  27979. })
  27980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27981. }
  27982. // Download fetches the API endpoint's "media" value, instead of the normal
  27983. // API response value. If the returned error is nil, the Response is guaranteed to
  27984. // have a 2xx status code. Callers must close the Response.Body as usual.
  27985. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  27986. gensupport.SetOptions(c.urlParams_, opts...)
  27987. res, err := c.doRequest("media")
  27988. if err != nil {
  27989. return nil, err
  27990. }
  27991. if err := googleapi.CheckMediaResponse(res); err != nil {
  27992. res.Body.Close()
  27993. return nil, err
  27994. }
  27995. return res, nil
  27996. }
  27997. // Do executes the "dfareporting.files.get" call.
  27998. // Exactly one of *File or error will be non-nil. Any non-2xx status
  27999. // code is an error. Response headers are in either
  28000. // *File.ServerResponse.Header or (if a response was returned at all) in
  28001. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28002. // whether the returned error was because http.StatusNotModified was
  28003. // returned.
  28004. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  28005. gensupport.SetOptions(c.urlParams_, opts...)
  28006. res, err := c.doRequest("json")
  28007. if res != nil && res.StatusCode == http.StatusNotModified {
  28008. if res.Body != nil {
  28009. res.Body.Close()
  28010. }
  28011. return nil, &googleapi.Error{
  28012. Code: res.StatusCode,
  28013. Header: res.Header,
  28014. }
  28015. }
  28016. if err != nil {
  28017. return nil, err
  28018. }
  28019. defer googleapi.CloseBody(res)
  28020. if err := googleapi.CheckResponse(res); err != nil {
  28021. return nil, err
  28022. }
  28023. ret := &File{
  28024. ServerResponse: googleapi.ServerResponse{
  28025. Header: res.Header,
  28026. HTTPStatusCode: res.StatusCode,
  28027. },
  28028. }
  28029. target := &ret
  28030. if err := gensupport.DecodeResponse(target, res); err != nil {
  28031. return nil, err
  28032. }
  28033. return ret, nil
  28034. // {
  28035. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  28036. // "httpMethod": "GET",
  28037. // "id": "dfareporting.files.get",
  28038. // "parameterOrder": [
  28039. // "reportId",
  28040. // "fileId"
  28041. // ],
  28042. // "parameters": {
  28043. // "fileId": {
  28044. // "description": "The ID of the report file.",
  28045. // "format": "int64",
  28046. // "location": "path",
  28047. // "required": true,
  28048. // "type": "string"
  28049. // },
  28050. // "reportId": {
  28051. // "description": "The ID of the report.",
  28052. // "format": "int64",
  28053. // "location": "path",
  28054. // "required": true,
  28055. // "type": "string"
  28056. // }
  28057. // },
  28058. // "path": "reports/{reportId}/files/{fileId}",
  28059. // "response": {
  28060. // "$ref": "File"
  28061. // },
  28062. // "scopes": [
  28063. // "https://www.googleapis.com/auth/dfareporting"
  28064. // ],
  28065. // "supportsMediaDownload": true
  28066. // }
  28067. }
  28068. // method id "dfareporting.files.list":
  28069. type FilesListCall struct {
  28070. s *Service
  28071. profileId int64
  28072. urlParams_ gensupport.URLParams
  28073. ifNoneMatch_ string
  28074. ctx_ context.Context
  28075. header_ http.Header
  28076. }
  28077. // List: Lists files for a user profile.
  28078. func (r *FilesService) List(profileId int64) *FilesListCall {
  28079. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28080. c.profileId = profileId
  28081. return c
  28082. }
  28083. // MaxResults sets the optional parameter "maxResults": Maximum number
  28084. // of results to return.
  28085. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  28086. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28087. return c
  28088. }
  28089. // PageToken sets the optional parameter "pageToken": The value of the
  28090. // nextToken from the previous result page.
  28091. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  28092. c.urlParams_.Set("pageToken", pageToken)
  28093. return c
  28094. }
  28095. // Scope sets the optional parameter "scope": The scope that defines
  28096. // which results are returned.
  28097. //
  28098. // Possible values:
  28099. // "ALL" - All files in account.
  28100. // "MINE" (default) - My files.
  28101. // "SHARED_WITH_ME" - Files shared with me.
  28102. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  28103. c.urlParams_.Set("scope", scope)
  28104. return c
  28105. }
  28106. // SortField sets the optional parameter "sortField": The field by which
  28107. // to sort the list.
  28108. //
  28109. // Possible values:
  28110. // "ID" - Sort by file ID.
  28111. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  28112. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  28113. c.urlParams_.Set("sortField", sortField)
  28114. return c
  28115. }
  28116. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28117. // results.
  28118. //
  28119. // Possible values:
  28120. // "ASCENDING" - Ascending order.
  28121. // "DESCENDING" (default) - Descending order.
  28122. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  28123. c.urlParams_.Set("sortOrder", sortOrder)
  28124. return c
  28125. }
  28126. // Fields allows partial responses to be retrieved. See
  28127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28128. // for more information.
  28129. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  28130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28131. return c
  28132. }
  28133. // IfNoneMatch sets the optional parameter which makes the operation
  28134. // fail if the object's ETag matches the given value. This is useful for
  28135. // getting updates only after the object has changed since the last
  28136. // request. Use googleapi.IsNotModified to check whether the response
  28137. // error from Do is the result of In-None-Match.
  28138. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  28139. c.ifNoneMatch_ = entityTag
  28140. return c
  28141. }
  28142. // Context sets the context to be used in this call's Do method. Any
  28143. // pending HTTP request will be aborted if the provided context is
  28144. // canceled.
  28145. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  28146. c.ctx_ = ctx
  28147. return c
  28148. }
  28149. // Header returns an http.Header that can be modified by the caller to
  28150. // add HTTP headers to the request.
  28151. func (c *FilesListCall) Header() http.Header {
  28152. if c.header_ == nil {
  28153. c.header_ = make(http.Header)
  28154. }
  28155. return c.header_
  28156. }
  28157. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  28158. reqHeaders := make(http.Header)
  28159. for k, v := range c.header_ {
  28160. reqHeaders[k] = v
  28161. }
  28162. reqHeaders.Set("User-Agent", c.s.userAgent())
  28163. if c.ifNoneMatch_ != "" {
  28164. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28165. }
  28166. var body io.Reader = nil
  28167. c.urlParams_.Set("alt", alt)
  28168. c.urlParams_.Set("prettyPrint", "false")
  28169. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  28170. urls += "?" + c.urlParams_.Encode()
  28171. req, err := http.NewRequest("GET", urls, body)
  28172. if err != nil {
  28173. return nil, err
  28174. }
  28175. req.Header = reqHeaders
  28176. googleapi.Expand(req.URL, map[string]string{
  28177. "profileId": strconv.FormatInt(c.profileId, 10),
  28178. })
  28179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28180. }
  28181. // Do executes the "dfareporting.files.list" call.
  28182. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  28183. // code is an error. Response headers are in either
  28184. // *FileList.ServerResponse.Header or (if a response was returned at
  28185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28186. // to check whether the returned error was because
  28187. // http.StatusNotModified was returned.
  28188. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  28189. gensupport.SetOptions(c.urlParams_, opts...)
  28190. res, err := c.doRequest("json")
  28191. if res != nil && res.StatusCode == http.StatusNotModified {
  28192. if res.Body != nil {
  28193. res.Body.Close()
  28194. }
  28195. return nil, &googleapi.Error{
  28196. Code: res.StatusCode,
  28197. Header: res.Header,
  28198. }
  28199. }
  28200. if err != nil {
  28201. return nil, err
  28202. }
  28203. defer googleapi.CloseBody(res)
  28204. if err := googleapi.CheckResponse(res); err != nil {
  28205. return nil, err
  28206. }
  28207. ret := &FileList{
  28208. ServerResponse: googleapi.ServerResponse{
  28209. Header: res.Header,
  28210. HTTPStatusCode: res.StatusCode,
  28211. },
  28212. }
  28213. target := &ret
  28214. if err := gensupport.DecodeResponse(target, res); err != nil {
  28215. return nil, err
  28216. }
  28217. return ret, nil
  28218. // {
  28219. // "description": "Lists files for a user profile.",
  28220. // "httpMethod": "GET",
  28221. // "id": "dfareporting.files.list",
  28222. // "parameterOrder": [
  28223. // "profileId"
  28224. // ],
  28225. // "parameters": {
  28226. // "maxResults": {
  28227. // "default": "10",
  28228. // "description": "Maximum number of results to return.",
  28229. // "format": "int32",
  28230. // "location": "query",
  28231. // "maximum": "10",
  28232. // "minimum": "0",
  28233. // "type": "integer"
  28234. // },
  28235. // "pageToken": {
  28236. // "description": "The value of the nextToken from the previous result page.",
  28237. // "location": "query",
  28238. // "type": "string"
  28239. // },
  28240. // "profileId": {
  28241. // "description": "The DFA profile ID.",
  28242. // "format": "int64",
  28243. // "location": "path",
  28244. // "required": true,
  28245. // "type": "string"
  28246. // },
  28247. // "scope": {
  28248. // "default": "MINE",
  28249. // "description": "The scope that defines which results are returned.",
  28250. // "enum": [
  28251. // "ALL",
  28252. // "MINE",
  28253. // "SHARED_WITH_ME"
  28254. // ],
  28255. // "enumDescriptions": [
  28256. // "All files in account.",
  28257. // "My files.",
  28258. // "Files shared with me."
  28259. // ],
  28260. // "location": "query",
  28261. // "type": "string"
  28262. // },
  28263. // "sortField": {
  28264. // "default": "LAST_MODIFIED_TIME",
  28265. // "description": "The field by which to sort the list.",
  28266. // "enum": [
  28267. // "ID",
  28268. // "LAST_MODIFIED_TIME"
  28269. // ],
  28270. // "enumDescriptions": [
  28271. // "Sort by file ID.",
  28272. // "Sort by 'lastmodifiedAt' field."
  28273. // ],
  28274. // "location": "query",
  28275. // "type": "string"
  28276. // },
  28277. // "sortOrder": {
  28278. // "default": "DESCENDING",
  28279. // "description": "Order of sorted results.",
  28280. // "enum": [
  28281. // "ASCENDING",
  28282. // "DESCENDING"
  28283. // ],
  28284. // "enumDescriptions": [
  28285. // "Ascending order.",
  28286. // "Descending order."
  28287. // ],
  28288. // "location": "query",
  28289. // "type": "string"
  28290. // }
  28291. // },
  28292. // "path": "userprofiles/{profileId}/files",
  28293. // "response": {
  28294. // "$ref": "FileList"
  28295. // },
  28296. // "scopes": [
  28297. // "https://www.googleapis.com/auth/dfareporting"
  28298. // ]
  28299. // }
  28300. }
  28301. // Pages invokes f for each page of results.
  28302. // A non-nil error returned from f will halt the iteration.
  28303. // The provided context supersedes any context provided to the Context method.
  28304. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  28305. c.ctx_ = ctx
  28306. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28307. for {
  28308. x, err := c.Do()
  28309. if err != nil {
  28310. return err
  28311. }
  28312. if err := f(x); err != nil {
  28313. return err
  28314. }
  28315. if x.NextPageToken == "" {
  28316. return nil
  28317. }
  28318. c.PageToken(x.NextPageToken)
  28319. }
  28320. }
  28321. // method id "dfareporting.floodlightActivities.delete":
  28322. type FloodlightActivitiesDeleteCall struct {
  28323. s *Service
  28324. profileId int64
  28325. id int64
  28326. urlParams_ gensupport.URLParams
  28327. ctx_ context.Context
  28328. header_ http.Header
  28329. }
  28330. // Delete: Deletes an existing floodlight activity.
  28331. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  28332. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28333. c.profileId = profileId
  28334. c.id = id
  28335. return c
  28336. }
  28337. // Fields allows partial responses to be retrieved. See
  28338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28339. // for more information.
  28340. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  28341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28342. return c
  28343. }
  28344. // Context sets the context to be used in this call's Do method. Any
  28345. // pending HTTP request will be aborted if the provided context is
  28346. // canceled.
  28347. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  28348. c.ctx_ = ctx
  28349. return c
  28350. }
  28351. // Header returns an http.Header that can be modified by the caller to
  28352. // add HTTP headers to the request.
  28353. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  28354. if c.header_ == nil {
  28355. c.header_ = make(http.Header)
  28356. }
  28357. return c.header_
  28358. }
  28359. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28360. reqHeaders := make(http.Header)
  28361. for k, v := range c.header_ {
  28362. reqHeaders[k] = v
  28363. }
  28364. reqHeaders.Set("User-Agent", c.s.userAgent())
  28365. var body io.Reader = nil
  28366. c.urlParams_.Set("alt", alt)
  28367. c.urlParams_.Set("prettyPrint", "false")
  28368. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28369. urls += "?" + c.urlParams_.Encode()
  28370. req, err := http.NewRequest("DELETE", urls, body)
  28371. if err != nil {
  28372. return nil, err
  28373. }
  28374. req.Header = reqHeaders
  28375. googleapi.Expand(req.URL, map[string]string{
  28376. "profileId": strconv.FormatInt(c.profileId, 10),
  28377. "id": strconv.FormatInt(c.id, 10),
  28378. })
  28379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28380. }
  28381. // Do executes the "dfareporting.floodlightActivities.delete" call.
  28382. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  28383. gensupport.SetOptions(c.urlParams_, opts...)
  28384. res, err := c.doRequest("json")
  28385. if err != nil {
  28386. return err
  28387. }
  28388. defer googleapi.CloseBody(res)
  28389. if err := googleapi.CheckResponse(res); err != nil {
  28390. return err
  28391. }
  28392. return nil
  28393. // {
  28394. // "description": "Deletes an existing floodlight activity.",
  28395. // "httpMethod": "DELETE",
  28396. // "id": "dfareporting.floodlightActivities.delete",
  28397. // "parameterOrder": [
  28398. // "profileId",
  28399. // "id"
  28400. // ],
  28401. // "parameters": {
  28402. // "id": {
  28403. // "description": "Floodlight activity ID.",
  28404. // "format": "int64",
  28405. // "location": "path",
  28406. // "required": true,
  28407. // "type": "string"
  28408. // },
  28409. // "profileId": {
  28410. // "description": "User profile ID associated with this request.",
  28411. // "format": "int64",
  28412. // "location": "path",
  28413. // "required": true,
  28414. // "type": "string"
  28415. // }
  28416. // },
  28417. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28418. // "scopes": [
  28419. // "https://www.googleapis.com/auth/dfatrafficking"
  28420. // ]
  28421. // }
  28422. }
  28423. // method id "dfareporting.floodlightActivities.generatetag":
  28424. type FloodlightActivitiesGeneratetagCall struct {
  28425. s *Service
  28426. profileId int64
  28427. urlParams_ gensupport.URLParams
  28428. ctx_ context.Context
  28429. header_ http.Header
  28430. }
  28431. // Generatetag: Generates a tag for a floodlight activity.
  28432. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  28433. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28434. c.profileId = profileId
  28435. return c
  28436. }
  28437. // FloodlightActivityId sets the optional parameter
  28438. // "floodlightActivityId": Floodlight activity ID for which we want to
  28439. // generate a tag.
  28440. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  28441. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  28442. return c
  28443. }
  28444. // Fields allows partial responses to be retrieved. See
  28445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28446. // for more information.
  28447. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  28448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28449. return c
  28450. }
  28451. // Context sets the context to be used in this call's Do method. Any
  28452. // pending HTTP request will be aborted if the provided context is
  28453. // canceled.
  28454. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  28455. c.ctx_ = ctx
  28456. return c
  28457. }
  28458. // Header returns an http.Header that can be modified by the caller to
  28459. // add HTTP headers to the request.
  28460. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  28461. if c.header_ == nil {
  28462. c.header_ = make(http.Header)
  28463. }
  28464. return c.header_
  28465. }
  28466. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  28467. reqHeaders := make(http.Header)
  28468. for k, v := range c.header_ {
  28469. reqHeaders[k] = v
  28470. }
  28471. reqHeaders.Set("User-Agent", c.s.userAgent())
  28472. var body io.Reader = nil
  28473. c.urlParams_.Set("alt", alt)
  28474. c.urlParams_.Set("prettyPrint", "false")
  28475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  28476. urls += "?" + c.urlParams_.Encode()
  28477. req, err := http.NewRequest("POST", urls, body)
  28478. if err != nil {
  28479. return nil, err
  28480. }
  28481. req.Header = reqHeaders
  28482. googleapi.Expand(req.URL, map[string]string{
  28483. "profileId": strconv.FormatInt(c.profileId, 10),
  28484. })
  28485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28486. }
  28487. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  28488. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  28489. // be non-nil. Any non-2xx status code is an error. Response headers are
  28490. // in either
  28491. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  28492. // a response was returned at all) in error.(*googleapi.Error).Header.
  28493. // Use googleapi.IsNotModified to check whether the returned error was
  28494. // because http.StatusNotModified was returned.
  28495. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  28496. gensupport.SetOptions(c.urlParams_, opts...)
  28497. res, err := c.doRequest("json")
  28498. if res != nil && res.StatusCode == http.StatusNotModified {
  28499. if res.Body != nil {
  28500. res.Body.Close()
  28501. }
  28502. return nil, &googleapi.Error{
  28503. Code: res.StatusCode,
  28504. Header: res.Header,
  28505. }
  28506. }
  28507. if err != nil {
  28508. return nil, err
  28509. }
  28510. defer googleapi.CloseBody(res)
  28511. if err := googleapi.CheckResponse(res); err != nil {
  28512. return nil, err
  28513. }
  28514. ret := &FloodlightActivitiesGenerateTagResponse{
  28515. ServerResponse: googleapi.ServerResponse{
  28516. Header: res.Header,
  28517. HTTPStatusCode: res.StatusCode,
  28518. },
  28519. }
  28520. target := &ret
  28521. if err := gensupport.DecodeResponse(target, res); err != nil {
  28522. return nil, err
  28523. }
  28524. return ret, nil
  28525. // {
  28526. // "description": "Generates a tag for a floodlight activity.",
  28527. // "httpMethod": "POST",
  28528. // "id": "dfareporting.floodlightActivities.generatetag",
  28529. // "parameterOrder": [
  28530. // "profileId"
  28531. // ],
  28532. // "parameters": {
  28533. // "floodlightActivityId": {
  28534. // "description": "Floodlight activity ID for which we want to generate a tag.",
  28535. // "format": "int64",
  28536. // "location": "query",
  28537. // "type": "string"
  28538. // },
  28539. // "profileId": {
  28540. // "description": "User profile ID associated with this request.",
  28541. // "format": "int64",
  28542. // "location": "path",
  28543. // "required": true,
  28544. // "type": "string"
  28545. // }
  28546. // },
  28547. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  28548. // "response": {
  28549. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  28550. // },
  28551. // "scopes": [
  28552. // "https://www.googleapis.com/auth/dfatrafficking"
  28553. // ]
  28554. // }
  28555. }
  28556. // method id "dfareporting.floodlightActivities.get":
  28557. type FloodlightActivitiesGetCall struct {
  28558. s *Service
  28559. profileId int64
  28560. id int64
  28561. urlParams_ gensupport.URLParams
  28562. ifNoneMatch_ string
  28563. ctx_ context.Context
  28564. header_ http.Header
  28565. }
  28566. // Get: Gets one floodlight activity by ID.
  28567. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  28568. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28569. c.profileId = profileId
  28570. c.id = id
  28571. return c
  28572. }
  28573. // Fields allows partial responses to be retrieved. See
  28574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28575. // for more information.
  28576. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  28577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28578. return c
  28579. }
  28580. // IfNoneMatch sets the optional parameter which makes the operation
  28581. // fail if the object's ETag matches the given value. This is useful for
  28582. // getting updates only after the object has changed since the last
  28583. // request. Use googleapi.IsNotModified to check whether the response
  28584. // error from Do is the result of In-None-Match.
  28585. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  28586. c.ifNoneMatch_ = entityTag
  28587. return c
  28588. }
  28589. // Context sets the context to be used in this call's Do method. Any
  28590. // pending HTTP request will be aborted if the provided context is
  28591. // canceled.
  28592. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  28593. c.ctx_ = ctx
  28594. return c
  28595. }
  28596. // Header returns an http.Header that can be modified by the caller to
  28597. // add HTTP headers to the request.
  28598. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  28599. if c.header_ == nil {
  28600. c.header_ = make(http.Header)
  28601. }
  28602. return c.header_
  28603. }
  28604. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  28605. reqHeaders := make(http.Header)
  28606. for k, v := range c.header_ {
  28607. reqHeaders[k] = v
  28608. }
  28609. reqHeaders.Set("User-Agent", c.s.userAgent())
  28610. if c.ifNoneMatch_ != "" {
  28611. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28612. }
  28613. var body io.Reader = nil
  28614. c.urlParams_.Set("alt", alt)
  28615. c.urlParams_.Set("prettyPrint", "false")
  28616. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28617. urls += "?" + c.urlParams_.Encode()
  28618. req, err := http.NewRequest("GET", urls, body)
  28619. if err != nil {
  28620. return nil, err
  28621. }
  28622. req.Header = reqHeaders
  28623. googleapi.Expand(req.URL, map[string]string{
  28624. "profileId": strconv.FormatInt(c.profileId, 10),
  28625. "id": strconv.FormatInt(c.id, 10),
  28626. })
  28627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28628. }
  28629. // Do executes the "dfareporting.floodlightActivities.get" call.
  28630. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28631. // non-2xx status code is an error. Response headers are in either
  28632. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28633. // returned at all) in error.(*googleapi.Error).Header. Use
  28634. // googleapi.IsNotModified to check whether the returned error was
  28635. // because http.StatusNotModified was returned.
  28636. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28637. gensupport.SetOptions(c.urlParams_, opts...)
  28638. res, err := c.doRequest("json")
  28639. if res != nil && res.StatusCode == http.StatusNotModified {
  28640. if res.Body != nil {
  28641. res.Body.Close()
  28642. }
  28643. return nil, &googleapi.Error{
  28644. Code: res.StatusCode,
  28645. Header: res.Header,
  28646. }
  28647. }
  28648. if err != nil {
  28649. return nil, err
  28650. }
  28651. defer googleapi.CloseBody(res)
  28652. if err := googleapi.CheckResponse(res); err != nil {
  28653. return nil, err
  28654. }
  28655. ret := &FloodlightActivity{
  28656. ServerResponse: googleapi.ServerResponse{
  28657. Header: res.Header,
  28658. HTTPStatusCode: res.StatusCode,
  28659. },
  28660. }
  28661. target := &ret
  28662. if err := gensupport.DecodeResponse(target, res); err != nil {
  28663. return nil, err
  28664. }
  28665. return ret, nil
  28666. // {
  28667. // "description": "Gets one floodlight activity by ID.",
  28668. // "httpMethod": "GET",
  28669. // "id": "dfareporting.floodlightActivities.get",
  28670. // "parameterOrder": [
  28671. // "profileId",
  28672. // "id"
  28673. // ],
  28674. // "parameters": {
  28675. // "id": {
  28676. // "description": "Floodlight activity ID.",
  28677. // "format": "int64",
  28678. // "location": "path",
  28679. // "required": true,
  28680. // "type": "string"
  28681. // },
  28682. // "profileId": {
  28683. // "description": "User profile ID associated with this request.",
  28684. // "format": "int64",
  28685. // "location": "path",
  28686. // "required": true,
  28687. // "type": "string"
  28688. // }
  28689. // },
  28690. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28691. // "response": {
  28692. // "$ref": "FloodlightActivity"
  28693. // },
  28694. // "scopes": [
  28695. // "https://www.googleapis.com/auth/dfatrafficking"
  28696. // ]
  28697. // }
  28698. }
  28699. // method id "dfareporting.floodlightActivities.insert":
  28700. type FloodlightActivitiesInsertCall struct {
  28701. s *Service
  28702. profileId int64
  28703. floodlightactivity *FloodlightActivity
  28704. urlParams_ gensupport.URLParams
  28705. ctx_ context.Context
  28706. header_ http.Header
  28707. }
  28708. // Insert: Inserts a new floodlight activity.
  28709. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  28710. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28711. c.profileId = profileId
  28712. c.floodlightactivity = floodlightactivity
  28713. return c
  28714. }
  28715. // Fields allows partial responses to be retrieved. See
  28716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28717. // for more information.
  28718. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  28719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28720. return c
  28721. }
  28722. // Context sets the context to be used in this call's Do method. Any
  28723. // pending HTTP request will be aborted if the provided context is
  28724. // canceled.
  28725. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  28726. c.ctx_ = ctx
  28727. return c
  28728. }
  28729. // Header returns an http.Header that can be modified by the caller to
  28730. // add HTTP headers to the request.
  28731. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  28732. if c.header_ == nil {
  28733. c.header_ = make(http.Header)
  28734. }
  28735. return c.header_
  28736. }
  28737. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  28738. reqHeaders := make(http.Header)
  28739. for k, v := range c.header_ {
  28740. reqHeaders[k] = v
  28741. }
  28742. reqHeaders.Set("User-Agent", c.s.userAgent())
  28743. var body io.Reader = nil
  28744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  28745. if err != nil {
  28746. return nil, err
  28747. }
  28748. reqHeaders.Set("Content-Type", "application/json")
  28749. c.urlParams_.Set("alt", alt)
  28750. c.urlParams_.Set("prettyPrint", "false")
  28751. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28752. urls += "?" + c.urlParams_.Encode()
  28753. req, err := http.NewRequest("POST", urls, body)
  28754. if err != nil {
  28755. return nil, err
  28756. }
  28757. req.Header = reqHeaders
  28758. googleapi.Expand(req.URL, map[string]string{
  28759. "profileId": strconv.FormatInt(c.profileId, 10),
  28760. })
  28761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28762. }
  28763. // Do executes the "dfareporting.floodlightActivities.insert" call.
  28764. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28765. // non-2xx status code is an error. Response headers are in either
  28766. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28767. // returned at all) in error.(*googleapi.Error).Header. Use
  28768. // googleapi.IsNotModified to check whether the returned error was
  28769. // because http.StatusNotModified was returned.
  28770. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28771. gensupport.SetOptions(c.urlParams_, opts...)
  28772. res, err := c.doRequest("json")
  28773. if res != nil && res.StatusCode == http.StatusNotModified {
  28774. if res.Body != nil {
  28775. res.Body.Close()
  28776. }
  28777. return nil, &googleapi.Error{
  28778. Code: res.StatusCode,
  28779. Header: res.Header,
  28780. }
  28781. }
  28782. if err != nil {
  28783. return nil, err
  28784. }
  28785. defer googleapi.CloseBody(res)
  28786. if err := googleapi.CheckResponse(res); err != nil {
  28787. return nil, err
  28788. }
  28789. ret := &FloodlightActivity{
  28790. ServerResponse: googleapi.ServerResponse{
  28791. Header: res.Header,
  28792. HTTPStatusCode: res.StatusCode,
  28793. },
  28794. }
  28795. target := &ret
  28796. if err := gensupport.DecodeResponse(target, res); err != nil {
  28797. return nil, err
  28798. }
  28799. return ret, nil
  28800. // {
  28801. // "description": "Inserts a new floodlight activity.",
  28802. // "httpMethod": "POST",
  28803. // "id": "dfareporting.floodlightActivities.insert",
  28804. // "parameterOrder": [
  28805. // "profileId"
  28806. // ],
  28807. // "parameters": {
  28808. // "profileId": {
  28809. // "description": "User profile ID associated with this request.",
  28810. // "format": "int64",
  28811. // "location": "path",
  28812. // "required": true,
  28813. // "type": "string"
  28814. // }
  28815. // },
  28816. // "path": "userprofiles/{profileId}/floodlightActivities",
  28817. // "request": {
  28818. // "$ref": "FloodlightActivity"
  28819. // },
  28820. // "response": {
  28821. // "$ref": "FloodlightActivity"
  28822. // },
  28823. // "scopes": [
  28824. // "https://www.googleapis.com/auth/dfatrafficking"
  28825. // ]
  28826. // }
  28827. }
  28828. // method id "dfareporting.floodlightActivities.list":
  28829. type FloodlightActivitiesListCall struct {
  28830. s *Service
  28831. profileId int64
  28832. urlParams_ gensupport.URLParams
  28833. ifNoneMatch_ string
  28834. ctx_ context.Context
  28835. header_ http.Header
  28836. }
  28837. // List: Retrieves a list of floodlight activities, possibly filtered.
  28838. // This method supports paging.
  28839. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  28840. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28841. c.profileId = profileId
  28842. return c
  28843. }
  28844. // AdvertiserId sets the optional parameter "advertiserId": Select only
  28845. // floodlight activities for the specified advertiser ID. Must specify
  28846. // either ids, advertiserId, or floodlightConfigurationId for a
  28847. // non-empty result.
  28848. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  28849. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  28850. return c
  28851. }
  28852. // FloodlightActivityGroupIds sets the optional parameter
  28853. // "floodlightActivityGroupIds": Select only floodlight activities with
  28854. // the specified floodlight activity group IDs.
  28855. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  28856. var floodlightActivityGroupIds_ []string
  28857. for _, v := range floodlightActivityGroupIds {
  28858. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  28859. }
  28860. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  28861. return c
  28862. }
  28863. // FloodlightActivityGroupName sets the optional parameter
  28864. // "floodlightActivityGroupName": Select only floodlight activities with
  28865. // the specified floodlight activity group name.
  28866. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  28867. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  28868. return c
  28869. }
  28870. // FloodlightActivityGroupTagString sets the optional parameter
  28871. // "floodlightActivityGroupTagString": Select only floodlight activities
  28872. // with the specified floodlight activity group tag string.
  28873. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  28874. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  28875. return c
  28876. }
  28877. // FloodlightActivityGroupType sets the optional parameter
  28878. // "floodlightActivityGroupType": Select only floodlight activities with
  28879. // the specified floodlight activity group type.
  28880. //
  28881. // Possible values:
  28882. // "COUNTER"
  28883. // "SALE"
  28884. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  28885. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  28886. return c
  28887. }
  28888. // FloodlightConfigurationId sets the optional parameter
  28889. // "floodlightConfigurationId": Select only floodlight activities for
  28890. // the specified floodlight configuration ID. Must specify either ids,
  28891. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28892. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  28893. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  28894. return c
  28895. }
  28896. // Ids sets the optional parameter "ids": Select only floodlight
  28897. // activities with the specified IDs. Must specify either ids,
  28898. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28899. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  28900. var ids_ []string
  28901. for _, v := range ids {
  28902. ids_ = append(ids_, fmt.Sprint(v))
  28903. }
  28904. c.urlParams_.SetMulti("ids", ids_)
  28905. return c
  28906. }
  28907. // MaxResults sets the optional parameter "maxResults": Maximum number
  28908. // of results to return.
  28909. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  28910. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28911. return c
  28912. }
  28913. // PageToken sets the optional parameter "pageToken": Value of the
  28914. // nextPageToken from the previous result page.
  28915. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  28916. c.urlParams_.Set("pageToken", pageToken)
  28917. return c
  28918. }
  28919. // SearchString sets the optional parameter "searchString": Allows
  28920. // searching for objects by name or ID. Wildcards (*) are allowed. For
  28921. // example, "floodlightactivity*2015" will return objects with names
  28922. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  28923. // or simply "floodlightactivity 2015". Most of the searches also add
  28924. // wildcards implicitly at the start and the end of the search string.
  28925. // For example, a search string of "floodlightactivity" will match
  28926. // objects with name "my floodlightactivity activity",
  28927. // "floodlightactivity 2015", or simply "floodlightactivity".
  28928. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  28929. c.urlParams_.Set("searchString", searchString)
  28930. return c
  28931. }
  28932. // SortField sets the optional parameter "sortField": Field by which to
  28933. // sort the list.
  28934. //
  28935. // Possible values:
  28936. // "ID" (default)
  28937. // "NAME"
  28938. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  28939. c.urlParams_.Set("sortField", sortField)
  28940. return c
  28941. }
  28942. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28943. // results.
  28944. //
  28945. // Possible values:
  28946. // "ASCENDING" (default)
  28947. // "DESCENDING"
  28948. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  28949. c.urlParams_.Set("sortOrder", sortOrder)
  28950. return c
  28951. }
  28952. // TagString sets the optional parameter "tagString": Select only
  28953. // floodlight activities with the specified tag string.
  28954. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  28955. c.urlParams_.Set("tagString", tagString)
  28956. return c
  28957. }
  28958. // Fields allows partial responses to be retrieved. See
  28959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28960. // for more information.
  28961. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  28962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28963. return c
  28964. }
  28965. // IfNoneMatch sets the optional parameter which makes the operation
  28966. // fail if the object's ETag matches the given value. This is useful for
  28967. // getting updates only after the object has changed since the last
  28968. // request. Use googleapi.IsNotModified to check whether the response
  28969. // error from Do is the result of In-None-Match.
  28970. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  28971. c.ifNoneMatch_ = entityTag
  28972. return c
  28973. }
  28974. // Context sets the context to be used in this call's Do method. Any
  28975. // pending HTTP request will be aborted if the provided context is
  28976. // canceled.
  28977. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  28978. c.ctx_ = ctx
  28979. return c
  28980. }
  28981. // Header returns an http.Header that can be modified by the caller to
  28982. // add HTTP headers to the request.
  28983. func (c *FloodlightActivitiesListCall) Header() http.Header {
  28984. if c.header_ == nil {
  28985. c.header_ = make(http.Header)
  28986. }
  28987. return c.header_
  28988. }
  28989. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  28990. reqHeaders := make(http.Header)
  28991. for k, v := range c.header_ {
  28992. reqHeaders[k] = v
  28993. }
  28994. reqHeaders.Set("User-Agent", c.s.userAgent())
  28995. if c.ifNoneMatch_ != "" {
  28996. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28997. }
  28998. var body io.Reader = nil
  28999. c.urlParams_.Set("alt", alt)
  29000. c.urlParams_.Set("prettyPrint", "false")
  29001. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29002. urls += "?" + c.urlParams_.Encode()
  29003. req, err := http.NewRequest("GET", urls, body)
  29004. if err != nil {
  29005. return nil, err
  29006. }
  29007. req.Header = reqHeaders
  29008. googleapi.Expand(req.URL, map[string]string{
  29009. "profileId": strconv.FormatInt(c.profileId, 10),
  29010. })
  29011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29012. }
  29013. // Do executes the "dfareporting.floodlightActivities.list" call.
  29014. // Exactly one of *FloodlightActivitiesListResponse or error will be
  29015. // non-nil. Any non-2xx status code is an error. Response headers are in
  29016. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  29017. // a response was returned at all) in error.(*googleapi.Error).Header.
  29018. // Use googleapi.IsNotModified to check whether the returned error was
  29019. // because http.StatusNotModified was returned.
  29020. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  29021. gensupport.SetOptions(c.urlParams_, opts...)
  29022. res, err := c.doRequest("json")
  29023. if res != nil && res.StatusCode == http.StatusNotModified {
  29024. if res.Body != nil {
  29025. res.Body.Close()
  29026. }
  29027. return nil, &googleapi.Error{
  29028. Code: res.StatusCode,
  29029. Header: res.Header,
  29030. }
  29031. }
  29032. if err != nil {
  29033. return nil, err
  29034. }
  29035. defer googleapi.CloseBody(res)
  29036. if err := googleapi.CheckResponse(res); err != nil {
  29037. return nil, err
  29038. }
  29039. ret := &FloodlightActivitiesListResponse{
  29040. ServerResponse: googleapi.ServerResponse{
  29041. Header: res.Header,
  29042. HTTPStatusCode: res.StatusCode,
  29043. },
  29044. }
  29045. target := &ret
  29046. if err := gensupport.DecodeResponse(target, res); err != nil {
  29047. return nil, err
  29048. }
  29049. return ret, nil
  29050. // {
  29051. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  29052. // "httpMethod": "GET",
  29053. // "id": "dfareporting.floodlightActivities.list",
  29054. // "parameterOrder": [
  29055. // "profileId"
  29056. // ],
  29057. // "parameters": {
  29058. // "advertiserId": {
  29059. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29060. // "format": "int64",
  29061. // "location": "query",
  29062. // "type": "string"
  29063. // },
  29064. // "floodlightActivityGroupIds": {
  29065. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  29066. // "format": "int64",
  29067. // "location": "query",
  29068. // "repeated": true,
  29069. // "type": "string"
  29070. // },
  29071. // "floodlightActivityGroupName": {
  29072. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  29073. // "location": "query",
  29074. // "type": "string"
  29075. // },
  29076. // "floodlightActivityGroupTagString": {
  29077. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  29078. // "location": "query",
  29079. // "type": "string"
  29080. // },
  29081. // "floodlightActivityGroupType": {
  29082. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  29083. // "enum": [
  29084. // "COUNTER",
  29085. // "SALE"
  29086. // ],
  29087. // "enumDescriptions": [
  29088. // "",
  29089. // ""
  29090. // ],
  29091. // "location": "query",
  29092. // "type": "string"
  29093. // },
  29094. // "floodlightConfigurationId": {
  29095. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29096. // "format": "int64",
  29097. // "location": "query",
  29098. // "type": "string"
  29099. // },
  29100. // "ids": {
  29101. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29102. // "format": "int64",
  29103. // "location": "query",
  29104. // "repeated": true,
  29105. // "type": "string"
  29106. // },
  29107. // "maxResults": {
  29108. // "default": "1000",
  29109. // "description": "Maximum number of results to return.",
  29110. // "format": "int32",
  29111. // "location": "query",
  29112. // "maximum": "1000",
  29113. // "minimum": "0",
  29114. // "type": "integer"
  29115. // },
  29116. // "pageToken": {
  29117. // "description": "Value of the nextPageToken from the previous result page.",
  29118. // "location": "query",
  29119. // "type": "string"
  29120. // },
  29121. // "profileId": {
  29122. // "description": "User profile ID associated with this request.",
  29123. // "format": "int64",
  29124. // "location": "path",
  29125. // "required": true,
  29126. // "type": "string"
  29127. // },
  29128. // "searchString": {
  29129. // "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\".",
  29130. // "location": "query",
  29131. // "type": "string"
  29132. // },
  29133. // "sortField": {
  29134. // "default": "ID",
  29135. // "description": "Field by which to sort the list.",
  29136. // "enum": [
  29137. // "ID",
  29138. // "NAME"
  29139. // ],
  29140. // "enumDescriptions": [
  29141. // "",
  29142. // ""
  29143. // ],
  29144. // "location": "query",
  29145. // "type": "string"
  29146. // },
  29147. // "sortOrder": {
  29148. // "default": "ASCENDING",
  29149. // "description": "Order of sorted results.",
  29150. // "enum": [
  29151. // "ASCENDING",
  29152. // "DESCENDING"
  29153. // ],
  29154. // "enumDescriptions": [
  29155. // "",
  29156. // ""
  29157. // ],
  29158. // "location": "query",
  29159. // "type": "string"
  29160. // },
  29161. // "tagString": {
  29162. // "description": "Select only floodlight activities with the specified tag string.",
  29163. // "location": "query",
  29164. // "type": "string"
  29165. // }
  29166. // },
  29167. // "path": "userprofiles/{profileId}/floodlightActivities",
  29168. // "response": {
  29169. // "$ref": "FloodlightActivitiesListResponse"
  29170. // },
  29171. // "scopes": [
  29172. // "https://www.googleapis.com/auth/dfatrafficking"
  29173. // ]
  29174. // }
  29175. }
  29176. // Pages invokes f for each page of results.
  29177. // A non-nil error returned from f will halt the iteration.
  29178. // The provided context supersedes any context provided to the Context method.
  29179. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  29180. c.ctx_ = ctx
  29181. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29182. for {
  29183. x, err := c.Do()
  29184. if err != nil {
  29185. return err
  29186. }
  29187. if err := f(x); err != nil {
  29188. return err
  29189. }
  29190. if x.NextPageToken == "" {
  29191. return nil
  29192. }
  29193. c.PageToken(x.NextPageToken)
  29194. }
  29195. }
  29196. // method id "dfareporting.floodlightActivities.patch":
  29197. type FloodlightActivitiesPatchCall struct {
  29198. s *Service
  29199. profileId int64
  29200. floodlightactivity *FloodlightActivity
  29201. urlParams_ gensupport.URLParams
  29202. ctx_ context.Context
  29203. header_ http.Header
  29204. }
  29205. // Patch: Updates an existing floodlight activity. This method supports
  29206. // patch semantics.
  29207. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  29208. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29209. c.profileId = profileId
  29210. c.urlParams_.Set("id", fmt.Sprint(id))
  29211. c.floodlightactivity = floodlightactivity
  29212. return c
  29213. }
  29214. // Fields allows partial responses to be retrieved. See
  29215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29216. // for more information.
  29217. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  29218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29219. return c
  29220. }
  29221. // Context sets the context to be used in this call's Do method. Any
  29222. // pending HTTP request will be aborted if the provided context is
  29223. // canceled.
  29224. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  29225. c.ctx_ = ctx
  29226. return c
  29227. }
  29228. // Header returns an http.Header that can be modified by the caller to
  29229. // add HTTP headers to the request.
  29230. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  29231. if c.header_ == nil {
  29232. c.header_ = make(http.Header)
  29233. }
  29234. return c.header_
  29235. }
  29236. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  29237. reqHeaders := make(http.Header)
  29238. for k, v := range c.header_ {
  29239. reqHeaders[k] = v
  29240. }
  29241. reqHeaders.Set("User-Agent", c.s.userAgent())
  29242. var body io.Reader = nil
  29243. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29244. if err != nil {
  29245. return nil, err
  29246. }
  29247. reqHeaders.Set("Content-Type", "application/json")
  29248. c.urlParams_.Set("alt", alt)
  29249. c.urlParams_.Set("prettyPrint", "false")
  29250. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29251. urls += "?" + c.urlParams_.Encode()
  29252. req, err := http.NewRequest("PATCH", urls, body)
  29253. if err != nil {
  29254. return nil, err
  29255. }
  29256. req.Header = reqHeaders
  29257. googleapi.Expand(req.URL, map[string]string{
  29258. "profileId": strconv.FormatInt(c.profileId, 10),
  29259. })
  29260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29261. }
  29262. // Do executes the "dfareporting.floodlightActivities.patch" call.
  29263. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29264. // non-2xx status code is an error. Response headers are in either
  29265. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29266. // returned at all) in error.(*googleapi.Error).Header. Use
  29267. // googleapi.IsNotModified to check whether the returned error was
  29268. // because http.StatusNotModified was returned.
  29269. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29270. gensupport.SetOptions(c.urlParams_, opts...)
  29271. res, err := c.doRequest("json")
  29272. if res != nil && res.StatusCode == http.StatusNotModified {
  29273. if res.Body != nil {
  29274. res.Body.Close()
  29275. }
  29276. return nil, &googleapi.Error{
  29277. Code: res.StatusCode,
  29278. Header: res.Header,
  29279. }
  29280. }
  29281. if err != nil {
  29282. return nil, err
  29283. }
  29284. defer googleapi.CloseBody(res)
  29285. if err := googleapi.CheckResponse(res); err != nil {
  29286. return nil, err
  29287. }
  29288. ret := &FloodlightActivity{
  29289. ServerResponse: googleapi.ServerResponse{
  29290. Header: res.Header,
  29291. HTTPStatusCode: res.StatusCode,
  29292. },
  29293. }
  29294. target := &ret
  29295. if err := gensupport.DecodeResponse(target, res); err != nil {
  29296. return nil, err
  29297. }
  29298. return ret, nil
  29299. // {
  29300. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  29301. // "httpMethod": "PATCH",
  29302. // "id": "dfareporting.floodlightActivities.patch",
  29303. // "parameterOrder": [
  29304. // "profileId",
  29305. // "id"
  29306. // ],
  29307. // "parameters": {
  29308. // "id": {
  29309. // "description": "Floodlight activity ID.",
  29310. // "format": "int64",
  29311. // "location": "query",
  29312. // "required": true,
  29313. // "type": "string"
  29314. // },
  29315. // "profileId": {
  29316. // "description": "User profile ID associated with this request.",
  29317. // "format": "int64",
  29318. // "location": "path",
  29319. // "required": true,
  29320. // "type": "string"
  29321. // }
  29322. // },
  29323. // "path": "userprofiles/{profileId}/floodlightActivities",
  29324. // "request": {
  29325. // "$ref": "FloodlightActivity"
  29326. // },
  29327. // "response": {
  29328. // "$ref": "FloodlightActivity"
  29329. // },
  29330. // "scopes": [
  29331. // "https://www.googleapis.com/auth/dfatrafficking"
  29332. // ]
  29333. // }
  29334. }
  29335. // method id "dfareporting.floodlightActivities.update":
  29336. type FloodlightActivitiesUpdateCall struct {
  29337. s *Service
  29338. profileId int64
  29339. floodlightactivity *FloodlightActivity
  29340. urlParams_ gensupport.URLParams
  29341. ctx_ context.Context
  29342. header_ http.Header
  29343. }
  29344. // Update: Updates an existing floodlight activity.
  29345. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  29346. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29347. c.profileId = profileId
  29348. c.floodlightactivity = floodlightactivity
  29349. return c
  29350. }
  29351. // Fields allows partial responses to be retrieved. See
  29352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29353. // for more information.
  29354. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  29355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29356. return c
  29357. }
  29358. // Context sets the context to be used in this call's Do method. Any
  29359. // pending HTTP request will be aborted if the provided context is
  29360. // canceled.
  29361. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  29362. c.ctx_ = ctx
  29363. return c
  29364. }
  29365. // Header returns an http.Header that can be modified by the caller to
  29366. // add HTTP headers to the request.
  29367. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  29368. if c.header_ == nil {
  29369. c.header_ = make(http.Header)
  29370. }
  29371. return c.header_
  29372. }
  29373. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  29374. reqHeaders := make(http.Header)
  29375. for k, v := range c.header_ {
  29376. reqHeaders[k] = v
  29377. }
  29378. reqHeaders.Set("User-Agent", c.s.userAgent())
  29379. var body io.Reader = nil
  29380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29381. if err != nil {
  29382. return nil, err
  29383. }
  29384. reqHeaders.Set("Content-Type", "application/json")
  29385. c.urlParams_.Set("alt", alt)
  29386. c.urlParams_.Set("prettyPrint", "false")
  29387. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29388. urls += "?" + c.urlParams_.Encode()
  29389. req, err := http.NewRequest("PUT", urls, body)
  29390. if err != nil {
  29391. return nil, err
  29392. }
  29393. req.Header = reqHeaders
  29394. googleapi.Expand(req.URL, map[string]string{
  29395. "profileId": strconv.FormatInt(c.profileId, 10),
  29396. })
  29397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29398. }
  29399. // Do executes the "dfareporting.floodlightActivities.update" call.
  29400. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29401. // non-2xx status code is an error. Response headers are in either
  29402. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29403. // returned at all) in error.(*googleapi.Error).Header. Use
  29404. // googleapi.IsNotModified to check whether the returned error was
  29405. // because http.StatusNotModified was returned.
  29406. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29407. gensupport.SetOptions(c.urlParams_, opts...)
  29408. res, err := c.doRequest("json")
  29409. if res != nil && res.StatusCode == http.StatusNotModified {
  29410. if res.Body != nil {
  29411. res.Body.Close()
  29412. }
  29413. return nil, &googleapi.Error{
  29414. Code: res.StatusCode,
  29415. Header: res.Header,
  29416. }
  29417. }
  29418. if err != nil {
  29419. return nil, err
  29420. }
  29421. defer googleapi.CloseBody(res)
  29422. if err := googleapi.CheckResponse(res); err != nil {
  29423. return nil, err
  29424. }
  29425. ret := &FloodlightActivity{
  29426. ServerResponse: googleapi.ServerResponse{
  29427. Header: res.Header,
  29428. HTTPStatusCode: res.StatusCode,
  29429. },
  29430. }
  29431. target := &ret
  29432. if err := gensupport.DecodeResponse(target, res); err != nil {
  29433. return nil, err
  29434. }
  29435. return ret, nil
  29436. // {
  29437. // "description": "Updates an existing floodlight activity.",
  29438. // "httpMethod": "PUT",
  29439. // "id": "dfareporting.floodlightActivities.update",
  29440. // "parameterOrder": [
  29441. // "profileId"
  29442. // ],
  29443. // "parameters": {
  29444. // "profileId": {
  29445. // "description": "User profile ID associated with this request.",
  29446. // "format": "int64",
  29447. // "location": "path",
  29448. // "required": true,
  29449. // "type": "string"
  29450. // }
  29451. // },
  29452. // "path": "userprofiles/{profileId}/floodlightActivities",
  29453. // "request": {
  29454. // "$ref": "FloodlightActivity"
  29455. // },
  29456. // "response": {
  29457. // "$ref": "FloodlightActivity"
  29458. // },
  29459. // "scopes": [
  29460. // "https://www.googleapis.com/auth/dfatrafficking"
  29461. // ]
  29462. // }
  29463. }
  29464. // method id "dfareporting.floodlightActivityGroups.get":
  29465. type FloodlightActivityGroupsGetCall struct {
  29466. s *Service
  29467. profileId int64
  29468. id int64
  29469. urlParams_ gensupport.URLParams
  29470. ifNoneMatch_ string
  29471. ctx_ context.Context
  29472. header_ http.Header
  29473. }
  29474. // Get: Gets one floodlight activity group by ID.
  29475. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  29476. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29477. c.profileId = profileId
  29478. c.id = id
  29479. return c
  29480. }
  29481. // Fields allows partial responses to be retrieved. See
  29482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29483. // for more information.
  29484. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  29485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29486. return c
  29487. }
  29488. // IfNoneMatch sets the optional parameter which makes the operation
  29489. // fail if the object's ETag matches the given value. This is useful for
  29490. // getting updates only after the object has changed since the last
  29491. // request. Use googleapi.IsNotModified to check whether the response
  29492. // error from Do is the result of In-None-Match.
  29493. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  29494. c.ifNoneMatch_ = entityTag
  29495. return c
  29496. }
  29497. // Context sets the context to be used in this call's Do method. Any
  29498. // pending HTTP request will be aborted if the provided context is
  29499. // canceled.
  29500. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  29501. c.ctx_ = ctx
  29502. return c
  29503. }
  29504. // Header returns an http.Header that can be modified by the caller to
  29505. // add HTTP headers to the request.
  29506. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  29507. if c.header_ == nil {
  29508. c.header_ = make(http.Header)
  29509. }
  29510. return c.header_
  29511. }
  29512. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  29513. reqHeaders := make(http.Header)
  29514. for k, v := range c.header_ {
  29515. reqHeaders[k] = v
  29516. }
  29517. reqHeaders.Set("User-Agent", c.s.userAgent())
  29518. if c.ifNoneMatch_ != "" {
  29519. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29520. }
  29521. var body io.Reader = nil
  29522. c.urlParams_.Set("alt", alt)
  29523. c.urlParams_.Set("prettyPrint", "false")
  29524. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  29525. urls += "?" + c.urlParams_.Encode()
  29526. req, err := http.NewRequest("GET", urls, body)
  29527. if err != nil {
  29528. return nil, err
  29529. }
  29530. req.Header = reqHeaders
  29531. googleapi.Expand(req.URL, map[string]string{
  29532. "profileId": strconv.FormatInt(c.profileId, 10),
  29533. "id": strconv.FormatInt(c.id, 10),
  29534. })
  29535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29536. }
  29537. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  29538. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29539. // non-2xx status code is an error. Response headers are in either
  29540. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29541. // returned at all) in error.(*googleapi.Error).Header. Use
  29542. // googleapi.IsNotModified to check whether the returned error was
  29543. // because http.StatusNotModified was returned.
  29544. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29545. gensupport.SetOptions(c.urlParams_, opts...)
  29546. res, err := c.doRequest("json")
  29547. if res != nil && res.StatusCode == http.StatusNotModified {
  29548. if res.Body != nil {
  29549. res.Body.Close()
  29550. }
  29551. return nil, &googleapi.Error{
  29552. Code: res.StatusCode,
  29553. Header: res.Header,
  29554. }
  29555. }
  29556. if err != nil {
  29557. return nil, err
  29558. }
  29559. defer googleapi.CloseBody(res)
  29560. if err := googleapi.CheckResponse(res); err != nil {
  29561. return nil, err
  29562. }
  29563. ret := &FloodlightActivityGroup{
  29564. ServerResponse: googleapi.ServerResponse{
  29565. Header: res.Header,
  29566. HTTPStatusCode: res.StatusCode,
  29567. },
  29568. }
  29569. target := &ret
  29570. if err := gensupport.DecodeResponse(target, res); err != nil {
  29571. return nil, err
  29572. }
  29573. return ret, nil
  29574. // {
  29575. // "description": "Gets one floodlight activity group by ID.",
  29576. // "httpMethod": "GET",
  29577. // "id": "dfareporting.floodlightActivityGroups.get",
  29578. // "parameterOrder": [
  29579. // "profileId",
  29580. // "id"
  29581. // ],
  29582. // "parameters": {
  29583. // "id": {
  29584. // "description": "Floodlight activity Group ID.",
  29585. // "format": "int64",
  29586. // "location": "path",
  29587. // "required": true,
  29588. // "type": "string"
  29589. // },
  29590. // "profileId": {
  29591. // "description": "User profile ID associated with this request.",
  29592. // "format": "int64",
  29593. // "location": "path",
  29594. // "required": true,
  29595. // "type": "string"
  29596. // }
  29597. // },
  29598. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  29599. // "response": {
  29600. // "$ref": "FloodlightActivityGroup"
  29601. // },
  29602. // "scopes": [
  29603. // "https://www.googleapis.com/auth/dfatrafficking"
  29604. // ]
  29605. // }
  29606. }
  29607. // method id "dfareporting.floodlightActivityGroups.insert":
  29608. type FloodlightActivityGroupsInsertCall struct {
  29609. s *Service
  29610. profileId int64
  29611. floodlightactivitygroup *FloodlightActivityGroup
  29612. urlParams_ gensupport.URLParams
  29613. ctx_ context.Context
  29614. header_ http.Header
  29615. }
  29616. // Insert: Inserts a new floodlight activity group.
  29617. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  29618. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29619. c.profileId = profileId
  29620. c.floodlightactivitygroup = floodlightactivitygroup
  29621. return c
  29622. }
  29623. // Fields allows partial responses to be retrieved. See
  29624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29625. // for more information.
  29626. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  29627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29628. return c
  29629. }
  29630. // Context sets the context to be used in this call's Do method. Any
  29631. // pending HTTP request will be aborted if the provided context is
  29632. // canceled.
  29633. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  29634. c.ctx_ = ctx
  29635. return c
  29636. }
  29637. // Header returns an http.Header that can be modified by the caller to
  29638. // add HTTP headers to the request.
  29639. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  29640. if c.header_ == nil {
  29641. c.header_ = make(http.Header)
  29642. }
  29643. return c.header_
  29644. }
  29645. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  29646. reqHeaders := make(http.Header)
  29647. for k, v := range c.header_ {
  29648. reqHeaders[k] = v
  29649. }
  29650. reqHeaders.Set("User-Agent", c.s.userAgent())
  29651. var body io.Reader = nil
  29652. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  29653. if err != nil {
  29654. return nil, err
  29655. }
  29656. reqHeaders.Set("Content-Type", "application/json")
  29657. c.urlParams_.Set("alt", alt)
  29658. c.urlParams_.Set("prettyPrint", "false")
  29659. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29660. urls += "?" + c.urlParams_.Encode()
  29661. req, err := http.NewRequest("POST", urls, body)
  29662. if err != nil {
  29663. return nil, err
  29664. }
  29665. req.Header = reqHeaders
  29666. googleapi.Expand(req.URL, map[string]string{
  29667. "profileId": strconv.FormatInt(c.profileId, 10),
  29668. })
  29669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29670. }
  29671. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  29672. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29673. // non-2xx status code is an error. Response headers are in either
  29674. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29675. // returned at all) in error.(*googleapi.Error).Header. Use
  29676. // googleapi.IsNotModified to check whether the returned error was
  29677. // because http.StatusNotModified was returned.
  29678. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29679. gensupport.SetOptions(c.urlParams_, opts...)
  29680. res, err := c.doRequest("json")
  29681. if res != nil && res.StatusCode == http.StatusNotModified {
  29682. if res.Body != nil {
  29683. res.Body.Close()
  29684. }
  29685. return nil, &googleapi.Error{
  29686. Code: res.StatusCode,
  29687. Header: res.Header,
  29688. }
  29689. }
  29690. if err != nil {
  29691. return nil, err
  29692. }
  29693. defer googleapi.CloseBody(res)
  29694. if err := googleapi.CheckResponse(res); err != nil {
  29695. return nil, err
  29696. }
  29697. ret := &FloodlightActivityGroup{
  29698. ServerResponse: googleapi.ServerResponse{
  29699. Header: res.Header,
  29700. HTTPStatusCode: res.StatusCode,
  29701. },
  29702. }
  29703. target := &ret
  29704. if err := gensupport.DecodeResponse(target, res); err != nil {
  29705. return nil, err
  29706. }
  29707. return ret, nil
  29708. // {
  29709. // "description": "Inserts a new floodlight activity group.",
  29710. // "httpMethod": "POST",
  29711. // "id": "dfareporting.floodlightActivityGroups.insert",
  29712. // "parameterOrder": [
  29713. // "profileId"
  29714. // ],
  29715. // "parameters": {
  29716. // "profileId": {
  29717. // "description": "User profile ID associated with this request.",
  29718. // "format": "int64",
  29719. // "location": "path",
  29720. // "required": true,
  29721. // "type": "string"
  29722. // }
  29723. // },
  29724. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29725. // "request": {
  29726. // "$ref": "FloodlightActivityGroup"
  29727. // },
  29728. // "response": {
  29729. // "$ref": "FloodlightActivityGroup"
  29730. // },
  29731. // "scopes": [
  29732. // "https://www.googleapis.com/auth/dfatrafficking"
  29733. // ]
  29734. // }
  29735. }
  29736. // method id "dfareporting.floodlightActivityGroups.list":
  29737. type FloodlightActivityGroupsListCall struct {
  29738. s *Service
  29739. profileId int64
  29740. urlParams_ gensupport.URLParams
  29741. ifNoneMatch_ string
  29742. ctx_ context.Context
  29743. header_ http.Header
  29744. }
  29745. // List: Retrieves a list of floodlight activity groups, possibly
  29746. // filtered. This method supports paging.
  29747. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  29748. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29749. c.profileId = profileId
  29750. return c
  29751. }
  29752. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29753. // floodlight activity groups with the specified advertiser ID. Must
  29754. // specify either advertiserId or floodlightConfigurationId for a
  29755. // non-empty result.
  29756. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  29757. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29758. return c
  29759. }
  29760. // FloodlightConfigurationId sets the optional parameter
  29761. // "floodlightConfigurationId": Select only floodlight activity groups
  29762. // with the specified floodlight configuration ID. Must specify either
  29763. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29764. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  29765. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29766. return c
  29767. }
  29768. // Ids sets the optional parameter "ids": Select only floodlight
  29769. // activity groups with the specified IDs. Must specify either
  29770. // advertiserId or floodlightConfigurationId for a non-empty result.
  29771. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  29772. var ids_ []string
  29773. for _, v := range ids {
  29774. ids_ = append(ids_, fmt.Sprint(v))
  29775. }
  29776. c.urlParams_.SetMulti("ids", ids_)
  29777. return c
  29778. }
  29779. // MaxResults sets the optional parameter "maxResults": Maximum number
  29780. // of results to return.
  29781. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  29782. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29783. return c
  29784. }
  29785. // PageToken sets the optional parameter "pageToken": Value of the
  29786. // nextPageToken from the previous result page.
  29787. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  29788. c.urlParams_.Set("pageToken", pageToken)
  29789. return c
  29790. }
  29791. // SearchString sets the optional parameter "searchString": Allows
  29792. // searching for objects by name or ID. Wildcards (*) are allowed. For
  29793. // example, "floodlightactivitygroup*2015" will return objects with
  29794. // names like "floodlightactivitygroup June 2015",
  29795. // "floodlightactivitygroup April 2015", or simply
  29796. // "floodlightactivitygroup 2015". Most of the searches also add
  29797. // wildcards implicitly at the start and the end of the search string.
  29798. // For example, a search string of "floodlightactivitygroup" will match
  29799. // objects with name "my floodlightactivitygroup activity",
  29800. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  29801. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  29802. c.urlParams_.Set("searchString", searchString)
  29803. return c
  29804. }
  29805. // SortField sets the optional parameter "sortField": Field by which to
  29806. // sort the list.
  29807. //
  29808. // Possible values:
  29809. // "ID" (default)
  29810. // "NAME"
  29811. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  29812. c.urlParams_.Set("sortField", sortField)
  29813. return c
  29814. }
  29815. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29816. // results.
  29817. //
  29818. // Possible values:
  29819. // "ASCENDING" (default)
  29820. // "DESCENDING"
  29821. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  29822. c.urlParams_.Set("sortOrder", sortOrder)
  29823. return c
  29824. }
  29825. // Type sets the optional parameter "type": Select only floodlight
  29826. // activity groups with the specified floodlight activity group type.
  29827. //
  29828. // Possible values:
  29829. // "COUNTER"
  29830. // "SALE"
  29831. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  29832. c.urlParams_.Set("type", type_)
  29833. return c
  29834. }
  29835. // Fields allows partial responses to be retrieved. See
  29836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29837. // for more information.
  29838. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  29839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29840. return c
  29841. }
  29842. // IfNoneMatch sets the optional parameter which makes the operation
  29843. // fail if the object's ETag matches the given value. This is useful for
  29844. // getting updates only after the object has changed since the last
  29845. // request. Use googleapi.IsNotModified to check whether the response
  29846. // error from Do is the result of In-None-Match.
  29847. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  29848. c.ifNoneMatch_ = entityTag
  29849. return c
  29850. }
  29851. // Context sets the context to be used in this call's Do method. Any
  29852. // pending HTTP request will be aborted if the provided context is
  29853. // canceled.
  29854. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  29855. c.ctx_ = ctx
  29856. return c
  29857. }
  29858. // Header returns an http.Header that can be modified by the caller to
  29859. // add HTTP headers to the request.
  29860. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  29861. if c.header_ == nil {
  29862. c.header_ = make(http.Header)
  29863. }
  29864. return c.header_
  29865. }
  29866. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  29867. reqHeaders := make(http.Header)
  29868. for k, v := range c.header_ {
  29869. reqHeaders[k] = v
  29870. }
  29871. reqHeaders.Set("User-Agent", c.s.userAgent())
  29872. if c.ifNoneMatch_ != "" {
  29873. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29874. }
  29875. var body io.Reader = nil
  29876. c.urlParams_.Set("alt", alt)
  29877. c.urlParams_.Set("prettyPrint", "false")
  29878. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29879. urls += "?" + c.urlParams_.Encode()
  29880. req, err := http.NewRequest("GET", urls, body)
  29881. if err != nil {
  29882. return nil, err
  29883. }
  29884. req.Header = reqHeaders
  29885. googleapi.Expand(req.URL, map[string]string{
  29886. "profileId": strconv.FormatInt(c.profileId, 10),
  29887. })
  29888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29889. }
  29890. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  29891. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  29892. // non-nil. Any non-2xx status code is an error. Response headers are in
  29893. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  29894. // (if a response was returned at all) in
  29895. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  29896. // whether the returned error was because http.StatusNotModified was
  29897. // returned.
  29898. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  29899. gensupport.SetOptions(c.urlParams_, opts...)
  29900. res, err := c.doRequest("json")
  29901. if res != nil && res.StatusCode == http.StatusNotModified {
  29902. if res.Body != nil {
  29903. res.Body.Close()
  29904. }
  29905. return nil, &googleapi.Error{
  29906. Code: res.StatusCode,
  29907. Header: res.Header,
  29908. }
  29909. }
  29910. if err != nil {
  29911. return nil, err
  29912. }
  29913. defer googleapi.CloseBody(res)
  29914. if err := googleapi.CheckResponse(res); err != nil {
  29915. return nil, err
  29916. }
  29917. ret := &FloodlightActivityGroupsListResponse{
  29918. ServerResponse: googleapi.ServerResponse{
  29919. Header: res.Header,
  29920. HTTPStatusCode: res.StatusCode,
  29921. },
  29922. }
  29923. target := &ret
  29924. if err := gensupport.DecodeResponse(target, res); err != nil {
  29925. return nil, err
  29926. }
  29927. return ret, nil
  29928. // {
  29929. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  29930. // "httpMethod": "GET",
  29931. // "id": "dfareporting.floodlightActivityGroups.list",
  29932. // "parameterOrder": [
  29933. // "profileId"
  29934. // ],
  29935. // "parameters": {
  29936. // "advertiserId": {
  29937. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  29938. // "format": "int64",
  29939. // "location": "query",
  29940. // "type": "string"
  29941. // },
  29942. // "floodlightConfigurationId": {
  29943. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  29944. // "format": "int64",
  29945. // "location": "query",
  29946. // "type": "string"
  29947. // },
  29948. // "ids": {
  29949. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  29950. // "format": "int64",
  29951. // "location": "query",
  29952. // "repeated": true,
  29953. // "type": "string"
  29954. // },
  29955. // "maxResults": {
  29956. // "default": "1000",
  29957. // "description": "Maximum number of results to return.",
  29958. // "format": "int32",
  29959. // "location": "query",
  29960. // "maximum": "1000",
  29961. // "minimum": "0",
  29962. // "type": "integer"
  29963. // },
  29964. // "pageToken": {
  29965. // "description": "Value of the nextPageToken from the previous result page.",
  29966. // "location": "query",
  29967. // "type": "string"
  29968. // },
  29969. // "profileId": {
  29970. // "description": "User profile ID associated with this request.",
  29971. // "format": "int64",
  29972. // "location": "path",
  29973. // "required": true,
  29974. // "type": "string"
  29975. // },
  29976. // "searchString": {
  29977. // "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\".",
  29978. // "location": "query",
  29979. // "type": "string"
  29980. // },
  29981. // "sortField": {
  29982. // "default": "ID",
  29983. // "description": "Field by which to sort the list.",
  29984. // "enum": [
  29985. // "ID",
  29986. // "NAME"
  29987. // ],
  29988. // "enumDescriptions": [
  29989. // "",
  29990. // ""
  29991. // ],
  29992. // "location": "query",
  29993. // "type": "string"
  29994. // },
  29995. // "sortOrder": {
  29996. // "default": "ASCENDING",
  29997. // "description": "Order of sorted results.",
  29998. // "enum": [
  29999. // "ASCENDING",
  30000. // "DESCENDING"
  30001. // ],
  30002. // "enumDescriptions": [
  30003. // "",
  30004. // ""
  30005. // ],
  30006. // "location": "query",
  30007. // "type": "string"
  30008. // },
  30009. // "type": {
  30010. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  30011. // "enum": [
  30012. // "COUNTER",
  30013. // "SALE"
  30014. // ],
  30015. // "enumDescriptions": [
  30016. // "",
  30017. // ""
  30018. // ],
  30019. // "location": "query",
  30020. // "type": "string"
  30021. // }
  30022. // },
  30023. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30024. // "response": {
  30025. // "$ref": "FloodlightActivityGroupsListResponse"
  30026. // },
  30027. // "scopes": [
  30028. // "https://www.googleapis.com/auth/dfatrafficking"
  30029. // ]
  30030. // }
  30031. }
  30032. // Pages invokes f for each page of results.
  30033. // A non-nil error returned from f will halt the iteration.
  30034. // The provided context supersedes any context provided to the Context method.
  30035. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  30036. c.ctx_ = ctx
  30037. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30038. for {
  30039. x, err := c.Do()
  30040. if err != nil {
  30041. return err
  30042. }
  30043. if err := f(x); err != nil {
  30044. return err
  30045. }
  30046. if x.NextPageToken == "" {
  30047. return nil
  30048. }
  30049. c.PageToken(x.NextPageToken)
  30050. }
  30051. }
  30052. // method id "dfareporting.floodlightActivityGroups.patch":
  30053. type FloodlightActivityGroupsPatchCall struct {
  30054. s *Service
  30055. profileId int64
  30056. floodlightactivitygroup *FloodlightActivityGroup
  30057. urlParams_ gensupport.URLParams
  30058. ctx_ context.Context
  30059. header_ http.Header
  30060. }
  30061. // Patch: Updates an existing floodlight activity group. This method
  30062. // supports patch semantics.
  30063. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  30064. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30065. c.profileId = profileId
  30066. c.urlParams_.Set("id", fmt.Sprint(id))
  30067. c.floodlightactivitygroup = floodlightactivitygroup
  30068. return c
  30069. }
  30070. // Fields allows partial responses to be retrieved. See
  30071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30072. // for more information.
  30073. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  30074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30075. return c
  30076. }
  30077. // Context sets the context to be used in this call's Do method. Any
  30078. // pending HTTP request will be aborted if the provided context is
  30079. // canceled.
  30080. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  30081. c.ctx_ = ctx
  30082. return c
  30083. }
  30084. // Header returns an http.Header that can be modified by the caller to
  30085. // add HTTP headers to the request.
  30086. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  30087. if c.header_ == nil {
  30088. c.header_ = make(http.Header)
  30089. }
  30090. return c.header_
  30091. }
  30092. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  30093. reqHeaders := make(http.Header)
  30094. for k, v := range c.header_ {
  30095. reqHeaders[k] = v
  30096. }
  30097. reqHeaders.Set("User-Agent", c.s.userAgent())
  30098. var body io.Reader = nil
  30099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30100. if err != nil {
  30101. return nil, err
  30102. }
  30103. reqHeaders.Set("Content-Type", "application/json")
  30104. c.urlParams_.Set("alt", alt)
  30105. c.urlParams_.Set("prettyPrint", "false")
  30106. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30107. urls += "?" + c.urlParams_.Encode()
  30108. req, err := http.NewRequest("PATCH", urls, body)
  30109. if err != nil {
  30110. return nil, err
  30111. }
  30112. req.Header = reqHeaders
  30113. googleapi.Expand(req.URL, map[string]string{
  30114. "profileId": strconv.FormatInt(c.profileId, 10),
  30115. })
  30116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30117. }
  30118. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  30119. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30120. // non-2xx status code is an error. Response headers are in either
  30121. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30122. // returned at all) in error.(*googleapi.Error).Header. Use
  30123. // googleapi.IsNotModified to check whether the returned error was
  30124. // because http.StatusNotModified was returned.
  30125. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30126. gensupport.SetOptions(c.urlParams_, opts...)
  30127. res, err := c.doRequest("json")
  30128. if res != nil && res.StatusCode == http.StatusNotModified {
  30129. if res.Body != nil {
  30130. res.Body.Close()
  30131. }
  30132. return nil, &googleapi.Error{
  30133. Code: res.StatusCode,
  30134. Header: res.Header,
  30135. }
  30136. }
  30137. if err != nil {
  30138. return nil, err
  30139. }
  30140. defer googleapi.CloseBody(res)
  30141. if err := googleapi.CheckResponse(res); err != nil {
  30142. return nil, err
  30143. }
  30144. ret := &FloodlightActivityGroup{
  30145. ServerResponse: googleapi.ServerResponse{
  30146. Header: res.Header,
  30147. HTTPStatusCode: res.StatusCode,
  30148. },
  30149. }
  30150. target := &ret
  30151. if err := gensupport.DecodeResponse(target, res); err != nil {
  30152. return nil, err
  30153. }
  30154. return ret, nil
  30155. // {
  30156. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  30157. // "httpMethod": "PATCH",
  30158. // "id": "dfareporting.floodlightActivityGroups.patch",
  30159. // "parameterOrder": [
  30160. // "profileId",
  30161. // "id"
  30162. // ],
  30163. // "parameters": {
  30164. // "id": {
  30165. // "description": "Floodlight activity Group ID.",
  30166. // "format": "int64",
  30167. // "location": "query",
  30168. // "required": true,
  30169. // "type": "string"
  30170. // },
  30171. // "profileId": {
  30172. // "description": "User profile ID associated with this request.",
  30173. // "format": "int64",
  30174. // "location": "path",
  30175. // "required": true,
  30176. // "type": "string"
  30177. // }
  30178. // },
  30179. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30180. // "request": {
  30181. // "$ref": "FloodlightActivityGroup"
  30182. // },
  30183. // "response": {
  30184. // "$ref": "FloodlightActivityGroup"
  30185. // },
  30186. // "scopes": [
  30187. // "https://www.googleapis.com/auth/dfatrafficking"
  30188. // ]
  30189. // }
  30190. }
  30191. // method id "dfareporting.floodlightActivityGroups.update":
  30192. type FloodlightActivityGroupsUpdateCall struct {
  30193. s *Service
  30194. profileId int64
  30195. floodlightactivitygroup *FloodlightActivityGroup
  30196. urlParams_ gensupport.URLParams
  30197. ctx_ context.Context
  30198. header_ http.Header
  30199. }
  30200. // Update: Updates an existing floodlight activity group.
  30201. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  30202. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30203. c.profileId = profileId
  30204. c.floodlightactivitygroup = floodlightactivitygroup
  30205. return c
  30206. }
  30207. // Fields allows partial responses to be retrieved. See
  30208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30209. // for more information.
  30210. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  30211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30212. return c
  30213. }
  30214. // Context sets the context to be used in this call's Do method. Any
  30215. // pending HTTP request will be aborted if the provided context is
  30216. // canceled.
  30217. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  30218. c.ctx_ = ctx
  30219. return c
  30220. }
  30221. // Header returns an http.Header that can be modified by the caller to
  30222. // add HTTP headers to the request.
  30223. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  30224. if c.header_ == nil {
  30225. c.header_ = make(http.Header)
  30226. }
  30227. return c.header_
  30228. }
  30229. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30230. reqHeaders := make(http.Header)
  30231. for k, v := range c.header_ {
  30232. reqHeaders[k] = v
  30233. }
  30234. reqHeaders.Set("User-Agent", c.s.userAgent())
  30235. var body io.Reader = nil
  30236. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30237. if err != nil {
  30238. return nil, err
  30239. }
  30240. reqHeaders.Set("Content-Type", "application/json")
  30241. c.urlParams_.Set("alt", alt)
  30242. c.urlParams_.Set("prettyPrint", "false")
  30243. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30244. urls += "?" + c.urlParams_.Encode()
  30245. req, err := http.NewRequest("PUT", urls, body)
  30246. if err != nil {
  30247. return nil, err
  30248. }
  30249. req.Header = reqHeaders
  30250. googleapi.Expand(req.URL, map[string]string{
  30251. "profileId": strconv.FormatInt(c.profileId, 10),
  30252. })
  30253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30254. }
  30255. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  30256. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30257. // non-2xx status code is an error. Response headers are in either
  30258. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30259. // returned at all) in error.(*googleapi.Error).Header. Use
  30260. // googleapi.IsNotModified to check whether the returned error was
  30261. // because http.StatusNotModified was returned.
  30262. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30263. gensupport.SetOptions(c.urlParams_, opts...)
  30264. res, err := c.doRequest("json")
  30265. if res != nil && res.StatusCode == http.StatusNotModified {
  30266. if res.Body != nil {
  30267. res.Body.Close()
  30268. }
  30269. return nil, &googleapi.Error{
  30270. Code: res.StatusCode,
  30271. Header: res.Header,
  30272. }
  30273. }
  30274. if err != nil {
  30275. return nil, err
  30276. }
  30277. defer googleapi.CloseBody(res)
  30278. if err := googleapi.CheckResponse(res); err != nil {
  30279. return nil, err
  30280. }
  30281. ret := &FloodlightActivityGroup{
  30282. ServerResponse: googleapi.ServerResponse{
  30283. Header: res.Header,
  30284. HTTPStatusCode: res.StatusCode,
  30285. },
  30286. }
  30287. target := &ret
  30288. if err := gensupport.DecodeResponse(target, res); err != nil {
  30289. return nil, err
  30290. }
  30291. return ret, nil
  30292. // {
  30293. // "description": "Updates an existing floodlight activity group.",
  30294. // "httpMethod": "PUT",
  30295. // "id": "dfareporting.floodlightActivityGroups.update",
  30296. // "parameterOrder": [
  30297. // "profileId"
  30298. // ],
  30299. // "parameters": {
  30300. // "profileId": {
  30301. // "description": "User profile ID associated with this request.",
  30302. // "format": "int64",
  30303. // "location": "path",
  30304. // "required": true,
  30305. // "type": "string"
  30306. // }
  30307. // },
  30308. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30309. // "request": {
  30310. // "$ref": "FloodlightActivityGroup"
  30311. // },
  30312. // "response": {
  30313. // "$ref": "FloodlightActivityGroup"
  30314. // },
  30315. // "scopes": [
  30316. // "https://www.googleapis.com/auth/dfatrafficking"
  30317. // ]
  30318. // }
  30319. }
  30320. // method id "dfareporting.floodlightConfigurations.get":
  30321. type FloodlightConfigurationsGetCall struct {
  30322. s *Service
  30323. profileId int64
  30324. id int64
  30325. urlParams_ gensupport.URLParams
  30326. ifNoneMatch_ string
  30327. ctx_ context.Context
  30328. header_ http.Header
  30329. }
  30330. // Get: Gets one floodlight configuration by ID.
  30331. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  30332. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30333. c.profileId = profileId
  30334. c.id = id
  30335. return c
  30336. }
  30337. // Fields allows partial responses to be retrieved. See
  30338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30339. // for more information.
  30340. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  30341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30342. return c
  30343. }
  30344. // IfNoneMatch sets the optional parameter which makes the operation
  30345. // fail if the object's ETag matches the given value. This is useful for
  30346. // getting updates only after the object has changed since the last
  30347. // request. Use googleapi.IsNotModified to check whether the response
  30348. // error from Do is the result of In-None-Match.
  30349. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  30350. c.ifNoneMatch_ = entityTag
  30351. return c
  30352. }
  30353. // Context sets the context to be used in this call's Do method. Any
  30354. // pending HTTP request will be aborted if the provided context is
  30355. // canceled.
  30356. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  30357. c.ctx_ = ctx
  30358. return c
  30359. }
  30360. // Header returns an http.Header that can be modified by the caller to
  30361. // add HTTP headers to the request.
  30362. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  30363. if c.header_ == nil {
  30364. c.header_ = make(http.Header)
  30365. }
  30366. return c.header_
  30367. }
  30368. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  30369. reqHeaders := make(http.Header)
  30370. for k, v := range c.header_ {
  30371. reqHeaders[k] = v
  30372. }
  30373. reqHeaders.Set("User-Agent", c.s.userAgent())
  30374. if c.ifNoneMatch_ != "" {
  30375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30376. }
  30377. var body io.Reader = nil
  30378. c.urlParams_.Set("alt", alt)
  30379. c.urlParams_.Set("prettyPrint", "false")
  30380. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  30381. urls += "?" + c.urlParams_.Encode()
  30382. req, err := http.NewRequest("GET", urls, body)
  30383. if err != nil {
  30384. return nil, err
  30385. }
  30386. req.Header = reqHeaders
  30387. googleapi.Expand(req.URL, map[string]string{
  30388. "profileId": strconv.FormatInt(c.profileId, 10),
  30389. "id": strconv.FormatInt(c.id, 10),
  30390. })
  30391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30392. }
  30393. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  30394. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30395. // non-2xx status code is an error. Response headers are in either
  30396. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30397. // returned at all) in error.(*googleapi.Error).Header. Use
  30398. // googleapi.IsNotModified to check whether the returned error was
  30399. // because http.StatusNotModified was returned.
  30400. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30401. gensupport.SetOptions(c.urlParams_, opts...)
  30402. res, err := c.doRequest("json")
  30403. if res != nil && res.StatusCode == http.StatusNotModified {
  30404. if res.Body != nil {
  30405. res.Body.Close()
  30406. }
  30407. return nil, &googleapi.Error{
  30408. Code: res.StatusCode,
  30409. Header: res.Header,
  30410. }
  30411. }
  30412. if err != nil {
  30413. return nil, err
  30414. }
  30415. defer googleapi.CloseBody(res)
  30416. if err := googleapi.CheckResponse(res); err != nil {
  30417. return nil, err
  30418. }
  30419. ret := &FloodlightConfiguration{
  30420. ServerResponse: googleapi.ServerResponse{
  30421. Header: res.Header,
  30422. HTTPStatusCode: res.StatusCode,
  30423. },
  30424. }
  30425. target := &ret
  30426. if err := gensupport.DecodeResponse(target, res); err != nil {
  30427. return nil, err
  30428. }
  30429. return ret, nil
  30430. // {
  30431. // "description": "Gets one floodlight configuration by ID.",
  30432. // "httpMethod": "GET",
  30433. // "id": "dfareporting.floodlightConfigurations.get",
  30434. // "parameterOrder": [
  30435. // "profileId",
  30436. // "id"
  30437. // ],
  30438. // "parameters": {
  30439. // "id": {
  30440. // "description": "Floodlight configuration ID.",
  30441. // "format": "int64",
  30442. // "location": "path",
  30443. // "required": true,
  30444. // "type": "string"
  30445. // },
  30446. // "profileId": {
  30447. // "description": "User profile ID associated with this request.",
  30448. // "format": "int64",
  30449. // "location": "path",
  30450. // "required": true,
  30451. // "type": "string"
  30452. // }
  30453. // },
  30454. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  30455. // "response": {
  30456. // "$ref": "FloodlightConfiguration"
  30457. // },
  30458. // "scopes": [
  30459. // "https://www.googleapis.com/auth/dfatrafficking"
  30460. // ]
  30461. // }
  30462. }
  30463. // method id "dfareporting.floodlightConfigurations.list":
  30464. type FloodlightConfigurationsListCall struct {
  30465. s *Service
  30466. profileId int64
  30467. urlParams_ gensupport.URLParams
  30468. ifNoneMatch_ string
  30469. ctx_ context.Context
  30470. header_ http.Header
  30471. }
  30472. // List: Retrieves a list of floodlight configurations, possibly
  30473. // filtered.
  30474. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  30475. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30476. c.profileId = profileId
  30477. return c
  30478. }
  30479. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  30480. // configurations to retrieve. Required field; otherwise an empty list
  30481. // will be returned.
  30482. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  30483. var ids_ []string
  30484. for _, v := range ids {
  30485. ids_ = append(ids_, fmt.Sprint(v))
  30486. }
  30487. c.urlParams_.SetMulti("ids", ids_)
  30488. return c
  30489. }
  30490. // Fields allows partial responses to be retrieved. See
  30491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30492. // for more information.
  30493. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  30494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30495. return c
  30496. }
  30497. // IfNoneMatch sets the optional parameter which makes the operation
  30498. // fail if the object's ETag matches the given value. This is useful for
  30499. // getting updates only after the object has changed since the last
  30500. // request. Use googleapi.IsNotModified to check whether the response
  30501. // error from Do is the result of In-None-Match.
  30502. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  30503. c.ifNoneMatch_ = entityTag
  30504. return c
  30505. }
  30506. // Context sets the context to be used in this call's Do method. Any
  30507. // pending HTTP request will be aborted if the provided context is
  30508. // canceled.
  30509. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  30510. c.ctx_ = ctx
  30511. return c
  30512. }
  30513. // Header returns an http.Header that can be modified by the caller to
  30514. // add HTTP headers to the request.
  30515. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  30516. if c.header_ == nil {
  30517. c.header_ = make(http.Header)
  30518. }
  30519. return c.header_
  30520. }
  30521. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  30522. reqHeaders := make(http.Header)
  30523. for k, v := range c.header_ {
  30524. reqHeaders[k] = v
  30525. }
  30526. reqHeaders.Set("User-Agent", c.s.userAgent())
  30527. if c.ifNoneMatch_ != "" {
  30528. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30529. }
  30530. var body io.Reader = nil
  30531. c.urlParams_.Set("alt", alt)
  30532. c.urlParams_.Set("prettyPrint", "false")
  30533. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30534. urls += "?" + c.urlParams_.Encode()
  30535. req, err := http.NewRequest("GET", urls, body)
  30536. if err != nil {
  30537. return nil, err
  30538. }
  30539. req.Header = reqHeaders
  30540. googleapi.Expand(req.URL, map[string]string{
  30541. "profileId": strconv.FormatInt(c.profileId, 10),
  30542. })
  30543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30544. }
  30545. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  30546. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  30547. // non-nil. Any non-2xx status code is an error. Response headers are in
  30548. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  30549. // (if a response was returned at all) in
  30550. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30551. // whether the returned error was because http.StatusNotModified was
  30552. // returned.
  30553. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  30554. gensupport.SetOptions(c.urlParams_, opts...)
  30555. res, err := c.doRequest("json")
  30556. if res != nil && res.StatusCode == http.StatusNotModified {
  30557. if res.Body != nil {
  30558. res.Body.Close()
  30559. }
  30560. return nil, &googleapi.Error{
  30561. Code: res.StatusCode,
  30562. Header: res.Header,
  30563. }
  30564. }
  30565. if err != nil {
  30566. return nil, err
  30567. }
  30568. defer googleapi.CloseBody(res)
  30569. if err := googleapi.CheckResponse(res); err != nil {
  30570. return nil, err
  30571. }
  30572. ret := &FloodlightConfigurationsListResponse{
  30573. ServerResponse: googleapi.ServerResponse{
  30574. Header: res.Header,
  30575. HTTPStatusCode: res.StatusCode,
  30576. },
  30577. }
  30578. target := &ret
  30579. if err := gensupport.DecodeResponse(target, res); err != nil {
  30580. return nil, err
  30581. }
  30582. return ret, nil
  30583. // {
  30584. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  30585. // "httpMethod": "GET",
  30586. // "id": "dfareporting.floodlightConfigurations.list",
  30587. // "parameterOrder": [
  30588. // "profileId"
  30589. // ],
  30590. // "parameters": {
  30591. // "ids": {
  30592. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  30593. // "format": "int64",
  30594. // "location": "query",
  30595. // "repeated": true,
  30596. // "type": "string"
  30597. // },
  30598. // "profileId": {
  30599. // "description": "User profile ID associated with this request.",
  30600. // "format": "int64",
  30601. // "location": "path",
  30602. // "required": true,
  30603. // "type": "string"
  30604. // }
  30605. // },
  30606. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30607. // "response": {
  30608. // "$ref": "FloodlightConfigurationsListResponse"
  30609. // },
  30610. // "scopes": [
  30611. // "https://www.googleapis.com/auth/dfatrafficking"
  30612. // ]
  30613. // }
  30614. }
  30615. // method id "dfareporting.floodlightConfigurations.patch":
  30616. type FloodlightConfigurationsPatchCall struct {
  30617. s *Service
  30618. profileId int64
  30619. floodlightconfiguration *FloodlightConfiguration
  30620. urlParams_ gensupport.URLParams
  30621. ctx_ context.Context
  30622. header_ http.Header
  30623. }
  30624. // Patch: Updates an existing floodlight configuration. This method
  30625. // supports patch semantics.
  30626. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  30627. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30628. c.profileId = profileId
  30629. c.urlParams_.Set("id", fmt.Sprint(id))
  30630. c.floodlightconfiguration = floodlightconfiguration
  30631. return c
  30632. }
  30633. // Fields allows partial responses to be retrieved. See
  30634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30635. // for more information.
  30636. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  30637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30638. return c
  30639. }
  30640. // Context sets the context to be used in this call's Do method. Any
  30641. // pending HTTP request will be aborted if the provided context is
  30642. // canceled.
  30643. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  30644. c.ctx_ = ctx
  30645. return c
  30646. }
  30647. // Header returns an http.Header that can be modified by the caller to
  30648. // add HTTP headers to the request.
  30649. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  30650. if c.header_ == nil {
  30651. c.header_ = make(http.Header)
  30652. }
  30653. return c.header_
  30654. }
  30655. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  30656. reqHeaders := make(http.Header)
  30657. for k, v := range c.header_ {
  30658. reqHeaders[k] = v
  30659. }
  30660. reqHeaders.Set("User-Agent", c.s.userAgent())
  30661. var body io.Reader = nil
  30662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30663. if err != nil {
  30664. return nil, err
  30665. }
  30666. reqHeaders.Set("Content-Type", "application/json")
  30667. c.urlParams_.Set("alt", alt)
  30668. c.urlParams_.Set("prettyPrint", "false")
  30669. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30670. urls += "?" + c.urlParams_.Encode()
  30671. req, err := http.NewRequest("PATCH", urls, body)
  30672. if err != nil {
  30673. return nil, err
  30674. }
  30675. req.Header = reqHeaders
  30676. googleapi.Expand(req.URL, map[string]string{
  30677. "profileId": strconv.FormatInt(c.profileId, 10),
  30678. })
  30679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30680. }
  30681. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  30682. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30683. // non-2xx status code is an error. Response headers are in either
  30684. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30685. // returned at all) in error.(*googleapi.Error).Header. Use
  30686. // googleapi.IsNotModified to check whether the returned error was
  30687. // because http.StatusNotModified was returned.
  30688. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30689. gensupport.SetOptions(c.urlParams_, opts...)
  30690. res, err := c.doRequest("json")
  30691. if res != nil && res.StatusCode == http.StatusNotModified {
  30692. if res.Body != nil {
  30693. res.Body.Close()
  30694. }
  30695. return nil, &googleapi.Error{
  30696. Code: res.StatusCode,
  30697. Header: res.Header,
  30698. }
  30699. }
  30700. if err != nil {
  30701. return nil, err
  30702. }
  30703. defer googleapi.CloseBody(res)
  30704. if err := googleapi.CheckResponse(res); err != nil {
  30705. return nil, err
  30706. }
  30707. ret := &FloodlightConfiguration{
  30708. ServerResponse: googleapi.ServerResponse{
  30709. Header: res.Header,
  30710. HTTPStatusCode: res.StatusCode,
  30711. },
  30712. }
  30713. target := &ret
  30714. if err := gensupport.DecodeResponse(target, res); err != nil {
  30715. return nil, err
  30716. }
  30717. return ret, nil
  30718. // {
  30719. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  30720. // "httpMethod": "PATCH",
  30721. // "id": "dfareporting.floodlightConfigurations.patch",
  30722. // "parameterOrder": [
  30723. // "profileId",
  30724. // "id"
  30725. // ],
  30726. // "parameters": {
  30727. // "id": {
  30728. // "description": "Floodlight configuration ID.",
  30729. // "format": "int64",
  30730. // "location": "query",
  30731. // "required": true,
  30732. // "type": "string"
  30733. // },
  30734. // "profileId": {
  30735. // "description": "User profile ID associated with this request.",
  30736. // "format": "int64",
  30737. // "location": "path",
  30738. // "required": true,
  30739. // "type": "string"
  30740. // }
  30741. // },
  30742. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30743. // "request": {
  30744. // "$ref": "FloodlightConfiguration"
  30745. // },
  30746. // "response": {
  30747. // "$ref": "FloodlightConfiguration"
  30748. // },
  30749. // "scopes": [
  30750. // "https://www.googleapis.com/auth/dfatrafficking"
  30751. // ]
  30752. // }
  30753. }
  30754. // method id "dfareporting.floodlightConfigurations.update":
  30755. type FloodlightConfigurationsUpdateCall struct {
  30756. s *Service
  30757. profileId int64
  30758. floodlightconfiguration *FloodlightConfiguration
  30759. urlParams_ gensupport.URLParams
  30760. ctx_ context.Context
  30761. header_ http.Header
  30762. }
  30763. // Update: Updates an existing floodlight configuration.
  30764. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  30765. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30766. c.profileId = profileId
  30767. c.floodlightconfiguration = floodlightconfiguration
  30768. return c
  30769. }
  30770. // Fields allows partial responses to be retrieved. See
  30771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30772. // for more information.
  30773. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  30774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30775. return c
  30776. }
  30777. // Context sets the context to be used in this call's Do method. Any
  30778. // pending HTTP request will be aborted if the provided context is
  30779. // canceled.
  30780. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  30781. c.ctx_ = ctx
  30782. return c
  30783. }
  30784. // Header returns an http.Header that can be modified by the caller to
  30785. // add HTTP headers to the request.
  30786. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  30787. if c.header_ == nil {
  30788. c.header_ = make(http.Header)
  30789. }
  30790. return c.header_
  30791. }
  30792. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30793. reqHeaders := make(http.Header)
  30794. for k, v := range c.header_ {
  30795. reqHeaders[k] = v
  30796. }
  30797. reqHeaders.Set("User-Agent", c.s.userAgent())
  30798. var body io.Reader = nil
  30799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30800. if err != nil {
  30801. return nil, err
  30802. }
  30803. reqHeaders.Set("Content-Type", "application/json")
  30804. c.urlParams_.Set("alt", alt)
  30805. c.urlParams_.Set("prettyPrint", "false")
  30806. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30807. urls += "?" + c.urlParams_.Encode()
  30808. req, err := http.NewRequest("PUT", urls, body)
  30809. if err != nil {
  30810. return nil, err
  30811. }
  30812. req.Header = reqHeaders
  30813. googleapi.Expand(req.URL, map[string]string{
  30814. "profileId": strconv.FormatInt(c.profileId, 10),
  30815. })
  30816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30817. }
  30818. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  30819. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30820. // non-2xx status code is an error. Response headers are in either
  30821. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30822. // returned at all) in error.(*googleapi.Error).Header. Use
  30823. // googleapi.IsNotModified to check whether the returned error was
  30824. // because http.StatusNotModified was returned.
  30825. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30826. gensupport.SetOptions(c.urlParams_, opts...)
  30827. res, err := c.doRequest("json")
  30828. if res != nil && res.StatusCode == http.StatusNotModified {
  30829. if res.Body != nil {
  30830. res.Body.Close()
  30831. }
  30832. return nil, &googleapi.Error{
  30833. Code: res.StatusCode,
  30834. Header: res.Header,
  30835. }
  30836. }
  30837. if err != nil {
  30838. return nil, err
  30839. }
  30840. defer googleapi.CloseBody(res)
  30841. if err := googleapi.CheckResponse(res); err != nil {
  30842. return nil, err
  30843. }
  30844. ret := &FloodlightConfiguration{
  30845. ServerResponse: googleapi.ServerResponse{
  30846. Header: res.Header,
  30847. HTTPStatusCode: res.StatusCode,
  30848. },
  30849. }
  30850. target := &ret
  30851. if err := gensupport.DecodeResponse(target, res); err != nil {
  30852. return nil, err
  30853. }
  30854. return ret, nil
  30855. // {
  30856. // "description": "Updates an existing floodlight configuration.",
  30857. // "httpMethod": "PUT",
  30858. // "id": "dfareporting.floodlightConfigurations.update",
  30859. // "parameterOrder": [
  30860. // "profileId"
  30861. // ],
  30862. // "parameters": {
  30863. // "profileId": {
  30864. // "description": "User profile ID associated with this request.",
  30865. // "format": "int64",
  30866. // "location": "path",
  30867. // "required": true,
  30868. // "type": "string"
  30869. // }
  30870. // },
  30871. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30872. // "request": {
  30873. // "$ref": "FloodlightConfiguration"
  30874. // },
  30875. // "response": {
  30876. // "$ref": "FloodlightConfiguration"
  30877. // },
  30878. // "scopes": [
  30879. // "https://www.googleapis.com/auth/dfatrafficking"
  30880. // ]
  30881. // }
  30882. }
  30883. // method id "dfareporting.inventoryItems.get":
  30884. type InventoryItemsGetCall struct {
  30885. s *Service
  30886. profileId int64
  30887. projectId int64
  30888. id int64
  30889. urlParams_ gensupport.URLParams
  30890. ifNoneMatch_ string
  30891. ctx_ context.Context
  30892. header_ http.Header
  30893. }
  30894. // Get: Gets one inventory item by ID.
  30895. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  30896. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30897. c.profileId = profileId
  30898. c.projectId = projectId
  30899. c.id = id
  30900. return c
  30901. }
  30902. // Fields allows partial responses to be retrieved. See
  30903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30904. // for more information.
  30905. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  30906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30907. return c
  30908. }
  30909. // IfNoneMatch sets the optional parameter which makes the operation
  30910. // fail if the object's ETag matches the given value. This is useful for
  30911. // getting updates only after the object has changed since the last
  30912. // request. Use googleapi.IsNotModified to check whether the response
  30913. // error from Do is the result of In-None-Match.
  30914. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  30915. c.ifNoneMatch_ = entityTag
  30916. return c
  30917. }
  30918. // Context sets the context to be used in this call's Do method. Any
  30919. // pending HTTP request will be aborted if the provided context is
  30920. // canceled.
  30921. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  30922. c.ctx_ = ctx
  30923. return c
  30924. }
  30925. // Header returns an http.Header that can be modified by the caller to
  30926. // add HTTP headers to the request.
  30927. func (c *InventoryItemsGetCall) Header() http.Header {
  30928. if c.header_ == nil {
  30929. c.header_ = make(http.Header)
  30930. }
  30931. return c.header_
  30932. }
  30933. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  30934. reqHeaders := make(http.Header)
  30935. for k, v := range c.header_ {
  30936. reqHeaders[k] = v
  30937. }
  30938. reqHeaders.Set("User-Agent", c.s.userAgent())
  30939. if c.ifNoneMatch_ != "" {
  30940. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30941. }
  30942. var body io.Reader = nil
  30943. c.urlParams_.Set("alt", alt)
  30944. c.urlParams_.Set("prettyPrint", "false")
  30945. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  30946. urls += "?" + c.urlParams_.Encode()
  30947. req, err := http.NewRequest("GET", urls, body)
  30948. if err != nil {
  30949. return nil, err
  30950. }
  30951. req.Header = reqHeaders
  30952. googleapi.Expand(req.URL, map[string]string{
  30953. "profileId": strconv.FormatInt(c.profileId, 10),
  30954. "projectId": strconv.FormatInt(c.projectId, 10),
  30955. "id": strconv.FormatInt(c.id, 10),
  30956. })
  30957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30958. }
  30959. // Do executes the "dfareporting.inventoryItems.get" call.
  30960. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  30961. // status code is an error. Response headers are in either
  30962. // *InventoryItem.ServerResponse.Header or (if a response was returned
  30963. // at all) in error.(*googleapi.Error).Header. Use
  30964. // googleapi.IsNotModified to check whether the returned error was
  30965. // because http.StatusNotModified was returned.
  30966. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  30967. gensupport.SetOptions(c.urlParams_, opts...)
  30968. res, err := c.doRequest("json")
  30969. if res != nil && res.StatusCode == http.StatusNotModified {
  30970. if res.Body != nil {
  30971. res.Body.Close()
  30972. }
  30973. return nil, &googleapi.Error{
  30974. Code: res.StatusCode,
  30975. Header: res.Header,
  30976. }
  30977. }
  30978. if err != nil {
  30979. return nil, err
  30980. }
  30981. defer googleapi.CloseBody(res)
  30982. if err := googleapi.CheckResponse(res); err != nil {
  30983. return nil, err
  30984. }
  30985. ret := &InventoryItem{
  30986. ServerResponse: googleapi.ServerResponse{
  30987. Header: res.Header,
  30988. HTTPStatusCode: res.StatusCode,
  30989. },
  30990. }
  30991. target := &ret
  30992. if err := gensupport.DecodeResponse(target, res); err != nil {
  30993. return nil, err
  30994. }
  30995. return ret, nil
  30996. // {
  30997. // "description": "Gets one inventory item by ID.",
  30998. // "httpMethod": "GET",
  30999. // "id": "dfareporting.inventoryItems.get",
  31000. // "parameterOrder": [
  31001. // "profileId",
  31002. // "projectId",
  31003. // "id"
  31004. // ],
  31005. // "parameters": {
  31006. // "id": {
  31007. // "description": "Inventory item ID.",
  31008. // "format": "int64",
  31009. // "location": "path",
  31010. // "required": true,
  31011. // "type": "string"
  31012. // },
  31013. // "profileId": {
  31014. // "description": "User profile ID associated with this request.",
  31015. // "format": "int64",
  31016. // "location": "path",
  31017. // "required": true,
  31018. // "type": "string"
  31019. // },
  31020. // "projectId": {
  31021. // "description": "Project ID for order documents.",
  31022. // "format": "int64",
  31023. // "location": "path",
  31024. // "required": true,
  31025. // "type": "string"
  31026. // }
  31027. // },
  31028. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  31029. // "response": {
  31030. // "$ref": "InventoryItem"
  31031. // },
  31032. // "scopes": [
  31033. // "https://www.googleapis.com/auth/dfatrafficking"
  31034. // ]
  31035. // }
  31036. }
  31037. // method id "dfareporting.inventoryItems.list":
  31038. type InventoryItemsListCall struct {
  31039. s *Service
  31040. profileId int64
  31041. projectId int64
  31042. urlParams_ gensupport.URLParams
  31043. ifNoneMatch_ string
  31044. ctx_ context.Context
  31045. header_ http.Header
  31046. }
  31047. // List: Retrieves a list of inventory items, possibly filtered. This
  31048. // method supports paging.
  31049. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  31050. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31051. c.profileId = profileId
  31052. c.projectId = projectId
  31053. return c
  31054. }
  31055. // Ids sets the optional parameter "ids": Select only inventory items
  31056. // with these IDs.
  31057. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  31058. var ids_ []string
  31059. for _, v := range ids {
  31060. ids_ = append(ids_, fmt.Sprint(v))
  31061. }
  31062. c.urlParams_.SetMulti("ids", ids_)
  31063. return c
  31064. }
  31065. // InPlan sets the optional parameter "inPlan": Select only inventory
  31066. // items that are in plan.
  31067. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  31068. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  31069. return c
  31070. }
  31071. // MaxResults sets the optional parameter "maxResults": Maximum number
  31072. // of results to return.
  31073. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  31074. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31075. return c
  31076. }
  31077. // OrderId sets the optional parameter "orderId": Select only inventory
  31078. // items that belong to specified orders.
  31079. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  31080. var orderId_ []string
  31081. for _, v := range orderId {
  31082. orderId_ = append(orderId_, fmt.Sprint(v))
  31083. }
  31084. c.urlParams_.SetMulti("orderId", orderId_)
  31085. return c
  31086. }
  31087. // PageToken sets the optional parameter "pageToken": Value of the
  31088. // nextPageToken from the previous result page.
  31089. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  31090. c.urlParams_.Set("pageToken", pageToken)
  31091. return c
  31092. }
  31093. // SiteId sets the optional parameter "siteId": Select only inventory
  31094. // items that are associated with these sites.
  31095. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  31096. var siteId_ []string
  31097. for _, v := range siteId {
  31098. siteId_ = append(siteId_, fmt.Sprint(v))
  31099. }
  31100. c.urlParams_.SetMulti("siteId", siteId_)
  31101. return c
  31102. }
  31103. // SortField sets the optional parameter "sortField": Field by which to
  31104. // sort the list.
  31105. //
  31106. // Possible values:
  31107. // "ID" (default)
  31108. // "NAME"
  31109. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  31110. c.urlParams_.Set("sortField", sortField)
  31111. return c
  31112. }
  31113. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  31114. // results.
  31115. //
  31116. // Possible values:
  31117. // "ASCENDING" (default)
  31118. // "DESCENDING"
  31119. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  31120. c.urlParams_.Set("sortOrder", sortOrder)
  31121. return c
  31122. }
  31123. // Type sets the optional parameter "type": Select only inventory items
  31124. // with this type.
  31125. //
  31126. // Possible values:
  31127. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  31128. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31129. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  31130. c.urlParams_.Set("type", type_)
  31131. return c
  31132. }
  31133. // Fields allows partial responses to be retrieved. See
  31134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31135. // for more information.
  31136. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  31137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31138. return c
  31139. }
  31140. // IfNoneMatch sets the optional parameter which makes the operation
  31141. // fail if the object's ETag matches the given value. This is useful for
  31142. // getting updates only after the object has changed since the last
  31143. // request. Use googleapi.IsNotModified to check whether the response
  31144. // error from Do is the result of In-None-Match.
  31145. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  31146. c.ifNoneMatch_ = entityTag
  31147. return c
  31148. }
  31149. // Context sets the context to be used in this call's Do method. Any
  31150. // pending HTTP request will be aborted if the provided context is
  31151. // canceled.
  31152. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  31153. c.ctx_ = ctx
  31154. return c
  31155. }
  31156. // Header returns an http.Header that can be modified by the caller to
  31157. // add HTTP headers to the request.
  31158. func (c *InventoryItemsListCall) Header() http.Header {
  31159. if c.header_ == nil {
  31160. c.header_ = make(http.Header)
  31161. }
  31162. return c.header_
  31163. }
  31164. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  31165. reqHeaders := make(http.Header)
  31166. for k, v := range c.header_ {
  31167. reqHeaders[k] = v
  31168. }
  31169. reqHeaders.Set("User-Agent", c.s.userAgent())
  31170. if c.ifNoneMatch_ != "" {
  31171. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31172. }
  31173. var body io.Reader = nil
  31174. c.urlParams_.Set("alt", alt)
  31175. c.urlParams_.Set("prettyPrint", "false")
  31176. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  31177. urls += "?" + c.urlParams_.Encode()
  31178. req, err := http.NewRequest("GET", urls, body)
  31179. if err != nil {
  31180. return nil, err
  31181. }
  31182. req.Header = reqHeaders
  31183. googleapi.Expand(req.URL, map[string]string{
  31184. "profileId": strconv.FormatInt(c.profileId, 10),
  31185. "projectId": strconv.FormatInt(c.projectId, 10),
  31186. })
  31187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31188. }
  31189. // Do executes the "dfareporting.inventoryItems.list" call.
  31190. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  31191. // Any non-2xx status code is an error. Response headers are in either
  31192. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  31193. // was returned at all) in error.(*googleapi.Error).Header. Use
  31194. // googleapi.IsNotModified to check whether the returned error was
  31195. // because http.StatusNotModified was returned.
  31196. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  31197. gensupport.SetOptions(c.urlParams_, opts...)
  31198. res, err := c.doRequest("json")
  31199. if res != nil && res.StatusCode == http.StatusNotModified {
  31200. if res.Body != nil {
  31201. res.Body.Close()
  31202. }
  31203. return nil, &googleapi.Error{
  31204. Code: res.StatusCode,
  31205. Header: res.Header,
  31206. }
  31207. }
  31208. if err != nil {
  31209. return nil, err
  31210. }
  31211. defer googleapi.CloseBody(res)
  31212. if err := googleapi.CheckResponse(res); err != nil {
  31213. return nil, err
  31214. }
  31215. ret := &InventoryItemsListResponse{
  31216. ServerResponse: googleapi.ServerResponse{
  31217. Header: res.Header,
  31218. HTTPStatusCode: res.StatusCode,
  31219. },
  31220. }
  31221. target := &ret
  31222. if err := gensupport.DecodeResponse(target, res); err != nil {
  31223. return nil, err
  31224. }
  31225. return ret, nil
  31226. // {
  31227. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  31228. // "httpMethod": "GET",
  31229. // "id": "dfareporting.inventoryItems.list",
  31230. // "parameterOrder": [
  31231. // "profileId",
  31232. // "projectId"
  31233. // ],
  31234. // "parameters": {
  31235. // "ids": {
  31236. // "description": "Select only inventory items with these IDs.",
  31237. // "format": "int64",
  31238. // "location": "query",
  31239. // "repeated": true,
  31240. // "type": "string"
  31241. // },
  31242. // "inPlan": {
  31243. // "description": "Select only inventory items that are in plan.",
  31244. // "location": "query",
  31245. // "type": "boolean"
  31246. // },
  31247. // "maxResults": {
  31248. // "default": "1000",
  31249. // "description": "Maximum number of results to return.",
  31250. // "format": "int32",
  31251. // "location": "query",
  31252. // "maximum": "1000",
  31253. // "minimum": "0",
  31254. // "type": "integer"
  31255. // },
  31256. // "orderId": {
  31257. // "description": "Select only inventory items that belong to specified orders.",
  31258. // "format": "int64",
  31259. // "location": "query",
  31260. // "repeated": true,
  31261. // "type": "string"
  31262. // },
  31263. // "pageToken": {
  31264. // "description": "Value of the nextPageToken from the previous result page.",
  31265. // "location": "query",
  31266. // "type": "string"
  31267. // },
  31268. // "profileId": {
  31269. // "description": "User profile ID associated with this request.",
  31270. // "format": "int64",
  31271. // "location": "path",
  31272. // "required": true,
  31273. // "type": "string"
  31274. // },
  31275. // "projectId": {
  31276. // "description": "Project ID for order documents.",
  31277. // "format": "int64",
  31278. // "location": "path",
  31279. // "required": true,
  31280. // "type": "string"
  31281. // },
  31282. // "siteId": {
  31283. // "description": "Select only inventory items that are associated with these sites.",
  31284. // "format": "int64",
  31285. // "location": "query",
  31286. // "repeated": true,
  31287. // "type": "string"
  31288. // },
  31289. // "sortField": {
  31290. // "default": "ID",
  31291. // "description": "Field by which to sort the list.",
  31292. // "enum": [
  31293. // "ID",
  31294. // "NAME"
  31295. // ],
  31296. // "enumDescriptions": [
  31297. // "",
  31298. // ""
  31299. // ],
  31300. // "location": "query",
  31301. // "type": "string"
  31302. // },
  31303. // "sortOrder": {
  31304. // "default": "ASCENDING",
  31305. // "description": "Order of sorted results.",
  31306. // "enum": [
  31307. // "ASCENDING",
  31308. // "DESCENDING"
  31309. // ],
  31310. // "enumDescriptions": [
  31311. // "",
  31312. // ""
  31313. // ],
  31314. // "location": "query",
  31315. // "type": "string"
  31316. // },
  31317. // "type": {
  31318. // "description": "Select only inventory items with this type.",
  31319. // "enum": [
  31320. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  31321. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31322. // ],
  31323. // "enumDescriptions": [
  31324. // "",
  31325. // ""
  31326. // ],
  31327. // "location": "query",
  31328. // "type": "string"
  31329. // }
  31330. // },
  31331. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  31332. // "response": {
  31333. // "$ref": "InventoryItemsListResponse"
  31334. // },
  31335. // "scopes": [
  31336. // "https://www.googleapis.com/auth/dfatrafficking"
  31337. // ]
  31338. // }
  31339. }
  31340. // Pages invokes f for each page of results.
  31341. // A non-nil error returned from f will halt the iteration.
  31342. // The provided context supersedes any context provided to the Context method.
  31343. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  31344. c.ctx_ = ctx
  31345. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31346. for {
  31347. x, err := c.Do()
  31348. if err != nil {
  31349. return err
  31350. }
  31351. if err := f(x); err != nil {
  31352. return err
  31353. }
  31354. if x.NextPageToken == "" {
  31355. return nil
  31356. }
  31357. c.PageToken(x.NextPageToken)
  31358. }
  31359. }
  31360. // method id "dfareporting.languages.list":
  31361. type LanguagesListCall struct {
  31362. s *Service
  31363. profileId int64
  31364. urlParams_ gensupport.URLParams
  31365. ifNoneMatch_ string
  31366. ctx_ context.Context
  31367. header_ http.Header
  31368. }
  31369. // List: Retrieves a list of languages.
  31370. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  31371. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31372. c.profileId = profileId
  31373. return c
  31374. }
  31375. // Fields allows partial responses to be retrieved. See
  31376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31377. // for more information.
  31378. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  31379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31380. return c
  31381. }
  31382. // IfNoneMatch sets the optional parameter which makes the operation
  31383. // fail if the object's ETag matches the given value. This is useful for
  31384. // getting updates only after the object has changed since the last
  31385. // request. Use googleapi.IsNotModified to check whether the response
  31386. // error from Do is the result of In-None-Match.
  31387. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  31388. c.ifNoneMatch_ = entityTag
  31389. return c
  31390. }
  31391. // Context sets the context to be used in this call's Do method. Any
  31392. // pending HTTP request will be aborted if the provided context is
  31393. // canceled.
  31394. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  31395. c.ctx_ = ctx
  31396. return c
  31397. }
  31398. // Header returns an http.Header that can be modified by the caller to
  31399. // add HTTP headers to the request.
  31400. func (c *LanguagesListCall) Header() http.Header {
  31401. if c.header_ == nil {
  31402. c.header_ = make(http.Header)
  31403. }
  31404. return c.header_
  31405. }
  31406. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  31407. reqHeaders := make(http.Header)
  31408. for k, v := range c.header_ {
  31409. reqHeaders[k] = v
  31410. }
  31411. reqHeaders.Set("User-Agent", c.s.userAgent())
  31412. if c.ifNoneMatch_ != "" {
  31413. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31414. }
  31415. var body io.Reader = nil
  31416. c.urlParams_.Set("alt", alt)
  31417. c.urlParams_.Set("prettyPrint", "false")
  31418. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  31419. urls += "?" + c.urlParams_.Encode()
  31420. req, err := http.NewRequest("GET", urls, body)
  31421. if err != nil {
  31422. return nil, err
  31423. }
  31424. req.Header = reqHeaders
  31425. googleapi.Expand(req.URL, map[string]string{
  31426. "profileId": strconv.FormatInt(c.profileId, 10),
  31427. })
  31428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31429. }
  31430. // Do executes the "dfareporting.languages.list" call.
  31431. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  31432. // non-2xx status code is an error. Response headers are in either
  31433. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  31434. // returned at all) in error.(*googleapi.Error).Header. Use
  31435. // googleapi.IsNotModified to check whether the returned error was
  31436. // because http.StatusNotModified was returned.
  31437. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  31438. gensupport.SetOptions(c.urlParams_, opts...)
  31439. res, err := c.doRequest("json")
  31440. if res != nil && res.StatusCode == http.StatusNotModified {
  31441. if res.Body != nil {
  31442. res.Body.Close()
  31443. }
  31444. return nil, &googleapi.Error{
  31445. Code: res.StatusCode,
  31446. Header: res.Header,
  31447. }
  31448. }
  31449. if err != nil {
  31450. return nil, err
  31451. }
  31452. defer googleapi.CloseBody(res)
  31453. if err := googleapi.CheckResponse(res); err != nil {
  31454. return nil, err
  31455. }
  31456. ret := &LanguagesListResponse{
  31457. ServerResponse: googleapi.ServerResponse{
  31458. Header: res.Header,
  31459. HTTPStatusCode: res.StatusCode,
  31460. },
  31461. }
  31462. target := &ret
  31463. if err := gensupport.DecodeResponse(target, res); err != nil {
  31464. return nil, err
  31465. }
  31466. return ret, nil
  31467. // {
  31468. // "description": "Retrieves a list of languages.",
  31469. // "httpMethod": "GET",
  31470. // "id": "dfareporting.languages.list",
  31471. // "parameterOrder": [
  31472. // "profileId"
  31473. // ],
  31474. // "parameters": {
  31475. // "profileId": {
  31476. // "description": "User profile ID associated with this request.",
  31477. // "format": "int64",
  31478. // "location": "path",
  31479. // "required": true,
  31480. // "type": "string"
  31481. // }
  31482. // },
  31483. // "path": "userprofiles/{profileId}/languages",
  31484. // "response": {
  31485. // "$ref": "LanguagesListResponse"
  31486. // },
  31487. // "scopes": [
  31488. // "https://www.googleapis.com/auth/dfatrafficking"
  31489. // ]
  31490. // }
  31491. }
  31492. // method id "dfareporting.metros.list":
  31493. type MetrosListCall struct {
  31494. s *Service
  31495. profileId int64
  31496. urlParams_ gensupport.URLParams
  31497. ifNoneMatch_ string
  31498. ctx_ context.Context
  31499. header_ http.Header
  31500. }
  31501. // List: Retrieves a list of metros.
  31502. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  31503. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31504. c.profileId = profileId
  31505. return c
  31506. }
  31507. // Fields allows partial responses to be retrieved. See
  31508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31509. // for more information.
  31510. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  31511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31512. return c
  31513. }
  31514. // IfNoneMatch sets the optional parameter which makes the operation
  31515. // fail if the object's ETag matches the given value. This is useful for
  31516. // getting updates only after the object has changed since the last
  31517. // request. Use googleapi.IsNotModified to check whether the response
  31518. // error from Do is the result of In-None-Match.
  31519. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  31520. c.ifNoneMatch_ = entityTag
  31521. return c
  31522. }
  31523. // Context sets the context to be used in this call's Do method. Any
  31524. // pending HTTP request will be aborted if the provided context is
  31525. // canceled.
  31526. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  31527. c.ctx_ = ctx
  31528. return c
  31529. }
  31530. // Header returns an http.Header that can be modified by the caller to
  31531. // add HTTP headers to the request.
  31532. func (c *MetrosListCall) Header() http.Header {
  31533. if c.header_ == nil {
  31534. c.header_ = make(http.Header)
  31535. }
  31536. return c.header_
  31537. }
  31538. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  31539. reqHeaders := make(http.Header)
  31540. for k, v := range c.header_ {
  31541. reqHeaders[k] = v
  31542. }
  31543. reqHeaders.Set("User-Agent", c.s.userAgent())
  31544. if c.ifNoneMatch_ != "" {
  31545. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31546. }
  31547. var body io.Reader = nil
  31548. c.urlParams_.Set("alt", alt)
  31549. c.urlParams_.Set("prettyPrint", "false")
  31550. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  31551. urls += "?" + c.urlParams_.Encode()
  31552. req, err := http.NewRequest("GET", urls, body)
  31553. if err != nil {
  31554. return nil, err
  31555. }
  31556. req.Header = reqHeaders
  31557. googleapi.Expand(req.URL, map[string]string{
  31558. "profileId": strconv.FormatInt(c.profileId, 10),
  31559. })
  31560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31561. }
  31562. // Do executes the "dfareporting.metros.list" call.
  31563. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  31564. // non-2xx status code is an error. Response headers are in either
  31565. // *MetrosListResponse.ServerResponse.Header or (if a response was
  31566. // returned at all) in error.(*googleapi.Error).Header. Use
  31567. // googleapi.IsNotModified to check whether the returned error was
  31568. // because http.StatusNotModified was returned.
  31569. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  31570. gensupport.SetOptions(c.urlParams_, opts...)
  31571. res, err := c.doRequest("json")
  31572. if res != nil && res.StatusCode == http.StatusNotModified {
  31573. if res.Body != nil {
  31574. res.Body.Close()
  31575. }
  31576. return nil, &googleapi.Error{
  31577. Code: res.StatusCode,
  31578. Header: res.Header,
  31579. }
  31580. }
  31581. if err != nil {
  31582. return nil, err
  31583. }
  31584. defer googleapi.CloseBody(res)
  31585. if err := googleapi.CheckResponse(res); err != nil {
  31586. return nil, err
  31587. }
  31588. ret := &MetrosListResponse{
  31589. ServerResponse: googleapi.ServerResponse{
  31590. Header: res.Header,
  31591. HTTPStatusCode: res.StatusCode,
  31592. },
  31593. }
  31594. target := &ret
  31595. if err := gensupport.DecodeResponse(target, res); err != nil {
  31596. return nil, err
  31597. }
  31598. return ret, nil
  31599. // {
  31600. // "description": "Retrieves a list of metros.",
  31601. // "httpMethod": "GET",
  31602. // "id": "dfareporting.metros.list",
  31603. // "parameterOrder": [
  31604. // "profileId"
  31605. // ],
  31606. // "parameters": {
  31607. // "profileId": {
  31608. // "description": "User profile ID associated with this request.",
  31609. // "format": "int64",
  31610. // "location": "path",
  31611. // "required": true,
  31612. // "type": "string"
  31613. // }
  31614. // },
  31615. // "path": "userprofiles/{profileId}/metros",
  31616. // "response": {
  31617. // "$ref": "MetrosListResponse"
  31618. // },
  31619. // "scopes": [
  31620. // "https://www.googleapis.com/auth/dfatrafficking"
  31621. // ]
  31622. // }
  31623. }
  31624. // method id "dfareporting.mobileApps.get":
  31625. type MobileAppsGetCall struct {
  31626. s *Service
  31627. profileId int64
  31628. id string
  31629. urlParams_ gensupport.URLParams
  31630. ifNoneMatch_ string
  31631. ctx_ context.Context
  31632. header_ http.Header
  31633. }
  31634. // Get: Gets one mobile app by ID.
  31635. func (r *MobileAppsService) Get(profileId int64, id string) *MobileAppsGetCall {
  31636. c := &MobileAppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31637. c.profileId = profileId
  31638. c.id = id
  31639. return c
  31640. }
  31641. // Fields allows partial responses to be retrieved. See
  31642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31643. // for more information.
  31644. func (c *MobileAppsGetCall) Fields(s ...googleapi.Field) *MobileAppsGetCall {
  31645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31646. return c
  31647. }
  31648. // IfNoneMatch sets the optional parameter which makes the operation
  31649. // fail if the object's ETag matches the given value. This is useful for
  31650. // getting updates only after the object has changed since the last
  31651. // request. Use googleapi.IsNotModified to check whether the response
  31652. // error from Do is the result of In-None-Match.
  31653. func (c *MobileAppsGetCall) IfNoneMatch(entityTag string) *MobileAppsGetCall {
  31654. c.ifNoneMatch_ = entityTag
  31655. return c
  31656. }
  31657. // Context sets the context to be used in this call's Do method. Any
  31658. // pending HTTP request will be aborted if the provided context is
  31659. // canceled.
  31660. func (c *MobileAppsGetCall) Context(ctx context.Context) *MobileAppsGetCall {
  31661. c.ctx_ = ctx
  31662. return c
  31663. }
  31664. // Header returns an http.Header that can be modified by the caller to
  31665. // add HTTP headers to the request.
  31666. func (c *MobileAppsGetCall) Header() http.Header {
  31667. if c.header_ == nil {
  31668. c.header_ = make(http.Header)
  31669. }
  31670. return c.header_
  31671. }
  31672. func (c *MobileAppsGetCall) doRequest(alt string) (*http.Response, error) {
  31673. reqHeaders := make(http.Header)
  31674. for k, v := range c.header_ {
  31675. reqHeaders[k] = v
  31676. }
  31677. reqHeaders.Set("User-Agent", c.s.userAgent())
  31678. if c.ifNoneMatch_ != "" {
  31679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31680. }
  31681. var body io.Reader = nil
  31682. c.urlParams_.Set("alt", alt)
  31683. c.urlParams_.Set("prettyPrint", "false")
  31684. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps/{id}")
  31685. urls += "?" + c.urlParams_.Encode()
  31686. req, err := http.NewRequest("GET", urls, body)
  31687. if err != nil {
  31688. return nil, err
  31689. }
  31690. req.Header = reqHeaders
  31691. googleapi.Expand(req.URL, map[string]string{
  31692. "profileId": strconv.FormatInt(c.profileId, 10),
  31693. "id": c.id,
  31694. })
  31695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31696. }
  31697. // Do executes the "dfareporting.mobileApps.get" call.
  31698. // Exactly one of *MobileApp or error will be non-nil. Any non-2xx
  31699. // status code is an error. Response headers are in either
  31700. // *MobileApp.ServerResponse.Header or (if a response was returned at
  31701. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31702. // to check whether the returned error was because
  31703. // http.StatusNotModified was returned.
  31704. func (c *MobileAppsGetCall) Do(opts ...googleapi.CallOption) (*MobileApp, error) {
  31705. gensupport.SetOptions(c.urlParams_, opts...)
  31706. res, err := c.doRequest("json")
  31707. if res != nil && res.StatusCode == http.StatusNotModified {
  31708. if res.Body != nil {
  31709. res.Body.Close()
  31710. }
  31711. return nil, &googleapi.Error{
  31712. Code: res.StatusCode,
  31713. Header: res.Header,
  31714. }
  31715. }
  31716. if err != nil {
  31717. return nil, err
  31718. }
  31719. defer googleapi.CloseBody(res)
  31720. if err := googleapi.CheckResponse(res); err != nil {
  31721. return nil, err
  31722. }
  31723. ret := &MobileApp{
  31724. ServerResponse: googleapi.ServerResponse{
  31725. Header: res.Header,
  31726. HTTPStatusCode: res.StatusCode,
  31727. },
  31728. }
  31729. target := &ret
  31730. if err := gensupport.DecodeResponse(target, res); err != nil {
  31731. return nil, err
  31732. }
  31733. return ret, nil
  31734. // {
  31735. // "description": "Gets one mobile app by ID.",
  31736. // "httpMethod": "GET",
  31737. // "id": "dfareporting.mobileApps.get",
  31738. // "parameterOrder": [
  31739. // "profileId",
  31740. // "id"
  31741. // ],
  31742. // "parameters": {
  31743. // "id": {
  31744. // "description": "Mobile app ID.",
  31745. // "location": "path",
  31746. // "required": true,
  31747. // "type": "string"
  31748. // },
  31749. // "profileId": {
  31750. // "description": "User profile ID associated with this request.",
  31751. // "format": "int64",
  31752. // "location": "path",
  31753. // "required": true,
  31754. // "type": "string"
  31755. // }
  31756. // },
  31757. // "path": "userprofiles/{profileId}/mobileApps/{id}",
  31758. // "response": {
  31759. // "$ref": "MobileApp"
  31760. // },
  31761. // "scopes": [
  31762. // "https://www.googleapis.com/auth/dfatrafficking"
  31763. // ]
  31764. // }
  31765. }
  31766. // method id "dfareporting.mobileApps.list":
  31767. type MobileAppsListCall struct {
  31768. s *Service
  31769. profileId int64
  31770. urlParams_ gensupport.URLParams
  31771. ifNoneMatch_ string
  31772. ctx_ context.Context
  31773. header_ http.Header
  31774. }
  31775. // List: Retrieves list of available mobile apps.
  31776. func (r *MobileAppsService) List(profileId int64) *MobileAppsListCall {
  31777. c := &MobileAppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31778. c.profileId = profileId
  31779. return c
  31780. }
  31781. // Directories sets the optional parameter "directories": Select only
  31782. // apps from these directories.
  31783. //
  31784. // Possible values:
  31785. // "APPLE_APP_STORE"
  31786. // "GOOGLE_PLAY_STORE"
  31787. // "UNKNOWN"
  31788. func (c *MobileAppsListCall) Directories(directories ...string) *MobileAppsListCall {
  31789. c.urlParams_.SetMulti("directories", append([]string{}, directories...))
  31790. return c
  31791. }
  31792. // Ids sets the optional parameter "ids": Select only apps with these
  31793. // IDs.
  31794. func (c *MobileAppsListCall) Ids(ids ...string) *MobileAppsListCall {
  31795. c.urlParams_.SetMulti("ids", append([]string{}, ids...))
  31796. return c
  31797. }
  31798. // MaxResults sets the optional parameter "maxResults": Maximum number
  31799. // of results to return.
  31800. func (c *MobileAppsListCall) MaxResults(maxResults int64) *MobileAppsListCall {
  31801. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31802. return c
  31803. }
  31804. // PageToken sets the optional parameter "pageToken": Value of the
  31805. // nextPageToken from the previous result page.
  31806. func (c *MobileAppsListCall) PageToken(pageToken string) *MobileAppsListCall {
  31807. c.urlParams_.Set("pageToken", pageToken)
  31808. return c
  31809. }
  31810. // SearchString sets the optional parameter "searchString": Allows
  31811. // searching for objects by name or ID. Wildcards (*) are allowed. For
  31812. // example, "app*2015" will return objects with names like "app Jan
  31813. // 2018", "app Jan 2018", or simply "app 2018". Most of the searches
  31814. // also add wildcards implicitly at the start and the end of the search
  31815. // string. For example, a search string of "app" will match objects with
  31816. // name "my app", "app 2018", or simply "app".
  31817. func (c *MobileAppsListCall) SearchString(searchString string) *MobileAppsListCall {
  31818. c.urlParams_.Set("searchString", searchString)
  31819. return c
  31820. }
  31821. // Fields allows partial responses to be retrieved. See
  31822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31823. // for more information.
  31824. func (c *MobileAppsListCall) Fields(s ...googleapi.Field) *MobileAppsListCall {
  31825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31826. return c
  31827. }
  31828. // IfNoneMatch sets the optional parameter which makes the operation
  31829. // fail if the object's ETag matches the given value. This is useful for
  31830. // getting updates only after the object has changed since the last
  31831. // request. Use googleapi.IsNotModified to check whether the response
  31832. // error from Do is the result of In-None-Match.
  31833. func (c *MobileAppsListCall) IfNoneMatch(entityTag string) *MobileAppsListCall {
  31834. c.ifNoneMatch_ = entityTag
  31835. return c
  31836. }
  31837. // Context sets the context to be used in this call's Do method. Any
  31838. // pending HTTP request will be aborted if the provided context is
  31839. // canceled.
  31840. func (c *MobileAppsListCall) Context(ctx context.Context) *MobileAppsListCall {
  31841. c.ctx_ = ctx
  31842. return c
  31843. }
  31844. // Header returns an http.Header that can be modified by the caller to
  31845. // add HTTP headers to the request.
  31846. func (c *MobileAppsListCall) Header() http.Header {
  31847. if c.header_ == nil {
  31848. c.header_ = make(http.Header)
  31849. }
  31850. return c.header_
  31851. }
  31852. func (c *MobileAppsListCall) doRequest(alt string) (*http.Response, error) {
  31853. reqHeaders := make(http.Header)
  31854. for k, v := range c.header_ {
  31855. reqHeaders[k] = v
  31856. }
  31857. reqHeaders.Set("User-Agent", c.s.userAgent())
  31858. if c.ifNoneMatch_ != "" {
  31859. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31860. }
  31861. var body io.Reader = nil
  31862. c.urlParams_.Set("alt", alt)
  31863. c.urlParams_.Set("prettyPrint", "false")
  31864. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps")
  31865. urls += "?" + c.urlParams_.Encode()
  31866. req, err := http.NewRequest("GET", urls, body)
  31867. if err != nil {
  31868. return nil, err
  31869. }
  31870. req.Header = reqHeaders
  31871. googleapi.Expand(req.URL, map[string]string{
  31872. "profileId": strconv.FormatInt(c.profileId, 10),
  31873. })
  31874. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31875. }
  31876. // Do executes the "dfareporting.mobileApps.list" call.
  31877. // Exactly one of *MobileAppsListResponse or error will be non-nil. Any
  31878. // non-2xx status code is an error. Response headers are in either
  31879. // *MobileAppsListResponse.ServerResponse.Header or (if a response was
  31880. // returned at all) in error.(*googleapi.Error).Header. Use
  31881. // googleapi.IsNotModified to check whether the returned error was
  31882. // because http.StatusNotModified was returned.
  31883. func (c *MobileAppsListCall) Do(opts ...googleapi.CallOption) (*MobileAppsListResponse, error) {
  31884. gensupport.SetOptions(c.urlParams_, opts...)
  31885. res, err := c.doRequest("json")
  31886. if res != nil && res.StatusCode == http.StatusNotModified {
  31887. if res.Body != nil {
  31888. res.Body.Close()
  31889. }
  31890. return nil, &googleapi.Error{
  31891. Code: res.StatusCode,
  31892. Header: res.Header,
  31893. }
  31894. }
  31895. if err != nil {
  31896. return nil, err
  31897. }
  31898. defer googleapi.CloseBody(res)
  31899. if err := googleapi.CheckResponse(res); err != nil {
  31900. return nil, err
  31901. }
  31902. ret := &MobileAppsListResponse{
  31903. ServerResponse: googleapi.ServerResponse{
  31904. Header: res.Header,
  31905. HTTPStatusCode: res.StatusCode,
  31906. },
  31907. }
  31908. target := &ret
  31909. if err := gensupport.DecodeResponse(target, res); err != nil {
  31910. return nil, err
  31911. }
  31912. return ret, nil
  31913. // {
  31914. // "description": "Retrieves list of available mobile apps.",
  31915. // "httpMethod": "GET",
  31916. // "id": "dfareporting.mobileApps.list",
  31917. // "parameterOrder": [
  31918. // "profileId"
  31919. // ],
  31920. // "parameters": {
  31921. // "directories": {
  31922. // "description": "Select only apps from these directories.",
  31923. // "enum": [
  31924. // "APPLE_APP_STORE",
  31925. // "GOOGLE_PLAY_STORE",
  31926. // "UNKNOWN"
  31927. // ],
  31928. // "enumDescriptions": [
  31929. // "",
  31930. // "",
  31931. // ""
  31932. // ],
  31933. // "location": "query",
  31934. // "repeated": true,
  31935. // "type": "string"
  31936. // },
  31937. // "ids": {
  31938. // "description": "Select only apps with these IDs.",
  31939. // "location": "query",
  31940. // "repeated": true,
  31941. // "type": "string"
  31942. // },
  31943. // "maxResults": {
  31944. // "default": "1000",
  31945. // "description": "Maximum number of results to return.",
  31946. // "format": "int32",
  31947. // "location": "query",
  31948. // "maximum": "1000",
  31949. // "minimum": "0",
  31950. // "type": "integer"
  31951. // },
  31952. // "pageToken": {
  31953. // "description": "Value of the nextPageToken from the previous result page.",
  31954. // "location": "query",
  31955. // "type": "string"
  31956. // },
  31957. // "profileId": {
  31958. // "description": "User profile ID associated with this request.",
  31959. // "format": "int64",
  31960. // "location": "path",
  31961. // "required": true,
  31962. // "type": "string"
  31963. // },
  31964. // "searchString": {
  31965. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"app*2015\" will return objects with names like \"app Jan 2018\", \"app Jan 2018\", or simply \"app 2018\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"app\" will match objects with name \"my app\", \"app 2018\", or simply \"app\".",
  31966. // "location": "query",
  31967. // "type": "string"
  31968. // }
  31969. // },
  31970. // "path": "userprofiles/{profileId}/mobileApps",
  31971. // "response": {
  31972. // "$ref": "MobileAppsListResponse"
  31973. // },
  31974. // "scopes": [
  31975. // "https://www.googleapis.com/auth/dfatrafficking"
  31976. // ]
  31977. // }
  31978. }
  31979. // Pages invokes f for each page of results.
  31980. // A non-nil error returned from f will halt the iteration.
  31981. // The provided context supersedes any context provided to the Context method.
  31982. func (c *MobileAppsListCall) Pages(ctx context.Context, f func(*MobileAppsListResponse) error) error {
  31983. c.ctx_ = ctx
  31984. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31985. for {
  31986. x, err := c.Do()
  31987. if err != nil {
  31988. return err
  31989. }
  31990. if err := f(x); err != nil {
  31991. return err
  31992. }
  31993. if x.NextPageToken == "" {
  31994. return nil
  31995. }
  31996. c.PageToken(x.NextPageToken)
  31997. }
  31998. }
  31999. // method id "dfareporting.mobileCarriers.get":
  32000. type MobileCarriersGetCall struct {
  32001. s *Service
  32002. profileId int64
  32003. id int64
  32004. urlParams_ gensupport.URLParams
  32005. ifNoneMatch_ string
  32006. ctx_ context.Context
  32007. header_ http.Header
  32008. }
  32009. // Get: Gets one mobile carrier by ID.
  32010. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  32011. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32012. c.profileId = profileId
  32013. c.id = id
  32014. return c
  32015. }
  32016. // Fields allows partial responses to be retrieved. See
  32017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32018. // for more information.
  32019. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  32020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32021. return c
  32022. }
  32023. // IfNoneMatch sets the optional parameter which makes the operation
  32024. // fail if the object's ETag matches the given value. This is useful for
  32025. // getting updates only after the object has changed since the last
  32026. // request. Use googleapi.IsNotModified to check whether the response
  32027. // error from Do is the result of In-None-Match.
  32028. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  32029. c.ifNoneMatch_ = entityTag
  32030. return c
  32031. }
  32032. // Context sets the context to be used in this call's Do method. Any
  32033. // pending HTTP request will be aborted if the provided context is
  32034. // canceled.
  32035. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  32036. c.ctx_ = ctx
  32037. return c
  32038. }
  32039. // Header returns an http.Header that can be modified by the caller to
  32040. // add HTTP headers to the request.
  32041. func (c *MobileCarriersGetCall) Header() http.Header {
  32042. if c.header_ == nil {
  32043. c.header_ = make(http.Header)
  32044. }
  32045. return c.header_
  32046. }
  32047. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  32048. reqHeaders := make(http.Header)
  32049. for k, v := range c.header_ {
  32050. reqHeaders[k] = v
  32051. }
  32052. reqHeaders.Set("User-Agent", c.s.userAgent())
  32053. if c.ifNoneMatch_ != "" {
  32054. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32055. }
  32056. var body io.Reader = nil
  32057. c.urlParams_.Set("alt", alt)
  32058. c.urlParams_.Set("prettyPrint", "false")
  32059. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  32060. urls += "?" + c.urlParams_.Encode()
  32061. req, err := http.NewRequest("GET", urls, body)
  32062. if err != nil {
  32063. return nil, err
  32064. }
  32065. req.Header = reqHeaders
  32066. googleapi.Expand(req.URL, map[string]string{
  32067. "profileId": strconv.FormatInt(c.profileId, 10),
  32068. "id": strconv.FormatInt(c.id, 10),
  32069. })
  32070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32071. }
  32072. // Do executes the "dfareporting.mobileCarriers.get" call.
  32073. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  32074. // status code is an error. Response headers are in either
  32075. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  32076. // at all) in error.(*googleapi.Error).Header. Use
  32077. // googleapi.IsNotModified to check whether the returned error was
  32078. // because http.StatusNotModified was returned.
  32079. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  32080. gensupport.SetOptions(c.urlParams_, opts...)
  32081. res, err := c.doRequest("json")
  32082. if res != nil && res.StatusCode == http.StatusNotModified {
  32083. if res.Body != nil {
  32084. res.Body.Close()
  32085. }
  32086. return nil, &googleapi.Error{
  32087. Code: res.StatusCode,
  32088. Header: res.Header,
  32089. }
  32090. }
  32091. if err != nil {
  32092. return nil, err
  32093. }
  32094. defer googleapi.CloseBody(res)
  32095. if err := googleapi.CheckResponse(res); err != nil {
  32096. return nil, err
  32097. }
  32098. ret := &MobileCarrier{
  32099. ServerResponse: googleapi.ServerResponse{
  32100. Header: res.Header,
  32101. HTTPStatusCode: res.StatusCode,
  32102. },
  32103. }
  32104. target := &ret
  32105. if err := gensupport.DecodeResponse(target, res); err != nil {
  32106. return nil, err
  32107. }
  32108. return ret, nil
  32109. // {
  32110. // "description": "Gets one mobile carrier by ID.",
  32111. // "httpMethod": "GET",
  32112. // "id": "dfareporting.mobileCarriers.get",
  32113. // "parameterOrder": [
  32114. // "profileId",
  32115. // "id"
  32116. // ],
  32117. // "parameters": {
  32118. // "id": {
  32119. // "description": "Mobile carrier ID.",
  32120. // "format": "int64",
  32121. // "location": "path",
  32122. // "required": true,
  32123. // "type": "string"
  32124. // },
  32125. // "profileId": {
  32126. // "description": "User profile ID associated with this request.",
  32127. // "format": "int64",
  32128. // "location": "path",
  32129. // "required": true,
  32130. // "type": "string"
  32131. // }
  32132. // },
  32133. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  32134. // "response": {
  32135. // "$ref": "MobileCarrier"
  32136. // },
  32137. // "scopes": [
  32138. // "https://www.googleapis.com/auth/dfatrafficking"
  32139. // ]
  32140. // }
  32141. }
  32142. // method id "dfareporting.mobileCarriers.list":
  32143. type MobileCarriersListCall struct {
  32144. s *Service
  32145. profileId int64
  32146. urlParams_ gensupport.URLParams
  32147. ifNoneMatch_ string
  32148. ctx_ context.Context
  32149. header_ http.Header
  32150. }
  32151. // List: Retrieves a list of mobile carriers.
  32152. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  32153. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32154. c.profileId = profileId
  32155. return c
  32156. }
  32157. // Fields allows partial responses to be retrieved. See
  32158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32159. // for more information.
  32160. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  32161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32162. return c
  32163. }
  32164. // IfNoneMatch sets the optional parameter which makes the operation
  32165. // fail if the object's ETag matches the given value. This is useful for
  32166. // getting updates only after the object has changed since the last
  32167. // request. Use googleapi.IsNotModified to check whether the response
  32168. // error from Do is the result of In-None-Match.
  32169. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  32170. c.ifNoneMatch_ = entityTag
  32171. return c
  32172. }
  32173. // Context sets the context to be used in this call's Do method. Any
  32174. // pending HTTP request will be aborted if the provided context is
  32175. // canceled.
  32176. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  32177. c.ctx_ = ctx
  32178. return c
  32179. }
  32180. // Header returns an http.Header that can be modified by the caller to
  32181. // add HTTP headers to the request.
  32182. func (c *MobileCarriersListCall) Header() http.Header {
  32183. if c.header_ == nil {
  32184. c.header_ = make(http.Header)
  32185. }
  32186. return c.header_
  32187. }
  32188. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  32189. reqHeaders := make(http.Header)
  32190. for k, v := range c.header_ {
  32191. reqHeaders[k] = v
  32192. }
  32193. reqHeaders.Set("User-Agent", c.s.userAgent())
  32194. if c.ifNoneMatch_ != "" {
  32195. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32196. }
  32197. var body io.Reader = nil
  32198. c.urlParams_.Set("alt", alt)
  32199. c.urlParams_.Set("prettyPrint", "false")
  32200. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  32201. urls += "?" + c.urlParams_.Encode()
  32202. req, err := http.NewRequest("GET", urls, body)
  32203. if err != nil {
  32204. return nil, err
  32205. }
  32206. req.Header = reqHeaders
  32207. googleapi.Expand(req.URL, map[string]string{
  32208. "profileId": strconv.FormatInt(c.profileId, 10),
  32209. })
  32210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32211. }
  32212. // Do executes the "dfareporting.mobileCarriers.list" call.
  32213. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  32214. // Any non-2xx status code is an error. Response headers are in either
  32215. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  32216. // was returned at all) in error.(*googleapi.Error).Header. Use
  32217. // googleapi.IsNotModified to check whether the returned error was
  32218. // because http.StatusNotModified was returned.
  32219. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  32220. gensupport.SetOptions(c.urlParams_, opts...)
  32221. res, err := c.doRequest("json")
  32222. if res != nil && res.StatusCode == http.StatusNotModified {
  32223. if res.Body != nil {
  32224. res.Body.Close()
  32225. }
  32226. return nil, &googleapi.Error{
  32227. Code: res.StatusCode,
  32228. Header: res.Header,
  32229. }
  32230. }
  32231. if err != nil {
  32232. return nil, err
  32233. }
  32234. defer googleapi.CloseBody(res)
  32235. if err := googleapi.CheckResponse(res); err != nil {
  32236. return nil, err
  32237. }
  32238. ret := &MobileCarriersListResponse{
  32239. ServerResponse: googleapi.ServerResponse{
  32240. Header: res.Header,
  32241. HTTPStatusCode: res.StatusCode,
  32242. },
  32243. }
  32244. target := &ret
  32245. if err := gensupport.DecodeResponse(target, res); err != nil {
  32246. return nil, err
  32247. }
  32248. return ret, nil
  32249. // {
  32250. // "description": "Retrieves a list of mobile carriers.",
  32251. // "httpMethod": "GET",
  32252. // "id": "dfareporting.mobileCarriers.list",
  32253. // "parameterOrder": [
  32254. // "profileId"
  32255. // ],
  32256. // "parameters": {
  32257. // "profileId": {
  32258. // "description": "User profile ID associated with this request.",
  32259. // "format": "int64",
  32260. // "location": "path",
  32261. // "required": true,
  32262. // "type": "string"
  32263. // }
  32264. // },
  32265. // "path": "userprofiles/{profileId}/mobileCarriers",
  32266. // "response": {
  32267. // "$ref": "MobileCarriersListResponse"
  32268. // },
  32269. // "scopes": [
  32270. // "https://www.googleapis.com/auth/dfatrafficking"
  32271. // ]
  32272. // }
  32273. }
  32274. // method id "dfareporting.operatingSystemVersions.get":
  32275. type OperatingSystemVersionsGetCall struct {
  32276. s *Service
  32277. profileId int64
  32278. id int64
  32279. urlParams_ gensupport.URLParams
  32280. ifNoneMatch_ string
  32281. ctx_ context.Context
  32282. header_ http.Header
  32283. }
  32284. // Get: Gets one operating system version by ID.
  32285. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  32286. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32287. c.profileId = profileId
  32288. c.id = id
  32289. return c
  32290. }
  32291. // Fields allows partial responses to be retrieved. See
  32292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32293. // for more information.
  32294. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  32295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32296. return c
  32297. }
  32298. // IfNoneMatch sets the optional parameter which makes the operation
  32299. // fail if the object's ETag matches the given value. This is useful for
  32300. // getting updates only after the object has changed since the last
  32301. // request. Use googleapi.IsNotModified to check whether the response
  32302. // error from Do is the result of In-None-Match.
  32303. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  32304. c.ifNoneMatch_ = entityTag
  32305. return c
  32306. }
  32307. // Context sets the context to be used in this call's Do method. Any
  32308. // pending HTTP request will be aborted if the provided context is
  32309. // canceled.
  32310. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  32311. c.ctx_ = ctx
  32312. return c
  32313. }
  32314. // Header returns an http.Header that can be modified by the caller to
  32315. // add HTTP headers to the request.
  32316. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  32317. if c.header_ == nil {
  32318. c.header_ = make(http.Header)
  32319. }
  32320. return c.header_
  32321. }
  32322. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  32323. reqHeaders := make(http.Header)
  32324. for k, v := range c.header_ {
  32325. reqHeaders[k] = v
  32326. }
  32327. reqHeaders.Set("User-Agent", c.s.userAgent())
  32328. if c.ifNoneMatch_ != "" {
  32329. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32330. }
  32331. var body io.Reader = nil
  32332. c.urlParams_.Set("alt", alt)
  32333. c.urlParams_.Set("prettyPrint", "false")
  32334. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  32335. urls += "?" + c.urlParams_.Encode()
  32336. req, err := http.NewRequest("GET", urls, body)
  32337. if err != nil {
  32338. return nil, err
  32339. }
  32340. req.Header = reqHeaders
  32341. googleapi.Expand(req.URL, map[string]string{
  32342. "profileId": strconv.FormatInt(c.profileId, 10),
  32343. "id": strconv.FormatInt(c.id, 10),
  32344. })
  32345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32346. }
  32347. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  32348. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  32349. // non-2xx status code is an error. Response headers are in either
  32350. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  32351. // returned at all) in error.(*googleapi.Error).Header. Use
  32352. // googleapi.IsNotModified to check whether the returned error was
  32353. // because http.StatusNotModified was returned.
  32354. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  32355. gensupport.SetOptions(c.urlParams_, opts...)
  32356. res, err := c.doRequest("json")
  32357. if res != nil && res.StatusCode == http.StatusNotModified {
  32358. if res.Body != nil {
  32359. res.Body.Close()
  32360. }
  32361. return nil, &googleapi.Error{
  32362. Code: res.StatusCode,
  32363. Header: res.Header,
  32364. }
  32365. }
  32366. if err != nil {
  32367. return nil, err
  32368. }
  32369. defer googleapi.CloseBody(res)
  32370. if err := googleapi.CheckResponse(res); err != nil {
  32371. return nil, err
  32372. }
  32373. ret := &OperatingSystemVersion{
  32374. ServerResponse: googleapi.ServerResponse{
  32375. Header: res.Header,
  32376. HTTPStatusCode: res.StatusCode,
  32377. },
  32378. }
  32379. target := &ret
  32380. if err := gensupport.DecodeResponse(target, res); err != nil {
  32381. return nil, err
  32382. }
  32383. return ret, nil
  32384. // {
  32385. // "description": "Gets one operating system version by ID.",
  32386. // "httpMethod": "GET",
  32387. // "id": "dfareporting.operatingSystemVersions.get",
  32388. // "parameterOrder": [
  32389. // "profileId",
  32390. // "id"
  32391. // ],
  32392. // "parameters": {
  32393. // "id": {
  32394. // "description": "Operating system version ID.",
  32395. // "format": "int64",
  32396. // "location": "path",
  32397. // "required": true,
  32398. // "type": "string"
  32399. // },
  32400. // "profileId": {
  32401. // "description": "User profile ID associated with this request.",
  32402. // "format": "int64",
  32403. // "location": "path",
  32404. // "required": true,
  32405. // "type": "string"
  32406. // }
  32407. // },
  32408. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  32409. // "response": {
  32410. // "$ref": "OperatingSystemVersion"
  32411. // },
  32412. // "scopes": [
  32413. // "https://www.googleapis.com/auth/dfatrafficking"
  32414. // ]
  32415. // }
  32416. }
  32417. // method id "dfareporting.operatingSystemVersions.list":
  32418. type OperatingSystemVersionsListCall struct {
  32419. s *Service
  32420. profileId int64
  32421. urlParams_ gensupport.URLParams
  32422. ifNoneMatch_ string
  32423. ctx_ context.Context
  32424. header_ http.Header
  32425. }
  32426. // List: Retrieves a list of operating system versions.
  32427. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  32428. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32429. c.profileId = profileId
  32430. return c
  32431. }
  32432. // Fields allows partial responses to be retrieved. See
  32433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32434. // for more information.
  32435. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  32436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32437. return c
  32438. }
  32439. // IfNoneMatch sets the optional parameter which makes the operation
  32440. // fail if the object's ETag matches the given value. This is useful for
  32441. // getting updates only after the object has changed since the last
  32442. // request. Use googleapi.IsNotModified to check whether the response
  32443. // error from Do is the result of In-None-Match.
  32444. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  32445. c.ifNoneMatch_ = entityTag
  32446. return c
  32447. }
  32448. // Context sets the context to be used in this call's Do method. Any
  32449. // pending HTTP request will be aborted if the provided context is
  32450. // canceled.
  32451. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  32452. c.ctx_ = ctx
  32453. return c
  32454. }
  32455. // Header returns an http.Header that can be modified by the caller to
  32456. // add HTTP headers to the request.
  32457. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  32458. if c.header_ == nil {
  32459. c.header_ = make(http.Header)
  32460. }
  32461. return c.header_
  32462. }
  32463. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  32464. reqHeaders := make(http.Header)
  32465. for k, v := range c.header_ {
  32466. reqHeaders[k] = v
  32467. }
  32468. reqHeaders.Set("User-Agent", c.s.userAgent())
  32469. if c.ifNoneMatch_ != "" {
  32470. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32471. }
  32472. var body io.Reader = nil
  32473. c.urlParams_.Set("alt", alt)
  32474. c.urlParams_.Set("prettyPrint", "false")
  32475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  32476. urls += "?" + c.urlParams_.Encode()
  32477. req, err := http.NewRequest("GET", urls, body)
  32478. if err != nil {
  32479. return nil, err
  32480. }
  32481. req.Header = reqHeaders
  32482. googleapi.Expand(req.URL, map[string]string{
  32483. "profileId": strconv.FormatInt(c.profileId, 10),
  32484. })
  32485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32486. }
  32487. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  32488. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  32489. // non-nil. Any non-2xx status code is an error. Response headers are in
  32490. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  32491. // (if a response was returned at all) in
  32492. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  32493. // whether the returned error was because http.StatusNotModified was
  32494. // returned.
  32495. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  32496. gensupport.SetOptions(c.urlParams_, opts...)
  32497. res, err := c.doRequest("json")
  32498. if res != nil && res.StatusCode == http.StatusNotModified {
  32499. if res.Body != nil {
  32500. res.Body.Close()
  32501. }
  32502. return nil, &googleapi.Error{
  32503. Code: res.StatusCode,
  32504. Header: res.Header,
  32505. }
  32506. }
  32507. if err != nil {
  32508. return nil, err
  32509. }
  32510. defer googleapi.CloseBody(res)
  32511. if err := googleapi.CheckResponse(res); err != nil {
  32512. return nil, err
  32513. }
  32514. ret := &OperatingSystemVersionsListResponse{
  32515. ServerResponse: googleapi.ServerResponse{
  32516. Header: res.Header,
  32517. HTTPStatusCode: res.StatusCode,
  32518. },
  32519. }
  32520. target := &ret
  32521. if err := gensupport.DecodeResponse(target, res); err != nil {
  32522. return nil, err
  32523. }
  32524. return ret, nil
  32525. // {
  32526. // "description": "Retrieves a list of operating system versions.",
  32527. // "httpMethod": "GET",
  32528. // "id": "dfareporting.operatingSystemVersions.list",
  32529. // "parameterOrder": [
  32530. // "profileId"
  32531. // ],
  32532. // "parameters": {
  32533. // "profileId": {
  32534. // "description": "User profile ID associated with this request.",
  32535. // "format": "int64",
  32536. // "location": "path",
  32537. // "required": true,
  32538. // "type": "string"
  32539. // }
  32540. // },
  32541. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  32542. // "response": {
  32543. // "$ref": "OperatingSystemVersionsListResponse"
  32544. // },
  32545. // "scopes": [
  32546. // "https://www.googleapis.com/auth/dfatrafficking"
  32547. // ]
  32548. // }
  32549. }
  32550. // method id "dfareporting.operatingSystems.get":
  32551. type OperatingSystemsGetCall struct {
  32552. s *Service
  32553. profileId int64
  32554. dartId int64
  32555. urlParams_ gensupport.URLParams
  32556. ifNoneMatch_ string
  32557. ctx_ context.Context
  32558. header_ http.Header
  32559. }
  32560. // Get: Gets one operating system by DART ID.
  32561. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  32562. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32563. c.profileId = profileId
  32564. c.dartId = dartId
  32565. return c
  32566. }
  32567. // Fields allows partial responses to be retrieved. See
  32568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32569. // for more information.
  32570. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  32571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32572. return c
  32573. }
  32574. // IfNoneMatch sets the optional parameter which makes the operation
  32575. // fail if the object's ETag matches the given value. This is useful for
  32576. // getting updates only after the object has changed since the last
  32577. // request. Use googleapi.IsNotModified to check whether the response
  32578. // error from Do is the result of In-None-Match.
  32579. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  32580. c.ifNoneMatch_ = entityTag
  32581. return c
  32582. }
  32583. // Context sets the context to be used in this call's Do method. Any
  32584. // pending HTTP request will be aborted if the provided context is
  32585. // canceled.
  32586. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  32587. c.ctx_ = ctx
  32588. return c
  32589. }
  32590. // Header returns an http.Header that can be modified by the caller to
  32591. // add HTTP headers to the request.
  32592. func (c *OperatingSystemsGetCall) Header() http.Header {
  32593. if c.header_ == nil {
  32594. c.header_ = make(http.Header)
  32595. }
  32596. return c.header_
  32597. }
  32598. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  32599. reqHeaders := make(http.Header)
  32600. for k, v := range c.header_ {
  32601. reqHeaders[k] = v
  32602. }
  32603. reqHeaders.Set("User-Agent", c.s.userAgent())
  32604. if c.ifNoneMatch_ != "" {
  32605. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32606. }
  32607. var body io.Reader = nil
  32608. c.urlParams_.Set("alt", alt)
  32609. c.urlParams_.Set("prettyPrint", "false")
  32610. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  32611. urls += "?" + c.urlParams_.Encode()
  32612. req, err := http.NewRequest("GET", urls, body)
  32613. if err != nil {
  32614. return nil, err
  32615. }
  32616. req.Header = reqHeaders
  32617. googleapi.Expand(req.URL, map[string]string{
  32618. "profileId": strconv.FormatInt(c.profileId, 10),
  32619. "dartId": strconv.FormatInt(c.dartId, 10),
  32620. })
  32621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32622. }
  32623. // Do executes the "dfareporting.operatingSystems.get" call.
  32624. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  32625. // status code is an error. Response headers are in either
  32626. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  32627. // at all) in error.(*googleapi.Error).Header. Use
  32628. // googleapi.IsNotModified to check whether the returned error was
  32629. // because http.StatusNotModified was returned.
  32630. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  32631. gensupport.SetOptions(c.urlParams_, opts...)
  32632. res, err := c.doRequest("json")
  32633. if res != nil && res.StatusCode == http.StatusNotModified {
  32634. if res.Body != nil {
  32635. res.Body.Close()
  32636. }
  32637. return nil, &googleapi.Error{
  32638. Code: res.StatusCode,
  32639. Header: res.Header,
  32640. }
  32641. }
  32642. if err != nil {
  32643. return nil, err
  32644. }
  32645. defer googleapi.CloseBody(res)
  32646. if err := googleapi.CheckResponse(res); err != nil {
  32647. return nil, err
  32648. }
  32649. ret := &OperatingSystem{
  32650. ServerResponse: googleapi.ServerResponse{
  32651. Header: res.Header,
  32652. HTTPStatusCode: res.StatusCode,
  32653. },
  32654. }
  32655. target := &ret
  32656. if err := gensupport.DecodeResponse(target, res); err != nil {
  32657. return nil, err
  32658. }
  32659. return ret, nil
  32660. // {
  32661. // "description": "Gets one operating system by DART ID.",
  32662. // "httpMethod": "GET",
  32663. // "id": "dfareporting.operatingSystems.get",
  32664. // "parameterOrder": [
  32665. // "profileId",
  32666. // "dartId"
  32667. // ],
  32668. // "parameters": {
  32669. // "dartId": {
  32670. // "description": "Operating system DART ID.",
  32671. // "format": "int64",
  32672. // "location": "path",
  32673. // "required": true,
  32674. // "type": "string"
  32675. // },
  32676. // "profileId": {
  32677. // "description": "User profile ID associated with this request.",
  32678. // "format": "int64",
  32679. // "location": "path",
  32680. // "required": true,
  32681. // "type": "string"
  32682. // }
  32683. // },
  32684. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  32685. // "response": {
  32686. // "$ref": "OperatingSystem"
  32687. // },
  32688. // "scopes": [
  32689. // "https://www.googleapis.com/auth/dfatrafficking"
  32690. // ]
  32691. // }
  32692. }
  32693. // method id "dfareporting.operatingSystems.list":
  32694. type OperatingSystemsListCall struct {
  32695. s *Service
  32696. profileId int64
  32697. urlParams_ gensupport.URLParams
  32698. ifNoneMatch_ string
  32699. ctx_ context.Context
  32700. header_ http.Header
  32701. }
  32702. // List: Retrieves a list of operating systems.
  32703. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  32704. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32705. c.profileId = profileId
  32706. return c
  32707. }
  32708. // Fields allows partial responses to be retrieved. See
  32709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32710. // for more information.
  32711. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  32712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32713. return c
  32714. }
  32715. // IfNoneMatch sets the optional parameter which makes the operation
  32716. // fail if the object's ETag matches the given value. This is useful for
  32717. // getting updates only after the object has changed since the last
  32718. // request. Use googleapi.IsNotModified to check whether the response
  32719. // error from Do is the result of In-None-Match.
  32720. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  32721. c.ifNoneMatch_ = entityTag
  32722. return c
  32723. }
  32724. // Context sets the context to be used in this call's Do method. Any
  32725. // pending HTTP request will be aborted if the provided context is
  32726. // canceled.
  32727. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  32728. c.ctx_ = ctx
  32729. return c
  32730. }
  32731. // Header returns an http.Header that can be modified by the caller to
  32732. // add HTTP headers to the request.
  32733. func (c *OperatingSystemsListCall) Header() http.Header {
  32734. if c.header_ == nil {
  32735. c.header_ = make(http.Header)
  32736. }
  32737. return c.header_
  32738. }
  32739. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  32740. reqHeaders := make(http.Header)
  32741. for k, v := range c.header_ {
  32742. reqHeaders[k] = v
  32743. }
  32744. reqHeaders.Set("User-Agent", c.s.userAgent())
  32745. if c.ifNoneMatch_ != "" {
  32746. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32747. }
  32748. var body io.Reader = nil
  32749. c.urlParams_.Set("alt", alt)
  32750. c.urlParams_.Set("prettyPrint", "false")
  32751. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  32752. urls += "?" + c.urlParams_.Encode()
  32753. req, err := http.NewRequest("GET", urls, body)
  32754. if err != nil {
  32755. return nil, err
  32756. }
  32757. req.Header = reqHeaders
  32758. googleapi.Expand(req.URL, map[string]string{
  32759. "profileId": strconv.FormatInt(c.profileId, 10),
  32760. })
  32761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32762. }
  32763. // Do executes the "dfareporting.operatingSystems.list" call.
  32764. // Exactly one of *OperatingSystemsListResponse or error will be
  32765. // non-nil. Any non-2xx status code is an error. Response headers are in
  32766. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  32767. // response was returned at all) in error.(*googleapi.Error).Header. Use
  32768. // googleapi.IsNotModified to check whether the returned error was
  32769. // because http.StatusNotModified was returned.
  32770. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  32771. gensupport.SetOptions(c.urlParams_, opts...)
  32772. res, err := c.doRequest("json")
  32773. if res != nil && res.StatusCode == http.StatusNotModified {
  32774. if res.Body != nil {
  32775. res.Body.Close()
  32776. }
  32777. return nil, &googleapi.Error{
  32778. Code: res.StatusCode,
  32779. Header: res.Header,
  32780. }
  32781. }
  32782. if err != nil {
  32783. return nil, err
  32784. }
  32785. defer googleapi.CloseBody(res)
  32786. if err := googleapi.CheckResponse(res); err != nil {
  32787. return nil, err
  32788. }
  32789. ret := &OperatingSystemsListResponse{
  32790. ServerResponse: googleapi.ServerResponse{
  32791. Header: res.Header,
  32792. HTTPStatusCode: res.StatusCode,
  32793. },
  32794. }
  32795. target := &ret
  32796. if err := gensupport.DecodeResponse(target, res); err != nil {
  32797. return nil, err
  32798. }
  32799. return ret, nil
  32800. // {
  32801. // "description": "Retrieves a list of operating systems.",
  32802. // "httpMethod": "GET",
  32803. // "id": "dfareporting.operatingSystems.list",
  32804. // "parameterOrder": [
  32805. // "profileId"
  32806. // ],
  32807. // "parameters": {
  32808. // "profileId": {
  32809. // "description": "User profile ID associated with this request.",
  32810. // "format": "int64",
  32811. // "location": "path",
  32812. // "required": true,
  32813. // "type": "string"
  32814. // }
  32815. // },
  32816. // "path": "userprofiles/{profileId}/operatingSystems",
  32817. // "response": {
  32818. // "$ref": "OperatingSystemsListResponse"
  32819. // },
  32820. // "scopes": [
  32821. // "https://www.googleapis.com/auth/dfatrafficking"
  32822. // ]
  32823. // }
  32824. }
  32825. // method id "dfareporting.orderDocuments.get":
  32826. type OrderDocumentsGetCall struct {
  32827. s *Service
  32828. profileId int64
  32829. projectId int64
  32830. id int64
  32831. urlParams_ gensupport.URLParams
  32832. ifNoneMatch_ string
  32833. ctx_ context.Context
  32834. header_ http.Header
  32835. }
  32836. // Get: Gets one order document by ID.
  32837. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  32838. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32839. c.profileId = profileId
  32840. c.projectId = projectId
  32841. c.id = id
  32842. return c
  32843. }
  32844. // Fields allows partial responses to be retrieved. See
  32845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32846. // for more information.
  32847. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  32848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32849. return c
  32850. }
  32851. // IfNoneMatch sets the optional parameter which makes the operation
  32852. // fail if the object's ETag matches the given value. This is useful for
  32853. // getting updates only after the object has changed since the last
  32854. // request. Use googleapi.IsNotModified to check whether the response
  32855. // error from Do is the result of In-None-Match.
  32856. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  32857. c.ifNoneMatch_ = entityTag
  32858. return c
  32859. }
  32860. // Context sets the context to be used in this call's Do method. Any
  32861. // pending HTTP request will be aborted if the provided context is
  32862. // canceled.
  32863. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  32864. c.ctx_ = ctx
  32865. return c
  32866. }
  32867. // Header returns an http.Header that can be modified by the caller to
  32868. // add HTTP headers to the request.
  32869. func (c *OrderDocumentsGetCall) Header() http.Header {
  32870. if c.header_ == nil {
  32871. c.header_ = make(http.Header)
  32872. }
  32873. return c.header_
  32874. }
  32875. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  32876. reqHeaders := make(http.Header)
  32877. for k, v := range c.header_ {
  32878. reqHeaders[k] = v
  32879. }
  32880. reqHeaders.Set("User-Agent", c.s.userAgent())
  32881. if c.ifNoneMatch_ != "" {
  32882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32883. }
  32884. var body io.Reader = nil
  32885. c.urlParams_.Set("alt", alt)
  32886. c.urlParams_.Set("prettyPrint", "false")
  32887. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  32888. urls += "?" + c.urlParams_.Encode()
  32889. req, err := http.NewRequest("GET", urls, body)
  32890. if err != nil {
  32891. return nil, err
  32892. }
  32893. req.Header = reqHeaders
  32894. googleapi.Expand(req.URL, map[string]string{
  32895. "profileId": strconv.FormatInt(c.profileId, 10),
  32896. "projectId": strconv.FormatInt(c.projectId, 10),
  32897. "id": strconv.FormatInt(c.id, 10),
  32898. })
  32899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32900. }
  32901. // Do executes the "dfareporting.orderDocuments.get" call.
  32902. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  32903. // status code is an error. Response headers are in either
  32904. // *OrderDocument.ServerResponse.Header or (if a response was returned
  32905. // at all) in error.(*googleapi.Error).Header. Use
  32906. // googleapi.IsNotModified to check whether the returned error was
  32907. // because http.StatusNotModified was returned.
  32908. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  32909. gensupport.SetOptions(c.urlParams_, opts...)
  32910. res, err := c.doRequest("json")
  32911. if res != nil && res.StatusCode == http.StatusNotModified {
  32912. if res.Body != nil {
  32913. res.Body.Close()
  32914. }
  32915. return nil, &googleapi.Error{
  32916. Code: res.StatusCode,
  32917. Header: res.Header,
  32918. }
  32919. }
  32920. if err != nil {
  32921. return nil, err
  32922. }
  32923. defer googleapi.CloseBody(res)
  32924. if err := googleapi.CheckResponse(res); err != nil {
  32925. return nil, err
  32926. }
  32927. ret := &OrderDocument{
  32928. ServerResponse: googleapi.ServerResponse{
  32929. Header: res.Header,
  32930. HTTPStatusCode: res.StatusCode,
  32931. },
  32932. }
  32933. target := &ret
  32934. if err := gensupport.DecodeResponse(target, res); err != nil {
  32935. return nil, err
  32936. }
  32937. return ret, nil
  32938. // {
  32939. // "description": "Gets one order document by ID.",
  32940. // "httpMethod": "GET",
  32941. // "id": "dfareporting.orderDocuments.get",
  32942. // "parameterOrder": [
  32943. // "profileId",
  32944. // "projectId",
  32945. // "id"
  32946. // ],
  32947. // "parameters": {
  32948. // "id": {
  32949. // "description": "Order document ID.",
  32950. // "format": "int64",
  32951. // "location": "path",
  32952. // "required": true,
  32953. // "type": "string"
  32954. // },
  32955. // "profileId": {
  32956. // "description": "User profile ID associated with this request.",
  32957. // "format": "int64",
  32958. // "location": "path",
  32959. // "required": true,
  32960. // "type": "string"
  32961. // },
  32962. // "projectId": {
  32963. // "description": "Project ID for order documents.",
  32964. // "format": "int64",
  32965. // "location": "path",
  32966. // "required": true,
  32967. // "type": "string"
  32968. // }
  32969. // },
  32970. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  32971. // "response": {
  32972. // "$ref": "OrderDocument"
  32973. // },
  32974. // "scopes": [
  32975. // "https://www.googleapis.com/auth/dfatrafficking"
  32976. // ]
  32977. // }
  32978. }
  32979. // method id "dfareporting.orderDocuments.list":
  32980. type OrderDocumentsListCall struct {
  32981. s *Service
  32982. profileId int64
  32983. projectId int64
  32984. urlParams_ gensupport.URLParams
  32985. ifNoneMatch_ string
  32986. ctx_ context.Context
  32987. header_ http.Header
  32988. }
  32989. // List: Retrieves a list of order documents, possibly filtered. This
  32990. // method supports paging.
  32991. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  32992. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32993. c.profileId = profileId
  32994. c.projectId = projectId
  32995. return c
  32996. }
  32997. // Approved sets the optional parameter "approved": Select only order
  32998. // documents that have been approved by at least one user.
  32999. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  33000. c.urlParams_.Set("approved", fmt.Sprint(approved))
  33001. return c
  33002. }
  33003. // Ids sets the optional parameter "ids": Select only order documents
  33004. // with these IDs.
  33005. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  33006. var ids_ []string
  33007. for _, v := range ids {
  33008. ids_ = append(ids_, fmt.Sprint(v))
  33009. }
  33010. c.urlParams_.SetMulti("ids", ids_)
  33011. return c
  33012. }
  33013. // MaxResults sets the optional parameter "maxResults": Maximum number
  33014. // of results to return.
  33015. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  33016. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33017. return c
  33018. }
  33019. // OrderId sets the optional parameter "orderId": Select only order
  33020. // documents for specified orders.
  33021. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  33022. var orderId_ []string
  33023. for _, v := range orderId {
  33024. orderId_ = append(orderId_, fmt.Sprint(v))
  33025. }
  33026. c.urlParams_.SetMulti("orderId", orderId_)
  33027. return c
  33028. }
  33029. // PageToken sets the optional parameter "pageToken": Value of the
  33030. // nextPageToken from the previous result page.
  33031. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  33032. c.urlParams_.Set("pageToken", pageToken)
  33033. return c
  33034. }
  33035. // SearchString sets the optional parameter "searchString": Allows
  33036. // searching for order documents by name or ID. Wildcards (*) are
  33037. // allowed. For example, "orderdocument*2015" will return order
  33038. // documents with names like "orderdocument June 2015", "orderdocument
  33039. // April 2015", or simply "orderdocument 2015". Most of the searches
  33040. // also add wildcards implicitly at the start and the end of the search
  33041. // string. For example, a search string of "orderdocument" will match
  33042. // order documents with name "my orderdocument", "orderdocument 2015",
  33043. // or simply "orderdocument".
  33044. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  33045. c.urlParams_.Set("searchString", searchString)
  33046. return c
  33047. }
  33048. // SiteId sets the optional parameter "siteId": Select only order
  33049. // documents that are associated with these sites.
  33050. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  33051. var siteId_ []string
  33052. for _, v := range siteId {
  33053. siteId_ = append(siteId_, fmt.Sprint(v))
  33054. }
  33055. c.urlParams_.SetMulti("siteId", siteId_)
  33056. return c
  33057. }
  33058. // SortField sets the optional parameter "sortField": Field by which to
  33059. // sort the list.
  33060. //
  33061. // Possible values:
  33062. // "ID" (default)
  33063. // "NAME"
  33064. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  33065. c.urlParams_.Set("sortField", sortField)
  33066. return c
  33067. }
  33068. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33069. // results.
  33070. //
  33071. // Possible values:
  33072. // "ASCENDING" (default)
  33073. // "DESCENDING"
  33074. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  33075. c.urlParams_.Set("sortOrder", sortOrder)
  33076. return c
  33077. }
  33078. // Fields allows partial responses to be retrieved. See
  33079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33080. // for more information.
  33081. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  33082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33083. return c
  33084. }
  33085. // IfNoneMatch sets the optional parameter which makes the operation
  33086. // fail if the object's ETag matches the given value. This is useful for
  33087. // getting updates only after the object has changed since the last
  33088. // request. Use googleapi.IsNotModified to check whether the response
  33089. // error from Do is the result of In-None-Match.
  33090. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  33091. c.ifNoneMatch_ = entityTag
  33092. return c
  33093. }
  33094. // Context sets the context to be used in this call's Do method. Any
  33095. // pending HTTP request will be aborted if the provided context is
  33096. // canceled.
  33097. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  33098. c.ctx_ = ctx
  33099. return c
  33100. }
  33101. // Header returns an http.Header that can be modified by the caller to
  33102. // add HTTP headers to the request.
  33103. func (c *OrderDocumentsListCall) Header() http.Header {
  33104. if c.header_ == nil {
  33105. c.header_ = make(http.Header)
  33106. }
  33107. return c.header_
  33108. }
  33109. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  33110. reqHeaders := make(http.Header)
  33111. for k, v := range c.header_ {
  33112. reqHeaders[k] = v
  33113. }
  33114. reqHeaders.Set("User-Agent", c.s.userAgent())
  33115. if c.ifNoneMatch_ != "" {
  33116. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33117. }
  33118. var body io.Reader = nil
  33119. c.urlParams_.Set("alt", alt)
  33120. c.urlParams_.Set("prettyPrint", "false")
  33121. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  33122. urls += "?" + c.urlParams_.Encode()
  33123. req, err := http.NewRequest("GET", urls, body)
  33124. if err != nil {
  33125. return nil, err
  33126. }
  33127. req.Header = reqHeaders
  33128. googleapi.Expand(req.URL, map[string]string{
  33129. "profileId": strconv.FormatInt(c.profileId, 10),
  33130. "projectId": strconv.FormatInt(c.projectId, 10),
  33131. })
  33132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33133. }
  33134. // Do executes the "dfareporting.orderDocuments.list" call.
  33135. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  33136. // Any non-2xx status code is an error. Response headers are in either
  33137. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  33138. // was returned at all) in error.(*googleapi.Error).Header. Use
  33139. // googleapi.IsNotModified to check whether the returned error was
  33140. // because http.StatusNotModified was returned.
  33141. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  33142. gensupport.SetOptions(c.urlParams_, opts...)
  33143. res, err := c.doRequest("json")
  33144. if res != nil && res.StatusCode == http.StatusNotModified {
  33145. if res.Body != nil {
  33146. res.Body.Close()
  33147. }
  33148. return nil, &googleapi.Error{
  33149. Code: res.StatusCode,
  33150. Header: res.Header,
  33151. }
  33152. }
  33153. if err != nil {
  33154. return nil, err
  33155. }
  33156. defer googleapi.CloseBody(res)
  33157. if err := googleapi.CheckResponse(res); err != nil {
  33158. return nil, err
  33159. }
  33160. ret := &OrderDocumentsListResponse{
  33161. ServerResponse: googleapi.ServerResponse{
  33162. Header: res.Header,
  33163. HTTPStatusCode: res.StatusCode,
  33164. },
  33165. }
  33166. target := &ret
  33167. if err := gensupport.DecodeResponse(target, res); err != nil {
  33168. return nil, err
  33169. }
  33170. return ret, nil
  33171. // {
  33172. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  33173. // "httpMethod": "GET",
  33174. // "id": "dfareporting.orderDocuments.list",
  33175. // "parameterOrder": [
  33176. // "profileId",
  33177. // "projectId"
  33178. // ],
  33179. // "parameters": {
  33180. // "approved": {
  33181. // "description": "Select only order documents that have been approved by at least one user.",
  33182. // "location": "query",
  33183. // "type": "boolean"
  33184. // },
  33185. // "ids": {
  33186. // "description": "Select only order documents with these IDs.",
  33187. // "format": "int64",
  33188. // "location": "query",
  33189. // "repeated": true,
  33190. // "type": "string"
  33191. // },
  33192. // "maxResults": {
  33193. // "default": "1000",
  33194. // "description": "Maximum number of results to return.",
  33195. // "format": "int32",
  33196. // "location": "query",
  33197. // "maximum": "1000",
  33198. // "minimum": "0",
  33199. // "type": "integer"
  33200. // },
  33201. // "orderId": {
  33202. // "description": "Select only order documents for specified orders.",
  33203. // "format": "int64",
  33204. // "location": "query",
  33205. // "repeated": true,
  33206. // "type": "string"
  33207. // },
  33208. // "pageToken": {
  33209. // "description": "Value of the nextPageToken from the previous result page.",
  33210. // "location": "query",
  33211. // "type": "string"
  33212. // },
  33213. // "profileId": {
  33214. // "description": "User profile ID associated with this request.",
  33215. // "format": "int64",
  33216. // "location": "path",
  33217. // "required": true,
  33218. // "type": "string"
  33219. // },
  33220. // "projectId": {
  33221. // "description": "Project ID for order documents.",
  33222. // "format": "int64",
  33223. // "location": "path",
  33224. // "required": true,
  33225. // "type": "string"
  33226. // },
  33227. // "searchString": {
  33228. // "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\".",
  33229. // "location": "query",
  33230. // "type": "string"
  33231. // },
  33232. // "siteId": {
  33233. // "description": "Select only order documents that are associated with these sites.",
  33234. // "format": "int64",
  33235. // "location": "query",
  33236. // "repeated": true,
  33237. // "type": "string"
  33238. // },
  33239. // "sortField": {
  33240. // "default": "ID",
  33241. // "description": "Field by which to sort the list.",
  33242. // "enum": [
  33243. // "ID",
  33244. // "NAME"
  33245. // ],
  33246. // "enumDescriptions": [
  33247. // "",
  33248. // ""
  33249. // ],
  33250. // "location": "query",
  33251. // "type": "string"
  33252. // },
  33253. // "sortOrder": {
  33254. // "default": "ASCENDING",
  33255. // "description": "Order of sorted results.",
  33256. // "enum": [
  33257. // "ASCENDING",
  33258. // "DESCENDING"
  33259. // ],
  33260. // "enumDescriptions": [
  33261. // "",
  33262. // ""
  33263. // ],
  33264. // "location": "query",
  33265. // "type": "string"
  33266. // }
  33267. // },
  33268. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  33269. // "response": {
  33270. // "$ref": "OrderDocumentsListResponse"
  33271. // },
  33272. // "scopes": [
  33273. // "https://www.googleapis.com/auth/dfatrafficking"
  33274. // ]
  33275. // }
  33276. }
  33277. // Pages invokes f for each page of results.
  33278. // A non-nil error returned from f will halt the iteration.
  33279. // The provided context supersedes any context provided to the Context method.
  33280. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  33281. c.ctx_ = ctx
  33282. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33283. for {
  33284. x, err := c.Do()
  33285. if err != nil {
  33286. return err
  33287. }
  33288. if err := f(x); err != nil {
  33289. return err
  33290. }
  33291. if x.NextPageToken == "" {
  33292. return nil
  33293. }
  33294. c.PageToken(x.NextPageToken)
  33295. }
  33296. }
  33297. // method id "dfareporting.orders.get":
  33298. type OrdersGetCall struct {
  33299. s *Service
  33300. profileId int64
  33301. projectId int64
  33302. id int64
  33303. urlParams_ gensupport.URLParams
  33304. ifNoneMatch_ string
  33305. ctx_ context.Context
  33306. header_ http.Header
  33307. }
  33308. // Get: Gets one order by ID.
  33309. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  33310. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33311. c.profileId = profileId
  33312. c.projectId = projectId
  33313. c.id = id
  33314. return c
  33315. }
  33316. // Fields allows partial responses to be retrieved. See
  33317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33318. // for more information.
  33319. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  33320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33321. return c
  33322. }
  33323. // IfNoneMatch sets the optional parameter which makes the operation
  33324. // fail if the object's ETag matches the given value. This is useful for
  33325. // getting updates only after the object has changed since the last
  33326. // request. Use googleapi.IsNotModified to check whether the response
  33327. // error from Do is the result of In-None-Match.
  33328. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  33329. c.ifNoneMatch_ = entityTag
  33330. return c
  33331. }
  33332. // Context sets the context to be used in this call's Do method. Any
  33333. // pending HTTP request will be aborted if the provided context is
  33334. // canceled.
  33335. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  33336. c.ctx_ = ctx
  33337. return c
  33338. }
  33339. // Header returns an http.Header that can be modified by the caller to
  33340. // add HTTP headers to the request.
  33341. func (c *OrdersGetCall) Header() http.Header {
  33342. if c.header_ == nil {
  33343. c.header_ = make(http.Header)
  33344. }
  33345. return c.header_
  33346. }
  33347. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  33348. reqHeaders := make(http.Header)
  33349. for k, v := range c.header_ {
  33350. reqHeaders[k] = v
  33351. }
  33352. reqHeaders.Set("User-Agent", c.s.userAgent())
  33353. if c.ifNoneMatch_ != "" {
  33354. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33355. }
  33356. var body io.Reader = nil
  33357. c.urlParams_.Set("alt", alt)
  33358. c.urlParams_.Set("prettyPrint", "false")
  33359. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  33360. urls += "?" + c.urlParams_.Encode()
  33361. req, err := http.NewRequest("GET", urls, body)
  33362. if err != nil {
  33363. return nil, err
  33364. }
  33365. req.Header = reqHeaders
  33366. googleapi.Expand(req.URL, map[string]string{
  33367. "profileId": strconv.FormatInt(c.profileId, 10),
  33368. "projectId": strconv.FormatInt(c.projectId, 10),
  33369. "id": strconv.FormatInt(c.id, 10),
  33370. })
  33371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33372. }
  33373. // Do executes the "dfareporting.orders.get" call.
  33374. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  33375. // code is an error. Response headers are in either
  33376. // *Order.ServerResponse.Header or (if a response was returned at all)
  33377. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33378. // check whether the returned error was because http.StatusNotModified
  33379. // was returned.
  33380. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  33381. gensupport.SetOptions(c.urlParams_, opts...)
  33382. res, err := c.doRequest("json")
  33383. if res != nil && res.StatusCode == http.StatusNotModified {
  33384. if res.Body != nil {
  33385. res.Body.Close()
  33386. }
  33387. return nil, &googleapi.Error{
  33388. Code: res.StatusCode,
  33389. Header: res.Header,
  33390. }
  33391. }
  33392. if err != nil {
  33393. return nil, err
  33394. }
  33395. defer googleapi.CloseBody(res)
  33396. if err := googleapi.CheckResponse(res); err != nil {
  33397. return nil, err
  33398. }
  33399. ret := &Order{
  33400. ServerResponse: googleapi.ServerResponse{
  33401. Header: res.Header,
  33402. HTTPStatusCode: res.StatusCode,
  33403. },
  33404. }
  33405. target := &ret
  33406. if err := gensupport.DecodeResponse(target, res); err != nil {
  33407. return nil, err
  33408. }
  33409. return ret, nil
  33410. // {
  33411. // "description": "Gets one order by ID.",
  33412. // "httpMethod": "GET",
  33413. // "id": "dfareporting.orders.get",
  33414. // "parameterOrder": [
  33415. // "profileId",
  33416. // "projectId",
  33417. // "id"
  33418. // ],
  33419. // "parameters": {
  33420. // "id": {
  33421. // "description": "Order ID.",
  33422. // "format": "int64",
  33423. // "location": "path",
  33424. // "required": true,
  33425. // "type": "string"
  33426. // },
  33427. // "profileId": {
  33428. // "description": "User profile ID associated with this request.",
  33429. // "format": "int64",
  33430. // "location": "path",
  33431. // "required": true,
  33432. // "type": "string"
  33433. // },
  33434. // "projectId": {
  33435. // "description": "Project ID for orders.",
  33436. // "format": "int64",
  33437. // "location": "path",
  33438. // "required": true,
  33439. // "type": "string"
  33440. // }
  33441. // },
  33442. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  33443. // "response": {
  33444. // "$ref": "Order"
  33445. // },
  33446. // "scopes": [
  33447. // "https://www.googleapis.com/auth/dfatrafficking"
  33448. // ]
  33449. // }
  33450. }
  33451. // method id "dfareporting.orders.list":
  33452. type OrdersListCall struct {
  33453. s *Service
  33454. profileId int64
  33455. projectId int64
  33456. urlParams_ gensupport.URLParams
  33457. ifNoneMatch_ string
  33458. ctx_ context.Context
  33459. header_ http.Header
  33460. }
  33461. // List: Retrieves a list of orders, possibly filtered. This method
  33462. // supports paging.
  33463. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  33464. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33465. c.profileId = profileId
  33466. c.projectId = projectId
  33467. return c
  33468. }
  33469. // Ids sets the optional parameter "ids": Select only orders with these
  33470. // IDs.
  33471. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  33472. var ids_ []string
  33473. for _, v := range ids {
  33474. ids_ = append(ids_, fmt.Sprint(v))
  33475. }
  33476. c.urlParams_.SetMulti("ids", ids_)
  33477. return c
  33478. }
  33479. // MaxResults sets the optional parameter "maxResults": Maximum number
  33480. // of results to return.
  33481. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  33482. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33483. return c
  33484. }
  33485. // PageToken sets the optional parameter "pageToken": Value of the
  33486. // nextPageToken from the previous result page.
  33487. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  33488. c.urlParams_.Set("pageToken", pageToken)
  33489. return c
  33490. }
  33491. // SearchString sets the optional parameter "searchString": Allows
  33492. // searching for orders by name or ID. Wildcards (*) are allowed. For
  33493. // example, "order*2015" will return orders with names like "order June
  33494. // 2015", "order April 2015", or simply "order 2015". Most of the
  33495. // searches also add wildcards implicitly at the start and the end of
  33496. // the search string. For example, a search string of "order" will match
  33497. // orders with name "my order", "order 2015", or simply "order".
  33498. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  33499. c.urlParams_.Set("searchString", searchString)
  33500. return c
  33501. }
  33502. // SiteId sets the optional parameter "siteId": Select only orders that
  33503. // are associated with these site IDs.
  33504. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  33505. var siteId_ []string
  33506. for _, v := range siteId {
  33507. siteId_ = append(siteId_, fmt.Sprint(v))
  33508. }
  33509. c.urlParams_.SetMulti("siteId", siteId_)
  33510. return c
  33511. }
  33512. // SortField sets the optional parameter "sortField": Field by which to
  33513. // sort the list.
  33514. //
  33515. // Possible values:
  33516. // "ID" (default)
  33517. // "NAME"
  33518. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  33519. c.urlParams_.Set("sortField", sortField)
  33520. return c
  33521. }
  33522. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33523. // results.
  33524. //
  33525. // Possible values:
  33526. // "ASCENDING" (default)
  33527. // "DESCENDING"
  33528. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  33529. c.urlParams_.Set("sortOrder", sortOrder)
  33530. return c
  33531. }
  33532. // Fields allows partial responses to be retrieved. See
  33533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33534. // for more information.
  33535. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  33536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33537. return c
  33538. }
  33539. // IfNoneMatch sets the optional parameter which makes the operation
  33540. // fail if the object's ETag matches the given value. This is useful for
  33541. // getting updates only after the object has changed since the last
  33542. // request. Use googleapi.IsNotModified to check whether the response
  33543. // error from Do is the result of In-None-Match.
  33544. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  33545. c.ifNoneMatch_ = entityTag
  33546. return c
  33547. }
  33548. // Context sets the context to be used in this call's Do method. Any
  33549. // pending HTTP request will be aborted if the provided context is
  33550. // canceled.
  33551. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  33552. c.ctx_ = ctx
  33553. return c
  33554. }
  33555. // Header returns an http.Header that can be modified by the caller to
  33556. // add HTTP headers to the request.
  33557. func (c *OrdersListCall) Header() http.Header {
  33558. if c.header_ == nil {
  33559. c.header_ = make(http.Header)
  33560. }
  33561. return c.header_
  33562. }
  33563. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  33564. reqHeaders := make(http.Header)
  33565. for k, v := range c.header_ {
  33566. reqHeaders[k] = v
  33567. }
  33568. reqHeaders.Set("User-Agent", c.s.userAgent())
  33569. if c.ifNoneMatch_ != "" {
  33570. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33571. }
  33572. var body io.Reader = nil
  33573. c.urlParams_.Set("alt", alt)
  33574. c.urlParams_.Set("prettyPrint", "false")
  33575. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  33576. urls += "?" + c.urlParams_.Encode()
  33577. req, err := http.NewRequest("GET", urls, body)
  33578. if err != nil {
  33579. return nil, err
  33580. }
  33581. req.Header = reqHeaders
  33582. googleapi.Expand(req.URL, map[string]string{
  33583. "profileId": strconv.FormatInt(c.profileId, 10),
  33584. "projectId": strconv.FormatInt(c.projectId, 10),
  33585. })
  33586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33587. }
  33588. // Do executes the "dfareporting.orders.list" call.
  33589. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  33590. // non-2xx status code is an error. Response headers are in either
  33591. // *OrdersListResponse.ServerResponse.Header or (if a response was
  33592. // returned at all) in error.(*googleapi.Error).Header. Use
  33593. // googleapi.IsNotModified to check whether the returned error was
  33594. // because http.StatusNotModified was returned.
  33595. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  33596. gensupport.SetOptions(c.urlParams_, opts...)
  33597. res, err := c.doRequest("json")
  33598. if res != nil && res.StatusCode == http.StatusNotModified {
  33599. if res.Body != nil {
  33600. res.Body.Close()
  33601. }
  33602. return nil, &googleapi.Error{
  33603. Code: res.StatusCode,
  33604. Header: res.Header,
  33605. }
  33606. }
  33607. if err != nil {
  33608. return nil, err
  33609. }
  33610. defer googleapi.CloseBody(res)
  33611. if err := googleapi.CheckResponse(res); err != nil {
  33612. return nil, err
  33613. }
  33614. ret := &OrdersListResponse{
  33615. ServerResponse: googleapi.ServerResponse{
  33616. Header: res.Header,
  33617. HTTPStatusCode: res.StatusCode,
  33618. },
  33619. }
  33620. target := &ret
  33621. if err := gensupport.DecodeResponse(target, res); err != nil {
  33622. return nil, err
  33623. }
  33624. return ret, nil
  33625. // {
  33626. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  33627. // "httpMethod": "GET",
  33628. // "id": "dfareporting.orders.list",
  33629. // "parameterOrder": [
  33630. // "profileId",
  33631. // "projectId"
  33632. // ],
  33633. // "parameters": {
  33634. // "ids": {
  33635. // "description": "Select only orders with these IDs.",
  33636. // "format": "int64",
  33637. // "location": "query",
  33638. // "repeated": true,
  33639. // "type": "string"
  33640. // },
  33641. // "maxResults": {
  33642. // "default": "1000",
  33643. // "description": "Maximum number of results to return.",
  33644. // "format": "int32",
  33645. // "location": "query",
  33646. // "maximum": "1000",
  33647. // "minimum": "0",
  33648. // "type": "integer"
  33649. // },
  33650. // "pageToken": {
  33651. // "description": "Value of the nextPageToken from the previous result page.",
  33652. // "location": "query",
  33653. // "type": "string"
  33654. // },
  33655. // "profileId": {
  33656. // "description": "User profile ID associated with this request.",
  33657. // "format": "int64",
  33658. // "location": "path",
  33659. // "required": true,
  33660. // "type": "string"
  33661. // },
  33662. // "projectId": {
  33663. // "description": "Project ID for orders.",
  33664. // "format": "int64",
  33665. // "location": "path",
  33666. // "required": true,
  33667. // "type": "string"
  33668. // },
  33669. // "searchString": {
  33670. // "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\".",
  33671. // "location": "query",
  33672. // "type": "string"
  33673. // },
  33674. // "siteId": {
  33675. // "description": "Select only orders that are associated with these site IDs.",
  33676. // "format": "int64",
  33677. // "location": "query",
  33678. // "repeated": true,
  33679. // "type": "string"
  33680. // },
  33681. // "sortField": {
  33682. // "default": "ID",
  33683. // "description": "Field by which to sort the list.",
  33684. // "enum": [
  33685. // "ID",
  33686. // "NAME"
  33687. // ],
  33688. // "enumDescriptions": [
  33689. // "",
  33690. // ""
  33691. // ],
  33692. // "location": "query",
  33693. // "type": "string"
  33694. // },
  33695. // "sortOrder": {
  33696. // "default": "ASCENDING",
  33697. // "description": "Order of sorted results.",
  33698. // "enum": [
  33699. // "ASCENDING",
  33700. // "DESCENDING"
  33701. // ],
  33702. // "enumDescriptions": [
  33703. // "",
  33704. // ""
  33705. // ],
  33706. // "location": "query",
  33707. // "type": "string"
  33708. // }
  33709. // },
  33710. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  33711. // "response": {
  33712. // "$ref": "OrdersListResponse"
  33713. // },
  33714. // "scopes": [
  33715. // "https://www.googleapis.com/auth/dfatrafficking"
  33716. // ]
  33717. // }
  33718. }
  33719. // Pages invokes f for each page of results.
  33720. // A non-nil error returned from f will halt the iteration.
  33721. // The provided context supersedes any context provided to the Context method.
  33722. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  33723. c.ctx_ = ctx
  33724. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33725. for {
  33726. x, err := c.Do()
  33727. if err != nil {
  33728. return err
  33729. }
  33730. if err := f(x); err != nil {
  33731. return err
  33732. }
  33733. if x.NextPageToken == "" {
  33734. return nil
  33735. }
  33736. c.PageToken(x.NextPageToken)
  33737. }
  33738. }
  33739. // method id "dfareporting.placementGroups.get":
  33740. type PlacementGroupsGetCall struct {
  33741. s *Service
  33742. profileId int64
  33743. id int64
  33744. urlParams_ gensupport.URLParams
  33745. ifNoneMatch_ string
  33746. ctx_ context.Context
  33747. header_ http.Header
  33748. }
  33749. // Get: Gets one placement group by ID.
  33750. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  33751. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33752. c.profileId = profileId
  33753. c.id = id
  33754. return c
  33755. }
  33756. // Fields allows partial responses to be retrieved. See
  33757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33758. // for more information.
  33759. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  33760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33761. return c
  33762. }
  33763. // IfNoneMatch sets the optional parameter which makes the operation
  33764. // fail if the object's ETag matches the given value. This is useful for
  33765. // getting updates only after the object has changed since the last
  33766. // request. Use googleapi.IsNotModified to check whether the response
  33767. // error from Do is the result of In-None-Match.
  33768. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  33769. c.ifNoneMatch_ = entityTag
  33770. return c
  33771. }
  33772. // Context sets the context to be used in this call's Do method. Any
  33773. // pending HTTP request will be aborted if the provided context is
  33774. // canceled.
  33775. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  33776. c.ctx_ = ctx
  33777. return c
  33778. }
  33779. // Header returns an http.Header that can be modified by the caller to
  33780. // add HTTP headers to the request.
  33781. func (c *PlacementGroupsGetCall) Header() http.Header {
  33782. if c.header_ == nil {
  33783. c.header_ = make(http.Header)
  33784. }
  33785. return c.header_
  33786. }
  33787. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  33788. reqHeaders := make(http.Header)
  33789. for k, v := range c.header_ {
  33790. reqHeaders[k] = v
  33791. }
  33792. reqHeaders.Set("User-Agent", c.s.userAgent())
  33793. if c.ifNoneMatch_ != "" {
  33794. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33795. }
  33796. var body io.Reader = nil
  33797. c.urlParams_.Set("alt", alt)
  33798. c.urlParams_.Set("prettyPrint", "false")
  33799. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  33800. urls += "?" + c.urlParams_.Encode()
  33801. req, err := http.NewRequest("GET", urls, body)
  33802. if err != nil {
  33803. return nil, err
  33804. }
  33805. req.Header = reqHeaders
  33806. googleapi.Expand(req.URL, map[string]string{
  33807. "profileId": strconv.FormatInt(c.profileId, 10),
  33808. "id": strconv.FormatInt(c.id, 10),
  33809. })
  33810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33811. }
  33812. // Do executes the "dfareporting.placementGroups.get" call.
  33813. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33814. // status code is an error. Response headers are in either
  33815. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33816. // at all) in error.(*googleapi.Error).Header. Use
  33817. // googleapi.IsNotModified to check whether the returned error was
  33818. // because http.StatusNotModified was returned.
  33819. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33820. gensupport.SetOptions(c.urlParams_, opts...)
  33821. res, err := c.doRequest("json")
  33822. if res != nil && res.StatusCode == http.StatusNotModified {
  33823. if res.Body != nil {
  33824. res.Body.Close()
  33825. }
  33826. return nil, &googleapi.Error{
  33827. Code: res.StatusCode,
  33828. Header: res.Header,
  33829. }
  33830. }
  33831. if err != nil {
  33832. return nil, err
  33833. }
  33834. defer googleapi.CloseBody(res)
  33835. if err := googleapi.CheckResponse(res); err != nil {
  33836. return nil, err
  33837. }
  33838. ret := &PlacementGroup{
  33839. ServerResponse: googleapi.ServerResponse{
  33840. Header: res.Header,
  33841. HTTPStatusCode: res.StatusCode,
  33842. },
  33843. }
  33844. target := &ret
  33845. if err := gensupport.DecodeResponse(target, res); err != nil {
  33846. return nil, err
  33847. }
  33848. return ret, nil
  33849. // {
  33850. // "description": "Gets one placement group by ID.",
  33851. // "httpMethod": "GET",
  33852. // "id": "dfareporting.placementGroups.get",
  33853. // "parameterOrder": [
  33854. // "profileId",
  33855. // "id"
  33856. // ],
  33857. // "parameters": {
  33858. // "id": {
  33859. // "description": "Placement group ID.",
  33860. // "format": "int64",
  33861. // "location": "path",
  33862. // "required": true,
  33863. // "type": "string"
  33864. // },
  33865. // "profileId": {
  33866. // "description": "User profile ID associated with this request.",
  33867. // "format": "int64",
  33868. // "location": "path",
  33869. // "required": true,
  33870. // "type": "string"
  33871. // }
  33872. // },
  33873. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  33874. // "response": {
  33875. // "$ref": "PlacementGroup"
  33876. // },
  33877. // "scopes": [
  33878. // "https://www.googleapis.com/auth/dfatrafficking"
  33879. // ]
  33880. // }
  33881. }
  33882. // method id "dfareporting.placementGroups.insert":
  33883. type PlacementGroupsInsertCall struct {
  33884. s *Service
  33885. profileId int64
  33886. placementgroup *PlacementGroup
  33887. urlParams_ gensupport.URLParams
  33888. ctx_ context.Context
  33889. header_ http.Header
  33890. }
  33891. // Insert: Inserts a new placement group.
  33892. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  33893. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33894. c.profileId = profileId
  33895. c.placementgroup = placementgroup
  33896. return c
  33897. }
  33898. // Fields allows partial responses to be retrieved. See
  33899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33900. // for more information.
  33901. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  33902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33903. return c
  33904. }
  33905. // Context sets the context to be used in this call's Do method. Any
  33906. // pending HTTP request will be aborted if the provided context is
  33907. // canceled.
  33908. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  33909. c.ctx_ = ctx
  33910. return c
  33911. }
  33912. // Header returns an http.Header that can be modified by the caller to
  33913. // add HTTP headers to the request.
  33914. func (c *PlacementGroupsInsertCall) Header() http.Header {
  33915. if c.header_ == nil {
  33916. c.header_ = make(http.Header)
  33917. }
  33918. return c.header_
  33919. }
  33920. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  33921. reqHeaders := make(http.Header)
  33922. for k, v := range c.header_ {
  33923. reqHeaders[k] = v
  33924. }
  33925. reqHeaders.Set("User-Agent", c.s.userAgent())
  33926. var body io.Reader = nil
  33927. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33928. if err != nil {
  33929. return nil, err
  33930. }
  33931. reqHeaders.Set("Content-Type", "application/json")
  33932. c.urlParams_.Set("alt", alt)
  33933. c.urlParams_.Set("prettyPrint", "false")
  33934. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33935. urls += "?" + c.urlParams_.Encode()
  33936. req, err := http.NewRequest("POST", urls, body)
  33937. if err != nil {
  33938. return nil, err
  33939. }
  33940. req.Header = reqHeaders
  33941. googleapi.Expand(req.URL, map[string]string{
  33942. "profileId": strconv.FormatInt(c.profileId, 10),
  33943. })
  33944. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33945. }
  33946. // Do executes the "dfareporting.placementGroups.insert" call.
  33947. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33948. // status code is an error. Response headers are in either
  33949. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33950. // at all) in error.(*googleapi.Error).Header. Use
  33951. // googleapi.IsNotModified to check whether the returned error was
  33952. // because http.StatusNotModified was returned.
  33953. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33954. gensupport.SetOptions(c.urlParams_, opts...)
  33955. res, err := c.doRequest("json")
  33956. if res != nil && res.StatusCode == http.StatusNotModified {
  33957. if res.Body != nil {
  33958. res.Body.Close()
  33959. }
  33960. return nil, &googleapi.Error{
  33961. Code: res.StatusCode,
  33962. Header: res.Header,
  33963. }
  33964. }
  33965. if err != nil {
  33966. return nil, err
  33967. }
  33968. defer googleapi.CloseBody(res)
  33969. if err := googleapi.CheckResponse(res); err != nil {
  33970. return nil, err
  33971. }
  33972. ret := &PlacementGroup{
  33973. ServerResponse: googleapi.ServerResponse{
  33974. Header: res.Header,
  33975. HTTPStatusCode: res.StatusCode,
  33976. },
  33977. }
  33978. target := &ret
  33979. if err := gensupport.DecodeResponse(target, res); err != nil {
  33980. return nil, err
  33981. }
  33982. return ret, nil
  33983. // {
  33984. // "description": "Inserts a new placement group.",
  33985. // "httpMethod": "POST",
  33986. // "id": "dfareporting.placementGroups.insert",
  33987. // "parameterOrder": [
  33988. // "profileId"
  33989. // ],
  33990. // "parameters": {
  33991. // "profileId": {
  33992. // "description": "User profile ID associated with this request.",
  33993. // "format": "int64",
  33994. // "location": "path",
  33995. // "required": true,
  33996. // "type": "string"
  33997. // }
  33998. // },
  33999. // "path": "userprofiles/{profileId}/placementGroups",
  34000. // "request": {
  34001. // "$ref": "PlacementGroup"
  34002. // },
  34003. // "response": {
  34004. // "$ref": "PlacementGroup"
  34005. // },
  34006. // "scopes": [
  34007. // "https://www.googleapis.com/auth/dfatrafficking"
  34008. // ]
  34009. // }
  34010. }
  34011. // method id "dfareporting.placementGroups.list":
  34012. type PlacementGroupsListCall struct {
  34013. s *Service
  34014. profileId int64
  34015. urlParams_ gensupport.URLParams
  34016. ifNoneMatch_ string
  34017. ctx_ context.Context
  34018. header_ http.Header
  34019. }
  34020. // List: Retrieves a list of placement groups, possibly filtered. This
  34021. // method supports paging.
  34022. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  34023. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34024. c.profileId = profileId
  34025. return c
  34026. }
  34027. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  34028. // only placement groups that belong to these advertisers.
  34029. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  34030. var advertiserIds_ []string
  34031. for _, v := range advertiserIds {
  34032. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  34033. }
  34034. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  34035. return c
  34036. }
  34037. // Archived sets the optional parameter "archived": Select only archived
  34038. // placements. Don't set this field to select both archived and
  34039. // non-archived placements.
  34040. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  34041. c.urlParams_.Set("archived", fmt.Sprint(archived))
  34042. return c
  34043. }
  34044. // CampaignIds sets the optional parameter "campaignIds": Select only
  34045. // placement groups that belong to these campaigns.
  34046. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  34047. var campaignIds_ []string
  34048. for _, v := range campaignIds {
  34049. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  34050. }
  34051. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  34052. return c
  34053. }
  34054. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  34055. // Select only placement groups that are associated with these content
  34056. // categories.
  34057. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  34058. var contentCategoryIds_ []string
  34059. for _, v := range contentCategoryIds {
  34060. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  34061. }
  34062. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  34063. return c
  34064. }
  34065. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  34066. // Select only placement groups that are associated with these directory
  34067. // sites.
  34068. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  34069. var directorySiteIds_ []string
  34070. for _, v := range directorySiteIds {
  34071. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  34072. }
  34073. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  34074. return c
  34075. }
  34076. // Ids sets the optional parameter "ids": Select only placement groups
  34077. // with these IDs.
  34078. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  34079. var ids_ []string
  34080. for _, v := range ids {
  34081. ids_ = append(ids_, fmt.Sprint(v))
  34082. }
  34083. c.urlParams_.SetMulti("ids", ids_)
  34084. return c
  34085. }
  34086. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  34087. // placements or placement groups whose end date is on or before the
  34088. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  34089. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  34090. c.urlParams_.Set("maxEndDate", maxEndDate)
  34091. return c
  34092. }
  34093. // MaxResults sets the optional parameter "maxResults": Maximum number
  34094. // of results to return.
  34095. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  34096. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34097. return c
  34098. }
  34099. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  34100. // placements or placement groups whose start date is on or before the
  34101. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  34102. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  34103. c.urlParams_.Set("maxStartDate", maxStartDate)
  34104. return c
  34105. }
  34106. // MinEndDate sets the optional parameter "minEndDate": Select only
  34107. // placements or placement groups whose end date is on or after the
  34108. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  34109. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  34110. c.urlParams_.Set("minEndDate", minEndDate)
  34111. return c
  34112. }
  34113. // MinStartDate sets the optional parameter "minStartDate": Select only
  34114. // placements or placement groups whose start date is on or after the
  34115. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  34116. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  34117. c.urlParams_.Set("minStartDate", minStartDate)
  34118. return c
  34119. }
  34120. // PageToken sets the optional parameter "pageToken": Value of the
  34121. // nextPageToken from the previous result page.
  34122. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  34123. c.urlParams_.Set("pageToken", pageToken)
  34124. return c
  34125. }
  34126. // PlacementGroupType sets the optional parameter "placementGroupType":
  34127. // Select only placement groups belonging with this group type. A
  34128. // package is a simple group of placements that acts as a single pricing
  34129. // point for a group of tags. A roadblock is a group of placements that
  34130. // not only acts as a single pricing point but also assumes that all the
  34131. // tags in it will be served at the same time. A roadblock requires one
  34132. // of its assigned placements to be marked as primary for reporting.
  34133. //
  34134. // Possible values:
  34135. // "PLACEMENT_PACKAGE"
  34136. // "PLACEMENT_ROADBLOCK"
  34137. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  34138. c.urlParams_.Set("placementGroupType", placementGroupType)
  34139. return c
  34140. }
  34141. // PlacementStrategyIds sets the optional parameter
  34142. // "placementStrategyIds": Select only placement groups that are
  34143. // associated with these placement strategies.
  34144. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  34145. var placementStrategyIds_ []string
  34146. for _, v := range placementStrategyIds {
  34147. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  34148. }
  34149. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  34150. return c
  34151. }
  34152. // PricingTypes sets the optional parameter "pricingTypes": Select only
  34153. // placement groups with these pricing types.
  34154. //
  34155. // Possible values:
  34156. // "PRICING_TYPE_CPA"
  34157. // "PRICING_TYPE_CPC"
  34158. // "PRICING_TYPE_CPM"
  34159. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  34160. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  34161. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34162. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  34163. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  34164. return c
  34165. }
  34166. // SearchString sets the optional parameter "searchString": Allows
  34167. // searching for placement groups by name or ID. Wildcards (*) are
  34168. // allowed. For example, "placement*2015" will return placement groups
  34169. // with names like "placement group June 2015", "placement group May
  34170. // 2015", or simply "placements 2015". Most of the searches also add
  34171. // wildcards implicitly at the start and the end of the search string.
  34172. // For example, a search string of "placementgroup" will match placement
  34173. // groups with name "my placementgroup", "placementgroup 2015", or
  34174. // simply "placementgroup".
  34175. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  34176. c.urlParams_.Set("searchString", searchString)
  34177. return c
  34178. }
  34179. // SiteIds sets the optional parameter "siteIds": Select only placement
  34180. // groups that are associated with these sites.
  34181. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  34182. var siteIds_ []string
  34183. for _, v := range siteIds {
  34184. siteIds_ = append(siteIds_, fmt.Sprint(v))
  34185. }
  34186. c.urlParams_.SetMulti("siteIds", siteIds_)
  34187. return c
  34188. }
  34189. // SortField sets the optional parameter "sortField": Field by which to
  34190. // sort the list.
  34191. //
  34192. // Possible values:
  34193. // "ID" (default)
  34194. // "NAME"
  34195. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  34196. c.urlParams_.Set("sortField", sortField)
  34197. return c
  34198. }
  34199. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34200. // results.
  34201. //
  34202. // Possible values:
  34203. // "ASCENDING" (default)
  34204. // "DESCENDING"
  34205. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  34206. c.urlParams_.Set("sortOrder", sortOrder)
  34207. return c
  34208. }
  34209. // Fields allows partial responses to be retrieved. See
  34210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34211. // for more information.
  34212. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  34213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34214. return c
  34215. }
  34216. // IfNoneMatch sets the optional parameter which makes the operation
  34217. // fail if the object's ETag matches the given value. This is useful for
  34218. // getting updates only after the object has changed since the last
  34219. // request. Use googleapi.IsNotModified to check whether the response
  34220. // error from Do is the result of In-None-Match.
  34221. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  34222. c.ifNoneMatch_ = entityTag
  34223. return c
  34224. }
  34225. // Context sets the context to be used in this call's Do method. Any
  34226. // pending HTTP request will be aborted if the provided context is
  34227. // canceled.
  34228. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  34229. c.ctx_ = ctx
  34230. return c
  34231. }
  34232. // Header returns an http.Header that can be modified by the caller to
  34233. // add HTTP headers to the request.
  34234. func (c *PlacementGroupsListCall) Header() http.Header {
  34235. if c.header_ == nil {
  34236. c.header_ = make(http.Header)
  34237. }
  34238. return c.header_
  34239. }
  34240. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  34241. reqHeaders := make(http.Header)
  34242. for k, v := range c.header_ {
  34243. reqHeaders[k] = v
  34244. }
  34245. reqHeaders.Set("User-Agent", c.s.userAgent())
  34246. if c.ifNoneMatch_ != "" {
  34247. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34248. }
  34249. var body io.Reader = nil
  34250. c.urlParams_.Set("alt", alt)
  34251. c.urlParams_.Set("prettyPrint", "false")
  34252. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34253. urls += "?" + c.urlParams_.Encode()
  34254. req, err := http.NewRequest("GET", urls, body)
  34255. if err != nil {
  34256. return nil, err
  34257. }
  34258. req.Header = reqHeaders
  34259. googleapi.Expand(req.URL, map[string]string{
  34260. "profileId": strconv.FormatInt(c.profileId, 10),
  34261. })
  34262. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34263. }
  34264. // Do executes the "dfareporting.placementGroups.list" call.
  34265. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  34266. // Any non-2xx status code is an error. Response headers are in either
  34267. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  34268. // was returned at all) in error.(*googleapi.Error).Header. Use
  34269. // googleapi.IsNotModified to check whether the returned error was
  34270. // because http.StatusNotModified was returned.
  34271. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  34272. gensupport.SetOptions(c.urlParams_, opts...)
  34273. res, err := c.doRequest("json")
  34274. if res != nil && res.StatusCode == http.StatusNotModified {
  34275. if res.Body != nil {
  34276. res.Body.Close()
  34277. }
  34278. return nil, &googleapi.Error{
  34279. Code: res.StatusCode,
  34280. Header: res.Header,
  34281. }
  34282. }
  34283. if err != nil {
  34284. return nil, err
  34285. }
  34286. defer googleapi.CloseBody(res)
  34287. if err := googleapi.CheckResponse(res); err != nil {
  34288. return nil, err
  34289. }
  34290. ret := &PlacementGroupsListResponse{
  34291. ServerResponse: googleapi.ServerResponse{
  34292. Header: res.Header,
  34293. HTTPStatusCode: res.StatusCode,
  34294. },
  34295. }
  34296. target := &ret
  34297. if err := gensupport.DecodeResponse(target, res); err != nil {
  34298. return nil, err
  34299. }
  34300. return ret, nil
  34301. // {
  34302. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  34303. // "httpMethod": "GET",
  34304. // "id": "dfareporting.placementGroups.list",
  34305. // "parameterOrder": [
  34306. // "profileId"
  34307. // ],
  34308. // "parameters": {
  34309. // "advertiserIds": {
  34310. // "description": "Select only placement groups that belong to these advertisers.",
  34311. // "format": "int64",
  34312. // "location": "query",
  34313. // "repeated": true,
  34314. // "type": "string"
  34315. // },
  34316. // "archived": {
  34317. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  34318. // "location": "query",
  34319. // "type": "boolean"
  34320. // },
  34321. // "campaignIds": {
  34322. // "description": "Select only placement groups that belong to these campaigns.",
  34323. // "format": "int64",
  34324. // "location": "query",
  34325. // "repeated": true,
  34326. // "type": "string"
  34327. // },
  34328. // "contentCategoryIds": {
  34329. // "description": "Select only placement groups that are associated with these content categories.",
  34330. // "format": "int64",
  34331. // "location": "query",
  34332. // "repeated": true,
  34333. // "type": "string"
  34334. // },
  34335. // "directorySiteIds": {
  34336. // "description": "Select only placement groups that are associated with these directory sites.",
  34337. // "format": "int64",
  34338. // "location": "query",
  34339. // "repeated": true,
  34340. // "type": "string"
  34341. // },
  34342. // "ids": {
  34343. // "description": "Select only placement groups with these IDs.",
  34344. // "format": "int64",
  34345. // "location": "query",
  34346. // "repeated": true,
  34347. // "type": "string"
  34348. // },
  34349. // "maxEndDate": {
  34350. // "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\".",
  34351. // "location": "query",
  34352. // "type": "string"
  34353. // },
  34354. // "maxResults": {
  34355. // "default": "800",
  34356. // "description": "Maximum number of results to return.",
  34357. // "format": "int32",
  34358. // "location": "query",
  34359. // "maximum": "800",
  34360. // "minimum": "0",
  34361. // "type": "integer"
  34362. // },
  34363. // "maxStartDate": {
  34364. // "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\".",
  34365. // "location": "query",
  34366. // "type": "string"
  34367. // },
  34368. // "minEndDate": {
  34369. // "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\".",
  34370. // "location": "query",
  34371. // "type": "string"
  34372. // },
  34373. // "minStartDate": {
  34374. // "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\".",
  34375. // "location": "query",
  34376. // "type": "string"
  34377. // },
  34378. // "pageToken": {
  34379. // "description": "Value of the nextPageToken from the previous result page.",
  34380. // "location": "query",
  34381. // "type": "string"
  34382. // },
  34383. // "placementGroupType": {
  34384. // "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.",
  34385. // "enum": [
  34386. // "PLACEMENT_PACKAGE",
  34387. // "PLACEMENT_ROADBLOCK"
  34388. // ],
  34389. // "enumDescriptions": [
  34390. // "",
  34391. // ""
  34392. // ],
  34393. // "location": "query",
  34394. // "type": "string"
  34395. // },
  34396. // "placementStrategyIds": {
  34397. // "description": "Select only placement groups that are associated with these placement strategies.",
  34398. // "format": "int64",
  34399. // "location": "query",
  34400. // "repeated": true,
  34401. // "type": "string"
  34402. // },
  34403. // "pricingTypes": {
  34404. // "description": "Select only placement groups with these pricing types.",
  34405. // "enum": [
  34406. // "PRICING_TYPE_CPA",
  34407. // "PRICING_TYPE_CPC",
  34408. // "PRICING_TYPE_CPM",
  34409. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  34410. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  34411. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34412. // ],
  34413. // "enumDescriptions": [
  34414. // "",
  34415. // "",
  34416. // "",
  34417. // "",
  34418. // "",
  34419. // ""
  34420. // ],
  34421. // "location": "query",
  34422. // "repeated": true,
  34423. // "type": "string"
  34424. // },
  34425. // "profileId": {
  34426. // "description": "User profile ID associated with this request.",
  34427. // "format": "int64",
  34428. // "location": "path",
  34429. // "required": true,
  34430. // "type": "string"
  34431. // },
  34432. // "searchString": {
  34433. // "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\".",
  34434. // "location": "query",
  34435. // "type": "string"
  34436. // },
  34437. // "siteIds": {
  34438. // "description": "Select only placement groups that are associated with these sites.",
  34439. // "format": "int64",
  34440. // "location": "query",
  34441. // "repeated": true,
  34442. // "type": "string"
  34443. // },
  34444. // "sortField": {
  34445. // "default": "ID",
  34446. // "description": "Field by which to sort the list.",
  34447. // "enum": [
  34448. // "ID",
  34449. // "NAME"
  34450. // ],
  34451. // "enumDescriptions": [
  34452. // "",
  34453. // ""
  34454. // ],
  34455. // "location": "query",
  34456. // "type": "string"
  34457. // },
  34458. // "sortOrder": {
  34459. // "default": "ASCENDING",
  34460. // "description": "Order of sorted results.",
  34461. // "enum": [
  34462. // "ASCENDING",
  34463. // "DESCENDING"
  34464. // ],
  34465. // "enumDescriptions": [
  34466. // "",
  34467. // ""
  34468. // ],
  34469. // "location": "query",
  34470. // "type": "string"
  34471. // }
  34472. // },
  34473. // "path": "userprofiles/{profileId}/placementGroups",
  34474. // "response": {
  34475. // "$ref": "PlacementGroupsListResponse"
  34476. // },
  34477. // "scopes": [
  34478. // "https://www.googleapis.com/auth/dfatrafficking"
  34479. // ]
  34480. // }
  34481. }
  34482. // Pages invokes f for each page of results.
  34483. // A non-nil error returned from f will halt the iteration.
  34484. // The provided context supersedes any context provided to the Context method.
  34485. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  34486. c.ctx_ = ctx
  34487. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34488. for {
  34489. x, err := c.Do()
  34490. if err != nil {
  34491. return err
  34492. }
  34493. if err := f(x); err != nil {
  34494. return err
  34495. }
  34496. if x.NextPageToken == "" {
  34497. return nil
  34498. }
  34499. c.PageToken(x.NextPageToken)
  34500. }
  34501. }
  34502. // method id "dfareporting.placementGroups.patch":
  34503. type PlacementGroupsPatchCall struct {
  34504. s *Service
  34505. profileId int64
  34506. placementgroup *PlacementGroup
  34507. urlParams_ gensupport.URLParams
  34508. ctx_ context.Context
  34509. header_ http.Header
  34510. }
  34511. // Patch: Updates an existing placement group. This method supports
  34512. // patch semantics.
  34513. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  34514. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34515. c.profileId = profileId
  34516. c.urlParams_.Set("id", fmt.Sprint(id))
  34517. c.placementgroup = placementgroup
  34518. return c
  34519. }
  34520. // Fields allows partial responses to be retrieved. See
  34521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34522. // for more information.
  34523. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  34524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34525. return c
  34526. }
  34527. // Context sets the context to be used in this call's Do method. Any
  34528. // pending HTTP request will be aborted if the provided context is
  34529. // canceled.
  34530. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  34531. c.ctx_ = ctx
  34532. return c
  34533. }
  34534. // Header returns an http.Header that can be modified by the caller to
  34535. // add HTTP headers to the request.
  34536. func (c *PlacementGroupsPatchCall) Header() http.Header {
  34537. if c.header_ == nil {
  34538. c.header_ = make(http.Header)
  34539. }
  34540. return c.header_
  34541. }
  34542. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  34543. reqHeaders := make(http.Header)
  34544. for k, v := range c.header_ {
  34545. reqHeaders[k] = v
  34546. }
  34547. reqHeaders.Set("User-Agent", c.s.userAgent())
  34548. var body io.Reader = nil
  34549. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34550. if err != nil {
  34551. return nil, err
  34552. }
  34553. reqHeaders.Set("Content-Type", "application/json")
  34554. c.urlParams_.Set("alt", alt)
  34555. c.urlParams_.Set("prettyPrint", "false")
  34556. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34557. urls += "?" + c.urlParams_.Encode()
  34558. req, err := http.NewRequest("PATCH", urls, body)
  34559. if err != nil {
  34560. return nil, err
  34561. }
  34562. req.Header = reqHeaders
  34563. googleapi.Expand(req.URL, map[string]string{
  34564. "profileId": strconv.FormatInt(c.profileId, 10),
  34565. })
  34566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34567. }
  34568. // Do executes the "dfareporting.placementGroups.patch" call.
  34569. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34570. // status code is an error. Response headers are in either
  34571. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34572. // at all) in error.(*googleapi.Error).Header. Use
  34573. // googleapi.IsNotModified to check whether the returned error was
  34574. // because http.StatusNotModified was returned.
  34575. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34576. gensupport.SetOptions(c.urlParams_, opts...)
  34577. res, err := c.doRequest("json")
  34578. if res != nil && res.StatusCode == http.StatusNotModified {
  34579. if res.Body != nil {
  34580. res.Body.Close()
  34581. }
  34582. return nil, &googleapi.Error{
  34583. Code: res.StatusCode,
  34584. Header: res.Header,
  34585. }
  34586. }
  34587. if err != nil {
  34588. return nil, err
  34589. }
  34590. defer googleapi.CloseBody(res)
  34591. if err := googleapi.CheckResponse(res); err != nil {
  34592. return nil, err
  34593. }
  34594. ret := &PlacementGroup{
  34595. ServerResponse: googleapi.ServerResponse{
  34596. Header: res.Header,
  34597. HTTPStatusCode: res.StatusCode,
  34598. },
  34599. }
  34600. target := &ret
  34601. if err := gensupport.DecodeResponse(target, res); err != nil {
  34602. return nil, err
  34603. }
  34604. return ret, nil
  34605. // {
  34606. // "description": "Updates an existing placement group. This method supports patch semantics.",
  34607. // "httpMethod": "PATCH",
  34608. // "id": "dfareporting.placementGroups.patch",
  34609. // "parameterOrder": [
  34610. // "profileId",
  34611. // "id"
  34612. // ],
  34613. // "parameters": {
  34614. // "id": {
  34615. // "description": "Placement group ID.",
  34616. // "format": "int64",
  34617. // "location": "query",
  34618. // "required": true,
  34619. // "type": "string"
  34620. // },
  34621. // "profileId": {
  34622. // "description": "User profile ID associated with this request.",
  34623. // "format": "int64",
  34624. // "location": "path",
  34625. // "required": true,
  34626. // "type": "string"
  34627. // }
  34628. // },
  34629. // "path": "userprofiles/{profileId}/placementGroups",
  34630. // "request": {
  34631. // "$ref": "PlacementGroup"
  34632. // },
  34633. // "response": {
  34634. // "$ref": "PlacementGroup"
  34635. // },
  34636. // "scopes": [
  34637. // "https://www.googleapis.com/auth/dfatrafficking"
  34638. // ]
  34639. // }
  34640. }
  34641. // method id "dfareporting.placementGroups.update":
  34642. type PlacementGroupsUpdateCall struct {
  34643. s *Service
  34644. profileId int64
  34645. placementgroup *PlacementGroup
  34646. urlParams_ gensupport.URLParams
  34647. ctx_ context.Context
  34648. header_ http.Header
  34649. }
  34650. // Update: Updates an existing placement group.
  34651. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  34652. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34653. c.profileId = profileId
  34654. c.placementgroup = placementgroup
  34655. return c
  34656. }
  34657. // Fields allows partial responses to be retrieved. See
  34658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34659. // for more information.
  34660. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  34661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34662. return c
  34663. }
  34664. // Context sets the context to be used in this call's Do method. Any
  34665. // pending HTTP request will be aborted if the provided context is
  34666. // canceled.
  34667. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  34668. c.ctx_ = ctx
  34669. return c
  34670. }
  34671. // Header returns an http.Header that can be modified by the caller to
  34672. // add HTTP headers to the request.
  34673. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  34674. if c.header_ == nil {
  34675. c.header_ = make(http.Header)
  34676. }
  34677. return c.header_
  34678. }
  34679. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  34680. reqHeaders := make(http.Header)
  34681. for k, v := range c.header_ {
  34682. reqHeaders[k] = v
  34683. }
  34684. reqHeaders.Set("User-Agent", c.s.userAgent())
  34685. var body io.Reader = nil
  34686. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34687. if err != nil {
  34688. return nil, err
  34689. }
  34690. reqHeaders.Set("Content-Type", "application/json")
  34691. c.urlParams_.Set("alt", alt)
  34692. c.urlParams_.Set("prettyPrint", "false")
  34693. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34694. urls += "?" + c.urlParams_.Encode()
  34695. req, err := http.NewRequest("PUT", urls, body)
  34696. if err != nil {
  34697. return nil, err
  34698. }
  34699. req.Header = reqHeaders
  34700. googleapi.Expand(req.URL, map[string]string{
  34701. "profileId": strconv.FormatInt(c.profileId, 10),
  34702. })
  34703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34704. }
  34705. // Do executes the "dfareporting.placementGroups.update" call.
  34706. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34707. // status code is an error. Response headers are in either
  34708. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34709. // at all) in error.(*googleapi.Error).Header. Use
  34710. // googleapi.IsNotModified to check whether the returned error was
  34711. // because http.StatusNotModified was returned.
  34712. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34713. gensupport.SetOptions(c.urlParams_, opts...)
  34714. res, err := c.doRequest("json")
  34715. if res != nil && res.StatusCode == http.StatusNotModified {
  34716. if res.Body != nil {
  34717. res.Body.Close()
  34718. }
  34719. return nil, &googleapi.Error{
  34720. Code: res.StatusCode,
  34721. Header: res.Header,
  34722. }
  34723. }
  34724. if err != nil {
  34725. return nil, err
  34726. }
  34727. defer googleapi.CloseBody(res)
  34728. if err := googleapi.CheckResponse(res); err != nil {
  34729. return nil, err
  34730. }
  34731. ret := &PlacementGroup{
  34732. ServerResponse: googleapi.ServerResponse{
  34733. Header: res.Header,
  34734. HTTPStatusCode: res.StatusCode,
  34735. },
  34736. }
  34737. target := &ret
  34738. if err := gensupport.DecodeResponse(target, res); err != nil {
  34739. return nil, err
  34740. }
  34741. return ret, nil
  34742. // {
  34743. // "description": "Updates an existing placement group.",
  34744. // "httpMethod": "PUT",
  34745. // "id": "dfareporting.placementGroups.update",
  34746. // "parameterOrder": [
  34747. // "profileId"
  34748. // ],
  34749. // "parameters": {
  34750. // "profileId": {
  34751. // "description": "User profile ID associated with this request.",
  34752. // "format": "int64",
  34753. // "location": "path",
  34754. // "required": true,
  34755. // "type": "string"
  34756. // }
  34757. // },
  34758. // "path": "userprofiles/{profileId}/placementGroups",
  34759. // "request": {
  34760. // "$ref": "PlacementGroup"
  34761. // },
  34762. // "response": {
  34763. // "$ref": "PlacementGroup"
  34764. // },
  34765. // "scopes": [
  34766. // "https://www.googleapis.com/auth/dfatrafficking"
  34767. // ]
  34768. // }
  34769. }
  34770. // method id "dfareporting.placementStrategies.delete":
  34771. type PlacementStrategiesDeleteCall struct {
  34772. s *Service
  34773. profileId int64
  34774. id int64
  34775. urlParams_ gensupport.URLParams
  34776. ctx_ context.Context
  34777. header_ http.Header
  34778. }
  34779. // Delete: Deletes an existing placement strategy.
  34780. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  34781. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34782. c.profileId = profileId
  34783. c.id = id
  34784. return c
  34785. }
  34786. // Fields allows partial responses to be retrieved. See
  34787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34788. // for more information.
  34789. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  34790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34791. return c
  34792. }
  34793. // Context sets the context to be used in this call's Do method. Any
  34794. // pending HTTP request will be aborted if the provided context is
  34795. // canceled.
  34796. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  34797. c.ctx_ = ctx
  34798. return c
  34799. }
  34800. // Header returns an http.Header that can be modified by the caller to
  34801. // add HTTP headers to the request.
  34802. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  34803. if c.header_ == nil {
  34804. c.header_ = make(http.Header)
  34805. }
  34806. return c.header_
  34807. }
  34808. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  34809. reqHeaders := make(http.Header)
  34810. for k, v := range c.header_ {
  34811. reqHeaders[k] = v
  34812. }
  34813. reqHeaders.Set("User-Agent", c.s.userAgent())
  34814. var body io.Reader = nil
  34815. c.urlParams_.Set("alt", alt)
  34816. c.urlParams_.Set("prettyPrint", "false")
  34817. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34818. urls += "?" + c.urlParams_.Encode()
  34819. req, err := http.NewRequest("DELETE", urls, body)
  34820. if err != nil {
  34821. return nil, err
  34822. }
  34823. req.Header = reqHeaders
  34824. googleapi.Expand(req.URL, map[string]string{
  34825. "profileId": strconv.FormatInt(c.profileId, 10),
  34826. "id": strconv.FormatInt(c.id, 10),
  34827. })
  34828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34829. }
  34830. // Do executes the "dfareporting.placementStrategies.delete" call.
  34831. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  34832. gensupport.SetOptions(c.urlParams_, opts...)
  34833. res, err := c.doRequest("json")
  34834. if err != nil {
  34835. return err
  34836. }
  34837. defer googleapi.CloseBody(res)
  34838. if err := googleapi.CheckResponse(res); err != nil {
  34839. return err
  34840. }
  34841. return nil
  34842. // {
  34843. // "description": "Deletes an existing placement strategy.",
  34844. // "httpMethod": "DELETE",
  34845. // "id": "dfareporting.placementStrategies.delete",
  34846. // "parameterOrder": [
  34847. // "profileId",
  34848. // "id"
  34849. // ],
  34850. // "parameters": {
  34851. // "id": {
  34852. // "description": "Placement strategy ID.",
  34853. // "format": "int64",
  34854. // "location": "path",
  34855. // "required": true,
  34856. // "type": "string"
  34857. // },
  34858. // "profileId": {
  34859. // "description": "User profile ID associated with this request.",
  34860. // "format": "int64",
  34861. // "location": "path",
  34862. // "required": true,
  34863. // "type": "string"
  34864. // }
  34865. // },
  34866. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34867. // "scopes": [
  34868. // "https://www.googleapis.com/auth/dfatrafficking"
  34869. // ]
  34870. // }
  34871. }
  34872. // method id "dfareporting.placementStrategies.get":
  34873. type PlacementStrategiesGetCall struct {
  34874. s *Service
  34875. profileId int64
  34876. id int64
  34877. urlParams_ gensupport.URLParams
  34878. ifNoneMatch_ string
  34879. ctx_ context.Context
  34880. header_ http.Header
  34881. }
  34882. // Get: Gets one placement strategy by ID.
  34883. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  34884. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34885. c.profileId = profileId
  34886. c.id = id
  34887. return c
  34888. }
  34889. // Fields allows partial responses to be retrieved. See
  34890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34891. // for more information.
  34892. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  34893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34894. return c
  34895. }
  34896. // IfNoneMatch sets the optional parameter which makes the operation
  34897. // fail if the object's ETag matches the given value. This is useful for
  34898. // getting updates only after the object has changed since the last
  34899. // request. Use googleapi.IsNotModified to check whether the response
  34900. // error from Do is the result of In-None-Match.
  34901. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  34902. c.ifNoneMatch_ = entityTag
  34903. return c
  34904. }
  34905. // Context sets the context to be used in this call's Do method. Any
  34906. // pending HTTP request will be aborted if the provided context is
  34907. // canceled.
  34908. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  34909. c.ctx_ = ctx
  34910. return c
  34911. }
  34912. // Header returns an http.Header that can be modified by the caller to
  34913. // add HTTP headers to the request.
  34914. func (c *PlacementStrategiesGetCall) Header() http.Header {
  34915. if c.header_ == nil {
  34916. c.header_ = make(http.Header)
  34917. }
  34918. return c.header_
  34919. }
  34920. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  34921. reqHeaders := make(http.Header)
  34922. for k, v := range c.header_ {
  34923. reqHeaders[k] = v
  34924. }
  34925. reqHeaders.Set("User-Agent", c.s.userAgent())
  34926. if c.ifNoneMatch_ != "" {
  34927. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34928. }
  34929. var body io.Reader = nil
  34930. c.urlParams_.Set("alt", alt)
  34931. c.urlParams_.Set("prettyPrint", "false")
  34932. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34933. urls += "?" + c.urlParams_.Encode()
  34934. req, err := http.NewRequest("GET", urls, body)
  34935. if err != nil {
  34936. return nil, err
  34937. }
  34938. req.Header = reqHeaders
  34939. googleapi.Expand(req.URL, map[string]string{
  34940. "profileId": strconv.FormatInt(c.profileId, 10),
  34941. "id": strconv.FormatInt(c.id, 10),
  34942. })
  34943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34944. }
  34945. // Do executes the "dfareporting.placementStrategies.get" call.
  34946. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34947. // non-2xx status code is an error. Response headers are in either
  34948. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34949. // returned at all) in error.(*googleapi.Error).Header. Use
  34950. // googleapi.IsNotModified to check whether the returned error was
  34951. // because http.StatusNotModified was returned.
  34952. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34953. gensupport.SetOptions(c.urlParams_, opts...)
  34954. res, err := c.doRequest("json")
  34955. if res != nil && res.StatusCode == http.StatusNotModified {
  34956. if res.Body != nil {
  34957. res.Body.Close()
  34958. }
  34959. return nil, &googleapi.Error{
  34960. Code: res.StatusCode,
  34961. Header: res.Header,
  34962. }
  34963. }
  34964. if err != nil {
  34965. return nil, err
  34966. }
  34967. defer googleapi.CloseBody(res)
  34968. if err := googleapi.CheckResponse(res); err != nil {
  34969. return nil, err
  34970. }
  34971. ret := &PlacementStrategy{
  34972. ServerResponse: googleapi.ServerResponse{
  34973. Header: res.Header,
  34974. HTTPStatusCode: res.StatusCode,
  34975. },
  34976. }
  34977. target := &ret
  34978. if err := gensupport.DecodeResponse(target, res); err != nil {
  34979. return nil, err
  34980. }
  34981. return ret, nil
  34982. // {
  34983. // "description": "Gets one placement strategy by ID.",
  34984. // "httpMethod": "GET",
  34985. // "id": "dfareporting.placementStrategies.get",
  34986. // "parameterOrder": [
  34987. // "profileId",
  34988. // "id"
  34989. // ],
  34990. // "parameters": {
  34991. // "id": {
  34992. // "description": "Placement strategy ID.",
  34993. // "format": "int64",
  34994. // "location": "path",
  34995. // "required": true,
  34996. // "type": "string"
  34997. // },
  34998. // "profileId": {
  34999. // "description": "User profile ID associated with this request.",
  35000. // "format": "int64",
  35001. // "location": "path",
  35002. // "required": true,
  35003. // "type": "string"
  35004. // }
  35005. // },
  35006. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  35007. // "response": {
  35008. // "$ref": "PlacementStrategy"
  35009. // },
  35010. // "scopes": [
  35011. // "https://www.googleapis.com/auth/dfatrafficking"
  35012. // ]
  35013. // }
  35014. }
  35015. // method id "dfareporting.placementStrategies.insert":
  35016. type PlacementStrategiesInsertCall struct {
  35017. s *Service
  35018. profileId int64
  35019. placementstrategy *PlacementStrategy
  35020. urlParams_ gensupport.URLParams
  35021. ctx_ context.Context
  35022. header_ http.Header
  35023. }
  35024. // Insert: Inserts a new placement strategy.
  35025. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  35026. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35027. c.profileId = profileId
  35028. c.placementstrategy = placementstrategy
  35029. return c
  35030. }
  35031. // Fields allows partial responses to be retrieved. See
  35032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35033. // for more information.
  35034. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  35035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35036. return c
  35037. }
  35038. // Context sets the context to be used in this call's Do method. Any
  35039. // pending HTTP request will be aborted if the provided context is
  35040. // canceled.
  35041. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  35042. c.ctx_ = ctx
  35043. return c
  35044. }
  35045. // Header returns an http.Header that can be modified by the caller to
  35046. // add HTTP headers to the request.
  35047. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  35048. if c.header_ == nil {
  35049. c.header_ = make(http.Header)
  35050. }
  35051. return c.header_
  35052. }
  35053. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  35054. reqHeaders := make(http.Header)
  35055. for k, v := range c.header_ {
  35056. reqHeaders[k] = v
  35057. }
  35058. reqHeaders.Set("User-Agent", c.s.userAgent())
  35059. var body io.Reader = nil
  35060. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35061. if err != nil {
  35062. return nil, err
  35063. }
  35064. reqHeaders.Set("Content-Type", "application/json")
  35065. c.urlParams_.Set("alt", alt)
  35066. c.urlParams_.Set("prettyPrint", "false")
  35067. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35068. urls += "?" + c.urlParams_.Encode()
  35069. req, err := http.NewRequest("POST", urls, body)
  35070. if err != nil {
  35071. return nil, err
  35072. }
  35073. req.Header = reqHeaders
  35074. googleapi.Expand(req.URL, map[string]string{
  35075. "profileId": strconv.FormatInt(c.profileId, 10),
  35076. })
  35077. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35078. }
  35079. // Do executes the "dfareporting.placementStrategies.insert" call.
  35080. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35081. // non-2xx status code is an error. Response headers are in either
  35082. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35083. // returned at all) in error.(*googleapi.Error).Header. Use
  35084. // googleapi.IsNotModified to check whether the returned error was
  35085. // because http.StatusNotModified was returned.
  35086. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35087. gensupport.SetOptions(c.urlParams_, opts...)
  35088. res, err := c.doRequest("json")
  35089. if res != nil && res.StatusCode == http.StatusNotModified {
  35090. if res.Body != nil {
  35091. res.Body.Close()
  35092. }
  35093. return nil, &googleapi.Error{
  35094. Code: res.StatusCode,
  35095. Header: res.Header,
  35096. }
  35097. }
  35098. if err != nil {
  35099. return nil, err
  35100. }
  35101. defer googleapi.CloseBody(res)
  35102. if err := googleapi.CheckResponse(res); err != nil {
  35103. return nil, err
  35104. }
  35105. ret := &PlacementStrategy{
  35106. ServerResponse: googleapi.ServerResponse{
  35107. Header: res.Header,
  35108. HTTPStatusCode: res.StatusCode,
  35109. },
  35110. }
  35111. target := &ret
  35112. if err := gensupport.DecodeResponse(target, res); err != nil {
  35113. return nil, err
  35114. }
  35115. return ret, nil
  35116. // {
  35117. // "description": "Inserts a new placement strategy.",
  35118. // "httpMethod": "POST",
  35119. // "id": "dfareporting.placementStrategies.insert",
  35120. // "parameterOrder": [
  35121. // "profileId"
  35122. // ],
  35123. // "parameters": {
  35124. // "profileId": {
  35125. // "description": "User profile ID associated with this request.",
  35126. // "format": "int64",
  35127. // "location": "path",
  35128. // "required": true,
  35129. // "type": "string"
  35130. // }
  35131. // },
  35132. // "path": "userprofiles/{profileId}/placementStrategies",
  35133. // "request": {
  35134. // "$ref": "PlacementStrategy"
  35135. // },
  35136. // "response": {
  35137. // "$ref": "PlacementStrategy"
  35138. // },
  35139. // "scopes": [
  35140. // "https://www.googleapis.com/auth/dfatrafficking"
  35141. // ]
  35142. // }
  35143. }
  35144. // method id "dfareporting.placementStrategies.list":
  35145. type PlacementStrategiesListCall struct {
  35146. s *Service
  35147. profileId int64
  35148. urlParams_ gensupport.URLParams
  35149. ifNoneMatch_ string
  35150. ctx_ context.Context
  35151. header_ http.Header
  35152. }
  35153. // List: Retrieves a list of placement strategies, possibly filtered.
  35154. // This method supports paging.
  35155. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  35156. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35157. c.profileId = profileId
  35158. return c
  35159. }
  35160. // Ids sets the optional parameter "ids": Select only placement
  35161. // strategies with these IDs.
  35162. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  35163. var ids_ []string
  35164. for _, v := range ids {
  35165. ids_ = append(ids_, fmt.Sprint(v))
  35166. }
  35167. c.urlParams_.SetMulti("ids", ids_)
  35168. return c
  35169. }
  35170. // MaxResults sets the optional parameter "maxResults": Maximum number
  35171. // of results to return.
  35172. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  35173. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35174. return c
  35175. }
  35176. // PageToken sets the optional parameter "pageToken": Value of the
  35177. // nextPageToken from the previous result page.
  35178. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  35179. c.urlParams_.Set("pageToken", pageToken)
  35180. return c
  35181. }
  35182. // SearchString sets the optional parameter "searchString": Allows
  35183. // searching for objects by name or ID. Wildcards (*) are allowed. For
  35184. // example, "placementstrategy*2015" will return objects with names like
  35185. // "placementstrategy June 2015", "placementstrategy April 2015", or
  35186. // simply "placementstrategy 2015". Most of the searches also add
  35187. // wildcards implicitly at the start and the end of the search string.
  35188. // For example, a search string of "placementstrategy" will match
  35189. // objects with name "my placementstrategy", "placementstrategy 2015",
  35190. // or simply "placementstrategy".
  35191. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  35192. c.urlParams_.Set("searchString", searchString)
  35193. return c
  35194. }
  35195. // SortField sets the optional parameter "sortField": Field by which to
  35196. // sort the list.
  35197. //
  35198. // Possible values:
  35199. // "ID" (default)
  35200. // "NAME"
  35201. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  35202. c.urlParams_.Set("sortField", sortField)
  35203. return c
  35204. }
  35205. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35206. // results.
  35207. //
  35208. // Possible values:
  35209. // "ASCENDING" (default)
  35210. // "DESCENDING"
  35211. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  35212. c.urlParams_.Set("sortOrder", sortOrder)
  35213. return c
  35214. }
  35215. // Fields allows partial responses to be retrieved. See
  35216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35217. // for more information.
  35218. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  35219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35220. return c
  35221. }
  35222. // IfNoneMatch sets the optional parameter which makes the operation
  35223. // fail if the object's ETag matches the given value. This is useful for
  35224. // getting updates only after the object has changed since the last
  35225. // request. Use googleapi.IsNotModified to check whether the response
  35226. // error from Do is the result of In-None-Match.
  35227. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  35228. c.ifNoneMatch_ = entityTag
  35229. return c
  35230. }
  35231. // Context sets the context to be used in this call's Do method. Any
  35232. // pending HTTP request will be aborted if the provided context is
  35233. // canceled.
  35234. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  35235. c.ctx_ = ctx
  35236. return c
  35237. }
  35238. // Header returns an http.Header that can be modified by the caller to
  35239. // add HTTP headers to the request.
  35240. func (c *PlacementStrategiesListCall) Header() http.Header {
  35241. if c.header_ == nil {
  35242. c.header_ = make(http.Header)
  35243. }
  35244. return c.header_
  35245. }
  35246. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  35247. reqHeaders := make(http.Header)
  35248. for k, v := range c.header_ {
  35249. reqHeaders[k] = v
  35250. }
  35251. reqHeaders.Set("User-Agent", c.s.userAgent())
  35252. if c.ifNoneMatch_ != "" {
  35253. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35254. }
  35255. var body io.Reader = nil
  35256. c.urlParams_.Set("alt", alt)
  35257. c.urlParams_.Set("prettyPrint", "false")
  35258. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35259. urls += "?" + c.urlParams_.Encode()
  35260. req, err := http.NewRequest("GET", urls, body)
  35261. if err != nil {
  35262. return nil, err
  35263. }
  35264. req.Header = reqHeaders
  35265. googleapi.Expand(req.URL, map[string]string{
  35266. "profileId": strconv.FormatInt(c.profileId, 10),
  35267. })
  35268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35269. }
  35270. // Do executes the "dfareporting.placementStrategies.list" call.
  35271. // Exactly one of *PlacementStrategiesListResponse or error will be
  35272. // non-nil. Any non-2xx status code is an error. Response headers are in
  35273. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  35274. // a response was returned at all) in error.(*googleapi.Error).Header.
  35275. // Use googleapi.IsNotModified to check whether the returned error was
  35276. // because http.StatusNotModified was returned.
  35277. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  35278. gensupport.SetOptions(c.urlParams_, opts...)
  35279. res, err := c.doRequest("json")
  35280. if res != nil && res.StatusCode == http.StatusNotModified {
  35281. if res.Body != nil {
  35282. res.Body.Close()
  35283. }
  35284. return nil, &googleapi.Error{
  35285. Code: res.StatusCode,
  35286. Header: res.Header,
  35287. }
  35288. }
  35289. if err != nil {
  35290. return nil, err
  35291. }
  35292. defer googleapi.CloseBody(res)
  35293. if err := googleapi.CheckResponse(res); err != nil {
  35294. return nil, err
  35295. }
  35296. ret := &PlacementStrategiesListResponse{
  35297. ServerResponse: googleapi.ServerResponse{
  35298. Header: res.Header,
  35299. HTTPStatusCode: res.StatusCode,
  35300. },
  35301. }
  35302. target := &ret
  35303. if err := gensupport.DecodeResponse(target, res); err != nil {
  35304. return nil, err
  35305. }
  35306. return ret, nil
  35307. // {
  35308. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  35309. // "httpMethod": "GET",
  35310. // "id": "dfareporting.placementStrategies.list",
  35311. // "parameterOrder": [
  35312. // "profileId"
  35313. // ],
  35314. // "parameters": {
  35315. // "ids": {
  35316. // "description": "Select only placement strategies with these IDs.",
  35317. // "format": "int64",
  35318. // "location": "query",
  35319. // "repeated": true,
  35320. // "type": "string"
  35321. // },
  35322. // "maxResults": {
  35323. // "default": "1000",
  35324. // "description": "Maximum number of results to return.",
  35325. // "format": "int32",
  35326. // "location": "query",
  35327. // "maximum": "1000",
  35328. // "minimum": "0",
  35329. // "type": "integer"
  35330. // },
  35331. // "pageToken": {
  35332. // "description": "Value of the nextPageToken from the previous result page.",
  35333. // "location": "query",
  35334. // "type": "string"
  35335. // },
  35336. // "profileId": {
  35337. // "description": "User profile ID associated with this request.",
  35338. // "format": "int64",
  35339. // "location": "path",
  35340. // "required": true,
  35341. // "type": "string"
  35342. // },
  35343. // "searchString": {
  35344. // "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\".",
  35345. // "location": "query",
  35346. // "type": "string"
  35347. // },
  35348. // "sortField": {
  35349. // "default": "ID",
  35350. // "description": "Field by which to sort the list.",
  35351. // "enum": [
  35352. // "ID",
  35353. // "NAME"
  35354. // ],
  35355. // "enumDescriptions": [
  35356. // "",
  35357. // ""
  35358. // ],
  35359. // "location": "query",
  35360. // "type": "string"
  35361. // },
  35362. // "sortOrder": {
  35363. // "default": "ASCENDING",
  35364. // "description": "Order of sorted results.",
  35365. // "enum": [
  35366. // "ASCENDING",
  35367. // "DESCENDING"
  35368. // ],
  35369. // "enumDescriptions": [
  35370. // "",
  35371. // ""
  35372. // ],
  35373. // "location": "query",
  35374. // "type": "string"
  35375. // }
  35376. // },
  35377. // "path": "userprofiles/{profileId}/placementStrategies",
  35378. // "response": {
  35379. // "$ref": "PlacementStrategiesListResponse"
  35380. // },
  35381. // "scopes": [
  35382. // "https://www.googleapis.com/auth/dfatrafficking"
  35383. // ]
  35384. // }
  35385. }
  35386. // Pages invokes f for each page of results.
  35387. // A non-nil error returned from f will halt the iteration.
  35388. // The provided context supersedes any context provided to the Context method.
  35389. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  35390. c.ctx_ = ctx
  35391. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35392. for {
  35393. x, err := c.Do()
  35394. if err != nil {
  35395. return err
  35396. }
  35397. if err := f(x); err != nil {
  35398. return err
  35399. }
  35400. if x.NextPageToken == "" {
  35401. return nil
  35402. }
  35403. c.PageToken(x.NextPageToken)
  35404. }
  35405. }
  35406. // method id "dfareporting.placementStrategies.patch":
  35407. type PlacementStrategiesPatchCall struct {
  35408. s *Service
  35409. profileId int64
  35410. placementstrategy *PlacementStrategy
  35411. urlParams_ gensupport.URLParams
  35412. ctx_ context.Context
  35413. header_ http.Header
  35414. }
  35415. // Patch: Updates an existing placement strategy. This method supports
  35416. // patch semantics.
  35417. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  35418. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35419. c.profileId = profileId
  35420. c.urlParams_.Set("id", fmt.Sprint(id))
  35421. c.placementstrategy = placementstrategy
  35422. return c
  35423. }
  35424. // Fields allows partial responses to be retrieved. See
  35425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35426. // for more information.
  35427. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  35428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35429. return c
  35430. }
  35431. // Context sets the context to be used in this call's Do method. Any
  35432. // pending HTTP request will be aborted if the provided context is
  35433. // canceled.
  35434. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  35435. c.ctx_ = ctx
  35436. return c
  35437. }
  35438. // Header returns an http.Header that can be modified by the caller to
  35439. // add HTTP headers to the request.
  35440. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  35441. if c.header_ == nil {
  35442. c.header_ = make(http.Header)
  35443. }
  35444. return c.header_
  35445. }
  35446. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  35447. reqHeaders := make(http.Header)
  35448. for k, v := range c.header_ {
  35449. reqHeaders[k] = v
  35450. }
  35451. reqHeaders.Set("User-Agent", c.s.userAgent())
  35452. var body io.Reader = nil
  35453. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35454. if err != nil {
  35455. return nil, err
  35456. }
  35457. reqHeaders.Set("Content-Type", "application/json")
  35458. c.urlParams_.Set("alt", alt)
  35459. c.urlParams_.Set("prettyPrint", "false")
  35460. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35461. urls += "?" + c.urlParams_.Encode()
  35462. req, err := http.NewRequest("PATCH", urls, body)
  35463. if err != nil {
  35464. return nil, err
  35465. }
  35466. req.Header = reqHeaders
  35467. googleapi.Expand(req.URL, map[string]string{
  35468. "profileId": strconv.FormatInt(c.profileId, 10),
  35469. })
  35470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35471. }
  35472. // Do executes the "dfareporting.placementStrategies.patch" call.
  35473. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35474. // non-2xx status code is an error. Response headers are in either
  35475. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35476. // returned at all) in error.(*googleapi.Error).Header. Use
  35477. // googleapi.IsNotModified to check whether the returned error was
  35478. // because http.StatusNotModified was returned.
  35479. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35480. gensupport.SetOptions(c.urlParams_, opts...)
  35481. res, err := c.doRequest("json")
  35482. if res != nil && res.StatusCode == http.StatusNotModified {
  35483. if res.Body != nil {
  35484. res.Body.Close()
  35485. }
  35486. return nil, &googleapi.Error{
  35487. Code: res.StatusCode,
  35488. Header: res.Header,
  35489. }
  35490. }
  35491. if err != nil {
  35492. return nil, err
  35493. }
  35494. defer googleapi.CloseBody(res)
  35495. if err := googleapi.CheckResponse(res); err != nil {
  35496. return nil, err
  35497. }
  35498. ret := &PlacementStrategy{
  35499. ServerResponse: googleapi.ServerResponse{
  35500. Header: res.Header,
  35501. HTTPStatusCode: res.StatusCode,
  35502. },
  35503. }
  35504. target := &ret
  35505. if err := gensupport.DecodeResponse(target, res); err != nil {
  35506. return nil, err
  35507. }
  35508. return ret, nil
  35509. // {
  35510. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  35511. // "httpMethod": "PATCH",
  35512. // "id": "dfareporting.placementStrategies.patch",
  35513. // "parameterOrder": [
  35514. // "profileId",
  35515. // "id"
  35516. // ],
  35517. // "parameters": {
  35518. // "id": {
  35519. // "description": "Placement strategy ID.",
  35520. // "format": "int64",
  35521. // "location": "query",
  35522. // "required": true,
  35523. // "type": "string"
  35524. // },
  35525. // "profileId": {
  35526. // "description": "User profile ID associated with this request.",
  35527. // "format": "int64",
  35528. // "location": "path",
  35529. // "required": true,
  35530. // "type": "string"
  35531. // }
  35532. // },
  35533. // "path": "userprofiles/{profileId}/placementStrategies",
  35534. // "request": {
  35535. // "$ref": "PlacementStrategy"
  35536. // },
  35537. // "response": {
  35538. // "$ref": "PlacementStrategy"
  35539. // },
  35540. // "scopes": [
  35541. // "https://www.googleapis.com/auth/dfatrafficking"
  35542. // ]
  35543. // }
  35544. }
  35545. // method id "dfareporting.placementStrategies.update":
  35546. type PlacementStrategiesUpdateCall struct {
  35547. s *Service
  35548. profileId int64
  35549. placementstrategy *PlacementStrategy
  35550. urlParams_ gensupport.URLParams
  35551. ctx_ context.Context
  35552. header_ http.Header
  35553. }
  35554. // Update: Updates an existing placement strategy.
  35555. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  35556. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35557. c.profileId = profileId
  35558. c.placementstrategy = placementstrategy
  35559. return c
  35560. }
  35561. // Fields allows partial responses to be retrieved. See
  35562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35563. // for more information.
  35564. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  35565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35566. return c
  35567. }
  35568. // Context sets the context to be used in this call's Do method. Any
  35569. // pending HTTP request will be aborted if the provided context is
  35570. // canceled.
  35571. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  35572. c.ctx_ = ctx
  35573. return c
  35574. }
  35575. // Header returns an http.Header that can be modified by the caller to
  35576. // add HTTP headers to the request.
  35577. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  35578. if c.header_ == nil {
  35579. c.header_ = make(http.Header)
  35580. }
  35581. return c.header_
  35582. }
  35583. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  35584. reqHeaders := make(http.Header)
  35585. for k, v := range c.header_ {
  35586. reqHeaders[k] = v
  35587. }
  35588. reqHeaders.Set("User-Agent", c.s.userAgent())
  35589. var body io.Reader = nil
  35590. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35591. if err != nil {
  35592. return nil, err
  35593. }
  35594. reqHeaders.Set("Content-Type", "application/json")
  35595. c.urlParams_.Set("alt", alt)
  35596. c.urlParams_.Set("prettyPrint", "false")
  35597. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35598. urls += "?" + c.urlParams_.Encode()
  35599. req, err := http.NewRequest("PUT", urls, body)
  35600. if err != nil {
  35601. return nil, err
  35602. }
  35603. req.Header = reqHeaders
  35604. googleapi.Expand(req.URL, map[string]string{
  35605. "profileId": strconv.FormatInt(c.profileId, 10),
  35606. })
  35607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35608. }
  35609. // Do executes the "dfareporting.placementStrategies.update" call.
  35610. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35611. // non-2xx status code is an error. Response headers are in either
  35612. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35613. // returned at all) in error.(*googleapi.Error).Header. Use
  35614. // googleapi.IsNotModified to check whether the returned error was
  35615. // because http.StatusNotModified was returned.
  35616. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35617. gensupport.SetOptions(c.urlParams_, opts...)
  35618. res, err := c.doRequest("json")
  35619. if res != nil && res.StatusCode == http.StatusNotModified {
  35620. if res.Body != nil {
  35621. res.Body.Close()
  35622. }
  35623. return nil, &googleapi.Error{
  35624. Code: res.StatusCode,
  35625. Header: res.Header,
  35626. }
  35627. }
  35628. if err != nil {
  35629. return nil, err
  35630. }
  35631. defer googleapi.CloseBody(res)
  35632. if err := googleapi.CheckResponse(res); err != nil {
  35633. return nil, err
  35634. }
  35635. ret := &PlacementStrategy{
  35636. ServerResponse: googleapi.ServerResponse{
  35637. Header: res.Header,
  35638. HTTPStatusCode: res.StatusCode,
  35639. },
  35640. }
  35641. target := &ret
  35642. if err := gensupport.DecodeResponse(target, res); err != nil {
  35643. return nil, err
  35644. }
  35645. return ret, nil
  35646. // {
  35647. // "description": "Updates an existing placement strategy.",
  35648. // "httpMethod": "PUT",
  35649. // "id": "dfareporting.placementStrategies.update",
  35650. // "parameterOrder": [
  35651. // "profileId"
  35652. // ],
  35653. // "parameters": {
  35654. // "profileId": {
  35655. // "description": "User profile ID associated with this request.",
  35656. // "format": "int64",
  35657. // "location": "path",
  35658. // "required": true,
  35659. // "type": "string"
  35660. // }
  35661. // },
  35662. // "path": "userprofiles/{profileId}/placementStrategies",
  35663. // "request": {
  35664. // "$ref": "PlacementStrategy"
  35665. // },
  35666. // "response": {
  35667. // "$ref": "PlacementStrategy"
  35668. // },
  35669. // "scopes": [
  35670. // "https://www.googleapis.com/auth/dfatrafficking"
  35671. // ]
  35672. // }
  35673. }
  35674. // method id "dfareporting.placements.generatetags":
  35675. type PlacementsGeneratetagsCall struct {
  35676. s *Service
  35677. profileId int64
  35678. urlParams_ gensupport.URLParams
  35679. ctx_ context.Context
  35680. header_ http.Header
  35681. }
  35682. // Generatetags: Generates tags for a placement.
  35683. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  35684. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35685. c.profileId = profileId
  35686. return c
  35687. }
  35688. // CampaignId sets the optional parameter "campaignId": Generate
  35689. // placements belonging to this campaign. This is a required field.
  35690. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  35691. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  35692. return c
  35693. }
  35694. // PlacementIds sets the optional parameter "placementIds": Generate
  35695. // tags for these placements.
  35696. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  35697. var placementIds_ []string
  35698. for _, v := range placementIds {
  35699. placementIds_ = append(placementIds_, fmt.Sprint(v))
  35700. }
  35701. c.urlParams_.SetMulti("placementIds", placementIds_)
  35702. return c
  35703. }
  35704. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  35705. // generate for these placements.
  35706. //
  35707. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  35708. // placements.
  35709. //
  35710. // Possible values:
  35711. // "PLACEMENT_TAG_CLICK_COMMANDS"
  35712. // "PLACEMENT_TAG_IFRAME_ILAYER"
  35713. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  35714. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  35715. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  35716. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  35717. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  35718. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  35719. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  35720. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  35721. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  35722. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  35723. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  35724. // "PLACEMENT_TAG_JAVASCRIPT"
  35725. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  35726. // "PLACEMENT_TAG_STANDARD"
  35727. // "PLACEMENT_TAG_TRACKING"
  35728. // "PLACEMENT_TAG_TRACKING_IFRAME"
  35729. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35730. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  35731. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  35732. return c
  35733. }
  35734. // Fields allows partial responses to be retrieved. See
  35735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35736. // for more information.
  35737. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  35738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35739. return c
  35740. }
  35741. // Context sets the context to be used in this call's Do method. Any
  35742. // pending HTTP request will be aborted if the provided context is
  35743. // canceled.
  35744. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  35745. c.ctx_ = ctx
  35746. return c
  35747. }
  35748. // Header returns an http.Header that can be modified by the caller to
  35749. // add HTTP headers to the request.
  35750. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  35751. if c.header_ == nil {
  35752. c.header_ = make(http.Header)
  35753. }
  35754. return c.header_
  35755. }
  35756. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  35757. reqHeaders := make(http.Header)
  35758. for k, v := range c.header_ {
  35759. reqHeaders[k] = v
  35760. }
  35761. reqHeaders.Set("User-Agent", c.s.userAgent())
  35762. var body io.Reader = nil
  35763. c.urlParams_.Set("alt", alt)
  35764. c.urlParams_.Set("prettyPrint", "false")
  35765. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  35766. urls += "?" + c.urlParams_.Encode()
  35767. req, err := http.NewRequest("POST", urls, body)
  35768. if err != nil {
  35769. return nil, err
  35770. }
  35771. req.Header = reqHeaders
  35772. googleapi.Expand(req.URL, map[string]string{
  35773. "profileId": strconv.FormatInt(c.profileId, 10),
  35774. })
  35775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35776. }
  35777. // Do executes the "dfareporting.placements.generatetags" call.
  35778. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  35779. // non-nil. Any non-2xx status code is an error. Response headers are in
  35780. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  35781. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35782. // googleapi.IsNotModified to check whether the returned error was
  35783. // because http.StatusNotModified was returned.
  35784. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  35785. gensupport.SetOptions(c.urlParams_, opts...)
  35786. res, err := c.doRequest("json")
  35787. if res != nil && res.StatusCode == http.StatusNotModified {
  35788. if res.Body != nil {
  35789. res.Body.Close()
  35790. }
  35791. return nil, &googleapi.Error{
  35792. Code: res.StatusCode,
  35793. Header: res.Header,
  35794. }
  35795. }
  35796. if err != nil {
  35797. return nil, err
  35798. }
  35799. defer googleapi.CloseBody(res)
  35800. if err := googleapi.CheckResponse(res); err != nil {
  35801. return nil, err
  35802. }
  35803. ret := &PlacementsGenerateTagsResponse{
  35804. ServerResponse: googleapi.ServerResponse{
  35805. Header: res.Header,
  35806. HTTPStatusCode: res.StatusCode,
  35807. },
  35808. }
  35809. target := &ret
  35810. if err := gensupport.DecodeResponse(target, res); err != nil {
  35811. return nil, err
  35812. }
  35813. return ret, nil
  35814. // {
  35815. // "description": "Generates tags for a placement.",
  35816. // "httpMethod": "POST",
  35817. // "id": "dfareporting.placements.generatetags",
  35818. // "parameterOrder": [
  35819. // "profileId"
  35820. // ],
  35821. // "parameters": {
  35822. // "campaignId": {
  35823. // "description": "Generate placements belonging to this campaign. This is a required field.",
  35824. // "format": "int64",
  35825. // "location": "query",
  35826. // "type": "string"
  35827. // },
  35828. // "placementIds": {
  35829. // "description": "Generate tags for these placements.",
  35830. // "format": "int64",
  35831. // "location": "query",
  35832. // "repeated": true,
  35833. // "type": "string"
  35834. // },
  35835. // "profileId": {
  35836. // "description": "User profile ID associated with this request.",
  35837. // "format": "int64",
  35838. // "location": "path",
  35839. // "required": true,
  35840. // "type": "string"
  35841. // },
  35842. // "tagFormats": {
  35843. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  35844. // "enum": [
  35845. // "PLACEMENT_TAG_CLICK_COMMANDS",
  35846. // "PLACEMENT_TAG_IFRAME_ILAYER",
  35847. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  35848. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  35849. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  35850. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  35851. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  35852. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  35853. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  35854. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  35855. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  35856. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  35857. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  35858. // "PLACEMENT_TAG_JAVASCRIPT",
  35859. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  35860. // "PLACEMENT_TAG_STANDARD",
  35861. // "PLACEMENT_TAG_TRACKING",
  35862. // "PLACEMENT_TAG_TRACKING_IFRAME",
  35863. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35864. // ],
  35865. // "enumDescriptions": [
  35866. // "",
  35867. // "",
  35868. // "",
  35869. // "",
  35870. // "",
  35871. // "",
  35872. // "",
  35873. // "",
  35874. // "",
  35875. // "",
  35876. // "",
  35877. // "",
  35878. // "",
  35879. // "",
  35880. // "",
  35881. // "",
  35882. // "",
  35883. // "",
  35884. // ""
  35885. // ],
  35886. // "location": "query",
  35887. // "repeated": true,
  35888. // "type": "string"
  35889. // }
  35890. // },
  35891. // "path": "userprofiles/{profileId}/placements/generatetags",
  35892. // "response": {
  35893. // "$ref": "PlacementsGenerateTagsResponse"
  35894. // },
  35895. // "scopes": [
  35896. // "https://www.googleapis.com/auth/dfatrafficking"
  35897. // ]
  35898. // }
  35899. }
  35900. // method id "dfareporting.placements.get":
  35901. type PlacementsGetCall struct {
  35902. s *Service
  35903. profileId int64
  35904. id int64
  35905. urlParams_ gensupport.URLParams
  35906. ifNoneMatch_ string
  35907. ctx_ context.Context
  35908. header_ http.Header
  35909. }
  35910. // Get: Gets one placement by ID.
  35911. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  35912. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35913. c.profileId = profileId
  35914. c.id = id
  35915. return c
  35916. }
  35917. // Fields allows partial responses to be retrieved. See
  35918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35919. // for more information.
  35920. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  35921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35922. return c
  35923. }
  35924. // IfNoneMatch sets the optional parameter which makes the operation
  35925. // fail if the object's ETag matches the given value. This is useful for
  35926. // getting updates only after the object has changed since the last
  35927. // request. Use googleapi.IsNotModified to check whether the response
  35928. // error from Do is the result of In-None-Match.
  35929. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  35930. c.ifNoneMatch_ = entityTag
  35931. return c
  35932. }
  35933. // Context sets the context to be used in this call's Do method. Any
  35934. // pending HTTP request will be aborted if the provided context is
  35935. // canceled.
  35936. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  35937. c.ctx_ = ctx
  35938. return c
  35939. }
  35940. // Header returns an http.Header that can be modified by the caller to
  35941. // add HTTP headers to the request.
  35942. func (c *PlacementsGetCall) Header() http.Header {
  35943. if c.header_ == nil {
  35944. c.header_ = make(http.Header)
  35945. }
  35946. return c.header_
  35947. }
  35948. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  35949. reqHeaders := make(http.Header)
  35950. for k, v := range c.header_ {
  35951. reqHeaders[k] = v
  35952. }
  35953. reqHeaders.Set("User-Agent", c.s.userAgent())
  35954. if c.ifNoneMatch_ != "" {
  35955. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35956. }
  35957. var body io.Reader = nil
  35958. c.urlParams_.Set("alt", alt)
  35959. c.urlParams_.Set("prettyPrint", "false")
  35960. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  35961. urls += "?" + c.urlParams_.Encode()
  35962. req, err := http.NewRequest("GET", urls, body)
  35963. if err != nil {
  35964. return nil, err
  35965. }
  35966. req.Header = reqHeaders
  35967. googleapi.Expand(req.URL, map[string]string{
  35968. "profileId": strconv.FormatInt(c.profileId, 10),
  35969. "id": strconv.FormatInt(c.id, 10),
  35970. })
  35971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35972. }
  35973. // Do executes the "dfareporting.placements.get" call.
  35974. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35975. // status code is an error. Response headers are in either
  35976. // *Placement.ServerResponse.Header or (if a response was returned at
  35977. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35978. // to check whether the returned error was because
  35979. // http.StatusNotModified was returned.
  35980. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35981. gensupport.SetOptions(c.urlParams_, opts...)
  35982. res, err := c.doRequest("json")
  35983. if res != nil && res.StatusCode == http.StatusNotModified {
  35984. if res.Body != nil {
  35985. res.Body.Close()
  35986. }
  35987. return nil, &googleapi.Error{
  35988. Code: res.StatusCode,
  35989. Header: res.Header,
  35990. }
  35991. }
  35992. if err != nil {
  35993. return nil, err
  35994. }
  35995. defer googleapi.CloseBody(res)
  35996. if err := googleapi.CheckResponse(res); err != nil {
  35997. return nil, err
  35998. }
  35999. ret := &Placement{
  36000. ServerResponse: googleapi.ServerResponse{
  36001. Header: res.Header,
  36002. HTTPStatusCode: res.StatusCode,
  36003. },
  36004. }
  36005. target := &ret
  36006. if err := gensupport.DecodeResponse(target, res); err != nil {
  36007. return nil, err
  36008. }
  36009. return ret, nil
  36010. // {
  36011. // "description": "Gets one placement by ID.",
  36012. // "httpMethod": "GET",
  36013. // "id": "dfareporting.placements.get",
  36014. // "parameterOrder": [
  36015. // "profileId",
  36016. // "id"
  36017. // ],
  36018. // "parameters": {
  36019. // "id": {
  36020. // "description": "Placement ID.",
  36021. // "format": "int64",
  36022. // "location": "path",
  36023. // "required": true,
  36024. // "type": "string"
  36025. // },
  36026. // "profileId": {
  36027. // "description": "User profile ID associated with this request.",
  36028. // "format": "int64",
  36029. // "location": "path",
  36030. // "required": true,
  36031. // "type": "string"
  36032. // }
  36033. // },
  36034. // "path": "userprofiles/{profileId}/placements/{id}",
  36035. // "response": {
  36036. // "$ref": "Placement"
  36037. // },
  36038. // "scopes": [
  36039. // "https://www.googleapis.com/auth/dfatrafficking"
  36040. // ]
  36041. // }
  36042. }
  36043. // method id "dfareporting.placements.insert":
  36044. type PlacementsInsertCall struct {
  36045. s *Service
  36046. profileId int64
  36047. placement *Placement
  36048. urlParams_ gensupport.URLParams
  36049. ctx_ context.Context
  36050. header_ http.Header
  36051. }
  36052. // Insert: Inserts a new placement.
  36053. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  36054. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36055. c.profileId = profileId
  36056. c.placement = placement
  36057. return c
  36058. }
  36059. // Fields allows partial responses to be retrieved. See
  36060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36061. // for more information.
  36062. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  36063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36064. return c
  36065. }
  36066. // Context sets the context to be used in this call's Do method. Any
  36067. // pending HTTP request will be aborted if the provided context is
  36068. // canceled.
  36069. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  36070. c.ctx_ = ctx
  36071. return c
  36072. }
  36073. // Header returns an http.Header that can be modified by the caller to
  36074. // add HTTP headers to the request.
  36075. func (c *PlacementsInsertCall) Header() http.Header {
  36076. if c.header_ == nil {
  36077. c.header_ = make(http.Header)
  36078. }
  36079. return c.header_
  36080. }
  36081. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  36082. reqHeaders := make(http.Header)
  36083. for k, v := range c.header_ {
  36084. reqHeaders[k] = v
  36085. }
  36086. reqHeaders.Set("User-Agent", c.s.userAgent())
  36087. var body io.Reader = nil
  36088. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36089. if err != nil {
  36090. return nil, err
  36091. }
  36092. reqHeaders.Set("Content-Type", "application/json")
  36093. c.urlParams_.Set("alt", alt)
  36094. c.urlParams_.Set("prettyPrint", "false")
  36095. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36096. urls += "?" + c.urlParams_.Encode()
  36097. req, err := http.NewRequest("POST", urls, body)
  36098. if err != nil {
  36099. return nil, err
  36100. }
  36101. req.Header = reqHeaders
  36102. googleapi.Expand(req.URL, map[string]string{
  36103. "profileId": strconv.FormatInt(c.profileId, 10),
  36104. })
  36105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36106. }
  36107. // Do executes the "dfareporting.placements.insert" call.
  36108. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36109. // status code is an error. Response headers are in either
  36110. // *Placement.ServerResponse.Header or (if a response was returned at
  36111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36112. // to check whether the returned error was because
  36113. // http.StatusNotModified was returned.
  36114. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36115. gensupport.SetOptions(c.urlParams_, opts...)
  36116. res, err := c.doRequest("json")
  36117. if res != nil && res.StatusCode == http.StatusNotModified {
  36118. if res.Body != nil {
  36119. res.Body.Close()
  36120. }
  36121. return nil, &googleapi.Error{
  36122. Code: res.StatusCode,
  36123. Header: res.Header,
  36124. }
  36125. }
  36126. if err != nil {
  36127. return nil, err
  36128. }
  36129. defer googleapi.CloseBody(res)
  36130. if err := googleapi.CheckResponse(res); err != nil {
  36131. return nil, err
  36132. }
  36133. ret := &Placement{
  36134. ServerResponse: googleapi.ServerResponse{
  36135. Header: res.Header,
  36136. HTTPStatusCode: res.StatusCode,
  36137. },
  36138. }
  36139. target := &ret
  36140. if err := gensupport.DecodeResponse(target, res); err != nil {
  36141. return nil, err
  36142. }
  36143. return ret, nil
  36144. // {
  36145. // "description": "Inserts a new placement.",
  36146. // "httpMethod": "POST",
  36147. // "id": "dfareporting.placements.insert",
  36148. // "parameterOrder": [
  36149. // "profileId"
  36150. // ],
  36151. // "parameters": {
  36152. // "profileId": {
  36153. // "description": "User profile ID associated with this request.",
  36154. // "format": "int64",
  36155. // "location": "path",
  36156. // "required": true,
  36157. // "type": "string"
  36158. // }
  36159. // },
  36160. // "path": "userprofiles/{profileId}/placements",
  36161. // "request": {
  36162. // "$ref": "Placement"
  36163. // },
  36164. // "response": {
  36165. // "$ref": "Placement"
  36166. // },
  36167. // "scopes": [
  36168. // "https://www.googleapis.com/auth/dfatrafficking"
  36169. // ]
  36170. // }
  36171. }
  36172. // method id "dfareporting.placements.list":
  36173. type PlacementsListCall struct {
  36174. s *Service
  36175. profileId int64
  36176. urlParams_ gensupport.URLParams
  36177. ifNoneMatch_ string
  36178. ctx_ context.Context
  36179. header_ http.Header
  36180. }
  36181. // List: Retrieves a list of placements, possibly filtered. This method
  36182. // supports paging.
  36183. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  36184. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36185. c.profileId = profileId
  36186. return c
  36187. }
  36188. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36189. // only placements that belong to these advertisers.
  36190. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  36191. var advertiserIds_ []string
  36192. for _, v := range advertiserIds {
  36193. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36194. }
  36195. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36196. return c
  36197. }
  36198. // Archived sets the optional parameter "archived": Select only archived
  36199. // placements. Don't set this field to select both archived and
  36200. // non-archived placements.
  36201. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  36202. c.urlParams_.Set("archived", fmt.Sprint(archived))
  36203. return c
  36204. }
  36205. // CampaignIds sets the optional parameter "campaignIds": Select only
  36206. // placements that belong to these campaigns.
  36207. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  36208. var campaignIds_ []string
  36209. for _, v := range campaignIds {
  36210. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  36211. }
  36212. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  36213. return c
  36214. }
  36215. // Compatibilities sets the optional parameter "compatibilities": Select
  36216. // only placements that are associated with these compatibilities.
  36217. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  36218. // or on mobile devices for regular or interstitial ads respectively.
  36219. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  36220. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  36221. // with the VAST standard.
  36222. //
  36223. // Possible values:
  36224. // "APP"
  36225. // "APP_INTERSTITIAL"
  36226. // "DISPLAY"
  36227. // "DISPLAY_INTERSTITIAL"
  36228. // "IN_STREAM_AUDIO"
  36229. // "IN_STREAM_VIDEO"
  36230. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  36231. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  36232. return c
  36233. }
  36234. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  36235. // Select only placements that are associated with these content
  36236. // categories.
  36237. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  36238. var contentCategoryIds_ []string
  36239. for _, v := range contentCategoryIds {
  36240. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  36241. }
  36242. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  36243. return c
  36244. }
  36245. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  36246. // Select only placements that are associated with these directory
  36247. // sites.
  36248. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  36249. var directorySiteIds_ []string
  36250. for _, v := range directorySiteIds {
  36251. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  36252. }
  36253. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  36254. return c
  36255. }
  36256. // GroupIds sets the optional parameter "groupIds": Select only
  36257. // placements that belong to these placement groups.
  36258. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  36259. var groupIds_ []string
  36260. for _, v := range groupIds {
  36261. groupIds_ = append(groupIds_, fmt.Sprint(v))
  36262. }
  36263. c.urlParams_.SetMulti("groupIds", groupIds_)
  36264. return c
  36265. }
  36266. // Ids sets the optional parameter "ids": Select only placements with
  36267. // these IDs.
  36268. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  36269. var ids_ []string
  36270. for _, v := range ids {
  36271. ids_ = append(ids_, fmt.Sprint(v))
  36272. }
  36273. c.urlParams_.SetMulti("ids", ids_)
  36274. return c
  36275. }
  36276. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  36277. // placements or placement groups whose end date is on or before the
  36278. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  36279. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  36280. c.urlParams_.Set("maxEndDate", maxEndDate)
  36281. return c
  36282. }
  36283. // MaxResults sets the optional parameter "maxResults": Maximum number
  36284. // of results to return.
  36285. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  36286. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36287. return c
  36288. }
  36289. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  36290. // placements or placement groups whose start date is on or before the
  36291. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  36292. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  36293. c.urlParams_.Set("maxStartDate", maxStartDate)
  36294. return c
  36295. }
  36296. // MinEndDate sets the optional parameter "minEndDate": Select only
  36297. // placements or placement groups whose end date is on or after the
  36298. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  36299. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  36300. c.urlParams_.Set("minEndDate", minEndDate)
  36301. return c
  36302. }
  36303. // MinStartDate sets the optional parameter "minStartDate": Select only
  36304. // placements or placement groups whose start date is on or after the
  36305. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  36306. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  36307. c.urlParams_.Set("minStartDate", minStartDate)
  36308. return c
  36309. }
  36310. // PageToken sets the optional parameter "pageToken": Value of the
  36311. // nextPageToken from the previous result page.
  36312. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  36313. c.urlParams_.Set("pageToken", pageToken)
  36314. return c
  36315. }
  36316. // PaymentSource sets the optional parameter "paymentSource": Select
  36317. // only placements with this payment source.
  36318. //
  36319. // Possible values:
  36320. // "PLACEMENT_AGENCY_PAID"
  36321. // "PLACEMENT_PUBLISHER_PAID"
  36322. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  36323. c.urlParams_.Set("paymentSource", paymentSource)
  36324. return c
  36325. }
  36326. // PlacementStrategyIds sets the optional parameter
  36327. // "placementStrategyIds": Select only placements that are associated
  36328. // with these placement strategies.
  36329. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  36330. var placementStrategyIds_ []string
  36331. for _, v := range placementStrategyIds {
  36332. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  36333. }
  36334. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  36335. return c
  36336. }
  36337. // PricingTypes sets the optional parameter "pricingTypes": Select only
  36338. // placements with these pricing types.
  36339. //
  36340. // Possible values:
  36341. // "PRICING_TYPE_CPA"
  36342. // "PRICING_TYPE_CPC"
  36343. // "PRICING_TYPE_CPM"
  36344. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  36345. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  36346. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36347. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  36348. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  36349. return c
  36350. }
  36351. // SearchString sets the optional parameter "searchString": Allows
  36352. // searching for placements by name or ID. Wildcards (*) are allowed.
  36353. // For example, "placement*2015" will return placements with names like
  36354. // "placement June 2015", "placement May 2015", or simply "placements
  36355. // 2015". Most of the searches also add wildcards implicitly at the
  36356. // start and the end of the search string. For example, a search string
  36357. // of "placement" will match placements with name "my placement",
  36358. // "placement 2015", or simply "placement".
  36359. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  36360. c.urlParams_.Set("searchString", searchString)
  36361. return c
  36362. }
  36363. // SiteIds sets the optional parameter "siteIds": Select only placements
  36364. // that are associated with these sites.
  36365. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  36366. var siteIds_ []string
  36367. for _, v := range siteIds {
  36368. siteIds_ = append(siteIds_, fmt.Sprint(v))
  36369. }
  36370. c.urlParams_.SetMulti("siteIds", siteIds_)
  36371. return c
  36372. }
  36373. // SizeIds sets the optional parameter "sizeIds": Select only placements
  36374. // that are associated with these sizes.
  36375. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  36376. var sizeIds_ []string
  36377. for _, v := range sizeIds {
  36378. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  36379. }
  36380. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  36381. return c
  36382. }
  36383. // SortField sets the optional parameter "sortField": Field by which to
  36384. // sort the list.
  36385. //
  36386. // Possible values:
  36387. // "ID" (default)
  36388. // "NAME"
  36389. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  36390. c.urlParams_.Set("sortField", sortField)
  36391. return c
  36392. }
  36393. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36394. // results.
  36395. //
  36396. // Possible values:
  36397. // "ASCENDING" (default)
  36398. // "DESCENDING"
  36399. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  36400. c.urlParams_.Set("sortOrder", sortOrder)
  36401. return c
  36402. }
  36403. // Fields allows partial responses to be retrieved. See
  36404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36405. // for more information.
  36406. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  36407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36408. return c
  36409. }
  36410. // IfNoneMatch sets the optional parameter which makes the operation
  36411. // fail if the object's ETag matches the given value. This is useful for
  36412. // getting updates only after the object has changed since the last
  36413. // request. Use googleapi.IsNotModified to check whether the response
  36414. // error from Do is the result of In-None-Match.
  36415. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  36416. c.ifNoneMatch_ = entityTag
  36417. return c
  36418. }
  36419. // Context sets the context to be used in this call's Do method. Any
  36420. // pending HTTP request will be aborted if the provided context is
  36421. // canceled.
  36422. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  36423. c.ctx_ = ctx
  36424. return c
  36425. }
  36426. // Header returns an http.Header that can be modified by the caller to
  36427. // add HTTP headers to the request.
  36428. func (c *PlacementsListCall) Header() http.Header {
  36429. if c.header_ == nil {
  36430. c.header_ = make(http.Header)
  36431. }
  36432. return c.header_
  36433. }
  36434. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  36435. reqHeaders := make(http.Header)
  36436. for k, v := range c.header_ {
  36437. reqHeaders[k] = v
  36438. }
  36439. reqHeaders.Set("User-Agent", c.s.userAgent())
  36440. if c.ifNoneMatch_ != "" {
  36441. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36442. }
  36443. var body io.Reader = nil
  36444. c.urlParams_.Set("alt", alt)
  36445. c.urlParams_.Set("prettyPrint", "false")
  36446. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36447. urls += "?" + c.urlParams_.Encode()
  36448. req, err := http.NewRequest("GET", urls, body)
  36449. if err != nil {
  36450. return nil, err
  36451. }
  36452. req.Header = reqHeaders
  36453. googleapi.Expand(req.URL, map[string]string{
  36454. "profileId": strconv.FormatInt(c.profileId, 10),
  36455. })
  36456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36457. }
  36458. // Do executes the "dfareporting.placements.list" call.
  36459. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  36460. // non-2xx status code is an error. Response headers are in either
  36461. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  36462. // returned at all) in error.(*googleapi.Error).Header. Use
  36463. // googleapi.IsNotModified to check whether the returned error was
  36464. // because http.StatusNotModified was returned.
  36465. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  36466. gensupport.SetOptions(c.urlParams_, opts...)
  36467. res, err := c.doRequest("json")
  36468. if res != nil && res.StatusCode == http.StatusNotModified {
  36469. if res.Body != nil {
  36470. res.Body.Close()
  36471. }
  36472. return nil, &googleapi.Error{
  36473. Code: res.StatusCode,
  36474. Header: res.Header,
  36475. }
  36476. }
  36477. if err != nil {
  36478. return nil, err
  36479. }
  36480. defer googleapi.CloseBody(res)
  36481. if err := googleapi.CheckResponse(res); err != nil {
  36482. return nil, err
  36483. }
  36484. ret := &PlacementsListResponse{
  36485. ServerResponse: googleapi.ServerResponse{
  36486. Header: res.Header,
  36487. HTTPStatusCode: res.StatusCode,
  36488. },
  36489. }
  36490. target := &ret
  36491. if err := gensupport.DecodeResponse(target, res); err != nil {
  36492. return nil, err
  36493. }
  36494. return ret, nil
  36495. // {
  36496. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  36497. // "httpMethod": "GET",
  36498. // "id": "dfareporting.placements.list",
  36499. // "parameterOrder": [
  36500. // "profileId"
  36501. // ],
  36502. // "parameters": {
  36503. // "advertiserIds": {
  36504. // "description": "Select only placements that belong to these advertisers.",
  36505. // "format": "int64",
  36506. // "location": "query",
  36507. // "repeated": true,
  36508. // "type": "string"
  36509. // },
  36510. // "archived": {
  36511. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  36512. // "location": "query",
  36513. // "type": "boolean"
  36514. // },
  36515. // "campaignIds": {
  36516. // "description": "Select only placements that belong to these campaigns.",
  36517. // "format": "int64",
  36518. // "location": "query",
  36519. // "repeated": true,
  36520. // "type": "string"
  36521. // },
  36522. // "compatibilities": {
  36523. // "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.",
  36524. // "enum": [
  36525. // "APP",
  36526. // "APP_INTERSTITIAL",
  36527. // "DISPLAY",
  36528. // "DISPLAY_INTERSTITIAL",
  36529. // "IN_STREAM_AUDIO",
  36530. // "IN_STREAM_VIDEO"
  36531. // ],
  36532. // "enumDescriptions": [
  36533. // "",
  36534. // "",
  36535. // "",
  36536. // "",
  36537. // "",
  36538. // ""
  36539. // ],
  36540. // "location": "query",
  36541. // "repeated": true,
  36542. // "type": "string"
  36543. // },
  36544. // "contentCategoryIds": {
  36545. // "description": "Select only placements that are associated with these content categories.",
  36546. // "format": "int64",
  36547. // "location": "query",
  36548. // "repeated": true,
  36549. // "type": "string"
  36550. // },
  36551. // "directorySiteIds": {
  36552. // "description": "Select only placements that are associated with these directory sites.",
  36553. // "format": "int64",
  36554. // "location": "query",
  36555. // "repeated": true,
  36556. // "type": "string"
  36557. // },
  36558. // "groupIds": {
  36559. // "description": "Select only placements that belong to these placement groups.",
  36560. // "format": "int64",
  36561. // "location": "query",
  36562. // "repeated": true,
  36563. // "type": "string"
  36564. // },
  36565. // "ids": {
  36566. // "description": "Select only placements with these IDs.",
  36567. // "format": "int64",
  36568. // "location": "query",
  36569. // "repeated": true,
  36570. // "type": "string"
  36571. // },
  36572. // "maxEndDate": {
  36573. // "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\".",
  36574. // "location": "query",
  36575. // "type": "string"
  36576. // },
  36577. // "maxResults": {
  36578. // "default": "1000",
  36579. // "description": "Maximum number of results to return.",
  36580. // "format": "int32",
  36581. // "location": "query",
  36582. // "maximum": "1000",
  36583. // "minimum": "0",
  36584. // "type": "integer"
  36585. // },
  36586. // "maxStartDate": {
  36587. // "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\".",
  36588. // "location": "query",
  36589. // "type": "string"
  36590. // },
  36591. // "minEndDate": {
  36592. // "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\".",
  36593. // "location": "query",
  36594. // "type": "string"
  36595. // },
  36596. // "minStartDate": {
  36597. // "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\".",
  36598. // "location": "query",
  36599. // "type": "string"
  36600. // },
  36601. // "pageToken": {
  36602. // "description": "Value of the nextPageToken from the previous result page.",
  36603. // "location": "query",
  36604. // "type": "string"
  36605. // },
  36606. // "paymentSource": {
  36607. // "description": "Select only placements with this payment source.",
  36608. // "enum": [
  36609. // "PLACEMENT_AGENCY_PAID",
  36610. // "PLACEMENT_PUBLISHER_PAID"
  36611. // ],
  36612. // "enumDescriptions": [
  36613. // "",
  36614. // ""
  36615. // ],
  36616. // "location": "query",
  36617. // "type": "string"
  36618. // },
  36619. // "placementStrategyIds": {
  36620. // "description": "Select only placements that are associated with these placement strategies.",
  36621. // "format": "int64",
  36622. // "location": "query",
  36623. // "repeated": true,
  36624. // "type": "string"
  36625. // },
  36626. // "pricingTypes": {
  36627. // "description": "Select only placements with these pricing types.",
  36628. // "enum": [
  36629. // "PRICING_TYPE_CPA",
  36630. // "PRICING_TYPE_CPC",
  36631. // "PRICING_TYPE_CPM",
  36632. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  36633. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  36634. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36635. // ],
  36636. // "enumDescriptions": [
  36637. // "",
  36638. // "",
  36639. // "",
  36640. // "",
  36641. // "",
  36642. // ""
  36643. // ],
  36644. // "location": "query",
  36645. // "repeated": true,
  36646. // "type": "string"
  36647. // },
  36648. // "profileId": {
  36649. // "description": "User profile ID associated with this request.",
  36650. // "format": "int64",
  36651. // "location": "path",
  36652. // "required": true,
  36653. // "type": "string"
  36654. // },
  36655. // "searchString": {
  36656. // "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\".",
  36657. // "location": "query",
  36658. // "type": "string"
  36659. // },
  36660. // "siteIds": {
  36661. // "description": "Select only placements that are associated with these sites.",
  36662. // "format": "int64",
  36663. // "location": "query",
  36664. // "repeated": true,
  36665. // "type": "string"
  36666. // },
  36667. // "sizeIds": {
  36668. // "description": "Select only placements that are associated with these sizes.",
  36669. // "format": "int64",
  36670. // "location": "query",
  36671. // "repeated": true,
  36672. // "type": "string"
  36673. // },
  36674. // "sortField": {
  36675. // "default": "ID",
  36676. // "description": "Field by which to sort the list.",
  36677. // "enum": [
  36678. // "ID",
  36679. // "NAME"
  36680. // ],
  36681. // "enumDescriptions": [
  36682. // "",
  36683. // ""
  36684. // ],
  36685. // "location": "query",
  36686. // "type": "string"
  36687. // },
  36688. // "sortOrder": {
  36689. // "default": "ASCENDING",
  36690. // "description": "Order of sorted results.",
  36691. // "enum": [
  36692. // "ASCENDING",
  36693. // "DESCENDING"
  36694. // ],
  36695. // "enumDescriptions": [
  36696. // "",
  36697. // ""
  36698. // ],
  36699. // "location": "query",
  36700. // "type": "string"
  36701. // }
  36702. // },
  36703. // "path": "userprofiles/{profileId}/placements",
  36704. // "response": {
  36705. // "$ref": "PlacementsListResponse"
  36706. // },
  36707. // "scopes": [
  36708. // "https://www.googleapis.com/auth/dfatrafficking"
  36709. // ]
  36710. // }
  36711. }
  36712. // Pages invokes f for each page of results.
  36713. // A non-nil error returned from f will halt the iteration.
  36714. // The provided context supersedes any context provided to the Context method.
  36715. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  36716. c.ctx_ = ctx
  36717. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36718. for {
  36719. x, err := c.Do()
  36720. if err != nil {
  36721. return err
  36722. }
  36723. if err := f(x); err != nil {
  36724. return err
  36725. }
  36726. if x.NextPageToken == "" {
  36727. return nil
  36728. }
  36729. c.PageToken(x.NextPageToken)
  36730. }
  36731. }
  36732. // method id "dfareporting.placements.patch":
  36733. type PlacementsPatchCall struct {
  36734. s *Service
  36735. profileId int64
  36736. placement *Placement
  36737. urlParams_ gensupport.URLParams
  36738. ctx_ context.Context
  36739. header_ http.Header
  36740. }
  36741. // Patch: Updates an existing placement. This method supports patch
  36742. // semantics.
  36743. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  36744. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36745. c.profileId = profileId
  36746. c.urlParams_.Set("id", fmt.Sprint(id))
  36747. c.placement = placement
  36748. return c
  36749. }
  36750. // Fields allows partial responses to be retrieved. See
  36751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36752. // for more information.
  36753. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  36754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36755. return c
  36756. }
  36757. // Context sets the context to be used in this call's Do method. Any
  36758. // pending HTTP request will be aborted if the provided context is
  36759. // canceled.
  36760. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  36761. c.ctx_ = ctx
  36762. return c
  36763. }
  36764. // Header returns an http.Header that can be modified by the caller to
  36765. // add HTTP headers to the request.
  36766. func (c *PlacementsPatchCall) Header() http.Header {
  36767. if c.header_ == nil {
  36768. c.header_ = make(http.Header)
  36769. }
  36770. return c.header_
  36771. }
  36772. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  36773. reqHeaders := make(http.Header)
  36774. for k, v := range c.header_ {
  36775. reqHeaders[k] = v
  36776. }
  36777. reqHeaders.Set("User-Agent", c.s.userAgent())
  36778. var body io.Reader = nil
  36779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36780. if err != nil {
  36781. return nil, err
  36782. }
  36783. reqHeaders.Set("Content-Type", "application/json")
  36784. c.urlParams_.Set("alt", alt)
  36785. c.urlParams_.Set("prettyPrint", "false")
  36786. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36787. urls += "?" + c.urlParams_.Encode()
  36788. req, err := http.NewRequest("PATCH", urls, body)
  36789. if err != nil {
  36790. return nil, err
  36791. }
  36792. req.Header = reqHeaders
  36793. googleapi.Expand(req.URL, map[string]string{
  36794. "profileId": strconv.FormatInt(c.profileId, 10),
  36795. })
  36796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36797. }
  36798. // Do executes the "dfareporting.placements.patch" call.
  36799. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36800. // status code is an error. Response headers are in either
  36801. // *Placement.ServerResponse.Header or (if a response was returned at
  36802. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36803. // to check whether the returned error was because
  36804. // http.StatusNotModified was returned.
  36805. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36806. gensupport.SetOptions(c.urlParams_, opts...)
  36807. res, err := c.doRequest("json")
  36808. if res != nil && res.StatusCode == http.StatusNotModified {
  36809. if res.Body != nil {
  36810. res.Body.Close()
  36811. }
  36812. return nil, &googleapi.Error{
  36813. Code: res.StatusCode,
  36814. Header: res.Header,
  36815. }
  36816. }
  36817. if err != nil {
  36818. return nil, err
  36819. }
  36820. defer googleapi.CloseBody(res)
  36821. if err := googleapi.CheckResponse(res); err != nil {
  36822. return nil, err
  36823. }
  36824. ret := &Placement{
  36825. ServerResponse: googleapi.ServerResponse{
  36826. Header: res.Header,
  36827. HTTPStatusCode: res.StatusCode,
  36828. },
  36829. }
  36830. target := &ret
  36831. if err := gensupport.DecodeResponse(target, res); err != nil {
  36832. return nil, err
  36833. }
  36834. return ret, nil
  36835. // {
  36836. // "description": "Updates an existing placement. This method supports patch semantics.",
  36837. // "httpMethod": "PATCH",
  36838. // "id": "dfareporting.placements.patch",
  36839. // "parameterOrder": [
  36840. // "profileId",
  36841. // "id"
  36842. // ],
  36843. // "parameters": {
  36844. // "id": {
  36845. // "description": "Placement ID.",
  36846. // "format": "int64",
  36847. // "location": "query",
  36848. // "required": true,
  36849. // "type": "string"
  36850. // },
  36851. // "profileId": {
  36852. // "description": "User profile ID associated with this request.",
  36853. // "format": "int64",
  36854. // "location": "path",
  36855. // "required": true,
  36856. // "type": "string"
  36857. // }
  36858. // },
  36859. // "path": "userprofiles/{profileId}/placements",
  36860. // "request": {
  36861. // "$ref": "Placement"
  36862. // },
  36863. // "response": {
  36864. // "$ref": "Placement"
  36865. // },
  36866. // "scopes": [
  36867. // "https://www.googleapis.com/auth/dfatrafficking"
  36868. // ]
  36869. // }
  36870. }
  36871. // method id "dfareporting.placements.update":
  36872. type PlacementsUpdateCall struct {
  36873. s *Service
  36874. profileId int64
  36875. placement *Placement
  36876. urlParams_ gensupport.URLParams
  36877. ctx_ context.Context
  36878. header_ http.Header
  36879. }
  36880. // Update: Updates an existing placement.
  36881. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  36882. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36883. c.profileId = profileId
  36884. c.placement = placement
  36885. return c
  36886. }
  36887. // Fields allows partial responses to be retrieved. See
  36888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36889. // for more information.
  36890. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  36891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36892. return c
  36893. }
  36894. // Context sets the context to be used in this call's Do method. Any
  36895. // pending HTTP request will be aborted if the provided context is
  36896. // canceled.
  36897. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  36898. c.ctx_ = ctx
  36899. return c
  36900. }
  36901. // Header returns an http.Header that can be modified by the caller to
  36902. // add HTTP headers to the request.
  36903. func (c *PlacementsUpdateCall) Header() http.Header {
  36904. if c.header_ == nil {
  36905. c.header_ = make(http.Header)
  36906. }
  36907. return c.header_
  36908. }
  36909. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36910. reqHeaders := make(http.Header)
  36911. for k, v := range c.header_ {
  36912. reqHeaders[k] = v
  36913. }
  36914. reqHeaders.Set("User-Agent", c.s.userAgent())
  36915. var body io.Reader = nil
  36916. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36917. if err != nil {
  36918. return nil, err
  36919. }
  36920. reqHeaders.Set("Content-Type", "application/json")
  36921. c.urlParams_.Set("alt", alt)
  36922. c.urlParams_.Set("prettyPrint", "false")
  36923. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36924. urls += "?" + c.urlParams_.Encode()
  36925. req, err := http.NewRequest("PUT", urls, body)
  36926. if err != nil {
  36927. return nil, err
  36928. }
  36929. req.Header = reqHeaders
  36930. googleapi.Expand(req.URL, map[string]string{
  36931. "profileId": strconv.FormatInt(c.profileId, 10),
  36932. })
  36933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36934. }
  36935. // Do executes the "dfareporting.placements.update" call.
  36936. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36937. // status code is an error. Response headers are in either
  36938. // *Placement.ServerResponse.Header or (if a response was returned at
  36939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36940. // to check whether the returned error was because
  36941. // http.StatusNotModified was returned.
  36942. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36943. gensupport.SetOptions(c.urlParams_, opts...)
  36944. res, err := c.doRequest("json")
  36945. if res != nil && res.StatusCode == http.StatusNotModified {
  36946. if res.Body != nil {
  36947. res.Body.Close()
  36948. }
  36949. return nil, &googleapi.Error{
  36950. Code: res.StatusCode,
  36951. Header: res.Header,
  36952. }
  36953. }
  36954. if err != nil {
  36955. return nil, err
  36956. }
  36957. defer googleapi.CloseBody(res)
  36958. if err := googleapi.CheckResponse(res); err != nil {
  36959. return nil, err
  36960. }
  36961. ret := &Placement{
  36962. ServerResponse: googleapi.ServerResponse{
  36963. Header: res.Header,
  36964. HTTPStatusCode: res.StatusCode,
  36965. },
  36966. }
  36967. target := &ret
  36968. if err := gensupport.DecodeResponse(target, res); err != nil {
  36969. return nil, err
  36970. }
  36971. return ret, nil
  36972. // {
  36973. // "description": "Updates an existing placement.",
  36974. // "httpMethod": "PUT",
  36975. // "id": "dfareporting.placements.update",
  36976. // "parameterOrder": [
  36977. // "profileId"
  36978. // ],
  36979. // "parameters": {
  36980. // "profileId": {
  36981. // "description": "User profile ID associated with this request.",
  36982. // "format": "int64",
  36983. // "location": "path",
  36984. // "required": true,
  36985. // "type": "string"
  36986. // }
  36987. // },
  36988. // "path": "userprofiles/{profileId}/placements",
  36989. // "request": {
  36990. // "$ref": "Placement"
  36991. // },
  36992. // "response": {
  36993. // "$ref": "Placement"
  36994. // },
  36995. // "scopes": [
  36996. // "https://www.googleapis.com/auth/dfatrafficking"
  36997. // ]
  36998. // }
  36999. }
  37000. // method id "dfareporting.platformTypes.get":
  37001. type PlatformTypesGetCall struct {
  37002. s *Service
  37003. profileId int64
  37004. id int64
  37005. urlParams_ gensupport.URLParams
  37006. ifNoneMatch_ string
  37007. ctx_ context.Context
  37008. header_ http.Header
  37009. }
  37010. // Get: Gets one platform type by ID.
  37011. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  37012. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37013. c.profileId = profileId
  37014. c.id = id
  37015. return c
  37016. }
  37017. // Fields allows partial responses to be retrieved. See
  37018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37019. // for more information.
  37020. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  37021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37022. return c
  37023. }
  37024. // IfNoneMatch sets the optional parameter which makes the operation
  37025. // fail if the object's ETag matches the given value. This is useful for
  37026. // getting updates only after the object has changed since the last
  37027. // request. Use googleapi.IsNotModified to check whether the response
  37028. // error from Do is the result of In-None-Match.
  37029. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  37030. c.ifNoneMatch_ = entityTag
  37031. return c
  37032. }
  37033. // Context sets the context to be used in this call's Do method. Any
  37034. // pending HTTP request will be aborted if the provided context is
  37035. // canceled.
  37036. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  37037. c.ctx_ = ctx
  37038. return c
  37039. }
  37040. // Header returns an http.Header that can be modified by the caller to
  37041. // add HTTP headers to the request.
  37042. func (c *PlatformTypesGetCall) Header() http.Header {
  37043. if c.header_ == nil {
  37044. c.header_ = make(http.Header)
  37045. }
  37046. return c.header_
  37047. }
  37048. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  37049. reqHeaders := make(http.Header)
  37050. for k, v := range c.header_ {
  37051. reqHeaders[k] = v
  37052. }
  37053. reqHeaders.Set("User-Agent", c.s.userAgent())
  37054. if c.ifNoneMatch_ != "" {
  37055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37056. }
  37057. var body io.Reader = nil
  37058. c.urlParams_.Set("alt", alt)
  37059. c.urlParams_.Set("prettyPrint", "false")
  37060. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  37061. urls += "?" + c.urlParams_.Encode()
  37062. req, err := http.NewRequest("GET", urls, body)
  37063. if err != nil {
  37064. return nil, err
  37065. }
  37066. req.Header = reqHeaders
  37067. googleapi.Expand(req.URL, map[string]string{
  37068. "profileId": strconv.FormatInt(c.profileId, 10),
  37069. "id": strconv.FormatInt(c.id, 10),
  37070. })
  37071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37072. }
  37073. // Do executes the "dfareporting.platformTypes.get" call.
  37074. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  37075. // status code is an error. Response headers are in either
  37076. // *PlatformType.ServerResponse.Header or (if a response was returned at
  37077. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37078. // to check whether the returned error was because
  37079. // http.StatusNotModified was returned.
  37080. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  37081. gensupport.SetOptions(c.urlParams_, opts...)
  37082. res, err := c.doRequest("json")
  37083. if res != nil && res.StatusCode == http.StatusNotModified {
  37084. if res.Body != nil {
  37085. res.Body.Close()
  37086. }
  37087. return nil, &googleapi.Error{
  37088. Code: res.StatusCode,
  37089. Header: res.Header,
  37090. }
  37091. }
  37092. if err != nil {
  37093. return nil, err
  37094. }
  37095. defer googleapi.CloseBody(res)
  37096. if err := googleapi.CheckResponse(res); err != nil {
  37097. return nil, err
  37098. }
  37099. ret := &PlatformType{
  37100. ServerResponse: googleapi.ServerResponse{
  37101. Header: res.Header,
  37102. HTTPStatusCode: res.StatusCode,
  37103. },
  37104. }
  37105. target := &ret
  37106. if err := gensupport.DecodeResponse(target, res); err != nil {
  37107. return nil, err
  37108. }
  37109. return ret, nil
  37110. // {
  37111. // "description": "Gets one platform type by ID.",
  37112. // "httpMethod": "GET",
  37113. // "id": "dfareporting.platformTypes.get",
  37114. // "parameterOrder": [
  37115. // "profileId",
  37116. // "id"
  37117. // ],
  37118. // "parameters": {
  37119. // "id": {
  37120. // "description": "Platform type ID.",
  37121. // "format": "int64",
  37122. // "location": "path",
  37123. // "required": true,
  37124. // "type": "string"
  37125. // },
  37126. // "profileId": {
  37127. // "description": "User profile ID associated with this request.",
  37128. // "format": "int64",
  37129. // "location": "path",
  37130. // "required": true,
  37131. // "type": "string"
  37132. // }
  37133. // },
  37134. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  37135. // "response": {
  37136. // "$ref": "PlatformType"
  37137. // },
  37138. // "scopes": [
  37139. // "https://www.googleapis.com/auth/dfatrafficking"
  37140. // ]
  37141. // }
  37142. }
  37143. // method id "dfareporting.platformTypes.list":
  37144. type PlatformTypesListCall struct {
  37145. s *Service
  37146. profileId int64
  37147. urlParams_ gensupport.URLParams
  37148. ifNoneMatch_ string
  37149. ctx_ context.Context
  37150. header_ http.Header
  37151. }
  37152. // List: Retrieves a list of platform types.
  37153. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  37154. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37155. c.profileId = profileId
  37156. return c
  37157. }
  37158. // Fields allows partial responses to be retrieved. See
  37159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37160. // for more information.
  37161. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  37162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37163. return c
  37164. }
  37165. // IfNoneMatch sets the optional parameter which makes the operation
  37166. // fail if the object's ETag matches the given value. This is useful for
  37167. // getting updates only after the object has changed since the last
  37168. // request. Use googleapi.IsNotModified to check whether the response
  37169. // error from Do is the result of In-None-Match.
  37170. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  37171. c.ifNoneMatch_ = entityTag
  37172. return c
  37173. }
  37174. // Context sets the context to be used in this call's Do method. Any
  37175. // pending HTTP request will be aborted if the provided context is
  37176. // canceled.
  37177. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  37178. c.ctx_ = ctx
  37179. return c
  37180. }
  37181. // Header returns an http.Header that can be modified by the caller to
  37182. // add HTTP headers to the request.
  37183. func (c *PlatformTypesListCall) Header() http.Header {
  37184. if c.header_ == nil {
  37185. c.header_ = make(http.Header)
  37186. }
  37187. return c.header_
  37188. }
  37189. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  37190. reqHeaders := make(http.Header)
  37191. for k, v := range c.header_ {
  37192. reqHeaders[k] = v
  37193. }
  37194. reqHeaders.Set("User-Agent", c.s.userAgent())
  37195. if c.ifNoneMatch_ != "" {
  37196. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37197. }
  37198. var body io.Reader = nil
  37199. c.urlParams_.Set("alt", alt)
  37200. c.urlParams_.Set("prettyPrint", "false")
  37201. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  37202. urls += "?" + c.urlParams_.Encode()
  37203. req, err := http.NewRequest("GET", urls, body)
  37204. if err != nil {
  37205. return nil, err
  37206. }
  37207. req.Header = reqHeaders
  37208. googleapi.Expand(req.URL, map[string]string{
  37209. "profileId": strconv.FormatInt(c.profileId, 10),
  37210. })
  37211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37212. }
  37213. // Do executes the "dfareporting.platformTypes.list" call.
  37214. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  37215. // Any non-2xx status code is an error. Response headers are in either
  37216. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  37217. // was returned at all) in error.(*googleapi.Error).Header. Use
  37218. // googleapi.IsNotModified to check whether the returned error was
  37219. // because http.StatusNotModified was returned.
  37220. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  37221. gensupport.SetOptions(c.urlParams_, opts...)
  37222. res, err := c.doRequest("json")
  37223. if res != nil && res.StatusCode == http.StatusNotModified {
  37224. if res.Body != nil {
  37225. res.Body.Close()
  37226. }
  37227. return nil, &googleapi.Error{
  37228. Code: res.StatusCode,
  37229. Header: res.Header,
  37230. }
  37231. }
  37232. if err != nil {
  37233. return nil, err
  37234. }
  37235. defer googleapi.CloseBody(res)
  37236. if err := googleapi.CheckResponse(res); err != nil {
  37237. return nil, err
  37238. }
  37239. ret := &PlatformTypesListResponse{
  37240. ServerResponse: googleapi.ServerResponse{
  37241. Header: res.Header,
  37242. HTTPStatusCode: res.StatusCode,
  37243. },
  37244. }
  37245. target := &ret
  37246. if err := gensupport.DecodeResponse(target, res); err != nil {
  37247. return nil, err
  37248. }
  37249. return ret, nil
  37250. // {
  37251. // "description": "Retrieves a list of platform types.",
  37252. // "httpMethod": "GET",
  37253. // "id": "dfareporting.platformTypes.list",
  37254. // "parameterOrder": [
  37255. // "profileId"
  37256. // ],
  37257. // "parameters": {
  37258. // "profileId": {
  37259. // "description": "User profile ID associated with this request.",
  37260. // "format": "int64",
  37261. // "location": "path",
  37262. // "required": true,
  37263. // "type": "string"
  37264. // }
  37265. // },
  37266. // "path": "userprofiles/{profileId}/platformTypes",
  37267. // "response": {
  37268. // "$ref": "PlatformTypesListResponse"
  37269. // },
  37270. // "scopes": [
  37271. // "https://www.googleapis.com/auth/dfatrafficking"
  37272. // ]
  37273. // }
  37274. }
  37275. // method id "dfareporting.postalCodes.get":
  37276. type PostalCodesGetCall struct {
  37277. s *Service
  37278. profileId int64
  37279. code string
  37280. urlParams_ gensupport.URLParams
  37281. ifNoneMatch_ string
  37282. ctx_ context.Context
  37283. header_ http.Header
  37284. }
  37285. // Get: Gets one postal code by ID.
  37286. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  37287. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37288. c.profileId = profileId
  37289. c.code = code
  37290. return c
  37291. }
  37292. // Fields allows partial responses to be retrieved. See
  37293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37294. // for more information.
  37295. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  37296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37297. return c
  37298. }
  37299. // IfNoneMatch sets the optional parameter which makes the operation
  37300. // fail if the object's ETag matches the given value. This is useful for
  37301. // getting updates only after the object has changed since the last
  37302. // request. Use googleapi.IsNotModified to check whether the response
  37303. // error from Do is the result of In-None-Match.
  37304. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  37305. c.ifNoneMatch_ = entityTag
  37306. return c
  37307. }
  37308. // Context sets the context to be used in this call's Do method. Any
  37309. // pending HTTP request will be aborted if the provided context is
  37310. // canceled.
  37311. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  37312. c.ctx_ = ctx
  37313. return c
  37314. }
  37315. // Header returns an http.Header that can be modified by the caller to
  37316. // add HTTP headers to the request.
  37317. func (c *PostalCodesGetCall) Header() http.Header {
  37318. if c.header_ == nil {
  37319. c.header_ = make(http.Header)
  37320. }
  37321. return c.header_
  37322. }
  37323. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  37324. reqHeaders := make(http.Header)
  37325. for k, v := range c.header_ {
  37326. reqHeaders[k] = v
  37327. }
  37328. reqHeaders.Set("User-Agent", c.s.userAgent())
  37329. if c.ifNoneMatch_ != "" {
  37330. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37331. }
  37332. var body io.Reader = nil
  37333. c.urlParams_.Set("alt", alt)
  37334. c.urlParams_.Set("prettyPrint", "false")
  37335. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  37336. urls += "?" + c.urlParams_.Encode()
  37337. req, err := http.NewRequest("GET", urls, body)
  37338. if err != nil {
  37339. return nil, err
  37340. }
  37341. req.Header = reqHeaders
  37342. googleapi.Expand(req.URL, map[string]string{
  37343. "profileId": strconv.FormatInt(c.profileId, 10),
  37344. "code": c.code,
  37345. })
  37346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37347. }
  37348. // Do executes the "dfareporting.postalCodes.get" call.
  37349. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  37350. // status code is an error. Response headers are in either
  37351. // *PostalCode.ServerResponse.Header or (if a response was returned at
  37352. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37353. // to check whether the returned error was because
  37354. // http.StatusNotModified was returned.
  37355. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  37356. gensupport.SetOptions(c.urlParams_, opts...)
  37357. res, err := c.doRequest("json")
  37358. if res != nil && res.StatusCode == http.StatusNotModified {
  37359. if res.Body != nil {
  37360. res.Body.Close()
  37361. }
  37362. return nil, &googleapi.Error{
  37363. Code: res.StatusCode,
  37364. Header: res.Header,
  37365. }
  37366. }
  37367. if err != nil {
  37368. return nil, err
  37369. }
  37370. defer googleapi.CloseBody(res)
  37371. if err := googleapi.CheckResponse(res); err != nil {
  37372. return nil, err
  37373. }
  37374. ret := &PostalCode{
  37375. ServerResponse: googleapi.ServerResponse{
  37376. Header: res.Header,
  37377. HTTPStatusCode: res.StatusCode,
  37378. },
  37379. }
  37380. target := &ret
  37381. if err := gensupport.DecodeResponse(target, res); err != nil {
  37382. return nil, err
  37383. }
  37384. return ret, nil
  37385. // {
  37386. // "description": "Gets one postal code by ID.",
  37387. // "httpMethod": "GET",
  37388. // "id": "dfareporting.postalCodes.get",
  37389. // "parameterOrder": [
  37390. // "profileId",
  37391. // "code"
  37392. // ],
  37393. // "parameters": {
  37394. // "code": {
  37395. // "description": "Postal code ID.",
  37396. // "location": "path",
  37397. // "required": true,
  37398. // "type": "string"
  37399. // },
  37400. // "profileId": {
  37401. // "description": "User profile ID associated with this request.",
  37402. // "format": "int64",
  37403. // "location": "path",
  37404. // "required": true,
  37405. // "type": "string"
  37406. // }
  37407. // },
  37408. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  37409. // "response": {
  37410. // "$ref": "PostalCode"
  37411. // },
  37412. // "scopes": [
  37413. // "https://www.googleapis.com/auth/dfatrafficking"
  37414. // ]
  37415. // }
  37416. }
  37417. // method id "dfareporting.postalCodes.list":
  37418. type PostalCodesListCall struct {
  37419. s *Service
  37420. profileId int64
  37421. urlParams_ gensupport.URLParams
  37422. ifNoneMatch_ string
  37423. ctx_ context.Context
  37424. header_ http.Header
  37425. }
  37426. // List: Retrieves a list of postal codes.
  37427. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  37428. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37429. c.profileId = profileId
  37430. return c
  37431. }
  37432. // Fields allows partial responses to be retrieved. See
  37433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37434. // for more information.
  37435. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  37436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37437. return c
  37438. }
  37439. // IfNoneMatch sets the optional parameter which makes the operation
  37440. // fail if the object's ETag matches the given value. This is useful for
  37441. // getting updates only after the object has changed since the last
  37442. // request. Use googleapi.IsNotModified to check whether the response
  37443. // error from Do is the result of In-None-Match.
  37444. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  37445. c.ifNoneMatch_ = entityTag
  37446. return c
  37447. }
  37448. // Context sets the context to be used in this call's Do method. Any
  37449. // pending HTTP request will be aborted if the provided context is
  37450. // canceled.
  37451. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  37452. c.ctx_ = ctx
  37453. return c
  37454. }
  37455. // Header returns an http.Header that can be modified by the caller to
  37456. // add HTTP headers to the request.
  37457. func (c *PostalCodesListCall) Header() http.Header {
  37458. if c.header_ == nil {
  37459. c.header_ = make(http.Header)
  37460. }
  37461. return c.header_
  37462. }
  37463. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  37464. reqHeaders := make(http.Header)
  37465. for k, v := range c.header_ {
  37466. reqHeaders[k] = v
  37467. }
  37468. reqHeaders.Set("User-Agent", c.s.userAgent())
  37469. if c.ifNoneMatch_ != "" {
  37470. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37471. }
  37472. var body io.Reader = nil
  37473. c.urlParams_.Set("alt", alt)
  37474. c.urlParams_.Set("prettyPrint", "false")
  37475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  37476. urls += "?" + c.urlParams_.Encode()
  37477. req, err := http.NewRequest("GET", urls, body)
  37478. if err != nil {
  37479. return nil, err
  37480. }
  37481. req.Header = reqHeaders
  37482. googleapi.Expand(req.URL, map[string]string{
  37483. "profileId": strconv.FormatInt(c.profileId, 10),
  37484. })
  37485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37486. }
  37487. // Do executes the "dfareporting.postalCodes.list" call.
  37488. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  37489. // non-2xx status code is an error. Response headers are in either
  37490. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  37491. // returned at all) in error.(*googleapi.Error).Header. Use
  37492. // googleapi.IsNotModified to check whether the returned error was
  37493. // because http.StatusNotModified was returned.
  37494. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  37495. gensupport.SetOptions(c.urlParams_, opts...)
  37496. res, err := c.doRequest("json")
  37497. if res != nil && res.StatusCode == http.StatusNotModified {
  37498. if res.Body != nil {
  37499. res.Body.Close()
  37500. }
  37501. return nil, &googleapi.Error{
  37502. Code: res.StatusCode,
  37503. Header: res.Header,
  37504. }
  37505. }
  37506. if err != nil {
  37507. return nil, err
  37508. }
  37509. defer googleapi.CloseBody(res)
  37510. if err := googleapi.CheckResponse(res); err != nil {
  37511. return nil, err
  37512. }
  37513. ret := &PostalCodesListResponse{
  37514. ServerResponse: googleapi.ServerResponse{
  37515. Header: res.Header,
  37516. HTTPStatusCode: res.StatusCode,
  37517. },
  37518. }
  37519. target := &ret
  37520. if err := gensupport.DecodeResponse(target, res); err != nil {
  37521. return nil, err
  37522. }
  37523. return ret, nil
  37524. // {
  37525. // "description": "Retrieves a list of postal codes.",
  37526. // "httpMethod": "GET",
  37527. // "id": "dfareporting.postalCodes.list",
  37528. // "parameterOrder": [
  37529. // "profileId"
  37530. // ],
  37531. // "parameters": {
  37532. // "profileId": {
  37533. // "description": "User profile ID associated with this request.",
  37534. // "format": "int64",
  37535. // "location": "path",
  37536. // "required": true,
  37537. // "type": "string"
  37538. // }
  37539. // },
  37540. // "path": "userprofiles/{profileId}/postalCodes",
  37541. // "response": {
  37542. // "$ref": "PostalCodesListResponse"
  37543. // },
  37544. // "scopes": [
  37545. // "https://www.googleapis.com/auth/dfatrafficking"
  37546. // ]
  37547. // }
  37548. }
  37549. // method id "dfareporting.projects.get":
  37550. type ProjectsGetCall struct {
  37551. s *Service
  37552. profileId int64
  37553. id int64
  37554. urlParams_ gensupport.URLParams
  37555. ifNoneMatch_ string
  37556. ctx_ context.Context
  37557. header_ http.Header
  37558. }
  37559. // Get: Gets one project by ID.
  37560. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  37561. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37562. c.profileId = profileId
  37563. c.id = id
  37564. return c
  37565. }
  37566. // Fields allows partial responses to be retrieved. See
  37567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37568. // for more information.
  37569. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  37570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37571. return c
  37572. }
  37573. // IfNoneMatch sets the optional parameter which makes the operation
  37574. // fail if the object's ETag matches the given value. This is useful for
  37575. // getting updates only after the object has changed since the last
  37576. // request. Use googleapi.IsNotModified to check whether the response
  37577. // error from Do is the result of In-None-Match.
  37578. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  37579. c.ifNoneMatch_ = entityTag
  37580. return c
  37581. }
  37582. // Context sets the context to be used in this call's Do method. Any
  37583. // pending HTTP request will be aborted if the provided context is
  37584. // canceled.
  37585. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  37586. c.ctx_ = ctx
  37587. return c
  37588. }
  37589. // Header returns an http.Header that can be modified by the caller to
  37590. // add HTTP headers to the request.
  37591. func (c *ProjectsGetCall) Header() http.Header {
  37592. if c.header_ == nil {
  37593. c.header_ = make(http.Header)
  37594. }
  37595. return c.header_
  37596. }
  37597. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  37598. reqHeaders := make(http.Header)
  37599. for k, v := range c.header_ {
  37600. reqHeaders[k] = v
  37601. }
  37602. reqHeaders.Set("User-Agent", c.s.userAgent())
  37603. if c.ifNoneMatch_ != "" {
  37604. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37605. }
  37606. var body io.Reader = nil
  37607. c.urlParams_.Set("alt", alt)
  37608. c.urlParams_.Set("prettyPrint", "false")
  37609. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  37610. urls += "?" + c.urlParams_.Encode()
  37611. req, err := http.NewRequest("GET", urls, body)
  37612. if err != nil {
  37613. return nil, err
  37614. }
  37615. req.Header = reqHeaders
  37616. googleapi.Expand(req.URL, map[string]string{
  37617. "profileId": strconv.FormatInt(c.profileId, 10),
  37618. "id": strconv.FormatInt(c.id, 10),
  37619. })
  37620. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37621. }
  37622. // Do executes the "dfareporting.projects.get" call.
  37623. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  37624. // code is an error. Response headers are in either
  37625. // *Project.ServerResponse.Header or (if a response was returned at all)
  37626. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  37627. // check whether the returned error was because http.StatusNotModified
  37628. // was returned.
  37629. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  37630. gensupport.SetOptions(c.urlParams_, opts...)
  37631. res, err := c.doRequest("json")
  37632. if res != nil && res.StatusCode == http.StatusNotModified {
  37633. if res.Body != nil {
  37634. res.Body.Close()
  37635. }
  37636. return nil, &googleapi.Error{
  37637. Code: res.StatusCode,
  37638. Header: res.Header,
  37639. }
  37640. }
  37641. if err != nil {
  37642. return nil, err
  37643. }
  37644. defer googleapi.CloseBody(res)
  37645. if err := googleapi.CheckResponse(res); err != nil {
  37646. return nil, err
  37647. }
  37648. ret := &Project{
  37649. ServerResponse: googleapi.ServerResponse{
  37650. Header: res.Header,
  37651. HTTPStatusCode: res.StatusCode,
  37652. },
  37653. }
  37654. target := &ret
  37655. if err := gensupport.DecodeResponse(target, res); err != nil {
  37656. return nil, err
  37657. }
  37658. return ret, nil
  37659. // {
  37660. // "description": "Gets one project by ID.",
  37661. // "httpMethod": "GET",
  37662. // "id": "dfareporting.projects.get",
  37663. // "parameterOrder": [
  37664. // "profileId",
  37665. // "id"
  37666. // ],
  37667. // "parameters": {
  37668. // "id": {
  37669. // "description": "Project ID.",
  37670. // "format": "int64",
  37671. // "location": "path",
  37672. // "required": true,
  37673. // "type": "string"
  37674. // },
  37675. // "profileId": {
  37676. // "description": "User profile ID associated with this request.",
  37677. // "format": "int64",
  37678. // "location": "path",
  37679. // "required": true,
  37680. // "type": "string"
  37681. // }
  37682. // },
  37683. // "path": "userprofiles/{profileId}/projects/{id}",
  37684. // "response": {
  37685. // "$ref": "Project"
  37686. // },
  37687. // "scopes": [
  37688. // "https://www.googleapis.com/auth/dfatrafficking"
  37689. // ]
  37690. // }
  37691. }
  37692. // method id "dfareporting.projects.list":
  37693. type ProjectsListCall struct {
  37694. s *Service
  37695. profileId int64
  37696. urlParams_ gensupport.URLParams
  37697. ifNoneMatch_ string
  37698. ctx_ context.Context
  37699. header_ http.Header
  37700. }
  37701. // List: Retrieves a list of projects, possibly filtered. This method
  37702. // supports paging.
  37703. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  37704. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37705. c.profileId = profileId
  37706. return c
  37707. }
  37708. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  37709. // only projects with these advertiser IDs.
  37710. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  37711. var advertiserIds_ []string
  37712. for _, v := range advertiserIds {
  37713. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  37714. }
  37715. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  37716. return c
  37717. }
  37718. // Ids sets the optional parameter "ids": Select only projects with
  37719. // these IDs.
  37720. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  37721. var ids_ []string
  37722. for _, v := range ids {
  37723. ids_ = append(ids_, fmt.Sprint(v))
  37724. }
  37725. c.urlParams_.SetMulti("ids", ids_)
  37726. return c
  37727. }
  37728. // MaxResults sets the optional parameter "maxResults": Maximum number
  37729. // of results to return.
  37730. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  37731. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37732. return c
  37733. }
  37734. // PageToken sets the optional parameter "pageToken": Value of the
  37735. // nextPageToken from the previous result page.
  37736. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  37737. c.urlParams_.Set("pageToken", pageToken)
  37738. return c
  37739. }
  37740. // SearchString sets the optional parameter "searchString": Allows
  37741. // searching for projects by name or ID. Wildcards (*) are allowed. For
  37742. // example, "project*2015" will return projects with names like "project
  37743. // June 2015", "project April 2015", or simply "project 2015". Most of
  37744. // the searches also add wildcards implicitly at the start and the end
  37745. // of the search string. For example, a search string of "project" will
  37746. // match projects with name "my project", "project 2015", or simply
  37747. // "project".
  37748. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  37749. c.urlParams_.Set("searchString", searchString)
  37750. return c
  37751. }
  37752. // SortField sets the optional parameter "sortField": Field by which to
  37753. // sort the list.
  37754. //
  37755. // Possible values:
  37756. // "ID" (default)
  37757. // "NAME"
  37758. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  37759. c.urlParams_.Set("sortField", sortField)
  37760. return c
  37761. }
  37762. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  37763. // results.
  37764. //
  37765. // Possible values:
  37766. // "ASCENDING" (default)
  37767. // "DESCENDING"
  37768. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  37769. c.urlParams_.Set("sortOrder", sortOrder)
  37770. return c
  37771. }
  37772. // Fields allows partial responses to be retrieved. See
  37773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37774. // for more information.
  37775. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  37776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37777. return c
  37778. }
  37779. // IfNoneMatch sets the optional parameter which makes the operation
  37780. // fail if the object's ETag matches the given value. This is useful for
  37781. // getting updates only after the object has changed since the last
  37782. // request. Use googleapi.IsNotModified to check whether the response
  37783. // error from Do is the result of In-None-Match.
  37784. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  37785. c.ifNoneMatch_ = entityTag
  37786. return c
  37787. }
  37788. // Context sets the context to be used in this call's Do method. Any
  37789. // pending HTTP request will be aborted if the provided context is
  37790. // canceled.
  37791. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  37792. c.ctx_ = ctx
  37793. return c
  37794. }
  37795. // Header returns an http.Header that can be modified by the caller to
  37796. // add HTTP headers to the request.
  37797. func (c *ProjectsListCall) Header() http.Header {
  37798. if c.header_ == nil {
  37799. c.header_ = make(http.Header)
  37800. }
  37801. return c.header_
  37802. }
  37803. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  37804. reqHeaders := make(http.Header)
  37805. for k, v := range c.header_ {
  37806. reqHeaders[k] = v
  37807. }
  37808. reqHeaders.Set("User-Agent", c.s.userAgent())
  37809. if c.ifNoneMatch_ != "" {
  37810. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37811. }
  37812. var body io.Reader = nil
  37813. c.urlParams_.Set("alt", alt)
  37814. c.urlParams_.Set("prettyPrint", "false")
  37815. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  37816. urls += "?" + c.urlParams_.Encode()
  37817. req, err := http.NewRequest("GET", urls, body)
  37818. if err != nil {
  37819. return nil, err
  37820. }
  37821. req.Header = reqHeaders
  37822. googleapi.Expand(req.URL, map[string]string{
  37823. "profileId": strconv.FormatInt(c.profileId, 10),
  37824. })
  37825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37826. }
  37827. // Do executes the "dfareporting.projects.list" call.
  37828. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  37829. // non-2xx status code is an error. Response headers are in either
  37830. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  37831. // returned at all) in error.(*googleapi.Error).Header. Use
  37832. // googleapi.IsNotModified to check whether the returned error was
  37833. // because http.StatusNotModified was returned.
  37834. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  37835. gensupport.SetOptions(c.urlParams_, opts...)
  37836. res, err := c.doRequest("json")
  37837. if res != nil && res.StatusCode == http.StatusNotModified {
  37838. if res.Body != nil {
  37839. res.Body.Close()
  37840. }
  37841. return nil, &googleapi.Error{
  37842. Code: res.StatusCode,
  37843. Header: res.Header,
  37844. }
  37845. }
  37846. if err != nil {
  37847. return nil, err
  37848. }
  37849. defer googleapi.CloseBody(res)
  37850. if err := googleapi.CheckResponse(res); err != nil {
  37851. return nil, err
  37852. }
  37853. ret := &ProjectsListResponse{
  37854. ServerResponse: googleapi.ServerResponse{
  37855. Header: res.Header,
  37856. HTTPStatusCode: res.StatusCode,
  37857. },
  37858. }
  37859. target := &ret
  37860. if err := gensupport.DecodeResponse(target, res); err != nil {
  37861. return nil, err
  37862. }
  37863. return ret, nil
  37864. // {
  37865. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  37866. // "httpMethod": "GET",
  37867. // "id": "dfareporting.projects.list",
  37868. // "parameterOrder": [
  37869. // "profileId"
  37870. // ],
  37871. // "parameters": {
  37872. // "advertiserIds": {
  37873. // "description": "Select only projects with these advertiser IDs.",
  37874. // "format": "int64",
  37875. // "location": "query",
  37876. // "repeated": true,
  37877. // "type": "string"
  37878. // },
  37879. // "ids": {
  37880. // "description": "Select only projects with these IDs.",
  37881. // "format": "int64",
  37882. // "location": "query",
  37883. // "repeated": true,
  37884. // "type": "string"
  37885. // },
  37886. // "maxResults": {
  37887. // "default": "1000",
  37888. // "description": "Maximum number of results to return.",
  37889. // "format": "int32",
  37890. // "location": "query",
  37891. // "maximum": "1000",
  37892. // "minimum": "0",
  37893. // "type": "integer"
  37894. // },
  37895. // "pageToken": {
  37896. // "description": "Value of the nextPageToken from the previous result page.",
  37897. // "location": "query",
  37898. // "type": "string"
  37899. // },
  37900. // "profileId": {
  37901. // "description": "User profile ID associated with this request.",
  37902. // "format": "int64",
  37903. // "location": "path",
  37904. // "required": true,
  37905. // "type": "string"
  37906. // },
  37907. // "searchString": {
  37908. // "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\".",
  37909. // "location": "query",
  37910. // "type": "string"
  37911. // },
  37912. // "sortField": {
  37913. // "default": "ID",
  37914. // "description": "Field by which to sort the list.",
  37915. // "enum": [
  37916. // "ID",
  37917. // "NAME"
  37918. // ],
  37919. // "enumDescriptions": [
  37920. // "",
  37921. // ""
  37922. // ],
  37923. // "location": "query",
  37924. // "type": "string"
  37925. // },
  37926. // "sortOrder": {
  37927. // "default": "ASCENDING",
  37928. // "description": "Order of sorted results.",
  37929. // "enum": [
  37930. // "ASCENDING",
  37931. // "DESCENDING"
  37932. // ],
  37933. // "enumDescriptions": [
  37934. // "",
  37935. // ""
  37936. // ],
  37937. // "location": "query",
  37938. // "type": "string"
  37939. // }
  37940. // },
  37941. // "path": "userprofiles/{profileId}/projects",
  37942. // "response": {
  37943. // "$ref": "ProjectsListResponse"
  37944. // },
  37945. // "scopes": [
  37946. // "https://www.googleapis.com/auth/dfatrafficking"
  37947. // ]
  37948. // }
  37949. }
  37950. // Pages invokes f for each page of results.
  37951. // A non-nil error returned from f will halt the iteration.
  37952. // The provided context supersedes any context provided to the Context method.
  37953. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  37954. c.ctx_ = ctx
  37955. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37956. for {
  37957. x, err := c.Do()
  37958. if err != nil {
  37959. return err
  37960. }
  37961. if err := f(x); err != nil {
  37962. return err
  37963. }
  37964. if x.NextPageToken == "" {
  37965. return nil
  37966. }
  37967. c.PageToken(x.NextPageToken)
  37968. }
  37969. }
  37970. // method id "dfareporting.regions.list":
  37971. type RegionsListCall struct {
  37972. s *Service
  37973. profileId int64
  37974. urlParams_ gensupport.URLParams
  37975. ifNoneMatch_ string
  37976. ctx_ context.Context
  37977. header_ http.Header
  37978. }
  37979. // List: Retrieves a list of regions.
  37980. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  37981. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37982. c.profileId = profileId
  37983. return c
  37984. }
  37985. // Fields allows partial responses to be retrieved. See
  37986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37987. // for more information.
  37988. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  37989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37990. return c
  37991. }
  37992. // IfNoneMatch sets the optional parameter which makes the operation
  37993. // fail if the object's ETag matches the given value. This is useful for
  37994. // getting updates only after the object has changed since the last
  37995. // request. Use googleapi.IsNotModified to check whether the response
  37996. // error from Do is the result of In-None-Match.
  37997. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  37998. c.ifNoneMatch_ = entityTag
  37999. return c
  38000. }
  38001. // Context sets the context to be used in this call's Do method. Any
  38002. // pending HTTP request will be aborted if the provided context is
  38003. // canceled.
  38004. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  38005. c.ctx_ = ctx
  38006. return c
  38007. }
  38008. // Header returns an http.Header that can be modified by the caller to
  38009. // add HTTP headers to the request.
  38010. func (c *RegionsListCall) Header() http.Header {
  38011. if c.header_ == nil {
  38012. c.header_ = make(http.Header)
  38013. }
  38014. return c.header_
  38015. }
  38016. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  38017. reqHeaders := make(http.Header)
  38018. for k, v := range c.header_ {
  38019. reqHeaders[k] = v
  38020. }
  38021. reqHeaders.Set("User-Agent", c.s.userAgent())
  38022. if c.ifNoneMatch_ != "" {
  38023. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38024. }
  38025. var body io.Reader = nil
  38026. c.urlParams_.Set("alt", alt)
  38027. c.urlParams_.Set("prettyPrint", "false")
  38028. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  38029. urls += "?" + c.urlParams_.Encode()
  38030. req, err := http.NewRequest("GET", urls, body)
  38031. if err != nil {
  38032. return nil, err
  38033. }
  38034. req.Header = reqHeaders
  38035. googleapi.Expand(req.URL, map[string]string{
  38036. "profileId": strconv.FormatInt(c.profileId, 10),
  38037. })
  38038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38039. }
  38040. // Do executes the "dfareporting.regions.list" call.
  38041. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  38042. // non-2xx status code is an error. Response headers are in either
  38043. // *RegionsListResponse.ServerResponse.Header or (if a response was
  38044. // returned at all) in error.(*googleapi.Error).Header. Use
  38045. // googleapi.IsNotModified to check whether the returned error was
  38046. // because http.StatusNotModified was returned.
  38047. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  38048. gensupport.SetOptions(c.urlParams_, opts...)
  38049. res, err := c.doRequest("json")
  38050. if res != nil && res.StatusCode == http.StatusNotModified {
  38051. if res.Body != nil {
  38052. res.Body.Close()
  38053. }
  38054. return nil, &googleapi.Error{
  38055. Code: res.StatusCode,
  38056. Header: res.Header,
  38057. }
  38058. }
  38059. if err != nil {
  38060. return nil, err
  38061. }
  38062. defer googleapi.CloseBody(res)
  38063. if err := googleapi.CheckResponse(res); err != nil {
  38064. return nil, err
  38065. }
  38066. ret := &RegionsListResponse{
  38067. ServerResponse: googleapi.ServerResponse{
  38068. Header: res.Header,
  38069. HTTPStatusCode: res.StatusCode,
  38070. },
  38071. }
  38072. target := &ret
  38073. if err := gensupport.DecodeResponse(target, res); err != nil {
  38074. return nil, err
  38075. }
  38076. return ret, nil
  38077. // {
  38078. // "description": "Retrieves a list of regions.",
  38079. // "httpMethod": "GET",
  38080. // "id": "dfareporting.regions.list",
  38081. // "parameterOrder": [
  38082. // "profileId"
  38083. // ],
  38084. // "parameters": {
  38085. // "profileId": {
  38086. // "description": "User profile ID associated with this request.",
  38087. // "format": "int64",
  38088. // "location": "path",
  38089. // "required": true,
  38090. // "type": "string"
  38091. // }
  38092. // },
  38093. // "path": "userprofiles/{profileId}/regions",
  38094. // "response": {
  38095. // "$ref": "RegionsListResponse"
  38096. // },
  38097. // "scopes": [
  38098. // "https://www.googleapis.com/auth/dfatrafficking"
  38099. // ]
  38100. // }
  38101. }
  38102. // method id "dfareporting.remarketingListShares.get":
  38103. type RemarketingListSharesGetCall struct {
  38104. s *Service
  38105. profileId int64
  38106. remarketingListId int64
  38107. urlParams_ gensupport.URLParams
  38108. ifNoneMatch_ string
  38109. ctx_ context.Context
  38110. header_ http.Header
  38111. }
  38112. // Get: Gets one remarketing list share by remarketing list ID.
  38113. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  38114. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38115. c.profileId = profileId
  38116. c.remarketingListId = remarketingListId
  38117. return c
  38118. }
  38119. // Fields allows partial responses to be retrieved. See
  38120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38121. // for more information.
  38122. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  38123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38124. return c
  38125. }
  38126. // IfNoneMatch sets the optional parameter which makes the operation
  38127. // fail if the object's ETag matches the given value. This is useful for
  38128. // getting updates only after the object has changed since the last
  38129. // request. Use googleapi.IsNotModified to check whether the response
  38130. // error from Do is the result of In-None-Match.
  38131. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  38132. c.ifNoneMatch_ = entityTag
  38133. return c
  38134. }
  38135. // Context sets the context to be used in this call's Do method. Any
  38136. // pending HTTP request will be aborted if the provided context is
  38137. // canceled.
  38138. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  38139. c.ctx_ = ctx
  38140. return c
  38141. }
  38142. // Header returns an http.Header that can be modified by the caller to
  38143. // add HTTP headers to the request.
  38144. func (c *RemarketingListSharesGetCall) Header() http.Header {
  38145. if c.header_ == nil {
  38146. c.header_ = make(http.Header)
  38147. }
  38148. return c.header_
  38149. }
  38150. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  38151. reqHeaders := make(http.Header)
  38152. for k, v := range c.header_ {
  38153. reqHeaders[k] = v
  38154. }
  38155. reqHeaders.Set("User-Agent", c.s.userAgent())
  38156. if c.ifNoneMatch_ != "" {
  38157. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38158. }
  38159. var body io.Reader = nil
  38160. c.urlParams_.Set("alt", alt)
  38161. c.urlParams_.Set("prettyPrint", "false")
  38162. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  38163. urls += "?" + c.urlParams_.Encode()
  38164. req, err := http.NewRequest("GET", urls, body)
  38165. if err != nil {
  38166. return nil, err
  38167. }
  38168. req.Header = reqHeaders
  38169. googleapi.Expand(req.URL, map[string]string{
  38170. "profileId": strconv.FormatInt(c.profileId, 10),
  38171. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  38172. })
  38173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38174. }
  38175. // Do executes the "dfareporting.remarketingListShares.get" call.
  38176. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38177. // non-2xx status code is an error. Response headers are in either
  38178. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38179. // returned at all) in error.(*googleapi.Error).Header. Use
  38180. // googleapi.IsNotModified to check whether the returned error was
  38181. // because http.StatusNotModified was returned.
  38182. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38183. gensupport.SetOptions(c.urlParams_, opts...)
  38184. res, err := c.doRequest("json")
  38185. if res != nil && res.StatusCode == http.StatusNotModified {
  38186. if res.Body != nil {
  38187. res.Body.Close()
  38188. }
  38189. return nil, &googleapi.Error{
  38190. Code: res.StatusCode,
  38191. Header: res.Header,
  38192. }
  38193. }
  38194. if err != nil {
  38195. return nil, err
  38196. }
  38197. defer googleapi.CloseBody(res)
  38198. if err := googleapi.CheckResponse(res); err != nil {
  38199. return nil, err
  38200. }
  38201. ret := &RemarketingListShare{
  38202. ServerResponse: googleapi.ServerResponse{
  38203. Header: res.Header,
  38204. HTTPStatusCode: res.StatusCode,
  38205. },
  38206. }
  38207. target := &ret
  38208. if err := gensupport.DecodeResponse(target, res); err != nil {
  38209. return nil, err
  38210. }
  38211. return ret, nil
  38212. // {
  38213. // "description": "Gets one remarketing list share by remarketing list ID.",
  38214. // "httpMethod": "GET",
  38215. // "id": "dfareporting.remarketingListShares.get",
  38216. // "parameterOrder": [
  38217. // "profileId",
  38218. // "remarketingListId"
  38219. // ],
  38220. // "parameters": {
  38221. // "profileId": {
  38222. // "description": "User profile ID associated with this request.",
  38223. // "format": "int64",
  38224. // "location": "path",
  38225. // "required": true,
  38226. // "type": "string"
  38227. // },
  38228. // "remarketingListId": {
  38229. // "description": "Remarketing list ID.",
  38230. // "format": "int64",
  38231. // "location": "path",
  38232. // "required": true,
  38233. // "type": "string"
  38234. // }
  38235. // },
  38236. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  38237. // "response": {
  38238. // "$ref": "RemarketingListShare"
  38239. // },
  38240. // "scopes": [
  38241. // "https://www.googleapis.com/auth/dfatrafficking"
  38242. // ]
  38243. // }
  38244. }
  38245. // method id "dfareporting.remarketingListShares.patch":
  38246. type RemarketingListSharesPatchCall struct {
  38247. s *Service
  38248. profileId int64
  38249. remarketinglistshare *RemarketingListShare
  38250. urlParams_ gensupport.URLParams
  38251. ctx_ context.Context
  38252. header_ http.Header
  38253. }
  38254. // Patch: Updates an existing remarketing list share. This method
  38255. // supports patch semantics.
  38256. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  38257. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38258. c.profileId = profileId
  38259. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  38260. c.remarketinglistshare = remarketinglistshare
  38261. return c
  38262. }
  38263. // Fields allows partial responses to be retrieved. See
  38264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38265. // for more information.
  38266. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  38267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38268. return c
  38269. }
  38270. // Context sets the context to be used in this call's Do method. Any
  38271. // pending HTTP request will be aborted if the provided context is
  38272. // canceled.
  38273. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  38274. c.ctx_ = ctx
  38275. return c
  38276. }
  38277. // Header returns an http.Header that can be modified by the caller to
  38278. // add HTTP headers to the request.
  38279. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  38280. if c.header_ == nil {
  38281. c.header_ = make(http.Header)
  38282. }
  38283. return c.header_
  38284. }
  38285. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  38286. reqHeaders := make(http.Header)
  38287. for k, v := range c.header_ {
  38288. reqHeaders[k] = v
  38289. }
  38290. reqHeaders.Set("User-Agent", c.s.userAgent())
  38291. var body io.Reader = nil
  38292. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38293. if err != nil {
  38294. return nil, err
  38295. }
  38296. reqHeaders.Set("Content-Type", "application/json")
  38297. c.urlParams_.Set("alt", alt)
  38298. c.urlParams_.Set("prettyPrint", "false")
  38299. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38300. urls += "?" + c.urlParams_.Encode()
  38301. req, err := http.NewRequest("PATCH", urls, body)
  38302. if err != nil {
  38303. return nil, err
  38304. }
  38305. req.Header = reqHeaders
  38306. googleapi.Expand(req.URL, map[string]string{
  38307. "profileId": strconv.FormatInt(c.profileId, 10),
  38308. })
  38309. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38310. }
  38311. // Do executes the "dfareporting.remarketingListShares.patch" call.
  38312. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38313. // non-2xx status code is an error. Response headers are in either
  38314. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38315. // returned at all) in error.(*googleapi.Error).Header. Use
  38316. // googleapi.IsNotModified to check whether the returned error was
  38317. // because http.StatusNotModified was returned.
  38318. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38319. gensupport.SetOptions(c.urlParams_, opts...)
  38320. res, err := c.doRequest("json")
  38321. if res != nil && res.StatusCode == http.StatusNotModified {
  38322. if res.Body != nil {
  38323. res.Body.Close()
  38324. }
  38325. return nil, &googleapi.Error{
  38326. Code: res.StatusCode,
  38327. Header: res.Header,
  38328. }
  38329. }
  38330. if err != nil {
  38331. return nil, err
  38332. }
  38333. defer googleapi.CloseBody(res)
  38334. if err := googleapi.CheckResponse(res); err != nil {
  38335. return nil, err
  38336. }
  38337. ret := &RemarketingListShare{
  38338. ServerResponse: googleapi.ServerResponse{
  38339. Header: res.Header,
  38340. HTTPStatusCode: res.StatusCode,
  38341. },
  38342. }
  38343. target := &ret
  38344. if err := gensupport.DecodeResponse(target, res); err != nil {
  38345. return nil, err
  38346. }
  38347. return ret, nil
  38348. // {
  38349. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  38350. // "httpMethod": "PATCH",
  38351. // "id": "dfareporting.remarketingListShares.patch",
  38352. // "parameterOrder": [
  38353. // "profileId",
  38354. // "remarketingListId"
  38355. // ],
  38356. // "parameters": {
  38357. // "profileId": {
  38358. // "description": "User profile ID associated with this request.",
  38359. // "format": "int64",
  38360. // "location": "path",
  38361. // "required": true,
  38362. // "type": "string"
  38363. // },
  38364. // "remarketingListId": {
  38365. // "description": "Remarketing list ID.",
  38366. // "format": "int64",
  38367. // "location": "query",
  38368. // "required": true,
  38369. // "type": "string"
  38370. // }
  38371. // },
  38372. // "path": "userprofiles/{profileId}/remarketingListShares",
  38373. // "request": {
  38374. // "$ref": "RemarketingListShare"
  38375. // },
  38376. // "response": {
  38377. // "$ref": "RemarketingListShare"
  38378. // },
  38379. // "scopes": [
  38380. // "https://www.googleapis.com/auth/dfatrafficking"
  38381. // ]
  38382. // }
  38383. }
  38384. // method id "dfareporting.remarketingListShares.update":
  38385. type RemarketingListSharesUpdateCall struct {
  38386. s *Service
  38387. profileId int64
  38388. remarketinglistshare *RemarketingListShare
  38389. urlParams_ gensupport.URLParams
  38390. ctx_ context.Context
  38391. header_ http.Header
  38392. }
  38393. // Update: Updates an existing remarketing list share.
  38394. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  38395. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38396. c.profileId = profileId
  38397. c.remarketinglistshare = remarketinglistshare
  38398. return c
  38399. }
  38400. // Fields allows partial responses to be retrieved. See
  38401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38402. // for more information.
  38403. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  38404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38405. return c
  38406. }
  38407. // Context sets the context to be used in this call's Do method. Any
  38408. // pending HTTP request will be aborted if the provided context is
  38409. // canceled.
  38410. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  38411. c.ctx_ = ctx
  38412. return c
  38413. }
  38414. // Header returns an http.Header that can be modified by the caller to
  38415. // add HTTP headers to the request.
  38416. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  38417. if c.header_ == nil {
  38418. c.header_ = make(http.Header)
  38419. }
  38420. return c.header_
  38421. }
  38422. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  38423. reqHeaders := make(http.Header)
  38424. for k, v := range c.header_ {
  38425. reqHeaders[k] = v
  38426. }
  38427. reqHeaders.Set("User-Agent", c.s.userAgent())
  38428. var body io.Reader = nil
  38429. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38430. if err != nil {
  38431. return nil, err
  38432. }
  38433. reqHeaders.Set("Content-Type", "application/json")
  38434. c.urlParams_.Set("alt", alt)
  38435. c.urlParams_.Set("prettyPrint", "false")
  38436. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38437. urls += "?" + c.urlParams_.Encode()
  38438. req, err := http.NewRequest("PUT", urls, body)
  38439. if err != nil {
  38440. return nil, err
  38441. }
  38442. req.Header = reqHeaders
  38443. googleapi.Expand(req.URL, map[string]string{
  38444. "profileId": strconv.FormatInt(c.profileId, 10),
  38445. })
  38446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38447. }
  38448. // Do executes the "dfareporting.remarketingListShares.update" call.
  38449. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38450. // non-2xx status code is an error. Response headers are in either
  38451. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38452. // returned at all) in error.(*googleapi.Error).Header. Use
  38453. // googleapi.IsNotModified to check whether the returned error was
  38454. // because http.StatusNotModified was returned.
  38455. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38456. gensupport.SetOptions(c.urlParams_, opts...)
  38457. res, err := c.doRequest("json")
  38458. if res != nil && res.StatusCode == http.StatusNotModified {
  38459. if res.Body != nil {
  38460. res.Body.Close()
  38461. }
  38462. return nil, &googleapi.Error{
  38463. Code: res.StatusCode,
  38464. Header: res.Header,
  38465. }
  38466. }
  38467. if err != nil {
  38468. return nil, err
  38469. }
  38470. defer googleapi.CloseBody(res)
  38471. if err := googleapi.CheckResponse(res); err != nil {
  38472. return nil, err
  38473. }
  38474. ret := &RemarketingListShare{
  38475. ServerResponse: googleapi.ServerResponse{
  38476. Header: res.Header,
  38477. HTTPStatusCode: res.StatusCode,
  38478. },
  38479. }
  38480. target := &ret
  38481. if err := gensupport.DecodeResponse(target, res); err != nil {
  38482. return nil, err
  38483. }
  38484. return ret, nil
  38485. // {
  38486. // "description": "Updates an existing remarketing list share.",
  38487. // "httpMethod": "PUT",
  38488. // "id": "dfareporting.remarketingListShares.update",
  38489. // "parameterOrder": [
  38490. // "profileId"
  38491. // ],
  38492. // "parameters": {
  38493. // "profileId": {
  38494. // "description": "User profile ID associated with this request.",
  38495. // "format": "int64",
  38496. // "location": "path",
  38497. // "required": true,
  38498. // "type": "string"
  38499. // }
  38500. // },
  38501. // "path": "userprofiles/{profileId}/remarketingListShares",
  38502. // "request": {
  38503. // "$ref": "RemarketingListShare"
  38504. // },
  38505. // "response": {
  38506. // "$ref": "RemarketingListShare"
  38507. // },
  38508. // "scopes": [
  38509. // "https://www.googleapis.com/auth/dfatrafficking"
  38510. // ]
  38511. // }
  38512. }
  38513. // method id "dfareporting.remarketingLists.get":
  38514. type RemarketingListsGetCall struct {
  38515. s *Service
  38516. profileId int64
  38517. id int64
  38518. urlParams_ gensupport.URLParams
  38519. ifNoneMatch_ string
  38520. ctx_ context.Context
  38521. header_ http.Header
  38522. }
  38523. // Get: Gets one remarketing list by ID.
  38524. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  38525. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38526. c.profileId = profileId
  38527. c.id = id
  38528. return c
  38529. }
  38530. // Fields allows partial responses to be retrieved. See
  38531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38532. // for more information.
  38533. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  38534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38535. return c
  38536. }
  38537. // IfNoneMatch sets the optional parameter which makes the operation
  38538. // fail if the object's ETag matches the given value. This is useful for
  38539. // getting updates only after the object has changed since the last
  38540. // request. Use googleapi.IsNotModified to check whether the response
  38541. // error from Do is the result of In-None-Match.
  38542. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  38543. c.ifNoneMatch_ = entityTag
  38544. return c
  38545. }
  38546. // Context sets the context to be used in this call's Do method. Any
  38547. // pending HTTP request will be aborted if the provided context is
  38548. // canceled.
  38549. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  38550. c.ctx_ = ctx
  38551. return c
  38552. }
  38553. // Header returns an http.Header that can be modified by the caller to
  38554. // add HTTP headers to the request.
  38555. func (c *RemarketingListsGetCall) Header() http.Header {
  38556. if c.header_ == nil {
  38557. c.header_ = make(http.Header)
  38558. }
  38559. return c.header_
  38560. }
  38561. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  38562. reqHeaders := make(http.Header)
  38563. for k, v := range c.header_ {
  38564. reqHeaders[k] = v
  38565. }
  38566. reqHeaders.Set("User-Agent", c.s.userAgent())
  38567. if c.ifNoneMatch_ != "" {
  38568. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38569. }
  38570. var body io.Reader = nil
  38571. c.urlParams_.Set("alt", alt)
  38572. c.urlParams_.Set("prettyPrint", "false")
  38573. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  38574. urls += "?" + c.urlParams_.Encode()
  38575. req, err := http.NewRequest("GET", urls, body)
  38576. if err != nil {
  38577. return nil, err
  38578. }
  38579. req.Header = reqHeaders
  38580. googleapi.Expand(req.URL, map[string]string{
  38581. "profileId": strconv.FormatInt(c.profileId, 10),
  38582. "id": strconv.FormatInt(c.id, 10),
  38583. })
  38584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38585. }
  38586. // Do executes the "dfareporting.remarketingLists.get" call.
  38587. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38588. // status code is an error. Response headers are in either
  38589. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38590. // at all) in error.(*googleapi.Error).Header. Use
  38591. // googleapi.IsNotModified to check whether the returned error was
  38592. // because http.StatusNotModified was returned.
  38593. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38594. gensupport.SetOptions(c.urlParams_, opts...)
  38595. res, err := c.doRequest("json")
  38596. if res != nil && res.StatusCode == http.StatusNotModified {
  38597. if res.Body != nil {
  38598. res.Body.Close()
  38599. }
  38600. return nil, &googleapi.Error{
  38601. Code: res.StatusCode,
  38602. Header: res.Header,
  38603. }
  38604. }
  38605. if err != nil {
  38606. return nil, err
  38607. }
  38608. defer googleapi.CloseBody(res)
  38609. if err := googleapi.CheckResponse(res); err != nil {
  38610. return nil, err
  38611. }
  38612. ret := &RemarketingList{
  38613. ServerResponse: googleapi.ServerResponse{
  38614. Header: res.Header,
  38615. HTTPStatusCode: res.StatusCode,
  38616. },
  38617. }
  38618. target := &ret
  38619. if err := gensupport.DecodeResponse(target, res); err != nil {
  38620. return nil, err
  38621. }
  38622. return ret, nil
  38623. // {
  38624. // "description": "Gets one remarketing list by ID.",
  38625. // "httpMethod": "GET",
  38626. // "id": "dfareporting.remarketingLists.get",
  38627. // "parameterOrder": [
  38628. // "profileId",
  38629. // "id"
  38630. // ],
  38631. // "parameters": {
  38632. // "id": {
  38633. // "description": "Remarketing list ID.",
  38634. // "format": "int64",
  38635. // "location": "path",
  38636. // "required": true,
  38637. // "type": "string"
  38638. // },
  38639. // "profileId": {
  38640. // "description": "User profile ID associated with this request.",
  38641. // "format": "int64",
  38642. // "location": "path",
  38643. // "required": true,
  38644. // "type": "string"
  38645. // }
  38646. // },
  38647. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  38648. // "response": {
  38649. // "$ref": "RemarketingList"
  38650. // },
  38651. // "scopes": [
  38652. // "https://www.googleapis.com/auth/dfatrafficking"
  38653. // ]
  38654. // }
  38655. }
  38656. // method id "dfareporting.remarketingLists.insert":
  38657. type RemarketingListsInsertCall struct {
  38658. s *Service
  38659. profileId int64
  38660. remarketinglist *RemarketingList
  38661. urlParams_ gensupport.URLParams
  38662. ctx_ context.Context
  38663. header_ http.Header
  38664. }
  38665. // Insert: Inserts a new remarketing list.
  38666. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  38667. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38668. c.profileId = profileId
  38669. c.remarketinglist = remarketinglist
  38670. return c
  38671. }
  38672. // Fields allows partial responses to be retrieved. See
  38673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38674. // for more information.
  38675. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  38676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38677. return c
  38678. }
  38679. // Context sets the context to be used in this call's Do method. Any
  38680. // pending HTTP request will be aborted if the provided context is
  38681. // canceled.
  38682. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  38683. c.ctx_ = ctx
  38684. return c
  38685. }
  38686. // Header returns an http.Header that can be modified by the caller to
  38687. // add HTTP headers to the request.
  38688. func (c *RemarketingListsInsertCall) Header() http.Header {
  38689. if c.header_ == nil {
  38690. c.header_ = make(http.Header)
  38691. }
  38692. return c.header_
  38693. }
  38694. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  38695. reqHeaders := make(http.Header)
  38696. for k, v := range c.header_ {
  38697. reqHeaders[k] = v
  38698. }
  38699. reqHeaders.Set("User-Agent", c.s.userAgent())
  38700. var body io.Reader = nil
  38701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38702. if err != nil {
  38703. return nil, err
  38704. }
  38705. reqHeaders.Set("Content-Type", "application/json")
  38706. c.urlParams_.Set("alt", alt)
  38707. c.urlParams_.Set("prettyPrint", "false")
  38708. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38709. urls += "?" + c.urlParams_.Encode()
  38710. req, err := http.NewRequest("POST", urls, body)
  38711. if err != nil {
  38712. return nil, err
  38713. }
  38714. req.Header = reqHeaders
  38715. googleapi.Expand(req.URL, map[string]string{
  38716. "profileId": strconv.FormatInt(c.profileId, 10),
  38717. })
  38718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38719. }
  38720. // Do executes the "dfareporting.remarketingLists.insert" call.
  38721. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38722. // status code is an error. Response headers are in either
  38723. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38724. // at all) in error.(*googleapi.Error).Header. Use
  38725. // googleapi.IsNotModified to check whether the returned error was
  38726. // because http.StatusNotModified was returned.
  38727. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38728. gensupport.SetOptions(c.urlParams_, opts...)
  38729. res, err := c.doRequest("json")
  38730. if res != nil && res.StatusCode == http.StatusNotModified {
  38731. if res.Body != nil {
  38732. res.Body.Close()
  38733. }
  38734. return nil, &googleapi.Error{
  38735. Code: res.StatusCode,
  38736. Header: res.Header,
  38737. }
  38738. }
  38739. if err != nil {
  38740. return nil, err
  38741. }
  38742. defer googleapi.CloseBody(res)
  38743. if err := googleapi.CheckResponse(res); err != nil {
  38744. return nil, err
  38745. }
  38746. ret := &RemarketingList{
  38747. ServerResponse: googleapi.ServerResponse{
  38748. Header: res.Header,
  38749. HTTPStatusCode: res.StatusCode,
  38750. },
  38751. }
  38752. target := &ret
  38753. if err := gensupport.DecodeResponse(target, res); err != nil {
  38754. return nil, err
  38755. }
  38756. return ret, nil
  38757. // {
  38758. // "description": "Inserts a new remarketing list.",
  38759. // "httpMethod": "POST",
  38760. // "id": "dfareporting.remarketingLists.insert",
  38761. // "parameterOrder": [
  38762. // "profileId"
  38763. // ],
  38764. // "parameters": {
  38765. // "profileId": {
  38766. // "description": "User profile ID associated with this request.",
  38767. // "format": "int64",
  38768. // "location": "path",
  38769. // "required": true,
  38770. // "type": "string"
  38771. // }
  38772. // },
  38773. // "path": "userprofiles/{profileId}/remarketingLists",
  38774. // "request": {
  38775. // "$ref": "RemarketingList"
  38776. // },
  38777. // "response": {
  38778. // "$ref": "RemarketingList"
  38779. // },
  38780. // "scopes": [
  38781. // "https://www.googleapis.com/auth/dfatrafficking"
  38782. // ]
  38783. // }
  38784. }
  38785. // method id "dfareporting.remarketingLists.list":
  38786. type RemarketingListsListCall struct {
  38787. s *Service
  38788. profileId int64
  38789. urlParams_ gensupport.URLParams
  38790. ifNoneMatch_ string
  38791. ctx_ context.Context
  38792. header_ http.Header
  38793. }
  38794. // List: Retrieves a list of remarketing lists, possibly filtered. This
  38795. // method supports paging.
  38796. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  38797. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38798. c.profileId = profileId
  38799. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  38800. return c
  38801. }
  38802. // Active sets the optional parameter "active": Select only active or
  38803. // only inactive remarketing lists.
  38804. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  38805. c.urlParams_.Set("active", fmt.Sprint(active))
  38806. return c
  38807. }
  38808. // FloodlightActivityId sets the optional parameter
  38809. // "floodlightActivityId": Select only remarketing lists that have this
  38810. // floodlight activity ID.
  38811. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  38812. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  38813. return c
  38814. }
  38815. // MaxResults sets the optional parameter "maxResults": Maximum number
  38816. // of results to return.
  38817. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  38818. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38819. return c
  38820. }
  38821. // Name sets the optional parameter "name": Allows searching for objects
  38822. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  38823. // list*2015" will return objects with names like "remarketing list June
  38824. // 2015", "remarketing list April 2015", or simply "remarketing list
  38825. // 2015". Most of the searches also add wildcards implicitly at the
  38826. // start and the end of the search string. For example, a search string
  38827. // of "remarketing list" will match objects with name "my remarketing
  38828. // list", "remarketing list 2015", or simply "remarketing list".
  38829. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  38830. c.urlParams_.Set("name", name)
  38831. return c
  38832. }
  38833. // PageToken sets the optional parameter "pageToken": Value of the
  38834. // nextPageToken from the previous result page.
  38835. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  38836. c.urlParams_.Set("pageToken", pageToken)
  38837. return c
  38838. }
  38839. // SortField sets the optional parameter "sortField": Field by which to
  38840. // sort the list.
  38841. //
  38842. // Possible values:
  38843. // "ID" (default)
  38844. // "NAME"
  38845. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  38846. c.urlParams_.Set("sortField", sortField)
  38847. return c
  38848. }
  38849. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38850. // results.
  38851. //
  38852. // Possible values:
  38853. // "ASCENDING" (default)
  38854. // "DESCENDING"
  38855. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  38856. c.urlParams_.Set("sortOrder", sortOrder)
  38857. return c
  38858. }
  38859. // Fields allows partial responses to be retrieved. See
  38860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38861. // for more information.
  38862. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  38863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38864. return c
  38865. }
  38866. // IfNoneMatch sets the optional parameter which makes the operation
  38867. // fail if the object's ETag matches the given value. This is useful for
  38868. // getting updates only after the object has changed since the last
  38869. // request. Use googleapi.IsNotModified to check whether the response
  38870. // error from Do is the result of In-None-Match.
  38871. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  38872. c.ifNoneMatch_ = entityTag
  38873. return c
  38874. }
  38875. // Context sets the context to be used in this call's Do method. Any
  38876. // pending HTTP request will be aborted if the provided context is
  38877. // canceled.
  38878. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  38879. c.ctx_ = ctx
  38880. return c
  38881. }
  38882. // Header returns an http.Header that can be modified by the caller to
  38883. // add HTTP headers to the request.
  38884. func (c *RemarketingListsListCall) Header() http.Header {
  38885. if c.header_ == nil {
  38886. c.header_ = make(http.Header)
  38887. }
  38888. return c.header_
  38889. }
  38890. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  38891. reqHeaders := make(http.Header)
  38892. for k, v := range c.header_ {
  38893. reqHeaders[k] = v
  38894. }
  38895. reqHeaders.Set("User-Agent", c.s.userAgent())
  38896. if c.ifNoneMatch_ != "" {
  38897. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38898. }
  38899. var body io.Reader = nil
  38900. c.urlParams_.Set("alt", alt)
  38901. c.urlParams_.Set("prettyPrint", "false")
  38902. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38903. urls += "?" + c.urlParams_.Encode()
  38904. req, err := http.NewRequest("GET", urls, body)
  38905. if err != nil {
  38906. return nil, err
  38907. }
  38908. req.Header = reqHeaders
  38909. googleapi.Expand(req.URL, map[string]string{
  38910. "profileId": strconv.FormatInt(c.profileId, 10),
  38911. })
  38912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38913. }
  38914. // Do executes the "dfareporting.remarketingLists.list" call.
  38915. // Exactly one of *RemarketingListsListResponse or error will be
  38916. // non-nil. Any non-2xx status code is an error. Response headers are in
  38917. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  38918. // response was returned at all) in error.(*googleapi.Error).Header. Use
  38919. // googleapi.IsNotModified to check whether the returned error was
  38920. // because http.StatusNotModified was returned.
  38921. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  38922. gensupport.SetOptions(c.urlParams_, opts...)
  38923. res, err := c.doRequest("json")
  38924. if res != nil && res.StatusCode == http.StatusNotModified {
  38925. if res.Body != nil {
  38926. res.Body.Close()
  38927. }
  38928. return nil, &googleapi.Error{
  38929. Code: res.StatusCode,
  38930. Header: res.Header,
  38931. }
  38932. }
  38933. if err != nil {
  38934. return nil, err
  38935. }
  38936. defer googleapi.CloseBody(res)
  38937. if err := googleapi.CheckResponse(res); err != nil {
  38938. return nil, err
  38939. }
  38940. ret := &RemarketingListsListResponse{
  38941. ServerResponse: googleapi.ServerResponse{
  38942. Header: res.Header,
  38943. HTTPStatusCode: res.StatusCode,
  38944. },
  38945. }
  38946. target := &ret
  38947. if err := gensupport.DecodeResponse(target, res); err != nil {
  38948. return nil, err
  38949. }
  38950. return ret, nil
  38951. // {
  38952. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  38953. // "httpMethod": "GET",
  38954. // "id": "dfareporting.remarketingLists.list",
  38955. // "parameterOrder": [
  38956. // "profileId",
  38957. // "advertiserId"
  38958. // ],
  38959. // "parameters": {
  38960. // "active": {
  38961. // "description": "Select only active or only inactive remarketing lists.",
  38962. // "location": "query",
  38963. // "type": "boolean"
  38964. // },
  38965. // "advertiserId": {
  38966. // "description": "Select only remarketing lists owned by this advertiser.",
  38967. // "format": "int64",
  38968. // "location": "query",
  38969. // "required": true,
  38970. // "type": "string"
  38971. // },
  38972. // "floodlightActivityId": {
  38973. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  38974. // "format": "int64",
  38975. // "location": "query",
  38976. // "type": "string"
  38977. // },
  38978. // "maxResults": {
  38979. // "default": "1000",
  38980. // "description": "Maximum number of results to return.",
  38981. // "format": "int32",
  38982. // "location": "query",
  38983. // "maximum": "1000",
  38984. // "minimum": "0",
  38985. // "type": "integer"
  38986. // },
  38987. // "name": {
  38988. // "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\".",
  38989. // "location": "query",
  38990. // "type": "string"
  38991. // },
  38992. // "pageToken": {
  38993. // "description": "Value of the nextPageToken from the previous result page.",
  38994. // "location": "query",
  38995. // "type": "string"
  38996. // },
  38997. // "profileId": {
  38998. // "description": "User profile ID associated with this request.",
  38999. // "format": "int64",
  39000. // "location": "path",
  39001. // "required": true,
  39002. // "type": "string"
  39003. // },
  39004. // "sortField": {
  39005. // "default": "ID",
  39006. // "description": "Field by which to sort the list.",
  39007. // "enum": [
  39008. // "ID",
  39009. // "NAME"
  39010. // ],
  39011. // "enumDescriptions": [
  39012. // "",
  39013. // ""
  39014. // ],
  39015. // "location": "query",
  39016. // "type": "string"
  39017. // },
  39018. // "sortOrder": {
  39019. // "default": "ASCENDING",
  39020. // "description": "Order of sorted results.",
  39021. // "enum": [
  39022. // "ASCENDING",
  39023. // "DESCENDING"
  39024. // ],
  39025. // "enumDescriptions": [
  39026. // "",
  39027. // ""
  39028. // ],
  39029. // "location": "query",
  39030. // "type": "string"
  39031. // }
  39032. // },
  39033. // "path": "userprofiles/{profileId}/remarketingLists",
  39034. // "response": {
  39035. // "$ref": "RemarketingListsListResponse"
  39036. // },
  39037. // "scopes": [
  39038. // "https://www.googleapis.com/auth/dfatrafficking"
  39039. // ]
  39040. // }
  39041. }
  39042. // Pages invokes f for each page of results.
  39043. // A non-nil error returned from f will halt the iteration.
  39044. // The provided context supersedes any context provided to the Context method.
  39045. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  39046. c.ctx_ = ctx
  39047. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39048. for {
  39049. x, err := c.Do()
  39050. if err != nil {
  39051. return err
  39052. }
  39053. if err := f(x); err != nil {
  39054. return err
  39055. }
  39056. if x.NextPageToken == "" {
  39057. return nil
  39058. }
  39059. c.PageToken(x.NextPageToken)
  39060. }
  39061. }
  39062. // method id "dfareporting.remarketingLists.patch":
  39063. type RemarketingListsPatchCall struct {
  39064. s *Service
  39065. profileId int64
  39066. remarketinglist *RemarketingList
  39067. urlParams_ gensupport.URLParams
  39068. ctx_ context.Context
  39069. header_ http.Header
  39070. }
  39071. // Patch: Updates an existing remarketing list. This method supports
  39072. // patch semantics.
  39073. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  39074. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39075. c.profileId = profileId
  39076. c.urlParams_.Set("id", fmt.Sprint(id))
  39077. c.remarketinglist = remarketinglist
  39078. return c
  39079. }
  39080. // Fields allows partial responses to be retrieved. See
  39081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39082. // for more information.
  39083. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  39084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39085. return c
  39086. }
  39087. // Context sets the context to be used in this call's Do method. Any
  39088. // pending HTTP request will be aborted if the provided context is
  39089. // canceled.
  39090. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  39091. c.ctx_ = ctx
  39092. return c
  39093. }
  39094. // Header returns an http.Header that can be modified by the caller to
  39095. // add HTTP headers to the request.
  39096. func (c *RemarketingListsPatchCall) Header() http.Header {
  39097. if c.header_ == nil {
  39098. c.header_ = make(http.Header)
  39099. }
  39100. return c.header_
  39101. }
  39102. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  39103. reqHeaders := make(http.Header)
  39104. for k, v := range c.header_ {
  39105. reqHeaders[k] = v
  39106. }
  39107. reqHeaders.Set("User-Agent", c.s.userAgent())
  39108. var body io.Reader = nil
  39109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39110. if err != nil {
  39111. return nil, err
  39112. }
  39113. reqHeaders.Set("Content-Type", "application/json")
  39114. c.urlParams_.Set("alt", alt)
  39115. c.urlParams_.Set("prettyPrint", "false")
  39116. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39117. urls += "?" + c.urlParams_.Encode()
  39118. req, err := http.NewRequest("PATCH", urls, body)
  39119. if err != nil {
  39120. return nil, err
  39121. }
  39122. req.Header = reqHeaders
  39123. googleapi.Expand(req.URL, map[string]string{
  39124. "profileId": strconv.FormatInt(c.profileId, 10),
  39125. })
  39126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39127. }
  39128. // Do executes the "dfareporting.remarketingLists.patch" call.
  39129. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39130. // status code is an error. Response headers are in either
  39131. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39132. // at all) in error.(*googleapi.Error).Header. Use
  39133. // googleapi.IsNotModified to check whether the returned error was
  39134. // because http.StatusNotModified was returned.
  39135. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39136. gensupport.SetOptions(c.urlParams_, opts...)
  39137. res, err := c.doRequest("json")
  39138. if res != nil && res.StatusCode == http.StatusNotModified {
  39139. if res.Body != nil {
  39140. res.Body.Close()
  39141. }
  39142. return nil, &googleapi.Error{
  39143. Code: res.StatusCode,
  39144. Header: res.Header,
  39145. }
  39146. }
  39147. if err != nil {
  39148. return nil, err
  39149. }
  39150. defer googleapi.CloseBody(res)
  39151. if err := googleapi.CheckResponse(res); err != nil {
  39152. return nil, err
  39153. }
  39154. ret := &RemarketingList{
  39155. ServerResponse: googleapi.ServerResponse{
  39156. Header: res.Header,
  39157. HTTPStatusCode: res.StatusCode,
  39158. },
  39159. }
  39160. target := &ret
  39161. if err := gensupport.DecodeResponse(target, res); err != nil {
  39162. return nil, err
  39163. }
  39164. return ret, nil
  39165. // {
  39166. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  39167. // "httpMethod": "PATCH",
  39168. // "id": "dfareporting.remarketingLists.patch",
  39169. // "parameterOrder": [
  39170. // "profileId",
  39171. // "id"
  39172. // ],
  39173. // "parameters": {
  39174. // "id": {
  39175. // "description": "Remarketing list ID.",
  39176. // "format": "int64",
  39177. // "location": "query",
  39178. // "required": true,
  39179. // "type": "string"
  39180. // },
  39181. // "profileId": {
  39182. // "description": "User profile ID associated with this request.",
  39183. // "format": "int64",
  39184. // "location": "path",
  39185. // "required": true,
  39186. // "type": "string"
  39187. // }
  39188. // },
  39189. // "path": "userprofiles/{profileId}/remarketingLists",
  39190. // "request": {
  39191. // "$ref": "RemarketingList"
  39192. // },
  39193. // "response": {
  39194. // "$ref": "RemarketingList"
  39195. // },
  39196. // "scopes": [
  39197. // "https://www.googleapis.com/auth/dfatrafficking"
  39198. // ]
  39199. // }
  39200. }
  39201. // method id "dfareporting.remarketingLists.update":
  39202. type RemarketingListsUpdateCall struct {
  39203. s *Service
  39204. profileId int64
  39205. remarketinglist *RemarketingList
  39206. urlParams_ gensupport.URLParams
  39207. ctx_ context.Context
  39208. header_ http.Header
  39209. }
  39210. // Update: Updates an existing remarketing list.
  39211. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  39212. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39213. c.profileId = profileId
  39214. c.remarketinglist = remarketinglist
  39215. return c
  39216. }
  39217. // Fields allows partial responses to be retrieved. See
  39218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39219. // for more information.
  39220. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  39221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39222. return c
  39223. }
  39224. // Context sets the context to be used in this call's Do method. Any
  39225. // pending HTTP request will be aborted if the provided context is
  39226. // canceled.
  39227. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  39228. c.ctx_ = ctx
  39229. return c
  39230. }
  39231. // Header returns an http.Header that can be modified by the caller to
  39232. // add HTTP headers to the request.
  39233. func (c *RemarketingListsUpdateCall) Header() http.Header {
  39234. if c.header_ == nil {
  39235. c.header_ = make(http.Header)
  39236. }
  39237. return c.header_
  39238. }
  39239. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39240. reqHeaders := make(http.Header)
  39241. for k, v := range c.header_ {
  39242. reqHeaders[k] = v
  39243. }
  39244. reqHeaders.Set("User-Agent", c.s.userAgent())
  39245. var body io.Reader = nil
  39246. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39247. if err != nil {
  39248. return nil, err
  39249. }
  39250. reqHeaders.Set("Content-Type", "application/json")
  39251. c.urlParams_.Set("alt", alt)
  39252. c.urlParams_.Set("prettyPrint", "false")
  39253. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39254. urls += "?" + c.urlParams_.Encode()
  39255. req, err := http.NewRequest("PUT", urls, body)
  39256. if err != nil {
  39257. return nil, err
  39258. }
  39259. req.Header = reqHeaders
  39260. googleapi.Expand(req.URL, map[string]string{
  39261. "profileId": strconv.FormatInt(c.profileId, 10),
  39262. })
  39263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39264. }
  39265. // Do executes the "dfareporting.remarketingLists.update" call.
  39266. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39267. // status code is an error. Response headers are in either
  39268. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39269. // at all) in error.(*googleapi.Error).Header. Use
  39270. // googleapi.IsNotModified to check whether the returned error was
  39271. // because http.StatusNotModified was returned.
  39272. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39273. gensupport.SetOptions(c.urlParams_, opts...)
  39274. res, err := c.doRequest("json")
  39275. if res != nil && res.StatusCode == http.StatusNotModified {
  39276. if res.Body != nil {
  39277. res.Body.Close()
  39278. }
  39279. return nil, &googleapi.Error{
  39280. Code: res.StatusCode,
  39281. Header: res.Header,
  39282. }
  39283. }
  39284. if err != nil {
  39285. return nil, err
  39286. }
  39287. defer googleapi.CloseBody(res)
  39288. if err := googleapi.CheckResponse(res); err != nil {
  39289. return nil, err
  39290. }
  39291. ret := &RemarketingList{
  39292. ServerResponse: googleapi.ServerResponse{
  39293. Header: res.Header,
  39294. HTTPStatusCode: res.StatusCode,
  39295. },
  39296. }
  39297. target := &ret
  39298. if err := gensupport.DecodeResponse(target, res); err != nil {
  39299. return nil, err
  39300. }
  39301. return ret, nil
  39302. // {
  39303. // "description": "Updates an existing remarketing list.",
  39304. // "httpMethod": "PUT",
  39305. // "id": "dfareporting.remarketingLists.update",
  39306. // "parameterOrder": [
  39307. // "profileId"
  39308. // ],
  39309. // "parameters": {
  39310. // "profileId": {
  39311. // "description": "User profile ID associated with this request.",
  39312. // "format": "int64",
  39313. // "location": "path",
  39314. // "required": true,
  39315. // "type": "string"
  39316. // }
  39317. // },
  39318. // "path": "userprofiles/{profileId}/remarketingLists",
  39319. // "request": {
  39320. // "$ref": "RemarketingList"
  39321. // },
  39322. // "response": {
  39323. // "$ref": "RemarketingList"
  39324. // },
  39325. // "scopes": [
  39326. // "https://www.googleapis.com/auth/dfatrafficking"
  39327. // ]
  39328. // }
  39329. }
  39330. // method id "dfareporting.reports.delete":
  39331. type ReportsDeleteCall struct {
  39332. s *Service
  39333. profileId int64
  39334. reportId int64
  39335. urlParams_ gensupport.URLParams
  39336. ctx_ context.Context
  39337. header_ http.Header
  39338. }
  39339. // Delete: Deletes a report by its ID.
  39340. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  39341. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39342. c.profileId = profileId
  39343. c.reportId = reportId
  39344. return c
  39345. }
  39346. // Fields allows partial responses to be retrieved. See
  39347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39348. // for more information.
  39349. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  39350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39351. return c
  39352. }
  39353. // Context sets the context to be used in this call's Do method. Any
  39354. // pending HTTP request will be aborted if the provided context is
  39355. // canceled.
  39356. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  39357. c.ctx_ = ctx
  39358. return c
  39359. }
  39360. // Header returns an http.Header that can be modified by the caller to
  39361. // add HTTP headers to the request.
  39362. func (c *ReportsDeleteCall) Header() http.Header {
  39363. if c.header_ == nil {
  39364. c.header_ = make(http.Header)
  39365. }
  39366. return c.header_
  39367. }
  39368. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39369. reqHeaders := make(http.Header)
  39370. for k, v := range c.header_ {
  39371. reqHeaders[k] = v
  39372. }
  39373. reqHeaders.Set("User-Agent", c.s.userAgent())
  39374. var body io.Reader = nil
  39375. c.urlParams_.Set("alt", alt)
  39376. c.urlParams_.Set("prettyPrint", "false")
  39377. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39378. urls += "?" + c.urlParams_.Encode()
  39379. req, err := http.NewRequest("DELETE", urls, body)
  39380. if err != nil {
  39381. return nil, err
  39382. }
  39383. req.Header = reqHeaders
  39384. googleapi.Expand(req.URL, map[string]string{
  39385. "profileId": strconv.FormatInt(c.profileId, 10),
  39386. "reportId": strconv.FormatInt(c.reportId, 10),
  39387. })
  39388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39389. }
  39390. // Do executes the "dfareporting.reports.delete" call.
  39391. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  39392. gensupport.SetOptions(c.urlParams_, opts...)
  39393. res, err := c.doRequest("json")
  39394. if err != nil {
  39395. return err
  39396. }
  39397. defer googleapi.CloseBody(res)
  39398. if err := googleapi.CheckResponse(res); err != nil {
  39399. return err
  39400. }
  39401. return nil
  39402. // {
  39403. // "description": "Deletes a report by its ID.",
  39404. // "httpMethod": "DELETE",
  39405. // "id": "dfareporting.reports.delete",
  39406. // "parameterOrder": [
  39407. // "profileId",
  39408. // "reportId"
  39409. // ],
  39410. // "parameters": {
  39411. // "profileId": {
  39412. // "description": "The DFA user profile ID.",
  39413. // "format": "int64",
  39414. // "location": "path",
  39415. // "required": true,
  39416. // "type": "string"
  39417. // },
  39418. // "reportId": {
  39419. // "description": "The ID of the report.",
  39420. // "format": "int64",
  39421. // "location": "path",
  39422. // "required": true,
  39423. // "type": "string"
  39424. // }
  39425. // },
  39426. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39427. // "scopes": [
  39428. // "https://www.googleapis.com/auth/dfareporting"
  39429. // ]
  39430. // }
  39431. }
  39432. // method id "dfareporting.reports.get":
  39433. type ReportsGetCall struct {
  39434. s *Service
  39435. profileId int64
  39436. reportId int64
  39437. urlParams_ gensupport.URLParams
  39438. ifNoneMatch_ string
  39439. ctx_ context.Context
  39440. header_ http.Header
  39441. }
  39442. // Get: Retrieves a report by its ID.
  39443. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  39444. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39445. c.profileId = profileId
  39446. c.reportId = reportId
  39447. return c
  39448. }
  39449. // Fields allows partial responses to be retrieved. See
  39450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39451. // for more information.
  39452. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  39453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39454. return c
  39455. }
  39456. // IfNoneMatch sets the optional parameter which makes the operation
  39457. // fail if the object's ETag matches the given value. This is useful for
  39458. // getting updates only after the object has changed since the last
  39459. // request. Use googleapi.IsNotModified to check whether the response
  39460. // error from Do is the result of In-None-Match.
  39461. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  39462. c.ifNoneMatch_ = entityTag
  39463. return c
  39464. }
  39465. // Context sets the context to be used in this call's Do method. Any
  39466. // pending HTTP request will be aborted if the provided context is
  39467. // canceled.
  39468. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  39469. c.ctx_ = ctx
  39470. return c
  39471. }
  39472. // Header returns an http.Header that can be modified by the caller to
  39473. // add HTTP headers to the request.
  39474. func (c *ReportsGetCall) Header() http.Header {
  39475. if c.header_ == nil {
  39476. c.header_ = make(http.Header)
  39477. }
  39478. return c.header_
  39479. }
  39480. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  39481. reqHeaders := make(http.Header)
  39482. for k, v := range c.header_ {
  39483. reqHeaders[k] = v
  39484. }
  39485. reqHeaders.Set("User-Agent", c.s.userAgent())
  39486. if c.ifNoneMatch_ != "" {
  39487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39488. }
  39489. var body io.Reader = nil
  39490. c.urlParams_.Set("alt", alt)
  39491. c.urlParams_.Set("prettyPrint", "false")
  39492. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39493. urls += "?" + c.urlParams_.Encode()
  39494. req, err := http.NewRequest("GET", urls, body)
  39495. if err != nil {
  39496. return nil, err
  39497. }
  39498. req.Header = reqHeaders
  39499. googleapi.Expand(req.URL, map[string]string{
  39500. "profileId": strconv.FormatInt(c.profileId, 10),
  39501. "reportId": strconv.FormatInt(c.reportId, 10),
  39502. })
  39503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39504. }
  39505. // Do executes the "dfareporting.reports.get" call.
  39506. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39507. // code is an error. Response headers are in either
  39508. // *Report.ServerResponse.Header or (if a response was returned at all)
  39509. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39510. // check whether the returned error was because http.StatusNotModified
  39511. // was returned.
  39512. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39513. gensupport.SetOptions(c.urlParams_, opts...)
  39514. res, err := c.doRequest("json")
  39515. if res != nil && res.StatusCode == http.StatusNotModified {
  39516. if res.Body != nil {
  39517. res.Body.Close()
  39518. }
  39519. return nil, &googleapi.Error{
  39520. Code: res.StatusCode,
  39521. Header: res.Header,
  39522. }
  39523. }
  39524. if err != nil {
  39525. return nil, err
  39526. }
  39527. defer googleapi.CloseBody(res)
  39528. if err := googleapi.CheckResponse(res); err != nil {
  39529. return nil, err
  39530. }
  39531. ret := &Report{
  39532. ServerResponse: googleapi.ServerResponse{
  39533. Header: res.Header,
  39534. HTTPStatusCode: res.StatusCode,
  39535. },
  39536. }
  39537. target := &ret
  39538. if err := gensupport.DecodeResponse(target, res); err != nil {
  39539. return nil, err
  39540. }
  39541. return ret, nil
  39542. // {
  39543. // "description": "Retrieves a report by its ID.",
  39544. // "httpMethod": "GET",
  39545. // "id": "dfareporting.reports.get",
  39546. // "parameterOrder": [
  39547. // "profileId",
  39548. // "reportId"
  39549. // ],
  39550. // "parameters": {
  39551. // "profileId": {
  39552. // "description": "The DFA user profile ID.",
  39553. // "format": "int64",
  39554. // "location": "path",
  39555. // "required": true,
  39556. // "type": "string"
  39557. // },
  39558. // "reportId": {
  39559. // "description": "The ID of the report.",
  39560. // "format": "int64",
  39561. // "location": "path",
  39562. // "required": true,
  39563. // "type": "string"
  39564. // }
  39565. // },
  39566. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39567. // "response": {
  39568. // "$ref": "Report"
  39569. // },
  39570. // "scopes": [
  39571. // "https://www.googleapis.com/auth/dfareporting"
  39572. // ]
  39573. // }
  39574. }
  39575. // method id "dfareporting.reports.insert":
  39576. type ReportsInsertCall struct {
  39577. s *Service
  39578. profileId int64
  39579. report *Report
  39580. urlParams_ gensupport.URLParams
  39581. ctx_ context.Context
  39582. header_ http.Header
  39583. }
  39584. // Insert: Creates a report.
  39585. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  39586. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39587. c.profileId = profileId
  39588. c.report = report
  39589. return c
  39590. }
  39591. // Fields allows partial responses to be retrieved. See
  39592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39593. // for more information.
  39594. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  39595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39596. return c
  39597. }
  39598. // Context sets the context to be used in this call's Do method. Any
  39599. // pending HTTP request will be aborted if the provided context is
  39600. // canceled.
  39601. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  39602. c.ctx_ = ctx
  39603. return c
  39604. }
  39605. // Header returns an http.Header that can be modified by the caller to
  39606. // add HTTP headers to the request.
  39607. func (c *ReportsInsertCall) Header() http.Header {
  39608. if c.header_ == nil {
  39609. c.header_ = make(http.Header)
  39610. }
  39611. return c.header_
  39612. }
  39613. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  39614. reqHeaders := make(http.Header)
  39615. for k, v := range c.header_ {
  39616. reqHeaders[k] = v
  39617. }
  39618. reqHeaders.Set("User-Agent", c.s.userAgent())
  39619. var body io.Reader = nil
  39620. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39621. if err != nil {
  39622. return nil, err
  39623. }
  39624. reqHeaders.Set("Content-Type", "application/json")
  39625. c.urlParams_.Set("alt", alt)
  39626. c.urlParams_.Set("prettyPrint", "false")
  39627. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39628. urls += "?" + c.urlParams_.Encode()
  39629. req, err := http.NewRequest("POST", urls, body)
  39630. if err != nil {
  39631. return nil, err
  39632. }
  39633. req.Header = reqHeaders
  39634. googleapi.Expand(req.URL, map[string]string{
  39635. "profileId": strconv.FormatInt(c.profileId, 10),
  39636. })
  39637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39638. }
  39639. // Do executes the "dfareporting.reports.insert" call.
  39640. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39641. // code is an error. Response headers are in either
  39642. // *Report.ServerResponse.Header or (if a response was returned at all)
  39643. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39644. // check whether the returned error was because http.StatusNotModified
  39645. // was returned.
  39646. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39647. gensupport.SetOptions(c.urlParams_, opts...)
  39648. res, err := c.doRequest("json")
  39649. if res != nil && res.StatusCode == http.StatusNotModified {
  39650. if res.Body != nil {
  39651. res.Body.Close()
  39652. }
  39653. return nil, &googleapi.Error{
  39654. Code: res.StatusCode,
  39655. Header: res.Header,
  39656. }
  39657. }
  39658. if err != nil {
  39659. return nil, err
  39660. }
  39661. defer googleapi.CloseBody(res)
  39662. if err := googleapi.CheckResponse(res); err != nil {
  39663. return nil, err
  39664. }
  39665. ret := &Report{
  39666. ServerResponse: googleapi.ServerResponse{
  39667. Header: res.Header,
  39668. HTTPStatusCode: res.StatusCode,
  39669. },
  39670. }
  39671. target := &ret
  39672. if err := gensupport.DecodeResponse(target, res); err != nil {
  39673. return nil, err
  39674. }
  39675. return ret, nil
  39676. // {
  39677. // "description": "Creates a report.",
  39678. // "httpMethod": "POST",
  39679. // "id": "dfareporting.reports.insert",
  39680. // "parameterOrder": [
  39681. // "profileId"
  39682. // ],
  39683. // "parameters": {
  39684. // "profileId": {
  39685. // "description": "The DFA user profile ID.",
  39686. // "format": "int64",
  39687. // "location": "path",
  39688. // "required": true,
  39689. // "type": "string"
  39690. // }
  39691. // },
  39692. // "path": "userprofiles/{profileId}/reports",
  39693. // "request": {
  39694. // "$ref": "Report"
  39695. // },
  39696. // "response": {
  39697. // "$ref": "Report"
  39698. // },
  39699. // "scopes": [
  39700. // "https://www.googleapis.com/auth/dfareporting"
  39701. // ]
  39702. // }
  39703. }
  39704. // method id "dfareporting.reports.list":
  39705. type ReportsListCall struct {
  39706. s *Service
  39707. profileId int64
  39708. urlParams_ gensupport.URLParams
  39709. ifNoneMatch_ string
  39710. ctx_ context.Context
  39711. header_ http.Header
  39712. }
  39713. // List: Retrieves list of reports.
  39714. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  39715. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39716. c.profileId = profileId
  39717. return c
  39718. }
  39719. // MaxResults sets the optional parameter "maxResults": Maximum number
  39720. // of results to return.
  39721. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  39722. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39723. return c
  39724. }
  39725. // PageToken sets the optional parameter "pageToken": The value of the
  39726. // nextToken from the previous result page.
  39727. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  39728. c.urlParams_.Set("pageToken", pageToken)
  39729. return c
  39730. }
  39731. // Scope sets the optional parameter "scope": The scope that defines
  39732. // which results are returned.
  39733. //
  39734. // Possible values:
  39735. // "ALL" - All reports in account.
  39736. // "MINE" (default) - My reports.
  39737. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  39738. c.urlParams_.Set("scope", scope)
  39739. return c
  39740. }
  39741. // SortField sets the optional parameter "sortField": The field by which
  39742. // to sort the list.
  39743. //
  39744. // Possible values:
  39745. // "ID" - Sort by report ID.
  39746. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  39747. // "NAME" - Sort by name of reports.
  39748. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  39749. c.urlParams_.Set("sortField", sortField)
  39750. return c
  39751. }
  39752. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39753. // results.
  39754. //
  39755. // Possible values:
  39756. // "ASCENDING" - Ascending order.
  39757. // "DESCENDING" (default) - Descending order.
  39758. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  39759. c.urlParams_.Set("sortOrder", sortOrder)
  39760. return c
  39761. }
  39762. // Fields allows partial responses to be retrieved. See
  39763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39764. // for more information.
  39765. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  39766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39767. return c
  39768. }
  39769. // IfNoneMatch sets the optional parameter which makes the operation
  39770. // fail if the object's ETag matches the given value. This is useful for
  39771. // getting updates only after the object has changed since the last
  39772. // request. Use googleapi.IsNotModified to check whether the response
  39773. // error from Do is the result of In-None-Match.
  39774. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  39775. c.ifNoneMatch_ = entityTag
  39776. return c
  39777. }
  39778. // Context sets the context to be used in this call's Do method. Any
  39779. // pending HTTP request will be aborted if the provided context is
  39780. // canceled.
  39781. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  39782. c.ctx_ = ctx
  39783. return c
  39784. }
  39785. // Header returns an http.Header that can be modified by the caller to
  39786. // add HTTP headers to the request.
  39787. func (c *ReportsListCall) Header() http.Header {
  39788. if c.header_ == nil {
  39789. c.header_ = make(http.Header)
  39790. }
  39791. return c.header_
  39792. }
  39793. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  39794. reqHeaders := make(http.Header)
  39795. for k, v := range c.header_ {
  39796. reqHeaders[k] = v
  39797. }
  39798. reqHeaders.Set("User-Agent", c.s.userAgent())
  39799. if c.ifNoneMatch_ != "" {
  39800. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39801. }
  39802. var body io.Reader = nil
  39803. c.urlParams_.Set("alt", alt)
  39804. c.urlParams_.Set("prettyPrint", "false")
  39805. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39806. urls += "?" + c.urlParams_.Encode()
  39807. req, err := http.NewRequest("GET", urls, body)
  39808. if err != nil {
  39809. return nil, err
  39810. }
  39811. req.Header = reqHeaders
  39812. googleapi.Expand(req.URL, map[string]string{
  39813. "profileId": strconv.FormatInt(c.profileId, 10),
  39814. })
  39815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39816. }
  39817. // Do executes the "dfareporting.reports.list" call.
  39818. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  39819. // status code is an error. Response headers are in either
  39820. // *ReportList.ServerResponse.Header or (if a response was returned at
  39821. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39822. // to check whether the returned error was because
  39823. // http.StatusNotModified was returned.
  39824. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  39825. gensupport.SetOptions(c.urlParams_, opts...)
  39826. res, err := c.doRequest("json")
  39827. if res != nil && res.StatusCode == http.StatusNotModified {
  39828. if res.Body != nil {
  39829. res.Body.Close()
  39830. }
  39831. return nil, &googleapi.Error{
  39832. Code: res.StatusCode,
  39833. Header: res.Header,
  39834. }
  39835. }
  39836. if err != nil {
  39837. return nil, err
  39838. }
  39839. defer googleapi.CloseBody(res)
  39840. if err := googleapi.CheckResponse(res); err != nil {
  39841. return nil, err
  39842. }
  39843. ret := &ReportList{
  39844. ServerResponse: googleapi.ServerResponse{
  39845. Header: res.Header,
  39846. HTTPStatusCode: res.StatusCode,
  39847. },
  39848. }
  39849. target := &ret
  39850. if err := gensupport.DecodeResponse(target, res); err != nil {
  39851. return nil, err
  39852. }
  39853. return ret, nil
  39854. // {
  39855. // "description": "Retrieves list of reports.",
  39856. // "httpMethod": "GET",
  39857. // "id": "dfareporting.reports.list",
  39858. // "parameterOrder": [
  39859. // "profileId"
  39860. // ],
  39861. // "parameters": {
  39862. // "maxResults": {
  39863. // "default": "10",
  39864. // "description": "Maximum number of results to return.",
  39865. // "format": "int32",
  39866. // "location": "query",
  39867. // "maximum": "10",
  39868. // "minimum": "0",
  39869. // "type": "integer"
  39870. // },
  39871. // "pageToken": {
  39872. // "description": "The value of the nextToken from the previous result page.",
  39873. // "location": "query",
  39874. // "type": "string"
  39875. // },
  39876. // "profileId": {
  39877. // "description": "The DFA user profile ID.",
  39878. // "format": "int64",
  39879. // "location": "path",
  39880. // "required": true,
  39881. // "type": "string"
  39882. // },
  39883. // "scope": {
  39884. // "default": "MINE",
  39885. // "description": "The scope that defines which results are returned.",
  39886. // "enum": [
  39887. // "ALL",
  39888. // "MINE"
  39889. // ],
  39890. // "enumDescriptions": [
  39891. // "All reports in account.",
  39892. // "My reports."
  39893. // ],
  39894. // "location": "query",
  39895. // "type": "string"
  39896. // },
  39897. // "sortField": {
  39898. // "default": "LAST_MODIFIED_TIME",
  39899. // "description": "The field by which to sort the list.",
  39900. // "enum": [
  39901. // "ID",
  39902. // "LAST_MODIFIED_TIME",
  39903. // "NAME"
  39904. // ],
  39905. // "enumDescriptions": [
  39906. // "Sort by report ID.",
  39907. // "Sort by 'lastModifiedTime' field.",
  39908. // "Sort by name of reports."
  39909. // ],
  39910. // "location": "query",
  39911. // "type": "string"
  39912. // },
  39913. // "sortOrder": {
  39914. // "default": "DESCENDING",
  39915. // "description": "Order of sorted results.",
  39916. // "enum": [
  39917. // "ASCENDING",
  39918. // "DESCENDING"
  39919. // ],
  39920. // "enumDescriptions": [
  39921. // "Ascending order.",
  39922. // "Descending order."
  39923. // ],
  39924. // "location": "query",
  39925. // "type": "string"
  39926. // }
  39927. // },
  39928. // "path": "userprofiles/{profileId}/reports",
  39929. // "response": {
  39930. // "$ref": "ReportList"
  39931. // },
  39932. // "scopes": [
  39933. // "https://www.googleapis.com/auth/dfareporting"
  39934. // ]
  39935. // }
  39936. }
  39937. // Pages invokes f for each page of results.
  39938. // A non-nil error returned from f will halt the iteration.
  39939. // The provided context supersedes any context provided to the Context method.
  39940. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  39941. c.ctx_ = ctx
  39942. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39943. for {
  39944. x, err := c.Do()
  39945. if err != nil {
  39946. return err
  39947. }
  39948. if err := f(x); err != nil {
  39949. return err
  39950. }
  39951. if x.NextPageToken == "" {
  39952. return nil
  39953. }
  39954. c.PageToken(x.NextPageToken)
  39955. }
  39956. }
  39957. // method id "dfareporting.reports.patch":
  39958. type ReportsPatchCall struct {
  39959. s *Service
  39960. profileId int64
  39961. reportId int64
  39962. report *Report
  39963. urlParams_ gensupport.URLParams
  39964. ctx_ context.Context
  39965. header_ http.Header
  39966. }
  39967. // Patch: Updates a report. This method supports patch semantics.
  39968. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  39969. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39970. c.profileId = profileId
  39971. c.reportId = reportId
  39972. c.report = report
  39973. return c
  39974. }
  39975. // Fields allows partial responses to be retrieved. See
  39976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39977. // for more information.
  39978. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  39979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39980. return c
  39981. }
  39982. // Context sets the context to be used in this call's Do method. Any
  39983. // pending HTTP request will be aborted if the provided context is
  39984. // canceled.
  39985. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  39986. c.ctx_ = ctx
  39987. return c
  39988. }
  39989. // Header returns an http.Header that can be modified by the caller to
  39990. // add HTTP headers to the request.
  39991. func (c *ReportsPatchCall) Header() http.Header {
  39992. if c.header_ == nil {
  39993. c.header_ = make(http.Header)
  39994. }
  39995. return c.header_
  39996. }
  39997. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  39998. reqHeaders := make(http.Header)
  39999. for k, v := range c.header_ {
  40000. reqHeaders[k] = v
  40001. }
  40002. reqHeaders.Set("User-Agent", c.s.userAgent())
  40003. var body io.Reader = nil
  40004. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40005. if err != nil {
  40006. return nil, err
  40007. }
  40008. reqHeaders.Set("Content-Type", "application/json")
  40009. c.urlParams_.Set("alt", alt)
  40010. c.urlParams_.Set("prettyPrint", "false")
  40011. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40012. urls += "?" + c.urlParams_.Encode()
  40013. req, err := http.NewRequest("PATCH", urls, body)
  40014. if err != nil {
  40015. return nil, err
  40016. }
  40017. req.Header = reqHeaders
  40018. googleapi.Expand(req.URL, map[string]string{
  40019. "profileId": strconv.FormatInt(c.profileId, 10),
  40020. "reportId": strconv.FormatInt(c.reportId, 10),
  40021. })
  40022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40023. }
  40024. // Do executes the "dfareporting.reports.patch" call.
  40025. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40026. // code is an error. Response headers are in either
  40027. // *Report.ServerResponse.Header or (if a response was returned at all)
  40028. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40029. // check whether the returned error was because http.StatusNotModified
  40030. // was returned.
  40031. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40032. gensupport.SetOptions(c.urlParams_, opts...)
  40033. res, err := c.doRequest("json")
  40034. if res != nil && res.StatusCode == http.StatusNotModified {
  40035. if res.Body != nil {
  40036. res.Body.Close()
  40037. }
  40038. return nil, &googleapi.Error{
  40039. Code: res.StatusCode,
  40040. Header: res.Header,
  40041. }
  40042. }
  40043. if err != nil {
  40044. return nil, err
  40045. }
  40046. defer googleapi.CloseBody(res)
  40047. if err := googleapi.CheckResponse(res); err != nil {
  40048. return nil, err
  40049. }
  40050. ret := &Report{
  40051. ServerResponse: googleapi.ServerResponse{
  40052. Header: res.Header,
  40053. HTTPStatusCode: res.StatusCode,
  40054. },
  40055. }
  40056. target := &ret
  40057. if err := gensupport.DecodeResponse(target, res); err != nil {
  40058. return nil, err
  40059. }
  40060. return ret, nil
  40061. // {
  40062. // "description": "Updates a report. This method supports patch semantics.",
  40063. // "httpMethod": "PATCH",
  40064. // "id": "dfareporting.reports.patch",
  40065. // "parameterOrder": [
  40066. // "profileId",
  40067. // "reportId"
  40068. // ],
  40069. // "parameters": {
  40070. // "profileId": {
  40071. // "description": "The DFA user profile ID.",
  40072. // "format": "int64",
  40073. // "location": "path",
  40074. // "required": true,
  40075. // "type": "string"
  40076. // },
  40077. // "reportId": {
  40078. // "description": "The ID of the report.",
  40079. // "format": "int64",
  40080. // "location": "path",
  40081. // "required": true,
  40082. // "type": "string"
  40083. // }
  40084. // },
  40085. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40086. // "request": {
  40087. // "$ref": "Report"
  40088. // },
  40089. // "response": {
  40090. // "$ref": "Report"
  40091. // },
  40092. // "scopes": [
  40093. // "https://www.googleapis.com/auth/dfareporting"
  40094. // ]
  40095. // }
  40096. }
  40097. // method id "dfareporting.reports.run":
  40098. type ReportsRunCall struct {
  40099. s *Service
  40100. profileId int64
  40101. reportId int64
  40102. urlParams_ gensupport.URLParams
  40103. ctx_ context.Context
  40104. header_ http.Header
  40105. }
  40106. // Run: Runs a report.
  40107. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  40108. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40109. c.profileId = profileId
  40110. c.reportId = reportId
  40111. return c
  40112. }
  40113. // Synchronous sets the optional parameter "synchronous": If set and
  40114. // true, tries to run the report synchronously.
  40115. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  40116. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  40117. return c
  40118. }
  40119. // Fields allows partial responses to be retrieved. See
  40120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40121. // for more information.
  40122. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  40123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40124. return c
  40125. }
  40126. // Context sets the context to be used in this call's Do method. Any
  40127. // pending HTTP request will be aborted if the provided context is
  40128. // canceled.
  40129. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  40130. c.ctx_ = ctx
  40131. return c
  40132. }
  40133. // Header returns an http.Header that can be modified by the caller to
  40134. // add HTTP headers to the request.
  40135. func (c *ReportsRunCall) Header() http.Header {
  40136. if c.header_ == nil {
  40137. c.header_ = make(http.Header)
  40138. }
  40139. return c.header_
  40140. }
  40141. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  40142. reqHeaders := make(http.Header)
  40143. for k, v := range c.header_ {
  40144. reqHeaders[k] = v
  40145. }
  40146. reqHeaders.Set("User-Agent", c.s.userAgent())
  40147. var body io.Reader = nil
  40148. c.urlParams_.Set("alt", alt)
  40149. c.urlParams_.Set("prettyPrint", "false")
  40150. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  40151. urls += "?" + c.urlParams_.Encode()
  40152. req, err := http.NewRequest("POST", urls, body)
  40153. if err != nil {
  40154. return nil, err
  40155. }
  40156. req.Header = reqHeaders
  40157. googleapi.Expand(req.URL, map[string]string{
  40158. "profileId": strconv.FormatInt(c.profileId, 10),
  40159. "reportId": strconv.FormatInt(c.reportId, 10),
  40160. })
  40161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40162. }
  40163. // Do executes the "dfareporting.reports.run" call.
  40164. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40165. // code is an error. Response headers are in either
  40166. // *File.ServerResponse.Header or (if a response was returned at all) in
  40167. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40168. // whether the returned error was because http.StatusNotModified was
  40169. // returned.
  40170. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40171. gensupport.SetOptions(c.urlParams_, opts...)
  40172. res, err := c.doRequest("json")
  40173. if res != nil && res.StatusCode == http.StatusNotModified {
  40174. if res.Body != nil {
  40175. res.Body.Close()
  40176. }
  40177. return nil, &googleapi.Error{
  40178. Code: res.StatusCode,
  40179. Header: res.Header,
  40180. }
  40181. }
  40182. if err != nil {
  40183. return nil, err
  40184. }
  40185. defer googleapi.CloseBody(res)
  40186. if err := googleapi.CheckResponse(res); err != nil {
  40187. return nil, err
  40188. }
  40189. ret := &File{
  40190. ServerResponse: googleapi.ServerResponse{
  40191. Header: res.Header,
  40192. HTTPStatusCode: res.StatusCode,
  40193. },
  40194. }
  40195. target := &ret
  40196. if err := gensupport.DecodeResponse(target, res); err != nil {
  40197. return nil, err
  40198. }
  40199. return ret, nil
  40200. // {
  40201. // "description": "Runs a report.",
  40202. // "httpMethod": "POST",
  40203. // "id": "dfareporting.reports.run",
  40204. // "parameterOrder": [
  40205. // "profileId",
  40206. // "reportId"
  40207. // ],
  40208. // "parameters": {
  40209. // "profileId": {
  40210. // "description": "The DFA profile ID.",
  40211. // "format": "int64",
  40212. // "location": "path",
  40213. // "required": true,
  40214. // "type": "string"
  40215. // },
  40216. // "reportId": {
  40217. // "description": "The ID of the report.",
  40218. // "format": "int64",
  40219. // "location": "path",
  40220. // "required": true,
  40221. // "type": "string"
  40222. // },
  40223. // "synchronous": {
  40224. // "default": "false",
  40225. // "description": "If set and true, tries to run the report synchronously.",
  40226. // "location": "query",
  40227. // "type": "boolean"
  40228. // }
  40229. // },
  40230. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  40231. // "response": {
  40232. // "$ref": "File"
  40233. // },
  40234. // "scopes": [
  40235. // "https://www.googleapis.com/auth/dfareporting"
  40236. // ]
  40237. // }
  40238. }
  40239. // method id "dfareporting.reports.update":
  40240. type ReportsUpdateCall struct {
  40241. s *Service
  40242. profileId int64
  40243. reportId int64
  40244. report *Report
  40245. urlParams_ gensupport.URLParams
  40246. ctx_ context.Context
  40247. header_ http.Header
  40248. }
  40249. // Update: Updates a report.
  40250. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  40251. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40252. c.profileId = profileId
  40253. c.reportId = reportId
  40254. c.report = report
  40255. return c
  40256. }
  40257. // Fields allows partial responses to be retrieved. See
  40258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40259. // for more information.
  40260. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  40261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40262. return c
  40263. }
  40264. // Context sets the context to be used in this call's Do method. Any
  40265. // pending HTTP request will be aborted if the provided context is
  40266. // canceled.
  40267. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  40268. c.ctx_ = ctx
  40269. return c
  40270. }
  40271. // Header returns an http.Header that can be modified by the caller to
  40272. // add HTTP headers to the request.
  40273. func (c *ReportsUpdateCall) Header() http.Header {
  40274. if c.header_ == nil {
  40275. c.header_ = make(http.Header)
  40276. }
  40277. return c.header_
  40278. }
  40279. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  40280. reqHeaders := make(http.Header)
  40281. for k, v := range c.header_ {
  40282. reqHeaders[k] = v
  40283. }
  40284. reqHeaders.Set("User-Agent", c.s.userAgent())
  40285. var body io.Reader = nil
  40286. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40287. if err != nil {
  40288. return nil, err
  40289. }
  40290. reqHeaders.Set("Content-Type", "application/json")
  40291. c.urlParams_.Set("alt", alt)
  40292. c.urlParams_.Set("prettyPrint", "false")
  40293. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40294. urls += "?" + c.urlParams_.Encode()
  40295. req, err := http.NewRequest("PUT", urls, body)
  40296. if err != nil {
  40297. return nil, err
  40298. }
  40299. req.Header = reqHeaders
  40300. googleapi.Expand(req.URL, map[string]string{
  40301. "profileId": strconv.FormatInt(c.profileId, 10),
  40302. "reportId": strconv.FormatInt(c.reportId, 10),
  40303. })
  40304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40305. }
  40306. // Do executes the "dfareporting.reports.update" call.
  40307. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40308. // code is an error. Response headers are in either
  40309. // *Report.ServerResponse.Header or (if a response was returned at all)
  40310. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40311. // check whether the returned error was because http.StatusNotModified
  40312. // was returned.
  40313. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40314. gensupport.SetOptions(c.urlParams_, opts...)
  40315. res, err := c.doRequest("json")
  40316. if res != nil && res.StatusCode == http.StatusNotModified {
  40317. if res.Body != nil {
  40318. res.Body.Close()
  40319. }
  40320. return nil, &googleapi.Error{
  40321. Code: res.StatusCode,
  40322. Header: res.Header,
  40323. }
  40324. }
  40325. if err != nil {
  40326. return nil, err
  40327. }
  40328. defer googleapi.CloseBody(res)
  40329. if err := googleapi.CheckResponse(res); err != nil {
  40330. return nil, err
  40331. }
  40332. ret := &Report{
  40333. ServerResponse: googleapi.ServerResponse{
  40334. Header: res.Header,
  40335. HTTPStatusCode: res.StatusCode,
  40336. },
  40337. }
  40338. target := &ret
  40339. if err := gensupport.DecodeResponse(target, res); err != nil {
  40340. return nil, err
  40341. }
  40342. return ret, nil
  40343. // {
  40344. // "description": "Updates a report.",
  40345. // "httpMethod": "PUT",
  40346. // "id": "dfareporting.reports.update",
  40347. // "parameterOrder": [
  40348. // "profileId",
  40349. // "reportId"
  40350. // ],
  40351. // "parameters": {
  40352. // "profileId": {
  40353. // "description": "The DFA user profile ID.",
  40354. // "format": "int64",
  40355. // "location": "path",
  40356. // "required": true,
  40357. // "type": "string"
  40358. // },
  40359. // "reportId": {
  40360. // "description": "The ID of the report.",
  40361. // "format": "int64",
  40362. // "location": "path",
  40363. // "required": true,
  40364. // "type": "string"
  40365. // }
  40366. // },
  40367. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40368. // "request": {
  40369. // "$ref": "Report"
  40370. // },
  40371. // "response": {
  40372. // "$ref": "Report"
  40373. // },
  40374. // "scopes": [
  40375. // "https://www.googleapis.com/auth/dfareporting"
  40376. // ]
  40377. // }
  40378. }
  40379. // method id "dfareporting.reports.compatibleFields.query":
  40380. type ReportsCompatibleFieldsQueryCall struct {
  40381. s *Service
  40382. profileId int64
  40383. report *Report
  40384. urlParams_ gensupport.URLParams
  40385. ctx_ context.Context
  40386. header_ http.Header
  40387. }
  40388. // Query: Returns the fields that are compatible to be selected in the
  40389. // respective sections of a report criteria, given the fields already
  40390. // selected in the input report and user permissions.
  40391. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  40392. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40393. c.profileId = profileId
  40394. c.report = report
  40395. return c
  40396. }
  40397. // Fields allows partial responses to be retrieved. See
  40398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40399. // for more information.
  40400. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  40401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40402. return c
  40403. }
  40404. // Context sets the context to be used in this call's Do method. Any
  40405. // pending HTTP request will be aborted if the provided context is
  40406. // canceled.
  40407. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  40408. c.ctx_ = ctx
  40409. return c
  40410. }
  40411. // Header returns an http.Header that can be modified by the caller to
  40412. // add HTTP headers to the request.
  40413. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  40414. if c.header_ == nil {
  40415. c.header_ = make(http.Header)
  40416. }
  40417. return c.header_
  40418. }
  40419. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  40420. reqHeaders := make(http.Header)
  40421. for k, v := range c.header_ {
  40422. reqHeaders[k] = v
  40423. }
  40424. reqHeaders.Set("User-Agent", c.s.userAgent())
  40425. var body io.Reader = nil
  40426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40427. if err != nil {
  40428. return nil, err
  40429. }
  40430. reqHeaders.Set("Content-Type", "application/json")
  40431. c.urlParams_.Set("alt", alt)
  40432. c.urlParams_.Set("prettyPrint", "false")
  40433. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  40434. urls += "?" + c.urlParams_.Encode()
  40435. req, err := http.NewRequest("POST", urls, body)
  40436. if err != nil {
  40437. return nil, err
  40438. }
  40439. req.Header = reqHeaders
  40440. googleapi.Expand(req.URL, map[string]string{
  40441. "profileId": strconv.FormatInt(c.profileId, 10),
  40442. })
  40443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40444. }
  40445. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  40446. // Exactly one of *CompatibleFields or error will be non-nil. Any
  40447. // non-2xx status code is an error. Response headers are in either
  40448. // *CompatibleFields.ServerResponse.Header or (if a response was
  40449. // returned at all) in error.(*googleapi.Error).Header. Use
  40450. // googleapi.IsNotModified to check whether the returned error was
  40451. // because http.StatusNotModified was returned.
  40452. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  40453. gensupport.SetOptions(c.urlParams_, opts...)
  40454. res, err := c.doRequest("json")
  40455. if res != nil && res.StatusCode == http.StatusNotModified {
  40456. if res.Body != nil {
  40457. res.Body.Close()
  40458. }
  40459. return nil, &googleapi.Error{
  40460. Code: res.StatusCode,
  40461. Header: res.Header,
  40462. }
  40463. }
  40464. if err != nil {
  40465. return nil, err
  40466. }
  40467. defer googleapi.CloseBody(res)
  40468. if err := googleapi.CheckResponse(res); err != nil {
  40469. return nil, err
  40470. }
  40471. ret := &CompatibleFields{
  40472. ServerResponse: googleapi.ServerResponse{
  40473. Header: res.Header,
  40474. HTTPStatusCode: res.StatusCode,
  40475. },
  40476. }
  40477. target := &ret
  40478. if err := gensupport.DecodeResponse(target, res); err != nil {
  40479. return nil, err
  40480. }
  40481. return ret, nil
  40482. // {
  40483. // "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.",
  40484. // "httpMethod": "POST",
  40485. // "id": "dfareporting.reports.compatibleFields.query",
  40486. // "parameterOrder": [
  40487. // "profileId"
  40488. // ],
  40489. // "parameters": {
  40490. // "profileId": {
  40491. // "description": "The DFA user profile ID.",
  40492. // "format": "int64",
  40493. // "location": "path",
  40494. // "required": true,
  40495. // "type": "string"
  40496. // }
  40497. // },
  40498. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  40499. // "request": {
  40500. // "$ref": "Report"
  40501. // },
  40502. // "response": {
  40503. // "$ref": "CompatibleFields"
  40504. // },
  40505. // "scopes": [
  40506. // "https://www.googleapis.com/auth/dfareporting"
  40507. // ]
  40508. // }
  40509. }
  40510. // method id "dfareporting.reports.files.get":
  40511. type ReportsFilesGetCall struct {
  40512. s *Service
  40513. profileId int64
  40514. reportId int64
  40515. fileId int64
  40516. urlParams_ gensupport.URLParams
  40517. ifNoneMatch_ string
  40518. ctx_ context.Context
  40519. header_ http.Header
  40520. }
  40521. // Get: Retrieves a report file. This method supports media download.
  40522. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  40523. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40524. c.profileId = profileId
  40525. c.reportId = reportId
  40526. c.fileId = fileId
  40527. return c
  40528. }
  40529. // Fields allows partial responses to be retrieved. See
  40530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40531. // for more information.
  40532. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  40533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40534. return c
  40535. }
  40536. // IfNoneMatch sets the optional parameter which makes the operation
  40537. // fail if the object's ETag matches the given value. This is useful for
  40538. // getting updates only after the object has changed since the last
  40539. // request. Use googleapi.IsNotModified to check whether the response
  40540. // error from Do is the result of In-None-Match.
  40541. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  40542. c.ifNoneMatch_ = entityTag
  40543. return c
  40544. }
  40545. // Context sets the context to be used in this call's Do and Download
  40546. // methods. Any pending HTTP request will be aborted if the provided
  40547. // context is canceled.
  40548. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  40549. c.ctx_ = ctx
  40550. return c
  40551. }
  40552. // Header returns an http.Header that can be modified by the caller to
  40553. // add HTTP headers to the request.
  40554. func (c *ReportsFilesGetCall) Header() http.Header {
  40555. if c.header_ == nil {
  40556. c.header_ = make(http.Header)
  40557. }
  40558. return c.header_
  40559. }
  40560. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  40561. reqHeaders := make(http.Header)
  40562. for k, v := range c.header_ {
  40563. reqHeaders[k] = v
  40564. }
  40565. reqHeaders.Set("User-Agent", c.s.userAgent())
  40566. if c.ifNoneMatch_ != "" {
  40567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40568. }
  40569. var body io.Reader = nil
  40570. c.urlParams_.Set("alt", alt)
  40571. c.urlParams_.Set("prettyPrint", "false")
  40572. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  40573. urls += "?" + c.urlParams_.Encode()
  40574. req, err := http.NewRequest("GET", urls, body)
  40575. if err != nil {
  40576. return nil, err
  40577. }
  40578. req.Header = reqHeaders
  40579. googleapi.Expand(req.URL, map[string]string{
  40580. "profileId": strconv.FormatInt(c.profileId, 10),
  40581. "reportId": strconv.FormatInt(c.reportId, 10),
  40582. "fileId": strconv.FormatInt(c.fileId, 10),
  40583. })
  40584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40585. }
  40586. // Download fetches the API endpoint's "media" value, instead of the normal
  40587. // API response value. If the returned error is nil, the Response is guaranteed to
  40588. // have a 2xx status code. Callers must close the Response.Body as usual.
  40589. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  40590. gensupport.SetOptions(c.urlParams_, opts...)
  40591. res, err := c.doRequest("media")
  40592. if err != nil {
  40593. return nil, err
  40594. }
  40595. if err := googleapi.CheckMediaResponse(res); err != nil {
  40596. res.Body.Close()
  40597. return nil, err
  40598. }
  40599. return res, nil
  40600. }
  40601. // Do executes the "dfareporting.reports.files.get" call.
  40602. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40603. // code is an error. Response headers are in either
  40604. // *File.ServerResponse.Header or (if a response was returned at all) in
  40605. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40606. // whether the returned error was because http.StatusNotModified was
  40607. // returned.
  40608. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40609. gensupport.SetOptions(c.urlParams_, opts...)
  40610. res, err := c.doRequest("json")
  40611. if res != nil && res.StatusCode == http.StatusNotModified {
  40612. if res.Body != nil {
  40613. res.Body.Close()
  40614. }
  40615. return nil, &googleapi.Error{
  40616. Code: res.StatusCode,
  40617. Header: res.Header,
  40618. }
  40619. }
  40620. if err != nil {
  40621. return nil, err
  40622. }
  40623. defer googleapi.CloseBody(res)
  40624. if err := googleapi.CheckResponse(res); err != nil {
  40625. return nil, err
  40626. }
  40627. ret := &File{
  40628. ServerResponse: googleapi.ServerResponse{
  40629. Header: res.Header,
  40630. HTTPStatusCode: res.StatusCode,
  40631. },
  40632. }
  40633. target := &ret
  40634. if err := gensupport.DecodeResponse(target, res); err != nil {
  40635. return nil, err
  40636. }
  40637. return ret, nil
  40638. // {
  40639. // "description": "Retrieves a report file. This method supports media download.",
  40640. // "httpMethod": "GET",
  40641. // "id": "dfareporting.reports.files.get",
  40642. // "parameterOrder": [
  40643. // "profileId",
  40644. // "reportId",
  40645. // "fileId"
  40646. // ],
  40647. // "parameters": {
  40648. // "fileId": {
  40649. // "description": "The ID of the report file.",
  40650. // "format": "int64",
  40651. // "location": "path",
  40652. // "required": true,
  40653. // "type": "string"
  40654. // },
  40655. // "profileId": {
  40656. // "description": "The DFA profile ID.",
  40657. // "format": "int64",
  40658. // "location": "path",
  40659. // "required": true,
  40660. // "type": "string"
  40661. // },
  40662. // "reportId": {
  40663. // "description": "The ID of the report.",
  40664. // "format": "int64",
  40665. // "location": "path",
  40666. // "required": true,
  40667. // "type": "string"
  40668. // }
  40669. // },
  40670. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  40671. // "response": {
  40672. // "$ref": "File"
  40673. // },
  40674. // "scopes": [
  40675. // "https://www.googleapis.com/auth/dfareporting"
  40676. // ],
  40677. // "supportsMediaDownload": true
  40678. // }
  40679. }
  40680. // method id "dfareporting.reports.files.list":
  40681. type ReportsFilesListCall struct {
  40682. s *Service
  40683. profileId int64
  40684. reportId int64
  40685. urlParams_ gensupport.URLParams
  40686. ifNoneMatch_ string
  40687. ctx_ context.Context
  40688. header_ http.Header
  40689. }
  40690. // List: Lists files for a report.
  40691. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  40692. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40693. c.profileId = profileId
  40694. c.reportId = reportId
  40695. return c
  40696. }
  40697. // MaxResults sets the optional parameter "maxResults": Maximum number
  40698. // of results to return.
  40699. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  40700. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40701. return c
  40702. }
  40703. // PageToken sets the optional parameter "pageToken": The value of the
  40704. // nextToken from the previous result page.
  40705. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  40706. c.urlParams_.Set("pageToken", pageToken)
  40707. return c
  40708. }
  40709. // SortField sets the optional parameter "sortField": The field by which
  40710. // to sort the list.
  40711. //
  40712. // Possible values:
  40713. // "ID" - Sort by file ID.
  40714. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  40715. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  40716. c.urlParams_.Set("sortField", sortField)
  40717. return c
  40718. }
  40719. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40720. // results.
  40721. //
  40722. // Possible values:
  40723. // "ASCENDING" - Ascending order.
  40724. // "DESCENDING" (default) - Descending order.
  40725. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  40726. c.urlParams_.Set("sortOrder", sortOrder)
  40727. return c
  40728. }
  40729. // Fields allows partial responses to be retrieved. See
  40730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40731. // for more information.
  40732. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  40733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40734. return c
  40735. }
  40736. // IfNoneMatch sets the optional parameter which makes the operation
  40737. // fail if the object's ETag matches the given value. This is useful for
  40738. // getting updates only after the object has changed since the last
  40739. // request. Use googleapi.IsNotModified to check whether the response
  40740. // error from Do is the result of In-None-Match.
  40741. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  40742. c.ifNoneMatch_ = entityTag
  40743. return c
  40744. }
  40745. // Context sets the context to be used in this call's Do method. Any
  40746. // pending HTTP request will be aborted if the provided context is
  40747. // canceled.
  40748. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  40749. c.ctx_ = ctx
  40750. return c
  40751. }
  40752. // Header returns an http.Header that can be modified by the caller to
  40753. // add HTTP headers to the request.
  40754. func (c *ReportsFilesListCall) Header() http.Header {
  40755. if c.header_ == nil {
  40756. c.header_ = make(http.Header)
  40757. }
  40758. return c.header_
  40759. }
  40760. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  40761. reqHeaders := make(http.Header)
  40762. for k, v := range c.header_ {
  40763. reqHeaders[k] = v
  40764. }
  40765. reqHeaders.Set("User-Agent", c.s.userAgent())
  40766. if c.ifNoneMatch_ != "" {
  40767. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40768. }
  40769. var body io.Reader = nil
  40770. c.urlParams_.Set("alt", alt)
  40771. c.urlParams_.Set("prettyPrint", "false")
  40772. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  40773. urls += "?" + c.urlParams_.Encode()
  40774. req, err := http.NewRequest("GET", urls, body)
  40775. if err != nil {
  40776. return nil, err
  40777. }
  40778. req.Header = reqHeaders
  40779. googleapi.Expand(req.URL, map[string]string{
  40780. "profileId": strconv.FormatInt(c.profileId, 10),
  40781. "reportId": strconv.FormatInt(c.reportId, 10),
  40782. })
  40783. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40784. }
  40785. // Do executes the "dfareporting.reports.files.list" call.
  40786. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  40787. // code is an error. Response headers are in either
  40788. // *FileList.ServerResponse.Header or (if a response was returned at
  40789. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40790. // to check whether the returned error was because
  40791. // http.StatusNotModified was returned.
  40792. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  40793. gensupport.SetOptions(c.urlParams_, opts...)
  40794. res, err := c.doRequest("json")
  40795. if res != nil && res.StatusCode == http.StatusNotModified {
  40796. if res.Body != nil {
  40797. res.Body.Close()
  40798. }
  40799. return nil, &googleapi.Error{
  40800. Code: res.StatusCode,
  40801. Header: res.Header,
  40802. }
  40803. }
  40804. if err != nil {
  40805. return nil, err
  40806. }
  40807. defer googleapi.CloseBody(res)
  40808. if err := googleapi.CheckResponse(res); err != nil {
  40809. return nil, err
  40810. }
  40811. ret := &FileList{
  40812. ServerResponse: googleapi.ServerResponse{
  40813. Header: res.Header,
  40814. HTTPStatusCode: res.StatusCode,
  40815. },
  40816. }
  40817. target := &ret
  40818. if err := gensupport.DecodeResponse(target, res); err != nil {
  40819. return nil, err
  40820. }
  40821. return ret, nil
  40822. // {
  40823. // "description": "Lists files for a report.",
  40824. // "httpMethod": "GET",
  40825. // "id": "dfareporting.reports.files.list",
  40826. // "parameterOrder": [
  40827. // "profileId",
  40828. // "reportId"
  40829. // ],
  40830. // "parameters": {
  40831. // "maxResults": {
  40832. // "default": "10",
  40833. // "description": "Maximum number of results to return.",
  40834. // "format": "int32",
  40835. // "location": "query",
  40836. // "maximum": "10",
  40837. // "minimum": "0",
  40838. // "type": "integer"
  40839. // },
  40840. // "pageToken": {
  40841. // "description": "The value of the nextToken from the previous result page.",
  40842. // "location": "query",
  40843. // "type": "string"
  40844. // },
  40845. // "profileId": {
  40846. // "description": "The DFA profile ID.",
  40847. // "format": "int64",
  40848. // "location": "path",
  40849. // "required": true,
  40850. // "type": "string"
  40851. // },
  40852. // "reportId": {
  40853. // "description": "The ID of the parent report.",
  40854. // "format": "int64",
  40855. // "location": "path",
  40856. // "required": true,
  40857. // "type": "string"
  40858. // },
  40859. // "sortField": {
  40860. // "default": "LAST_MODIFIED_TIME",
  40861. // "description": "The field by which to sort the list.",
  40862. // "enum": [
  40863. // "ID",
  40864. // "LAST_MODIFIED_TIME"
  40865. // ],
  40866. // "enumDescriptions": [
  40867. // "Sort by file ID.",
  40868. // "Sort by 'lastmodifiedAt' field."
  40869. // ],
  40870. // "location": "query",
  40871. // "type": "string"
  40872. // },
  40873. // "sortOrder": {
  40874. // "default": "DESCENDING",
  40875. // "description": "Order of sorted results.",
  40876. // "enum": [
  40877. // "ASCENDING",
  40878. // "DESCENDING"
  40879. // ],
  40880. // "enumDescriptions": [
  40881. // "Ascending order.",
  40882. // "Descending order."
  40883. // ],
  40884. // "location": "query",
  40885. // "type": "string"
  40886. // }
  40887. // },
  40888. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  40889. // "response": {
  40890. // "$ref": "FileList"
  40891. // },
  40892. // "scopes": [
  40893. // "https://www.googleapis.com/auth/dfareporting"
  40894. // ]
  40895. // }
  40896. }
  40897. // Pages invokes f for each page of results.
  40898. // A non-nil error returned from f will halt the iteration.
  40899. // The provided context supersedes any context provided to the Context method.
  40900. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  40901. c.ctx_ = ctx
  40902. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40903. for {
  40904. x, err := c.Do()
  40905. if err != nil {
  40906. return err
  40907. }
  40908. if err := f(x); err != nil {
  40909. return err
  40910. }
  40911. if x.NextPageToken == "" {
  40912. return nil
  40913. }
  40914. c.PageToken(x.NextPageToken)
  40915. }
  40916. }
  40917. // method id "dfareporting.sites.get":
  40918. type SitesGetCall struct {
  40919. s *Service
  40920. profileId int64
  40921. id int64
  40922. urlParams_ gensupport.URLParams
  40923. ifNoneMatch_ string
  40924. ctx_ context.Context
  40925. header_ http.Header
  40926. }
  40927. // Get: Gets one site by ID.
  40928. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  40929. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40930. c.profileId = profileId
  40931. c.id = id
  40932. return c
  40933. }
  40934. // Fields allows partial responses to be retrieved. See
  40935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40936. // for more information.
  40937. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  40938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40939. return c
  40940. }
  40941. // IfNoneMatch sets the optional parameter which makes the operation
  40942. // fail if the object's ETag matches the given value. This is useful for
  40943. // getting updates only after the object has changed since the last
  40944. // request. Use googleapi.IsNotModified to check whether the response
  40945. // error from Do is the result of In-None-Match.
  40946. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  40947. c.ifNoneMatch_ = entityTag
  40948. return c
  40949. }
  40950. // Context sets the context to be used in this call's Do method. Any
  40951. // pending HTTP request will be aborted if the provided context is
  40952. // canceled.
  40953. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  40954. c.ctx_ = ctx
  40955. return c
  40956. }
  40957. // Header returns an http.Header that can be modified by the caller to
  40958. // add HTTP headers to the request.
  40959. func (c *SitesGetCall) Header() http.Header {
  40960. if c.header_ == nil {
  40961. c.header_ = make(http.Header)
  40962. }
  40963. return c.header_
  40964. }
  40965. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  40966. reqHeaders := make(http.Header)
  40967. for k, v := range c.header_ {
  40968. reqHeaders[k] = v
  40969. }
  40970. reqHeaders.Set("User-Agent", c.s.userAgent())
  40971. if c.ifNoneMatch_ != "" {
  40972. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40973. }
  40974. var body io.Reader = nil
  40975. c.urlParams_.Set("alt", alt)
  40976. c.urlParams_.Set("prettyPrint", "false")
  40977. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  40978. urls += "?" + c.urlParams_.Encode()
  40979. req, err := http.NewRequest("GET", urls, body)
  40980. if err != nil {
  40981. return nil, err
  40982. }
  40983. req.Header = reqHeaders
  40984. googleapi.Expand(req.URL, map[string]string{
  40985. "profileId": strconv.FormatInt(c.profileId, 10),
  40986. "id": strconv.FormatInt(c.id, 10),
  40987. })
  40988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40989. }
  40990. // Do executes the "dfareporting.sites.get" call.
  40991. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40992. // code is an error. Response headers are in either
  40993. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40994. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40995. // whether the returned error was because http.StatusNotModified was
  40996. // returned.
  40997. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40998. gensupport.SetOptions(c.urlParams_, opts...)
  40999. res, err := c.doRequest("json")
  41000. if res != nil && res.StatusCode == http.StatusNotModified {
  41001. if res.Body != nil {
  41002. res.Body.Close()
  41003. }
  41004. return nil, &googleapi.Error{
  41005. Code: res.StatusCode,
  41006. Header: res.Header,
  41007. }
  41008. }
  41009. if err != nil {
  41010. return nil, err
  41011. }
  41012. defer googleapi.CloseBody(res)
  41013. if err := googleapi.CheckResponse(res); err != nil {
  41014. return nil, err
  41015. }
  41016. ret := &Site{
  41017. ServerResponse: googleapi.ServerResponse{
  41018. Header: res.Header,
  41019. HTTPStatusCode: res.StatusCode,
  41020. },
  41021. }
  41022. target := &ret
  41023. if err := gensupport.DecodeResponse(target, res); err != nil {
  41024. return nil, err
  41025. }
  41026. return ret, nil
  41027. // {
  41028. // "description": "Gets one site by ID.",
  41029. // "httpMethod": "GET",
  41030. // "id": "dfareporting.sites.get",
  41031. // "parameterOrder": [
  41032. // "profileId",
  41033. // "id"
  41034. // ],
  41035. // "parameters": {
  41036. // "id": {
  41037. // "description": "Site ID.",
  41038. // "format": "int64",
  41039. // "location": "path",
  41040. // "required": true,
  41041. // "type": "string"
  41042. // },
  41043. // "profileId": {
  41044. // "description": "User profile ID associated with this request.",
  41045. // "format": "int64",
  41046. // "location": "path",
  41047. // "required": true,
  41048. // "type": "string"
  41049. // }
  41050. // },
  41051. // "path": "userprofiles/{profileId}/sites/{id}",
  41052. // "response": {
  41053. // "$ref": "Site"
  41054. // },
  41055. // "scopes": [
  41056. // "https://www.googleapis.com/auth/dfatrafficking"
  41057. // ]
  41058. // }
  41059. }
  41060. // method id "dfareporting.sites.insert":
  41061. type SitesInsertCall struct {
  41062. s *Service
  41063. profileId int64
  41064. site *Site
  41065. urlParams_ gensupport.URLParams
  41066. ctx_ context.Context
  41067. header_ http.Header
  41068. }
  41069. // Insert: Inserts a new site.
  41070. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  41071. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41072. c.profileId = profileId
  41073. c.site = site
  41074. return c
  41075. }
  41076. // Fields allows partial responses to be retrieved. See
  41077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41078. // for more information.
  41079. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  41080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41081. return c
  41082. }
  41083. // Context sets the context to be used in this call's Do method. Any
  41084. // pending HTTP request will be aborted if the provided context is
  41085. // canceled.
  41086. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  41087. c.ctx_ = ctx
  41088. return c
  41089. }
  41090. // Header returns an http.Header that can be modified by the caller to
  41091. // add HTTP headers to the request.
  41092. func (c *SitesInsertCall) Header() http.Header {
  41093. if c.header_ == nil {
  41094. c.header_ = make(http.Header)
  41095. }
  41096. return c.header_
  41097. }
  41098. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  41099. reqHeaders := make(http.Header)
  41100. for k, v := range c.header_ {
  41101. reqHeaders[k] = v
  41102. }
  41103. reqHeaders.Set("User-Agent", c.s.userAgent())
  41104. var body io.Reader = nil
  41105. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41106. if err != nil {
  41107. return nil, err
  41108. }
  41109. reqHeaders.Set("Content-Type", "application/json")
  41110. c.urlParams_.Set("alt", alt)
  41111. c.urlParams_.Set("prettyPrint", "false")
  41112. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41113. urls += "?" + c.urlParams_.Encode()
  41114. req, err := http.NewRequest("POST", urls, body)
  41115. if err != nil {
  41116. return nil, err
  41117. }
  41118. req.Header = reqHeaders
  41119. googleapi.Expand(req.URL, map[string]string{
  41120. "profileId": strconv.FormatInt(c.profileId, 10),
  41121. })
  41122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41123. }
  41124. // Do executes the "dfareporting.sites.insert" call.
  41125. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41126. // code is an error. Response headers are in either
  41127. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41128. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41129. // whether the returned error was because http.StatusNotModified was
  41130. // returned.
  41131. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41132. gensupport.SetOptions(c.urlParams_, opts...)
  41133. res, err := c.doRequest("json")
  41134. if res != nil && res.StatusCode == http.StatusNotModified {
  41135. if res.Body != nil {
  41136. res.Body.Close()
  41137. }
  41138. return nil, &googleapi.Error{
  41139. Code: res.StatusCode,
  41140. Header: res.Header,
  41141. }
  41142. }
  41143. if err != nil {
  41144. return nil, err
  41145. }
  41146. defer googleapi.CloseBody(res)
  41147. if err := googleapi.CheckResponse(res); err != nil {
  41148. return nil, err
  41149. }
  41150. ret := &Site{
  41151. ServerResponse: googleapi.ServerResponse{
  41152. Header: res.Header,
  41153. HTTPStatusCode: res.StatusCode,
  41154. },
  41155. }
  41156. target := &ret
  41157. if err := gensupport.DecodeResponse(target, res); err != nil {
  41158. return nil, err
  41159. }
  41160. return ret, nil
  41161. // {
  41162. // "description": "Inserts a new site.",
  41163. // "httpMethod": "POST",
  41164. // "id": "dfareporting.sites.insert",
  41165. // "parameterOrder": [
  41166. // "profileId"
  41167. // ],
  41168. // "parameters": {
  41169. // "profileId": {
  41170. // "description": "User profile ID associated with this request.",
  41171. // "format": "int64",
  41172. // "location": "path",
  41173. // "required": true,
  41174. // "type": "string"
  41175. // }
  41176. // },
  41177. // "path": "userprofiles/{profileId}/sites",
  41178. // "request": {
  41179. // "$ref": "Site"
  41180. // },
  41181. // "response": {
  41182. // "$ref": "Site"
  41183. // },
  41184. // "scopes": [
  41185. // "https://www.googleapis.com/auth/dfatrafficking"
  41186. // ]
  41187. // }
  41188. }
  41189. // method id "dfareporting.sites.list":
  41190. type SitesListCall struct {
  41191. s *Service
  41192. profileId int64
  41193. urlParams_ gensupport.URLParams
  41194. ifNoneMatch_ string
  41195. ctx_ context.Context
  41196. header_ http.Header
  41197. }
  41198. // List: Retrieves a list of sites, possibly filtered. This method
  41199. // supports paging.
  41200. func (r *SitesService) List(profileId int64) *SitesListCall {
  41201. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41202. c.profileId = profileId
  41203. return c
  41204. }
  41205. // AcceptsInStreamVideoPlacements sets the optional parameter
  41206. // "acceptsInStreamVideoPlacements": This search filter is no longer
  41207. // supported and will have no effect on the results returned.
  41208. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  41209. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  41210. return c
  41211. }
  41212. // AcceptsInterstitialPlacements sets the optional parameter
  41213. // "acceptsInterstitialPlacements": This search filter is no longer
  41214. // supported and will have no effect on the results returned.
  41215. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  41216. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  41217. return c
  41218. }
  41219. // AcceptsPublisherPaidPlacements sets the optional parameter
  41220. // "acceptsPublisherPaidPlacements": Select only sites that accept
  41221. // publisher paid placements.
  41222. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  41223. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  41224. return c
  41225. }
  41226. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  41227. // AdWords sites.
  41228. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  41229. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  41230. return c
  41231. }
  41232. // Approved sets the optional parameter "approved": Select only approved
  41233. // sites.
  41234. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  41235. c.urlParams_.Set("approved", fmt.Sprint(approved))
  41236. return c
  41237. }
  41238. // CampaignIds sets the optional parameter "campaignIds": Select only
  41239. // sites with these campaign IDs.
  41240. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  41241. var campaignIds_ []string
  41242. for _, v := range campaignIds {
  41243. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  41244. }
  41245. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  41246. return c
  41247. }
  41248. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  41249. // Select only sites with these directory site IDs.
  41250. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  41251. var directorySiteIds_ []string
  41252. for _, v := range directorySiteIds {
  41253. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  41254. }
  41255. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  41256. return c
  41257. }
  41258. // Ids sets the optional parameter "ids": Select only sites with these
  41259. // IDs.
  41260. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  41261. var ids_ []string
  41262. for _, v := range ids {
  41263. ids_ = append(ids_, fmt.Sprint(v))
  41264. }
  41265. c.urlParams_.SetMulti("ids", ids_)
  41266. return c
  41267. }
  41268. // MaxResults sets the optional parameter "maxResults": Maximum number
  41269. // of results to return.
  41270. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  41271. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41272. return c
  41273. }
  41274. // PageToken sets the optional parameter "pageToken": Value of the
  41275. // nextPageToken from the previous result page.
  41276. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  41277. c.urlParams_.Set("pageToken", pageToken)
  41278. return c
  41279. }
  41280. // SearchString sets the optional parameter "searchString": Allows
  41281. // searching for objects by name, ID or keyName. Wildcards (*) are
  41282. // allowed. For example, "site*2015" will return objects with names like
  41283. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  41284. // the searches also add wildcards implicitly at the start and the end
  41285. // of the search string. For example, a search string of "site" will
  41286. // match objects with name "my site", "site 2015", or simply "site".
  41287. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  41288. c.urlParams_.Set("searchString", searchString)
  41289. return c
  41290. }
  41291. // SortField sets the optional parameter "sortField": Field by which to
  41292. // sort the list.
  41293. //
  41294. // Possible values:
  41295. // "ID" (default)
  41296. // "NAME"
  41297. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  41298. c.urlParams_.Set("sortField", sortField)
  41299. return c
  41300. }
  41301. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41302. // results.
  41303. //
  41304. // Possible values:
  41305. // "ASCENDING" (default)
  41306. // "DESCENDING"
  41307. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  41308. c.urlParams_.Set("sortOrder", sortOrder)
  41309. return c
  41310. }
  41311. // SubaccountId sets the optional parameter "subaccountId": Select only
  41312. // sites with this subaccount ID.
  41313. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  41314. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  41315. return c
  41316. }
  41317. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  41318. // sites that have not been mapped to a directory site.
  41319. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  41320. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  41321. return c
  41322. }
  41323. // Fields allows partial responses to be retrieved. See
  41324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41325. // for more information.
  41326. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  41327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41328. return c
  41329. }
  41330. // IfNoneMatch sets the optional parameter which makes the operation
  41331. // fail if the object's ETag matches the given value. This is useful for
  41332. // getting updates only after the object has changed since the last
  41333. // request. Use googleapi.IsNotModified to check whether the response
  41334. // error from Do is the result of In-None-Match.
  41335. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  41336. c.ifNoneMatch_ = entityTag
  41337. return c
  41338. }
  41339. // Context sets the context to be used in this call's Do method. Any
  41340. // pending HTTP request will be aborted if the provided context is
  41341. // canceled.
  41342. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  41343. c.ctx_ = ctx
  41344. return c
  41345. }
  41346. // Header returns an http.Header that can be modified by the caller to
  41347. // add HTTP headers to the request.
  41348. func (c *SitesListCall) Header() http.Header {
  41349. if c.header_ == nil {
  41350. c.header_ = make(http.Header)
  41351. }
  41352. return c.header_
  41353. }
  41354. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  41355. reqHeaders := make(http.Header)
  41356. for k, v := range c.header_ {
  41357. reqHeaders[k] = v
  41358. }
  41359. reqHeaders.Set("User-Agent", c.s.userAgent())
  41360. if c.ifNoneMatch_ != "" {
  41361. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41362. }
  41363. var body io.Reader = nil
  41364. c.urlParams_.Set("alt", alt)
  41365. c.urlParams_.Set("prettyPrint", "false")
  41366. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41367. urls += "?" + c.urlParams_.Encode()
  41368. req, err := http.NewRequest("GET", urls, body)
  41369. if err != nil {
  41370. return nil, err
  41371. }
  41372. req.Header = reqHeaders
  41373. googleapi.Expand(req.URL, map[string]string{
  41374. "profileId": strconv.FormatInt(c.profileId, 10),
  41375. })
  41376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41377. }
  41378. // Do executes the "dfareporting.sites.list" call.
  41379. // Exactly one of *SitesListResponse or error will be non-nil. Any
  41380. // non-2xx status code is an error. Response headers are in either
  41381. // *SitesListResponse.ServerResponse.Header or (if a response was
  41382. // returned at all) in error.(*googleapi.Error).Header. Use
  41383. // googleapi.IsNotModified to check whether the returned error was
  41384. // because http.StatusNotModified was returned.
  41385. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  41386. gensupport.SetOptions(c.urlParams_, opts...)
  41387. res, err := c.doRequest("json")
  41388. if res != nil && res.StatusCode == http.StatusNotModified {
  41389. if res.Body != nil {
  41390. res.Body.Close()
  41391. }
  41392. return nil, &googleapi.Error{
  41393. Code: res.StatusCode,
  41394. Header: res.Header,
  41395. }
  41396. }
  41397. if err != nil {
  41398. return nil, err
  41399. }
  41400. defer googleapi.CloseBody(res)
  41401. if err := googleapi.CheckResponse(res); err != nil {
  41402. return nil, err
  41403. }
  41404. ret := &SitesListResponse{
  41405. ServerResponse: googleapi.ServerResponse{
  41406. Header: res.Header,
  41407. HTTPStatusCode: res.StatusCode,
  41408. },
  41409. }
  41410. target := &ret
  41411. if err := gensupport.DecodeResponse(target, res); err != nil {
  41412. return nil, err
  41413. }
  41414. return ret, nil
  41415. // {
  41416. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  41417. // "httpMethod": "GET",
  41418. // "id": "dfareporting.sites.list",
  41419. // "parameterOrder": [
  41420. // "profileId"
  41421. // ],
  41422. // "parameters": {
  41423. // "acceptsInStreamVideoPlacements": {
  41424. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41425. // "location": "query",
  41426. // "type": "boolean"
  41427. // },
  41428. // "acceptsInterstitialPlacements": {
  41429. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41430. // "location": "query",
  41431. // "type": "boolean"
  41432. // },
  41433. // "acceptsPublisherPaidPlacements": {
  41434. // "description": "Select only sites that accept publisher paid placements.",
  41435. // "location": "query",
  41436. // "type": "boolean"
  41437. // },
  41438. // "adWordsSite": {
  41439. // "description": "Select only AdWords sites.",
  41440. // "location": "query",
  41441. // "type": "boolean"
  41442. // },
  41443. // "approved": {
  41444. // "description": "Select only approved sites.",
  41445. // "location": "query",
  41446. // "type": "boolean"
  41447. // },
  41448. // "campaignIds": {
  41449. // "description": "Select only sites with these campaign IDs.",
  41450. // "format": "int64",
  41451. // "location": "query",
  41452. // "repeated": true,
  41453. // "type": "string"
  41454. // },
  41455. // "directorySiteIds": {
  41456. // "description": "Select only sites with these directory site IDs.",
  41457. // "format": "int64",
  41458. // "location": "query",
  41459. // "repeated": true,
  41460. // "type": "string"
  41461. // },
  41462. // "ids": {
  41463. // "description": "Select only sites with these IDs.",
  41464. // "format": "int64",
  41465. // "location": "query",
  41466. // "repeated": true,
  41467. // "type": "string"
  41468. // },
  41469. // "maxResults": {
  41470. // "default": "1000",
  41471. // "description": "Maximum number of results to return.",
  41472. // "format": "int32",
  41473. // "location": "query",
  41474. // "maximum": "1000",
  41475. // "minimum": "0",
  41476. // "type": "integer"
  41477. // },
  41478. // "pageToken": {
  41479. // "description": "Value of the nextPageToken from the previous result page.",
  41480. // "location": "query",
  41481. // "type": "string"
  41482. // },
  41483. // "profileId": {
  41484. // "description": "User profile ID associated with this request.",
  41485. // "format": "int64",
  41486. // "location": "path",
  41487. // "required": true,
  41488. // "type": "string"
  41489. // },
  41490. // "searchString": {
  41491. // "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\".",
  41492. // "location": "query",
  41493. // "type": "string"
  41494. // },
  41495. // "sortField": {
  41496. // "default": "ID",
  41497. // "description": "Field by which to sort the list.",
  41498. // "enum": [
  41499. // "ID",
  41500. // "NAME"
  41501. // ],
  41502. // "enumDescriptions": [
  41503. // "",
  41504. // ""
  41505. // ],
  41506. // "location": "query",
  41507. // "type": "string"
  41508. // },
  41509. // "sortOrder": {
  41510. // "default": "ASCENDING",
  41511. // "description": "Order of sorted results.",
  41512. // "enum": [
  41513. // "ASCENDING",
  41514. // "DESCENDING"
  41515. // ],
  41516. // "enumDescriptions": [
  41517. // "",
  41518. // ""
  41519. // ],
  41520. // "location": "query",
  41521. // "type": "string"
  41522. // },
  41523. // "subaccountId": {
  41524. // "description": "Select only sites with this subaccount ID.",
  41525. // "format": "int64",
  41526. // "location": "query",
  41527. // "type": "string"
  41528. // },
  41529. // "unmappedSite": {
  41530. // "description": "Select only sites that have not been mapped to a directory site.",
  41531. // "location": "query",
  41532. // "type": "boolean"
  41533. // }
  41534. // },
  41535. // "path": "userprofiles/{profileId}/sites",
  41536. // "response": {
  41537. // "$ref": "SitesListResponse"
  41538. // },
  41539. // "scopes": [
  41540. // "https://www.googleapis.com/auth/dfatrafficking"
  41541. // ]
  41542. // }
  41543. }
  41544. // Pages invokes f for each page of results.
  41545. // A non-nil error returned from f will halt the iteration.
  41546. // The provided context supersedes any context provided to the Context method.
  41547. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  41548. c.ctx_ = ctx
  41549. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41550. for {
  41551. x, err := c.Do()
  41552. if err != nil {
  41553. return err
  41554. }
  41555. if err := f(x); err != nil {
  41556. return err
  41557. }
  41558. if x.NextPageToken == "" {
  41559. return nil
  41560. }
  41561. c.PageToken(x.NextPageToken)
  41562. }
  41563. }
  41564. // method id "dfareporting.sites.patch":
  41565. type SitesPatchCall struct {
  41566. s *Service
  41567. profileId int64
  41568. site *Site
  41569. urlParams_ gensupport.URLParams
  41570. ctx_ context.Context
  41571. header_ http.Header
  41572. }
  41573. // Patch: Updates an existing site. This method supports patch
  41574. // semantics.
  41575. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  41576. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41577. c.profileId = profileId
  41578. c.urlParams_.Set("id", fmt.Sprint(id))
  41579. c.site = site
  41580. return c
  41581. }
  41582. // Fields allows partial responses to be retrieved. See
  41583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41584. // for more information.
  41585. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  41586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41587. return c
  41588. }
  41589. // Context sets the context to be used in this call's Do method. Any
  41590. // pending HTTP request will be aborted if the provided context is
  41591. // canceled.
  41592. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  41593. c.ctx_ = ctx
  41594. return c
  41595. }
  41596. // Header returns an http.Header that can be modified by the caller to
  41597. // add HTTP headers to the request.
  41598. func (c *SitesPatchCall) Header() http.Header {
  41599. if c.header_ == nil {
  41600. c.header_ = make(http.Header)
  41601. }
  41602. return c.header_
  41603. }
  41604. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  41605. reqHeaders := make(http.Header)
  41606. for k, v := range c.header_ {
  41607. reqHeaders[k] = v
  41608. }
  41609. reqHeaders.Set("User-Agent", c.s.userAgent())
  41610. var body io.Reader = nil
  41611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41612. if err != nil {
  41613. return nil, err
  41614. }
  41615. reqHeaders.Set("Content-Type", "application/json")
  41616. c.urlParams_.Set("alt", alt)
  41617. c.urlParams_.Set("prettyPrint", "false")
  41618. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41619. urls += "?" + c.urlParams_.Encode()
  41620. req, err := http.NewRequest("PATCH", urls, body)
  41621. if err != nil {
  41622. return nil, err
  41623. }
  41624. req.Header = reqHeaders
  41625. googleapi.Expand(req.URL, map[string]string{
  41626. "profileId": strconv.FormatInt(c.profileId, 10),
  41627. })
  41628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41629. }
  41630. // Do executes the "dfareporting.sites.patch" call.
  41631. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41632. // code is an error. Response headers are in either
  41633. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41634. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41635. // whether the returned error was because http.StatusNotModified was
  41636. // returned.
  41637. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41638. gensupport.SetOptions(c.urlParams_, opts...)
  41639. res, err := c.doRequest("json")
  41640. if res != nil && res.StatusCode == http.StatusNotModified {
  41641. if res.Body != nil {
  41642. res.Body.Close()
  41643. }
  41644. return nil, &googleapi.Error{
  41645. Code: res.StatusCode,
  41646. Header: res.Header,
  41647. }
  41648. }
  41649. if err != nil {
  41650. return nil, err
  41651. }
  41652. defer googleapi.CloseBody(res)
  41653. if err := googleapi.CheckResponse(res); err != nil {
  41654. return nil, err
  41655. }
  41656. ret := &Site{
  41657. ServerResponse: googleapi.ServerResponse{
  41658. Header: res.Header,
  41659. HTTPStatusCode: res.StatusCode,
  41660. },
  41661. }
  41662. target := &ret
  41663. if err := gensupport.DecodeResponse(target, res); err != nil {
  41664. return nil, err
  41665. }
  41666. return ret, nil
  41667. // {
  41668. // "description": "Updates an existing site. This method supports patch semantics.",
  41669. // "httpMethod": "PATCH",
  41670. // "id": "dfareporting.sites.patch",
  41671. // "parameterOrder": [
  41672. // "profileId",
  41673. // "id"
  41674. // ],
  41675. // "parameters": {
  41676. // "id": {
  41677. // "description": "Site ID.",
  41678. // "format": "int64",
  41679. // "location": "query",
  41680. // "required": true,
  41681. // "type": "string"
  41682. // },
  41683. // "profileId": {
  41684. // "description": "User profile ID associated with this request.",
  41685. // "format": "int64",
  41686. // "location": "path",
  41687. // "required": true,
  41688. // "type": "string"
  41689. // }
  41690. // },
  41691. // "path": "userprofiles/{profileId}/sites",
  41692. // "request": {
  41693. // "$ref": "Site"
  41694. // },
  41695. // "response": {
  41696. // "$ref": "Site"
  41697. // },
  41698. // "scopes": [
  41699. // "https://www.googleapis.com/auth/dfatrafficking"
  41700. // ]
  41701. // }
  41702. }
  41703. // method id "dfareporting.sites.update":
  41704. type SitesUpdateCall struct {
  41705. s *Service
  41706. profileId int64
  41707. site *Site
  41708. urlParams_ gensupport.URLParams
  41709. ctx_ context.Context
  41710. header_ http.Header
  41711. }
  41712. // Update: Updates an existing site.
  41713. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  41714. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41715. c.profileId = profileId
  41716. c.site = site
  41717. return c
  41718. }
  41719. // Fields allows partial responses to be retrieved. See
  41720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41721. // for more information.
  41722. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  41723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41724. return c
  41725. }
  41726. // Context sets the context to be used in this call's Do method. Any
  41727. // pending HTTP request will be aborted if the provided context is
  41728. // canceled.
  41729. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  41730. c.ctx_ = ctx
  41731. return c
  41732. }
  41733. // Header returns an http.Header that can be modified by the caller to
  41734. // add HTTP headers to the request.
  41735. func (c *SitesUpdateCall) Header() http.Header {
  41736. if c.header_ == nil {
  41737. c.header_ = make(http.Header)
  41738. }
  41739. return c.header_
  41740. }
  41741. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  41742. reqHeaders := make(http.Header)
  41743. for k, v := range c.header_ {
  41744. reqHeaders[k] = v
  41745. }
  41746. reqHeaders.Set("User-Agent", c.s.userAgent())
  41747. var body io.Reader = nil
  41748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41749. if err != nil {
  41750. return nil, err
  41751. }
  41752. reqHeaders.Set("Content-Type", "application/json")
  41753. c.urlParams_.Set("alt", alt)
  41754. c.urlParams_.Set("prettyPrint", "false")
  41755. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41756. urls += "?" + c.urlParams_.Encode()
  41757. req, err := http.NewRequest("PUT", urls, body)
  41758. if err != nil {
  41759. return nil, err
  41760. }
  41761. req.Header = reqHeaders
  41762. googleapi.Expand(req.URL, map[string]string{
  41763. "profileId": strconv.FormatInt(c.profileId, 10),
  41764. })
  41765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41766. }
  41767. // Do executes the "dfareporting.sites.update" call.
  41768. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41769. // code is an error. Response headers are in either
  41770. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41771. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41772. // whether the returned error was because http.StatusNotModified was
  41773. // returned.
  41774. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41775. gensupport.SetOptions(c.urlParams_, opts...)
  41776. res, err := c.doRequest("json")
  41777. if res != nil && res.StatusCode == http.StatusNotModified {
  41778. if res.Body != nil {
  41779. res.Body.Close()
  41780. }
  41781. return nil, &googleapi.Error{
  41782. Code: res.StatusCode,
  41783. Header: res.Header,
  41784. }
  41785. }
  41786. if err != nil {
  41787. return nil, err
  41788. }
  41789. defer googleapi.CloseBody(res)
  41790. if err := googleapi.CheckResponse(res); err != nil {
  41791. return nil, err
  41792. }
  41793. ret := &Site{
  41794. ServerResponse: googleapi.ServerResponse{
  41795. Header: res.Header,
  41796. HTTPStatusCode: res.StatusCode,
  41797. },
  41798. }
  41799. target := &ret
  41800. if err := gensupport.DecodeResponse(target, res); err != nil {
  41801. return nil, err
  41802. }
  41803. return ret, nil
  41804. // {
  41805. // "description": "Updates an existing site.",
  41806. // "httpMethod": "PUT",
  41807. // "id": "dfareporting.sites.update",
  41808. // "parameterOrder": [
  41809. // "profileId"
  41810. // ],
  41811. // "parameters": {
  41812. // "profileId": {
  41813. // "description": "User profile ID associated with this request.",
  41814. // "format": "int64",
  41815. // "location": "path",
  41816. // "required": true,
  41817. // "type": "string"
  41818. // }
  41819. // },
  41820. // "path": "userprofiles/{profileId}/sites",
  41821. // "request": {
  41822. // "$ref": "Site"
  41823. // },
  41824. // "response": {
  41825. // "$ref": "Site"
  41826. // },
  41827. // "scopes": [
  41828. // "https://www.googleapis.com/auth/dfatrafficking"
  41829. // ]
  41830. // }
  41831. }
  41832. // method id "dfareporting.sizes.get":
  41833. type SizesGetCall struct {
  41834. s *Service
  41835. profileId int64
  41836. id int64
  41837. urlParams_ gensupport.URLParams
  41838. ifNoneMatch_ string
  41839. ctx_ context.Context
  41840. header_ http.Header
  41841. }
  41842. // Get: Gets one size by ID.
  41843. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  41844. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41845. c.profileId = profileId
  41846. c.id = id
  41847. return c
  41848. }
  41849. // Fields allows partial responses to be retrieved. See
  41850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41851. // for more information.
  41852. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  41853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41854. return c
  41855. }
  41856. // IfNoneMatch sets the optional parameter which makes the operation
  41857. // fail if the object's ETag matches the given value. This is useful for
  41858. // getting updates only after the object has changed since the last
  41859. // request. Use googleapi.IsNotModified to check whether the response
  41860. // error from Do is the result of In-None-Match.
  41861. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  41862. c.ifNoneMatch_ = entityTag
  41863. return c
  41864. }
  41865. // Context sets the context to be used in this call's Do method. Any
  41866. // pending HTTP request will be aborted if the provided context is
  41867. // canceled.
  41868. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  41869. c.ctx_ = ctx
  41870. return c
  41871. }
  41872. // Header returns an http.Header that can be modified by the caller to
  41873. // add HTTP headers to the request.
  41874. func (c *SizesGetCall) Header() http.Header {
  41875. if c.header_ == nil {
  41876. c.header_ = make(http.Header)
  41877. }
  41878. return c.header_
  41879. }
  41880. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  41881. reqHeaders := make(http.Header)
  41882. for k, v := range c.header_ {
  41883. reqHeaders[k] = v
  41884. }
  41885. reqHeaders.Set("User-Agent", c.s.userAgent())
  41886. if c.ifNoneMatch_ != "" {
  41887. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41888. }
  41889. var body io.Reader = nil
  41890. c.urlParams_.Set("alt", alt)
  41891. c.urlParams_.Set("prettyPrint", "false")
  41892. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  41893. urls += "?" + c.urlParams_.Encode()
  41894. req, err := http.NewRequest("GET", urls, body)
  41895. if err != nil {
  41896. return nil, err
  41897. }
  41898. req.Header = reqHeaders
  41899. googleapi.Expand(req.URL, map[string]string{
  41900. "profileId": strconv.FormatInt(c.profileId, 10),
  41901. "id": strconv.FormatInt(c.id, 10),
  41902. })
  41903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41904. }
  41905. // Do executes the "dfareporting.sizes.get" call.
  41906. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41907. // code is an error. Response headers are in either
  41908. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41909. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41910. // whether the returned error was because http.StatusNotModified was
  41911. // returned.
  41912. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41913. gensupport.SetOptions(c.urlParams_, opts...)
  41914. res, err := c.doRequest("json")
  41915. if res != nil && res.StatusCode == http.StatusNotModified {
  41916. if res.Body != nil {
  41917. res.Body.Close()
  41918. }
  41919. return nil, &googleapi.Error{
  41920. Code: res.StatusCode,
  41921. Header: res.Header,
  41922. }
  41923. }
  41924. if err != nil {
  41925. return nil, err
  41926. }
  41927. defer googleapi.CloseBody(res)
  41928. if err := googleapi.CheckResponse(res); err != nil {
  41929. return nil, err
  41930. }
  41931. ret := &Size{
  41932. ServerResponse: googleapi.ServerResponse{
  41933. Header: res.Header,
  41934. HTTPStatusCode: res.StatusCode,
  41935. },
  41936. }
  41937. target := &ret
  41938. if err := gensupport.DecodeResponse(target, res); err != nil {
  41939. return nil, err
  41940. }
  41941. return ret, nil
  41942. // {
  41943. // "description": "Gets one size by ID.",
  41944. // "httpMethod": "GET",
  41945. // "id": "dfareporting.sizes.get",
  41946. // "parameterOrder": [
  41947. // "profileId",
  41948. // "id"
  41949. // ],
  41950. // "parameters": {
  41951. // "id": {
  41952. // "description": "Size ID.",
  41953. // "format": "int64",
  41954. // "location": "path",
  41955. // "required": true,
  41956. // "type": "string"
  41957. // },
  41958. // "profileId": {
  41959. // "description": "User profile ID associated with this request.",
  41960. // "format": "int64",
  41961. // "location": "path",
  41962. // "required": true,
  41963. // "type": "string"
  41964. // }
  41965. // },
  41966. // "path": "userprofiles/{profileId}/sizes/{id}",
  41967. // "response": {
  41968. // "$ref": "Size"
  41969. // },
  41970. // "scopes": [
  41971. // "https://www.googleapis.com/auth/dfatrafficking"
  41972. // ]
  41973. // }
  41974. }
  41975. // method id "dfareporting.sizes.insert":
  41976. type SizesInsertCall struct {
  41977. s *Service
  41978. profileId int64
  41979. size *Size
  41980. urlParams_ gensupport.URLParams
  41981. ctx_ context.Context
  41982. header_ http.Header
  41983. }
  41984. // Insert: Inserts a new size.
  41985. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  41986. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41987. c.profileId = profileId
  41988. c.size = size
  41989. return c
  41990. }
  41991. // Fields allows partial responses to be retrieved. See
  41992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41993. // for more information.
  41994. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  41995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41996. return c
  41997. }
  41998. // Context sets the context to be used in this call's Do method. Any
  41999. // pending HTTP request will be aborted if the provided context is
  42000. // canceled.
  42001. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  42002. c.ctx_ = ctx
  42003. return c
  42004. }
  42005. // Header returns an http.Header that can be modified by the caller to
  42006. // add HTTP headers to the request.
  42007. func (c *SizesInsertCall) Header() http.Header {
  42008. if c.header_ == nil {
  42009. c.header_ = make(http.Header)
  42010. }
  42011. return c.header_
  42012. }
  42013. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  42014. reqHeaders := make(http.Header)
  42015. for k, v := range c.header_ {
  42016. reqHeaders[k] = v
  42017. }
  42018. reqHeaders.Set("User-Agent", c.s.userAgent())
  42019. var body io.Reader = nil
  42020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  42021. if err != nil {
  42022. return nil, err
  42023. }
  42024. reqHeaders.Set("Content-Type", "application/json")
  42025. c.urlParams_.Set("alt", alt)
  42026. c.urlParams_.Set("prettyPrint", "false")
  42027. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  42028. urls += "?" + c.urlParams_.Encode()
  42029. req, err := http.NewRequest("POST", urls, body)
  42030. if err != nil {
  42031. return nil, err
  42032. }
  42033. req.Header = reqHeaders
  42034. googleapi.Expand(req.URL, map[string]string{
  42035. "profileId": strconv.FormatInt(c.profileId, 10),
  42036. })
  42037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42038. }
  42039. // Do executes the "dfareporting.sizes.insert" call.
  42040. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  42041. // code is an error. Response headers are in either
  42042. // *Size.ServerResponse.Header or (if a response was returned at all) in
  42043. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42044. // whether the returned error was because http.StatusNotModified was
  42045. // returned.
  42046. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  42047. gensupport.SetOptions(c.urlParams_, opts...)
  42048. res, err := c.doRequest("json")
  42049. if res != nil && res.StatusCode == http.StatusNotModified {
  42050. if res.Body != nil {
  42051. res.Body.Close()
  42052. }
  42053. return nil, &googleapi.Error{
  42054. Code: res.StatusCode,
  42055. Header: res.Header,
  42056. }
  42057. }
  42058. if err != nil {
  42059. return nil, err
  42060. }
  42061. defer googleapi.CloseBody(res)
  42062. if err := googleapi.CheckResponse(res); err != nil {
  42063. return nil, err
  42064. }
  42065. ret := &Size{
  42066. ServerResponse: googleapi.ServerResponse{
  42067. Header: res.Header,
  42068. HTTPStatusCode: res.StatusCode,
  42069. },
  42070. }
  42071. target := &ret
  42072. if err := gensupport.DecodeResponse(target, res); err != nil {
  42073. return nil, err
  42074. }
  42075. return ret, nil
  42076. // {
  42077. // "description": "Inserts a new size.",
  42078. // "httpMethod": "POST",
  42079. // "id": "dfareporting.sizes.insert",
  42080. // "parameterOrder": [
  42081. // "profileId"
  42082. // ],
  42083. // "parameters": {
  42084. // "profileId": {
  42085. // "description": "User profile ID associated with this request.",
  42086. // "format": "int64",
  42087. // "location": "path",
  42088. // "required": true,
  42089. // "type": "string"
  42090. // }
  42091. // },
  42092. // "path": "userprofiles/{profileId}/sizes",
  42093. // "request": {
  42094. // "$ref": "Size"
  42095. // },
  42096. // "response": {
  42097. // "$ref": "Size"
  42098. // },
  42099. // "scopes": [
  42100. // "https://www.googleapis.com/auth/dfatrafficking"
  42101. // ]
  42102. // }
  42103. }
  42104. // method id "dfareporting.sizes.list":
  42105. type SizesListCall struct {
  42106. s *Service
  42107. profileId int64
  42108. urlParams_ gensupport.URLParams
  42109. ifNoneMatch_ string
  42110. ctx_ context.Context
  42111. header_ http.Header
  42112. }
  42113. // List: Retrieves a list of sizes, possibly filtered. Retrieved sizes
  42114. // are globally unique and may include values not currently in use by
  42115. // your account. Due to this, the list of sizes returned by this method
  42116. // may differ from the list seen in the Trafficking UI.
  42117. func (r *SizesService) List(profileId int64) *SizesListCall {
  42118. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42119. c.profileId = profileId
  42120. return c
  42121. }
  42122. // Height sets the optional parameter "height": Select only sizes with
  42123. // this height.
  42124. func (c *SizesListCall) Height(height int64) *SizesListCall {
  42125. c.urlParams_.Set("height", fmt.Sprint(height))
  42126. return c
  42127. }
  42128. // IabStandard sets the optional parameter "iabStandard": Select only
  42129. // IAB standard sizes.
  42130. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  42131. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  42132. return c
  42133. }
  42134. // Ids sets the optional parameter "ids": Select only sizes with these
  42135. // IDs.
  42136. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  42137. var ids_ []string
  42138. for _, v := range ids {
  42139. ids_ = append(ids_, fmt.Sprint(v))
  42140. }
  42141. c.urlParams_.SetMulti("ids", ids_)
  42142. return c
  42143. }
  42144. // Width sets the optional parameter "width": Select only sizes with
  42145. // this width.
  42146. func (c *SizesListCall) Width(width int64) *SizesListCall {
  42147. c.urlParams_.Set("width", fmt.Sprint(width))
  42148. return c
  42149. }
  42150. // Fields allows partial responses to be retrieved. See
  42151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42152. // for more information.
  42153. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  42154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42155. return c
  42156. }
  42157. // IfNoneMatch sets the optional parameter which makes the operation
  42158. // fail if the object's ETag matches the given value. This is useful for
  42159. // getting updates only after the object has changed since the last
  42160. // request. Use googleapi.IsNotModified to check whether the response
  42161. // error from Do is the result of In-None-Match.
  42162. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  42163. c.ifNoneMatch_ = entityTag
  42164. return c
  42165. }
  42166. // Context sets the context to be used in this call's Do method. Any
  42167. // pending HTTP request will be aborted if the provided context is
  42168. // canceled.
  42169. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  42170. c.ctx_ = ctx
  42171. return c
  42172. }
  42173. // Header returns an http.Header that can be modified by the caller to
  42174. // add HTTP headers to the request.
  42175. func (c *SizesListCall) Header() http.Header {
  42176. if c.header_ == nil {
  42177. c.header_ = make(http.Header)
  42178. }
  42179. return c.header_
  42180. }
  42181. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  42182. reqHeaders := make(http.Header)
  42183. for k, v := range c.header_ {
  42184. reqHeaders[k] = v
  42185. }
  42186. reqHeaders.Set("User-Agent", c.s.userAgent())
  42187. if c.ifNoneMatch_ != "" {
  42188. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42189. }
  42190. var body io.Reader = nil
  42191. c.urlParams_.Set("alt", alt)
  42192. c.urlParams_.Set("prettyPrint", "false")
  42193. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  42194. urls += "?" + c.urlParams_.Encode()
  42195. req, err := http.NewRequest("GET", urls, body)
  42196. if err != nil {
  42197. return nil, err
  42198. }
  42199. req.Header = reqHeaders
  42200. googleapi.Expand(req.URL, map[string]string{
  42201. "profileId": strconv.FormatInt(c.profileId, 10),
  42202. })
  42203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42204. }
  42205. // Do executes the "dfareporting.sizes.list" call.
  42206. // Exactly one of *SizesListResponse or error will be non-nil. Any
  42207. // non-2xx status code is an error. Response headers are in either
  42208. // *SizesListResponse.ServerResponse.Header or (if a response was
  42209. // returned at all) in error.(*googleapi.Error).Header. Use
  42210. // googleapi.IsNotModified to check whether the returned error was
  42211. // because http.StatusNotModified was returned.
  42212. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  42213. gensupport.SetOptions(c.urlParams_, opts...)
  42214. res, err := c.doRequest("json")
  42215. if res != nil && res.StatusCode == http.StatusNotModified {
  42216. if res.Body != nil {
  42217. res.Body.Close()
  42218. }
  42219. return nil, &googleapi.Error{
  42220. Code: res.StatusCode,
  42221. Header: res.Header,
  42222. }
  42223. }
  42224. if err != nil {
  42225. return nil, err
  42226. }
  42227. defer googleapi.CloseBody(res)
  42228. if err := googleapi.CheckResponse(res); err != nil {
  42229. return nil, err
  42230. }
  42231. ret := &SizesListResponse{
  42232. ServerResponse: googleapi.ServerResponse{
  42233. Header: res.Header,
  42234. HTTPStatusCode: res.StatusCode,
  42235. },
  42236. }
  42237. target := &ret
  42238. if err := gensupport.DecodeResponse(target, res); err != nil {
  42239. return nil, err
  42240. }
  42241. return ret, nil
  42242. // {
  42243. // "description": "Retrieves a list of sizes, possibly filtered. Retrieved sizes are globally unique and may include values not currently in use by your account. Due to this, the list of sizes returned by this method may differ from the list seen in the Trafficking UI.",
  42244. // "httpMethod": "GET",
  42245. // "id": "dfareporting.sizes.list",
  42246. // "parameterOrder": [
  42247. // "profileId"
  42248. // ],
  42249. // "parameters": {
  42250. // "height": {
  42251. // "description": "Select only sizes with this height.",
  42252. // "format": "int32",
  42253. // "location": "query",
  42254. // "maximum": "32767",
  42255. // "minimum": "0",
  42256. // "type": "integer"
  42257. // },
  42258. // "iabStandard": {
  42259. // "description": "Select only IAB standard sizes.",
  42260. // "location": "query",
  42261. // "type": "boolean"
  42262. // },
  42263. // "ids": {
  42264. // "description": "Select only sizes with these IDs.",
  42265. // "format": "int64",
  42266. // "location": "query",
  42267. // "repeated": true,
  42268. // "type": "string"
  42269. // },
  42270. // "profileId": {
  42271. // "description": "User profile ID associated with this request.",
  42272. // "format": "int64",
  42273. // "location": "path",
  42274. // "required": true,
  42275. // "type": "string"
  42276. // },
  42277. // "width": {
  42278. // "description": "Select only sizes with this width.",
  42279. // "format": "int32",
  42280. // "location": "query",
  42281. // "maximum": "32767",
  42282. // "minimum": "0",
  42283. // "type": "integer"
  42284. // }
  42285. // },
  42286. // "path": "userprofiles/{profileId}/sizes",
  42287. // "response": {
  42288. // "$ref": "SizesListResponse"
  42289. // },
  42290. // "scopes": [
  42291. // "https://www.googleapis.com/auth/dfatrafficking"
  42292. // ]
  42293. // }
  42294. }
  42295. // method id "dfareporting.subaccounts.get":
  42296. type SubaccountsGetCall struct {
  42297. s *Service
  42298. profileId int64
  42299. id int64
  42300. urlParams_ gensupport.URLParams
  42301. ifNoneMatch_ string
  42302. ctx_ context.Context
  42303. header_ http.Header
  42304. }
  42305. // Get: Gets one subaccount by ID.
  42306. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  42307. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42308. c.profileId = profileId
  42309. c.id = id
  42310. return c
  42311. }
  42312. // Fields allows partial responses to be retrieved. See
  42313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42314. // for more information.
  42315. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  42316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42317. return c
  42318. }
  42319. // IfNoneMatch sets the optional parameter which makes the operation
  42320. // fail if the object's ETag matches the given value. This is useful for
  42321. // getting updates only after the object has changed since the last
  42322. // request. Use googleapi.IsNotModified to check whether the response
  42323. // error from Do is the result of In-None-Match.
  42324. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  42325. c.ifNoneMatch_ = entityTag
  42326. return c
  42327. }
  42328. // Context sets the context to be used in this call's Do method. Any
  42329. // pending HTTP request will be aborted if the provided context is
  42330. // canceled.
  42331. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  42332. c.ctx_ = ctx
  42333. return c
  42334. }
  42335. // Header returns an http.Header that can be modified by the caller to
  42336. // add HTTP headers to the request.
  42337. func (c *SubaccountsGetCall) Header() http.Header {
  42338. if c.header_ == nil {
  42339. c.header_ = make(http.Header)
  42340. }
  42341. return c.header_
  42342. }
  42343. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  42344. reqHeaders := make(http.Header)
  42345. for k, v := range c.header_ {
  42346. reqHeaders[k] = v
  42347. }
  42348. reqHeaders.Set("User-Agent", c.s.userAgent())
  42349. if c.ifNoneMatch_ != "" {
  42350. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42351. }
  42352. var body io.Reader = nil
  42353. c.urlParams_.Set("alt", alt)
  42354. c.urlParams_.Set("prettyPrint", "false")
  42355. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  42356. urls += "?" + c.urlParams_.Encode()
  42357. req, err := http.NewRequest("GET", urls, body)
  42358. if err != nil {
  42359. return nil, err
  42360. }
  42361. req.Header = reqHeaders
  42362. googleapi.Expand(req.URL, map[string]string{
  42363. "profileId": strconv.FormatInt(c.profileId, 10),
  42364. "id": strconv.FormatInt(c.id, 10),
  42365. })
  42366. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42367. }
  42368. // Do executes the "dfareporting.subaccounts.get" call.
  42369. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42370. // status code is an error. Response headers are in either
  42371. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42372. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42373. // to check whether the returned error was because
  42374. // http.StatusNotModified was returned.
  42375. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42376. gensupport.SetOptions(c.urlParams_, opts...)
  42377. res, err := c.doRequest("json")
  42378. if res != nil && res.StatusCode == http.StatusNotModified {
  42379. if res.Body != nil {
  42380. res.Body.Close()
  42381. }
  42382. return nil, &googleapi.Error{
  42383. Code: res.StatusCode,
  42384. Header: res.Header,
  42385. }
  42386. }
  42387. if err != nil {
  42388. return nil, err
  42389. }
  42390. defer googleapi.CloseBody(res)
  42391. if err := googleapi.CheckResponse(res); err != nil {
  42392. return nil, err
  42393. }
  42394. ret := &Subaccount{
  42395. ServerResponse: googleapi.ServerResponse{
  42396. Header: res.Header,
  42397. HTTPStatusCode: res.StatusCode,
  42398. },
  42399. }
  42400. target := &ret
  42401. if err := gensupport.DecodeResponse(target, res); err != nil {
  42402. return nil, err
  42403. }
  42404. return ret, nil
  42405. // {
  42406. // "description": "Gets one subaccount by ID.",
  42407. // "httpMethod": "GET",
  42408. // "id": "dfareporting.subaccounts.get",
  42409. // "parameterOrder": [
  42410. // "profileId",
  42411. // "id"
  42412. // ],
  42413. // "parameters": {
  42414. // "id": {
  42415. // "description": "Subaccount ID.",
  42416. // "format": "int64",
  42417. // "location": "path",
  42418. // "required": true,
  42419. // "type": "string"
  42420. // },
  42421. // "profileId": {
  42422. // "description": "User profile ID associated with this request.",
  42423. // "format": "int64",
  42424. // "location": "path",
  42425. // "required": true,
  42426. // "type": "string"
  42427. // }
  42428. // },
  42429. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  42430. // "response": {
  42431. // "$ref": "Subaccount"
  42432. // },
  42433. // "scopes": [
  42434. // "https://www.googleapis.com/auth/dfatrafficking"
  42435. // ]
  42436. // }
  42437. }
  42438. // method id "dfareporting.subaccounts.insert":
  42439. type SubaccountsInsertCall struct {
  42440. s *Service
  42441. profileId int64
  42442. subaccount *Subaccount
  42443. urlParams_ gensupport.URLParams
  42444. ctx_ context.Context
  42445. header_ http.Header
  42446. }
  42447. // Insert: Inserts a new subaccount.
  42448. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  42449. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42450. c.profileId = profileId
  42451. c.subaccount = subaccount
  42452. return c
  42453. }
  42454. // Fields allows partial responses to be retrieved. See
  42455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42456. // for more information.
  42457. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  42458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42459. return c
  42460. }
  42461. // Context sets the context to be used in this call's Do method. Any
  42462. // pending HTTP request will be aborted if the provided context is
  42463. // canceled.
  42464. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  42465. c.ctx_ = ctx
  42466. return c
  42467. }
  42468. // Header returns an http.Header that can be modified by the caller to
  42469. // add HTTP headers to the request.
  42470. func (c *SubaccountsInsertCall) Header() http.Header {
  42471. if c.header_ == nil {
  42472. c.header_ = make(http.Header)
  42473. }
  42474. return c.header_
  42475. }
  42476. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  42477. reqHeaders := make(http.Header)
  42478. for k, v := range c.header_ {
  42479. reqHeaders[k] = v
  42480. }
  42481. reqHeaders.Set("User-Agent", c.s.userAgent())
  42482. var body io.Reader = nil
  42483. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42484. if err != nil {
  42485. return nil, err
  42486. }
  42487. reqHeaders.Set("Content-Type", "application/json")
  42488. c.urlParams_.Set("alt", alt)
  42489. c.urlParams_.Set("prettyPrint", "false")
  42490. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42491. urls += "?" + c.urlParams_.Encode()
  42492. req, err := http.NewRequest("POST", urls, body)
  42493. if err != nil {
  42494. return nil, err
  42495. }
  42496. req.Header = reqHeaders
  42497. googleapi.Expand(req.URL, map[string]string{
  42498. "profileId": strconv.FormatInt(c.profileId, 10),
  42499. })
  42500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42501. }
  42502. // Do executes the "dfareporting.subaccounts.insert" call.
  42503. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42504. // status code is an error. Response headers are in either
  42505. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42506. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42507. // to check whether the returned error was because
  42508. // http.StatusNotModified was returned.
  42509. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42510. gensupport.SetOptions(c.urlParams_, opts...)
  42511. res, err := c.doRequest("json")
  42512. if res != nil && res.StatusCode == http.StatusNotModified {
  42513. if res.Body != nil {
  42514. res.Body.Close()
  42515. }
  42516. return nil, &googleapi.Error{
  42517. Code: res.StatusCode,
  42518. Header: res.Header,
  42519. }
  42520. }
  42521. if err != nil {
  42522. return nil, err
  42523. }
  42524. defer googleapi.CloseBody(res)
  42525. if err := googleapi.CheckResponse(res); err != nil {
  42526. return nil, err
  42527. }
  42528. ret := &Subaccount{
  42529. ServerResponse: googleapi.ServerResponse{
  42530. Header: res.Header,
  42531. HTTPStatusCode: res.StatusCode,
  42532. },
  42533. }
  42534. target := &ret
  42535. if err := gensupport.DecodeResponse(target, res); err != nil {
  42536. return nil, err
  42537. }
  42538. return ret, nil
  42539. // {
  42540. // "description": "Inserts a new subaccount.",
  42541. // "httpMethod": "POST",
  42542. // "id": "dfareporting.subaccounts.insert",
  42543. // "parameterOrder": [
  42544. // "profileId"
  42545. // ],
  42546. // "parameters": {
  42547. // "profileId": {
  42548. // "description": "User profile ID associated with this request.",
  42549. // "format": "int64",
  42550. // "location": "path",
  42551. // "required": true,
  42552. // "type": "string"
  42553. // }
  42554. // },
  42555. // "path": "userprofiles/{profileId}/subaccounts",
  42556. // "request": {
  42557. // "$ref": "Subaccount"
  42558. // },
  42559. // "response": {
  42560. // "$ref": "Subaccount"
  42561. // },
  42562. // "scopes": [
  42563. // "https://www.googleapis.com/auth/dfatrafficking"
  42564. // ]
  42565. // }
  42566. }
  42567. // method id "dfareporting.subaccounts.list":
  42568. type SubaccountsListCall struct {
  42569. s *Service
  42570. profileId int64
  42571. urlParams_ gensupport.URLParams
  42572. ifNoneMatch_ string
  42573. ctx_ context.Context
  42574. header_ http.Header
  42575. }
  42576. // List: Gets a list of subaccounts, possibly filtered. This method
  42577. // supports paging.
  42578. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  42579. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42580. c.profileId = profileId
  42581. return c
  42582. }
  42583. // Ids sets the optional parameter "ids": Select only subaccounts with
  42584. // these IDs.
  42585. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  42586. var ids_ []string
  42587. for _, v := range ids {
  42588. ids_ = append(ids_, fmt.Sprint(v))
  42589. }
  42590. c.urlParams_.SetMulti("ids", ids_)
  42591. return c
  42592. }
  42593. // MaxResults sets the optional parameter "maxResults": Maximum number
  42594. // of results to return.
  42595. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  42596. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42597. return c
  42598. }
  42599. // PageToken sets the optional parameter "pageToken": Value of the
  42600. // nextPageToken from the previous result page.
  42601. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  42602. c.urlParams_.Set("pageToken", pageToken)
  42603. return c
  42604. }
  42605. // SearchString sets the optional parameter "searchString": Allows
  42606. // searching for objects by name or ID. Wildcards (*) are allowed. For
  42607. // example, "subaccount*2015" will return objects with names like
  42608. // "subaccount June 2015", "subaccount April 2015", or simply
  42609. // "subaccount 2015". Most of the searches also add wildcards implicitly
  42610. // at the start and the end of the search string. For example, a search
  42611. // string of "subaccount" will match objects with name "my subaccount",
  42612. // "subaccount 2015", or simply "subaccount".
  42613. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  42614. c.urlParams_.Set("searchString", searchString)
  42615. return c
  42616. }
  42617. // SortField sets the optional parameter "sortField": Field by which to
  42618. // sort the list.
  42619. //
  42620. // Possible values:
  42621. // "ID" (default)
  42622. // "NAME"
  42623. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  42624. c.urlParams_.Set("sortField", sortField)
  42625. return c
  42626. }
  42627. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42628. // results.
  42629. //
  42630. // Possible values:
  42631. // "ASCENDING" (default)
  42632. // "DESCENDING"
  42633. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  42634. c.urlParams_.Set("sortOrder", sortOrder)
  42635. return c
  42636. }
  42637. // Fields allows partial responses to be retrieved. See
  42638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42639. // for more information.
  42640. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  42641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42642. return c
  42643. }
  42644. // IfNoneMatch sets the optional parameter which makes the operation
  42645. // fail if the object's ETag matches the given value. This is useful for
  42646. // getting updates only after the object has changed since the last
  42647. // request. Use googleapi.IsNotModified to check whether the response
  42648. // error from Do is the result of In-None-Match.
  42649. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  42650. c.ifNoneMatch_ = entityTag
  42651. return c
  42652. }
  42653. // Context sets the context to be used in this call's Do method. Any
  42654. // pending HTTP request will be aborted if the provided context is
  42655. // canceled.
  42656. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  42657. c.ctx_ = ctx
  42658. return c
  42659. }
  42660. // Header returns an http.Header that can be modified by the caller to
  42661. // add HTTP headers to the request.
  42662. func (c *SubaccountsListCall) Header() http.Header {
  42663. if c.header_ == nil {
  42664. c.header_ = make(http.Header)
  42665. }
  42666. return c.header_
  42667. }
  42668. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  42669. reqHeaders := make(http.Header)
  42670. for k, v := range c.header_ {
  42671. reqHeaders[k] = v
  42672. }
  42673. reqHeaders.Set("User-Agent", c.s.userAgent())
  42674. if c.ifNoneMatch_ != "" {
  42675. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42676. }
  42677. var body io.Reader = nil
  42678. c.urlParams_.Set("alt", alt)
  42679. c.urlParams_.Set("prettyPrint", "false")
  42680. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42681. urls += "?" + c.urlParams_.Encode()
  42682. req, err := http.NewRequest("GET", urls, body)
  42683. if err != nil {
  42684. return nil, err
  42685. }
  42686. req.Header = reqHeaders
  42687. googleapi.Expand(req.URL, map[string]string{
  42688. "profileId": strconv.FormatInt(c.profileId, 10),
  42689. })
  42690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42691. }
  42692. // Do executes the "dfareporting.subaccounts.list" call.
  42693. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  42694. // non-2xx status code is an error. Response headers are in either
  42695. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  42696. // returned at all) in error.(*googleapi.Error).Header. Use
  42697. // googleapi.IsNotModified to check whether the returned error was
  42698. // because http.StatusNotModified was returned.
  42699. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  42700. gensupport.SetOptions(c.urlParams_, opts...)
  42701. res, err := c.doRequest("json")
  42702. if res != nil && res.StatusCode == http.StatusNotModified {
  42703. if res.Body != nil {
  42704. res.Body.Close()
  42705. }
  42706. return nil, &googleapi.Error{
  42707. Code: res.StatusCode,
  42708. Header: res.Header,
  42709. }
  42710. }
  42711. if err != nil {
  42712. return nil, err
  42713. }
  42714. defer googleapi.CloseBody(res)
  42715. if err := googleapi.CheckResponse(res); err != nil {
  42716. return nil, err
  42717. }
  42718. ret := &SubaccountsListResponse{
  42719. ServerResponse: googleapi.ServerResponse{
  42720. Header: res.Header,
  42721. HTTPStatusCode: res.StatusCode,
  42722. },
  42723. }
  42724. target := &ret
  42725. if err := gensupport.DecodeResponse(target, res); err != nil {
  42726. return nil, err
  42727. }
  42728. return ret, nil
  42729. // {
  42730. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  42731. // "httpMethod": "GET",
  42732. // "id": "dfareporting.subaccounts.list",
  42733. // "parameterOrder": [
  42734. // "profileId"
  42735. // ],
  42736. // "parameters": {
  42737. // "ids": {
  42738. // "description": "Select only subaccounts with these IDs.",
  42739. // "format": "int64",
  42740. // "location": "query",
  42741. // "repeated": true,
  42742. // "type": "string"
  42743. // },
  42744. // "maxResults": {
  42745. // "default": "1000",
  42746. // "description": "Maximum number of results to return.",
  42747. // "format": "int32",
  42748. // "location": "query",
  42749. // "maximum": "1000",
  42750. // "minimum": "0",
  42751. // "type": "integer"
  42752. // },
  42753. // "pageToken": {
  42754. // "description": "Value of the nextPageToken from the previous result page.",
  42755. // "location": "query",
  42756. // "type": "string"
  42757. // },
  42758. // "profileId": {
  42759. // "description": "User profile ID associated with this request.",
  42760. // "format": "int64",
  42761. // "location": "path",
  42762. // "required": true,
  42763. // "type": "string"
  42764. // },
  42765. // "searchString": {
  42766. // "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\".",
  42767. // "location": "query",
  42768. // "type": "string"
  42769. // },
  42770. // "sortField": {
  42771. // "default": "ID",
  42772. // "description": "Field by which to sort the list.",
  42773. // "enum": [
  42774. // "ID",
  42775. // "NAME"
  42776. // ],
  42777. // "enumDescriptions": [
  42778. // "",
  42779. // ""
  42780. // ],
  42781. // "location": "query",
  42782. // "type": "string"
  42783. // },
  42784. // "sortOrder": {
  42785. // "default": "ASCENDING",
  42786. // "description": "Order of sorted results.",
  42787. // "enum": [
  42788. // "ASCENDING",
  42789. // "DESCENDING"
  42790. // ],
  42791. // "enumDescriptions": [
  42792. // "",
  42793. // ""
  42794. // ],
  42795. // "location": "query",
  42796. // "type": "string"
  42797. // }
  42798. // },
  42799. // "path": "userprofiles/{profileId}/subaccounts",
  42800. // "response": {
  42801. // "$ref": "SubaccountsListResponse"
  42802. // },
  42803. // "scopes": [
  42804. // "https://www.googleapis.com/auth/dfatrafficking"
  42805. // ]
  42806. // }
  42807. }
  42808. // Pages invokes f for each page of results.
  42809. // A non-nil error returned from f will halt the iteration.
  42810. // The provided context supersedes any context provided to the Context method.
  42811. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  42812. c.ctx_ = ctx
  42813. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42814. for {
  42815. x, err := c.Do()
  42816. if err != nil {
  42817. return err
  42818. }
  42819. if err := f(x); err != nil {
  42820. return err
  42821. }
  42822. if x.NextPageToken == "" {
  42823. return nil
  42824. }
  42825. c.PageToken(x.NextPageToken)
  42826. }
  42827. }
  42828. // method id "dfareporting.subaccounts.patch":
  42829. type SubaccountsPatchCall struct {
  42830. s *Service
  42831. profileId int64
  42832. subaccount *Subaccount
  42833. urlParams_ gensupport.URLParams
  42834. ctx_ context.Context
  42835. header_ http.Header
  42836. }
  42837. // Patch: Updates an existing subaccount. This method supports patch
  42838. // semantics.
  42839. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  42840. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42841. c.profileId = profileId
  42842. c.urlParams_.Set("id", fmt.Sprint(id))
  42843. c.subaccount = subaccount
  42844. return c
  42845. }
  42846. // Fields allows partial responses to be retrieved. See
  42847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42848. // for more information.
  42849. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  42850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42851. return c
  42852. }
  42853. // Context sets the context to be used in this call's Do method. Any
  42854. // pending HTTP request will be aborted if the provided context is
  42855. // canceled.
  42856. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  42857. c.ctx_ = ctx
  42858. return c
  42859. }
  42860. // Header returns an http.Header that can be modified by the caller to
  42861. // add HTTP headers to the request.
  42862. func (c *SubaccountsPatchCall) Header() http.Header {
  42863. if c.header_ == nil {
  42864. c.header_ = make(http.Header)
  42865. }
  42866. return c.header_
  42867. }
  42868. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  42869. reqHeaders := make(http.Header)
  42870. for k, v := range c.header_ {
  42871. reqHeaders[k] = v
  42872. }
  42873. reqHeaders.Set("User-Agent", c.s.userAgent())
  42874. var body io.Reader = nil
  42875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42876. if err != nil {
  42877. return nil, err
  42878. }
  42879. reqHeaders.Set("Content-Type", "application/json")
  42880. c.urlParams_.Set("alt", alt)
  42881. c.urlParams_.Set("prettyPrint", "false")
  42882. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42883. urls += "?" + c.urlParams_.Encode()
  42884. req, err := http.NewRequest("PATCH", urls, body)
  42885. if err != nil {
  42886. return nil, err
  42887. }
  42888. req.Header = reqHeaders
  42889. googleapi.Expand(req.URL, map[string]string{
  42890. "profileId": strconv.FormatInt(c.profileId, 10),
  42891. })
  42892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42893. }
  42894. // Do executes the "dfareporting.subaccounts.patch" call.
  42895. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42896. // status code is an error. Response headers are in either
  42897. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42899. // to check whether the returned error was because
  42900. // http.StatusNotModified was returned.
  42901. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42902. gensupport.SetOptions(c.urlParams_, opts...)
  42903. res, err := c.doRequest("json")
  42904. if res != nil && res.StatusCode == http.StatusNotModified {
  42905. if res.Body != nil {
  42906. res.Body.Close()
  42907. }
  42908. return nil, &googleapi.Error{
  42909. Code: res.StatusCode,
  42910. Header: res.Header,
  42911. }
  42912. }
  42913. if err != nil {
  42914. return nil, err
  42915. }
  42916. defer googleapi.CloseBody(res)
  42917. if err := googleapi.CheckResponse(res); err != nil {
  42918. return nil, err
  42919. }
  42920. ret := &Subaccount{
  42921. ServerResponse: googleapi.ServerResponse{
  42922. Header: res.Header,
  42923. HTTPStatusCode: res.StatusCode,
  42924. },
  42925. }
  42926. target := &ret
  42927. if err := gensupport.DecodeResponse(target, res); err != nil {
  42928. return nil, err
  42929. }
  42930. return ret, nil
  42931. // {
  42932. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  42933. // "httpMethod": "PATCH",
  42934. // "id": "dfareporting.subaccounts.patch",
  42935. // "parameterOrder": [
  42936. // "profileId",
  42937. // "id"
  42938. // ],
  42939. // "parameters": {
  42940. // "id": {
  42941. // "description": "Subaccount ID.",
  42942. // "format": "int64",
  42943. // "location": "query",
  42944. // "required": true,
  42945. // "type": "string"
  42946. // },
  42947. // "profileId": {
  42948. // "description": "User profile ID associated with this request.",
  42949. // "format": "int64",
  42950. // "location": "path",
  42951. // "required": true,
  42952. // "type": "string"
  42953. // }
  42954. // },
  42955. // "path": "userprofiles/{profileId}/subaccounts",
  42956. // "request": {
  42957. // "$ref": "Subaccount"
  42958. // },
  42959. // "response": {
  42960. // "$ref": "Subaccount"
  42961. // },
  42962. // "scopes": [
  42963. // "https://www.googleapis.com/auth/dfatrafficking"
  42964. // ]
  42965. // }
  42966. }
  42967. // method id "dfareporting.subaccounts.update":
  42968. type SubaccountsUpdateCall struct {
  42969. s *Service
  42970. profileId int64
  42971. subaccount *Subaccount
  42972. urlParams_ gensupport.URLParams
  42973. ctx_ context.Context
  42974. header_ http.Header
  42975. }
  42976. // Update: Updates an existing subaccount.
  42977. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  42978. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42979. c.profileId = profileId
  42980. c.subaccount = subaccount
  42981. return c
  42982. }
  42983. // Fields allows partial responses to be retrieved. See
  42984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42985. // for more information.
  42986. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  42987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42988. return c
  42989. }
  42990. // Context sets the context to be used in this call's Do method. Any
  42991. // pending HTTP request will be aborted if the provided context is
  42992. // canceled.
  42993. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  42994. c.ctx_ = ctx
  42995. return c
  42996. }
  42997. // Header returns an http.Header that can be modified by the caller to
  42998. // add HTTP headers to the request.
  42999. func (c *SubaccountsUpdateCall) Header() http.Header {
  43000. if c.header_ == nil {
  43001. c.header_ = make(http.Header)
  43002. }
  43003. return c.header_
  43004. }
  43005. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  43006. reqHeaders := make(http.Header)
  43007. for k, v := range c.header_ {
  43008. reqHeaders[k] = v
  43009. }
  43010. reqHeaders.Set("User-Agent", c.s.userAgent())
  43011. var body io.Reader = nil
  43012. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  43013. if err != nil {
  43014. return nil, err
  43015. }
  43016. reqHeaders.Set("Content-Type", "application/json")
  43017. c.urlParams_.Set("alt", alt)
  43018. c.urlParams_.Set("prettyPrint", "false")
  43019. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43020. urls += "?" + c.urlParams_.Encode()
  43021. req, err := http.NewRequest("PUT", urls, body)
  43022. if err != nil {
  43023. return nil, err
  43024. }
  43025. req.Header = reqHeaders
  43026. googleapi.Expand(req.URL, map[string]string{
  43027. "profileId": strconv.FormatInt(c.profileId, 10),
  43028. })
  43029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43030. }
  43031. // Do executes the "dfareporting.subaccounts.update" call.
  43032. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  43033. // status code is an error. Response headers are in either
  43034. // *Subaccount.ServerResponse.Header or (if a response was returned at
  43035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43036. // to check whether the returned error was because
  43037. // http.StatusNotModified was returned.
  43038. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  43039. gensupport.SetOptions(c.urlParams_, opts...)
  43040. res, err := c.doRequest("json")
  43041. if res != nil && res.StatusCode == http.StatusNotModified {
  43042. if res.Body != nil {
  43043. res.Body.Close()
  43044. }
  43045. return nil, &googleapi.Error{
  43046. Code: res.StatusCode,
  43047. Header: res.Header,
  43048. }
  43049. }
  43050. if err != nil {
  43051. return nil, err
  43052. }
  43053. defer googleapi.CloseBody(res)
  43054. if err := googleapi.CheckResponse(res); err != nil {
  43055. return nil, err
  43056. }
  43057. ret := &Subaccount{
  43058. ServerResponse: googleapi.ServerResponse{
  43059. Header: res.Header,
  43060. HTTPStatusCode: res.StatusCode,
  43061. },
  43062. }
  43063. target := &ret
  43064. if err := gensupport.DecodeResponse(target, res); err != nil {
  43065. return nil, err
  43066. }
  43067. return ret, nil
  43068. // {
  43069. // "description": "Updates an existing subaccount.",
  43070. // "httpMethod": "PUT",
  43071. // "id": "dfareporting.subaccounts.update",
  43072. // "parameterOrder": [
  43073. // "profileId"
  43074. // ],
  43075. // "parameters": {
  43076. // "profileId": {
  43077. // "description": "User profile ID associated with this request.",
  43078. // "format": "int64",
  43079. // "location": "path",
  43080. // "required": true,
  43081. // "type": "string"
  43082. // }
  43083. // },
  43084. // "path": "userprofiles/{profileId}/subaccounts",
  43085. // "request": {
  43086. // "$ref": "Subaccount"
  43087. // },
  43088. // "response": {
  43089. // "$ref": "Subaccount"
  43090. // },
  43091. // "scopes": [
  43092. // "https://www.googleapis.com/auth/dfatrafficking"
  43093. // ]
  43094. // }
  43095. }
  43096. // method id "dfareporting.targetableRemarketingLists.get":
  43097. type TargetableRemarketingListsGetCall struct {
  43098. s *Service
  43099. profileId int64
  43100. id int64
  43101. urlParams_ gensupport.URLParams
  43102. ifNoneMatch_ string
  43103. ctx_ context.Context
  43104. header_ http.Header
  43105. }
  43106. // Get: Gets one remarketing list by ID.
  43107. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  43108. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43109. c.profileId = profileId
  43110. c.id = id
  43111. return c
  43112. }
  43113. // Fields allows partial responses to be retrieved. See
  43114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43115. // for more information.
  43116. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  43117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43118. return c
  43119. }
  43120. // IfNoneMatch sets the optional parameter which makes the operation
  43121. // fail if the object's ETag matches the given value. This is useful for
  43122. // getting updates only after the object has changed since the last
  43123. // request. Use googleapi.IsNotModified to check whether the response
  43124. // error from Do is the result of In-None-Match.
  43125. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  43126. c.ifNoneMatch_ = entityTag
  43127. return c
  43128. }
  43129. // Context sets the context to be used in this call's Do method. Any
  43130. // pending HTTP request will be aborted if the provided context is
  43131. // canceled.
  43132. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  43133. c.ctx_ = ctx
  43134. return c
  43135. }
  43136. // Header returns an http.Header that can be modified by the caller to
  43137. // add HTTP headers to the request.
  43138. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  43139. if c.header_ == nil {
  43140. c.header_ = make(http.Header)
  43141. }
  43142. return c.header_
  43143. }
  43144. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  43145. reqHeaders := make(http.Header)
  43146. for k, v := range c.header_ {
  43147. reqHeaders[k] = v
  43148. }
  43149. reqHeaders.Set("User-Agent", c.s.userAgent())
  43150. if c.ifNoneMatch_ != "" {
  43151. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43152. }
  43153. var body io.Reader = nil
  43154. c.urlParams_.Set("alt", alt)
  43155. c.urlParams_.Set("prettyPrint", "false")
  43156. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  43157. urls += "?" + c.urlParams_.Encode()
  43158. req, err := http.NewRequest("GET", urls, body)
  43159. if err != nil {
  43160. return nil, err
  43161. }
  43162. req.Header = reqHeaders
  43163. googleapi.Expand(req.URL, map[string]string{
  43164. "profileId": strconv.FormatInt(c.profileId, 10),
  43165. "id": strconv.FormatInt(c.id, 10),
  43166. })
  43167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43168. }
  43169. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  43170. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  43171. // Any non-2xx status code is an error. Response headers are in either
  43172. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  43173. // was returned at all) in error.(*googleapi.Error).Header. Use
  43174. // googleapi.IsNotModified to check whether the returned error was
  43175. // because http.StatusNotModified was returned.
  43176. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  43177. gensupport.SetOptions(c.urlParams_, opts...)
  43178. res, err := c.doRequest("json")
  43179. if res != nil && res.StatusCode == http.StatusNotModified {
  43180. if res.Body != nil {
  43181. res.Body.Close()
  43182. }
  43183. return nil, &googleapi.Error{
  43184. Code: res.StatusCode,
  43185. Header: res.Header,
  43186. }
  43187. }
  43188. if err != nil {
  43189. return nil, err
  43190. }
  43191. defer googleapi.CloseBody(res)
  43192. if err := googleapi.CheckResponse(res); err != nil {
  43193. return nil, err
  43194. }
  43195. ret := &TargetableRemarketingList{
  43196. ServerResponse: googleapi.ServerResponse{
  43197. Header: res.Header,
  43198. HTTPStatusCode: res.StatusCode,
  43199. },
  43200. }
  43201. target := &ret
  43202. if err := gensupport.DecodeResponse(target, res); err != nil {
  43203. return nil, err
  43204. }
  43205. return ret, nil
  43206. // {
  43207. // "description": "Gets one remarketing list by ID.",
  43208. // "httpMethod": "GET",
  43209. // "id": "dfareporting.targetableRemarketingLists.get",
  43210. // "parameterOrder": [
  43211. // "profileId",
  43212. // "id"
  43213. // ],
  43214. // "parameters": {
  43215. // "id": {
  43216. // "description": "Remarketing list ID.",
  43217. // "format": "int64",
  43218. // "location": "path",
  43219. // "required": true,
  43220. // "type": "string"
  43221. // },
  43222. // "profileId": {
  43223. // "description": "User profile ID associated with this request.",
  43224. // "format": "int64",
  43225. // "location": "path",
  43226. // "required": true,
  43227. // "type": "string"
  43228. // }
  43229. // },
  43230. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  43231. // "response": {
  43232. // "$ref": "TargetableRemarketingList"
  43233. // },
  43234. // "scopes": [
  43235. // "https://www.googleapis.com/auth/dfatrafficking"
  43236. // ]
  43237. // }
  43238. }
  43239. // method id "dfareporting.targetableRemarketingLists.list":
  43240. type TargetableRemarketingListsListCall struct {
  43241. s *Service
  43242. profileId int64
  43243. urlParams_ gensupport.URLParams
  43244. ifNoneMatch_ string
  43245. ctx_ context.Context
  43246. header_ http.Header
  43247. }
  43248. // List: Retrieves a list of targetable remarketing lists, possibly
  43249. // filtered. This method supports paging.
  43250. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  43251. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43252. c.profileId = profileId
  43253. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43254. return c
  43255. }
  43256. // Active sets the optional parameter "active": Select only active or
  43257. // only inactive targetable remarketing lists.
  43258. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  43259. c.urlParams_.Set("active", fmt.Sprint(active))
  43260. return c
  43261. }
  43262. // MaxResults sets the optional parameter "maxResults": Maximum number
  43263. // of results to return.
  43264. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  43265. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43266. return c
  43267. }
  43268. // Name sets the optional parameter "name": Allows searching for objects
  43269. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  43270. // list*2015" will return objects with names like "remarketing list June
  43271. // 2015", "remarketing list April 2015", or simply "remarketing list
  43272. // 2015". Most of the searches also add wildcards implicitly at the
  43273. // start and the end of the search string. For example, a search string
  43274. // of "remarketing list" will match objects with name "my remarketing
  43275. // list", "remarketing list 2015", or simply "remarketing list".
  43276. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  43277. c.urlParams_.Set("name", name)
  43278. return c
  43279. }
  43280. // PageToken sets the optional parameter "pageToken": Value of the
  43281. // nextPageToken from the previous result page.
  43282. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  43283. c.urlParams_.Set("pageToken", pageToken)
  43284. return c
  43285. }
  43286. // SortField sets the optional parameter "sortField": Field by which to
  43287. // sort the list.
  43288. //
  43289. // Possible values:
  43290. // "ID" (default)
  43291. // "NAME"
  43292. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  43293. c.urlParams_.Set("sortField", sortField)
  43294. return c
  43295. }
  43296. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43297. // results.
  43298. //
  43299. // Possible values:
  43300. // "ASCENDING" (default)
  43301. // "DESCENDING"
  43302. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  43303. c.urlParams_.Set("sortOrder", sortOrder)
  43304. return c
  43305. }
  43306. // Fields allows partial responses to be retrieved. See
  43307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43308. // for more information.
  43309. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  43310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43311. return c
  43312. }
  43313. // IfNoneMatch sets the optional parameter which makes the operation
  43314. // fail if the object's ETag matches the given value. This is useful for
  43315. // getting updates only after the object has changed since the last
  43316. // request. Use googleapi.IsNotModified to check whether the response
  43317. // error from Do is the result of In-None-Match.
  43318. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  43319. c.ifNoneMatch_ = entityTag
  43320. return c
  43321. }
  43322. // Context sets the context to be used in this call's Do method. Any
  43323. // pending HTTP request will be aborted if the provided context is
  43324. // canceled.
  43325. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  43326. c.ctx_ = ctx
  43327. return c
  43328. }
  43329. // Header returns an http.Header that can be modified by the caller to
  43330. // add HTTP headers to the request.
  43331. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  43332. if c.header_ == nil {
  43333. c.header_ = make(http.Header)
  43334. }
  43335. return c.header_
  43336. }
  43337. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  43338. reqHeaders := make(http.Header)
  43339. for k, v := range c.header_ {
  43340. reqHeaders[k] = v
  43341. }
  43342. reqHeaders.Set("User-Agent", c.s.userAgent())
  43343. if c.ifNoneMatch_ != "" {
  43344. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43345. }
  43346. var body io.Reader = nil
  43347. c.urlParams_.Set("alt", alt)
  43348. c.urlParams_.Set("prettyPrint", "false")
  43349. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  43350. urls += "?" + c.urlParams_.Encode()
  43351. req, err := http.NewRequest("GET", urls, body)
  43352. if err != nil {
  43353. return nil, err
  43354. }
  43355. req.Header = reqHeaders
  43356. googleapi.Expand(req.URL, map[string]string{
  43357. "profileId": strconv.FormatInt(c.profileId, 10),
  43358. })
  43359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43360. }
  43361. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  43362. // Exactly one of *TargetableRemarketingListsListResponse or error will
  43363. // be non-nil. Any non-2xx status code is an error. Response headers are
  43364. // in either
  43365. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  43366. // a response was returned at all) in error.(*googleapi.Error).Header.
  43367. // Use googleapi.IsNotModified to check whether the returned error was
  43368. // because http.StatusNotModified was returned.
  43369. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  43370. gensupport.SetOptions(c.urlParams_, opts...)
  43371. res, err := c.doRequest("json")
  43372. if res != nil && res.StatusCode == http.StatusNotModified {
  43373. if res.Body != nil {
  43374. res.Body.Close()
  43375. }
  43376. return nil, &googleapi.Error{
  43377. Code: res.StatusCode,
  43378. Header: res.Header,
  43379. }
  43380. }
  43381. if err != nil {
  43382. return nil, err
  43383. }
  43384. defer googleapi.CloseBody(res)
  43385. if err := googleapi.CheckResponse(res); err != nil {
  43386. return nil, err
  43387. }
  43388. ret := &TargetableRemarketingListsListResponse{
  43389. ServerResponse: googleapi.ServerResponse{
  43390. Header: res.Header,
  43391. HTTPStatusCode: res.StatusCode,
  43392. },
  43393. }
  43394. target := &ret
  43395. if err := gensupport.DecodeResponse(target, res); err != nil {
  43396. return nil, err
  43397. }
  43398. return ret, nil
  43399. // {
  43400. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  43401. // "httpMethod": "GET",
  43402. // "id": "dfareporting.targetableRemarketingLists.list",
  43403. // "parameterOrder": [
  43404. // "profileId",
  43405. // "advertiserId"
  43406. // ],
  43407. // "parameters": {
  43408. // "active": {
  43409. // "description": "Select only active or only inactive targetable remarketing lists.",
  43410. // "location": "query",
  43411. // "type": "boolean"
  43412. // },
  43413. // "advertiserId": {
  43414. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  43415. // "format": "int64",
  43416. // "location": "query",
  43417. // "required": true,
  43418. // "type": "string"
  43419. // },
  43420. // "maxResults": {
  43421. // "default": "1000",
  43422. // "description": "Maximum number of results to return.",
  43423. // "format": "int32",
  43424. // "location": "query",
  43425. // "maximum": "1000",
  43426. // "minimum": "0",
  43427. // "type": "integer"
  43428. // },
  43429. // "name": {
  43430. // "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\".",
  43431. // "location": "query",
  43432. // "type": "string"
  43433. // },
  43434. // "pageToken": {
  43435. // "description": "Value of the nextPageToken from the previous result page.",
  43436. // "location": "query",
  43437. // "type": "string"
  43438. // },
  43439. // "profileId": {
  43440. // "description": "User profile ID associated with this request.",
  43441. // "format": "int64",
  43442. // "location": "path",
  43443. // "required": true,
  43444. // "type": "string"
  43445. // },
  43446. // "sortField": {
  43447. // "default": "ID",
  43448. // "description": "Field by which to sort the list.",
  43449. // "enum": [
  43450. // "ID",
  43451. // "NAME"
  43452. // ],
  43453. // "enumDescriptions": [
  43454. // "",
  43455. // ""
  43456. // ],
  43457. // "location": "query",
  43458. // "type": "string"
  43459. // },
  43460. // "sortOrder": {
  43461. // "default": "ASCENDING",
  43462. // "description": "Order of sorted results.",
  43463. // "enum": [
  43464. // "ASCENDING",
  43465. // "DESCENDING"
  43466. // ],
  43467. // "enumDescriptions": [
  43468. // "",
  43469. // ""
  43470. // ],
  43471. // "location": "query",
  43472. // "type": "string"
  43473. // }
  43474. // },
  43475. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  43476. // "response": {
  43477. // "$ref": "TargetableRemarketingListsListResponse"
  43478. // },
  43479. // "scopes": [
  43480. // "https://www.googleapis.com/auth/dfatrafficking"
  43481. // ]
  43482. // }
  43483. }
  43484. // Pages invokes f for each page of results.
  43485. // A non-nil error returned from f will halt the iteration.
  43486. // The provided context supersedes any context provided to the Context method.
  43487. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  43488. c.ctx_ = ctx
  43489. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43490. for {
  43491. x, err := c.Do()
  43492. if err != nil {
  43493. return err
  43494. }
  43495. if err := f(x); err != nil {
  43496. return err
  43497. }
  43498. if x.NextPageToken == "" {
  43499. return nil
  43500. }
  43501. c.PageToken(x.NextPageToken)
  43502. }
  43503. }
  43504. // method id "dfareporting.targetingTemplates.get":
  43505. type TargetingTemplatesGetCall struct {
  43506. s *Service
  43507. profileId int64
  43508. id int64
  43509. urlParams_ gensupport.URLParams
  43510. ifNoneMatch_ string
  43511. ctx_ context.Context
  43512. header_ http.Header
  43513. }
  43514. // Get: Gets one targeting template by ID.
  43515. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  43516. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43517. c.profileId = profileId
  43518. c.id = id
  43519. return c
  43520. }
  43521. // Fields allows partial responses to be retrieved. See
  43522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43523. // for more information.
  43524. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  43525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43526. return c
  43527. }
  43528. // IfNoneMatch sets the optional parameter which makes the operation
  43529. // fail if the object's ETag matches the given value. This is useful for
  43530. // getting updates only after the object has changed since the last
  43531. // request. Use googleapi.IsNotModified to check whether the response
  43532. // error from Do is the result of In-None-Match.
  43533. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  43534. c.ifNoneMatch_ = entityTag
  43535. return c
  43536. }
  43537. // Context sets the context to be used in this call's Do method. Any
  43538. // pending HTTP request will be aborted if the provided context is
  43539. // canceled.
  43540. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  43541. c.ctx_ = ctx
  43542. return c
  43543. }
  43544. // Header returns an http.Header that can be modified by the caller to
  43545. // add HTTP headers to the request.
  43546. func (c *TargetingTemplatesGetCall) Header() http.Header {
  43547. if c.header_ == nil {
  43548. c.header_ = make(http.Header)
  43549. }
  43550. return c.header_
  43551. }
  43552. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  43553. reqHeaders := make(http.Header)
  43554. for k, v := range c.header_ {
  43555. reqHeaders[k] = v
  43556. }
  43557. reqHeaders.Set("User-Agent", c.s.userAgent())
  43558. if c.ifNoneMatch_ != "" {
  43559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43560. }
  43561. var body io.Reader = nil
  43562. c.urlParams_.Set("alt", alt)
  43563. c.urlParams_.Set("prettyPrint", "false")
  43564. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  43565. urls += "?" + c.urlParams_.Encode()
  43566. req, err := http.NewRequest("GET", urls, body)
  43567. if err != nil {
  43568. return nil, err
  43569. }
  43570. req.Header = reqHeaders
  43571. googleapi.Expand(req.URL, map[string]string{
  43572. "profileId": strconv.FormatInt(c.profileId, 10),
  43573. "id": strconv.FormatInt(c.id, 10),
  43574. })
  43575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43576. }
  43577. // Do executes the "dfareporting.targetingTemplates.get" call.
  43578. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43579. // non-2xx status code is an error. Response headers are in either
  43580. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43581. // returned at all) in error.(*googleapi.Error).Header. Use
  43582. // googleapi.IsNotModified to check whether the returned error was
  43583. // because http.StatusNotModified was returned.
  43584. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43585. gensupport.SetOptions(c.urlParams_, opts...)
  43586. res, err := c.doRequest("json")
  43587. if res != nil && res.StatusCode == http.StatusNotModified {
  43588. if res.Body != nil {
  43589. res.Body.Close()
  43590. }
  43591. return nil, &googleapi.Error{
  43592. Code: res.StatusCode,
  43593. Header: res.Header,
  43594. }
  43595. }
  43596. if err != nil {
  43597. return nil, err
  43598. }
  43599. defer googleapi.CloseBody(res)
  43600. if err := googleapi.CheckResponse(res); err != nil {
  43601. return nil, err
  43602. }
  43603. ret := &TargetingTemplate{
  43604. ServerResponse: googleapi.ServerResponse{
  43605. Header: res.Header,
  43606. HTTPStatusCode: res.StatusCode,
  43607. },
  43608. }
  43609. target := &ret
  43610. if err := gensupport.DecodeResponse(target, res); err != nil {
  43611. return nil, err
  43612. }
  43613. return ret, nil
  43614. // {
  43615. // "description": "Gets one targeting template by ID.",
  43616. // "httpMethod": "GET",
  43617. // "id": "dfareporting.targetingTemplates.get",
  43618. // "parameterOrder": [
  43619. // "profileId",
  43620. // "id"
  43621. // ],
  43622. // "parameters": {
  43623. // "id": {
  43624. // "description": "Targeting template ID.",
  43625. // "format": "int64",
  43626. // "location": "path",
  43627. // "required": true,
  43628. // "type": "string"
  43629. // },
  43630. // "profileId": {
  43631. // "description": "User profile ID associated with this request.",
  43632. // "format": "int64",
  43633. // "location": "path",
  43634. // "required": true,
  43635. // "type": "string"
  43636. // }
  43637. // },
  43638. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  43639. // "response": {
  43640. // "$ref": "TargetingTemplate"
  43641. // },
  43642. // "scopes": [
  43643. // "https://www.googleapis.com/auth/dfatrafficking"
  43644. // ]
  43645. // }
  43646. }
  43647. // method id "dfareporting.targetingTemplates.insert":
  43648. type TargetingTemplatesInsertCall struct {
  43649. s *Service
  43650. profileId int64
  43651. targetingtemplate *TargetingTemplate
  43652. urlParams_ gensupport.URLParams
  43653. ctx_ context.Context
  43654. header_ http.Header
  43655. }
  43656. // Insert: Inserts a new targeting template.
  43657. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  43658. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43659. c.profileId = profileId
  43660. c.targetingtemplate = targetingtemplate
  43661. return c
  43662. }
  43663. // Fields allows partial responses to be retrieved. See
  43664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43665. // for more information.
  43666. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  43667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43668. return c
  43669. }
  43670. // Context sets the context to be used in this call's Do method. Any
  43671. // pending HTTP request will be aborted if the provided context is
  43672. // canceled.
  43673. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  43674. c.ctx_ = ctx
  43675. return c
  43676. }
  43677. // Header returns an http.Header that can be modified by the caller to
  43678. // add HTTP headers to the request.
  43679. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  43680. if c.header_ == nil {
  43681. c.header_ = make(http.Header)
  43682. }
  43683. return c.header_
  43684. }
  43685. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  43686. reqHeaders := make(http.Header)
  43687. for k, v := range c.header_ {
  43688. reqHeaders[k] = v
  43689. }
  43690. reqHeaders.Set("User-Agent", c.s.userAgent())
  43691. var body io.Reader = nil
  43692. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43693. if err != nil {
  43694. return nil, err
  43695. }
  43696. reqHeaders.Set("Content-Type", "application/json")
  43697. c.urlParams_.Set("alt", alt)
  43698. c.urlParams_.Set("prettyPrint", "false")
  43699. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43700. urls += "?" + c.urlParams_.Encode()
  43701. req, err := http.NewRequest("POST", urls, body)
  43702. if err != nil {
  43703. return nil, err
  43704. }
  43705. req.Header = reqHeaders
  43706. googleapi.Expand(req.URL, map[string]string{
  43707. "profileId": strconv.FormatInt(c.profileId, 10),
  43708. })
  43709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43710. }
  43711. // Do executes the "dfareporting.targetingTemplates.insert" call.
  43712. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43713. // non-2xx status code is an error. Response headers are in either
  43714. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43715. // returned at all) in error.(*googleapi.Error).Header. Use
  43716. // googleapi.IsNotModified to check whether the returned error was
  43717. // because http.StatusNotModified was returned.
  43718. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43719. gensupport.SetOptions(c.urlParams_, opts...)
  43720. res, err := c.doRequest("json")
  43721. if res != nil && res.StatusCode == http.StatusNotModified {
  43722. if res.Body != nil {
  43723. res.Body.Close()
  43724. }
  43725. return nil, &googleapi.Error{
  43726. Code: res.StatusCode,
  43727. Header: res.Header,
  43728. }
  43729. }
  43730. if err != nil {
  43731. return nil, err
  43732. }
  43733. defer googleapi.CloseBody(res)
  43734. if err := googleapi.CheckResponse(res); err != nil {
  43735. return nil, err
  43736. }
  43737. ret := &TargetingTemplate{
  43738. ServerResponse: googleapi.ServerResponse{
  43739. Header: res.Header,
  43740. HTTPStatusCode: res.StatusCode,
  43741. },
  43742. }
  43743. target := &ret
  43744. if err := gensupport.DecodeResponse(target, res); err != nil {
  43745. return nil, err
  43746. }
  43747. return ret, nil
  43748. // {
  43749. // "description": "Inserts a new targeting template.",
  43750. // "httpMethod": "POST",
  43751. // "id": "dfareporting.targetingTemplates.insert",
  43752. // "parameterOrder": [
  43753. // "profileId"
  43754. // ],
  43755. // "parameters": {
  43756. // "profileId": {
  43757. // "description": "User profile ID associated with this request.",
  43758. // "format": "int64",
  43759. // "location": "path",
  43760. // "required": true,
  43761. // "type": "string"
  43762. // }
  43763. // },
  43764. // "path": "userprofiles/{profileId}/targetingTemplates",
  43765. // "request": {
  43766. // "$ref": "TargetingTemplate"
  43767. // },
  43768. // "response": {
  43769. // "$ref": "TargetingTemplate"
  43770. // },
  43771. // "scopes": [
  43772. // "https://www.googleapis.com/auth/dfatrafficking"
  43773. // ]
  43774. // }
  43775. }
  43776. // method id "dfareporting.targetingTemplates.list":
  43777. type TargetingTemplatesListCall struct {
  43778. s *Service
  43779. profileId int64
  43780. urlParams_ gensupport.URLParams
  43781. ifNoneMatch_ string
  43782. ctx_ context.Context
  43783. header_ http.Header
  43784. }
  43785. // List: Retrieves a list of targeting templates, optionally filtered.
  43786. // This method supports paging.
  43787. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  43788. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43789. c.profileId = profileId
  43790. return c
  43791. }
  43792. // AdvertiserId sets the optional parameter "advertiserId": Select only
  43793. // targeting templates with this advertiser ID.
  43794. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  43795. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43796. return c
  43797. }
  43798. // Ids sets the optional parameter "ids": Select only targeting
  43799. // templates with these IDs.
  43800. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  43801. var ids_ []string
  43802. for _, v := range ids {
  43803. ids_ = append(ids_, fmt.Sprint(v))
  43804. }
  43805. c.urlParams_.SetMulti("ids", ids_)
  43806. return c
  43807. }
  43808. // MaxResults sets the optional parameter "maxResults": Maximum number
  43809. // of results to return.
  43810. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  43811. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43812. return c
  43813. }
  43814. // PageToken sets the optional parameter "pageToken": Value of the
  43815. // nextPageToken from the previous result page.
  43816. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  43817. c.urlParams_.Set("pageToken", pageToken)
  43818. return c
  43819. }
  43820. // SearchString sets the optional parameter "searchString": Allows
  43821. // searching for objects by name or ID. Wildcards (*) are allowed. For
  43822. // example, "template*2015" will return objects with names like
  43823. // "template June 2015", "template April 2015", or simply "template
  43824. // 2015". Most of the searches also add wildcards implicitly at the
  43825. // start and the end of the search string. For example, a search string
  43826. // of "template" will match objects with name "my template", "template
  43827. // 2015", or simply "template".
  43828. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  43829. c.urlParams_.Set("searchString", searchString)
  43830. return c
  43831. }
  43832. // SortField sets the optional parameter "sortField": Field by which to
  43833. // sort the list.
  43834. //
  43835. // Possible values:
  43836. // "ID" (default)
  43837. // "NAME"
  43838. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  43839. c.urlParams_.Set("sortField", sortField)
  43840. return c
  43841. }
  43842. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43843. // results.
  43844. //
  43845. // Possible values:
  43846. // "ASCENDING" (default)
  43847. // "DESCENDING"
  43848. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  43849. c.urlParams_.Set("sortOrder", sortOrder)
  43850. return c
  43851. }
  43852. // Fields allows partial responses to be retrieved. See
  43853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43854. // for more information.
  43855. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  43856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43857. return c
  43858. }
  43859. // IfNoneMatch sets the optional parameter which makes the operation
  43860. // fail if the object's ETag matches the given value. This is useful for
  43861. // getting updates only after the object has changed since the last
  43862. // request. Use googleapi.IsNotModified to check whether the response
  43863. // error from Do is the result of In-None-Match.
  43864. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  43865. c.ifNoneMatch_ = entityTag
  43866. return c
  43867. }
  43868. // Context sets the context to be used in this call's Do method. Any
  43869. // pending HTTP request will be aborted if the provided context is
  43870. // canceled.
  43871. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  43872. c.ctx_ = ctx
  43873. return c
  43874. }
  43875. // Header returns an http.Header that can be modified by the caller to
  43876. // add HTTP headers to the request.
  43877. func (c *TargetingTemplatesListCall) Header() http.Header {
  43878. if c.header_ == nil {
  43879. c.header_ = make(http.Header)
  43880. }
  43881. return c.header_
  43882. }
  43883. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  43884. reqHeaders := make(http.Header)
  43885. for k, v := range c.header_ {
  43886. reqHeaders[k] = v
  43887. }
  43888. reqHeaders.Set("User-Agent", c.s.userAgent())
  43889. if c.ifNoneMatch_ != "" {
  43890. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43891. }
  43892. var body io.Reader = nil
  43893. c.urlParams_.Set("alt", alt)
  43894. c.urlParams_.Set("prettyPrint", "false")
  43895. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43896. urls += "?" + c.urlParams_.Encode()
  43897. req, err := http.NewRequest("GET", urls, body)
  43898. if err != nil {
  43899. return nil, err
  43900. }
  43901. req.Header = reqHeaders
  43902. googleapi.Expand(req.URL, map[string]string{
  43903. "profileId": strconv.FormatInt(c.profileId, 10),
  43904. })
  43905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43906. }
  43907. // Do executes the "dfareporting.targetingTemplates.list" call.
  43908. // Exactly one of *TargetingTemplatesListResponse or error will be
  43909. // non-nil. Any non-2xx status code is an error. Response headers are in
  43910. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  43911. // response was returned at all) in error.(*googleapi.Error).Header. Use
  43912. // googleapi.IsNotModified to check whether the returned error was
  43913. // because http.StatusNotModified was returned.
  43914. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  43915. gensupport.SetOptions(c.urlParams_, opts...)
  43916. res, err := c.doRequest("json")
  43917. if res != nil && res.StatusCode == http.StatusNotModified {
  43918. if res.Body != nil {
  43919. res.Body.Close()
  43920. }
  43921. return nil, &googleapi.Error{
  43922. Code: res.StatusCode,
  43923. Header: res.Header,
  43924. }
  43925. }
  43926. if err != nil {
  43927. return nil, err
  43928. }
  43929. defer googleapi.CloseBody(res)
  43930. if err := googleapi.CheckResponse(res); err != nil {
  43931. return nil, err
  43932. }
  43933. ret := &TargetingTemplatesListResponse{
  43934. ServerResponse: googleapi.ServerResponse{
  43935. Header: res.Header,
  43936. HTTPStatusCode: res.StatusCode,
  43937. },
  43938. }
  43939. target := &ret
  43940. if err := gensupport.DecodeResponse(target, res); err != nil {
  43941. return nil, err
  43942. }
  43943. return ret, nil
  43944. // {
  43945. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  43946. // "httpMethod": "GET",
  43947. // "id": "dfareporting.targetingTemplates.list",
  43948. // "parameterOrder": [
  43949. // "profileId"
  43950. // ],
  43951. // "parameters": {
  43952. // "advertiserId": {
  43953. // "description": "Select only targeting templates with this advertiser ID.",
  43954. // "format": "int64",
  43955. // "location": "query",
  43956. // "type": "string"
  43957. // },
  43958. // "ids": {
  43959. // "description": "Select only targeting templates with these IDs.",
  43960. // "format": "int64",
  43961. // "location": "query",
  43962. // "repeated": true,
  43963. // "type": "string"
  43964. // },
  43965. // "maxResults": {
  43966. // "default": "1000",
  43967. // "description": "Maximum number of results to return.",
  43968. // "format": "int32",
  43969. // "location": "query",
  43970. // "maximum": "1000",
  43971. // "minimum": "0",
  43972. // "type": "integer"
  43973. // },
  43974. // "pageToken": {
  43975. // "description": "Value of the nextPageToken from the previous result page.",
  43976. // "location": "query",
  43977. // "type": "string"
  43978. // },
  43979. // "profileId": {
  43980. // "description": "User profile ID associated with this request.",
  43981. // "format": "int64",
  43982. // "location": "path",
  43983. // "required": true,
  43984. // "type": "string"
  43985. // },
  43986. // "searchString": {
  43987. // "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\".",
  43988. // "location": "query",
  43989. // "type": "string"
  43990. // },
  43991. // "sortField": {
  43992. // "default": "ID",
  43993. // "description": "Field by which to sort the list.",
  43994. // "enum": [
  43995. // "ID",
  43996. // "NAME"
  43997. // ],
  43998. // "enumDescriptions": [
  43999. // "",
  44000. // ""
  44001. // ],
  44002. // "location": "query",
  44003. // "type": "string"
  44004. // },
  44005. // "sortOrder": {
  44006. // "default": "ASCENDING",
  44007. // "description": "Order of sorted results.",
  44008. // "enum": [
  44009. // "ASCENDING",
  44010. // "DESCENDING"
  44011. // ],
  44012. // "enumDescriptions": [
  44013. // "",
  44014. // ""
  44015. // ],
  44016. // "location": "query",
  44017. // "type": "string"
  44018. // }
  44019. // },
  44020. // "path": "userprofiles/{profileId}/targetingTemplates",
  44021. // "response": {
  44022. // "$ref": "TargetingTemplatesListResponse"
  44023. // },
  44024. // "scopes": [
  44025. // "https://www.googleapis.com/auth/dfatrafficking"
  44026. // ]
  44027. // }
  44028. }
  44029. // Pages invokes f for each page of results.
  44030. // A non-nil error returned from f will halt the iteration.
  44031. // The provided context supersedes any context provided to the Context method.
  44032. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  44033. c.ctx_ = ctx
  44034. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44035. for {
  44036. x, err := c.Do()
  44037. if err != nil {
  44038. return err
  44039. }
  44040. if err := f(x); err != nil {
  44041. return err
  44042. }
  44043. if x.NextPageToken == "" {
  44044. return nil
  44045. }
  44046. c.PageToken(x.NextPageToken)
  44047. }
  44048. }
  44049. // method id "dfareporting.targetingTemplates.patch":
  44050. type TargetingTemplatesPatchCall struct {
  44051. s *Service
  44052. profileId int64
  44053. targetingtemplate *TargetingTemplate
  44054. urlParams_ gensupport.URLParams
  44055. ctx_ context.Context
  44056. header_ http.Header
  44057. }
  44058. // Patch: Updates an existing targeting template. This method supports
  44059. // patch semantics.
  44060. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  44061. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44062. c.profileId = profileId
  44063. c.urlParams_.Set("id", fmt.Sprint(id))
  44064. c.targetingtemplate = targetingtemplate
  44065. return c
  44066. }
  44067. // Fields allows partial responses to be retrieved. See
  44068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44069. // for more information.
  44070. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  44071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44072. return c
  44073. }
  44074. // Context sets the context to be used in this call's Do method. Any
  44075. // pending HTTP request will be aborted if the provided context is
  44076. // canceled.
  44077. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  44078. c.ctx_ = ctx
  44079. return c
  44080. }
  44081. // Header returns an http.Header that can be modified by the caller to
  44082. // add HTTP headers to the request.
  44083. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  44084. if c.header_ == nil {
  44085. c.header_ = make(http.Header)
  44086. }
  44087. return c.header_
  44088. }
  44089. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  44090. reqHeaders := make(http.Header)
  44091. for k, v := range c.header_ {
  44092. reqHeaders[k] = v
  44093. }
  44094. reqHeaders.Set("User-Agent", c.s.userAgent())
  44095. var body io.Reader = nil
  44096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44097. if err != nil {
  44098. return nil, err
  44099. }
  44100. reqHeaders.Set("Content-Type", "application/json")
  44101. c.urlParams_.Set("alt", alt)
  44102. c.urlParams_.Set("prettyPrint", "false")
  44103. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44104. urls += "?" + c.urlParams_.Encode()
  44105. req, err := http.NewRequest("PATCH", urls, body)
  44106. if err != nil {
  44107. return nil, err
  44108. }
  44109. req.Header = reqHeaders
  44110. googleapi.Expand(req.URL, map[string]string{
  44111. "profileId": strconv.FormatInt(c.profileId, 10),
  44112. })
  44113. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44114. }
  44115. // Do executes the "dfareporting.targetingTemplates.patch" call.
  44116. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44117. // non-2xx status code is an error. Response headers are in either
  44118. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44119. // returned at all) in error.(*googleapi.Error).Header. Use
  44120. // googleapi.IsNotModified to check whether the returned error was
  44121. // because http.StatusNotModified was returned.
  44122. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44123. gensupport.SetOptions(c.urlParams_, opts...)
  44124. res, err := c.doRequest("json")
  44125. if res != nil && res.StatusCode == http.StatusNotModified {
  44126. if res.Body != nil {
  44127. res.Body.Close()
  44128. }
  44129. return nil, &googleapi.Error{
  44130. Code: res.StatusCode,
  44131. Header: res.Header,
  44132. }
  44133. }
  44134. if err != nil {
  44135. return nil, err
  44136. }
  44137. defer googleapi.CloseBody(res)
  44138. if err := googleapi.CheckResponse(res); err != nil {
  44139. return nil, err
  44140. }
  44141. ret := &TargetingTemplate{
  44142. ServerResponse: googleapi.ServerResponse{
  44143. Header: res.Header,
  44144. HTTPStatusCode: res.StatusCode,
  44145. },
  44146. }
  44147. target := &ret
  44148. if err := gensupport.DecodeResponse(target, res); err != nil {
  44149. return nil, err
  44150. }
  44151. return ret, nil
  44152. // {
  44153. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  44154. // "httpMethod": "PATCH",
  44155. // "id": "dfareporting.targetingTemplates.patch",
  44156. // "parameterOrder": [
  44157. // "profileId",
  44158. // "id"
  44159. // ],
  44160. // "parameters": {
  44161. // "id": {
  44162. // "description": "Targeting template ID.",
  44163. // "format": "int64",
  44164. // "location": "query",
  44165. // "required": true,
  44166. // "type": "string"
  44167. // },
  44168. // "profileId": {
  44169. // "description": "User profile ID associated with this request.",
  44170. // "format": "int64",
  44171. // "location": "path",
  44172. // "required": true,
  44173. // "type": "string"
  44174. // }
  44175. // },
  44176. // "path": "userprofiles/{profileId}/targetingTemplates",
  44177. // "request": {
  44178. // "$ref": "TargetingTemplate"
  44179. // },
  44180. // "response": {
  44181. // "$ref": "TargetingTemplate"
  44182. // },
  44183. // "scopes": [
  44184. // "https://www.googleapis.com/auth/dfatrafficking"
  44185. // ]
  44186. // }
  44187. }
  44188. // method id "dfareporting.targetingTemplates.update":
  44189. type TargetingTemplatesUpdateCall struct {
  44190. s *Service
  44191. profileId int64
  44192. targetingtemplate *TargetingTemplate
  44193. urlParams_ gensupport.URLParams
  44194. ctx_ context.Context
  44195. header_ http.Header
  44196. }
  44197. // Update: Updates an existing targeting template.
  44198. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  44199. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44200. c.profileId = profileId
  44201. c.targetingtemplate = targetingtemplate
  44202. return c
  44203. }
  44204. // Fields allows partial responses to be retrieved. See
  44205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44206. // for more information.
  44207. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  44208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44209. return c
  44210. }
  44211. // Context sets the context to be used in this call's Do method. Any
  44212. // pending HTTP request will be aborted if the provided context is
  44213. // canceled.
  44214. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  44215. c.ctx_ = ctx
  44216. return c
  44217. }
  44218. // Header returns an http.Header that can be modified by the caller to
  44219. // add HTTP headers to the request.
  44220. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  44221. if c.header_ == nil {
  44222. c.header_ = make(http.Header)
  44223. }
  44224. return c.header_
  44225. }
  44226. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  44227. reqHeaders := make(http.Header)
  44228. for k, v := range c.header_ {
  44229. reqHeaders[k] = v
  44230. }
  44231. reqHeaders.Set("User-Agent", c.s.userAgent())
  44232. var body io.Reader = nil
  44233. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44234. if err != nil {
  44235. return nil, err
  44236. }
  44237. reqHeaders.Set("Content-Type", "application/json")
  44238. c.urlParams_.Set("alt", alt)
  44239. c.urlParams_.Set("prettyPrint", "false")
  44240. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44241. urls += "?" + c.urlParams_.Encode()
  44242. req, err := http.NewRequest("PUT", urls, body)
  44243. if err != nil {
  44244. return nil, err
  44245. }
  44246. req.Header = reqHeaders
  44247. googleapi.Expand(req.URL, map[string]string{
  44248. "profileId": strconv.FormatInt(c.profileId, 10),
  44249. })
  44250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44251. }
  44252. // Do executes the "dfareporting.targetingTemplates.update" call.
  44253. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44254. // non-2xx status code is an error. Response headers are in either
  44255. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44256. // returned at all) in error.(*googleapi.Error).Header. Use
  44257. // googleapi.IsNotModified to check whether the returned error was
  44258. // because http.StatusNotModified was returned.
  44259. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44260. gensupport.SetOptions(c.urlParams_, opts...)
  44261. res, err := c.doRequest("json")
  44262. if res != nil && res.StatusCode == http.StatusNotModified {
  44263. if res.Body != nil {
  44264. res.Body.Close()
  44265. }
  44266. return nil, &googleapi.Error{
  44267. Code: res.StatusCode,
  44268. Header: res.Header,
  44269. }
  44270. }
  44271. if err != nil {
  44272. return nil, err
  44273. }
  44274. defer googleapi.CloseBody(res)
  44275. if err := googleapi.CheckResponse(res); err != nil {
  44276. return nil, err
  44277. }
  44278. ret := &TargetingTemplate{
  44279. ServerResponse: googleapi.ServerResponse{
  44280. Header: res.Header,
  44281. HTTPStatusCode: res.StatusCode,
  44282. },
  44283. }
  44284. target := &ret
  44285. if err := gensupport.DecodeResponse(target, res); err != nil {
  44286. return nil, err
  44287. }
  44288. return ret, nil
  44289. // {
  44290. // "description": "Updates an existing targeting template.",
  44291. // "httpMethod": "PUT",
  44292. // "id": "dfareporting.targetingTemplates.update",
  44293. // "parameterOrder": [
  44294. // "profileId"
  44295. // ],
  44296. // "parameters": {
  44297. // "profileId": {
  44298. // "description": "User profile ID associated with this request.",
  44299. // "format": "int64",
  44300. // "location": "path",
  44301. // "required": true,
  44302. // "type": "string"
  44303. // }
  44304. // },
  44305. // "path": "userprofiles/{profileId}/targetingTemplates",
  44306. // "request": {
  44307. // "$ref": "TargetingTemplate"
  44308. // },
  44309. // "response": {
  44310. // "$ref": "TargetingTemplate"
  44311. // },
  44312. // "scopes": [
  44313. // "https://www.googleapis.com/auth/dfatrafficking"
  44314. // ]
  44315. // }
  44316. }
  44317. // method id "dfareporting.userProfiles.get":
  44318. type UserProfilesGetCall struct {
  44319. s *Service
  44320. profileId int64
  44321. urlParams_ gensupport.URLParams
  44322. ifNoneMatch_ string
  44323. ctx_ context.Context
  44324. header_ http.Header
  44325. }
  44326. // Get: Gets one user profile by ID.
  44327. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  44328. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44329. c.profileId = profileId
  44330. return c
  44331. }
  44332. // Fields allows partial responses to be retrieved. See
  44333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44334. // for more information.
  44335. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  44336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44337. return c
  44338. }
  44339. // IfNoneMatch sets the optional parameter which makes the operation
  44340. // fail if the object's ETag matches the given value. This is useful for
  44341. // getting updates only after the object has changed since the last
  44342. // request. Use googleapi.IsNotModified to check whether the response
  44343. // error from Do is the result of In-None-Match.
  44344. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  44345. c.ifNoneMatch_ = entityTag
  44346. return c
  44347. }
  44348. // Context sets the context to be used in this call's Do method. Any
  44349. // pending HTTP request will be aborted if the provided context is
  44350. // canceled.
  44351. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  44352. c.ctx_ = ctx
  44353. return c
  44354. }
  44355. // Header returns an http.Header that can be modified by the caller to
  44356. // add HTTP headers to the request.
  44357. func (c *UserProfilesGetCall) Header() http.Header {
  44358. if c.header_ == nil {
  44359. c.header_ = make(http.Header)
  44360. }
  44361. return c.header_
  44362. }
  44363. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  44364. reqHeaders := make(http.Header)
  44365. for k, v := range c.header_ {
  44366. reqHeaders[k] = v
  44367. }
  44368. reqHeaders.Set("User-Agent", c.s.userAgent())
  44369. if c.ifNoneMatch_ != "" {
  44370. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44371. }
  44372. var body io.Reader = nil
  44373. c.urlParams_.Set("alt", alt)
  44374. c.urlParams_.Set("prettyPrint", "false")
  44375. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  44376. urls += "?" + c.urlParams_.Encode()
  44377. req, err := http.NewRequest("GET", urls, body)
  44378. if err != nil {
  44379. return nil, err
  44380. }
  44381. req.Header = reqHeaders
  44382. googleapi.Expand(req.URL, map[string]string{
  44383. "profileId": strconv.FormatInt(c.profileId, 10),
  44384. })
  44385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44386. }
  44387. // Do executes the "dfareporting.userProfiles.get" call.
  44388. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  44389. // status code is an error. Response headers are in either
  44390. // *UserProfile.ServerResponse.Header or (if a response was returned at
  44391. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44392. // to check whether the returned error was because
  44393. // http.StatusNotModified was returned.
  44394. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  44395. gensupport.SetOptions(c.urlParams_, opts...)
  44396. res, err := c.doRequest("json")
  44397. if res != nil && res.StatusCode == http.StatusNotModified {
  44398. if res.Body != nil {
  44399. res.Body.Close()
  44400. }
  44401. return nil, &googleapi.Error{
  44402. Code: res.StatusCode,
  44403. Header: res.Header,
  44404. }
  44405. }
  44406. if err != nil {
  44407. return nil, err
  44408. }
  44409. defer googleapi.CloseBody(res)
  44410. if err := googleapi.CheckResponse(res); err != nil {
  44411. return nil, err
  44412. }
  44413. ret := &UserProfile{
  44414. ServerResponse: googleapi.ServerResponse{
  44415. Header: res.Header,
  44416. HTTPStatusCode: res.StatusCode,
  44417. },
  44418. }
  44419. target := &ret
  44420. if err := gensupport.DecodeResponse(target, res); err != nil {
  44421. return nil, err
  44422. }
  44423. return ret, nil
  44424. // {
  44425. // "description": "Gets one user profile by ID.",
  44426. // "httpMethod": "GET",
  44427. // "id": "dfareporting.userProfiles.get",
  44428. // "parameterOrder": [
  44429. // "profileId"
  44430. // ],
  44431. // "parameters": {
  44432. // "profileId": {
  44433. // "description": "The user profile ID.",
  44434. // "format": "int64",
  44435. // "location": "path",
  44436. // "required": true,
  44437. // "type": "string"
  44438. // }
  44439. // },
  44440. // "path": "userprofiles/{profileId}",
  44441. // "response": {
  44442. // "$ref": "UserProfile"
  44443. // },
  44444. // "scopes": [
  44445. // "https://www.googleapis.com/auth/dfareporting",
  44446. // "https://www.googleapis.com/auth/dfatrafficking"
  44447. // ]
  44448. // }
  44449. }
  44450. // method id "dfareporting.userProfiles.list":
  44451. type UserProfilesListCall struct {
  44452. s *Service
  44453. urlParams_ gensupport.URLParams
  44454. ifNoneMatch_ string
  44455. ctx_ context.Context
  44456. header_ http.Header
  44457. }
  44458. // List: Retrieves list of user profiles for a user.
  44459. func (r *UserProfilesService) List() *UserProfilesListCall {
  44460. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44461. return c
  44462. }
  44463. // Fields allows partial responses to be retrieved. See
  44464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44465. // for more information.
  44466. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  44467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44468. return c
  44469. }
  44470. // IfNoneMatch sets the optional parameter which makes the operation
  44471. // fail if the object's ETag matches the given value. This is useful for
  44472. // getting updates only after the object has changed since the last
  44473. // request. Use googleapi.IsNotModified to check whether the response
  44474. // error from Do is the result of In-None-Match.
  44475. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  44476. c.ifNoneMatch_ = entityTag
  44477. return c
  44478. }
  44479. // Context sets the context to be used in this call's Do method. Any
  44480. // pending HTTP request will be aborted if the provided context is
  44481. // canceled.
  44482. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  44483. c.ctx_ = ctx
  44484. return c
  44485. }
  44486. // Header returns an http.Header that can be modified by the caller to
  44487. // add HTTP headers to the request.
  44488. func (c *UserProfilesListCall) Header() http.Header {
  44489. if c.header_ == nil {
  44490. c.header_ = make(http.Header)
  44491. }
  44492. return c.header_
  44493. }
  44494. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  44495. reqHeaders := make(http.Header)
  44496. for k, v := range c.header_ {
  44497. reqHeaders[k] = v
  44498. }
  44499. reqHeaders.Set("User-Agent", c.s.userAgent())
  44500. if c.ifNoneMatch_ != "" {
  44501. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44502. }
  44503. var body io.Reader = nil
  44504. c.urlParams_.Set("alt", alt)
  44505. c.urlParams_.Set("prettyPrint", "false")
  44506. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  44507. urls += "?" + c.urlParams_.Encode()
  44508. req, err := http.NewRequest("GET", urls, body)
  44509. if err != nil {
  44510. return nil, err
  44511. }
  44512. req.Header = reqHeaders
  44513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44514. }
  44515. // Do executes the "dfareporting.userProfiles.list" call.
  44516. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  44517. // status code is an error. Response headers are in either
  44518. // *UserProfileList.ServerResponse.Header or (if a response was returned
  44519. // at all) in error.(*googleapi.Error).Header. Use
  44520. // googleapi.IsNotModified to check whether the returned error was
  44521. // because http.StatusNotModified was returned.
  44522. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  44523. gensupport.SetOptions(c.urlParams_, opts...)
  44524. res, err := c.doRequest("json")
  44525. if res != nil && res.StatusCode == http.StatusNotModified {
  44526. if res.Body != nil {
  44527. res.Body.Close()
  44528. }
  44529. return nil, &googleapi.Error{
  44530. Code: res.StatusCode,
  44531. Header: res.Header,
  44532. }
  44533. }
  44534. if err != nil {
  44535. return nil, err
  44536. }
  44537. defer googleapi.CloseBody(res)
  44538. if err := googleapi.CheckResponse(res); err != nil {
  44539. return nil, err
  44540. }
  44541. ret := &UserProfileList{
  44542. ServerResponse: googleapi.ServerResponse{
  44543. Header: res.Header,
  44544. HTTPStatusCode: res.StatusCode,
  44545. },
  44546. }
  44547. target := &ret
  44548. if err := gensupport.DecodeResponse(target, res); err != nil {
  44549. return nil, err
  44550. }
  44551. return ret, nil
  44552. // {
  44553. // "description": "Retrieves list of user profiles for a user.",
  44554. // "httpMethod": "GET",
  44555. // "id": "dfareporting.userProfiles.list",
  44556. // "path": "userprofiles",
  44557. // "response": {
  44558. // "$ref": "UserProfileList"
  44559. // },
  44560. // "scopes": [
  44561. // "https://www.googleapis.com/auth/dfareporting",
  44562. // "https://www.googleapis.com/auth/dfatrafficking"
  44563. // ]
  44564. // }
  44565. }
  44566. // method id "dfareporting.userRolePermissionGroups.get":
  44567. type UserRolePermissionGroupsGetCall struct {
  44568. s *Service
  44569. profileId int64
  44570. id int64
  44571. urlParams_ gensupport.URLParams
  44572. ifNoneMatch_ string
  44573. ctx_ context.Context
  44574. header_ http.Header
  44575. }
  44576. // Get: Gets one user role permission group by ID.
  44577. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  44578. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44579. c.profileId = profileId
  44580. c.id = id
  44581. return c
  44582. }
  44583. // Fields allows partial responses to be retrieved. See
  44584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44585. // for more information.
  44586. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  44587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44588. return c
  44589. }
  44590. // IfNoneMatch sets the optional parameter which makes the operation
  44591. // fail if the object's ETag matches the given value. This is useful for
  44592. // getting updates only after the object has changed since the last
  44593. // request. Use googleapi.IsNotModified to check whether the response
  44594. // error from Do is the result of In-None-Match.
  44595. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  44596. c.ifNoneMatch_ = entityTag
  44597. return c
  44598. }
  44599. // Context sets the context to be used in this call's Do method. Any
  44600. // pending HTTP request will be aborted if the provided context is
  44601. // canceled.
  44602. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  44603. c.ctx_ = ctx
  44604. return c
  44605. }
  44606. // Header returns an http.Header that can be modified by the caller to
  44607. // add HTTP headers to the request.
  44608. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  44609. if c.header_ == nil {
  44610. c.header_ = make(http.Header)
  44611. }
  44612. return c.header_
  44613. }
  44614. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  44615. reqHeaders := make(http.Header)
  44616. for k, v := range c.header_ {
  44617. reqHeaders[k] = v
  44618. }
  44619. reqHeaders.Set("User-Agent", c.s.userAgent())
  44620. if c.ifNoneMatch_ != "" {
  44621. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44622. }
  44623. var body io.Reader = nil
  44624. c.urlParams_.Set("alt", alt)
  44625. c.urlParams_.Set("prettyPrint", "false")
  44626. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  44627. urls += "?" + c.urlParams_.Encode()
  44628. req, err := http.NewRequest("GET", urls, body)
  44629. if err != nil {
  44630. return nil, err
  44631. }
  44632. req.Header = reqHeaders
  44633. googleapi.Expand(req.URL, map[string]string{
  44634. "profileId": strconv.FormatInt(c.profileId, 10),
  44635. "id": strconv.FormatInt(c.id, 10),
  44636. })
  44637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44638. }
  44639. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  44640. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  44641. // non-2xx status code is an error. Response headers are in either
  44642. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  44643. // returned at all) in error.(*googleapi.Error).Header. Use
  44644. // googleapi.IsNotModified to check whether the returned error was
  44645. // because http.StatusNotModified was returned.
  44646. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  44647. gensupport.SetOptions(c.urlParams_, opts...)
  44648. res, err := c.doRequest("json")
  44649. if res != nil && res.StatusCode == http.StatusNotModified {
  44650. if res.Body != nil {
  44651. res.Body.Close()
  44652. }
  44653. return nil, &googleapi.Error{
  44654. Code: res.StatusCode,
  44655. Header: res.Header,
  44656. }
  44657. }
  44658. if err != nil {
  44659. return nil, err
  44660. }
  44661. defer googleapi.CloseBody(res)
  44662. if err := googleapi.CheckResponse(res); err != nil {
  44663. return nil, err
  44664. }
  44665. ret := &UserRolePermissionGroup{
  44666. ServerResponse: googleapi.ServerResponse{
  44667. Header: res.Header,
  44668. HTTPStatusCode: res.StatusCode,
  44669. },
  44670. }
  44671. target := &ret
  44672. if err := gensupport.DecodeResponse(target, res); err != nil {
  44673. return nil, err
  44674. }
  44675. return ret, nil
  44676. // {
  44677. // "description": "Gets one user role permission group by ID.",
  44678. // "httpMethod": "GET",
  44679. // "id": "dfareporting.userRolePermissionGroups.get",
  44680. // "parameterOrder": [
  44681. // "profileId",
  44682. // "id"
  44683. // ],
  44684. // "parameters": {
  44685. // "id": {
  44686. // "description": "User role permission group ID.",
  44687. // "format": "int64",
  44688. // "location": "path",
  44689. // "required": true,
  44690. // "type": "string"
  44691. // },
  44692. // "profileId": {
  44693. // "description": "User profile ID associated with this request.",
  44694. // "format": "int64",
  44695. // "location": "path",
  44696. // "required": true,
  44697. // "type": "string"
  44698. // }
  44699. // },
  44700. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  44701. // "response": {
  44702. // "$ref": "UserRolePermissionGroup"
  44703. // },
  44704. // "scopes": [
  44705. // "https://www.googleapis.com/auth/dfatrafficking"
  44706. // ]
  44707. // }
  44708. }
  44709. // method id "dfareporting.userRolePermissionGroups.list":
  44710. type UserRolePermissionGroupsListCall struct {
  44711. s *Service
  44712. profileId int64
  44713. urlParams_ gensupport.URLParams
  44714. ifNoneMatch_ string
  44715. ctx_ context.Context
  44716. header_ http.Header
  44717. }
  44718. // List: Gets a list of all supported user role permission groups.
  44719. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  44720. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44721. c.profileId = profileId
  44722. return c
  44723. }
  44724. // Fields allows partial responses to be retrieved. See
  44725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44726. // for more information.
  44727. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  44728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44729. return c
  44730. }
  44731. // IfNoneMatch sets the optional parameter which makes the operation
  44732. // fail if the object's ETag matches the given value. This is useful for
  44733. // getting updates only after the object has changed since the last
  44734. // request. Use googleapi.IsNotModified to check whether the response
  44735. // error from Do is the result of In-None-Match.
  44736. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  44737. c.ifNoneMatch_ = entityTag
  44738. return c
  44739. }
  44740. // Context sets the context to be used in this call's Do method. Any
  44741. // pending HTTP request will be aborted if the provided context is
  44742. // canceled.
  44743. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  44744. c.ctx_ = ctx
  44745. return c
  44746. }
  44747. // Header returns an http.Header that can be modified by the caller to
  44748. // add HTTP headers to the request.
  44749. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  44750. if c.header_ == nil {
  44751. c.header_ = make(http.Header)
  44752. }
  44753. return c.header_
  44754. }
  44755. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  44756. reqHeaders := make(http.Header)
  44757. for k, v := range c.header_ {
  44758. reqHeaders[k] = v
  44759. }
  44760. reqHeaders.Set("User-Agent", c.s.userAgent())
  44761. if c.ifNoneMatch_ != "" {
  44762. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44763. }
  44764. var body io.Reader = nil
  44765. c.urlParams_.Set("alt", alt)
  44766. c.urlParams_.Set("prettyPrint", "false")
  44767. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  44768. urls += "?" + c.urlParams_.Encode()
  44769. req, err := http.NewRequest("GET", urls, body)
  44770. if err != nil {
  44771. return nil, err
  44772. }
  44773. req.Header = reqHeaders
  44774. googleapi.Expand(req.URL, map[string]string{
  44775. "profileId": strconv.FormatInt(c.profileId, 10),
  44776. })
  44777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44778. }
  44779. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  44780. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  44781. // non-nil. Any non-2xx status code is an error. Response headers are in
  44782. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  44783. // (if a response was returned at all) in
  44784. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  44785. // whether the returned error was because http.StatusNotModified was
  44786. // returned.
  44787. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  44788. gensupport.SetOptions(c.urlParams_, opts...)
  44789. res, err := c.doRequest("json")
  44790. if res != nil && res.StatusCode == http.StatusNotModified {
  44791. if res.Body != nil {
  44792. res.Body.Close()
  44793. }
  44794. return nil, &googleapi.Error{
  44795. Code: res.StatusCode,
  44796. Header: res.Header,
  44797. }
  44798. }
  44799. if err != nil {
  44800. return nil, err
  44801. }
  44802. defer googleapi.CloseBody(res)
  44803. if err := googleapi.CheckResponse(res); err != nil {
  44804. return nil, err
  44805. }
  44806. ret := &UserRolePermissionGroupsListResponse{
  44807. ServerResponse: googleapi.ServerResponse{
  44808. Header: res.Header,
  44809. HTTPStatusCode: res.StatusCode,
  44810. },
  44811. }
  44812. target := &ret
  44813. if err := gensupport.DecodeResponse(target, res); err != nil {
  44814. return nil, err
  44815. }
  44816. return ret, nil
  44817. // {
  44818. // "description": "Gets a list of all supported user role permission groups.",
  44819. // "httpMethod": "GET",
  44820. // "id": "dfareporting.userRolePermissionGroups.list",
  44821. // "parameterOrder": [
  44822. // "profileId"
  44823. // ],
  44824. // "parameters": {
  44825. // "profileId": {
  44826. // "description": "User profile ID associated with this request.",
  44827. // "format": "int64",
  44828. // "location": "path",
  44829. // "required": true,
  44830. // "type": "string"
  44831. // }
  44832. // },
  44833. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  44834. // "response": {
  44835. // "$ref": "UserRolePermissionGroupsListResponse"
  44836. // },
  44837. // "scopes": [
  44838. // "https://www.googleapis.com/auth/dfatrafficking"
  44839. // ]
  44840. // }
  44841. }
  44842. // method id "dfareporting.userRolePermissions.get":
  44843. type UserRolePermissionsGetCall struct {
  44844. s *Service
  44845. profileId int64
  44846. id int64
  44847. urlParams_ gensupport.URLParams
  44848. ifNoneMatch_ string
  44849. ctx_ context.Context
  44850. header_ http.Header
  44851. }
  44852. // Get: Gets one user role permission by ID.
  44853. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  44854. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44855. c.profileId = profileId
  44856. c.id = id
  44857. return c
  44858. }
  44859. // Fields allows partial responses to be retrieved. See
  44860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44861. // for more information.
  44862. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  44863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44864. return c
  44865. }
  44866. // IfNoneMatch sets the optional parameter which makes the operation
  44867. // fail if the object's ETag matches the given value. This is useful for
  44868. // getting updates only after the object has changed since the last
  44869. // request. Use googleapi.IsNotModified to check whether the response
  44870. // error from Do is the result of In-None-Match.
  44871. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  44872. c.ifNoneMatch_ = entityTag
  44873. return c
  44874. }
  44875. // Context sets the context to be used in this call's Do method. Any
  44876. // pending HTTP request will be aborted if the provided context is
  44877. // canceled.
  44878. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  44879. c.ctx_ = ctx
  44880. return c
  44881. }
  44882. // Header returns an http.Header that can be modified by the caller to
  44883. // add HTTP headers to the request.
  44884. func (c *UserRolePermissionsGetCall) Header() http.Header {
  44885. if c.header_ == nil {
  44886. c.header_ = make(http.Header)
  44887. }
  44888. return c.header_
  44889. }
  44890. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  44891. reqHeaders := make(http.Header)
  44892. for k, v := range c.header_ {
  44893. reqHeaders[k] = v
  44894. }
  44895. reqHeaders.Set("User-Agent", c.s.userAgent())
  44896. if c.ifNoneMatch_ != "" {
  44897. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44898. }
  44899. var body io.Reader = nil
  44900. c.urlParams_.Set("alt", alt)
  44901. c.urlParams_.Set("prettyPrint", "false")
  44902. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  44903. urls += "?" + c.urlParams_.Encode()
  44904. req, err := http.NewRequest("GET", urls, body)
  44905. if err != nil {
  44906. return nil, err
  44907. }
  44908. req.Header = reqHeaders
  44909. googleapi.Expand(req.URL, map[string]string{
  44910. "profileId": strconv.FormatInt(c.profileId, 10),
  44911. "id": strconv.FormatInt(c.id, 10),
  44912. })
  44913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44914. }
  44915. // Do executes the "dfareporting.userRolePermissions.get" call.
  44916. // Exactly one of *UserRolePermission or error will be non-nil. Any
  44917. // non-2xx status code is an error. Response headers are in either
  44918. // *UserRolePermission.ServerResponse.Header or (if a response was
  44919. // returned at all) in error.(*googleapi.Error).Header. Use
  44920. // googleapi.IsNotModified to check whether the returned error was
  44921. // because http.StatusNotModified was returned.
  44922. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  44923. gensupport.SetOptions(c.urlParams_, opts...)
  44924. res, err := c.doRequest("json")
  44925. if res != nil && res.StatusCode == http.StatusNotModified {
  44926. if res.Body != nil {
  44927. res.Body.Close()
  44928. }
  44929. return nil, &googleapi.Error{
  44930. Code: res.StatusCode,
  44931. Header: res.Header,
  44932. }
  44933. }
  44934. if err != nil {
  44935. return nil, err
  44936. }
  44937. defer googleapi.CloseBody(res)
  44938. if err := googleapi.CheckResponse(res); err != nil {
  44939. return nil, err
  44940. }
  44941. ret := &UserRolePermission{
  44942. ServerResponse: googleapi.ServerResponse{
  44943. Header: res.Header,
  44944. HTTPStatusCode: res.StatusCode,
  44945. },
  44946. }
  44947. target := &ret
  44948. if err := gensupport.DecodeResponse(target, res); err != nil {
  44949. return nil, err
  44950. }
  44951. return ret, nil
  44952. // {
  44953. // "description": "Gets one user role permission by ID.",
  44954. // "httpMethod": "GET",
  44955. // "id": "dfareporting.userRolePermissions.get",
  44956. // "parameterOrder": [
  44957. // "profileId",
  44958. // "id"
  44959. // ],
  44960. // "parameters": {
  44961. // "id": {
  44962. // "description": "User role permission ID.",
  44963. // "format": "int64",
  44964. // "location": "path",
  44965. // "required": true,
  44966. // "type": "string"
  44967. // },
  44968. // "profileId": {
  44969. // "description": "User profile ID associated with this request.",
  44970. // "format": "int64",
  44971. // "location": "path",
  44972. // "required": true,
  44973. // "type": "string"
  44974. // }
  44975. // },
  44976. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  44977. // "response": {
  44978. // "$ref": "UserRolePermission"
  44979. // },
  44980. // "scopes": [
  44981. // "https://www.googleapis.com/auth/dfatrafficking"
  44982. // ]
  44983. // }
  44984. }
  44985. // method id "dfareporting.userRolePermissions.list":
  44986. type UserRolePermissionsListCall struct {
  44987. s *Service
  44988. profileId int64
  44989. urlParams_ gensupport.URLParams
  44990. ifNoneMatch_ string
  44991. ctx_ context.Context
  44992. header_ http.Header
  44993. }
  44994. // List: Gets a list of user role permissions, possibly filtered.
  44995. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  44996. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44997. c.profileId = profileId
  44998. return c
  44999. }
  45000. // Ids sets the optional parameter "ids": Select only user role
  45001. // permissions with these IDs.
  45002. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  45003. var ids_ []string
  45004. for _, v := range ids {
  45005. ids_ = append(ids_, fmt.Sprint(v))
  45006. }
  45007. c.urlParams_.SetMulti("ids", ids_)
  45008. return c
  45009. }
  45010. // Fields allows partial responses to be retrieved. See
  45011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45012. // for more information.
  45013. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  45014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45015. return c
  45016. }
  45017. // IfNoneMatch sets the optional parameter which makes the operation
  45018. // fail if the object's ETag matches the given value. This is useful for
  45019. // getting updates only after the object has changed since the last
  45020. // request. Use googleapi.IsNotModified to check whether the response
  45021. // error from Do is the result of In-None-Match.
  45022. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  45023. c.ifNoneMatch_ = entityTag
  45024. return c
  45025. }
  45026. // Context sets the context to be used in this call's Do method. Any
  45027. // pending HTTP request will be aborted if the provided context is
  45028. // canceled.
  45029. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  45030. c.ctx_ = ctx
  45031. return c
  45032. }
  45033. // Header returns an http.Header that can be modified by the caller to
  45034. // add HTTP headers to the request.
  45035. func (c *UserRolePermissionsListCall) Header() http.Header {
  45036. if c.header_ == nil {
  45037. c.header_ = make(http.Header)
  45038. }
  45039. return c.header_
  45040. }
  45041. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  45042. reqHeaders := make(http.Header)
  45043. for k, v := range c.header_ {
  45044. reqHeaders[k] = v
  45045. }
  45046. reqHeaders.Set("User-Agent", c.s.userAgent())
  45047. if c.ifNoneMatch_ != "" {
  45048. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45049. }
  45050. var body io.Reader = nil
  45051. c.urlParams_.Set("alt", alt)
  45052. c.urlParams_.Set("prettyPrint", "false")
  45053. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  45054. urls += "?" + c.urlParams_.Encode()
  45055. req, err := http.NewRequest("GET", urls, body)
  45056. if err != nil {
  45057. return nil, err
  45058. }
  45059. req.Header = reqHeaders
  45060. googleapi.Expand(req.URL, map[string]string{
  45061. "profileId": strconv.FormatInt(c.profileId, 10),
  45062. })
  45063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45064. }
  45065. // Do executes the "dfareporting.userRolePermissions.list" call.
  45066. // Exactly one of *UserRolePermissionsListResponse or error will be
  45067. // non-nil. Any non-2xx status code is an error. Response headers are in
  45068. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  45069. // a response was returned at all) in error.(*googleapi.Error).Header.
  45070. // Use googleapi.IsNotModified to check whether the returned error was
  45071. // because http.StatusNotModified was returned.
  45072. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  45073. gensupport.SetOptions(c.urlParams_, opts...)
  45074. res, err := c.doRequest("json")
  45075. if res != nil && res.StatusCode == http.StatusNotModified {
  45076. if res.Body != nil {
  45077. res.Body.Close()
  45078. }
  45079. return nil, &googleapi.Error{
  45080. Code: res.StatusCode,
  45081. Header: res.Header,
  45082. }
  45083. }
  45084. if err != nil {
  45085. return nil, err
  45086. }
  45087. defer googleapi.CloseBody(res)
  45088. if err := googleapi.CheckResponse(res); err != nil {
  45089. return nil, err
  45090. }
  45091. ret := &UserRolePermissionsListResponse{
  45092. ServerResponse: googleapi.ServerResponse{
  45093. Header: res.Header,
  45094. HTTPStatusCode: res.StatusCode,
  45095. },
  45096. }
  45097. target := &ret
  45098. if err := gensupport.DecodeResponse(target, res); err != nil {
  45099. return nil, err
  45100. }
  45101. return ret, nil
  45102. // {
  45103. // "description": "Gets a list of user role permissions, possibly filtered.",
  45104. // "httpMethod": "GET",
  45105. // "id": "dfareporting.userRolePermissions.list",
  45106. // "parameterOrder": [
  45107. // "profileId"
  45108. // ],
  45109. // "parameters": {
  45110. // "ids": {
  45111. // "description": "Select only user role permissions with these IDs.",
  45112. // "format": "int64",
  45113. // "location": "query",
  45114. // "repeated": true,
  45115. // "type": "string"
  45116. // },
  45117. // "profileId": {
  45118. // "description": "User profile ID associated with this request.",
  45119. // "format": "int64",
  45120. // "location": "path",
  45121. // "required": true,
  45122. // "type": "string"
  45123. // }
  45124. // },
  45125. // "path": "userprofiles/{profileId}/userRolePermissions",
  45126. // "response": {
  45127. // "$ref": "UserRolePermissionsListResponse"
  45128. // },
  45129. // "scopes": [
  45130. // "https://www.googleapis.com/auth/dfatrafficking"
  45131. // ]
  45132. // }
  45133. }
  45134. // method id "dfareporting.userRoles.delete":
  45135. type UserRolesDeleteCall struct {
  45136. s *Service
  45137. profileId int64
  45138. id int64
  45139. urlParams_ gensupport.URLParams
  45140. ctx_ context.Context
  45141. header_ http.Header
  45142. }
  45143. // Delete: Deletes an existing user role.
  45144. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  45145. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45146. c.profileId = profileId
  45147. c.id = id
  45148. return c
  45149. }
  45150. // Fields allows partial responses to be retrieved. See
  45151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45152. // for more information.
  45153. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  45154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45155. return c
  45156. }
  45157. // Context sets the context to be used in this call's Do method. Any
  45158. // pending HTTP request will be aborted if the provided context is
  45159. // canceled.
  45160. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  45161. c.ctx_ = ctx
  45162. return c
  45163. }
  45164. // Header returns an http.Header that can be modified by the caller to
  45165. // add HTTP headers to the request.
  45166. func (c *UserRolesDeleteCall) Header() http.Header {
  45167. if c.header_ == nil {
  45168. c.header_ = make(http.Header)
  45169. }
  45170. return c.header_
  45171. }
  45172. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  45173. reqHeaders := make(http.Header)
  45174. for k, v := range c.header_ {
  45175. reqHeaders[k] = v
  45176. }
  45177. reqHeaders.Set("User-Agent", c.s.userAgent())
  45178. var body io.Reader = nil
  45179. c.urlParams_.Set("alt", alt)
  45180. c.urlParams_.Set("prettyPrint", "false")
  45181. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45182. urls += "?" + c.urlParams_.Encode()
  45183. req, err := http.NewRequest("DELETE", urls, body)
  45184. if err != nil {
  45185. return nil, err
  45186. }
  45187. req.Header = reqHeaders
  45188. googleapi.Expand(req.URL, map[string]string{
  45189. "profileId": strconv.FormatInt(c.profileId, 10),
  45190. "id": strconv.FormatInt(c.id, 10),
  45191. })
  45192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45193. }
  45194. // Do executes the "dfareporting.userRoles.delete" call.
  45195. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  45196. gensupport.SetOptions(c.urlParams_, opts...)
  45197. res, err := c.doRequest("json")
  45198. if err != nil {
  45199. return err
  45200. }
  45201. defer googleapi.CloseBody(res)
  45202. if err := googleapi.CheckResponse(res); err != nil {
  45203. return err
  45204. }
  45205. return nil
  45206. // {
  45207. // "description": "Deletes an existing user role.",
  45208. // "httpMethod": "DELETE",
  45209. // "id": "dfareporting.userRoles.delete",
  45210. // "parameterOrder": [
  45211. // "profileId",
  45212. // "id"
  45213. // ],
  45214. // "parameters": {
  45215. // "id": {
  45216. // "description": "User role ID.",
  45217. // "format": "int64",
  45218. // "location": "path",
  45219. // "required": true,
  45220. // "type": "string"
  45221. // },
  45222. // "profileId": {
  45223. // "description": "User profile ID associated with this request.",
  45224. // "format": "int64",
  45225. // "location": "path",
  45226. // "required": true,
  45227. // "type": "string"
  45228. // }
  45229. // },
  45230. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45231. // "scopes": [
  45232. // "https://www.googleapis.com/auth/dfatrafficking"
  45233. // ]
  45234. // }
  45235. }
  45236. // method id "dfareporting.userRoles.get":
  45237. type UserRolesGetCall struct {
  45238. s *Service
  45239. profileId int64
  45240. id int64
  45241. urlParams_ gensupport.URLParams
  45242. ifNoneMatch_ string
  45243. ctx_ context.Context
  45244. header_ http.Header
  45245. }
  45246. // Get: Gets one user role by ID.
  45247. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  45248. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45249. c.profileId = profileId
  45250. c.id = id
  45251. return c
  45252. }
  45253. // Fields allows partial responses to be retrieved. See
  45254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45255. // for more information.
  45256. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  45257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45258. return c
  45259. }
  45260. // IfNoneMatch sets the optional parameter which makes the operation
  45261. // fail if the object's ETag matches the given value. This is useful for
  45262. // getting updates only after the object has changed since the last
  45263. // request. Use googleapi.IsNotModified to check whether the response
  45264. // error from Do is the result of In-None-Match.
  45265. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  45266. c.ifNoneMatch_ = entityTag
  45267. return c
  45268. }
  45269. // Context sets the context to be used in this call's Do method. Any
  45270. // pending HTTP request will be aborted if the provided context is
  45271. // canceled.
  45272. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  45273. c.ctx_ = ctx
  45274. return c
  45275. }
  45276. // Header returns an http.Header that can be modified by the caller to
  45277. // add HTTP headers to the request.
  45278. func (c *UserRolesGetCall) Header() http.Header {
  45279. if c.header_ == nil {
  45280. c.header_ = make(http.Header)
  45281. }
  45282. return c.header_
  45283. }
  45284. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  45285. reqHeaders := make(http.Header)
  45286. for k, v := range c.header_ {
  45287. reqHeaders[k] = v
  45288. }
  45289. reqHeaders.Set("User-Agent", c.s.userAgent())
  45290. if c.ifNoneMatch_ != "" {
  45291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45292. }
  45293. var body io.Reader = nil
  45294. c.urlParams_.Set("alt", alt)
  45295. c.urlParams_.Set("prettyPrint", "false")
  45296. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45297. urls += "?" + c.urlParams_.Encode()
  45298. req, err := http.NewRequest("GET", urls, body)
  45299. if err != nil {
  45300. return nil, err
  45301. }
  45302. req.Header = reqHeaders
  45303. googleapi.Expand(req.URL, map[string]string{
  45304. "profileId": strconv.FormatInt(c.profileId, 10),
  45305. "id": strconv.FormatInt(c.id, 10),
  45306. })
  45307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45308. }
  45309. // Do executes the "dfareporting.userRoles.get" call.
  45310. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45311. // code is an error. Response headers are in either
  45312. // *UserRole.ServerResponse.Header or (if a response was returned at
  45313. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45314. // to check whether the returned error was because
  45315. // http.StatusNotModified was returned.
  45316. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45317. gensupport.SetOptions(c.urlParams_, opts...)
  45318. res, err := c.doRequest("json")
  45319. if res != nil && res.StatusCode == http.StatusNotModified {
  45320. if res.Body != nil {
  45321. res.Body.Close()
  45322. }
  45323. return nil, &googleapi.Error{
  45324. Code: res.StatusCode,
  45325. Header: res.Header,
  45326. }
  45327. }
  45328. if err != nil {
  45329. return nil, err
  45330. }
  45331. defer googleapi.CloseBody(res)
  45332. if err := googleapi.CheckResponse(res); err != nil {
  45333. return nil, err
  45334. }
  45335. ret := &UserRole{
  45336. ServerResponse: googleapi.ServerResponse{
  45337. Header: res.Header,
  45338. HTTPStatusCode: res.StatusCode,
  45339. },
  45340. }
  45341. target := &ret
  45342. if err := gensupport.DecodeResponse(target, res); err != nil {
  45343. return nil, err
  45344. }
  45345. return ret, nil
  45346. // {
  45347. // "description": "Gets one user role by ID.",
  45348. // "httpMethod": "GET",
  45349. // "id": "dfareporting.userRoles.get",
  45350. // "parameterOrder": [
  45351. // "profileId",
  45352. // "id"
  45353. // ],
  45354. // "parameters": {
  45355. // "id": {
  45356. // "description": "User role ID.",
  45357. // "format": "int64",
  45358. // "location": "path",
  45359. // "required": true,
  45360. // "type": "string"
  45361. // },
  45362. // "profileId": {
  45363. // "description": "User profile ID associated with this request.",
  45364. // "format": "int64",
  45365. // "location": "path",
  45366. // "required": true,
  45367. // "type": "string"
  45368. // }
  45369. // },
  45370. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45371. // "response": {
  45372. // "$ref": "UserRole"
  45373. // },
  45374. // "scopes": [
  45375. // "https://www.googleapis.com/auth/dfatrafficking"
  45376. // ]
  45377. // }
  45378. }
  45379. // method id "dfareporting.userRoles.insert":
  45380. type UserRolesInsertCall struct {
  45381. s *Service
  45382. profileId int64
  45383. userrole *UserRole
  45384. urlParams_ gensupport.URLParams
  45385. ctx_ context.Context
  45386. header_ http.Header
  45387. }
  45388. // Insert: Inserts a new user role.
  45389. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  45390. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45391. c.profileId = profileId
  45392. c.userrole = userrole
  45393. return c
  45394. }
  45395. // Fields allows partial responses to be retrieved. See
  45396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45397. // for more information.
  45398. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  45399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45400. return c
  45401. }
  45402. // Context sets the context to be used in this call's Do method. Any
  45403. // pending HTTP request will be aborted if the provided context is
  45404. // canceled.
  45405. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  45406. c.ctx_ = ctx
  45407. return c
  45408. }
  45409. // Header returns an http.Header that can be modified by the caller to
  45410. // add HTTP headers to the request.
  45411. func (c *UserRolesInsertCall) Header() http.Header {
  45412. if c.header_ == nil {
  45413. c.header_ = make(http.Header)
  45414. }
  45415. return c.header_
  45416. }
  45417. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  45418. reqHeaders := make(http.Header)
  45419. for k, v := range c.header_ {
  45420. reqHeaders[k] = v
  45421. }
  45422. reqHeaders.Set("User-Agent", c.s.userAgent())
  45423. var body io.Reader = nil
  45424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45425. if err != nil {
  45426. return nil, err
  45427. }
  45428. reqHeaders.Set("Content-Type", "application/json")
  45429. c.urlParams_.Set("alt", alt)
  45430. c.urlParams_.Set("prettyPrint", "false")
  45431. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45432. urls += "?" + c.urlParams_.Encode()
  45433. req, err := http.NewRequest("POST", urls, body)
  45434. if err != nil {
  45435. return nil, err
  45436. }
  45437. req.Header = reqHeaders
  45438. googleapi.Expand(req.URL, map[string]string{
  45439. "profileId": strconv.FormatInt(c.profileId, 10),
  45440. })
  45441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45442. }
  45443. // Do executes the "dfareporting.userRoles.insert" call.
  45444. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45445. // code is an error. Response headers are in either
  45446. // *UserRole.ServerResponse.Header or (if a response was returned at
  45447. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45448. // to check whether the returned error was because
  45449. // http.StatusNotModified was returned.
  45450. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45451. gensupport.SetOptions(c.urlParams_, opts...)
  45452. res, err := c.doRequest("json")
  45453. if res != nil && res.StatusCode == http.StatusNotModified {
  45454. if res.Body != nil {
  45455. res.Body.Close()
  45456. }
  45457. return nil, &googleapi.Error{
  45458. Code: res.StatusCode,
  45459. Header: res.Header,
  45460. }
  45461. }
  45462. if err != nil {
  45463. return nil, err
  45464. }
  45465. defer googleapi.CloseBody(res)
  45466. if err := googleapi.CheckResponse(res); err != nil {
  45467. return nil, err
  45468. }
  45469. ret := &UserRole{
  45470. ServerResponse: googleapi.ServerResponse{
  45471. Header: res.Header,
  45472. HTTPStatusCode: res.StatusCode,
  45473. },
  45474. }
  45475. target := &ret
  45476. if err := gensupport.DecodeResponse(target, res); err != nil {
  45477. return nil, err
  45478. }
  45479. return ret, nil
  45480. // {
  45481. // "description": "Inserts a new user role.",
  45482. // "httpMethod": "POST",
  45483. // "id": "dfareporting.userRoles.insert",
  45484. // "parameterOrder": [
  45485. // "profileId"
  45486. // ],
  45487. // "parameters": {
  45488. // "profileId": {
  45489. // "description": "User profile ID associated with this request.",
  45490. // "format": "int64",
  45491. // "location": "path",
  45492. // "required": true,
  45493. // "type": "string"
  45494. // }
  45495. // },
  45496. // "path": "userprofiles/{profileId}/userRoles",
  45497. // "request": {
  45498. // "$ref": "UserRole"
  45499. // },
  45500. // "response": {
  45501. // "$ref": "UserRole"
  45502. // },
  45503. // "scopes": [
  45504. // "https://www.googleapis.com/auth/dfatrafficking"
  45505. // ]
  45506. // }
  45507. }
  45508. // method id "dfareporting.userRoles.list":
  45509. type UserRolesListCall struct {
  45510. s *Service
  45511. profileId int64
  45512. urlParams_ gensupport.URLParams
  45513. ifNoneMatch_ string
  45514. ctx_ context.Context
  45515. header_ http.Header
  45516. }
  45517. // List: Retrieves a list of user roles, possibly filtered. This method
  45518. // supports paging.
  45519. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  45520. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45521. c.profileId = profileId
  45522. return c
  45523. }
  45524. // AccountUserRoleOnly sets the optional parameter
  45525. // "accountUserRoleOnly": Select only account level user roles not
  45526. // associated with any specific subaccount.
  45527. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  45528. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  45529. return c
  45530. }
  45531. // Ids sets the optional parameter "ids": Select only user roles with
  45532. // the specified IDs.
  45533. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  45534. var ids_ []string
  45535. for _, v := range ids {
  45536. ids_ = append(ids_, fmt.Sprint(v))
  45537. }
  45538. c.urlParams_.SetMulti("ids", ids_)
  45539. return c
  45540. }
  45541. // MaxResults sets the optional parameter "maxResults": Maximum number
  45542. // of results to return.
  45543. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  45544. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45545. return c
  45546. }
  45547. // PageToken sets the optional parameter "pageToken": Value of the
  45548. // nextPageToken from the previous result page.
  45549. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  45550. c.urlParams_.Set("pageToken", pageToken)
  45551. return c
  45552. }
  45553. // SearchString sets the optional parameter "searchString": Allows
  45554. // searching for objects by name or ID. Wildcards (*) are allowed. For
  45555. // example, "userrole*2015" will return objects with names like
  45556. // "userrole June 2015", "userrole April 2015", or simply "userrole
  45557. // 2015". Most of the searches also add wildcards implicitly at the
  45558. // start and the end of the search string. For example, a search string
  45559. // of "userrole" will match objects with name "my userrole", "userrole
  45560. // 2015", or simply "userrole".
  45561. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  45562. c.urlParams_.Set("searchString", searchString)
  45563. return c
  45564. }
  45565. // SortField sets the optional parameter "sortField": Field by which to
  45566. // sort the list.
  45567. //
  45568. // Possible values:
  45569. // "ID" (default)
  45570. // "NAME"
  45571. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  45572. c.urlParams_.Set("sortField", sortField)
  45573. return c
  45574. }
  45575. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  45576. // results.
  45577. //
  45578. // Possible values:
  45579. // "ASCENDING" (default)
  45580. // "DESCENDING"
  45581. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  45582. c.urlParams_.Set("sortOrder", sortOrder)
  45583. return c
  45584. }
  45585. // SubaccountId sets the optional parameter "subaccountId": Select only
  45586. // user roles that belong to this subaccount.
  45587. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  45588. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  45589. return c
  45590. }
  45591. // Fields allows partial responses to be retrieved. See
  45592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45593. // for more information.
  45594. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  45595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45596. return c
  45597. }
  45598. // IfNoneMatch sets the optional parameter which makes the operation
  45599. // fail if the object's ETag matches the given value. This is useful for
  45600. // getting updates only after the object has changed since the last
  45601. // request. Use googleapi.IsNotModified to check whether the response
  45602. // error from Do is the result of In-None-Match.
  45603. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  45604. c.ifNoneMatch_ = entityTag
  45605. return c
  45606. }
  45607. // Context sets the context to be used in this call's Do method. Any
  45608. // pending HTTP request will be aborted if the provided context is
  45609. // canceled.
  45610. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  45611. c.ctx_ = ctx
  45612. return c
  45613. }
  45614. // Header returns an http.Header that can be modified by the caller to
  45615. // add HTTP headers to the request.
  45616. func (c *UserRolesListCall) Header() http.Header {
  45617. if c.header_ == nil {
  45618. c.header_ = make(http.Header)
  45619. }
  45620. return c.header_
  45621. }
  45622. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  45623. reqHeaders := make(http.Header)
  45624. for k, v := range c.header_ {
  45625. reqHeaders[k] = v
  45626. }
  45627. reqHeaders.Set("User-Agent", c.s.userAgent())
  45628. if c.ifNoneMatch_ != "" {
  45629. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45630. }
  45631. var body io.Reader = nil
  45632. c.urlParams_.Set("alt", alt)
  45633. c.urlParams_.Set("prettyPrint", "false")
  45634. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45635. urls += "?" + c.urlParams_.Encode()
  45636. req, err := http.NewRequest("GET", urls, body)
  45637. if err != nil {
  45638. return nil, err
  45639. }
  45640. req.Header = reqHeaders
  45641. googleapi.Expand(req.URL, map[string]string{
  45642. "profileId": strconv.FormatInt(c.profileId, 10),
  45643. })
  45644. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45645. }
  45646. // Do executes the "dfareporting.userRoles.list" call.
  45647. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  45648. // non-2xx status code is an error. Response headers are in either
  45649. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  45650. // returned at all) in error.(*googleapi.Error).Header. Use
  45651. // googleapi.IsNotModified to check whether the returned error was
  45652. // because http.StatusNotModified was returned.
  45653. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  45654. gensupport.SetOptions(c.urlParams_, opts...)
  45655. res, err := c.doRequest("json")
  45656. if res != nil && res.StatusCode == http.StatusNotModified {
  45657. if res.Body != nil {
  45658. res.Body.Close()
  45659. }
  45660. return nil, &googleapi.Error{
  45661. Code: res.StatusCode,
  45662. Header: res.Header,
  45663. }
  45664. }
  45665. if err != nil {
  45666. return nil, err
  45667. }
  45668. defer googleapi.CloseBody(res)
  45669. if err := googleapi.CheckResponse(res); err != nil {
  45670. return nil, err
  45671. }
  45672. ret := &UserRolesListResponse{
  45673. ServerResponse: googleapi.ServerResponse{
  45674. Header: res.Header,
  45675. HTTPStatusCode: res.StatusCode,
  45676. },
  45677. }
  45678. target := &ret
  45679. if err := gensupport.DecodeResponse(target, res); err != nil {
  45680. return nil, err
  45681. }
  45682. return ret, nil
  45683. // {
  45684. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  45685. // "httpMethod": "GET",
  45686. // "id": "dfareporting.userRoles.list",
  45687. // "parameterOrder": [
  45688. // "profileId"
  45689. // ],
  45690. // "parameters": {
  45691. // "accountUserRoleOnly": {
  45692. // "description": "Select only account level user roles not associated with any specific subaccount.",
  45693. // "location": "query",
  45694. // "type": "boolean"
  45695. // },
  45696. // "ids": {
  45697. // "description": "Select only user roles with the specified IDs.",
  45698. // "format": "int64",
  45699. // "location": "query",
  45700. // "repeated": true,
  45701. // "type": "string"
  45702. // },
  45703. // "maxResults": {
  45704. // "default": "1000",
  45705. // "description": "Maximum number of results to return.",
  45706. // "format": "int32",
  45707. // "location": "query",
  45708. // "maximum": "1000",
  45709. // "minimum": "0",
  45710. // "type": "integer"
  45711. // },
  45712. // "pageToken": {
  45713. // "description": "Value of the nextPageToken from the previous result page.",
  45714. // "location": "query",
  45715. // "type": "string"
  45716. // },
  45717. // "profileId": {
  45718. // "description": "User profile ID associated with this request.",
  45719. // "format": "int64",
  45720. // "location": "path",
  45721. // "required": true,
  45722. // "type": "string"
  45723. // },
  45724. // "searchString": {
  45725. // "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\".",
  45726. // "location": "query",
  45727. // "type": "string"
  45728. // },
  45729. // "sortField": {
  45730. // "default": "ID",
  45731. // "description": "Field by which to sort the list.",
  45732. // "enum": [
  45733. // "ID",
  45734. // "NAME"
  45735. // ],
  45736. // "enumDescriptions": [
  45737. // "",
  45738. // ""
  45739. // ],
  45740. // "location": "query",
  45741. // "type": "string"
  45742. // },
  45743. // "sortOrder": {
  45744. // "default": "ASCENDING",
  45745. // "description": "Order of sorted results.",
  45746. // "enum": [
  45747. // "ASCENDING",
  45748. // "DESCENDING"
  45749. // ],
  45750. // "enumDescriptions": [
  45751. // "",
  45752. // ""
  45753. // ],
  45754. // "location": "query",
  45755. // "type": "string"
  45756. // },
  45757. // "subaccountId": {
  45758. // "description": "Select only user roles that belong to this subaccount.",
  45759. // "format": "int64",
  45760. // "location": "query",
  45761. // "type": "string"
  45762. // }
  45763. // },
  45764. // "path": "userprofiles/{profileId}/userRoles",
  45765. // "response": {
  45766. // "$ref": "UserRolesListResponse"
  45767. // },
  45768. // "scopes": [
  45769. // "https://www.googleapis.com/auth/dfatrafficking"
  45770. // ]
  45771. // }
  45772. }
  45773. // Pages invokes f for each page of results.
  45774. // A non-nil error returned from f will halt the iteration.
  45775. // The provided context supersedes any context provided to the Context method.
  45776. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  45777. c.ctx_ = ctx
  45778. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45779. for {
  45780. x, err := c.Do()
  45781. if err != nil {
  45782. return err
  45783. }
  45784. if err := f(x); err != nil {
  45785. return err
  45786. }
  45787. if x.NextPageToken == "" {
  45788. return nil
  45789. }
  45790. c.PageToken(x.NextPageToken)
  45791. }
  45792. }
  45793. // method id "dfareporting.userRoles.patch":
  45794. type UserRolesPatchCall struct {
  45795. s *Service
  45796. profileId int64
  45797. userrole *UserRole
  45798. urlParams_ gensupport.URLParams
  45799. ctx_ context.Context
  45800. header_ http.Header
  45801. }
  45802. // Patch: Updates an existing user role. This method supports patch
  45803. // semantics.
  45804. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  45805. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45806. c.profileId = profileId
  45807. c.urlParams_.Set("id", fmt.Sprint(id))
  45808. c.userrole = userrole
  45809. return c
  45810. }
  45811. // Fields allows partial responses to be retrieved. See
  45812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45813. // for more information.
  45814. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  45815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45816. return c
  45817. }
  45818. // Context sets the context to be used in this call's Do method. Any
  45819. // pending HTTP request will be aborted if the provided context is
  45820. // canceled.
  45821. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  45822. c.ctx_ = ctx
  45823. return c
  45824. }
  45825. // Header returns an http.Header that can be modified by the caller to
  45826. // add HTTP headers to the request.
  45827. func (c *UserRolesPatchCall) Header() http.Header {
  45828. if c.header_ == nil {
  45829. c.header_ = make(http.Header)
  45830. }
  45831. return c.header_
  45832. }
  45833. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  45834. reqHeaders := make(http.Header)
  45835. for k, v := range c.header_ {
  45836. reqHeaders[k] = v
  45837. }
  45838. reqHeaders.Set("User-Agent", c.s.userAgent())
  45839. var body io.Reader = nil
  45840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45841. if err != nil {
  45842. return nil, err
  45843. }
  45844. reqHeaders.Set("Content-Type", "application/json")
  45845. c.urlParams_.Set("alt", alt)
  45846. c.urlParams_.Set("prettyPrint", "false")
  45847. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45848. urls += "?" + c.urlParams_.Encode()
  45849. req, err := http.NewRequest("PATCH", urls, body)
  45850. if err != nil {
  45851. return nil, err
  45852. }
  45853. req.Header = reqHeaders
  45854. googleapi.Expand(req.URL, map[string]string{
  45855. "profileId": strconv.FormatInt(c.profileId, 10),
  45856. })
  45857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45858. }
  45859. // Do executes the "dfareporting.userRoles.patch" call.
  45860. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45861. // code is an error. Response headers are in either
  45862. // *UserRole.ServerResponse.Header or (if a response was returned at
  45863. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45864. // to check whether the returned error was because
  45865. // http.StatusNotModified was returned.
  45866. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45867. gensupport.SetOptions(c.urlParams_, opts...)
  45868. res, err := c.doRequest("json")
  45869. if res != nil && res.StatusCode == http.StatusNotModified {
  45870. if res.Body != nil {
  45871. res.Body.Close()
  45872. }
  45873. return nil, &googleapi.Error{
  45874. Code: res.StatusCode,
  45875. Header: res.Header,
  45876. }
  45877. }
  45878. if err != nil {
  45879. return nil, err
  45880. }
  45881. defer googleapi.CloseBody(res)
  45882. if err := googleapi.CheckResponse(res); err != nil {
  45883. return nil, err
  45884. }
  45885. ret := &UserRole{
  45886. ServerResponse: googleapi.ServerResponse{
  45887. Header: res.Header,
  45888. HTTPStatusCode: res.StatusCode,
  45889. },
  45890. }
  45891. target := &ret
  45892. if err := gensupport.DecodeResponse(target, res); err != nil {
  45893. return nil, err
  45894. }
  45895. return ret, nil
  45896. // {
  45897. // "description": "Updates an existing user role. This method supports patch semantics.",
  45898. // "httpMethod": "PATCH",
  45899. // "id": "dfareporting.userRoles.patch",
  45900. // "parameterOrder": [
  45901. // "profileId",
  45902. // "id"
  45903. // ],
  45904. // "parameters": {
  45905. // "id": {
  45906. // "description": "User role ID.",
  45907. // "format": "int64",
  45908. // "location": "query",
  45909. // "required": true,
  45910. // "type": "string"
  45911. // },
  45912. // "profileId": {
  45913. // "description": "User profile ID associated with this request.",
  45914. // "format": "int64",
  45915. // "location": "path",
  45916. // "required": true,
  45917. // "type": "string"
  45918. // }
  45919. // },
  45920. // "path": "userprofiles/{profileId}/userRoles",
  45921. // "request": {
  45922. // "$ref": "UserRole"
  45923. // },
  45924. // "response": {
  45925. // "$ref": "UserRole"
  45926. // },
  45927. // "scopes": [
  45928. // "https://www.googleapis.com/auth/dfatrafficking"
  45929. // ]
  45930. // }
  45931. }
  45932. // method id "dfareporting.userRoles.update":
  45933. type UserRolesUpdateCall struct {
  45934. s *Service
  45935. profileId int64
  45936. userrole *UserRole
  45937. urlParams_ gensupport.URLParams
  45938. ctx_ context.Context
  45939. header_ http.Header
  45940. }
  45941. // Update: Updates an existing user role.
  45942. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  45943. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45944. c.profileId = profileId
  45945. c.userrole = userrole
  45946. return c
  45947. }
  45948. // Fields allows partial responses to be retrieved. See
  45949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45950. // for more information.
  45951. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  45952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45953. return c
  45954. }
  45955. // Context sets the context to be used in this call's Do method. Any
  45956. // pending HTTP request will be aborted if the provided context is
  45957. // canceled.
  45958. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  45959. c.ctx_ = ctx
  45960. return c
  45961. }
  45962. // Header returns an http.Header that can be modified by the caller to
  45963. // add HTTP headers to the request.
  45964. func (c *UserRolesUpdateCall) Header() http.Header {
  45965. if c.header_ == nil {
  45966. c.header_ = make(http.Header)
  45967. }
  45968. return c.header_
  45969. }
  45970. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  45971. reqHeaders := make(http.Header)
  45972. for k, v := range c.header_ {
  45973. reqHeaders[k] = v
  45974. }
  45975. reqHeaders.Set("User-Agent", c.s.userAgent())
  45976. var body io.Reader = nil
  45977. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45978. if err != nil {
  45979. return nil, err
  45980. }
  45981. reqHeaders.Set("Content-Type", "application/json")
  45982. c.urlParams_.Set("alt", alt)
  45983. c.urlParams_.Set("prettyPrint", "false")
  45984. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45985. urls += "?" + c.urlParams_.Encode()
  45986. req, err := http.NewRequest("PUT", urls, body)
  45987. if err != nil {
  45988. return nil, err
  45989. }
  45990. req.Header = reqHeaders
  45991. googleapi.Expand(req.URL, map[string]string{
  45992. "profileId": strconv.FormatInt(c.profileId, 10),
  45993. })
  45994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45995. }
  45996. // Do executes the "dfareporting.userRoles.update" call.
  45997. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45998. // code is an error. Response headers are in either
  45999. // *UserRole.ServerResponse.Header or (if a response was returned at
  46000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46001. // to check whether the returned error was because
  46002. // http.StatusNotModified was returned.
  46003. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  46004. gensupport.SetOptions(c.urlParams_, opts...)
  46005. res, err := c.doRequest("json")
  46006. if res != nil && res.StatusCode == http.StatusNotModified {
  46007. if res.Body != nil {
  46008. res.Body.Close()
  46009. }
  46010. return nil, &googleapi.Error{
  46011. Code: res.StatusCode,
  46012. Header: res.Header,
  46013. }
  46014. }
  46015. if err != nil {
  46016. return nil, err
  46017. }
  46018. defer googleapi.CloseBody(res)
  46019. if err := googleapi.CheckResponse(res); err != nil {
  46020. return nil, err
  46021. }
  46022. ret := &UserRole{
  46023. ServerResponse: googleapi.ServerResponse{
  46024. Header: res.Header,
  46025. HTTPStatusCode: res.StatusCode,
  46026. },
  46027. }
  46028. target := &ret
  46029. if err := gensupport.DecodeResponse(target, res); err != nil {
  46030. return nil, err
  46031. }
  46032. return ret, nil
  46033. // {
  46034. // "description": "Updates an existing user role.",
  46035. // "httpMethod": "PUT",
  46036. // "id": "dfareporting.userRoles.update",
  46037. // "parameterOrder": [
  46038. // "profileId"
  46039. // ],
  46040. // "parameters": {
  46041. // "profileId": {
  46042. // "description": "User profile ID associated with this request.",
  46043. // "format": "int64",
  46044. // "location": "path",
  46045. // "required": true,
  46046. // "type": "string"
  46047. // }
  46048. // },
  46049. // "path": "userprofiles/{profileId}/userRoles",
  46050. // "request": {
  46051. // "$ref": "UserRole"
  46052. // },
  46053. // "response": {
  46054. // "$ref": "UserRole"
  46055. // },
  46056. // "scopes": [
  46057. // "https://www.googleapis.com/auth/dfatrafficking"
  46058. // ]
  46059. // }
  46060. }
  46061. // method id "dfareporting.videoFormats.get":
  46062. type VideoFormatsGetCall struct {
  46063. s *Service
  46064. profileId int64
  46065. id int64
  46066. urlParams_ gensupport.URLParams
  46067. ifNoneMatch_ string
  46068. ctx_ context.Context
  46069. header_ http.Header
  46070. }
  46071. // Get: Gets one video format by ID.
  46072. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  46073. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46074. c.profileId = profileId
  46075. c.id = id
  46076. return c
  46077. }
  46078. // Fields allows partial responses to be retrieved. See
  46079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46080. // for more information.
  46081. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  46082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46083. return c
  46084. }
  46085. // IfNoneMatch sets the optional parameter which makes the operation
  46086. // fail if the object's ETag matches the given value. This is useful for
  46087. // getting updates only after the object has changed since the last
  46088. // request. Use googleapi.IsNotModified to check whether the response
  46089. // error from Do is the result of In-None-Match.
  46090. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  46091. c.ifNoneMatch_ = entityTag
  46092. return c
  46093. }
  46094. // Context sets the context to be used in this call's Do method. Any
  46095. // pending HTTP request will be aborted if the provided context is
  46096. // canceled.
  46097. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  46098. c.ctx_ = ctx
  46099. return c
  46100. }
  46101. // Header returns an http.Header that can be modified by the caller to
  46102. // add HTTP headers to the request.
  46103. func (c *VideoFormatsGetCall) Header() http.Header {
  46104. if c.header_ == nil {
  46105. c.header_ = make(http.Header)
  46106. }
  46107. return c.header_
  46108. }
  46109. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  46110. reqHeaders := make(http.Header)
  46111. for k, v := range c.header_ {
  46112. reqHeaders[k] = v
  46113. }
  46114. reqHeaders.Set("User-Agent", c.s.userAgent())
  46115. if c.ifNoneMatch_ != "" {
  46116. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46117. }
  46118. var body io.Reader = nil
  46119. c.urlParams_.Set("alt", alt)
  46120. c.urlParams_.Set("prettyPrint", "false")
  46121. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  46122. urls += "?" + c.urlParams_.Encode()
  46123. req, err := http.NewRequest("GET", urls, body)
  46124. if err != nil {
  46125. return nil, err
  46126. }
  46127. req.Header = reqHeaders
  46128. googleapi.Expand(req.URL, map[string]string{
  46129. "profileId": strconv.FormatInt(c.profileId, 10),
  46130. "id": strconv.FormatInt(c.id, 10),
  46131. })
  46132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46133. }
  46134. // Do executes the "dfareporting.videoFormats.get" call.
  46135. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  46136. // status code is an error. Response headers are in either
  46137. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  46138. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46139. // to check whether the returned error was because
  46140. // http.StatusNotModified was returned.
  46141. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  46142. gensupport.SetOptions(c.urlParams_, opts...)
  46143. res, err := c.doRequest("json")
  46144. if res != nil && res.StatusCode == http.StatusNotModified {
  46145. if res.Body != nil {
  46146. res.Body.Close()
  46147. }
  46148. return nil, &googleapi.Error{
  46149. Code: res.StatusCode,
  46150. Header: res.Header,
  46151. }
  46152. }
  46153. if err != nil {
  46154. return nil, err
  46155. }
  46156. defer googleapi.CloseBody(res)
  46157. if err := googleapi.CheckResponse(res); err != nil {
  46158. return nil, err
  46159. }
  46160. ret := &VideoFormat{
  46161. ServerResponse: googleapi.ServerResponse{
  46162. Header: res.Header,
  46163. HTTPStatusCode: res.StatusCode,
  46164. },
  46165. }
  46166. target := &ret
  46167. if err := gensupport.DecodeResponse(target, res); err != nil {
  46168. return nil, err
  46169. }
  46170. return ret, nil
  46171. // {
  46172. // "description": "Gets one video format by ID.",
  46173. // "httpMethod": "GET",
  46174. // "id": "dfareporting.videoFormats.get",
  46175. // "parameterOrder": [
  46176. // "profileId",
  46177. // "id"
  46178. // ],
  46179. // "parameters": {
  46180. // "id": {
  46181. // "description": "Video format ID.",
  46182. // "format": "int32",
  46183. // "location": "path",
  46184. // "required": true,
  46185. // "type": "integer"
  46186. // },
  46187. // "profileId": {
  46188. // "description": "User profile ID associated with this request.",
  46189. // "format": "int64",
  46190. // "location": "path",
  46191. // "required": true,
  46192. // "type": "string"
  46193. // }
  46194. // },
  46195. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  46196. // "response": {
  46197. // "$ref": "VideoFormat"
  46198. // },
  46199. // "scopes": [
  46200. // "https://www.googleapis.com/auth/dfatrafficking"
  46201. // ]
  46202. // }
  46203. }
  46204. // method id "dfareporting.videoFormats.list":
  46205. type VideoFormatsListCall struct {
  46206. s *Service
  46207. profileId int64
  46208. urlParams_ gensupport.URLParams
  46209. ifNoneMatch_ string
  46210. ctx_ context.Context
  46211. header_ http.Header
  46212. }
  46213. // List: Lists available video formats.
  46214. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  46215. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46216. c.profileId = profileId
  46217. return c
  46218. }
  46219. // Fields allows partial responses to be retrieved. See
  46220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46221. // for more information.
  46222. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  46223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46224. return c
  46225. }
  46226. // IfNoneMatch sets the optional parameter which makes the operation
  46227. // fail if the object's ETag matches the given value. This is useful for
  46228. // getting updates only after the object has changed since the last
  46229. // request. Use googleapi.IsNotModified to check whether the response
  46230. // error from Do is the result of In-None-Match.
  46231. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  46232. c.ifNoneMatch_ = entityTag
  46233. return c
  46234. }
  46235. // Context sets the context to be used in this call's Do method. Any
  46236. // pending HTTP request will be aborted if the provided context is
  46237. // canceled.
  46238. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  46239. c.ctx_ = ctx
  46240. return c
  46241. }
  46242. // Header returns an http.Header that can be modified by the caller to
  46243. // add HTTP headers to the request.
  46244. func (c *VideoFormatsListCall) Header() http.Header {
  46245. if c.header_ == nil {
  46246. c.header_ = make(http.Header)
  46247. }
  46248. return c.header_
  46249. }
  46250. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  46251. reqHeaders := make(http.Header)
  46252. for k, v := range c.header_ {
  46253. reqHeaders[k] = v
  46254. }
  46255. reqHeaders.Set("User-Agent", c.s.userAgent())
  46256. if c.ifNoneMatch_ != "" {
  46257. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46258. }
  46259. var body io.Reader = nil
  46260. c.urlParams_.Set("alt", alt)
  46261. c.urlParams_.Set("prettyPrint", "false")
  46262. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  46263. urls += "?" + c.urlParams_.Encode()
  46264. req, err := http.NewRequest("GET", urls, body)
  46265. if err != nil {
  46266. return nil, err
  46267. }
  46268. req.Header = reqHeaders
  46269. googleapi.Expand(req.URL, map[string]string{
  46270. "profileId": strconv.FormatInt(c.profileId, 10),
  46271. })
  46272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46273. }
  46274. // Do executes the "dfareporting.videoFormats.list" call.
  46275. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  46276. // Any non-2xx status code is an error. Response headers are in either
  46277. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  46278. // returned at all) in error.(*googleapi.Error).Header. Use
  46279. // googleapi.IsNotModified to check whether the returned error was
  46280. // because http.StatusNotModified was returned.
  46281. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  46282. gensupport.SetOptions(c.urlParams_, opts...)
  46283. res, err := c.doRequest("json")
  46284. if res != nil && res.StatusCode == http.StatusNotModified {
  46285. if res.Body != nil {
  46286. res.Body.Close()
  46287. }
  46288. return nil, &googleapi.Error{
  46289. Code: res.StatusCode,
  46290. Header: res.Header,
  46291. }
  46292. }
  46293. if err != nil {
  46294. return nil, err
  46295. }
  46296. defer googleapi.CloseBody(res)
  46297. if err := googleapi.CheckResponse(res); err != nil {
  46298. return nil, err
  46299. }
  46300. ret := &VideoFormatsListResponse{
  46301. ServerResponse: googleapi.ServerResponse{
  46302. Header: res.Header,
  46303. HTTPStatusCode: res.StatusCode,
  46304. },
  46305. }
  46306. target := &ret
  46307. if err := gensupport.DecodeResponse(target, res); err != nil {
  46308. return nil, err
  46309. }
  46310. return ret, nil
  46311. // {
  46312. // "description": "Lists available video formats.",
  46313. // "httpMethod": "GET",
  46314. // "id": "dfareporting.videoFormats.list",
  46315. // "parameterOrder": [
  46316. // "profileId"
  46317. // ],
  46318. // "parameters": {
  46319. // "profileId": {
  46320. // "description": "User profile ID associated with this request.",
  46321. // "format": "int64",
  46322. // "location": "path",
  46323. // "required": true,
  46324. // "type": "string"
  46325. // }
  46326. // },
  46327. // "path": "userprofiles/{profileId}/videoFormats",
  46328. // "response": {
  46329. // "$ref": "VideoFormatsListResponse"
  46330. // },
  46331. // "scopes": [
  46332. // "https://www.googleapis.com/auth/dfatrafficking"
  46333. // ]
  46334. // }
  46335. }