Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

51486 řádky
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.2"
  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.2"
  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.2"
  71. const apiName = "dfareporting"
  72. const apiVersion = "v3.2"
  73. const basePath = "https://www.googleapis.com/dfareporting/v3.2/"
  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.DirectorySiteContacts = NewDirectorySiteContactsService(s)
  141. s.DirectorySites = NewDirectorySitesService(s)
  142. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  143. s.EventTags = NewEventTagsService(s)
  144. s.Files = NewFilesService(s)
  145. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  146. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  147. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  148. s.InventoryItems = NewInventoryItemsService(s)
  149. s.Languages = NewLanguagesService(s)
  150. s.Metros = NewMetrosService(s)
  151. s.MobileApps = NewMobileAppsService(s)
  152. s.MobileCarriers = NewMobileCarriersService(s)
  153. s.OperatingSystemVersions = NewOperatingSystemVersionsService(s)
  154. s.OperatingSystems = NewOperatingSystemsService(s)
  155. s.OrderDocuments = NewOrderDocumentsService(s)
  156. s.Orders = NewOrdersService(s)
  157. s.PlacementGroups = NewPlacementGroupsService(s)
  158. s.PlacementStrategies = NewPlacementStrategiesService(s)
  159. s.Placements = NewPlacementsService(s)
  160. s.PlatformTypes = NewPlatformTypesService(s)
  161. s.PostalCodes = NewPostalCodesService(s)
  162. s.Projects = NewProjectsService(s)
  163. s.Regions = NewRegionsService(s)
  164. s.RemarketingListShares = NewRemarketingListSharesService(s)
  165. s.RemarketingLists = NewRemarketingListsService(s)
  166. s.Reports = NewReportsService(s)
  167. s.Sites = NewSitesService(s)
  168. s.Sizes = NewSizesService(s)
  169. s.Subaccounts = NewSubaccountsService(s)
  170. s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s)
  171. s.TargetingTemplates = NewTargetingTemplatesService(s)
  172. s.UserProfiles = NewUserProfilesService(s)
  173. s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s)
  174. s.UserRolePermissions = NewUserRolePermissionsService(s)
  175. s.UserRoles = NewUserRolesService(s)
  176. s.VideoFormats = NewVideoFormatsService(s)
  177. return s, nil
  178. }
  179. type Service struct {
  180. client *http.Client
  181. BasePath string // API endpoint base URL
  182. UserAgent string // optional additional User-Agent fragment
  183. AccountActiveAdSummaries *AccountActiveAdSummariesService
  184. AccountPermissionGroups *AccountPermissionGroupsService
  185. AccountPermissions *AccountPermissionsService
  186. AccountUserProfiles *AccountUserProfilesService
  187. Accounts *AccountsService
  188. Ads *AdsService
  189. AdvertiserGroups *AdvertiserGroupsService
  190. AdvertiserLandingPages *AdvertiserLandingPagesService
  191. Advertisers *AdvertisersService
  192. Browsers *BrowsersService
  193. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  194. Campaigns *CampaignsService
  195. ChangeLogs *ChangeLogsService
  196. Cities *CitiesService
  197. ConnectionTypes *ConnectionTypesService
  198. ContentCategories *ContentCategoriesService
  199. Conversions *ConversionsService
  200. Countries *CountriesService
  201. CreativeAssets *CreativeAssetsService
  202. CreativeFieldValues *CreativeFieldValuesService
  203. CreativeFields *CreativeFieldsService
  204. CreativeGroups *CreativeGroupsService
  205. Creatives *CreativesService
  206. DimensionValues *DimensionValuesService
  207. DirectorySiteContacts *DirectorySiteContactsService
  208. DirectorySites *DirectorySitesService
  209. DynamicTargetingKeys *DynamicTargetingKeysService
  210. EventTags *EventTagsService
  211. Files *FilesService
  212. FloodlightActivities *FloodlightActivitiesService
  213. FloodlightActivityGroups *FloodlightActivityGroupsService
  214. FloodlightConfigurations *FloodlightConfigurationsService
  215. InventoryItems *InventoryItemsService
  216. Languages *LanguagesService
  217. Metros *MetrosService
  218. MobileApps *MobileAppsService
  219. MobileCarriers *MobileCarriersService
  220. OperatingSystemVersions *OperatingSystemVersionsService
  221. OperatingSystems *OperatingSystemsService
  222. OrderDocuments *OrderDocumentsService
  223. Orders *OrdersService
  224. PlacementGroups *PlacementGroupsService
  225. PlacementStrategies *PlacementStrategiesService
  226. Placements *PlacementsService
  227. PlatformTypes *PlatformTypesService
  228. PostalCodes *PostalCodesService
  229. Projects *ProjectsService
  230. Regions *RegionsService
  231. RemarketingListShares *RemarketingListSharesService
  232. RemarketingLists *RemarketingListsService
  233. Reports *ReportsService
  234. Sites *SitesService
  235. Sizes *SizesService
  236. Subaccounts *SubaccountsService
  237. TargetableRemarketingLists *TargetableRemarketingListsService
  238. TargetingTemplates *TargetingTemplatesService
  239. UserProfiles *UserProfilesService
  240. UserRolePermissionGroups *UserRolePermissionGroupsService
  241. UserRolePermissions *UserRolePermissionsService
  242. UserRoles *UserRolesService
  243. VideoFormats *VideoFormatsService
  244. }
  245. func (s *Service) userAgent() string {
  246. if s.UserAgent == "" {
  247. return googleapi.UserAgent
  248. }
  249. return googleapi.UserAgent + " " + s.UserAgent
  250. }
  251. func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService {
  252. rs := &AccountActiveAdSummariesService{s: s}
  253. return rs
  254. }
  255. type AccountActiveAdSummariesService struct {
  256. s *Service
  257. }
  258. func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService {
  259. rs := &AccountPermissionGroupsService{s: s}
  260. return rs
  261. }
  262. type AccountPermissionGroupsService struct {
  263. s *Service
  264. }
  265. func NewAccountPermissionsService(s *Service) *AccountPermissionsService {
  266. rs := &AccountPermissionsService{s: s}
  267. return rs
  268. }
  269. type AccountPermissionsService struct {
  270. s *Service
  271. }
  272. func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService {
  273. rs := &AccountUserProfilesService{s: s}
  274. return rs
  275. }
  276. type AccountUserProfilesService struct {
  277. s *Service
  278. }
  279. func NewAccountsService(s *Service) *AccountsService {
  280. rs := &AccountsService{s: s}
  281. return rs
  282. }
  283. type AccountsService struct {
  284. s *Service
  285. }
  286. func NewAdsService(s *Service) *AdsService {
  287. rs := &AdsService{s: s}
  288. return rs
  289. }
  290. type AdsService struct {
  291. s *Service
  292. }
  293. func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService {
  294. rs := &AdvertiserGroupsService{s: s}
  295. return rs
  296. }
  297. type AdvertiserGroupsService struct {
  298. s *Service
  299. }
  300. func NewAdvertiserLandingPagesService(s *Service) *AdvertiserLandingPagesService {
  301. rs := &AdvertiserLandingPagesService{s: s}
  302. return rs
  303. }
  304. type AdvertiserLandingPagesService struct {
  305. s *Service
  306. }
  307. func NewAdvertisersService(s *Service) *AdvertisersService {
  308. rs := &AdvertisersService{s: s}
  309. return rs
  310. }
  311. type AdvertisersService struct {
  312. s *Service
  313. }
  314. func NewBrowsersService(s *Service) *BrowsersService {
  315. rs := &BrowsersService{s: s}
  316. return rs
  317. }
  318. type BrowsersService struct {
  319. s *Service
  320. }
  321. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  322. rs := &CampaignCreativeAssociationsService{s: s}
  323. return rs
  324. }
  325. type CampaignCreativeAssociationsService struct {
  326. s *Service
  327. }
  328. func NewCampaignsService(s *Service) *CampaignsService {
  329. rs := &CampaignsService{s: s}
  330. return rs
  331. }
  332. type CampaignsService struct {
  333. s *Service
  334. }
  335. func NewChangeLogsService(s *Service) *ChangeLogsService {
  336. rs := &ChangeLogsService{s: s}
  337. return rs
  338. }
  339. type ChangeLogsService struct {
  340. s *Service
  341. }
  342. func NewCitiesService(s *Service) *CitiesService {
  343. rs := &CitiesService{s: s}
  344. return rs
  345. }
  346. type CitiesService struct {
  347. s *Service
  348. }
  349. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  350. rs := &ConnectionTypesService{s: s}
  351. return rs
  352. }
  353. type ConnectionTypesService struct {
  354. s *Service
  355. }
  356. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  357. rs := &ContentCategoriesService{s: s}
  358. return rs
  359. }
  360. type ContentCategoriesService struct {
  361. s *Service
  362. }
  363. func NewConversionsService(s *Service) *ConversionsService {
  364. rs := &ConversionsService{s: s}
  365. return rs
  366. }
  367. type ConversionsService struct {
  368. s *Service
  369. }
  370. func NewCountriesService(s *Service) *CountriesService {
  371. rs := &CountriesService{s: s}
  372. return rs
  373. }
  374. type CountriesService struct {
  375. s *Service
  376. }
  377. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  378. rs := &CreativeAssetsService{s: s}
  379. return rs
  380. }
  381. type CreativeAssetsService struct {
  382. s *Service
  383. }
  384. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  385. rs := &CreativeFieldValuesService{s: s}
  386. return rs
  387. }
  388. type CreativeFieldValuesService struct {
  389. s *Service
  390. }
  391. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  392. rs := &CreativeFieldsService{s: s}
  393. return rs
  394. }
  395. type CreativeFieldsService struct {
  396. s *Service
  397. }
  398. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  399. rs := &CreativeGroupsService{s: s}
  400. return rs
  401. }
  402. type CreativeGroupsService struct {
  403. s *Service
  404. }
  405. func NewCreativesService(s *Service) *CreativesService {
  406. rs := &CreativesService{s: s}
  407. return rs
  408. }
  409. type CreativesService struct {
  410. s *Service
  411. }
  412. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  413. rs := &DimensionValuesService{s: s}
  414. return rs
  415. }
  416. type DimensionValuesService struct {
  417. s *Service
  418. }
  419. func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService {
  420. rs := &DirectorySiteContactsService{s: s}
  421. return rs
  422. }
  423. type DirectorySiteContactsService struct {
  424. s *Service
  425. }
  426. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  427. rs := &DirectorySitesService{s: s}
  428. return rs
  429. }
  430. type DirectorySitesService struct {
  431. s *Service
  432. }
  433. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  434. rs := &DynamicTargetingKeysService{s: s}
  435. return rs
  436. }
  437. type DynamicTargetingKeysService struct {
  438. s *Service
  439. }
  440. func NewEventTagsService(s *Service) *EventTagsService {
  441. rs := &EventTagsService{s: s}
  442. return rs
  443. }
  444. type EventTagsService struct {
  445. s *Service
  446. }
  447. func NewFilesService(s *Service) *FilesService {
  448. rs := &FilesService{s: s}
  449. return rs
  450. }
  451. type FilesService struct {
  452. s *Service
  453. }
  454. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  455. rs := &FloodlightActivitiesService{s: s}
  456. return rs
  457. }
  458. type FloodlightActivitiesService struct {
  459. s *Service
  460. }
  461. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  462. rs := &FloodlightActivityGroupsService{s: s}
  463. return rs
  464. }
  465. type FloodlightActivityGroupsService struct {
  466. s *Service
  467. }
  468. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  469. rs := &FloodlightConfigurationsService{s: s}
  470. return rs
  471. }
  472. type FloodlightConfigurationsService struct {
  473. s *Service
  474. }
  475. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  476. rs := &InventoryItemsService{s: s}
  477. return rs
  478. }
  479. type InventoryItemsService struct {
  480. s *Service
  481. }
  482. func NewLanguagesService(s *Service) *LanguagesService {
  483. rs := &LanguagesService{s: s}
  484. return rs
  485. }
  486. type LanguagesService struct {
  487. s *Service
  488. }
  489. func NewMetrosService(s *Service) *MetrosService {
  490. rs := &MetrosService{s: s}
  491. return rs
  492. }
  493. type MetrosService struct {
  494. s *Service
  495. }
  496. func NewMobileAppsService(s *Service) *MobileAppsService {
  497. rs := &MobileAppsService{s: s}
  498. return rs
  499. }
  500. type MobileAppsService struct {
  501. s *Service
  502. }
  503. func NewMobileCarriersService(s *Service) *MobileCarriersService {
  504. rs := &MobileCarriersService{s: s}
  505. return rs
  506. }
  507. type MobileCarriersService struct {
  508. s *Service
  509. }
  510. func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService {
  511. rs := &OperatingSystemVersionsService{s: s}
  512. return rs
  513. }
  514. type OperatingSystemVersionsService struct {
  515. s *Service
  516. }
  517. func NewOperatingSystemsService(s *Service) *OperatingSystemsService {
  518. rs := &OperatingSystemsService{s: s}
  519. return rs
  520. }
  521. type OperatingSystemsService struct {
  522. s *Service
  523. }
  524. func NewOrderDocumentsService(s *Service) *OrderDocumentsService {
  525. rs := &OrderDocumentsService{s: s}
  526. return rs
  527. }
  528. type OrderDocumentsService struct {
  529. s *Service
  530. }
  531. func NewOrdersService(s *Service) *OrdersService {
  532. rs := &OrdersService{s: s}
  533. return rs
  534. }
  535. type OrdersService struct {
  536. s *Service
  537. }
  538. func NewPlacementGroupsService(s *Service) *PlacementGroupsService {
  539. rs := &PlacementGroupsService{s: s}
  540. return rs
  541. }
  542. type PlacementGroupsService struct {
  543. s *Service
  544. }
  545. func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService {
  546. rs := &PlacementStrategiesService{s: s}
  547. return rs
  548. }
  549. type PlacementStrategiesService struct {
  550. s *Service
  551. }
  552. func NewPlacementsService(s *Service) *PlacementsService {
  553. rs := &PlacementsService{s: s}
  554. return rs
  555. }
  556. type PlacementsService struct {
  557. s *Service
  558. }
  559. func NewPlatformTypesService(s *Service) *PlatformTypesService {
  560. rs := &PlatformTypesService{s: s}
  561. return rs
  562. }
  563. type PlatformTypesService struct {
  564. s *Service
  565. }
  566. func NewPostalCodesService(s *Service) *PostalCodesService {
  567. rs := &PostalCodesService{s: s}
  568. return rs
  569. }
  570. type PostalCodesService struct {
  571. s *Service
  572. }
  573. func NewProjectsService(s *Service) *ProjectsService {
  574. rs := &ProjectsService{s: s}
  575. return rs
  576. }
  577. type ProjectsService struct {
  578. s *Service
  579. }
  580. func NewRegionsService(s *Service) *RegionsService {
  581. rs := &RegionsService{s: s}
  582. return rs
  583. }
  584. type RegionsService struct {
  585. s *Service
  586. }
  587. func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService {
  588. rs := &RemarketingListSharesService{s: s}
  589. return rs
  590. }
  591. type RemarketingListSharesService struct {
  592. s *Service
  593. }
  594. func NewRemarketingListsService(s *Service) *RemarketingListsService {
  595. rs := &RemarketingListsService{s: s}
  596. return rs
  597. }
  598. type RemarketingListsService struct {
  599. s *Service
  600. }
  601. func NewReportsService(s *Service) *ReportsService {
  602. rs := &ReportsService{s: s}
  603. rs.CompatibleFields = NewReportsCompatibleFieldsService(s)
  604. rs.Files = NewReportsFilesService(s)
  605. return rs
  606. }
  607. type ReportsService struct {
  608. s *Service
  609. CompatibleFields *ReportsCompatibleFieldsService
  610. Files *ReportsFilesService
  611. }
  612. func NewReportsCompatibleFieldsService(s *Service) *ReportsCompatibleFieldsService {
  613. rs := &ReportsCompatibleFieldsService{s: s}
  614. return rs
  615. }
  616. type ReportsCompatibleFieldsService struct {
  617. s *Service
  618. }
  619. func NewReportsFilesService(s *Service) *ReportsFilesService {
  620. rs := &ReportsFilesService{s: s}
  621. return rs
  622. }
  623. type ReportsFilesService struct {
  624. s *Service
  625. }
  626. func NewSitesService(s *Service) *SitesService {
  627. rs := &SitesService{s: s}
  628. return rs
  629. }
  630. type SitesService struct {
  631. s *Service
  632. }
  633. func NewSizesService(s *Service) *SizesService {
  634. rs := &SizesService{s: s}
  635. return rs
  636. }
  637. type SizesService struct {
  638. s *Service
  639. }
  640. func NewSubaccountsService(s *Service) *SubaccountsService {
  641. rs := &SubaccountsService{s: s}
  642. return rs
  643. }
  644. type SubaccountsService struct {
  645. s *Service
  646. }
  647. func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService {
  648. rs := &TargetableRemarketingListsService{s: s}
  649. return rs
  650. }
  651. type TargetableRemarketingListsService struct {
  652. s *Service
  653. }
  654. func NewTargetingTemplatesService(s *Service) *TargetingTemplatesService {
  655. rs := &TargetingTemplatesService{s: s}
  656. return rs
  657. }
  658. type TargetingTemplatesService struct {
  659. s *Service
  660. }
  661. func NewUserProfilesService(s *Service) *UserProfilesService {
  662. rs := &UserProfilesService{s: s}
  663. return rs
  664. }
  665. type UserProfilesService struct {
  666. s *Service
  667. }
  668. func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService {
  669. rs := &UserRolePermissionGroupsService{s: s}
  670. return rs
  671. }
  672. type UserRolePermissionGroupsService struct {
  673. s *Service
  674. }
  675. func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService {
  676. rs := &UserRolePermissionsService{s: s}
  677. return rs
  678. }
  679. type UserRolePermissionsService struct {
  680. s *Service
  681. }
  682. func NewUserRolesService(s *Service) *UserRolesService {
  683. rs := &UserRolesService{s: s}
  684. return rs
  685. }
  686. type UserRolesService struct {
  687. s *Service
  688. }
  689. func NewVideoFormatsService(s *Service) *VideoFormatsService {
  690. rs := &VideoFormatsService{s: s}
  691. return rs
  692. }
  693. type VideoFormatsService struct {
  694. s *Service
  695. }
  696. // Account: Contains properties of a Campaign Manager account.
  697. type Account struct {
  698. // AccountPermissionIds: Account permissions assigned to this account.
  699. AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"`
  700. // AccountProfile: Profile for this account. This is a read-only field
  701. // that can be left blank.
  702. //
  703. // Possible values:
  704. // "ACCOUNT_PROFILE_BASIC"
  705. // "ACCOUNT_PROFILE_STANDARD"
  706. AccountProfile string `json:"accountProfile,omitempty"`
  707. // Active: Whether this account is active.
  708. Active bool `json:"active,omitempty"`
  709. // ActiveAdsLimitTier: Maximum number of active ads allowed for this
  710. // account.
  711. //
  712. // Possible values:
  713. // "ACTIVE_ADS_TIER_100K"
  714. // "ACTIVE_ADS_TIER_1M"
  715. // "ACTIVE_ADS_TIER_200K"
  716. // "ACTIVE_ADS_TIER_300K"
  717. // "ACTIVE_ADS_TIER_40K"
  718. // "ACTIVE_ADS_TIER_500K"
  719. // "ACTIVE_ADS_TIER_750K"
  720. // "ACTIVE_ADS_TIER_75K"
  721. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  722. // ActiveViewOptOut: Whether to serve creatives with Active View tags.
  723. // If disabled, viewability data will not be available for any
  724. // impressions.
  725. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  726. // AvailablePermissionIds: User role permissions available to the user
  727. // roles of this account.
  728. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  729. // CountryId: ID of the country associated with this account.
  730. CountryId int64 `json:"countryId,omitempty,string"`
  731. // CurrencyId: ID of currency associated with this account. This is a
  732. // required field.
  733. // Acceptable values are:
  734. // - "1" for USD
  735. // - "2" for GBP
  736. // - "3" for ESP
  737. // - "4" for SEK
  738. // - "5" for CAD
  739. // - "6" for JPY
  740. // - "7" for DEM
  741. // - "8" for AUD
  742. // - "9" for FRF
  743. // - "10" for ITL
  744. // - "11" for DKK
  745. // - "12" for NOK
  746. // - "13" for FIM
  747. // - "14" for ZAR
  748. // - "15" for IEP
  749. // - "16" for NLG
  750. // - "17" for EUR
  751. // - "18" for KRW
  752. // - "19" for TWD
  753. // - "20" for SGD
  754. // - "21" for CNY
  755. // - "22" for HKD
  756. // - "23" for NZD
  757. // - "24" for MYR
  758. // - "25" for BRL
  759. // - "26" for PTE
  760. // - "27" for MXP
  761. // - "28" for CLP
  762. // - "29" for TRY
  763. // - "30" for ARS
  764. // - "31" for PEN
  765. // - "32" for ILS
  766. // - "33" for CHF
  767. // - "34" for VEF
  768. // - "35" for COP
  769. // - "36" for GTQ
  770. // - "37" for PLN
  771. // - "39" for INR
  772. // - "40" for THB
  773. // - "41" for IDR
  774. // - "42" for CZK
  775. // - "43" for RON
  776. // - "44" for HUF
  777. // - "45" for RUB
  778. // - "46" for AED
  779. // - "47" for BGN
  780. // - "48" for HRK
  781. // - "49" for MXN
  782. // - "50" for NGN
  783. CurrencyId int64 `json:"currencyId,omitempty,string"`
  784. // DefaultCreativeSizeId: Default placement dimensions for this account.
  785. DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"`
  786. // Description: Description of this account.
  787. Description string `json:"description,omitempty"`
  788. // Id: ID of this account. This is a read-only, auto-generated field.
  789. Id int64 `json:"id,omitempty,string"`
  790. // Kind: Identifies what kind of resource this is. Value: the fixed
  791. // string "dfareporting#account".
  792. Kind string `json:"kind,omitempty"`
  793. // Locale: Locale of this account.
  794. // Acceptable values are:
  795. // - "cs" (Czech)
  796. // - "de" (German)
  797. // - "en" (English)
  798. // - "en-GB" (English United Kingdom)
  799. // - "es" (Spanish)
  800. // - "fr" (French)
  801. // - "it" (Italian)
  802. // - "ja" (Japanese)
  803. // - "ko" (Korean)
  804. // - "pl" (Polish)
  805. // - "pt-BR" (Portuguese Brazil)
  806. // - "ru" (Russian)
  807. // - "sv" (Swedish)
  808. // - "tr" (Turkish)
  809. // - "zh-CN" (Chinese Simplified)
  810. // - "zh-TW" (Chinese Traditional)
  811. Locale string `json:"locale,omitempty"`
  812. // MaximumImageSize: Maximum image size allowed for this account, in
  813. // kilobytes. Value must be greater than or equal to 1.
  814. MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"`
  815. // Name: Name of this account. This is a required field, and must be
  816. // less than 128 characters long and be globally unique.
  817. Name string `json:"name,omitempty"`
  818. // NielsenOcrEnabled: Whether campaigns created in this account will be
  819. // enabled for Nielsen OCR reach ratings by default.
  820. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  821. // ReportsConfiguration: Reporting configuration of this account.
  822. ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"`
  823. // ShareReportsWithTwitter: Share Path to Conversion reports with
  824. // Twitter.
  825. ShareReportsWithTwitter bool `json:"shareReportsWithTwitter,omitempty"`
  826. // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser
  827. // creatives. Acceptable values are 1 to 10240, inclusive.
  828. TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"`
  829. // ServerResponse contains the HTTP response code and headers from the
  830. // server.
  831. googleapi.ServerResponse `json:"-"`
  832. // ForceSendFields is a list of field names (e.g.
  833. // "AccountPermissionIds") to unconditionally include in API requests.
  834. // By default, fields with empty values are omitted from API requests.
  835. // However, any non-pointer, non-interface field appearing in
  836. // ForceSendFields will be sent to the server regardless of whether the
  837. // field is empty or not. This may be used to include empty fields in
  838. // Patch requests.
  839. ForceSendFields []string `json:"-"`
  840. // NullFields is a list of field names (e.g. "AccountPermissionIds") to
  841. // include in API requests with the JSON null value. By default, fields
  842. // with empty values are omitted from API requests. However, any field
  843. // with an empty value appearing in NullFields will be sent to the
  844. // server as null. It is an error if a field in this list has a
  845. // non-empty value. This may be used to include null fields in Patch
  846. // requests.
  847. NullFields []string `json:"-"`
  848. }
  849. func (s *Account) MarshalJSON() ([]byte, error) {
  850. type NoMethod Account
  851. raw := NoMethod(*s)
  852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  853. }
  854. // AccountActiveAdSummary: Gets a summary of active ads in an account.
  855. type AccountActiveAdSummary struct {
  856. // AccountId: ID of the account.
  857. AccountId int64 `json:"accountId,omitempty,string"`
  858. // ActiveAds: Ads that have been activated for the account
  859. ActiveAds int64 `json:"activeAds,omitempty,string"`
  860. // ActiveAdsLimitTier: Maximum number of active ads allowed for the
  861. // account.
  862. //
  863. // Possible values:
  864. // "ACTIVE_ADS_TIER_100K"
  865. // "ACTIVE_ADS_TIER_1M"
  866. // "ACTIVE_ADS_TIER_200K"
  867. // "ACTIVE_ADS_TIER_300K"
  868. // "ACTIVE_ADS_TIER_40K"
  869. // "ACTIVE_ADS_TIER_500K"
  870. // "ACTIVE_ADS_TIER_750K"
  871. // "ACTIVE_ADS_TIER_75K"
  872. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  873. // AvailableAds: Ads that can be activated for the account.
  874. AvailableAds int64 `json:"availableAds,omitempty,string"`
  875. // Kind: Identifies what kind of resource this is. Value: the fixed
  876. // string "dfareporting#accountActiveAdSummary".
  877. Kind string `json:"kind,omitempty"`
  878. // ServerResponse contains the HTTP response code and headers from the
  879. // server.
  880. googleapi.ServerResponse `json:"-"`
  881. // ForceSendFields is a list of field names (e.g. "AccountId") to
  882. // unconditionally include in API requests. By default, fields with
  883. // empty values are omitted from API requests. However, any non-pointer,
  884. // non-interface field appearing in ForceSendFields will be sent to the
  885. // server regardless of whether the field is empty or not. This may be
  886. // used to include empty fields in Patch requests.
  887. ForceSendFields []string `json:"-"`
  888. // NullFields is a list of field names (e.g. "AccountId") to include in
  889. // API requests with the JSON null value. By default, fields with empty
  890. // values are omitted from API requests. However, any field with an
  891. // empty value appearing in NullFields will be sent to the server as
  892. // null. It is an error if a field in this list has a non-empty value.
  893. // This may be used to include null fields in Patch requests.
  894. NullFields []string `json:"-"`
  895. }
  896. func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) {
  897. type NoMethod AccountActiveAdSummary
  898. raw := NoMethod(*s)
  899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  900. }
  901. // AccountPermission: AccountPermissions contains information about a
  902. // particular account permission. Some features of Campaign Manager
  903. // require an account permission to be present in the account.
  904. type AccountPermission struct {
  905. // AccountProfiles: Account profiles associated with this account
  906. // permission.
  907. //
  908. // Possible values are:
  909. // - "ACCOUNT_PROFILE_BASIC"
  910. // - "ACCOUNT_PROFILE_STANDARD"
  911. //
  912. // Possible values:
  913. // "ACCOUNT_PROFILE_BASIC"
  914. // "ACCOUNT_PROFILE_STANDARD"
  915. AccountProfiles []string `json:"accountProfiles,omitempty"`
  916. // Id: ID of this account permission.
  917. Id int64 `json:"id,omitempty,string"`
  918. // Kind: Identifies what kind of resource this is. Value: the fixed
  919. // string "dfareporting#accountPermission".
  920. Kind string `json:"kind,omitempty"`
  921. // Level: Administrative level required to enable this account
  922. // permission.
  923. //
  924. // Possible values:
  925. // "ADMINISTRATOR"
  926. // "USER"
  927. Level string `json:"level,omitempty"`
  928. // Name: Name of this account permission.
  929. Name string `json:"name,omitempty"`
  930. // PermissionGroupId: Permission group of this account permission.
  931. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  932. // ServerResponse contains the HTTP response code and headers from the
  933. // server.
  934. googleapi.ServerResponse `json:"-"`
  935. // ForceSendFields is a list of field names (e.g. "AccountProfiles") to
  936. // unconditionally include in API requests. By default, fields with
  937. // empty values are omitted from API requests. However, any non-pointer,
  938. // non-interface field appearing in ForceSendFields will be sent to the
  939. // server regardless of whether the field is empty or not. This may be
  940. // used to include empty fields in Patch requests.
  941. ForceSendFields []string `json:"-"`
  942. // NullFields is a list of field names (e.g. "AccountProfiles") to
  943. // include in API requests with the JSON null value. By default, fields
  944. // with empty values are omitted from API requests. However, any field
  945. // with an empty value appearing in NullFields will be sent to the
  946. // server as null. It is an error if a field in this list has a
  947. // non-empty value. This may be used to include null fields in Patch
  948. // requests.
  949. NullFields []string `json:"-"`
  950. }
  951. func (s *AccountPermission) MarshalJSON() ([]byte, error) {
  952. type NoMethod AccountPermission
  953. raw := NoMethod(*s)
  954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  955. }
  956. // AccountPermissionGroup: AccountPermissionGroups contains a mapping of
  957. // permission group IDs to names. A permission group is a grouping of
  958. // account permissions.
  959. type AccountPermissionGroup struct {
  960. // Id: ID of this account permission group.
  961. Id int64 `json:"id,omitempty,string"`
  962. // Kind: Identifies what kind of resource this is. Value: the fixed
  963. // string "dfareporting#accountPermissionGroup".
  964. Kind string `json:"kind,omitempty"`
  965. // Name: Name of this account permission group.
  966. Name string `json:"name,omitempty"`
  967. // ServerResponse contains the HTTP response code and headers from the
  968. // server.
  969. googleapi.ServerResponse `json:"-"`
  970. // ForceSendFields is a list of field names (e.g. "Id") to
  971. // unconditionally include in API requests. By default, fields with
  972. // empty values are omitted from API requests. However, any non-pointer,
  973. // non-interface field appearing in ForceSendFields will be sent to the
  974. // server regardless of whether the field is empty or not. This may be
  975. // used to include empty fields in Patch requests.
  976. ForceSendFields []string `json:"-"`
  977. // NullFields is a list of field names (e.g. "Id") to include in API
  978. // requests with the JSON null value. By default, fields with empty
  979. // values are omitted from API requests. However, any field with an
  980. // empty value appearing in NullFields will be sent to the server as
  981. // null. It is an error if a field in this list has a non-empty value.
  982. // This may be used to include null fields in Patch requests.
  983. NullFields []string `json:"-"`
  984. }
  985. func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) {
  986. type NoMethod AccountPermissionGroup
  987. raw := NoMethod(*s)
  988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  989. }
  990. // AccountPermissionGroupsListResponse: Account Permission Group List
  991. // Response
  992. type AccountPermissionGroupsListResponse struct {
  993. // AccountPermissionGroups: Account permission group collection.
  994. AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"`
  995. // Kind: Identifies what kind of resource this is. Value: the fixed
  996. // string "dfareporting#accountPermissionGroupsListResponse".
  997. Kind string `json:"kind,omitempty"`
  998. // ServerResponse contains the HTTP response code and headers from the
  999. // server.
  1000. googleapi.ServerResponse `json:"-"`
  1001. // ForceSendFields is a list of field names (e.g.
  1002. // "AccountPermissionGroups") to unconditionally include in API
  1003. // requests. By default, fields with empty values are omitted from API
  1004. // requests. However, any non-pointer, non-interface field appearing in
  1005. // ForceSendFields will be sent to the server regardless of whether the
  1006. // field is empty or not. This may be used to include empty fields in
  1007. // Patch requests.
  1008. ForceSendFields []string `json:"-"`
  1009. // NullFields is a list of field names (e.g. "AccountPermissionGroups")
  1010. // to include in API requests with the JSON null value. By default,
  1011. // fields with empty values are omitted from API requests. However, any
  1012. // field with an empty value appearing in NullFields will be sent to the
  1013. // server as null. It is an error if a field in this list has a
  1014. // non-empty value. This may be used to include null fields in Patch
  1015. // requests.
  1016. NullFields []string `json:"-"`
  1017. }
  1018. func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  1019. type NoMethod AccountPermissionGroupsListResponse
  1020. raw := NoMethod(*s)
  1021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1022. }
  1023. // AccountPermissionsListResponse: Account Permission List Response
  1024. type AccountPermissionsListResponse struct {
  1025. // AccountPermissions: Account permission collection.
  1026. AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"`
  1027. // Kind: Identifies what kind of resource this is. Value: the fixed
  1028. // string "dfareporting#accountPermissionsListResponse".
  1029. Kind string `json:"kind,omitempty"`
  1030. // ServerResponse contains the HTTP response code and headers from the
  1031. // server.
  1032. googleapi.ServerResponse `json:"-"`
  1033. // ForceSendFields is a list of field names (e.g. "AccountPermissions")
  1034. // to unconditionally include in API requests. By default, fields with
  1035. // empty values are omitted from API requests. However, any non-pointer,
  1036. // non-interface field appearing in ForceSendFields will be sent to the
  1037. // server regardless of whether the field is empty or not. This may be
  1038. // used to include empty fields in Patch requests.
  1039. ForceSendFields []string `json:"-"`
  1040. // NullFields is a list of field names (e.g. "AccountPermissions") to
  1041. // include in API requests with the JSON null value. By default, fields
  1042. // with empty values are omitted from API requests. However, any field
  1043. // with an empty value appearing in NullFields will be sent to the
  1044. // server as null. It is an error if a field in this list has a
  1045. // non-empty value. This may be used to include null fields in Patch
  1046. // requests.
  1047. NullFields []string `json:"-"`
  1048. }
  1049. func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) {
  1050. type NoMethod AccountPermissionsListResponse
  1051. raw := NoMethod(*s)
  1052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1053. }
  1054. // AccountUserProfile: AccountUserProfiles contains properties of a
  1055. // Campaign Manager user profile. This resource is specifically for
  1056. // managing user profiles, whereas UserProfiles is for accessing the
  1057. // API.
  1058. type AccountUserProfile struct {
  1059. // AccountId: Account ID of the user profile. This is a read-only field
  1060. // that can be left blank.
  1061. AccountId int64 `json:"accountId,omitempty,string"`
  1062. // Active: Whether this user profile is active. This defaults to false,
  1063. // and must be set true on insert for the user profile to be usable.
  1064. Active bool `json:"active,omitempty"`
  1065. // AdvertiserFilter: Filter that describes which advertisers are visible
  1066. // to the user profile.
  1067. AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"`
  1068. // CampaignFilter: Filter that describes which campaigns are visible to
  1069. // the user profile.
  1070. CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"`
  1071. // Comments: Comments for this user profile.
  1072. Comments string `json:"comments,omitempty"`
  1073. // Email: Email of the user profile. The email addresss must be linked
  1074. // to a Google Account. This field is required on insertion and is
  1075. // read-only after insertion.
  1076. Email string `json:"email,omitempty"`
  1077. // Id: ID of the user profile. This is a read-only, auto-generated
  1078. // field.
  1079. Id int64 `json:"id,omitempty,string"`
  1080. // Kind: Identifies what kind of resource this is. Value: the fixed
  1081. // string "dfareporting#accountUserProfile".
  1082. Kind string `json:"kind,omitempty"`
  1083. // Locale: Locale of the user profile. This is a required
  1084. // field.
  1085. // Acceptable values are:
  1086. // - "cs" (Czech)
  1087. // - "de" (German)
  1088. // - "en" (English)
  1089. // - "en-GB" (English United Kingdom)
  1090. // - "es" (Spanish)
  1091. // - "fr" (French)
  1092. // - "it" (Italian)
  1093. // - "ja" (Japanese)
  1094. // - "ko" (Korean)
  1095. // - "pl" (Polish)
  1096. // - "pt-BR" (Portuguese Brazil)
  1097. // - "ru" (Russian)
  1098. // - "sv" (Swedish)
  1099. // - "tr" (Turkish)
  1100. // - "zh-CN" (Chinese Simplified)
  1101. // - "zh-TW" (Chinese Traditional)
  1102. Locale string `json:"locale,omitempty"`
  1103. // Name: Name of the user profile. This is a required field. Must be
  1104. // less than 64 characters long, must be globally unique, and cannot
  1105. // contain whitespace or any of the following characters: "&;"#%,".
  1106. Name string `json:"name,omitempty"`
  1107. // SiteFilter: Filter that describes which sites are visible to the user
  1108. // profile.
  1109. SiteFilter *ObjectFilter `json:"siteFilter,omitempty"`
  1110. // SubaccountId: Subaccount ID of the user profile. This is a read-only
  1111. // field that can be left blank.
  1112. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1113. // TraffickerType: Trafficker type of this user profile. This is a
  1114. // read-only field.
  1115. //
  1116. // Possible values:
  1117. // "EXTERNAL_TRAFFICKER"
  1118. // "INTERNAL_NON_TRAFFICKER"
  1119. // "INTERNAL_TRAFFICKER"
  1120. TraffickerType string `json:"traffickerType,omitempty"`
  1121. // UserAccessType: User type of the user profile. This is a read-only
  1122. // field that can be left blank.
  1123. //
  1124. // Possible values:
  1125. // "INTERNAL_ADMINISTRATOR"
  1126. // "NORMAL_USER"
  1127. // "READ_ONLY_SUPER_USER"
  1128. // "SUPER_USER"
  1129. UserAccessType string `json:"userAccessType,omitempty"`
  1130. // UserRoleFilter: Filter that describes which user roles are visible to
  1131. // the user profile.
  1132. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1133. // UserRoleId: User role ID of the user profile. This is a required
  1134. // field.
  1135. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1136. // ServerResponse contains the HTTP response code and headers from the
  1137. // server.
  1138. googleapi.ServerResponse `json:"-"`
  1139. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1140. // unconditionally include in API requests. By default, fields with
  1141. // empty values are omitted from API requests. However, any non-pointer,
  1142. // non-interface field appearing in ForceSendFields will be sent to the
  1143. // server regardless of whether the field is empty or not. This may be
  1144. // used to include empty fields in Patch requests.
  1145. ForceSendFields []string `json:"-"`
  1146. // NullFields is a list of field names (e.g. "AccountId") to include in
  1147. // API requests with the JSON null value. By default, fields with empty
  1148. // values are omitted from API requests. However, any field with an
  1149. // empty value appearing in NullFields will be sent to the server as
  1150. // null. It is an error if a field in this list has a non-empty value.
  1151. // This may be used to include null fields in Patch requests.
  1152. NullFields []string `json:"-"`
  1153. }
  1154. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1155. type NoMethod AccountUserProfile
  1156. raw := NoMethod(*s)
  1157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1158. }
  1159. // AccountUserProfilesListResponse: Account User Profile List Response
  1160. type AccountUserProfilesListResponse struct {
  1161. // AccountUserProfiles: Account user profile collection.
  1162. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1163. // Kind: Identifies what kind of resource this is. Value: the fixed
  1164. // string "dfareporting#accountUserProfilesListResponse".
  1165. Kind string `json:"kind,omitempty"`
  1166. // NextPageToken: Pagination token to be used for the next list
  1167. // operation.
  1168. NextPageToken string `json:"nextPageToken,omitempty"`
  1169. // ServerResponse contains the HTTP response code and headers from the
  1170. // server.
  1171. googleapi.ServerResponse `json:"-"`
  1172. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1173. // to unconditionally include in API requests. By default, fields with
  1174. // empty values are omitted from API requests. However, any non-pointer,
  1175. // non-interface field appearing in ForceSendFields will be sent to the
  1176. // server regardless of whether the field is empty or not. This may be
  1177. // used to include empty fields in Patch requests.
  1178. ForceSendFields []string `json:"-"`
  1179. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1180. // include in API requests with the JSON null value. By default, fields
  1181. // with empty values are omitted from API requests. However, any field
  1182. // with an empty value appearing in NullFields will be sent to the
  1183. // server as null. It is an error if a field in this list has a
  1184. // non-empty value. This may be used to include null fields in Patch
  1185. // requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1189. type NoMethod AccountUserProfilesListResponse
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. // AccountsListResponse: Account List Response
  1194. type AccountsListResponse struct {
  1195. // Accounts: Account collection.
  1196. Accounts []*Account `json:"accounts,omitempty"`
  1197. // Kind: Identifies what kind of resource this is. Value: the fixed
  1198. // string "dfareporting#accountsListResponse".
  1199. Kind string `json:"kind,omitempty"`
  1200. // NextPageToken: Pagination token to be used for the next list
  1201. // operation.
  1202. NextPageToken string `json:"nextPageToken,omitempty"`
  1203. // ServerResponse contains the HTTP response code and headers from the
  1204. // server.
  1205. googleapi.ServerResponse `json:"-"`
  1206. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1207. // unconditionally include in API requests. By default, fields with
  1208. // empty values are omitted from API requests. However, any non-pointer,
  1209. // non-interface field appearing in ForceSendFields will be sent to the
  1210. // server regardless of whether the field is empty or not. This may be
  1211. // used to include empty fields in Patch requests.
  1212. ForceSendFields []string `json:"-"`
  1213. // NullFields is a list of field names (e.g. "Accounts") to include in
  1214. // API requests with the JSON null value. By default, fields with empty
  1215. // values are omitted from API requests. However, any field with an
  1216. // empty value appearing in NullFields will be sent to the server as
  1217. // null. It is an error if a field in this list has a non-empty value.
  1218. // This may be used to include null fields in Patch requests.
  1219. NullFields []string `json:"-"`
  1220. }
  1221. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1222. type NoMethod AccountsListResponse
  1223. raw := NoMethod(*s)
  1224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1225. }
  1226. // Activities: Represents an activity group.
  1227. type Activities struct {
  1228. // Filters: List of activity filters. The dimension values need to be
  1229. // all either of type "dfa:activity" or "dfa:activityGroup".
  1230. Filters []*DimensionValue `json:"filters,omitempty"`
  1231. // Kind: The kind of resource this is, in this case
  1232. // dfareporting#activities.
  1233. Kind string `json:"kind,omitempty"`
  1234. // MetricNames: List of names of floodlight activity metrics.
  1235. MetricNames []string `json:"metricNames,omitempty"`
  1236. // ForceSendFields is a list of field names (e.g. "Filters") to
  1237. // unconditionally include in API requests. By default, fields with
  1238. // empty values are omitted from API requests. However, any non-pointer,
  1239. // non-interface field appearing in ForceSendFields will be sent to the
  1240. // server regardless of whether the field is empty or not. This may be
  1241. // used to include empty fields in Patch requests.
  1242. ForceSendFields []string `json:"-"`
  1243. // NullFields is a list of field names (e.g. "Filters") to include in
  1244. // API requests with the JSON null value. By default, fields with empty
  1245. // values are omitted from API requests. However, any field with an
  1246. // empty value appearing in NullFields will be sent to the server as
  1247. // null. It is an error if a field in this list has a non-empty value.
  1248. // This may be used to include null fields in Patch requests.
  1249. NullFields []string `json:"-"`
  1250. }
  1251. func (s *Activities) MarshalJSON() ([]byte, error) {
  1252. type NoMethod Activities
  1253. raw := NoMethod(*s)
  1254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1255. }
  1256. // Ad: Contains properties of a Campaign Manager ad.
  1257. type Ad struct {
  1258. // AccountId: Account ID of this ad. This is a read-only field that can
  1259. // be left blank.
  1260. AccountId int64 `json:"accountId,omitempty,string"`
  1261. // Active: Whether this ad is active. When true, archived must be false.
  1262. Active bool `json:"active,omitempty"`
  1263. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1264. // insertion.
  1265. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1266. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1267. // advertiser. This is a read-only, auto-generated field.
  1268. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1269. // Archived: Whether this ad is archived. When true, active must be
  1270. // false.
  1271. Archived bool `json:"archived,omitempty"`
  1272. // AudienceSegmentId: Audience segment ID that is being targeted for
  1273. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1274. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1275. // CampaignId: Campaign ID of this ad. This is a required field on
  1276. // insertion.
  1277. CampaignId int64 `json:"campaignId,omitempty,string"`
  1278. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1279. // This is a read-only, auto-generated field.
  1280. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1281. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1282. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1283. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1284. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1285. // for this ad. Applies to the URL in the ad or (if overriding ad
  1286. // properties) the URL in the creative.
  1287. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1288. // Comments: Comments for this ad.
  1289. Comments string `json:"comments,omitempty"`
  1290. // Compatibility: Compatibility of this ad. Applicable when type is
  1291. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1292. // either rendering on desktop or on mobile devices or in mobile apps
  1293. // for regular or interstitial ads, respectively. APP and
  1294. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1295. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1296. // default ads created for those placements will be limited to those
  1297. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1298. // video ads developed with the VAST standard.
  1299. //
  1300. // Possible values:
  1301. // "APP"
  1302. // "APP_INTERSTITIAL"
  1303. // "DISPLAY"
  1304. // "DISPLAY_INTERSTITIAL"
  1305. // "IN_STREAM_AUDIO"
  1306. // "IN_STREAM_VIDEO"
  1307. Compatibility string `json:"compatibility,omitempty"`
  1308. // CreateInfo: Information about the creation of this ad. This is a
  1309. // read-only field.
  1310. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1311. // CreativeGroupAssignments: Creative group assignments for this ad.
  1312. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1313. // per creative group number is allowed for a maximum of two
  1314. // assignments.
  1315. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1316. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1317. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1318. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1319. // should have exactly one creativeAssignment.
  1320. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1321. // DayPartTargeting: Time and day targeting information for this ad.
  1322. // This field must be left blank if the ad is using a targeting
  1323. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1324. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1325. // DefaultClickThroughEventTagProperties: Default click-through event
  1326. // tag properties for this ad.
  1327. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1328. // DeliverySchedule: Delivery schedule information for this ad.
  1329. // Applicable when type is AD_SERVING_STANDARD_AD or
  1330. // AD_SERVING_TRACKING. This field along with subfields priority and
  1331. // impressionRatio are required on insertion when type is
  1332. // AD_SERVING_STANDARD_AD.
  1333. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1334. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1335. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1336. // field on insert, and is read-only after insert.
  1337. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1338. // EndTime: Date and time that this ad should stop serving. Must be
  1339. // later than the start time. This is a required field on insertion.
  1340. EndTime string `json:"endTime,omitempty"`
  1341. // EventTagOverrides: Event tag overrides for this ad.
  1342. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1343. // GeoTargeting: Geographical targeting information for this ad. This
  1344. // field must be left blank if the ad is using a targeting template.
  1345. // Applicable when type is AD_SERVING_STANDARD_AD.
  1346. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1347. // Id: ID of this ad. This is a read-only, auto-generated field.
  1348. Id int64 `json:"id,omitempty,string"`
  1349. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1350. // read-only, auto-generated field.
  1351. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1352. // KeyValueTargetingExpression: Key-value targeting information for this
  1353. // ad. This field must be left blank if the ad is using a targeting
  1354. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1355. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1356. // Kind: Identifies what kind of resource this is. Value: the fixed
  1357. // string "dfareporting#ad".
  1358. Kind string `json:"kind,omitempty"`
  1359. // LanguageTargeting: Language targeting information for this ad. This
  1360. // field must be left blank if the ad is using a targeting template.
  1361. // Applicable when type is AD_SERVING_STANDARD_AD.
  1362. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1363. // LastModifiedInfo: Information about the most recent modification of
  1364. // this ad. This is a read-only field.
  1365. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1366. // Name: Name of this ad. This is a required field and must be less than
  1367. // 256 characters long.
  1368. Name string `json:"name,omitempty"`
  1369. // PlacementAssignments: Placement assignments for this ad.
  1370. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1371. // RemarketingListExpression: Remarketing list targeting expression for
  1372. // this ad. This field must be left blank if the ad is using a targeting
  1373. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1374. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1375. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1376. Size *Size `json:"size,omitempty"`
  1377. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1378. // field that is auto-generated when the ad is inserted or updated.
  1379. SslCompliant bool `json:"sslCompliant,omitempty"`
  1380. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1381. // that is auto-generated when the ad is inserted or updated.
  1382. SslRequired bool `json:"sslRequired,omitempty"`
  1383. // StartTime: Date and time that this ad should start serving. If
  1384. // creating an ad, this field must be a time in the future. This is a
  1385. // required field on insertion.
  1386. StartTime string `json:"startTime,omitempty"`
  1387. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1388. // that can be left blank.
  1389. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1390. // TargetingTemplateId: Targeting template ID, used to apply
  1391. // preconfigured targeting information to this ad. This cannot be set
  1392. // while any of dayPartTargeting, geoTargeting,
  1393. // keyValueTargetingExpression, languageTargeting,
  1394. // remarketingListExpression, or technologyTargeting are set. Applicable
  1395. // when type is AD_SERVING_STANDARD_AD.
  1396. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1397. // TechnologyTargeting: Technology platform targeting information for
  1398. // this ad. This field must be left blank if the ad is using a targeting
  1399. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1400. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1401. // Type: Type of ad. This is a required field on insertion. Note that
  1402. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1403. // Creative resource).
  1404. //
  1405. // Possible values:
  1406. // "AD_SERVING_CLICK_TRACKER"
  1407. // "AD_SERVING_DEFAULT_AD"
  1408. // "AD_SERVING_STANDARD_AD"
  1409. // "AD_SERVING_TRACKING"
  1410. Type string `json:"type,omitempty"`
  1411. // ServerResponse contains the HTTP response code and headers from the
  1412. // server.
  1413. googleapi.ServerResponse `json:"-"`
  1414. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1415. // unconditionally include in API requests. By default, fields with
  1416. // empty values are omitted from API requests. However, any non-pointer,
  1417. // non-interface field appearing in ForceSendFields will be sent to the
  1418. // server regardless of whether the field is empty or not. This may be
  1419. // used to include empty fields in Patch requests.
  1420. ForceSendFields []string `json:"-"`
  1421. // NullFields is a list of field names (e.g. "AccountId") to include in
  1422. // API requests with the JSON null value. By default, fields with empty
  1423. // values are omitted from API requests. However, any field with an
  1424. // empty value appearing in NullFields will be sent to the server as
  1425. // null. It is an error if a field in this list has a non-empty value.
  1426. // This may be used to include null fields in Patch requests.
  1427. NullFields []string `json:"-"`
  1428. }
  1429. func (s *Ad) MarshalJSON() ([]byte, error) {
  1430. type NoMethod Ad
  1431. raw := NoMethod(*s)
  1432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1433. }
  1434. // AdBlockingConfiguration: Campaign ad blocking settings.
  1435. type AdBlockingConfiguration struct {
  1436. // ClickThroughUrl: Click-through URL used by brand-neutral ads. This is
  1437. // a required field when overrideClickThroughUrl is set to true.
  1438. ClickThroughUrl string `json:"clickThroughUrl,omitempty"`
  1439. // CreativeBundleId: ID of a creative bundle to use for this campaign.
  1440. // If set, brand-neutral ads will select creatives from this bundle.
  1441. // Otherwise, a default transparent pixel will be used.
  1442. CreativeBundleId int64 `json:"creativeBundleId,omitempty,string"`
  1443. // Enabled: Whether this campaign has enabled ad blocking. When true, ad
  1444. // blocking is enabled for placements in the campaign, but this may be
  1445. // overridden by site and placement settings. When false, ad blocking is
  1446. // disabled for all placements under the campaign, regardless of site
  1447. // and placement settings.
  1448. Enabled bool `json:"enabled,omitempty"`
  1449. // OverrideClickThroughUrl: Whether the brand-neutral ad's click-through
  1450. // URL comes from the campaign's creative bundle or the override URL.
  1451. // Must be set to true if ad blocking is enabled and no creative bundle
  1452. // is configured.
  1453. OverrideClickThroughUrl bool `json:"overrideClickThroughUrl,omitempty"`
  1454. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  1455. // unconditionally include in API requests. By default, fields with
  1456. // empty values are omitted from API requests. However, any non-pointer,
  1457. // non-interface field appearing in ForceSendFields will be sent to the
  1458. // server regardless of whether the field is empty or not. This may be
  1459. // used to include empty fields in Patch requests.
  1460. ForceSendFields []string `json:"-"`
  1461. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  1462. // include in API requests with the JSON null value. By default, fields
  1463. // with empty values are omitted from API requests. However, any field
  1464. // with an empty value appearing in NullFields will be sent to the
  1465. // server as null. It is an error if a field in this list has a
  1466. // non-empty value. This may be used to include null fields in Patch
  1467. // requests.
  1468. NullFields []string `json:"-"`
  1469. }
  1470. func (s *AdBlockingConfiguration) MarshalJSON() ([]byte, error) {
  1471. type NoMethod AdBlockingConfiguration
  1472. raw := NoMethod(*s)
  1473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1474. }
  1475. // AdSlot: Ad Slot
  1476. type AdSlot struct {
  1477. // Comment: Comment for this ad slot.
  1478. Comment string `json:"comment,omitempty"`
  1479. // Compatibility: Ad slot compatibility. DISPLAY and
  1480. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1481. // devices or in mobile apps for regular or interstitial ads
  1482. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1483. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1484. // developed with the VAST standard.
  1485. //
  1486. // Possible values:
  1487. // "APP"
  1488. // "APP_INTERSTITIAL"
  1489. // "DISPLAY"
  1490. // "DISPLAY_INTERSTITIAL"
  1491. // "IN_STREAM_AUDIO"
  1492. // "IN_STREAM_VIDEO"
  1493. Compatibility string `json:"compatibility,omitempty"`
  1494. // Height: Height of this ad slot.
  1495. Height int64 `json:"height,omitempty,string"`
  1496. // LinkedPlacementId: ID of the placement from an external platform that
  1497. // is linked to this ad slot.
  1498. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1499. // Name: Name of this ad slot.
  1500. Name string `json:"name,omitempty"`
  1501. // PaymentSourceType: Payment source type of this ad slot.
  1502. //
  1503. // Possible values:
  1504. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1505. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1506. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1507. // Primary: Primary ad slot of a roadblock inventory item.
  1508. Primary bool `json:"primary,omitempty"`
  1509. // Width: Width of this ad slot.
  1510. Width int64 `json:"width,omitempty,string"`
  1511. // ForceSendFields is a list of field names (e.g. "Comment") to
  1512. // unconditionally include in API requests. By default, fields with
  1513. // empty values are omitted from API requests. However, any non-pointer,
  1514. // non-interface field appearing in ForceSendFields will be sent to the
  1515. // server regardless of whether the field is empty or not. This may be
  1516. // used to include empty fields in Patch requests.
  1517. ForceSendFields []string `json:"-"`
  1518. // NullFields is a list of field names (e.g. "Comment") to include in
  1519. // API requests with the JSON null value. By default, fields with empty
  1520. // values are omitted from API requests. However, any field with an
  1521. // empty value appearing in NullFields will be sent to the server as
  1522. // null. It is an error if a field in this list has a non-empty value.
  1523. // This may be used to include null fields in Patch requests.
  1524. NullFields []string `json:"-"`
  1525. }
  1526. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1527. type NoMethod AdSlot
  1528. raw := NoMethod(*s)
  1529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1530. }
  1531. // AdsListResponse: Ad List Response
  1532. type AdsListResponse struct {
  1533. // Ads: Ad collection.
  1534. Ads []*Ad `json:"ads,omitempty"`
  1535. // Kind: Identifies what kind of resource this is. Value: the fixed
  1536. // string "dfareporting#adsListResponse".
  1537. Kind string `json:"kind,omitempty"`
  1538. // NextPageToken: Pagination token to be used for the next list
  1539. // operation.
  1540. NextPageToken string `json:"nextPageToken,omitempty"`
  1541. // ServerResponse contains the HTTP response code and headers from the
  1542. // server.
  1543. googleapi.ServerResponse `json:"-"`
  1544. // ForceSendFields is a list of field names (e.g. "Ads") to
  1545. // unconditionally include in API requests. By default, fields with
  1546. // empty values are omitted from API requests. However, any non-pointer,
  1547. // non-interface field appearing in ForceSendFields will be sent to the
  1548. // server regardless of whether the field is empty or not. This may be
  1549. // used to include empty fields in Patch requests.
  1550. ForceSendFields []string `json:"-"`
  1551. // NullFields is a list of field names (e.g. "Ads") to include in API
  1552. // requests with the JSON null value. By default, fields with empty
  1553. // values are omitted from API requests. However, any field with an
  1554. // empty value appearing in NullFields will be sent to the server as
  1555. // null. It is an error if a field in this list has a non-empty value.
  1556. // This may be used to include null fields in Patch requests.
  1557. NullFields []string `json:"-"`
  1558. }
  1559. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1560. type NoMethod AdsListResponse
  1561. raw := NoMethod(*s)
  1562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1563. }
  1564. // Advertiser: Contains properties of a Campaign Manager advertiser.
  1565. type Advertiser struct {
  1566. // AccountId: Account ID of this advertiser.This is a read-only field
  1567. // that can be left blank.
  1568. AccountId int64 `json:"accountId,omitempty,string"`
  1569. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1570. // to. You can group advertisers for reporting purposes, allowing you to
  1571. // see aggregated information for all advertisers in each group.
  1572. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1573. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1574. // creative associations under this advertiser. Must be less than 129
  1575. // characters long.
  1576. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1577. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1578. // apply by default to the landing pages of this advertiser's campaigns.
  1579. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1580. // DefaultEmail: Default email address used in sender field for tag
  1581. // emails.
  1582. DefaultEmail string `json:"defaultEmail,omitempty"`
  1583. // FloodlightConfigurationId: Floodlight configuration ID of this
  1584. // advertiser. The floodlight configuration ID will be created
  1585. // automatically, so on insert this field should be left blank. This
  1586. // field can be set to another advertiser's floodlight configuration ID
  1587. // in order to share that advertiser's floodlight configuration with
  1588. // this advertiser, so long as:
  1589. // - This advertiser's original floodlight configuration is not already
  1590. // associated with floodlight activities or floodlight activity groups.
  1591. //
  1592. // - This advertiser's original floodlight configuration is not already
  1593. // shared with another advertiser.
  1594. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1595. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1596. // of the floodlight configuration. This is a read-only, auto-generated
  1597. // field.
  1598. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1599. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1600. Id int64 `json:"id,omitempty,string"`
  1601. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1602. // is a read-only, auto-generated field.
  1603. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1604. // Kind: Identifies what kind of resource this is. Value: the fixed
  1605. // string "dfareporting#advertiser".
  1606. Kind string `json:"kind,omitempty"`
  1607. // Name: Name of this advertiser. This is a required field and must be
  1608. // less than 256 characters long and unique among advertisers of the
  1609. // same account.
  1610. Name string `json:"name,omitempty"`
  1611. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1612. // before any sharing occurred. Set the floodlightConfigurationId of
  1613. // this advertiser to originalFloodlightConfigurationId to unshare the
  1614. // advertiser's current floodlight configuration. You cannot unshare an
  1615. // advertiser's floodlight configuration if the shared configuration has
  1616. // activities associated with any campaign or placement.
  1617. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1618. // Status: Status of this advertiser.
  1619. //
  1620. // Possible values:
  1621. // "APPROVED"
  1622. // "ON_HOLD"
  1623. Status string `json:"status,omitempty"`
  1624. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1625. // field that can be left blank.
  1626. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1627. // Suspended: Suspension status of this advertiser.
  1628. Suspended bool `json:"suspended,omitempty"`
  1629. // ServerResponse contains the HTTP response code and headers from the
  1630. // server.
  1631. googleapi.ServerResponse `json:"-"`
  1632. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1633. // unconditionally include in API requests. By default, fields with
  1634. // empty values are omitted from API requests. However, any non-pointer,
  1635. // non-interface field appearing in ForceSendFields will be sent to the
  1636. // server regardless of whether the field is empty or not. This may be
  1637. // used to include empty fields in Patch requests.
  1638. ForceSendFields []string `json:"-"`
  1639. // NullFields is a list of field names (e.g. "AccountId") to include in
  1640. // API requests with the JSON null value. By default, fields with empty
  1641. // values are omitted from API requests. However, any field with an
  1642. // empty value appearing in NullFields will be sent to the server as
  1643. // null. It is an error if a field in this list has a non-empty value.
  1644. // This may be used to include null fields in Patch requests.
  1645. NullFields []string `json:"-"`
  1646. }
  1647. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1648. type NoMethod Advertiser
  1649. raw := NoMethod(*s)
  1650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1651. }
  1652. // AdvertiserGroup: Groups advertisers together so that reports can be
  1653. // generated for the entire group at once.
  1654. type AdvertiserGroup struct {
  1655. // AccountId: Account ID of this advertiser group. This is a read-only
  1656. // field that can be left blank.
  1657. AccountId int64 `json:"accountId,omitempty,string"`
  1658. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1659. // field.
  1660. Id int64 `json:"id,omitempty,string"`
  1661. // Kind: Identifies what kind of resource this is. Value: the fixed
  1662. // string "dfareporting#advertiserGroup".
  1663. Kind string `json:"kind,omitempty"`
  1664. // Name: Name of this advertiser group. This is a required field and
  1665. // must be less than 256 characters long and unique among advertiser
  1666. // groups of the same account.
  1667. Name string `json:"name,omitempty"`
  1668. // ServerResponse contains the HTTP response code and headers from the
  1669. // server.
  1670. googleapi.ServerResponse `json:"-"`
  1671. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1672. // unconditionally include in API requests. By default, fields with
  1673. // empty values are omitted from API requests. However, any non-pointer,
  1674. // non-interface field appearing in ForceSendFields will be sent to the
  1675. // server regardless of whether the field is empty or not. This may be
  1676. // used to include empty fields in Patch requests.
  1677. ForceSendFields []string `json:"-"`
  1678. // NullFields is a list of field names (e.g. "AccountId") to include in
  1679. // API requests with the JSON null value. By default, fields with empty
  1680. // values are omitted from API requests. However, any field with an
  1681. // empty value appearing in NullFields will be sent to the server as
  1682. // null. It is an error if a field in this list has a non-empty value.
  1683. // This may be used to include null fields in Patch requests.
  1684. NullFields []string `json:"-"`
  1685. }
  1686. func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1687. type NoMethod AdvertiserGroup
  1688. raw := NoMethod(*s)
  1689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1690. }
  1691. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1692. type AdvertiserGroupsListResponse struct {
  1693. // AdvertiserGroups: Advertiser group collection.
  1694. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1695. // Kind: Identifies what kind of resource this is. Value: the fixed
  1696. // string "dfareporting#advertiserGroupsListResponse".
  1697. Kind string `json:"kind,omitempty"`
  1698. // NextPageToken: Pagination token to be used for the next list
  1699. // operation.
  1700. NextPageToken string `json:"nextPageToken,omitempty"`
  1701. // ServerResponse contains the HTTP response code and headers from the
  1702. // server.
  1703. googleapi.ServerResponse `json:"-"`
  1704. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1705. // unconditionally include in API requests. By default, fields with
  1706. // empty values are omitted from API requests. However, any non-pointer,
  1707. // non-interface field appearing in ForceSendFields will be sent to the
  1708. // server regardless of whether the field is empty or not. This may be
  1709. // used to include empty fields in Patch requests.
  1710. ForceSendFields []string `json:"-"`
  1711. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1712. // include in API requests with the JSON null value. By default, fields
  1713. // with empty values are omitted from API requests. However, any field
  1714. // with an empty value appearing in NullFields will be sent to the
  1715. // server as null. It is an error if a field in this list has a
  1716. // non-empty value. This may be used to include null fields in Patch
  1717. // requests.
  1718. NullFields []string `json:"-"`
  1719. }
  1720. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1721. type NoMethod AdvertiserGroupsListResponse
  1722. raw := NoMethod(*s)
  1723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1724. }
  1725. // AdvertiserLandingPagesListResponse: Landing Page List Response
  1726. type AdvertiserLandingPagesListResponse struct {
  1727. // Kind: Identifies what kind of resource this is. Value: the fixed
  1728. // string "dfareporting#advertiserLandingPagesListResponse".
  1729. Kind string `json:"kind,omitempty"`
  1730. // LandingPages: Landing page collection
  1731. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  1732. // NextPageToken: Pagination token to be used for the next list
  1733. // operation.
  1734. NextPageToken string `json:"nextPageToken,omitempty"`
  1735. // ServerResponse contains the HTTP response code and headers from the
  1736. // server.
  1737. googleapi.ServerResponse `json:"-"`
  1738. // ForceSendFields is a list of field names (e.g. "Kind") to
  1739. // unconditionally include in API requests. By default, fields with
  1740. // empty values are omitted from API requests. However, any non-pointer,
  1741. // non-interface field appearing in ForceSendFields will be sent to the
  1742. // server regardless of whether the field is empty or not. This may be
  1743. // used to include empty fields in Patch requests.
  1744. ForceSendFields []string `json:"-"`
  1745. // NullFields is a list of field names (e.g. "Kind") to include in API
  1746. // requests with the JSON null value. By default, fields with empty
  1747. // values are omitted from API requests. However, any field with an
  1748. // empty value appearing in NullFields will be sent to the server as
  1749. // null. It is an error if a field in this list has a non-empty value.
  1750. // This may be used to include null fields in Patch requests.
  1751. NullFields []string `json:"-"`
  1752. }
  1753. func (s *AdvertiserLandingPagesListResponse) MarshalJSON() ([]byte, error) {
  1754. type NoMethod AdvertiserLandingPagesListResponse
  1755. raw := NoMethod(*s)
  1756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1757. }
  1758. // AdvertisersListResponse: Advertiser List Response
  1759. type AdvertisersListResponse struct {
  1760. // Advertisers: Advertiser collection.
  1761. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1762. // Kind: Identifies what kind of resource this is. Value: the fixed
  1763. // string "dfareporting#advertisersListResponse".
  1764. Kind string `json:"kind,omitempty"`
  1765. // NextPageToken: Pagination token to be used for the next list
  1766. // operation.
  1767. NextPageToken string `json:"nextPageToken,omitempty"`
  1768. // ServerResponse contains the HTTP response code and headers from the
  1769. // server.
  1770. googleapi.ServerResponse `json:"-"`
  1771. // ForceSendFields is a list of field names (e.g. "Advertisers") to
  1772. // unconditionally include in API requests. By default, fields with
  1773. // empty values are omitted from API requests. However, any non-pointer,
  1774. // non-interface field appearing in ForceSendFields will be sent to the
  1775. // server regardless of whether the field is empty or not. This may be
  1776. // used to include empty fields in Patch requests.
  1777. ForceSendFields []string `json:"-"`
  1778. // NullFields is a list of field names (e.g. "Advertisers") to include
  1779. // in API requests with the JSON null value. By default, fields with
  1780. // empty values are omitted from API requests. However, any field with
  1781. // an empty value appearing in NullFields will be sent to the server as
  1782. // null. It is an error if a field in this list has a non-empty value.
  1783. // This may be used to include null fields in Patch requests.
  1784. NullFields []string `json:"-"`
  1785. }
  1786. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1787. type NoMethod AdvertisersListResponse
  1788. raw := NoMethod(*s)
  1789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1790. }
  1791. // AudienceSegment: Audience Segment.
  1792. type AudienceSegment struct {
  1793. // Allocation: Weight allocated to this segment. The weight assigned
  1794. // will be understood in proportion to the weights assigned to other
  1795. // segments in the same segment group. Acceptable values are 1 to 1000,
  1796. // inclusive.
  1797. Allocation int64 `json:"allocation,omitempty"`
  1798. // Id: ID of this audience segment. This is a read-only, auto-generated
  1799. // field.
  1800. Id int64 `json:"id,omitempty,string"`
  1801. // Name: Name of this audience segment. This is a required field and
  1802. // must be less than 65 characters long.
  1803. Name string `json:"name,omitempty"`
  1804. // ForceSendFields is a list of field names (e.g. "Allocation") to
  1805. // unconditionally include in API requests. By default, fields with
  1806. // empty values are omitted from API requests. However, any non-pointer,
  1807. // non-interface field appearing in ForceSendFields will be sent to the
  1808. // server regardless of whether the field is empty or not. This may be
  1809. // used to include empty fields in Patch requests.
  1810. ForceSendFields []string `json:"-"`
  1811. // NullFields is a list of field names (e.g. "Allocation") to include in
  1812. // API requests with the JSON null value. By default, fields with empty
  1813. // values are omitted from API requests. However, any field with an
  1814. // empty value appearing in NullFields will be sent to the server as
  1815. // null. It is an error if a field in this list has a non-empty value.
  1816. // This may be used to include null fields in Patch requests.
  1817. NullFields []string `json:"-"`
  1818. }
  1819. func (s *AudienceSegment) MarshalJSON() ([]byte, error) {
  1820. type NoMethod AudienceSegment
  1821. raw := NoMethod(*s)
  1822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1823. }
  1824. // AudienceSegmentGroup: Audience Segment Group.
  1825. type AudienceSegmentGroup struct {
  1826. // AudienceSegments: Audience segments assigned to this group. The
  1827. // number of segments must be between 2 and 100.
  1828. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1829. // Id: ID of this audience segment group. This is a read-only,
  1830. // auto-generated field.
  1831. Id int64 `json:"id,omitempty,string"`
  1832. // Name: Name of this audience segment group. This is a required field
  1833. // and must be less than 65 characters long.
  1834. Name string `json:"name,omitempty"`
  1835. // ForceSendFields is a list of field names (e.g. "AudienceSegments") to
  1836. // unconditionally include in API requests. By default, fields with
  1837. // empty values are omitted from API requests. However, any non-pointer,
  1838. // non-interface field appearing in ForceSendFields will be sent to the
  1839. // server regardless of whether the field is empty or not. This may be
  1840. // used to include empty fields in Patch requests.
  1841. ForceSendFields []string `json:"-"`
  1842. // NullFields is a list of field names (e.g. "AudienceSegments") to
  1843. // include in API requests with the JSON null value. By default, fields
  1844. // with empty values are omitted from API requests. However, any field
  1845. // with an empty value appearing in NullFields will be sent to the
  1846. // server as null. It is an error if a field in this list has a
  1847. // non-empty value. This may be used to include null fields in Patch
  1848. // requests.
  1849. NullFields []string `json:"-"`
  1850. }
  1851. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1852. type NoMethod AudienceSegmentGroup
  1853. raw := NoMethod(*s)
  1854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1855. }
  1856. // Browser: Contains information about a browser that can be targeted by
  1857. // ads.
  1858. type Browser struct {
  1859. // BrowserVersionId: ID referring to this grouping of browser and
  1860. // version numbers. This is the ID used for targeting.
  1861. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1862. // DartId: DART ID of this browser. This is the ID used when generating
  1863. // reports.
  1864. DartId int64 `json:"dartId,omitempty,string"`
  1865. // Kind: Identifies what kind of resource this is. Value: the fixed
  1866. // string "dfareporting#browser".
  1867. Kind string `json:"kind,omitempty"`
  1868. // MajorVersion: Major version number (leftmost number) of this browser.
  1869. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1870. // 5. An asterisk (*) may be used to target any version number, and a
  1871. // question mark (?) may be used to target cases where the version
  1872. // number cannot be identified. For example, Chrome *.* targets any
  1873. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1874. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1875. // server knows the browser is Firefox but can't tell which version it
  1876. // is.
  1877. MajorVersion string `json:"majorVersion,omitempty"`
  1878. // MinorVersion: Minor version number (number after first dot on left)
  1879. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1880. // should be set to 0. An asterisk (*) may be used to target any version
  1881. // number, and a question mark (?) may be used to target cases where the
  1882. // version number cannot be identified. For example, Chrome *.* targets
  1883. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1884. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1885. // server knows the browser is Firefox but can't tell which version it
  1886. // is.
  1887. MinorVersion string `json:"minorVersion,omitempty"`
  1888. // Name: Name of this browser.
  1889. Name string `json:"name,omitempty"`
  1890. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1891. // unconditionally include in API requests. By default, fields with
  1892. // empty values are omitted from API requests. However, any non-pointer,
  1893. // non-interface field appearing in ForceSendFields will be sent to the
  1894. // server regardless of whether the field is empty or not. This may be
  1895. // used to include empty fields in Patch requests.
  1896. ForceSendFields []string `json:"-"`
  1897. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1898. // include in API requests with the JSON null value. By default, fields
  1899. // with empty values are omitted from API requests. However, any field
  1900. // with an empty value appearing in NullFields will be sent to the
  1901. // server as null. It is an error if a field in this list has a
  1902. // non-empty value. This may be used to include null fields in Patch
  1903. // requests.
  1904. NullFields []string `json:"-"`
  1905. }
  1906. func (s *Browser) MarshalJSON() ([]byte, error) {
  1907. type NoMethod Browser
  1908. raw := NoMethod(*s)
  1909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1910. }
  1911. // BrowsersListResponse: Browser List Response
  1912. type BrowsersListResponse struct {
  1913. // Browsers: Browser collection.
  1914. Browsers []*Browser `json:"browsers,omitempty"`
  1915. // Kind: Identifies what kind of resource this is. Value: the fixed
  1916. // string "dfareporting#browsersListResponse".
  1917. Kind string `json:"kind,omitempty"`
  1918. // ServerResponse contains the HTTP response code and headers from the
  1919. // server.
  1920. googleapi.ServerResponse `json:"-"`
  1921. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1922. // unconditionally include in API requests. By default, fields with
  1923. // empty values are omitted from API requests. However, any non-pointer,
  1924. // non-interface field appearing in ForceSendFields will be sent to the
  1925. // server regardless of whether the field is empty or not. This may be
  1926. // used to include empty fields in Patch requests.
  1927. ForceSendFields []string `json:"-"`
  1928. // NullFields is a list of field names (e.g. "Browsers") to include in
  1929. // API requests with the JSON null value. By default, fields with empty
  1930. // values are omitted from API requests. However, any field with an
  1931. // empty value appearing in NullFields will be sent to the server as
  1932. // null. It is an error if a field in this list has a non-empty value.
  1933. // This may be used to include null fields in Patch requests.
  1934. NullFields []string `json:"-"`
  1935. }
  1936. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1937. type NoMethod BrowsersListResponse
  1938. raw := NoMethod(*s)
  1939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1940. }
  1941. // Campaign: Contains properties of a Campaign Manager campaign.
  1942. type Campaign struct {
  1943. // AccountId: Account ID of this campaign. This is a read-only field
  1944. // that can be left blank.
  1945. AccountId int64 `json:"accountId,omitempty,string"`
  1946. // AdBlockingConfiguration: Ad blocking settings for this campaign.
  1947. AdBlockingConfiguration *AdBlockingConfiguration `json:"adBlockingConfiguration,omitempty"`
  1948. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1949. // optimization configurations for the campaign.
  1950. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1951. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1952. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1953. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1954. // field.
  1955. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1956. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1957. // this campaign. This is a read-only, auto-generated field.
  1958. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1959. // Archived: Whether this campaign has been archived.
  1960. Archived bool `json:"archived,omitempty"`
  1961. // AudienceSegmentGroups: Audience segment groups assigned to this
  1962. // campaign. Cannot have more than 300 segment groups.
  1963. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1964. // BillingInvoiceCode: Billing invoice code included in the Campaign
  1965. // Manager client billing invoices associated with the campaign.
  1966. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1967. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1968. // properties for this campaign.
  1969. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1970. // Comment: Arbitrary comments about this campaign. Must be less than
  1971. // 256 characters long.
  1972. Comment string `json:"comment,omitempty"`
  1973. // CreateInfo: Information about the creation of this campaign. This is
  1974. // a read-only field.
  1975. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1976. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1977. // campaign.
  1978. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1979. // CreativeOptimizationConfiguration: Creative optimization
  1980. // configuration for the campaign.
  1981. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1982. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1983. // override properties for this campaign.
  1984. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1985. // DefaultLandingPageId: The default landing page ID for this campaign.
  1986. DefaultLandingPageId int64 `json:"defaultLandingPageId,omitempty,string"`
  1987. // EndDate: Date on which the campaign will stop running. On insert, the
  1988. // end date must be today or a future date. The end date must be later
  1989. // than or be the same as the start date. If, for example, you set
  1990. // 6/25/2015 as both the start and end dates, the effective campaign run
  1991. // date is just that day only, 6/25/2015. The hours, minutes, and
  1992. // seconds of the end date should not be set, as doing so will result in
  1993. // an error. This is a required field.
  1994. EndDate string `json:"endDate,omitempty"`
  1995. // EventTagOverrides: Overrides that can be used to activate or
  1996. // deactivate advertiser event tags.
  1997. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1998. // ExternalId: External ID for this campaign.
  1999. ExternalId string `json:"externalId,omitempty"`
  2000. // Id: ID of this campaign. This is a read-only auto-generated field.
  2001. Id int64 `json:"id,omitempty,string"`
  2002. // IdDimensionValue: Dimension value for the ID of this campaign. This
  2003. // is a read-only, auto-generated field.
  2004. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  2005. // Kind: Identifies what kind of resource this is. Value: the fixed
  2006. // string "dfareporting#campaign".
  2007. Kind string `json:"kind,omitempty"`
  2008. // LastModifiedInfo: Information about the most recent modification of
  2009. // this campaign. This is a read-only field.
  2010. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  2011. // LookbackConfiguration: Lookback window settings for the campaign.
  2012. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  2013. // Name: Name of this campaign. This is a required field and must be
  2014. // less than 256 characters long and unique among campaigns of the same
  2015. // advertiser.
  2016. Name string `json:"name,omitempty"`
  2017. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  2018. // campaign.
  2019. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  2020. // StartDate: Date on which the campaign starts running. The start date
  2021. // can be any date. The hours, minutes, and seconds of the start date
  2022. // should not be set, as doing so will result in an error. This is a
  2023. // required field.
  2024. StartDate string `json:"startDate,omitempty"`
  2025. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  2026. // field that can be left blank.
  2027. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2028. // TraffickerEmails: Campaign trafficker contact emails.
  2029. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  2030. // ServerResponse contains the HTTP response code and headers from the
  2031. // server.
  2032. googleapi.ServerResponse `json:"-"`
  2033. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2034. // unconditionally include in API requests. By default, fields with
  2035. // empty values are omitted from API requests. However, any non-pointer,
  2036. // non-interface field appearing in ForceSendFields will be sent to the
  2037. // server regardless of whether the field is empty or not. This may be
  2038. // used to include empty fields in Patch requests.
  2039. ForceSendFields []string `json:"-"`
  2040. // NullFields is a list of field names (e.g. "AccountId") to include in
  2041. // API requests with the JSON null value. By default, fields with empty
  2042. // values are omitted from API requests. However, any field with an
  2043. // empty value appearing in NullFields will be sent to the server as
  2044. // null. It is an error if a field in this list has a non-empty value.
  2045. // This may be used to include null fields in Patch requests.
  2046. NullFields []string `json:"-"`
  2047. }
  2048. func (s *Campaign) MarshalJSON() ([]byte, error) {
  2049. type NoMethod Campaign
  2050. raw := NoMethod(*s)
  2051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2052. }
  2053. // CampaignCreativeAssociation: Identifies a creative which has been
  2054. // associated with a given campaign.
  2055. type CampaignCreativeAssociation struct {
  2056. // CreativeId: ID of the creative associated with the campaign. This is
  2057. // a required field.
  2058. CreativeId int64 `json:"creativeId,omitempty,string"`
  2059. // Kind: Identifies what kind of resource this is. Value: the fixed
  2060. // string "dfareporting#campaignCreativeAssociation".
  2061. Kind string `json:"kind,omitempty"`
  2062. // ServerResponse contains the HTTP response code and headers from the
  2063. // server.
  2064. googleapi.ServerResponse `json:"-"`
  2065. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  2066. // unconditionally include in API requests. By default, fields with
  2067. // empty values are omitted from API requests. However, any non-pointer,
  2068. // non-interface field appearing in ForceSendFields will be sent to the
  2069. // server regardless of whether the field is empty or not. This may be
  2070. // used to include empty fields in Patch requests.
  2071. ForceSendFields []string `json:"-"`
  2072. // NullFields is a list of field names (e.g. "CreativeId") to include in
  2073. // API requests with the JSON null value. By default, fields with empty
  2074. // values are omitted from API requests. However, any field with an
  2075. // empty value appearing in NullFields will be sent to the server as
  2076. // null. It is an error if a field in this list has a non-empty value.
  2077. // This may be used to include null fields in Patch requests.
  2078. NullFields []string `json:"-"`
  2079. }
  2080. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  2081. type NoMethod CampaignCreativeAssociation
  2082. raw := NoMethod(*s)
  2083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2084. }
  2085. // CampaignCreativeAssociationsListResponse: Campaign Creative
  2086. // Association List Response
  2087. type CampaignCreativeAssociationsListResponse struct {
  2088. // CampaignCreativeAssociations: Campaign creative association
  2089. // collection
  2090. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  2091. // Kind: Identifies what kind of resource this is. Value: the fixed
  2092. // string "dfareporting#campaignCreativeAssociationsListResponse".
  2093. Kind string `json:"kind,omitempty"`
  2094. // NextPageToken: Pagination token to be used for the next list
  2095. // operation.
  2096. NextPageToken string `json:"nextPageToken,omitempty"`
  2097. // ServerResponse contains the HTTP response code and headers from the
  2098. // server.
  2099. googleapi.ServerResponse `json:"-"`
  2100. // ForceSendFields is a list of field names (e.g.
  2101. // "CampaignCreativeAssociations") to unconditionally include in API
  2102. // requests. By default, fields with empty values are omitted from API
  2103. // requests. However, any non-pointer, non-interface field appearing in
  2104. // ForceSendFields will be sent to the server regardless of whether the
  2105. // field is empty or not. This may be used to include empty fields in
  2106. // Patch requests.
  2107. ForceSendFields []string `json:"-"`
  2108. // NullFields is a list of field names (e.g.
  2109. // "CampaignCreativeAssociations") to include in API requests with the
  2110. // JSON null value. By default, fields with empty values are omitted
  2111. // from API requests. However, any field with an empty value appearing
  2112. // in NullFields will be sent to the server as null. It is an error if a
  2113. // field in this list has a non-empty value. This may be used to include
  2114. // null fields in Patch requests.
  2115. NullFields []string `json:"-"`
  2116. }
  2117. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  2118. type NoMethod CampaignCreativeAssociationsListResponse
  2119. raw := NoMethod(*s)
  2120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2121. }
  2122. // CampaignsListResponse: Campaign List Response
  2123. type CampaignsListResponse struct {
  2124. // Campaigns: Campaign collection.
  2125. Campaigns []*Campaign `json:"campaigns,omitempty"`
  2126. // Kind: Identifies what kind of resource this is. Value: the fixed
  2127. // string "dfareporting#campaignsListResponse".
  2128. Kind string `json:"kind,omitempty"`
  2129. // NextPageToken: Pagination token to be used for the next list
  2130. // operation.
  2131. NextPageToken string `json:"nextPageToken,omitempty"`
  2132. // ServerResponse contains the HTTP response code and headers from the
  2133. // server.
  2134. googleapi.ServerResponse `json:"-"`
  2135. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  2136. // unconditionally include in API requests. By default, fields with
  2137. // empty values are omitted from API requests. However, any non-pointer,
  2138. // non-interface field appearing in ForceSendFields will be sent to the
  2139. // server regardless of whether the field is empty or not. This may be
  2140. // used to include empty fields in Patch requests.
  2141. ForceSendFields []string `json:"-"`
  2142. // NullFields is a list of field names (e.g. "Campaigns") to include in
  2143. // API requests with the JSON null value. By default, fields with empty
  2144. // values are omitted from API requests. However, any field with an
  2145. // empty value appearing in NullFields will be sent to the server as
  2146. // null. It is an error if a field in this list has a non-empty value.
  2147. // This may be used to include null fields in Patch requests.
  2148. NullFields []string `json:"-"`
  2149. }
  2150. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2151. type NoMethod CampaignsListResponse
  2152. raw := NoMethod(*s)
  2153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2154. }
  2155. // ChangeLog: Describes a change that a user has made to a resource.
  2156. type ChangeLog struct {
  2157. // AccountId: Account ID of the modified object.
  2158. AccountId int64 `json:"accountId,omitempty,string"`
  2159. // Action: Action which caused the change.
  2160. Action string `json:"action,omitempty"`
  2161. // ChangeTime: Time when the object was modified.
  2162. ChangeTime string `json:"changeTime,omitempty"`
  2163. // FieldName: Field name of the object which changed.
  2164. FieldName string `json:"fieldName,omitempty"`
  2165. // Id: ID of this change log.
  2166. Id int64 `json:"id,omitempty,string"`
  2167. // Kind: Identifies what kind of resource this is. Value: the fixed
  2168. // string "dfareporting#changeLog".
  2169. Kind string `json:"kind,omitempty"`
  2170. // NewValue: New value of the object field.
  2171. NewValue string `json:"newValue,omitempty"`
  2172. // ObjectId: ID of the object of this change log. The object could be a
  2173. // campaign, placement, ad, or other type.
  2174. ObjectId int64 `json:"objectId,omitempty,string"`
  2175. // ObjectType: Object type of the change log.
  2176. ObjectType string `json:"objectType,omitempty"`
  2177. // OldValue: Old value of the object field.
  2178. OldValue string `json:"oldValue,omitempty"`
  2179. // SubaccountId: Subaccount ID of the modified object.
  2180. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2181. // TransactionId: Transaction ID of this change log. When a single API
  2182. // call results in many changes, each change will have a separate ID in
  2183. // the change log but will share the same transactionId.
  2184. TransactionId int64 `json:"transactionId,omitempty,string"`
  2185. // UserProfileId: ID of the user who modified the object.
  2186. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2187. // UserProfileName: User profile name of the user who modified the
  2188. // object.
  2189. UserProfileName string `json:"userProfileName,omitempty"`
  2190. // ServerResponse contains the HTTP response code and headers from the
  2191. // server.
  2192. googleapi.ServerResponse `json:"-"`
  2193. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2194. // unconditionally include in API requests. By default, fields with
  2195. // empty values are omitted from API requests. However, any non-pointer,
  2196. // non-interface field appearing in ForceSendFields will be sent to the
  2197. // server regardless of whether the field is empty or not. This may be
  2198. // used to include empty fields in Patch requests.
  2199. ForceSendFields []string `json:"-"`
  2200. // NullFields is a list of field names (e.g. "AccountId") to include in
  2201. // API requests with the JSON null value. By default, fields with empty
  2202. // values are omitted from API requests. However, any field with an
  2203. // empty value appearing in NullFields will be sent to the server as
  2204. // null. It is an error if a field in this list has a non-empty value.
  2205. // This may be used to include null fields in Patch requests.
  2206. NullFields []string `json:"-"`
  2207. }
  2208. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2209. type NoMethod ChangeLog
  2210. raw := NoMethod(*s)
  2211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2212. }
  2213. // ChangeLogsListResponse: Change Log List Response
  2214. type ChangeLogsListResponse struct {
  2215. // ChangeLogs: Change log collection.
  2216. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2217. // Kind: Identifies what kind of resource this is. Value: the fixed
  2218. // string "dfareporting#changeLogsListResponse".
  2219. Kind string `json:"kind,omitempty"`
  2220. // NextPageToken: Pagination token to be used for the next list
  2221. // operation.
  2222. NextPageToken string `json:"nextPageToken,omitempty"`
  2223. // ServerResponse contains the HTTP response code and headers from the
  2224. // server.
  2225. googleapi.ServerResponse `json:"-"`
  2226. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2227. // unconditionally include in API requests. By default, fields with
  2228. // empty values are omitted from API requests. However, any non-pointer,
  2229. // non-interface field appearing in ForceSendFields will be sent to the
  2230. // server regardless of whether the field is empty or not. This may be
  2231. // used to include empty fields in Patch requests.
  2232. ForceSendFields []string `json:"-"`
  2233. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2234. // API requests with the JSON null value. By default, fields with empty
  2235. // values are omitted from API requests. However, any field with an
  2236. // empty value appearing in NullFields will be sent to the server as
  2237. // null. It is an error if a field in this list has a non-empty value.
  2238. // This may be used to include null fields in Patch requests.
  2239. NullFields []string `json:"-"`
  2240. }
  2241. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2242. type NoMethod ChangeLogsListResponse
  2243. raw := NoMethod(*s)
  2244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2245. }
  2246. // CitiesListResponse: City List Response
  2247. type CitiesListResponse struct {
  2248. // Cities: City collection.
  2249. Cities []*City `json:"cities,omitempty"`
  2250. // Kind: Identifies what kind of resource this is. Value: the fixed
  2251. // string "dfareporting#citiesListResponse".
  2252. Kind string `json:"kind,omitempty"`
  2253. // ServerResponse contains the HTTP response code and headers from the
  2254. // server.
  2255. googleapi.ServerResponse `json:"-"`
  2256. // ForceSendFields is a list of field names (e.g. "Cities") to
  2257. // unconditionally include in API requests. By default, fields with
  2258. // empty values are omitted from API requests. However, any non-pointer,
  2259. // non-interface field appearing in ForceSendFields will be sent to the
  2260. // server regardless of whether the field is empty or not. This may be
  2261. // used to include empty fields in Patch requests.
  2262. ForceSendFields []string `json:"-"`
  2263. // NullFields is a list of field names (e.g. "Cities") to include in API
  2264. // requests with the JSON null value. By default, fields with empty
  2265. // values are omitted from API requests. However, any field with an
  2266. // empty value appearing in NullFields will be sent to the server as
  2267. // null. It is an error if a field in this list has a non-empty value.
  2268. // This may be used to include null fields in Patch requests.
  2269. NullFields []string `json:"-"`
  2270. }
  2271. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2272. type NoMethod CitiesListResponse
  2273. raw := NoMethod(*s)
  2274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2275. }
  2276. // City: Contains information about a city that can be targeted by ads.
  2277. type City struct {
  2278. // CountryCode: Country code of the country to which this city belongs.
  2279. CountryCode string `json:"countryCode,omitempty"`
  2280. // CountryDartId: DART ID of the country to which this city belongs.
  2281. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2282. // DartId: DART ID of this city. This is the ID used for targeting and
  2283. // generating reports.
  2284. DartId int64 `json:"dartId,omitempty,string"`
  2285. // Kind: Identifies what kind of resource this is. Value: the fixed
  2286. // string "dfareporting#city".
  2287. Kind string `json:"kind,omitempty"`
  2288. // MetroCode: Metro region code of the metro region (DMA) to which this
  2289. // city belongs.
  2290. MetroCode string `json:"metroCode,omitempty"`
  2291. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2292. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2293. // Name: Name of this city.
  2294. Name string `json:"name,omitempty"`
  2295. // RegionCode: Region code of the region to which this city belongs.
  2296. RegionCode string `json:"regionCode,omitempty"`
  2297. // RegionDartId: DART ID of the region to which this city belongs.
  2298. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2299. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2300. // unconditionally include in API requests. By default, fields with
  2301. // empty values are omitted from API requests. However, any non-pointer,
  2302. // non-interface field appearing in ForceSendFields will be sent to the
  2303. // server regardless of whether the field is empty or not. This may be
  2304. // used to include empty fields in Patch requests.
  2305. ForceSendFields []string `json:"-"`
  2306. // NullFields is a list of field names (e.g. "CountryCode") to include
  2307. // in API requests with the JSON null value. By default, fields with
  2308. // empty values are omitted from API requests. However, any field with
  2309. // an empty value appearing in NullFields will be sent to the server as
  2310. // null. It is an error if a field in this list has a non-empty value.
  2311. // This may be used to include null fields in Patch requests.
  2312. NullFields []string `json:"-"`
  2313. }
  2314. func (s *City) MarshalJSON() ([]byte, error) {
  2315. type NoMethod City
  2316. raw := NoMethod(*s)
  2317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2318. }
  2319. // ClickTag: Creative Click Tag.
  2320. type ClickTag struct {
  2321. // ClickThroughUrl: Parameter value for the specified click tag. This
  2322. // field contains a click-through url.
  2323. ClickThroughUrl *CreativeClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2324. // EventName: Advertiser event name associated with the click tag. This
  2325. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2326. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2327. EventName string `json:"eventName,omitempty"`
  2328. // Name: Parameter name for the specified click tag. For
  2329. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2330. // value of the creative asset's creativeAssetId.name field.
  2331. Name string `json:"name,omitempty"`
  2332. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2333. // unconditionally include in API requests. By default, fields with
  2334. // empty values are omitted from API requests. However, any non-pointer,
  2335. // non-interface field appearing in ForceSendFields will be sent to the
  2336. // server regardless of whether the field is empty or not. This may be
  2337. // used to include empty fields in Patch requests.
  2338. ForceSendFields []string `json:"-"`
  2339. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2340. // include in API requests with the JSON null value. By default, fields
  2341. // with empty values are omitted from API requests. However, any field
  2342. // with an empty value appearing in NullFields will be sent to the
  2343. // server as null. It is an error if a field in this list has a
  2344. // non-empty value. This may be used to include null fields in Patch
  2345. // requests.
  2346. NullFields []string `json:"-"`
  2347. }
  2348. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2349. type NoMethod ClickTag
  2350. raw := NoMethod(*s)
  2351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2352. }
  2353. // ClickThroughUrl: Click-through URL
  2354. type ClickThroughUrl struct {
  2355. // ComputedClickThroughUrl: Read-only convenience field representing the
  2356. // actual URL that will be used for this click-through. The URL is
  2357. // computed as follows:
  2358. // - If defaultLandingPage is enabled then the campaign's default
  2359. // landing page URL is assigned to this field.
  2360. // - If defaultLandingPage is not enabled and a landingPageId is
  2361. // specified then that landing page's URL is assigned to this field.
  2362. // - If neither of the above cases apply, then the customClickThroughUrl
  2363. // is assigned to this field.
  2364. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2365. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2366. // defaultLandingPage field is set to false and the landingPageId field
  2367. // is left unset.
  2368. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2369. // DefaultLandingPage: Whether the campaign default landing page is
  2370. // used.
  2371. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2372. // LandingPageId: ID of the landing page for the click-through URL.
  2373. // Applicable if the defaultLandingPage field is set to false.
  2374. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2375. // ForceSendFields is a list of field names (e.g.
  2376. // "ComputedClickThroughUrl") to unconditionally include in API
  2377. // requests. By default, fields with empty values are omitted from API
  2378. // requests. However, any non-pointer, non-interface field appearing in
  2379. // ForceSendFields will be sent to the server regardless of whether the
  2380. // field is empty or not. This may be used to include empty fields in
  2381. // Patch requests.
  2382. ForceSendFields []string `json:"-"`
  2383. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2384. // to include in API requests with the JSON null value. By default,
  2385. // fields with empty values are omitted from API requests. However, any
  2386. // field with an empty value appearing in NullFields will be sent to the
  2387. // server as null. It is an error if a field in this list has a
  2388. // non-empty value. This may be used to include null fields in Patch
  2389. // requests.
  2390. NullFields []string `json:"-"`
  2391. }
  2392. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2393. type NoMethod ClickThroughUrl
  2394. raw := NoMethod(*s)
  2395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2396. }
  2397. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2398. type ClickThroughUrlSuffixProperties struct {
  2399. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2400. // in this entity's scope. Must be less than 128 characters long.
  2401. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2402. // OverrideInheritedSuffix: Whether this entity should override the
  2403. // inherited click-through URL suffix with its own defined value.
  2404. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2405. // ForceSendFields is a list of field names (e.g.
  2406. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2407. // By default, fields with empty values are omitted from API requests.
  2408. // However, any non-pointer, non-interface field appearing in
  2409. // ForceSendFields will be sent to the server regardless of whether the
  2410. // field is empty or not. This may be used to include empty fields in
  2411. // Patch requests.
  2412. ForceSendFields []string `json:"-"`
  2413. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2414. // include in API requests with the JSON null value. By default, fields
  2415. // with empty values are omitted from API requests. However, any field
  2416. // with an empty value appearing in NullFields will be sent to the
  2417. // server as null. It is an error if a field in this list has a
  2418. // non-empty value. This may be used to include null fields in Patch
  2419. // requests.
  2420. NullFields []string `json:"-"`
  2421. }
  2422. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2423. type NoMethod ClickThroughUrlSuffixProperties
  2424. raw := NoMethod(*s)
  2425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2426. }
  2427. // CompanionClickThroughOverride: Companion Click-through override.
  2428. type CompanionClickThroughOverride struct {
  2429. // ClickThroughUrl: Click-through URL of this companion click-through
  2430. // override.
  2431. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2432. // CreativeId: ID of the creative for this companion click-through
  2433. // override.
  2434. CreativeId int64 `json:"creativeId,omitempty,string"`
  2435. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2436. // unconditionally include in API requests. By default, fields with
  2437. // empty values are omitted from API requests. However, any non-pointer,
  2438. // non-interface field appearing in ForceSendFields will be sent to the
  2439. // server regardless of whether the field is empty or not. This may be
  2440. // used to include empty fields in Patch requests.
  2441. ForceSendFields []string `json:"-"`
  2442. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2443. // include in API requests with the JSON null value. By default, fields
  2444. // with empty values are omitted from API requests. However, any field
  2445. // with an empty value appearing in NullFields will be sent to the
  2446. // server as null. It is an error if a field in this list has a
  2447. // non-empty value. This may be used to include null fields in Patch
  2448. // requests.
  2449. NullFields []string `json:"-"`
  2450. }
  2451. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2452. type NoMethod CompanionClickThroughOverride
  2453. raw := NoMethod(*s)
  2454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2455. }
  2456. // CompanionSetting: Companion Settings
  2457. type CompanionSetting struct {
  2458. // CompanionsDisabled: Whether companions are disabled for this
  2459. // placement.
  2460. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2461. // EnabledSizes: Whitelist of companion sizes to be served to this
  2462. // placement. Set this list to null or empty to serve all companion
  2463. // sizes.
  2464. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2465. // ImageOnly: Whether to serve only static images as companions.
  2466. ImageOnly bool `json:"imageOnly,omitempty"`
  2467. // Kind: Identifies what kind of resource this is. Value: the fixed
  2468. // string "dfareporting#companionSetting".
  2469. Kind string `json:"kind,omitempty"`
  2470. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2471. // to unconditionally include in API requests. By default, fields with
  2472. // empty values are omitted from API requests. However, any non-pointer,
  2473. // non-interface field appearing in ForceSendFields will be sent to the
  2474. // server regardless of whether the field is empty or not. This may be
  2475. // used to include empty fields in Patch requests.
  2476. ForceSendFields []string `json:"-"`
  2477. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2478. // include in API requests with the JSON null value. By default, fields
  2479. // with empty values are omitted from API requests. However, any field
  2480. // with an empty value appearing in NullFields will be sent to the
  2481. // server as null. It is an error if a field in this list has a
  2482. // non-empty value. This may be used to include null fields in Patch
  2483. // requests.
  2484. NullFields []string `json:"-"`
  2485. }
  2486. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2487. type NoMethod CompanionSetting
  2488. raw := NoMethod(*s)
  2489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2490. }
  2491. // CompatibleFields: Represents a response to the queryCompatibleFields
  2492. // method.
  2493. type CompatibleFields struct {
  2494. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2495. // compatible to be selected for a report of type
  2496. // "CROSS_DIMENSION_REACH".
  2497. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2498. // FloodlightReportCompatibleFields: Contains items that are compatible
  2499. // to be selected for a report of type "FLOODLIGHT".
  2500. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2501. // Kind: The kind of resource this is, in this case
  2502. // dfareporting#compatibleFields.
  2503. Kind string `json:"kind,omitempty"`
  2504. // PathToConversionReportCompatibleFields: Contains items that are
  2505. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2506. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2507. // ReachReportCompatibleFields: Contains items that are compatible to be
  2508. // selected for a report of type "REACH".
  2509. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2510. // ReportCompatibleFields: Contains items that are compatible to be
  2511. // selected for a report of type "STANDARD".
  2512. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2513. // ServerResponse contains the HTTP response code and headers from the
  2514. // server.
  2515. googleapi.ServerResponse `json:"-"`
  2516. // ForceSendFields is a list of field names (e.g.
  2517. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2518. // include in API requests. By default, fields with empty values are
  2519. // omitted from API requests. However, any non-pointer, non-interface
  2520. // field appearing in ForceSendFields will be sent to the server
  2521. // regardless of whether the field is empty or not. This may be used to
  2522. // include empty fields in Patch requests.
  2523. ForceSendFields []string `json:"-"`
  2524. // NullFields is a list of field names (e.g.
  2525. // "CrossDimensionReachReportCompatibleFields") to include in API
  2526. // requests with the JSON null value. By default, fields with empty
  2527. // values are omitted from API requests. However, any field with an
  2528. // empty value appearing in NullFields will be sent to the server as
  2529. // null. It is an error if a field in this list has a non-empty value.
  2530. // This may be used to include null fields in Patch requests.
  2531. NullFields []string `json:"-"`
  2532. }
  2533. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2534. type NoMethod CompatibleFields
  2535. raw := NoMethod(*s)
  2536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2537. }
  2538. // ConnectionType: Contains information about an internet connection
  2539. // type that can be targeted by ads. Clients can use the connection type
  2540. // to target mobile vs. broadband users.
  2541. type ConnectionType struct {
  2542. // Id: ID of this connection type.
  2543. Id int64 `json:"id,omitempty,string"`
  2544. // Kind: Identifies what kind of resource this is. Value: the fixed
  2545. // string "dfareporting#connectionType".
  2546. Kind string `json:"kind,omitempty"`
  2547. // Name: Name of this connection type.
  2548. Name string `json:"name,omitempty"`
  2549. // ServerResponse contains the HTTP response code and headers from the
  2550. // server.
  2551. googleapi.ServerResponse `json:"-"`
  2552. // ForceSendFields is a list of field names (e.g. "Id") to
  2553. // unconditionally include in API requests. By default, fields with
  2554. // empty values are omitted from API requests. However, any non-pointer,
  2555. // non-interface field appearing in ForceSendFields will be sent to the
  2556. // server regardless of whether the field is empty or not. This may be
  2557. // used to include empty fields in Patch requests.
  2558. ForceSendFields []string `json:"-"`
  2559. // NullFields is a list of field names (e.g. "Id") to include in API
  2560. // requests with the JSON null value. By default, fields with empty
  2561. // values are omitted from API requests. However, any field with an
  2562. // empty value appearing in NullFields will be sent to the server as
  2563. // null. It is an error if a field in this list has a non-empty value.
  2564. // This may be used to include null fields in Patch requests.
  2565. NullFields []string `json:"-"`
  2566. }
  2567. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2568. type NoMethod ConnectionType
  2569. raw := NoMethod(*s)
  2570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2571. }
  2572. // ConnectionTypesListResponse: Connection Type List Response
  2573. type ConnectionTypesListResponse struct {
  2574. // ConnectionTypes: Collection of connection types such as broadband and
  2575. // mobile.
  2576. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2577. // Kind: Identifies what kind of resource this is. Value: the fixed
  2578. // string "dfareporting#connectionTypesListResponse".
  2579. Kind string `json:"kind,omitempty"`
  2580. // ServerResponse contains the HTTP response code and headers from the
  2581. // server.
  2582. googleapi.ServerResponse `json:"-"`
  2583. // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to
  2584. // unconditionally include in API requests. By default, fields with
  2585. // empty values are omitted from API requests. However, any non-pointer,
  2586. // non-interface field appearing in ForceSendFields will be sent to the
  2587. // server regardless of whether the field is empty or not. This may be
  2588. // used to include empty fields in Patch requests.
  2589. ForceSendFields []string `json:"-"`
  2590. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2591. // include in API requests with the JSON null value. By default, fields
  2592. // with empty values are omitted from API requests. However, any field
  2593. // with an empty value appearing in NullFields will be sent to the
  2594. // server as null. It is an error if a field in this list has a
  2595. // non-empty value. This may be used to include null fields in Patch
  2596. // requests.
  2597. NullFields []string `json:"-"`
  2598. }
  2599. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2600. type NoMethod ConnectionTypesListResponse
  2601. raw := NoMethod(*s)
  2602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2603. }
  2604. // ContentCategoriesListResponse: Content Category List Response
  2605. type ContentCategoriesListResponse struct {
  2606. // ContentCategories: Content category collection.
  2607. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2608. // Kind: Identifies what kind of resource this is. Value: the fixed
  2609. // string "dfareporting#contentCategoriesListResponse".
  2610. Kind string `json:"kind,omitempty"`
  2611. // NextPageToken: Pagination token to be used for the next list
  2612. // operation.
  2613. NextPageToken string `json:"nextPageToken,omitempty"`
  2614. // ServerResponse contains the HTTP response code and headers from the
  2615. // server.
  2616. googleapi.ServerResponse `json:"-"`
  2617. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2618. // to unconditionally include in API requests. By default, fields with
  2619. // empty values are omitted from API requests. However, any non-pointer,
  2620. // non-interface field appearing in ForceSendFields will be sent to the
  2621. // server regardless of whether the field is empty or not. This may be
  2622. // used to include empty fields in Patch requests.
  2623. ForceSendFields []string `json:"-"`
  2624. // NullFields is a list of field names (e.g. "ContentCategories") to
  2625. // include in API requests with the JSON null value. By default, fields
  2626. // with empty values are omitted from API requests. However, any field
  2627. // with an empty value appearing in NullFields will be sent to the
  2628. // server as null. It is an error if a field in this list has a
  2629. // non-empty value. This may be used to include null fields in Patch
  2630. // requests.
  2631. NullFields []string `json:"-"`
  2632. }
  2633. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2634. type NoMethod ContentCategoriesListResponse
  2635. raw := NoMethod(*s)
  2636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2637. }
  2638. // ContentCategory: Organizes placements according to the contents of
  2639. // their associated webpages.
  2640. type ContentCategory struct {
  2641. // AccountId: Account ID of this content category. This is a read-only
  2642. // field that can be left blank.
  2643. AccountId int64 `json:"accountId,omitempty,string"`
  2644. // Id: ID of this content category. This is a read-only, auto-generated
  2645. // field.
  2646. Id int64 `json:"id,omitempty,string"`
  2647. // Kind: Identifies what kind of resource this is. Value: the fixed
  2648. // string "dfareporting#contentCategory".
  2649. Kind string `json:"kind,omitempty"`
  2650. // Name: Name of this content category. This is a required field and
  2651. // must be less than 256 characters long and unique among content
  2652. // categories of the same account.
  2653. Name string `json:"name,omitempty"`
  2654. // ServerResponse contains the HTTP response code and headers from the
  2655. // server.
  2656. googleapi.ServerResponse `json:"-"`
  2657. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2658. // unconditionally include in API requests. By default, fields with
  2659. // empty values are omitted from API requests. However, any non-pointer,
  2660. // non-interface field appearing in ForceSendFields will be sent to the
  2661. // server regardless of whether the field is empty or not. This may be
  2662. // used to include empty fields in Patch requests.
  2663. ForceSendFields []string `json:"-"`
  2664. // NullFields is a list of field names (e.g. "AccountId") to include in
  2665. // API requests with the JSON null value. By default, fields with empty
  2666. // values are omitted from API requests. However, any field with an
  2667. // empty value appearing in NullFields will be sent to the server as
  2668. // null. It is an error if a field in this list has a non-empty value.
  2669. // This may be used to include null fields in Patch requests.
  2670. NullFields []string `json:"-"`
  2671. }
  2672. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2673. type NoMethod ContentCategory
  2674. raw := NoMethod(*s)
  2675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2676. }
  2677. // Conversion: A Conversion represents when a user successfully performs
  2678. // a desired action after seeing an ad.
  2679. type Conversion struct {
  2680. // ChildDirectedTreatment: Whether this particular request may come from
  2681. // a user under the age of 13, under COPPA compliance.
  2682. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2683. // CustomVariables: Custom floodlight variables.
  2684. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2685. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2686. // encryptionInfo should also be specified. This field is mutually
  2687. // exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid.
  2688. // This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a
  2689. // required field.
  2690. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2691. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2692. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2693. // be used in the inserted conversion. If no such user ID is found then
  2694. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2695. // When set, encryptionInfo should also be specified. This field may
  2696. // only be used when calling batchinsert; it is not supported by
  2697. // batchupdate. This field is mutually exclusive with encryptedUserId,
  2698. // mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId
  2699. // or gclid is a required field.
  2700. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2701. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2702. // is a required field.
  2703. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2704. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2705. // conversion. This is a required field.
  2706. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2707. // Gclid: The Google click ID. This field is mutually exclusive with
  2708. // encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This
  2709. // or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId
  2710. // is a required field.
  2711. Gclid string `json:"gclid,omitempty"`
  2712. // Kind: Identifies what kind of resource this is. Value: the fixed
  2713. // string "dfareporting#conversion".
  2714. Kind string `json:"kind,omitempty"`
  2715. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2716. // true, the conversion will be used for reporting but not targeting.
  2717. // This will prevent remarketing.
  2718. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2719. // MobileDeviceId: The mobile device ID. This field is mutually
  2720. // exclusive with encryptedUserId, encryptedUserIdCandidates[] and
  2721. // gclid. This or encryptedUserId or encryptedUserIdCandidates[] or
  2722. // gclid is a required field.
  2723. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2724. // NonPersonalizedAd: Whether the conversion was for a non personalized
  2725. // ad.
  2726. NonPersonalizedAd bool `json:"nonPersonalizedAd,omitempty"`
  2727. // Ordinal: The ordinal of the conversion. Use this field to control how
  2728. // conversions of the same user and day are de-duplicated. This is a
  2729. // required field.
  2730. Ordinal string `json:"ordinal,omitempty"`
  2731. // Quantity: The quantity of the conversion.
  2732. Quantity int64 `json:"quantity,omitempty,string"`
  2733. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2734. // This is a required field.
  2735. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2736. // TreatmentForUnderage: Whether this particular request may come from a
  2737. // user under the age of 16 (may differ by country), under compliance
  2738. // with the European Union's General Data Protection Regulation (GDPR).
  2739. TreatmentForUnderage bool `json:"treatmentForUnderage,omitempty"`
  2740. // Value: The value of the conversion.
  2741. Value float64 `json:"value,omitempty"`
  2742. // ForceSendFields is a list of field names (e.g.
  2743. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2744. // By default, fields with empty values are omitted from API requests.
  2745. // However, any non-pointer, non-interface field appearing in
  2746. // ForceSendFields will be sent to the server regardless of whether the
  2747. // field is empty or not. This may be used to include empty fields in
  2748. // Patch requests.
  2749. ForceSendFields []string `json:"-"`
  2750. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2751. // to include in API requests with the JSON null value. By default,
  2752. // fields with empty values are omitted from API requests. However, any
  2753. // field with an empty value appearing in NullFields will be sent to the
  2754. // server as null. It is an error if a field in this list has a
  2755. // non-empty value. This may be used to include null fields in Patch
  2756. // requests.
  2757. NullFields []string `json:"-"`
  2758. }
  2759. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2760. type NoMethod Conversion
  2761. raw := NoMethod(*s)
  2762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2763. }
  2764. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2765. type NoMethod Conversion
  2766. var s1 struct {
  2767. Value gensupport.JSONFloat64 `json:"value"`
  2768. *NoMethod
  2769. }
  2770. s1.NoMethod = (*NoMethod)(s)
  2771. if err := json.Unmarshal(data, &s1); err != nil {
  2772. return err
  2773. }
  2774. s.Value = float64(s1.Value)
  2775. return nil
  2776. }
  2777. // ConversionError: The error code and description for a conversion that
  2778. // failed to insert or update.
  2779. type ConversionError struct {
  2780. // Code: The error code.
  2781. //
  2782. // Possible values:
  2783. // "INTERNAL"
  2784. // "INVALID_ARGUMENT"
  2785. // "NOT_FOUND"
  2786. // "PERMISSION_DENIED"
  2787. Code string `json:"code,omitempty"`
  2788. // Kind: Identifies what kind of resource this is. Value: the fixed
  2789. // string "dfareporting#conversionError".
  2790. Kind string `json:"kind,omitempty"`
  2791. // Message: A description of the error.
  2792. Message string `json:"message,omitempty"`
  2793. // ForceSendFields is a list of field names (e.g. "Code") to
  2794. // unconditionally include in API requests. By default, fields with
  2795. // empty values are omitted from API requests. However, any non-pointer,
  2796. // non-interface field appearing in ForceSendFields will be sent to the
  2797. // server regardless of whether the field is empty or not. This may be
  2798. // used to include empty fields in Patch requests.
  2799. ForceSendFields []string `json:"-"`
  2800. // NullFields is a list of field names (e.g. "Code") to include in API
  2801. // requests with the JSON null value. By default, fields with empty
  2802. // values are omitted from API requests. However, any field with an
  2803. // empty value appearing in NullFields will be sent to the server as
  2804. // null. It is an error if a field in this list has a non-empty value.
  2805. // This may be used to include null fields in Patch requests.
  2806. NullFields []string `json:"-"`
  2807. }
  2808. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2809. type NoMethod ConversionError
  2810. raw := NoMethod(*s)
  2811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2812. }
  2813. // ConversionStatus: The original conversion that was inserted or
  2814. // updated and whether there were any errors.
  2815. type ConversionStatus struct {
  2816. // Conversion: The original conversion that was inserted or updated.
  2817. Conversion *Conversion `json:"conversion,omitempty"`
  2818. // Errors: A list of errors related to this conversion.
  2819. Errors []*ConversionError `json:"errors,omitempty"`
  2820. // Kind: Identifies what kind of resource this is. Value: the fixed
  2821. // string "dfareporting#conversionStatus".
  2822. Kind string `json:"kind,omitempty"`
  2823. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2824. // unconditionally include in API requests. By default, fields with
  2825. // empty values are omitted from API requests. However, any non-pointer,
  2826. // non-interface field appearing in ForceSendFields will be sent to the
  2827. // server regardless of whether the field is empty or not. This may be
  2828. // used to include empty fields in Patch requests.
  2829. ForceSendFields []string `json:"-"`
  2830. // NullFields is a list of field names (e.g. "Conversion") to include in
  2831. // API requests with the JSON null value. By default, fields with empty
  2832. // values are omitted from API requests. However, any field with an
  2833. // empty value appearing in NullFields will be sent to the server as
  2834. // null. It is an error if a field in this list has a non-empty value.
  2835. // This may be used to include null fields in Patch requests.
  2836. NullFields []string `json:"-"`
  2837. }
  2838. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2839. type NoMethod ConversionStatus
  2840. raw := NoMethod(*s)
  2841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2842. }
  2843. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2844. type ConversionsBatchInsertRequest struct {
  2845. // Conversions: The set of conversions to insert.
  2846. Conversions []*Conversion `json:"conversions,omitempty"`
  2847. // EncryptionInfo: Describes how encryptedUserId or
  2848. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2849. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2850. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2851. // Kind: Identifies what kind of resource this is. Value: the fixed
  2852. // string "dfareporting#conversionsBatchInsertRequest".
  2853. Kind string `json:"kind,omitempty"`
  2854. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2855. // unconditionally include in API requests. By default, fields with
  2856. // empty values are omitted from API requests. However, any non-pointer,
  2857. // non-interface field appearing in ForceSendFields will be sent to the
  2858. // server regardless of whether the field is empty or not. This may be
  2859. // used to include empty fields in Patch requests.
  2860. ForceSendFields []string `json:"-"`
  2861. // NullFields is a list of field names (e.g. "Conversions") to include
  2862. // in API requests with the JSON null value. By default, fields with
  2863. // empty values are omitted from API requests. However, any field with
  2864. // an empty value appearing in NullFields will be sent to the server as
  2865. // null. It is an error if a field in this list has a non-empty value.
  2866. // This may be used to include null fields in Patch requests.
  2867. NullFields []string `json:"-"`
  2868. }
  2869. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2870. type NoMethod ConversionsBatchInsertRequest
  2871. raw := NoMethod(*s)
  2872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2873. }
  2874. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2875. type ConversionsBatchInsertResponse struct {
  2876. // HasFailures: Indicates that some or all conversions failed to insert.
  2877. HasFailures bool `json:"hasFailures,omitempty"`
  2878. // Kind: Identifies what kind of resource this is. Value: the fixed
  2879. // string "dfareporting#conversionsBatchInsertResponse".
  2880. Kind string `json:"kind,omitempty"`
  2881. // Status: The insert status of each conversion. Statuses are returned
  2882. // in the same order that conversions are inserted.
  2883. Status []*ConversionStatus `json:"status,omitempty"`
  2884. // ServerResponse contains the HTTP response code and headers from the
  2885. // server.
  2886. googleapi.ServerResponse `json:"-"`
  2887. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2888. // unconditionally include in API requests. By default, fields with
  2889. // empty values are omitted from API requests. However, any non-pointer,
  2890. // non-interface field appearing in ForceSendFields will be sent to the
  2891. // server regardless of whether the field is empty or not. This may be
  2892. // used to include empty fields in Patch requests.
  2893. ForceSendFields []string `json:"-"`
  2894. // NullFields is a list of field names (e.g. "HasFailures") to include
  2895. // in API requests with the JSON null value. By default, fields with
  2896. // empty values are omitted from API requests. However, any field with
  2897. // an empty value appearing in NullFields will be sent to the server as
  2898. // null. It is an error if a field in this list has a non-empty value.
  2899. // This may be used to include null fields in Patch requests.
  2900. NullFields []string `json:"-"`
  2901. }
  2902. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2903. type NoMethod ConversionsBatchInsertResponse
  2904. raw := NoMethod(*s)
  2905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2906. }
  2907. // ConversionsBatchUpdateRequest: Update Conversions Request.
  2908. type ConversionsBatchUpdateRequest struct {
  2909. // Conversions: The set of conversions to update.
  2910. Conversions []*Conversion `json:"conversions,omitempty"`
  2911. // EncryptionInfo: Describes how encryptedUserId is encrypted. This is a
  2912. // required field if encryptedUserId is used.
  2913. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2914. // Kind: Identifies what kind of resource this is. Value: the fixed
  2915. // string "dfareporting#conversionsBatchUpdateRequest".
  2916. Kind string `json:"kind,omitempty"`
  2917. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2918. // unconditionally include in API requests. By default, fields with
  2919. // empty values are omitted from API requests. However, any non-pointer,
  2920. // non-interface field appearing in ForceSendFields will be sent to the
  2921. // server regardless of whether the field is empty or not. This may be
  2922. // used to include empty fields in Patch requests.
  2923. ForceSendFields []string `json:"-"`
  2924. // NullFields is a list of field names (e.g. "Conversions") to include
  2925. // in API requests with the JSON null value. By default, fields with
  2926. // empty values are omitted from API requests. However, any field with
  2927. // an empty value appearing in NullFields will be sent to the server as
  2928. // null. It is an error if a field in this list has a non-empty value.
  2929. // This may be used to include null fields in Patch requests.
  2930. NullFields []string `json:"-"`
  2931. }
  2932. func (s *ConversionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  2933. type NoMethod ConversionsBatchUpdateRequest
  2934. raw := NoMethod(*s)
  2935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2936. }
  2937. // ConversionsBatchUpdateResponse: Update Conversions Response.
  2938. type ConversionsBatchUpdateResponse struct {
  2939. // HasFailures: Indicates that some or all conversions failed to update.
  2940. HasFailures bool `json:"hasFailures,omitempty"`
  2941. // Kind: Identifies what kind of resource this is. Value: the fixed
  2942. // string "dfareporting#conversionsBatchUpdateResponse".
  2943. Kind string `json:"kind,omitempty"`
  2944. // Status: The update status of each conversion. Statuses are returned
  2945. // in the same order that conversions are updated.
  2946. Status []*ConversionStatus `json:"status,omitempty"`
  2947. // ServerResponse contains the HTTP response code and headers from the
  2948. // server.
  2949. googleapi.ServerResponse `json:"-"`
  2950. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2951. // unconditionally include in API requests. By default, fields with
  2952. // empty values are omitted from API requests. However, any non-pointer,
  2953. // non-interface field appearing in ForceSendFields will be sent to the
  2954. // server regardless of whether the field is empty or not. This may be
  2955. // used to include empty fields in Patch requests.
  2956. ForceSendFields []string `json:"-"`
  2957. // NullFields is a list of field names (e.g. "HasFailures") to include
  2958. // in API requests with the JSON null value. By default, fields with
  2959. // empty values are omitted from API requests. However, any field with
  2960. // an empty value appearing in NullFields will be sent to the server as
  2961. // null. It is an error if a field in this list has a non-empty value.
  2962. // This may be used to include null fields in Patch requests.
  2963. NullFields []string `json:"-"`
  2964. }
  2965. func (s *ConversionsBatchUpdateResponse) MarshalJSON() ([]byte, error) {
  2966. type NoMethod ConversionsBatchUpdateResponse
  2967. raw := NoMethod(*s)
  2968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2969. }
  2970. // CountriesListResponse: Country List Response
  2971. type CountriesListResponse struct {
  2972. // Countries: Country collection.
  2973. Countries []*Country `json:"countries,omitempty"`
  2974. // Kind: Identifies what kind of resource this is. Value: the fixed
  2975. // string "dfareporting#countriesListResponse".
  2976. Kind string `json:"kind,omitempty"`
  2977. // ServerResponse contains the HTTP response code and headers from the
  2978. // server.
  2979. googleapi.ServerResponse `json:"-"`
  2980. // ForceSendFields is a list of field names (e.g. "Countries") to
  2981. // unconditionally include in API requests. By default, fields with
  2982. // empty values are omitted from API requests. However, any non-pointer,
  2983. // non-interface field appearing in ForceSendFields will be sent to the
  2984. // server regardless of whether the field is empty or not. This may be
  2985. // used to include empty fields in Patch requests.
  2986. ForceSendFields []string `json:"-"`
  2987. // NullFields is a list of field names (e.g. "Countries") to include in
  2988. // API requests with the JSON null value. By default, fields with empty
  2989. // values are omitted from API requests. However, any field with an
  2990. // empty value appearing in NullFields will be sent to the server as
  2991. // null. It is an error if a field in this list has a non-empty value.
  2992. // This may be used to include null fields in Patch requests.
  2993. NullFields []string `json:"-"`
  2994. }
  2995. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2996. type NoMethod CountriesListResponse
  2997. raw := NoMethod(*s)
  2998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2999. }
  3000. // Country: Contains information about a country that can be targeted by
  3001. // ads.
  3002. type Country struct {
  3003. // CountryCode: Country code.
  3004. CountryCode string `json:"countryCode,omitempty"`
  3005. // DartId: DART ID of this country. This is the ID used for targeting
  3006. // and generating reports.
  3007. DartId int64 `json:"dartId,omitempty,string"`
  3008. // Kind: Identifies what kind of resource this is. Value: the fixed
  3009. // string "dfareporting#country".
  3010. Kind string `json:"kind,omitempty"`
  3011. // Name: Name of this country.
  3012. Name string `json:"name,omitempty"`
  3013. // SslEnabled: Whether ad serving supports secure servers in this
  3014. // country.
  3015. SslEnabled bool `json:"sslEnabled,omitempty"`
  3016. // ServerResponse contains the HTTP response code and headers from the
  3017. // server.
  3018. googleapi.ServerResponse `json:"-"`
  3019. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  3020. // unconditionally include in API requests. By default, fields with
  3021. // empty values are omitted from API requests. However, any non-pointer,
  3022. // non-interface field appearing in ForceSendFields will be sent to the
  3023. // server regardless of whether the field is empty or not. This may be
  3024. // used to include empty fields in Patch requests.
  3025. ForceSendFields []string `json:"-"`
  3026. // NullFields is a list of field names (e.g. "CountryCode") to include
  3027. // in API requests with the JSON null value. By default, fields with
  3028. // empty values are omitted from API requests. However, any field with
  3029. // an empty value appearing in NullFields will be sent to the server as
  3030. // null. It is an error if a field in this list has a non-empty value.
  3031. // This may be used to include null fields in Patch requests.
  3032. NullFields []string `json:"-"`
  3033. }
  3034. func (s *Country) MarshalJSON() ([]byte, error) {
  3035. type NoMethod Country
  3036. raw := NoMethod(*s)
  3037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3038. }
  3039. // Creative: Contains properties of a Creative.
  3040. type Creative struct {
  3041. // AccountId: Account ID of this creative. This field, if left unset,
  3042. // will be auto-generated for both insert and update operations.
  3043. // Applicable to all creative types.
  3044. AccountId int64 `json:"accountId,omitempty,string"`
  3045. // Active: Whether the creative is active. Applicable to all creative
  3046. // types.
  3047. Active bool `json:"active,omitempty"`
  3048. // AdParameters: Ad parameters user for VPAID creative. This is a
  3049. // read-only field. Applicable to the following creative types: all
  3050. // VPAID.
  3051. AdParameters string `json:"adParameters,omitempty"`
  3052. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  3053. // customize the creative settings of a Rich Media ad running on your
  3054. // site without having to contact the advertiser. You can use keywords
  3055. // to dynamically change the look or functionality of a creative.
  3056. // Applicable to the following creative types: all RICH_MEDIA, and all
  3057. // VPAID.
  3058. AdTagKeys []string `json:"adTagKeys,omitempty"`
  3059. // AdditionalSizes: Additional sizes associated with a responsive
  3060. // creative. When inserting or updating a creative either the size ID
  3061. // field or size width and height fields can be used. Applicable to
  3062. // DISPLAY creatives when the primary asset type is HTML_IMAGE.
  3063. AdditionalSizes []*Size `json:"additionalSizes,omitempty"`
  3064. // AdvertiserId: Advertiser ID of this creative. This is a required
  3065. // field. Applicable to all creative types.
  3066. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  3067. // AllowScriptAccess: Whether script access is allowed for this
  3068. // creative. This is a read-only and deprecated field which will
  3069. // automatically be set to true on update. Applicable to the following
  3070. // creative types: FLASH_INPAGE.
  3071. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  3072. // Archived: Whether the creative is archived. Applicable to all
  3073. // creative types.
  3074. Archived bool `json:"archived,omitempty"`
  3075. // ArtworkType: Type of artwork used for the creative. This is a
  3076. // read-only field. Applicable to the following creative types: all
  3077. // RICH_MEDIA, and all VPAID.
  3078. //
  3079. // Possible values:
  3080. // "ARTWORK_TYPE_FLASH"
  3081. // "ARTWORK_TYPE_HTML5"
  3082. // "ARTWORK_TYPE_IMAGE"
  3083. // "ARTWORK_TYPE_MIXED"
  3084. ArtworkType string `json:"artworkType,omitempty"`
  3085. // AuthoringSource: Source application where creative was authored.
  3086. // Presently, only DBM authored creatives will have this field set.
  3087. // Applicable to all creative types.
  3088. //
  3089. // Possible values:
  3090. // "CREATIVE_AUTHORING_SOURCE_DBM"
  3091. // "CREATIVE_AUTHORING_SOURCE_DCM"
  3092. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  3093. AuthoringSource string `json:"authoringSource,omitempty"`
  3094. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  3095. // read-only field. Applicable to the following creative types:
  3096. // HTML5_BANNER.
  3097. //
  3098. // Possible values:
  3099. // "NINJA"
  3100. // "SWIFFY"
  3101. AuthoringTool string `json:"authoringTool,omitempty"`
  3102. // AutoAdvanceImages: Whether images are automatically advanced for
  3103. // image gallery creatives. Applicable to the following creative types:
  3104. // DISPLAY_IMAGE_GALLERY.
  3105. AutoAdvanceImages bool `json:"autoAdvanceImages,omitempty"`
  3106. // BackgroundColor: The 6-character HTML color code, beginning with #,
  3107. // for the background of the window area where the Flash file is
  3108. // displayed. Default is white. Applicable to the following creative
  3109. // types: FLASH_INPAGE.
  3110. BackgroundColor string `json:"backgroundColor,omitempty"`
  3111. // BackupImageClickThroughUrl: Click-through URL for backup image.
  3112. // Applicable to ENHANCED_BANNER when the primary asset type is not
  3113. // HTML_IMAGE.
  3114. BackupImageClickThroughUrl *CreativeClickThroughUrl `json:"backupImageClickThroughUrl,omitempty"`
  3115. // BackupImageFeatures: List of feature dependencies that will cause a
  3116. // backup image to be served if the browser that serves the ad does not
  3117. // support them. Feature dependencies are features that a browser must
  3118. // be able to support in order to render your HTML5 creative asset
  3119. // correctly. This field is initially auto-generated to contain all
  3120. // features detected by Campaign Manager for all the assets of this
  3121. // creative and can then be modified by the client. To reset this field,
  3122. // copy over all the creativeAssets' detected features. Applicable to
  3123. // the following creative types: HTML5_BANNER. Applicable to DISPLAY
  3124. // when the primary asset type is not HTML_IMAGE.
  3125. //
  3126. // Possible values:
  3127. // "APPLICATION_CACHE"
  3128. // "AUDIO"
  3129. // "CANVAS"
  3130. // "CANVAS_TEXT"
  3131. // "CSS_ANIMATIONS"
  3132. // "CSS_BACKGROUND_SIZE"
  3133. // "CSS_BORDER_IMAGE"
  3134. // "CSS_BORDER_RADIUS"
  3135. // "CSS_BOX_SHADOW"
  3136. // "CSS_COLUMNS"
  3137. // "CSS_FLEX_BOX"
  3138. // "CSS_FONT_FACE"
  3139. // "CSS_GENERATED_CONTENT"
  3140. // "CSS_GRADIENTS"
  3141. // "CSS_HSLA"
  3142. // "CSS_MULTIPLE_BGS"
  3143. // "CSS_OPACITY"
  3144. // "CSS_REFLECTIONS"
  3145. // "CSS_RGBA"
  3146. // "CSS_TEXT_SHADOW"
  3147. // "CSS_TRANSFORMS"
  3148. // "CSS_TRANSFORMS3D"
  3149. // "CSS_TRANSITIONS"
  3150. // "DRAG_AND_DROP"
  3151. // "GEO_LOCATION"
  3152. // "HASH_CHANGE"
  3153. // "HISTORY"
  3154. // "INDEXED_DB"
  3155. // "INLINE_SVG"
  3156. // "INPUT_ATTR_AUTOCOMPLETE"
  3157. // "INPUT_ATTR_AUTOFOCUS"
  3158. // "INPUT_ATTR_LIST"
  3159. // "INPUT_ATTR_MAX"
  3160. // "INPUT_ATTR_MIN"
  3161. // "INPUT_ATTR_MULTIPLE"
  3162. // "INPUT_ATTR_PATTERN"
  3163. // "INPUT_ATTR_PLACEHOLDER"
  3164. // "INPUT_ATTR_REQUIRED"
  3165. // "INPUT_ATTR_STEP"
  3166. // "INPUT_TYPE_COLOR"
  3167. // "INPUT_TYPE_DATE"
  3168. // "INPUT_TYPE_DATETIME"
  3169. // "INPUT_TYPE_DATETIME_LOCAL"
  3170. // "INPUT_TYPE_EMAIL"
  3171. // "INPUT_TYPE_MONTH"
  3172. // "INPUT_TYPE_NUMBER"
  3173. // "INPUT_TYPE_RANGE"
  3174. // "INPUT_TYPE_SEARCH"
  3175. // "INPUT_TYPE_TEL"
  3176. // "INPUT_TYPE_TIME"
  3177. // "INPUT_TYPE_URL"
  3178. // "INPUT_TYPE_WEEK"
  3179. // "LOCAL_STORAGE"
  3180. // "POST_MESSAGE"
  3181. // "SESSION_STORAGE"
  3182. // "SMIL"
  3183. // "SVG_CLIP_PATHS"
  3184. // "SVG_FE_IMAGE"
  3185. // "SVG_FILTERS"
  3186. // "SVG_HREF"
  3187. // "TOUCH"
  3188. // "VIDEO"
  3189. // "WEBGL"
  3190. // "WEB_SOCKETS"
  3191. // "WEB_SQL_DATABASE"
  3192. // "WEB_WORKERS"
  3193. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  3194. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  3195. // backup image. Applicable to the following creative types: DISPLAY
  3196. // when the primary asset type is not HTML_IMAGE.
  3197. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  3198. // BackupImageTargetWindow: Target window for backup image. Applicable
  3199. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  3200. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3201. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  3202. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  3203. // HTML5_BANNER creatives, this is a subset of detected click tags for
  3204. // the assets associated with this creative. After creating a flash
  3205. // asset, detected click tags will be returned in the
  3206. // creativeAssetMetadata. When inserting the creative, populate the
  3207. // creative clickTags field using the creativeAssetMetadata.clickTags
  3208. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  3209. // one entry in this list for each image creative asset. A click tag is
  3210. // matched with a corresponding creative asset by matching the
  3211. // clickTag.name field with the creativeAsset.assetIdentifier.name
  3212. // field. Applicable to the following creative types:
  3213. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  3214. // DISPLAY when the primary asset type is not HTML_IMAGE.
  3215. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3216. // CommercialId: Industry standard ID assigned to creative for reach and
  3217. // frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives.
  3218. CommercialId string `json:"commercialId,omitempty"`
  3219. // CompanionCreatives: List of companion creatives assigned to an
  3220. // in-Stream video creative. Acceptable values include IDs of existing
  3221. // flash and image creatives. Applicable to the following creative
  3222. // types: all VPAID, all INSTREAM_AUDIO and all INSTREAM_VIDEO with
  3223. // dynamicAssetSelection set to false.
  3224. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  3225. // Compatibility: Compatibilities associated with this creative. This is
  3226. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3227. // rendering either on desktop or on mobile devices or in mobile apps
  3228. // for regular or interstitial ads, respectively. APP and
  3229. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3230. // creatives may have these compatibilities since new creatives will
  3231. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3232. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3233. // with the VAST standard. IN_STREAM_AUDIO refers to rendering in
  3234. // in-stream audio ads developed with the VAST standard. Applicable to
  3235. // all creative types.
  3236. //
  3237. // Acceptable values are:
  3238. // - "APP"
  3239. // - "APP_INTERSTITIAL"
  3240. // - "IN_STREAM_VIDEO"
  3241. // - "IN_STREAM_AUDIO"
  3242. // - "DISPLAY"
  3243. // - "DISPLAY_INTERSTITIAL"
  3244. //
  3245. // Possible values:
  3246. // "APP"
  3247. // "APP_INTERSTITIAL"
  3248. // "DISPLAY"
  3249. // "DISPLAY_INTERSTITIAL"
  3250. // "IN_STREAM_AUDIO"
  3251. // "IN_STREAM_VIDEO"
  3252. Compatibility []string `json:"compatibility,omitempty"`
  3253. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3254. // creative need to be automatically converted to HTML5. This flag is
  3255. // enabled by default and users can choose to disable it if they don't
  3256. // want the system to generate and use HTML5 asset for this creative.
  3257. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3258. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3259. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3260. // CounterCustomEvents: List of counter events configured for the
  3261. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3262. // and auto-generated from clickTags. Applicable to the following
  3263. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3264. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3265. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3266. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3267. // CreativeAssets: Assets associated with a creative. Applicable to all
  3268. // but the following creative types: INTERNAL_REDIRECT,
  3269. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3270. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3271. // CreativeFieldAssignments: Creative field assignments for this
  3272. // creative. Applicable to all creative types.
  3273. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3274. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3275. // Key-values let you customize the creative settings of a Rich Media ad
  3276. // running on your site without having to contact the advertiser. You
  3277. // can use key-values to dynamically change the look or functionality of
  3278. // a creative. Applicable to the following creative types: all
  3279. // RICH_MEDIA, and all VPAID.
  3280. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3281. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3282. // target individual assets in this creative. When set to true
  3283. // creativeAssetSelection must be set. This also controls asset-level
  3284. // companions. When this is true, companion creatives should be assigned
  3285. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3286. // creatives.
  3287. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3288. // ExitCustomEvents: List of exit events configured for the creative.
  3289. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3290. // and auto-generated from clickTags, For DISPLAY, an event is also
  3291. // created from the backupImageReportingLabel. Applicable to the
  3292. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3293. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3294. // HTML_IMAGE.
  3295. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3296. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3297. // file communicate with either Flash Player or the program hosting
  3298. // Flash Player, such as a web browser. This is only triggered if
  3299. // allowScriptAccess field is true. Applicable to the following creative
  3300. // types: FLASH_INPAGE.
  3301. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3302. // HtmlCode: HTML code for the creative. This is a required field when
  3303. // applicable. This field is ignored if htmlCodeLocked is true.
  3304. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3305. // and HTML5_BANNER, and all RICH_MEDIA.
  3306. HtmlCode string `json:"htmlCode,omitempty"`
  3307. // HtmlCodeLocked: Whether HTML code is generated by Campaign Manager or
  3308. // manually entered. Set to true to ignore changes to htmlCode.
  3309. // Applicable to the following creative types: FLASH_INPAGE and
  3310. // HTML5_BANNER.
  3311. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3312. // Id: ID of this creative. This is a read-only, auto-generated field.
  3313. // Applicable to all creative types.
  3314. Id int64 `json:"id,omitempty,string"`
  3315. // IdDimensionValue: Dimension value for the ID of this creative. This
  3316. // is a read-only field. Applicable to all creative types.
  3317. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3318. // Kind: Identifies what kind of resource this is. Value: the fixed
  3319. // string "dfareporting#creative".
  3320. Kind string `json:"kind,omitempty"`
  3321. // LastModifiedInfo: Creative last modification information. This is a
  3322. // read-only field. Applicable to all creative types.
  3323. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3324. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3325. // associated with rich media and VPAID creatives. This is a read-only
  3326. // field. Applicable to the following creative types: all RICH_MEDIA,
  3327. // and all VPAID.
  3328. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3329. // MediaDescription: Description of the audio or video ad. Applicable to
  3330. // the following creative types: all INSTREAM_VIDEO, INSTREAM_AUDIO, and
  3331. // all VPAID.
  3332. MediaDescription string `json:"mediaDescription,omitempty"`
  3333. // MediaDuration: Creative audio or video duration in seconds. This is a
  3334. // read-only field. Applicable to the following creative types:
  3335. // INSTREAM_VIDEO, INSTREAM_AUDIO, all RICH_MEDIA, and all VPAID.
  3336. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3337. // Name: Name of the creative. This is a required field and must be less
  3338. // than 256 characters long. Applicable to all creative types.
  3339. Name string `json:"name,omitempty"`
  3340. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3341. // to the following creative types: all RICH_MEDIA.
  3342. OverrideCss string `json:"overrideCss,omitempty"`
  3343. // PoliteLoadAssetId: The asset ID of the polite load image asset.
  3344. // Applicable to the creative type: DISPLAY.
  3345. PoliteLoadAssetId int64 `json:"politeLoadAssetId,omitempty,string"`
  3346. // ProgressOffset: Amount of time to play the video before counting a
  3347. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3348. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3349. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3350. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3351. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3352. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3353. // This is a required field when applicable. Applicable to the following
  3354. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3355. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3356. RedirectUrl string `json:"redirectUrl,omitempty"`
  3357. // RenderingId: ID of current rendering version. This is a read-only
  3358. // field. Applicable to all creative types.
  3359. RenderingId int64 `json:"renderingId,omitempty,string"`
  3360. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3361. // this creative. This is a read-only field. Applicable to all creative
  3362. // types.
  3363. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3364. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3365. // for this creative. For example, 11.2.202.235. This is a read-only
  3366. // field. Applicable to the following creative types: all RICH_MEDIA,
  3367. // and all VPAID.
  3368. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3369. // RequiredFlashVersion: The internal Flash version for this creative as
  3370. // calculated by Studio. This is a read-only field. Applicable to the
  3371. // following creative types: FLASH_INPAGE all RICH_MEDIA, and all VPAID.
  3372. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3373. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3374. // Size: Size associated with this creative. When inserting or updating
  3375. // a creative either the size ID field or size width and height fields
  3376. // can be used. This is a required field when applicable; however for
  3377. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3378. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3379. // automatically set using the actual size of the associated image
  3380. // assets. Applicable to the following creative types: DISPLAY,
  3381. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3382. // RICH_MEDIA.
  3383. Size *Size `json:"size,omitempty"`
  3384. // SkipOffset: Amount of time to play the video before the skip button
  3385. // appears. Applicable to the following creative types: all
  3386. // INSTREAM_VIDEO.
  3387. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3388. // Skippable: Whether the user can choose to skip the creative.
  3389. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3390. // all VPAID.
  3391. Skippable bool `json:"skippable,omitempty"`
  3392. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3393. // read-only field. Applicable to all creative types.
  3394. SslCompliant bool `json:"sslCompliant,omitempty"`
  3395. // SslOverride: Whether creative should be treated as SSL compliant even
  3396. // if the system scan shows it's not. Applicable to all creative types.
  3397. SslOverride bool `json:"sslOverride,omitempty"`
  3398. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3399. // and VPAID creatives. This is a read-only field. Applicable to the
  3400. // following creative types: all RICH_MEDIA, and all VPAID.
  3401. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3402. // StudioCreativeId: Studio creative ID associated with rich media and
  3403. // VPAID creatives. This is a read-only field. Applicable to the
  3404. // following creative types: all RICH_MEDIA, and all VPAID.
  3405. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3406. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3407. // with rich media and VPAID creatives. This is a read-only field.
  3408. // Applicable to the following creative types: all RICH_MEDIA, and all
  3409. // VPAID.
  3410. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3411. // SubaccountId: Subaccount ID of this creative. This field, if left
  3412. // unset, will be auto-generated for both insert and update operations.
  3413. // Applicable to all creative types.
  3414. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3415. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3416. // backup image impressions. Applicable to the following creative types:
  3417. // all RICH_MEDIA.
  3418. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3419. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3420. // rich media impressions. Applicable to the following creative types:
  3421. // all RICH_MEDIA.
  3422. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3423. // ThirdPartyUrls: Third-party URLs for tracking in-stream creative
  3424. // events. Applicable to the following creative types: all
  3425. // INSTREAM_VIDEO, all INSTREAM_AUDIO, and all VPAID.
  3426. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3427. // TimerCustomEvents: List of timer events configured for the creative.
  3428. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3429. // auto-generated from clickTags. Applicable to the following creative
  3430. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3431. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3432. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3433. // TotalFileSize: Combined size of all creative assets. This is a
  3434. // read-only field. Applicable to the following creative types: all
  3435. // RICH_MEDIA, and all VPAID.
  3436. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3437. // Type: Type of this creative. This is a required field. Applicable to
  3438. // all creative types.
  3439. //
  3440. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3441. // existing creatives. New creatives should use DISPLAY as a replacement
  3442. // for these types.
  3443. //
  3444. // Possible values:
  3445. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3446. // "CUSTOM_DISPLAY"
  3447. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3448. // "DISPLAY"
  3449. // "DISPLAY_IMAGE_GALLERY"
  3450. // "DISPLAY_REDIRECT"
  3451. // "FLASH_INPAGE"
  3452. // "HTML5_BANNER"
  3453. // "IMAGE"
  3454. // "INSTREAM_AUDIO"
  3455. // "INSTREAM_VIDEO"
  3456. // "INSTREAM_VIDEO_REDIRECT"
  3457. // "INTERNAL_REDIRECT"
  3458. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3459. // "RICH_MEDIA_DISPLAY_BANNER"
  3460. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3461. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3462. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3463. // "RICH_MEDIA_IM_EXPAND"
  3464. // "RICH_MEDIA_INPAGE_FLOATING"
  3465. // "RICH_MEDIA_MOBILE_IN_APP"
  3466. // "RICH_MEDIA_PEEL_DOWN"
  3467. // "TRACKING_TEXT"
  3468. // "VPAID_LINEAR_VIDEO"
  3469. // "VPAID_NON_LINEAR_VIDEO"
  3470. Type string `json:"type,omitempty"`
  3471. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  3472. // to the following creative types: INSTREAM_AUDIO and INSTREAM_VIDEO
  3473. // and VPAID.
  3474. UniversalAdId *UniversalAdId `json:"universalAdId,omitempty"`
  3475. // Version: The version number helps you keep track of multiple versions
  3476. // of your creative in your reports. The version number will always be
  3477. // auto-generated during insert operations to start at 1. For tracking
  3478. // creatives the version cannot be incremented and will always remain at
  3479. // 1. For all other creative types the version can be incremented only
  3480. // by 1 during update operations. In addition, the version will be
  3481. // automatically incremented by 1 when undergoing Rich Media creative
  3482. // merging. Applicable to all creative types.
  3483. Version int64 `json:"version,omitempty"`
  3484. // ServerResponse contains the HTTP response code and headers from the
  3485. // server.
  3486. googleapi.ServerResponse `json:"-"`
  3487. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3488. // unconditionally include in API requests. By default, fields with
  3489. // empty values are omitted from API requests. However, any non-pointer,
  3490. // non-interface field appearing in ForceSendFields will be sent to the
  3491. // server regardless of whether the field is empty or not. This may be
  3492. // used to include empty fields in Patch requests.
  3493. ForceSendFields []string `json:"-"`
  3494. // NullFields is a list of field names (e.g. "AccountId") to include in
  3495. // API requests with the JSON null value. By default, fields with empty
  3496. // values are omitted from API requests. However, any field with an
  3497. // empty value appearing in NullFields will be sent to the server as
  3498. // null. It is an error if a field in this list has a non-empty value.
  3499. // This may be used to include null fields in Patch requests.
  3500. NullFields []string `json:"-"`
  3501. }
  3502. func (s *Creative) MarshalJSON() ([]byte, error) {
  3503. type NoMethod Creative
  3504. raw := NoMethod(*s)
  3505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3506. }
  3507. func (s *Creative) UnmarshalJSON(data []byte) error {
  3508. type NoMethod Creative
  3509. var s1 struct {
  3510. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3511. *NoMethod
  3512. }
  3513. s1.NoMethod = (*NoMethod)(s)
  3514. if err := json.Unmarshal(data, &s1); err != nil {
  3515. return err
  3516. }
  3517. s.MediaDuration = float64(s1.MediaDuration)
  3518. return nil
  3519. }
  3520. // CreativeAsset: Creative Asset.
  3521. type CreativeAsset struct {
  3522. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3523. // This is a read-only field. Applicable to the following creative type:
  3524. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3525. // not HTML_IMAGE.
  3526. ActionScript3 bool `json:"actionScript3,omitempty"`
  3527. // Active: Whether the video or audio asset is active. This is a
  3528. // read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the
  3529. // following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and all
  3530. // VPAID.
  3531. Active bool `json:"active,omitempty"`
  3532. // AdditionalSizes: Additional sizes associated with this creative
  3533. // asset. HTML5 asset generated by compatible software such as GWD will
  3534. // be able to support more sizes this creative asset can render.
  3535. AdditionalSizes []*Size `json:"additionalSizes,omitempty"`
  3536. // Alignment: Possible alignments for an asset. This is a read-only
  3537. // field. Applicable to the following creative types:
  3538. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3539. //
  3540. // Possible values:
  3541. // "ALIGNMENT_BOTTOM"
  3542. // "ALIGNMENT_LEFT"
  3543. // "ALIGNMENT_RIGHT"
  3544. // "ALIGNMENT_TOP"
  3545. Alignment string `json:"alignment,omitempty"`
  3546. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3547. // field. Applicable to the following creative types: all RICH_MEDIA.
  3548. //
  3549. // Possible values:
  3550. // "ARTWORK_TYPE_FLASH"
  3551. // "ARTWORK_TYPE_HTML5"
  3552. // "ARTWORK_TYPE_IMAGE"
  3553. // "ARTWORK_TYPE_MIXED"
  3554. ArtworkType string `json:"artworkType,omitempty"`
  3555. // AssetIdentifier: Identifier of this asset. This is the same
  3556. // identifier returned during creative asset insert operation. This is a
  3557. // required field. Applicable to all but the following creative types:
  3558. // all REDIRECT and TRACKING_TEXT.
  3559. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3560. // BackupImageExit: Exit event configured for the backup image.
  3561. // Applicable to the following creative types: all RICH_MEDIA.
  3562. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3563. // BitRate: Detected bit-rate for audio or video asset. This is a
  3564. // read-only field. Applicable to the following creative types:
  3565. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3566. BitRate int64 `json:"bitRate,omitempty"`
  3567. // ChildAssetType: Rich media child asset type. This is a read-only
  3568. // field. Applicable to the following creative types: all VPAID.
  3569. //
  3570. // Possible values:
  3571. // "CHILD_ASSET_TYPE_DATA"
  3572. // "CHILD_ASSET_TYPE_FLASH"
  3573. // "CHILD_ASSET_TYPE_IMAGE"
  3574. // "CHILD_ASSET_TYPE_VIDEO"
  3575. ChildAssetType string `json:"childAssetType,omitempty"`
  3576. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3577. // field. Applicable to the following creative types: all RICH_MEDIA and
  3578. // all VPAID. Additionally, applicable to assets whose displayType is
  3579. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3580. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3581. // CompanionCreativeIds: List of companion creatives assigned to an
  3582. // in-stream video creative asset. Acceptable values include IDs of
  3583. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3584. // creative type with dynamicAssetSelection set to true.
  3585. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3586. // CustomStartTimeValue: Custom start time in seconds for making the
  3587. // asset visible. Applicable to the following creative types: all
  3588. // RICH_MEDIA. Value must be greater than or equal to 0.
  3589. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3590. // DetectedFeatures: List of feature dependencies for the creative asset
  3591. // that are detected by Campaign Manager. Feature dependencies are
  3592. // features that a browser must be able to support in order to render
  3593. // your HTML5 creative correctly. This is a read-only, auto-generated
  3594. // field. Applicable to the following creative types: HTML5_BANNER.
  3595. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3596. //
  3597. // Possible values:
  3598. // "APPLICATION_CACHE"
  3599. // "AUDIO"
  3600. // "CANVAS"
  3601. // "CANVAS_TEXT"
  3602. // "CSS_ANIMATIONS"
  3603. // "CSS_BACKGROUND_SIZE"
  3604. // "CSS_BORDER_IMAGE"
  3605. // "CSS_BORDER_RADIUS"
  3606. // "CSS_BOX_SHADOW"
  3607. // "CSS_COLUMNS"
  3608. // "CSS_FLEX_BOX"
  3609. // "CSS_FONT_FACE"
  3610. // "CSS_GENERATED_CONTENT"
  3611. // "CSS_GRADIENTS"
  3612. // "CSS_HSLA"
  3613. // "CSS_MULTIPLE_BGS"
  3614. // "CSS_OPACITY"
  3615. // "CSS_REFLECTIONS"
  3616. // "CSS_RGBA"
  3617. // "CSS_TEXT_SHADOW"
  3618. // "CSS_TRANSFORMS"
  3619. // "CSS_TRANSFORMS3D"
  3620. // "CSS_TRANSITIONS"
  3621. // "DRAG_AND_DROP"
  3622. // "GEO_LOCATION"
  3623. // "HASH_CHANGE"
  3624. // "HISTORY"
  3625. // "INDEXED_DB"
  3626. // "INLINE_SVG"
  3627. // "INPUT_ATTR_AUTOCOMPLETE"
  3628. // "INPUT_ATTR_AUTOFOCUS"
  3629. // "INPUT_ATTR_LIST"
  3630. // "INPUT_ATTR_MAX"
  3631. // "INPUT_ATTR_MIN"
  3632. // "INPUT_ATTR_MULTIPLE"
  3633. // "INPUT_ATTR_PATTERN"
  3634. // "INPUT_ATTR_PLACEHOLDER"
  3635. // "INPUT_ATTR_REQUIRED"
  3636. // "INPUT_ATTR_STEP"
  3637. // "INPUT_TYPE_COLOR"
  3638. // "INPUT_TYPE_DATE"
  3639. // "INPUT_TYPE_DATETIME"
  3640. // "INPUT_TYPE_DATETIME_LOCAL"
  3641. // "INPUT_TYPE_EMAIL"
  3642. // "INPUT_TYPE_MONTH"
  3643. // "INPUT_TYPE_NUMBER"
  3644. // "INPUT_TYPE_RANGE"
  3645. // "INPUT_TYPE_SEARCH"
  3646. // "INPUT_TYPE_TEL"
  3647. // "INPUT_TYPE_TIME"
  3648. // "INPUT_TYPE_URL"
  3649. // "INPUT_TYPE_WEEK"
  3650. // "LOCAL_STORAGE"
  3651. // "POST_MESSAGE"
  3652. // "SESSION_STORAGE"
  3653. // "SMIL"
  3654. // "SVG_CLIP_PATHS"
  3655. // "SVG_FE_IMAGE"
  3656. // "SVG_FILTERS"
  3657. // "SVG_HREF"
  3658. // "TOUCH"
  3659. // "VIDEO"
  3660. // "WEBGL"
  3661. // "WEB_SOCKETS"
  3662. // "WEB_SQL_DATABASE"
  3663. // "WEB_WORKERS"
  3664. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3665. // DisplayType: Type of rich media asset. This is a read-only field.
  3666. // Applicable to the following creative types: all RICH_MEDIA.
  3667. //
  3668. // Possible values:
  3669. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3670. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3671. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3672. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3673. // "ASSET_DISPLAY_TYPE_FLOATING"
  3674. // "ASSET_DISPLAY_TYPE_INPAGE"
  3675. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3676. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3677. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3678. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3679. DisplayType string `json:"displayType,omitempty"`
  3680. // Duration: Duration in seconds for which an asset will be displayed.
  3681. // Applicable to the following creative types: INSTREAM_AUDIO,
  3682. // INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must be greater than or
  3683. // equal to 1.
  3684. Duration int64 `json:"duration,omitempty"`
  3685. // DurationType: Duration type for which an asset will be displayed.
  3686. // Applicable to the following creative types: all RICH_MEDIA.
  3687. //
  3688. // Possible values:
  3689. // "ASSET_DURATION_TYPE_AUTO"
  3690. // "ASSET_DURATION_TYPE_CUSTOM"
  3691. // "ASSET_DURATION_TYPE_NONE"
  3692. DurationType string `json:"durationType,omitempty"`
  3693. // ExpandedDimension: Detected expanded dimension for video asset. This
  3694. // is a read-only field. Applicable to the following creative types:
  3695. // INSTREAM_VIDEO and all VPAID.
  3696. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3697. // FileSize: File size associated with this creative asset. This is a
  3698. // read-only field. Applicable to all but the following creative types:
  3699. // all REDIRECT and TRACKING_TEXT.
  3700. FileSize int64 `json:"fileSize,omitempty,string"`
  3701. // FlashVersion: Flash version of the asset. This is a read-only field.
  3702. // Applicable to the following creative types: FLASH_INPAGE, all
  3703. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3704. // asset type is not HTML_IMAGE.
  3705. FlashVersion int64 `json:"flashVersion,omitempty"`
  3706. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3707. // Applicable to the following creative types: all RICH_MEDIA.
  3708. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3709. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3710. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3711. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3712. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3713. // a read-only field. Applicable to the following creative types: all
  3714. // RICH_MEDIA.
  3715. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3716. // Id: Numeric ID of this creative asset. This is a required field and
  3717. // should not be modified. Applicable to all but the following creative
  3718. // types: all REDIRECT and TRACKING_TEXT.
  3719. Id int64 `json:"id,omitempty,string"`
  3720. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3721. // read-only, auto-generated field.
  3722. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3723. // MediaDuration: Detected duration for audio or video asset. This is a
  3724. // read-only field. Applicable to the following creative types:
  3725. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3726. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3727. // MimeType: Detected MIME type for audio or video asset. This is a
  3728. // read-only field. Applicable to the following creative types:
  3729. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3730. MimeType string `json:"mimeType,omitempty"`
  3731. // Offset: Offset position for an asset in collapsed mode. This is a
  3732. // read-only field. Applicable to the following creative types: all
  3733. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3734. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3735. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3736. Offset *OffsetPosition `json:"offset,omitempty"`
  3737. // Orientation: Orientation of video asset. This is a read-only,
  3738. // auto-generated field.
  3739. //
  3740. // Possible values:
  3741. // "LANDSCAPE"
  3742. // "PORTRAIT"
  3743. // "SQUARE"
  3744. Orientation string `json:"orientation,omitempty"`
  3745. // OriginalBackup: Whether the backup asset is original or changed by
  3746. // the user in Campaign Manager. Applicable to the following creative
  3747. // types: all RICH_MEDIA.
  3748. OriginalBackup bool `json:"originalBackup,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. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3910. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3911. *NoMethod
  3912. }
  3913. s1.NoMethod = (*NoMethod)(s)
  3914. if err := json.Unmarshal(data, &s1); err != nil {
  3915. return err
  3916. }
  3917. s.MediaDuration = float64(s1.MediaDuration)
  3918. s.PushdownDuration = float64(s1.PushdownDuration)
  3919. return nil
  3920. }
  3921. // CreativeAssetId: Creative Asset ID.
  3922. type CreativeAssetId struct {
  3923. // Name: Name of the creative asset. This is a required field while
  3924. // inserting an asset. After insertion, this assetIdentifier is used to
  3925. // identify the uploaded asset. Characters in the name must be
  3926. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3927. Name string `json:"name,omitempty"`
  3928. // Type: Type of asset to upload. This is a required field. FLASH and
  3929. // IMAGE are no longer supported for new uploads. All image assets
  3930. // should use HTML_IMAGE.
  3931. //
  3932. // Possible values:
  3933. // "AUDIO"
  3934. // "FLASH"
  3935. // "HTML"
  3936. // "HTML_IMAGE"
  3937. // "IMAGE"
  3938. // "VIDEO"
  3939. Type string `json:"type,omitempty"`
  3940. // ForceSendFields is a list of field names (e.g. "Name") to
  3941. // unconditionally include in API requests. By default, fields with
  3942. // empty values are omitted from API requests. However, any non-pointer,
  3943. // non-interface field appearing in ForceSendFields will be sent to the
  3944. // server regardless of whether the field is empty or not. This may be
  3945. // used to include empty fields in Patch requests.
  3946. ForceSendFields []string `json:"-"`
  3947. // NullFields is a list of field names (e.g. "Name") to include in API
  3948. // requests with the JSON null value. By default, fields with empty
  3949. // values are omitted from API requests. However, any field with an
  3950. // empty value appearing in NullFields will be sent to the server as
  3951. // null. It is an error if a field in this list has a non-empty value.
  3952. // This may be used to include null fields in Patch requests.
  3953. NullFields []string `json:"-"`
  3954. }
  3955. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3956. type NoMethod CreativeAssetId
  3957. raw := NoMethod(*s)
  3958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3959. }
  3960. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3961. // creative asset file which will be uploaded or has already been
  3962. // uploaded. Refer to the creative sample code for how to upload assets
  3963. // and insert a creative.
  3964. type CreativeAssetMetadata struct {
  3965. // AssetIdentifier: ID of the creative asset. This is a required field.
  3966. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3967. // ClickTags: List of detected click tags for assets. This is a
  3968. // read-only auto-generated field.
  3969. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3970. // DetectedFeatures: List of feature dependencies for the creative asset
  3971. // that are detected by Campaign Manager. Feature dependencies are
  3972. // features that a browser must be able to support in order to render
  3973. // your HTML5 creative correctly. This is a read-only, auto-generated
  3974. // field.
  3975. //
  3976. // Possible values:
  3977. // "APPLICATION_CACHE"
  3978. // "AUDIO"
  3979. // "CANVAS"
  3980. // "CANVAS_TEXT"
  3981. // "CSS_ANIMATIONS"
  3982. // "CSS_BACKGROUND_SIZE"
  3983. // "CSS_BORDER_IMAGE"
  3984. // "CSS_BORDER_RADIUS"
  3985. // "CSS_BOX_SHADOW"
  3986. // "CSS_COLUMNS"
  3987. // "CSS_FLEX_BOX"
  3988. // "CSS_FONT_FACE"
  3989. // "CSS_GENERATED_CONTENT"
  3990. // "CSS_GRADIENTS"
  3991. // "CSS_HSLA"
  3992. // "CSS_MULTIPLE_BGS"
  3993. // "CSS_OPACITY"
  3994. // "CSS_REFLECTIONS"
  3995. // "CSS_RGBA"
  3996. // "CSS_TEXT_SHADOW"
  3997. // "CSS_TRANSFORMS"
  3998. // "CSS_TRANSFORMS3D"
  3999. // "CSS_TRANSITIONS"
  4000. // "DRAG_AND_DROP"
  4001. // "GEO_LOCATION"
  4002. // "HASH_CHANGE"
  4003. // "HISTORY"
  4004. // "INDEXED_DB"
  4005. // "INLINE_SVG"
  4006. // "INPUT_ATTR_AUTOCOMPLETE"
  4007. // "INPUT_ATTR_AUTOFOCUS"
  4008. // "INPUT_ATTR_LIST"
  4009. // "INPUT_ATTR_MAX"
  4010. // "INPUT_ATTR_MIN"
  4011. // "INPUT_ATTR_MULTIPLE"
  4012. // "INPUT_ATTR_PATTERN"
  4013. // "INPUT_ATTR_PLACEHOLDER"
  4014. // "INPUT_ATTR_REQUIRED"
  4015. // "INPUT_ATTR_STEP"
  4016. // "INPUT_TYPE_COLOR"
  4017. // "INPUT_TYPE_DATE"
  4018. // "INPUT_TYPE_DATETIME"
  4019. // "INPUT_TYPE_DATETIME_LOCAL"
  4020. // "INPUT_TYPE_EMAIL"
  4021. // "INPUT_TYPE_MONTH"
  4022. // "INPUT_TYPE_NUMBER"
  4023. // "INPUT_TYPE_RANGE"
  4024. // "INPUT_TYPE_SEARCH"
  4025. // "INPUT_TYPE_TEL"
  4026. // "INPUT_TYPE_TIME"
  4027. // "INPUT_TYPE_URL"
  4028. // "INPUT_TYPE_WEEK"
  4029. // "LOCAL_STORAGE"
  4030. // "POST_MESSAGE"
  4031. // "SESSION_STORAGE"
  4032. // "SMIL"
  4033. // "SVG_CLIP_PATHS"
  4034. // "SVG_FE_IMAGE"
  4035. // "SVG_FILTERS"
  4036. // "SVG_HREF"
  4037. // "TOUCH"
  4038. // "VIDEO"
  4039. // "WEBGL"
  4040. // "WEB_SOCKETS"
  4041. // "WEB_SQL_DATABASE"
  4042. // "WEB_WORKERS"
  4043. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  4044. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  4045. // field.
  4046. Id int64 `json:"id,omitempty,string"`
  4047. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  4048. // This is a read-only, auto-generated field.
  4049. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  4050. // Kind: Identifies what kind of resource this is. Value: the fixed
  4051. // string "dfareporting#creativeAssetMetadata".
  4052. Kind string `json:"kind,omitempty"`
  4053. // WarnedValidationRules: Rules validated during code generation that
  4054. // generated a warning. This is a read-only, auto-generated
  4055. // field.
  4056. //
  4057. // Possible values are:
  4058. // - "ADMOB_REFERENCED"
  4059. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  4060. // - "ASSET_INVALID"
  4061. // - "CLICK_TAG_HARD_CODED"
  4062. // - "CLICK_TAG_INVALID"
  4063. // - "CLICK_TAG_IN_GWD"
  4064. // - "CLICK_TAG_MISSING"
  4065. // - "CLICK_TAG_MORE_THAN_ONE"
  4066. // - "CLICK_TAG_NON_TOP_LEVEL"
  4067. // - "COMPONENT_UNSUPPORTED_DCM"
  4068. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  4069. // - "EXTERNAL_FILE_REFERENCED"
  4070. // - "FILE_DETAIL_EMPTY"
  4071. // - "FILE_TYPE_INVALID"
  4072. // - "GWD_PROPERTIES_INVALID"
  4073. // - "HTML5_FEATURE_UNSUPPORTED"
  4074. // - "LINKED_FILE_NOT_FOUND"
  4075. // - "MAX_FLASH_VERSION_11"
  4076. // - "MRAID_REFERENCED"
  4077. // - "NOT_SSL_COMPLIANT"
  4078. // - "ORPHANED_ASSET"
  4079. // - "PRIMARY_HTML_MISSING"
  4080. // - "SVG_INVALID"
  4081. // - "ZIP_INVALID"
  4082. //
  4083. // Possible values:
  4084. // "ADMOB_REFERENCED"
  4085. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  4086. // "ASSET_INVALID"
  4087. // "CLICK_TAG_HARD_CODED"
  4088. // "CLICK_TAG_INVALID"
  4089. // "CLICK_TAG_IN_GWD"
  4090. // "CLICK_TAG_MISSING"
  4091. // "CLICK_TAG_MORE_THAN_ONE"
  4092. // "CLICK_TAG_NON_TOP_LEVEL"
  4093. // "COMPONENT_UNSUPPORTED_DCM"
  4094. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  4095. // "EXTERNAL_FILE_REFERENCED"
  4096. // "FILE_DETAIL_EMPTY"
  4097. // "FILE_TYPE_INVALID"
  4098. // "GWD_PROPERTIES_INVALID"
  4099. // "HTML5_FEATURE_UNSUPPORTED"
  4100. // "LINKED_FILE_NOT_FOUND"
  4101. // "MAX_FLASH_VERSION_11"
  4102. // "MRAID_REFERENCED"
  4103. // "NOT_SSL_COMPLIANT"
  4104. // "ORPHANED_ASSET"
  4105. // "PRIMARY_HTML_MISSING"
  4106. // "SVG_INVALID"
  4107. // "ZIP_INVALID"
  4108. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  4109. // ServerResponse contains the HTTP response code and headers from the
  4110. // server.
  4111. googleapi.ServerResponse `json:"-"`
  4112. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  4113. // unconditionally include in API requests. By default, fields with
  4114. // empty values are omitted from API requests. However, any non-pointer,
  4115. // non-interface field appearing in ForceSendFields will be sent to the
  4116. // server regardless of whether the field is empty or not. This may be
  4117. // used to include empty fields in Patch requests.
  4118. ForceSendFields []string `json:"-"`
  4119. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  4120. // include in API requests with the JSON null value. By default, fields
  4121. // with empty values are omitted from API requests. However, any field
  4122. // with an empty value appearing in NullFields will be sent to the
  4123. // server as null. It is an error if a field in this list has a
  4124. // non-empty value. This may be used to include null fields in Patch
  4125. // requests.
  4126. NullFields []string `json:"-"`
  4127. }
  4128. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  4129. type NoMethod CreativeAssetMetadata
  4130. raw := NoMethod(*s)
  4131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4132. }
  4133. // CreativeAssetSelection: Encapsulates the list of rules for asset
  4134. // selection and a default asset in case none of the rules match.
  4135. // Applicable to INSTREAM_VIDEO creatives.
  4136. type CreativeAssetSelection struct {
  4137. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  4138. // the parent assets in this creative, and will be served if none of the
  4139. // rules match. This is a required field.
  4140. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  4141. // Rules: Rules determine which asset will be served to a viewer. Rules
  4142. // will be evaluated in the order in which they are stored in this list.
  4143. // This list must contain at least one rule. Applicable to
  4144. // INSTREAM_VIDEO creatives.
  4145. Rules []*Rule `json:"rules,omitempty"`
  4146. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  4147. // unconditionally include in API requests. By default, fields with
  4148. // empty values are omitted from API requests. However, any non-pointer,
  4149. // non-interface field appearing in ForceSendFields will be sent to the
  4150. // server regardless of whether the field is empty or not. This may be
  4151. // used to include empty fields in Patch requests.
  4152. ForceSendFields []string `json:"-"`
  4153. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  4154. // include in API requests with the JSON null value. By default, fields
  4155. // with empty values are omitted from API requests. However, any field
  4156. // with an empty value appearing in NullFields will be sent to the
  4157. // server as null. It is an error if a field in this list has a
  4158. // non-empty value. This may be used to include null fields in Patch
  4159. // requests.
  4160. NullFields []string `json:"-"`
  4161. }
  4162. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  4163. type NoMethod CreativeAssetSelection
  4164. raw := NoMethod(*s)
  4165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4166. }
  4167. // CreativeAssignment: Creative Assignment.
  4168. type CreativeAssignment struct {
  4169. // Active: Whether this creative assignment is active. When true, the
  4170. // creative will be included in the ad's rotation.
  4171. Active bool `json:"active,omitempty"`
  4172. // ApplyEventTags: Whether applicable event tags should fire when this
  4173. // creative assignment is rendered. If this value is unset when the ad
  4174. // is inserted or updated, it will default to true for all creative
  4175. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  4176. // and INSTREAM_VIDEO.
  4177. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  4178. // ClickThroughUrl: Click-through URL of the creative assignment.
  4179. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  4180. // CompanionCreativeOverrides: Companion creative overrides for this
  4181. // creative assignment. Applicable to video ads.
  4182. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  4183. // CreativeGroupAssignments: Creative group assignments for this
  4184. // creative assignment. Only one assignment per creative group number is
  4185. // allowed for a maximum of two assignments.
  4186. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  4187. // CreativeId: ID of the creative to be assigned. This is a required
  4188. // field.
  4189. CreativeId int64 `json:"creativeId,omitempty,string"`
  4190. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  4191. // This is a read-only, auto-generated field.
  4192. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  4193. // EndTime: Date and time that the assigned creative should stop
  4194. // serving. Must be later than the start time.
  4195. EndTime string `json:"endTime,omitempty"`
  4196. // RichMediaExitOverrides: Rich media exit overrides for this creative
  4197. // assignment.
  4198. // Applicable when the creative type is any of the following:
  4199. // - DISPLAY
  4200. // - RICH_MEDIA_INPAGE
  4201. // - RICH_MEDIA_INPAGE_FLOATING
  4202. // - RICH_MEDIA_IM_EXPAND
  4203. // - RICH_MEDIA_EXPANDING
  4204. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  4205. // - RICH_MEDIA_MOBILE_IN_APP
  4206. // - RICH_MEDIA_MULTI_FLOATING
  4207. // - RICH_MEDIA_PEEL_DOWN
  4208. // - VPAID_LINEAR
  4209. // - VPAID_NON_LINEAR
  4210. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  4211. // Sequence: Sequence number of the creative assignment, applicable when
  4212. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  4213. // values are 1 to 65535, inclusive.
  4214. Sequence int64 `json:"sequence,omitempty"`
  4215. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  4216. // This is a read-only field that is auto-generated when the ad is
  4217. // inserted or updated.
  4218. SslCompliant bool `json:"sslCompliant,omitempty"`
  4219. // StartTime: Date and time that the assigned creative should start
  4220. // serving.
  4221. StartTime string `json:"startTime,omitempty"`
  4222. // Weight: Weight of the creative assignment, applicable when the
  4223. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  4224. // than or equal to 1.
  4225. Weight int64 `json:"weight,omitempty"`
  4226. // ForceSendFields is a list of field names (e.g. "Active") to
  4227. // unconditionally include in API requests. By default, fields with
  4228. // empty values are omitted from API requests. However, any non-pointer,
  4229. // non-interface field appearing in ForceSendFields will be sent to the
  4230. // server regardless of whether the field is empty or not. This may be
  4231. // used to include empty fields in Patch requests.
  4232. ForceSendFields []string `json:"-"`
  4233. // NullFields is a list of field names (e.g. "Active") to include in API
  4234. // requests with the JSON null value. By default, fields with empty
  4235. // values are omitted from API requests. However, any field with an
  4236. // empty value appearing in NullFields will be sent to the server as
  4237. // null. It is an error if a field in this list has a non-empty value.
  4238. // This may be used to include null fields in Patch requests.
  4239. NullFields []string `json:"-"`
  4240. }
  4241. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  4242. type NoMethod CreativeAssignment
  4243. raw := NoMethod(*s)
  4244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4245. }
  4246. // CreativeClickThroughUrl: Click-through URL
  4247. type CreativeClickThroughUrl struct {
  4248. // ComputedClickThroughUrl: Read-only convenience field representing the
  4249. // actual URL that will be used for this click-through. The URL is
  4250. // computed as follows:
  4251. // - If landingPageId is specified then that landing page's URL is
  4252. // assigned to this field.
  4253. // - Otherwise, the customClickThroughUrl is assigned to this field.
  4254. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  4255. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  4256. // landingPageId field is left unset.
  4257. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  4258. // LandingPageId: ID of the landing page for the click-through URL.
  4259. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  4260. // ForceSendFields is a list of field names (e.g.
  4261. // "ComputedClickThroughUrl") to unconditionally include in API
  4262. // requests. By default, fields with empty values are omitted from API
  4263. // requests. However, any non-pointer, non-interface field appearing in
  4264. // ForceSendFields will be sent to the server regardless of whether the
  4265. // field is empty or not. This may be used to include empty fields in
  4266. // Patch requests.
  4267. ForceSendFields []string `json:"-"`
  4268. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  4269. // to include in API requests with the JSON null value. By default,
  4270. // fields with empty values are omitted from API requests. However, any
  4271. // field with an empty value appearing in NullFields will be sent to the
  4272. // server as null. It is an error if a field in this list has a
  4273. // non-empty value. This may be used to include null fields in Patch
  4274. // requests.
  4275. NullFields []string `json:"-"`
  4276. }
  4277. func (s *CreativeClickThroughUrl) MarshalJSON() ([]byte, error) {
  4278. type NoMethod CreativeClickThroughUrl
  4279. raw := NoMethod(*s)
  4280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4281. }
  4282. // CreativeCustomEvent: Creative Custom Event.
  4283. type CreativeCustomEvent struct {
  4284. // AdvertiserCustomEventId: Unique ID of this event used by Reporting
  4285. // and Data Transfer. This is a read-only field.
  4286. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  4287. // AdvertiserCustomEventName: User-entered name for the event.
  4288. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  4289. // AdvertiserCustomEventType: Type of the event. This is a read-only
  4290. // field.
  4291. //
  4292. // Possible values:
  4293. // "ADVERTISER_EVENT_COUNTER"
  4294. // "ADVERTISER_EVENT_EXIT"
  4295. // "ADVERTISER_EVENT_TIMER"
  4296. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  4297. // ArtworkLabel: Artwork label column, used to link events in Campaign
  4298. // Manager back to events in Studio. This is a required field and should
  4299. // not be modified after insertion.
  4300. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4301. // ArtworkType: Artwork type used by the creative.This is a read-only
  4302. // field.
  4303. //
  4304. // Possible values:
  4305. // "ARTWORK_TYPE_FLASH"
  4306. // "ARTWORK_TYPE_HTML5"
  4307. // "ARTWORK_TYPE_IMAGE"
  4308. // "ARTWORK_TYPE_MIXED"
  4309. ArtworkType string `json:"artworkType,omitempty"`
  4310. // ExitClickThroughUrl: Exit click-through URL for the event. This field
  4311. // is used only for exit events.
  4312. ExitClickThroughUrl *CreativeClickThroughUrl `json:"exitClickThroughUrl,omitempty"`
  4313. // Id: ID of this event. This is a required field and should not be
  4314. // modified after insertion.
  4315. Id int64 `json:"id,omitempty,string"`
  4316. // PopupWindowProperties: Properties for rich media popup windows. This
  4317. // field is used only for exit events.
  4318. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4319. // TargetType: Target type used by the event.
  4320. //
  4321. // Possible values:
  4322. // "TARGET_BLANK"
  4323. // "TARGET_PARENT"
  4324. // "TARGET_POPUP"
  4325. // "TARGET_SELF"
  4326. // "TARGET_TOP"
  4327. TargetType string `json:"targetType,omitempty"`
  4328. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4329. // videos in a single creative. This is a read-only field.
  4330. VideoReportingId string `json:"videoReportingId,omitempty"`
  4331. // ForceSendFields is a list of field names (e.g.
  4332. // "AdvertiserCustomEventId") to unconditionally include in API
  4333. // requests. By default, fields with empty values are omitted from API
  4334. // requests. However, any non-pointer, non-interface field appearing in
  4335. // ForceSendFields will be sent to the server regardless of whether the
  4336. // field is empty or not. This may be used to include empty fields in
  4337. // Patch requests.
  4338. ForceSendFields []string `json:"-"`
  4339. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4340. // to include in API requests with the JSON null value. By default,
  4341. // fields with empty values are omitted from API requests. However, any
  4342. // field with an empty value appearing in NullFields will be sent to the
  4343. // server as null. It is an error if a field in this list has a
  4344. // non-empty value. This may be used to include null fields in Patch
  4345. // requests.
  4346. NullFields []string `json:"-"`
  4347. }
  4348. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4349. type NoMethod CreativeCustomEvent
  4350. raw := NoMethod(*s)
  4351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4352. }
  4353. // CreativeField: Contains properties of a creative field.
  4354. type CreativeField struct {
  4355. // AccountId: Account ID of this creative field. This is a read-only
  4356. // field that can be left blank.
  4357. AccountId int64 `json:"accountId,omitempty,string"`
  4358. // AdvertiserId: Advertiser ID of this creative field. This is a
  4359. // required field on insertion.
  4360. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4361. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4362. // advertiser. This is a read-only, auto-generated field.
  4363. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4364. // Id: ID of this creative field. This is a read-only, auto-generated
  4365. // field.
  4366. Id int64 `json:"id,omitempty,string"`
  4367. // Kind: Identifies what kind of resource this is. Value: the fixed
  4368. // string "dfareporting#creativeField".
  4369. Kind string `json:"kind,omitempty"`
  4370. // Name: Name of this creative field. This is a required field and must
  4371. // be less than 256 characters long and unique among creative fields of
  4372. // the same advertiser.
  4373. Name string `json:"name,omitempty"`
  4374. // SubaccountId: Subaccount ID of this creative field. This is a
  4375. // read-only field that can be left blank.
  4376. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4377. // ServerResponse contains the HTTP response code and headers from the
  4378. // server.
  4379. googleapi.ServerResponse `json:"-"`
  4380. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4381. // unconditionally include in API requests. By default, fields with
  4382. // empty values are omitted from API requests. However, any non-pointer,
  4383. // non-interface field appearing in ForceSendFields will be sent to the
  4384. // server regardless of whether the field is empty or not. This may be
  4385. // used to include empty fields in Patch requests.
  4386. ForceSendFields []string `json:"-"`
  4387. // NullFields is a list of field names (e.g. "AccountId") to include in
  4388. // API requests with the JSON null value. By default, fields with empty
  4389. // values are omitted from API requests. However, any field with an
  4390. // empty value appearing in NullFields will be sent to the server as
  4391. // null. It is an error if a field in this list has a non-empty value.
  4392. // This may be used to include null fields in Patch requests.
  4393. NullFields []string `json:"-"`
  4394. }
  4395. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4396. type NoMethod CreativeField
  4397. raw := NoMethod(*s)
  4398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4399. }
  4400. // CreativeFieldAssignment: Creative Field Assignment.
  4401. type CreativeFieldAssignment struct {
  4402. // CreativeFieldId: ID of the creative field.
  4403. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4404. // CreativeFieldValueId: ID of the creative field value.
  4405. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4406. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4407. // unconditionally include in API requests. By default, fields with
  4408. // empty values are omitted from API requests. However, any non-pointer,
  4409. // non-interface field appearing in ForceSendFields will be sent to the
  4410. // server regardless of whether the field is empty or not. This may be
  4411. // used to include empty fields in Patch requests.
  4412. ForceSendFields []string `json:"-"`
  4413. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4414. // include in API requests with the JSON null value. By default, fields
  4415. // with empty values are omitted from API requests. However, any field
  4416. // with an empty value appearing in NullFields will be sent to the
  4417. // server as null. It is an error if a field in this list has a
  4418. // non-empty value. This may be used to include null fields in Patch
  4419. // requests.
  4420. NullFields []string `json:"-"`
  4421. }
  4422. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4423. type NoMethod CreativeFieldAssignment
  4424. raw := NoMethod(*s)
  4425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4426. }
  4427. // CreativeFieldValue: Contains properties of a creative field value.
  4428. type CreativeFieldValue struct {
  4429. // Id: ID of this creative field value. This is a read-only,
  4430. // auto-generated field.
  4431. Id int64 `json:"id,omitempty,string"`
  4432. // Kind: Identifies what kind of resource this is. Value: the fixed
  4433. // string "dfareporting#creativeFieldValue".
  4434. Kind string `json:"kind,omitempty"`
  4435. // Value: Value of this creative field value. It needs to be less than
  4436. // 256 characters in length and unique per creative field.
  4437. Value string `json:"value,omitempty"`
  4438. // ServerResponse contains the HTTP response code and headers from the
  4439. // server.
  4440. googleapi.ServerResponse `json:"-"`
  4441. // ForceSendFields is a list of field names (e.g. "Id") to
  4442. // unconditionally include in API requests. By default, fields with
  4443. // empty values are omitted from API requests. However, any non-pointer,
  4444. // non-interface field appearing in ForceSendFields will be sent to the
  4445. // server regardless of whether the field is empty or not. This may be
  4446. // used to include empty fields in Patch requests.
  4447. ForceSendFields []string `json:"-"`
  4448. // NullFields is a list of field names (e.g. "Id") to include in API
  4449. // requests with the JSON null value. By default, fields with empty
  4450. // values are omitted from API requests. However, any field with an
  4451. // empty value appearing in NullFields will be sent to the server as
  4452. // null. It is an error if a field in this list has a non-empty value.
  4453. // This may be used to include null fields in Patch requests.
  4454. NullFields []string `json:"-"`
  4455. }
  4456. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4457. type NoMethod CreativeFieldValue
  4458. raw := NoMethod(*s)
  4459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4460. }
  4461. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4462. type CreativeFieldValuesListResponse struct {
  4463. // CreativeFieldValues: Creative field value collection.
  4464. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4465. // Kind: Identifies what kind of resource this is. Value: the fixed
  4466. // string "dfareporting#creativeFieldValuesListResponse".
  4467. Kind string `json:"kind,omitempty"`
  4468. // NextPageToken: Pagination token to be used for the next list
  4469. // operation.
  4470. NextPageToken string `json:"nextPageToken,omitempty"`
  4471. // ServerResponse contains the HTTP response code and headers from the
  4472. // server.
  4473. googleapi.ServerResponse `json:"-"`
  4474. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4475. // to unconditionally include in API requests. By default, fields with
  4476. // empty values are omitted from API requests. However, any non-pointer,
  4477. // non-interface field appearing in ForceSendFields will be sent to the
  4478. // server regardless of whether the field is empty or not. This may be
  4479. // used to include empty fields in Patch requests.
  4480. ForceSendFields []string `json:"-"`
  4481. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4482. // include in API requests with the JSON null value. By default, fields
  4483. // with empty values are omitted from API requests. However, any field
  4484. // with an empty value appearing in NullFields will be sent to the
  4485. // server as null. It is an error if a field in this list has a
  4486. // non-empty value. This may be used to include null fields in Patch
  4487. // requests.
  4488. NullFields []string `json:"-"`
  4489. }
  4490. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4491. type NoMethod CreativeFieldValuesListResponse
  4492. raw := NoMethod(*s)
  4493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4494. }
  4495. // CreativeFieldsListResponse: Creative Field List Response
  4496. type CreativeFieldsListResponse struct {
  4497. // CreativeFields: Creative field collection.
  4498. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4499. // Kind: Identifies what kind of resource this is. Value: the fixed
  4500. // string "dfareporting#creativeFieldsListResponse".
  4501. Kind string `json:"kind,omitempty"`
  4502. // NextPageToken: Pagination token to be used for the next list
  4503. // operation.
  4504. NextPageToken string `json:"nextPageToken,omitempty"`
  4505. // ServerResponse contains the HTTP response code and headers from the
  4506. // server.
  4507. googleapi.ServerResponse `json:"-"`
  4508. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4509. // unconditionally include in API requests. By default, fields with
  4510. // empty values are omitted from API requests. However, any non-pointer,
  4511. // non-interface field appearing in ForceSendFields will be sent to the
  4512. // server regardless of whether the field is empty or not. This may be
  4513. // used to include empty fields in Patch requests.
  4514. ForceSendFields []string `json:"-"`
  4515. // NullFields is a list of field names (e.g. "CreativeFields") to
  4516. // include in API requests with the JSON null value. By default, fields
  4517. // with empty values are omitted from API requests. However, any field
  4518. // with an empty value appearing in NullFields will be sent to the
  4519. // server as null. It is an error if a field in this list has a
  4520. // non-empty value. This may be used to include null fields in Patch
  4521. // requests.
  4522. NullFields []string `json:"-"`
  4523. }
  4524. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4525. type NoMethod CreativeFieldsListResponse
  4526. raw := NoMethod(*s)
  4527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4528. }
  4529. // CreativeGroup: Contains properties of a creative group.
  4530. type CreativeGroup struct {
  4531. // AccountId: Account ID of this creative group. This is a read-only
  4532. // field that can be left blank.
  4533. AccountId int64 `json:"accountId,omitempty,string"`
  4534. // AdvertiserId: Advertiser ID of this creative group. This is a
  4535. // required field on insertion.
  4536. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4537. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4538. // advertiser. This is a read-only, auto-generated field.
  4539. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4540. // GroupNumber: Subgroup of the creative group. Assign your creative
  4541. // groups to a subgroup in order to filter or manage them more easily.
  4542. // This field is required on insertion and is read-only after insertion.
  4543. // Acceptable values are 1 to 2, inclusive.
  4544. GroupNumber int64 `json:"groupNumber,omitempty"`
  4545. // Id: ID of this creative group. This is a read-only, auto-generated
  4546. // field.
  4547. Id int64 `json:"id,omitempty,string"`
  4548. // Kind: Identifies what kind of resource this is. Value: the fixed
  4549. // string "dfareporting#creativeGroup".
  4550. Kind string `json:"kind,omitempty"`
  4551. // Name: Name of this creative group. This is a required field and must
  4552. // be less than 256 characters long and unique among creative groups of
  4553. // the same advertiser.
  4554. Name string `json:"name,omitempty"`
  4555. // SubaccountId: Subaccount ID of this creative group. This is a
  4556. // read-only field that can be left blank.
  4557. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4558. // ServerResponse contains the HTTP response code and headers from the
  4559. // server.
  4560. googleapi.ServerResponse `json:"-"`
  4561. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4562. // unconditionally include in API requests. By default, fields with
  4563. // empty values are omitted from API requests. However, any non-pointer,
  4564. // non-interface field appearing in ForceSendFields will be sent to the
  4565. // server regardless of whether the field is empty or not. This may be
  4566. // used to include empty fields in Patch requests.
  4567. ForceSendFields []string `json:"-"`
  4568. // NullFields is a list of field names (e.g. "AccountId") to include in
  4569. // API requests with the JSON null value. By default, fields with empty
  4570. // values are omitted from API requests. However, any field with an
  4571. // empty value appearing in NullFields will be sent to the server as
  4572. // null. It is an error if a field in this list has a non-empty value.
  4573. // This may be used to include null fields in Patch requests.
  4574. NullFields []string `json:"-"`
  4575. }
  4576. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4577. type NoMethod CreativeGroup
  4578. raw := NoMethod(*s)
  4579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4580. }
  4581. // CreativeGroupAssignment: Creative Group Assignment.
  4582. type CreativeGroupAssignment struct {
  4583. // CreativeGroupId: ID of the creative group to be assigned.
  4584. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4585. // CreativeGroupNumber: Creative group number of the creative group
  4586. // assignment.
  4587. //
  4588. // Possible values:
  4589. // "CREATIVE_GROUP_ONE"
  4590. // "CREATIVE_GROUP_TWO"
  4591. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4592. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4593. // unconditionally include in API requests. By default, fields with
  4594. // empty values are omitted from API requests. However, any non-pointer,
  4595. // non-interface field appearing in ForceSendFields will be sent to the
  4596. // server regardless of whether the field is empty or not. This may be
  4597. // used to include empty fields in Patch requests.
  4598. ForceSendFields []string `json:"-"`
  4599. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4600. // include in API requests with the JSON null value. By default, fields
  4601. // with empty values are omitted from API requests. However, any field
  4602. // with an empty value appearing in NullFields will be sent to the
  4603. // server as null. It is an error if a field in this list has a
  4604. // non-empty value. This may be used to include null fields in Patch
  4605. // requests.
  4606. NullFields []string `json:"-"`
  4607. }
  4608. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4609. type NoMethod CreativeGroupAssignment
  4610. raw := NoMethod(*s)
  4611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4612. }
  4613. // CreativeGroupsListResponse: Creative Group List Response
  4614. type CreativeGroupsListResponse struct {
  4615. // CreativeGroups: Creative group collection.
  4616. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4617. // Kind: Identifies what kind of resource this is. Value: the fixed
  4618. // string "dfareporting#creativeGroupsListResponse".
  4619. Kind string `json:"kind,omitempty"`
  4620. // NextPageToken: Pagination token to be used for the next list
  4621. // operation.
  4622. NextPageToken string `json:"nextPageToken,omitempty"`
  4623. // ServerResponse contains the HTTP response code and headers from the
  4624. // server.
  4625. googleapi.ServerResponse `json:"-"`
  4626. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4627. // unconditionally include in API requests. By default, fields with
  4628. // empty values are omitted from API requests. However, any non-pointer,
  4629. // non-interface field appearing in ForceSendFields will be sent to the
  4630. // server regardless of whether the field is empty or not. This may be
  4631. // used to include empty fields in Patch requests.
  4632. ForceSendFields []string `json:"-"`
  4633. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4634. // include in API requests with the JSON null value. By default, fields
  4635. // with empty values are omitted from API requests. However, any field
  4636. // with an empty value appearing in NullFields will be sent to the
  4637. // server as null. It is an error if a field in this list has a
  4638. // non-empty value. This may be used to include null fields in Patch
  4639. // requests.
  4640. NullFields []string `json:"-"`
  4641. }
  4642. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4643. type NoMethod CreativeGroupsListResponse
  4644. raw := NoMethod(*s)
  4645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4646. }
  4647. // CreativeOptimizationConfiguration: Creative optimization settings.
  4648. type CreativeOptimizationConfiguration struct {
  4649. // Id: ID of this creative optimization config. This field is
  4650. // auto-generated when the campaign is inserted or updated. It can be
  4651. // null for existing campaigns.
  4652. Id int64 `json:"id,omitempty,string"`
  4653. // Name: Name of this creative optimization config. This is a required
  4654. // field and must be less than 129 characters long.
  4655. Name string `json:"name,omitempty"`
  4656. // OptimizationActivitys: List of optimization activities associated
  4657. // with this configuration.
  4658. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4659. // OptimizationModel: Optimization model for this configuration.
  4660. //
  4661. // Possible values:
  4662. // "CLICK"
  4663. // "POST_CLICK"
  4664. // "POST_CLICK_AND_IMPRESSION"
  4665. // "POST_IMPRESSION"
  4666. // "VIDEO_COMPLETION"
  4667. OptimizationModel string `json:"optimizationModel,omitempty"`
  4668. // ForceSendFields is a list of field names (e.g. "Id") to
  4669. // unconditionally include in API requests. By default, fields with
  4670. // empty values are omitted from API requests. However, any non-pointer,
  4671. // non-interface field appearing in ForceSendFields will be sent to the
  4672. // server regardless of whether the field is empty or not. This may be
  4673. // used to include empty fields in Patch requests.
  4674. ForceSendFields []string `json:"-"`
  4675. // NullFields is a list of field names (e.g. "Id") to include in API
  4676. // requests with the JSON null value. By default, fields with empty
  4677. // values are omitted from API requests. However, any field with an
  4678. // empty value appearing in NullFields will be sent to the server as
  4679. // null. It is an error if a field in this list has a non-empty value.
  4680. // This may be used to include null fields in Patch requests.
  4681. NullFields []string `json:"-"`
  4682. }
  4683. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4684. type NoMethod CreativeOptimizationConfiguration
  4685. raw := NoMethod(*s)
  4686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4687. }
  4688. // CreativeRotation: Creative Rotation.
  4689. type CreativeRotation struct {
  4690. // CreativeAssignments: Creative assignments in this creative rotation.
  4691. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4692. // CreativeOptimizationConfigurationId: Creative optimization
  4693. // configuration that is used by this ad. It should refer to one of the
  4694. // existing optimization configurations in the ad's campaign. If it is
  4695. // unset or set to 0, then the campaign's default optimization
  4696. // configuration will be used for this ad.
  4697. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4698. // Type: Type of creative rotation. Can be used to specify whether to
  4699. // use sequential or random rotation.
  4700. //
  4701. // Possible values:
  4702. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4703. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4704. Type string `json:"type,omitempty"`
  4705. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4706. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4707. //
  4708. // Possible values:
  4709. // "WEIGHT_STRATEGY_CUSTOM"
  4710. // "WEIGHT_STRATEGY_EQUAL"
  4711. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4712. // "WEIGHT_STRATEGY_OPTIMIZED"
  4713. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4714. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4715. // to unconditionally include in API requests. By default, fields with
  4716. // empty values are omitted from API requests. However, any non-pointer,
  4717. // non-interface field appearing in ForceSendFields will be sent to the
  4718. // server regardless of whether the field is empty or not. This may be
  4719. // used to include empty fields in Patch requests.
  4720. ForceSendFields []string `json:"-"`
  4721. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4722. // include in API requests with the JSON null value. By default, fields
  4723. // with empty values are omitted from API requests. However, any field
  4724. // with an empty value appearing in NullFields will be sent to the
  4725. // server as null. It is an error if a field in this list has a
  4726. // non-empty value. This may be used to include null fields in Patch
  4727. // requests.
  4728. NullFields []string `json:"-"`
  4729. }
  4730. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4731. type NoMethod CreativeRotation
  4732. raw := NoMethod(*s)
  4733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4734. }
  4735. // CreativeSettings: Creative Settings
  4736. type CreativeSettings struct {
  4737. // IFrameFooter: Header text for iFrames for this site. Must be less
  4738. // than or equal to 2000 characters long.
  4739. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4740. // IFrameHeader: Header text for iFrames for this site. Must be less
  4741. // than or equal to 2000 characters long.
  4742. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4743. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4744. // unconditionally include in API requests. By default, fields with
  4745. // empty values are omitted from API requests. However, any non-pointer,
  4746. // non-interface field appearing in ForceSendFields will be sent to the
  4747. // server regardless of whether the field is empty or not. This may be
  4748. // used to include empty fields in Patch requests.
  4749. ForceSendFields []string `json:"-"`
  4750. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4751. // in API requests with the JSON null value. By default, fields with
  4752. // empty values are omitted from API requests. However, any field with
  4753. // an empty value appearing in NullFields will be sent to the server as
  4754. // null. It is an error if a field in this list has a non-empty value.
  4755. // This may be used to include null fields in Patch requests.
  4756. NullFields []string `json:"-"`
  4757. }
  4758. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4759. type NoMethod CreativeSettings
  4760. raw := NoMethod(*s)
  4761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4762. }
  4763. // CreativesListResponse: Creative List Response
  4764. type CreativesListResponse struct {
  4765. // Creatives: Creative collection.
  4766. Creatives []*Creative `json:"creatives,omitempty"`
  4767. // Kind: Identifies what kind of resource this is. Value: the fixed
  4768. // string "dfareporting#creativesListResponse".
  4769. Kind string `json:"kind,omitempty"`
  4770. // NextPageToken: Pagination token to be used for the next list
  4771. // operation.
  4772. NextPageToken string `json:"nextPageToken,omitempty"`
  4773. // ServerResponse contains the HTTP response code and headers from the
  4774. // server.
  4775. googleapi.ServerResponse `json:"-"`
  4776. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4777. // unconditionally include in API requests. By default, fields with
  4778. // empty values are omitted from API requests. However, any non-pointer,
  4779. // non-interface field appearing in ForceSendFields will be sent to the
  4780. // server regardless of whether the field is empty or not. This may be
  4781. // used to include empty fields in Patch requests.
  4782. ForceSendFields []string `json:"-"`
  4783. // NullFields is a list of field names (e.g. "Creatives") to include in
  4784. // API requests with the JSON null value. By default, fields with empty
  4785. // values are omitted from API requests. However, any field with an
  4786. // empty value appearing in NullFields will be sent to the server as
  4787. // null. It is an error if a field in this list has a non-empty value.
  4788. // This may be used to include null fields in Patch requests.
  4789. NullFields []string `json:"-"`
  4790. }
  4791. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4792. type NoMethod CreativesListResponse
  4793. raw := NoMethod(*s)
  4794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4795. }
  4796. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4797. // compatible to be selected for a report of type
  4798. // "CROSS_DIMENSION_REACH".
  4799. type CrossDimensionReachReportCompatibleFields struct {
  4800. // Breakdown: Dimensions which are compatible to be selected in the
  4801. // "breakdown" section of the report.
  4802. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4803. // DimensionFilters: Dimensions which are compatible to be selected in
  4804. // the "dimensionFilters" section of the report.
  4805. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4806. // Kind: The kind of resource this is, in this case
  4807. // dfareporting#crossDimensionReachReportCompatibleFields.
  4808. Kind string `json:"kind,omitempty"`
  4809. // Metrics: Metrics which are compatible to be selected in the
  4810. // "metricNames" section of the report.
  4811. Metrics []*Metric `json:"metrics,omitempty"`
  4812. // OverlapMetrics: Metrics which are compatible to be selected in the
  4813. // "overlapMetricNames" section of the report.
  4814. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4815. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4816. // unconditionally include in API requests. By default, fields with
  4817. // empty values are omitted from API requests. However, any non-pointer,
  4818. // non-interface field appearing in ForceSendFields will be sent to the
  4819. // server regardless of whether the field is empty or not. This may be
  4820. // used to include empty fields in Patch requests.
  4821. ForceSendFields []string `json:"-"`
  4822. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4823. // API requests with the JSON null value. By default, fields with empty
  4824. // values are omitted from API requests. However, any field with an
  4825. // empty value appearing in NullFields will be sent to the server as
  4826. // null. It is an error if a field in this list has a non-empty value.
  4827. // This may be used to include null fields in Patch requests.
  4828. NullFields []string `json:"-"`
  4829. }
  4830. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4831. type NoMethod CrossDimensionReachReportCompatibleFields
  4832. raw := NoMethod(*s)
  4833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4834. }
  4835. // CustomFloodlightVariable: A custom floodlight variable.
  4836. type CustomFloodlightVariable struct {
  4837. // Kind: Identifies what kind of resource this is. Value: the fixed
  4838. // string "dfareporting#customFloodlightVariable".
  4839. Kind string `json:"kind,omitempty"`
  4840. // Type: The type of custom floodlight variable to supply a value for.
  4841. // These map to the "u[1-20]=" in the tags.
  4842. //
  4843. // Possible values:
  4844. // "U1"
  4845. // "U10"
  4846. // "U100"
  4847. // "U11"
  4848. // "U12"
  4849. // "U13"
  4850. // "U14"
  4851. // "U15"
  4852. // "U16"
  4853. // "U17"
  4854. // "U18"
  4855. // "U19"
  4856. // "U2"
  4857. // "U20"
  4858. // "U21"
  4859. // "U22"
  4860. // "U23"
  4861. // "U24"
  4862. // "U25"
  4863. // "U26"
  4864. // "U27"
  4865. // "U28"
  4866. // "U29"
  4867. // "U3"
  4868. // "U30"
  4869. // "U31"
  4870. // "U32"
  4871. // "U33"
  4872. // "U34"
  4873. // "U35"
  4874. // "U36"
  4875. // "U37"
  4876. // "U38"
  4877. // "U39"
  4878. // "U4"
  4879. // "U40"
  4880. // "U41"
  4881. // "U42"
  4882. // "U43"
  4883. // "U44"
  4884. // "U45"
  4885. // "U46"
  4886. // "U47"
  4887. // "U48"
  4888. // "U49"
  4889. // "U5"
  4890. // "U50"
  4891. // "U51"
  4892. // "U52"
  4893. // "U53"
  4894. // "U54"
  4895. // "U55"
  4896. // "U56"
  4897. // "U57"
  4898. // "U58"
  4899. // "U59"
  4900. // "U6"
  4901. // "U60"
  4902. // "U61"
  4903. // "U62"
  4904. // "U63"
  4905. // "U64"
  4906. // "U65"
  4907. // "U66"
  4908. // "U67"
  4909. // "U68"
  4910. // "U69"
  4911. // "U7"
  4912. // "U70"
  4913. // "U71"
  4914. // "U72"
  4915. // "U73"
  4916. // "U74"
  4917. // "U75"
  4918. // "U76"
  4919. // "U77"
  4920. // "U78"
  4921. // "U79"
  4922. // "U8"
  4923. // "U80"
  4924. // "U81"
  4925. // "U82"
  4926. // "U83"
  4927. // "U84"
  4928. // "U85"
  4929. // "U86"
  4930. // "U87"
  4931. // "U88"
  4932. // "U89"
  4933. // "U9"
  4934. // "U90"
  4935. // "U91"
  4936. // "U92"
  4937. // "U93"
  4938. // "U94"
  4939. // "U95"
  4940. // "U96"
  4941. // "U97"
  4942. // "U98"
  4943. // "U99"
  4944. Type string `json:"type,omitempty"`
  4945. // Value: The value of the custom floodlight variable. The length of
  4946. // string must not exceed 50 characters.
  4947. Value string `json:"value,omitempty"`
  4948. // ForceSendFields is a list of field names (e.g. "Kind") to
  4949. // unconditionally include in API requests. By default, fields with
  4950. // empty values are omitted from API requests. However, any non-pointer,
  4951. // non-interface field appearing in ForceSendFields will be sent to the
  4952. // server regardless of whether the field is empty or not. This may be
  4953. // used to include empty fields in Patch requests.
  4954. ForceSendFields []string `json:"-"`
  4955. // NullFields is a list of field names (e.g. "Kind") to include in API
  4956. // requests with the JSON null value. By default, fields with empty
  4957. // values are omitted from API requests. However, any field with an
  4958. // empty value appearing in NullFields will be sent to the server as
  4959. // null. It is an error if a field in this list has a non-empty value.
  4960. // This may be used to include null fields in Patch requests.
  4961. NullFields []string `json:"-"`
  4962. }
  4963. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4964. type NoMethod CustomFloodlightVariable
  4965. raw := NoMethod(*s)
  4966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4967. }
  4968. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4969. type CustomRichMediaEvents struct {
  4970. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4971. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4972. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4973. // Kind: The kind of resource this is, in this case
  4974. // dfareporting#customRichMediaEvents.
  4975. Kind string `json:"kind,omitempty"`
  4976. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4977. // unconditionally include in API requests. By default, fields with
  4978. // empty values are omitted from API requests. However, any non-pointer,
  4979. // non-interface field appearing in ForceSendFields will be sent to the
  4980. // server regardless of whether the field is empty or not. This may be
  4981. // used to include empty fields in Patch requests.
  4982. ForceSendFields []string `json:"-"`
  4983. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4984. // include in API requests with the JSON null value. By default, fields
  4985. // with empty values are omitted from API requests. However, any field
  4986. // with an empty value appearing in NullFields will be sent to the
  4987. // server as null. It is an error if a field in this list has a
  4988. // non-empty value. This may be used to include null fields in Patch
  4989. // requests.
  4990. NullFields []string `json:"-"`
  4991. }
  4992. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4993. type NoMethod CustomRichMediaEvents
  4994. raw := NoMethod(*s)
  4995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4996. }
  4997. // DateRange: Represents a date range.
  4998. type DateRange struct {
  4999. // EndDate: The end date of the date range, inclusive. A string of the
  5000. // format: "yyyy-MM-dd".
  5001. EndDate string `json:"endDate,omitempty"`
  5002. // Kind: The kind of resource this is, in this case
  5003. // dfareporting#dateRange.
  5004. Kind string `json:"kind,omitempty"`
  5005. // RelativeDateRange: The date range relative to the date of when the
  5006. // report is run.
  5007. //
  5008. // Possible values:
  5009. // "LAST_14_DAYS"
  5010. // "LAST_24_MONTHS"
  5011. // "LAST_30_DAYS"
  5012. // "LAST_365_DAYS"
  5013. // "LAST_60_DAYS"
  5014. // "LAST_7_DAYS"
  5015. // "LAST_90_DAYS"
  5016. // "MONTH_TO_DATE"
  5017. // "PREVIOUS_MONTH"
  5018. // "PREVIOUS_QUARTER"
  5019. // "PREVIOUS_WEEK"
  5020. // "PREVIOUS_YEAR"
  5021. // "QUARTER_TO_DATE"
  5022. // "TODAY"
  5023. // "WEEK_TO_DATE"
  5024. // "YEAR_TO_DATE"
  5025. // "YESTERDAY"
  5026. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  5027. // StartDate: The start date of the date range, inclusive. A string of
  5028. // the format: "yyyy-MM-dd".
  5029. StartDate string `json:"startDate,omitempty"`
  5030. // ForceSendFields is a list of field names (e.g. "EndDate") to
  5031. // unconditionally include in API requests. By default, fields with
  5032. // empty values are omitted from API requests. However, any non-pointer,
  5033. // non-interface field appearing in ForceSendFields will be sent to the
  5034. // server regardless of whether the field is empty or not. This may be
  5035. // used to include empty fields in Patch requests.
  5036. ForceSendFields []string `json:"-"`
  5037. // NullFields is a list of field names (e.g. "EndDate") to include in
  5038. // API requests with the JSON null value. By default, fields with empty
  5039. // values are omitted from API requests. However, any field with an
  5040. // empty value appearing in NullFields will be sent to the server as
  5041. // null. It is an error if a field in this list has a non-empty value.
  5042. // This may be used to include null fields in Patch requests.
  5043. NullFields []string `json:"-"`
  5044. }
  5045. func (s *DateRange) MarshalJSON() ([]byte, error) {
  5046. type NoMethod DateRange
  5047. raw := NoMethod(*s)
  5048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5049. }
  5050. // DayPartTargeting: Day Part Targeting.
  5051. type DayPartTargeting struct {
  5052. // DaysOfWeek: Days of the week when the ad will serve.
  5053. //
  5054. // Acceptable values are:
  5055. // - "SUNDAY"
  5056. // - "MONDAY"
  5057. // - "TUESDAY"
  5058. // - "WEDNESDAY"
  5059. // - "THURSDAY"
  5060. // - "FRIDAY"
  5061. // - "SATURDAY"
  5062. //
  5063. // Possible values:
  5064. // "FRIDAY"
  5065. // "MONDAY"
  5066. // "SATURDAY"
  5067. // "SUNDAY"
  5068. // "THURSDAY"
  5069. // "TUESDAY"
  5070. // "WEDNESDAY"
  5071. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  5072. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  5073. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  5074. // days of week, in which case the ad would serve during these hours on
  5075. // the specified days. For example if Monday, Wednesday, Friday are the
  5076. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  5077. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  5078. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  5079. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  5080. // UserLocalTime: Whether or not to use the user's local time. If false,
  5081. // the America/New York time zone applies.
  5082. UserLocalTime bool `json:"userLocalTime,omitempty"`
  5083. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  5084. // unconditionally include in API requests. By default, fields with
  5085. // empty values are omitted from API requests. However, any non-pointer,
  5086. // non-interface field appearing in ForceSendFields will be sent to the
  5087. // server regardless of whether the field is empty or not. This may be
  5088. // used to include empty fields in Patch requests.
  5089. ForceSendFields []string `json:"-"`
  5090. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  5091. // API requests with the JSON null value. By default, fields with empty
  5092. // values are omitted from API requests. However, any field with an
  5093. // empty value appearing in NullFields will be sent to the server as
  5094. // null. It is an error if a field in this list has a non-empty value.
  5095. // This may be used to include null fields in Patch requests.
  5096. NullFields []string `json:"-"`
  5097. }
  5098. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  5099. type NoMethod DayPartTargeting
  5100. raw := NoMethod(*s)
  5101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5102. }
  5103. // DeepLink: Contains information about a landing page deep link.
  5104. type DeepLink struct {
  5105. // AppUrl: The URL of the mobile app being linked to.
  5106. AppUrl string `json:"appUrl,omitempty"`
  5107. // FallbackUrl: The fallback URL. This URL will be served to users who
  5108. // do not have the mobile app installed.
  5109. FallbackUrl string `json:"fallbackUrl,omitempty"`
  5110. // Kind: Identifies what kind of resource this is. Value: the fixed
  5111. // string "dfareporting#deepLink".
  5112. Kind string `json:"kind,omitempty"`
  5113. // MobileApp: The mobile app targeted by this deep link.
  5114. MobileApp *MobileApp `json:"mobileApp,omitempty"`
  5115. // RemarketingListIds: Ads served to users on these remarketing lists
  5116. // will use this deep link. Applicable when mobileApp.directory is
  5117. // APPLE_APP_STORE.
  5118. RemarketingListIds googleapi.Int64s `json:"remarketingListIds,omitempty"`
  5119. // ForceSendFields is a list of field names (e.g. "AppUrl") to
  5120. // unconditionally include in API requests. By default, fields with
  5121. // empty values are omitted from API requests. However, any non-pointer,
  5122. // non-interface field appearing in ForceSendFields will be sent to the
  5123. // server regardless of whether the field is empty or not. This may be
  5124. // used to include empty fields in Patch requests.
  5125. ForceSendFields []string `json:"-"`
  5126. // NullFields is a list of field names (e.g. "AppUrl") to include in API
  5127. // requests with the JSON null value. By default, fields with empty
  5128. // values are omitted from API requests. However, any field with an
  5129. // empty value appearing in NullFields will be sent to the server as
  5130. // null. It is an error if a field in this list has a non-empty value.
  5131. // This may be used to include null fields in Patch requests.
  5132. NullFields []string `json:"-"`
  5133. }
  5134. func (s *DeepLink) MarshalJSON() ([]byte, error) {
  5135. type NoMethod DeepLink
  5136. raw := NoMethod(*s)
  5137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5138. }
  5139. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  5140. // overriding the default click-through event tag. A campaign may
  5141. // override the event tag defined at the advertiser level, and an ad may
  5142. // also override the campaign's setting further.
  5143. type DefaultClickThroughEventTagProperties struct {
  5144. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  5145. // apply to all ads in this entity's scope.
  5146. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  5147. // OverrideInheritedEventTag: Whether this entity should override the
  5148. // inherited default click-through event tag with its own defined value.
  5149. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  5150. // ForceSendFields is a list of field names (e.g.
  5151. // "DefaultClickThroughEventTagId") to unconditionally include in API
  5152. // requests. By default, fields with empty values are omitted from API
  5153. // requests. However, any non-pointer, non-interface field appearing in
  5154. // ForceSendFields will be sent to the server regardless of whether the
  5155. // field is empty or not. This may be used to include empty fields in
  5156. // Patch requests.
  5157. ForceSendFields []string `json:"-"`
  5158. // NullFields is a list of field names (e.g.
  5159. // "DefaultClickThroughEventTagId") to include in API requests with the
  5160. // JSON null value. By default, fields with empty values are omitted
  5161. // from API requests. However, any field with an empty value appearing
  5162. // in NullFields will be sent to the server as null. It is an error if a
  5163. // field in this list has a non-empty value. This may be used to include
  5164. // null fields in Patch requests.
  5165. NullFields []string `json:"-"`
  5166. }
  5167. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  5168. type NoMethod DefaultClickThroughEventTagProperties
  5169. raw := NoMethod(*s)
  5170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5171. }
  5172. // DeliverySchedule: Delivery Schedule.
  5173. type DeliverySchedule struct {
  5174. // FrequencyCap: Limit on the number of times an individual user can be
  5175. // served the ad within a specified period of time.
  5176. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  5177. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  5178. // will not serve after the end date and time. Otherwise the ad will
  5179. // continue to be served until it has reached its delivery goals.
  5180. HardCutoff bool `json:"hardCutoff,omitempty"`
  5181. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  5182. // how often each ad is served relative to the others. For example, if
  5183. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  5184. // 3, then Campaign Manager will serve ad B three times as often as ad
  5185. // A. Acceptable values are 1 to 10, inclusive.
  5186. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  5187. // Priority: Serving priority of an ad, with respect to other ads. The
  5188. // lower the priority number, the greater the priority with which it is
  5189. // served.
  5190. //
  5191. // Possible values:
  5192. // "AD_PRIORITY_01"
  5193. // "AD_PRIORITY_02"
  5194. // "AD_PRIORITY_03"
  5195. // "AD_PRIORITY_04"
  5196. // "AD_PRIORITY_05"
  5197. // "AD_PRIORITY_06"
  5198. // "AD_PRIORITY_07"
  5199. // "AD_PRIORITY_08"
  5200. // "AD_PRIORITY_09"
  5201. // "AD_PRIORITY_10"
  5202. // "AD_PRIORITY_11"
  5203. // "AD_PRIORITY_12"
  5204. // "AD_PRIORITY_13"
  5205. // "AD_PRIORITY_14"
  5206. // "AD_PRIORITY_15"
  5207. // "AD_PRIORITY_16"
  5208. Priority string `json:"priority,omitempty"`
  5209. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  5210. // unconditionally include in API requests. By default, fields with
  5211. // empty values are omitted from API requests. However, any non-pointer,
  5212. // non-interface field appearing in ForceSendFields will be sent to the
  5213. // server regardless of whether the field is empty or not. This may be
  5214. // used to include empty fields in Patch requests.
  5215. ForceSendFields []string `json:"-"`
  5216. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  5217. // in API requests with the JSON null value. By default, fields with
  5218. // empty values are omitted from API requests. However, any field with
  5219. // an empty value appearing in NullFields will be sent to the server as
  5220. // null. It is an error if a field in this list has a non-empty value.
  5221. // This may be used to include null fields in Patch requests.
  5222. NullFields []string `json:"-"`
  5223. }
  5224. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  5225. type NoMethod DeliverySchedule
  5226. raw := NoMethod(*s)
  5227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5228. }
  5229. // DfpSettings: Google Ad Manager Settings
  5230. type DfpSettings struct {
  5231. // DfpNetworkCode: Ad Manager network code for this directory site.
  5232. DfpNetworkCode string `json:"dfpNetworkCode,omitempty"`
  5233. // DfpNetworkName: Ad Manager network name for this directory site.
  5234. DfpNetworkName string `json:"dfpNetworkName,omitempty"`
  5235. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  5236. // programmatic placements.
  5237. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  5238. // PubPaidPlacementAccepted: Whether this directory site accepts
  5239. // publisher-paid tags.
  5240. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  5241. // PublisherPortalOnly: Whether this directory site is available only
  5242. // via Publisher Portal.
  5243. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  5244. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  5245. // unconditionally include in API requests. By default, fields with
  5246. // empty values are omitted from API requests. However, any non-pointer,
  5247. // non-interface field appearing in ForceSendFields will be sent to the
  5248. // server regardless of whether the field is empty or not. This may be
  5249. // used to include empty fields in Patch requests.
  5250. ForceSendFields []string `json:"-"`
  5251. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  5252. // include in API requests with the JSON null value. By default, fields
  5253. // with empty values are omitted from API requests. However, any field
  5254. // with an empty value appearing in NullFields will be sent to the
  5255. // server as null. It is an error if a field in this list has a
  5256. // non-empty value. This may be used to include null fields in Patch
  5257. // requests.
  5258. NullFields []string `json:"-"`
  5259. }
  5260. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  5261. type NoMethod DfpSettings
  5262. raw := NoMethod(*s)
  5263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5264. }
  5265. // Dimension: Represents a dimension.
  5266. type Dimension struct {
  5267. // Kind: The kind of resource this is, in this case
  5268. // dfareporting#dimension.
  5269. Kind string `json:"kind,omitempty"`
  5270. // Name: The dimension name, e.g. dfa:advertiser
  5271. Name string `json:"name,omitempty"`
  5272. // ForceSendFields is a list of field names (e.g. "Kind") to
  5273. // unconditionally include in API requests. By default, fields with
  5274. // empty values are omitted from API requests. However, any non-pointer,
  5275. // non-interface field appearing in ForceSendFields will be sent to the
  5276. // server regardless of whether the field is empty or not. This may be
  5277. // used to include empty fields in Patch requests.
  5278. ForceSendFields []string `json:"-"`
  5279. // NullFields is a list of field names (e.g. "Kind") to include in API
  5280. // requests with the JSON null value. By default, fields with empty
  5281. // values are omitted from API requests. However, any field with an
  5282. // empty value appearing in NullFields will be sent to the server as
  5283. // null. It is an error if a field in this list has a non-empty value.
  5284. // This may be used to include null fields in Patch requests.
  5285. NullFields []string `json:"-"`
  5286. }
  5287. func (s *Dimension) MarshalJSON() ([]byte, error) {
  5288. type NoMethod Dimension
  5289. raw := NoMethod(*s)
  5290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5291. }
  5292. // DimensionFilter: Represents a dimension filter.
  5293. type DimensionFilter struct {
  5294. // DimensionName: The name of the dimension to filter.
  5295. DimensionName string `json:"dimensionName,omitempty"`
  5296. // Kind: The kind of resource this is, in this case
  5297. // dfareporting#dimensionFilter.
  5298. Kind string `json:"kind,omitempty"`
  5299. // Value: The value of the dimension to filter.
  5300. Value string `json:"value,omitempty"`
  5301. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5302. // unconditionally include in API requests. By default, fields with
  5303. // empty values are omitted from API requests. However, any non-pointer,
  5304. // non-interface field appearing in ForceSendFields will be sent to the
  5305. // server regardless of whether the field is empty or not. This may be
  5306. // used to include empty fields in Patch requests.
  5307. ForceSendFields []string `json:"-"`
  5308. // NullFields is a list of field names (e.g. "DimensionName") to include
  5309. // in API requests with the JSON null value. By default, fields with
  5310. // empty values are omitted from API requests. However, any field with
  5311. // an empty value appearing in NullFields will be sent to the server as
  5312. // null. It is an error if a field in this list has a non-empty value.
  5313. // This may be used to include null fields in Patch requests.
  5314. NullFields []string `json:"-"`
  5315. }
  5316. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  5317. type NoMethod DimensionFilter
  5318. raw := NoMethod(*s)
  5319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5320. }
  5321. // DimensionValue: Represents a DimensionValue resource.
  5322. type DimensionValue struct {
  5323. // DimensionName: The name of the dimension.
  5324. DimensionName string `json:"dimensionName,omitempty"`
  5325. // Etag: The eTag of this response for caching purposes.
  5326. Etag string `json:"etag,omitempty"`
  5327. // Id: The ID associated with the value if available.
  5328. Id string `json:"id,omitempty"`
  5329. // Kind: The kind of resource this is, in this case
  5330. // dfareporting#dimensionValue.
  5331. Kind string `json:"kind,omitempty"`
  5332. // MatchType: Determines how the 'value' field is matched when
  5333. // filtering. If not specified, defaults to EXACT. If set to
  5334. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  5335. // length character sequences, and it can be escaped with a backslash.
  5336. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  5337. // matchType other than EXACT.
  5338. //
  5339. // Possible values:
  5340. // "BEGINS_WITH"
  5341. // "CONTAINS"
  5342. // "EXACT"
  5343. // "WILDCARD_EXPRESSION"
  5344. MatchType string `json:"matchType,omitempty"`
  5345. // Value: The value of the dimension.
  5346. Value string `json:"value,omitempty"`
  5347. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5348. // unconditionally include in API requests. By default, fields with
  5349. // empty values are omitted from API requests. However, any non-pointer,
  5350. // non-interface field appearing in ForceSendFields will be sent to the
  5351. // server regardless of whether the field is empty or not. This may be
  5352. // used to include empty fields in Patch requests.
  5353. ForceSendFields []string `json:"-"`
  5354. // NullFields is a list of field names (e.g. "DimensionName") to include
  5355. // in API requests with the JSON null value. By default, fields with
  5356. // empty values are omitted from API requests. However, any field with
  5357. // an empty value appearing in NullFields will be sent to the server as
  5358. // null. It is an error if a field in this list has a non-empty value.
  5359. // This may be used to include null fields in Patch requests.
  5360. NullFields []string `json:"-"`
  5361. }
  5362. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5363. type NoMethod DimensionValue
  5364. raw := NoMethod(*s)
  5365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5366. }
  5367. // DimensionValueList: Represents the list of DimensionValue resources.
  5368. type DimensionValueList struct {
  5369. // Etag: The eTag of this response for caching purposes.
  5370. Etag string `json:"etag,omitempty"`
  5371. // Items: The dimension values returned in this response.
  5372. Items []*DimensionValue `json:"items,omitempty"`
  5373. // Kind: The kind of list this is, in this case
  5374. // dfareporting#dimensionValueList.
  5375. Kind string `json:"kind,omitempty"`
  5376. // NextPageToken: Continuation token used to page through dimension
  5377. // values. To retrieve the next page of results, set the next request's
  5378. // "pageToken" to the value of this field. The page token is only valid
  5379. // for a limited amount of time and should not be persisted.
  5380. NextPageToken string `json:"nextPageToken,omitempty"`
  5381. // ServerResponse contains the HTTP response code and headers from the
  5382. // server.
  5383. googleapi.ServerResponse `json:"-"`
  5384. // ForceSendFields is a list of field names (e.g. "Etag") to
  5385. // unconditionally include in API requests. By default, fields with
  5386. // empty values are omitted from API requests. However, any non-pointer,
  5387. // non-interface field appearing in ForceSendFields will be sent to the
  5388. // server regardless of whether the field is empty or not. This may be
  5389. // used to include empty fields in Patch requests.
  5390. ForceSendFields []string `json:"-"`
  5391. // NullFields is a list of field names (e.g. "Etag") to include in API
  5392. // requests with the JSON null value. By default, fields with empty
  5393. // values are omitted from API requests. However, any field with an
  5394. // empty value appearing in NullFields will be sent to the server as
  5395. // null. It is an error if a field in this list has a non-empty value.
  5396. // This may be used to include null fields in Patch requests.
  5397. NullFields []string `json:"-"`
  5398. }
  5399. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5400. type NoMethod DimensionValueList
  5401. raw := NoMethod(*s)
  5402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5403. }
  5404. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5405. type DimensionValueRequest struct {
  5406. // DimensionName: The name of the dimension for which values should be
  5407. // requested.
  5408. DimensionName string `json:"dimensionName,omitempty"`
  5409. // EndDate: The end date of the date range for which to retrieve
  5410. // dimension values. A string of the format "yyyy-MM-dd".
  5411. EndDate string `json:"endDate,omitempty"`
  5412. // Filters: The list of filters by which to filter values. The filters
  5413. // are ANDed.
  5414. Filters []*DimensionFilter `json:"filters,omitempty"`
  5415. // Kind: The kind of request this is, in this case
  5416. // dfareporting#dimensionValueRequest.
  5417. Kind string `json:"kind,omitempty"`
  5418. // StartDate: The start date of the date range for which to retrieve
  5419. // dimension values. A string of the format "yyyy-MM-dd".
  5420. StartDate string `json:"startDate,omitempty"`
  5421. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5422. // unconditionally include in API requests. By default, fields with
  5423. // empty values are omitted from API requests. However, any non-pointer,
  5424. // non-interface field appearing in ForceSendFields will be sent to the
  5425. // server regardless of whether the field is empty or not. This may be
  5426. // used to include empty fields in Patch requests.
  5427. ForceSendFields []string `json:"-"`
  5428. // NullFields is a list of field names (e.g. "DimensionName") to include
  5429. // in API requests with the JSON null value. By default, fields with
  5430. // empty values are omitted from API requests. However, any field with
  5431. // an empty value appearing in NullFields will be sent to the server as
  5432. // null. It is an error if a field in this list has a non-empty value.
  5433. // This may be used to include null fields in Patch requests.
  5434. NullFields []string `json:"-"`
  5435. }
  5436. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5437. type NoMethod DimensionValueRequest
  5438. raw := NoMethod(*s)
  5439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5440. }
  5441. // DirectorySite: DirectorySites contains properties of a website from
  5442. // the Site Directory. Sites need to be added to an account via the
  5443. // Sites resource before they can be assigned to a placement.
  5444. type DirectorySite struct {
  5445. // Active: Whether this directory site is active.
  5446. Active bool `json:"active,omitempty"`
  5447. // ContactAssignments: Directory site contacts.
  5448. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5449. // CountryId: Country ID of this directory site. This is a read-only
  5450. // field.
  5451. CountryId int64 `json:"countryId,omitempty,string"`
  5452. // CurrencyId: Currency ID of this directory site. This is a read-only
  5453. // field.
  5454. // Possible values are:
  5455. // - "1" for USD
  5456. // - "2" for GBP
  5457. // - "3" for ESP
  5458. // - "4" for SEK
  5459. // - "5" for CAD
  5460. // - "6" for JPY
  5461. // - "7" for DEM
  5462. // - "8" for AUD
  5463. // - "9" for FRF
  5464. // - "10" for ITL
  5465. // - "11" for DKK
  5466. // - "12" for NOK
  5467. // - "13" for FIM
  5468. // - "14" for ZAR
  5469. // - "15" for IEP
  5470. // - "16" for NLG
  5471. // - "17" for EUR
  5472. // - "18" for KRW
  5473. // - "19" for TWD
  5474. // - "20" for SGD
  5475. // - "21" for CNY
  5476. // - "22" for HKD
  5477. // - "23" for NZD
  5478. // - "24" for MYR
  5479. // - "25" for BRL
  5480. // - "26" for PTE
  5481. // - "27" for MXP
  5482. // - "28" for CLP
  5483. // - "29" for TRY
  5484. // - "30" for ARS
  5485. // - "31" for PEN
  5486. // - "32" for ILS
  5487. // - "33" for CHF
  5488. // - "34" for VEF
  5489. // - "35" for COP
  5490. // - "36" for GTQ
  5491. // - "37" for PLN
  5492. // - "39" for INR
  5493. // - "40" for THB
  5494. // - "41" for IDR
  5495. // - "42" for CZK
  5496. // - "43" for RON
  5497. // - "44" for HUF
  5498. // - "45" for RUB
  5499. // - "46" for AED
  5500. // - "47" for BGN
  5501. // - "48" for HRK
  5502. // - "49" for MXN
  5503. // - "50" for NGN
  5504. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5505. // Description: Description of this directory site. This is a read-only
  5506. // field.
  5507. Description string `json:"description,omitempty"`
  5508. // Id: ID of this directory site. This is a read-only, auto-generated
  5509. // field.
  5510. Id int64 `json:"id,omitempty,string"`
  5511. // IdDimensionValue: Dimension value for the ID of this directory site.
  5512. // This is a read-only, auto-generated field.
  5513. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5514. // InpageTagFormats: Tag types for regular placements.
  5515. //
  5516. // Acceptable values are:
  5517. // - "STANDARD"
  5518. // - "IFRAME_JAVASCRIPT_INPAGE"
  5519. // - "INTERNAL_REDIRECT_INPAGE"
  5520. // - "JAVASCRIPT_INPAGE"
  5521. //
  5522. // Possible values:
  5523. // "IFRAME_JAVASCRIPT_INPAGE"
  5524. // "INTERNAL_REDIRECT_INPAGE"
  5525. // "JAVASCRIPT_INPAGE"
  5526. // "STANDARD"
  5527. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5528. // InterstitialTagFormats: Tag types for interstitial
  5529. // placements.
  5530. //
  5531. // Acceptable values are:
  5532. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5533. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5534. // - "JAVASCRIPT_INTERSTITIAL"
  5535. //
  5536. // Possible values:
  5537. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5538. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5539. // "JAVASCRIPT_INTERSTITIAL"
  5540. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5541. // Kind: Identifies what kind of resource this is. Value: the fixed
  5542. // string "dfareporting#directorySite".
  5543. Kind string `json:"kind,omitempty"`
  5544. // Name: Name of this directory site.
  5545. Name string `json:"name,omitempty"`
  5546. // ParentId: Parent directory site ID.
  5547. ParentId int64 `json:"parentId,omitempty,string"`
  5548. // Settings: Directory site settings.
  5549. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5550. // Url: URL of this directory site.
  5551. Url string `json:"url,omitempty"`
  5552. // ServerResponse contains the HTTP response code and headers from the
  5553. // server.
  5554. googleapi.ServerResponse `json:"-"`
  5555. // ForceSendFields is a list of field names (e.g. "Active") to
  5556. // unconditionally include in API requests. By default, fields with
  5557. // empty values are omitted from API requests. However, any non-pointer,
  5558. // non-interface field appearing in ForceSendFields will be sent to the
  5559. // server regardless of whether the field is empty or not. This may be
  5560. // used to include empty fields in Patch requests.
  5561. ForceSendFields []string `json:"-"`
  5562. // NullFields is a list of field names (e.g. "Active") to include in API
  5563. // requests with the JSON null value. By default, fields with empty
  5564. // values are omitted from API requests. However, any field with an
  5565. // empty value appearing in NullFields will be sent to the server as
  5566. // null. It is an error if a field in this list has a non-empty value.
  5567. // This may be used to include null fields in Patch requests.
  5568. NullFields []string `json:"-"`
  5569. }
  5570. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5571. type NoMethod DirectorySite
  5572. raw := NoMethod(*s)
  5573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5574. }
  5575. // DirectorySiteContact: Contains properties of a Site Directory
  5576. // contact.
  5577. type DirectorySiteContact struct {
  5578. // Address: Address of this directory site contact.
  5579. Address string `json:"address,omitempty"`
  5580. // Email: Email address of this directory site contact.
  5581. Email string `json:"email,omitempty"`
  5582. // FirstName: First name of this directory site contact.
  5583. FirstName string `json:"firstName,omitempty"`
  5584. // Id: ID of this directory site contact. This is a read-only,
  5585. // auto-generated field.
  5586. Id int64 `json:"id,omitempty,string"`
  5587. // Kind: Identifies what kind of resource this is. Value: the fixed
  5588. // string "dfareporting#directorySiteContact".
  5589. Kind string `json:"kind,omitempty"`
  5590. // LastName: Last name of this directory site contact.
  5591. LastName string `json:"lastName,omitempty"`
  5592. // Phone: Phone number of this directory site contact.
  5593. Phone string `json:"phone,omitempty"`
  5594. // Role: Directory site contact role.
  5595. //
  5596. // Possible values:
  5597. // "ADMIN"
  5598. // "EDIT"
  5599. // "VIEW"
  5600. Role string `json:"role,omitempty"`
  5601. // Title: Title or designation of this directory site contact.
  5602. Title string `json:"title,omitempty"`
  5603. // Type: Directory site contact type.
  5604. //
  5605. // Possible values:
  5606. // "BILLING"
  5607. // "OTHER"
  5608. // "SALES"
  5609. // "TECHNICAL"
  5610. Type string `json:"type,omitempty"`
  5611. // ServerResponse contains the HTTP response code and headers from the
  5612. // server.
  5613. googleapi.ServerResponse `json:"-"`
  5614. // ForceSendFields is a list of field names (e.g. "Address") to
  5615. // unconditionally include in API requests. By default, fields with
  5616. // empty values are omitted from API requests. However, any non-pointer,
  5617. // non-interface field appearing in ForceSendFields will be sent to the
  5618. // server regardless of whether the field is empty or not. This may be
  5619. // used to include empty fields in Patch requests.
  5620. ForceSendFields []string `json:"-"`
  5621. // NullFields is a list of field names (e.g. "Address") to include in
  5622. // API requests with the JSON null value. By default, fields with empty
  5623. // values are omitted from API requests. However, any field with an
  5624. // empty value appearing in NullFields will be sent to the server as
  5625. // null. It is an error if a field in this list has a non-empty value.
  5626. // This may be used to include null fields in Patch requests.
  5627. NullFields []string `json:"-"`
  5628. }
  5629. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5630. type NoMethod DirectorySiteContact
  5631. raw := NoMethod(*s)
  5632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5633. }
  5634. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5635. type DirectorySiteContactAssignment struct {
  5636. // ContactId: ID of this directory site contact. This is a read-only,
  5637. // auto-generated field.
  5638. ContactId int64 `json:"contactId,omitempty,string"`
  5639. // Visibility: Visibility of this directory site contact assignment.
  5640. // When set to PUBLIC this contact assignment is visible to all account
  5641. // and agency users; when set to PRIVATE it is visible only to the site.
  5642. //
  5643. // Possible values:
  5644. // "PRIVATE"
  5645. // "PUBLIC"
  5646. Visibility string `json:"visibility,omitempty"`
  5647. // ForceSendFields is a list of field names (e.g. "ContactId") 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. "ContactId") to include in
  5655. // API 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 *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5663. type NoMethod DirectorySiteContactAssignment
  5664. raw := NoMethod(*s)
  5665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5666. }
  5667. // DirectorySiteContactsListResponse: Directory Site Contact List
  5668. // Response
  5669. type DirectorySiteContactsListResponse struct {
  5670. // DirectorySiteContacts: Directory site contact collection
  5671. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5672. // Kind: Identifies what kind of resource this is. Value: the fixed
  5673. // string "dfareporting#directorySiteContactsListResponse".
  5674. Kind string `json:"kind,omitempty"`
  5675. // NextPageToken: Pagination token to be used for the next list
  5676. // operation.
  5677. NextPageToken string `json:"nextPageToken,omitempty"`
  5678. // ServerResponse contains the HTTP response code and headers from the
  5679. // server.
  5680. googleapi.ServerResponse `json:"-"`
  5681. // ForceSendFields is a list of field names (e.g.
  5682. // "DirectorySiteContacts") to unconditionally include in API requests.
  5683. // By default, fields with empty values are omitted from API requests.
  5684. // However, any non-pointer, non-interface field appearing in
  5685. // ForceSendFields will be sent to the server regardless of whether the
  5686. // field is empty or not. This may be used to include empty fields in
  5687. // Patch requests.
  5688. ForceSendFields []string `json:"-"`
  5689. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5690. // include in API requests with the JSON null value. By default, fields
  5691. // with empty values are omitted from API requests. However, any field
  5692. // with an empty value appearing in NullFields will be sent to the
  5693. // server as null. It is an error if a field in this list has a
  5694. // non-empty value. This may be used to include null fields in Patch
  5695. // requests.
  5696. NullFields []string `json:"-"`
  5697. }
  5698. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5699. type NoMethod DirectorySiteContactsListResponse
  5700. raw := NoMethod(*s)
  5701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5702. }
  5703. // DirectorySiteSettings: Directory Site Settings
  5704. type DirectorySiteSettings struct {
  5705. // ActiveViewOptOut: Whether this directory site has disabled active
  5706. // view creatives.
  5707. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5708. // DfpSettings: Directory site Ad Manager settings.
  5709. DfpSettings *DfpSettings `json:"dfpSettings,omitempty"`
  5710. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5711. // video ads.
  5712. InstreamVideoPlacementAccepted bool `json:"instreamVideoPlacementAccepted,omitempty"`
  5713. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5714. // ads.
  5715. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5716. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5717. // OCR reach ratings.
  5718. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5719. // VerificationTagOptOut: Whether this directory site has disabled
  5720. // generation of Verification ins tags.
  5721. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5722. // VideoActiveViewOptOut: Whether this directory site has disabled
  5723. // active view for in-stream video creatives. This is a read-only field.
  5724. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5725. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5726. // unconditionally include in API requests. By default, fields with
  5727. // empty values are omitted from API requests. However, any non-pointer,
  5728. // non-interface field appearing in ForceSendFields will be sent to the
  5729. // server regardless of whether the field is empty or not. This may be
  5730. // used to include empty fields in Patch requests.
  5731. ForceSendFields []string `json:"-"`
  5732. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5733. // include in API requests with the JSON null value. By default, fields
  5734. // with empty values are omitted from API requests. However, any field
  5735. // with an empty value appearing in NullFields will be sent to the
  5736. // server as null. It is an error if a field in this list has a
  5737. // non-empty value. This may be used to include null fields in Patch
  5738. // requests.
  5739. NullFields []string `json:"-"`
  5740. }
  5741. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5742. type NoMethod DirectorySiteSettings
  5743. raw := NoMethod(*s)
  5744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5745. }
  5746. // DirectorySitesListResponse: Directory Site List Response
  5747. type DirectorySitesListResponse struct {
  5748. // DirectorySites: Directory site collection.
  5749. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5750. // Kind: Identifies what kind of resource this is. Value: the fixed
  5751. // string "dfareporting#directorySitesListResponse".
  5752. Kind string `json:"kind,omitempty"`
  5753. // NextPageToken: Pagination token to be used for the next list
  5754. // operation.
  5755. NextPageToken string `json:"nextPageToken,omitempty"`
  5756. // ServerResponse contains the HTTP response code and headers from the
  5757. // server.
  5758. googleapi.ServerResponse `json:"-"`
  5759. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5760. // unconditionally include in API requests. By default, fields with
  5761. // empty values are omitted from API requests. However, any non-pointer,
  5762. // non-interface field appearing in ForceSendFields will be sent to the
  5763. // server regardless of whether the field is empty or not. This may be
  5764. // used to include empty fields in Patch requests.
  5765. ForceSendFields []string `json:"-"`
  5766. // NullFields is a list of field names (e.g. "DirectorySites") to
  5767. // include in API requests with the JSON null value. By default, fields
  5768. // with empty values are omitted from API requests. However, any field
  5769. // with an empty value appearing in NullFields will be sent to the
  5770. // server as null. It is an error if a field in this list has a
  5771. // non-empty value. This may be used to include null fields in Patch
  5772. // requests.
  5773. NullFields []string `json:"-"`
  5774. }
  5775. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5776. type NoMethod DirectorySitesListResponse
  5777. raw := NoMethod(*s)
  5778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5779. }
  5780. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5781. // Dynamic targeting keys are unique, user-friendly labels, created at
  5782. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5783. // and placements and used for targeting with Studio dynamic creatives.
  5784. // Use these labels instead of numeric Campaign Manager IDs (such as
  5785. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5786. type DynamicTargetingKey struct {
  5787. // Kind: Identifies what kind of resource this is. Value: the fixed
  5788. // string "dfareporting#dynamicTargetingKey".
  5789. Kind string `json:"kind,omitempty"`
  5790. // Name: Name of this dynamic targeting key. This is a required field.
  5791. // Must be less than 256 characters long and cannot contain commas. All
  5792. // characters are converted to lowercase.
  5793. Name string `json:"name,omitempty"`
  5794. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5795. // required field.
  5796. ObjectId int64 `json:"objectId,omitempty,string"`
  5797. // ObjectType: Type of the object of this dynamic targeting key. This is
  5798. // a required field.
  5799. //
  5800. // Possible values:
  5801. // "OBJECT_AD"
  5802. // "OBJECT_ADVERTISER"
  5803. // "OBJECT_CREATIVE"
  5804. // "OBJECT_PLACEMENT"
  5805. ObjectType string `json:"objectType,omitempty"`
  5806. // ServerResponse contains the HTTP response code and headers from the
  5807. // server.
  5808. googleapi.ServerResponse `json:"-"`
  5809. // ForceSendFields is a list of field names (e.g. "Kind") to
  5810. // unconditionally include in API requests. By default, fields with
  5811. // empty values are omitted from API requests. However, any non-pointer,
  5812. // non-interface field appearing in ForceSendFields will be sent to the
  5813. // server regardless of whether the field is empty or not. This may be
  5814. // used to include empty fields in Patch requests.
  5815. ForceSendFields []string `json:"-"`
  5816. // NullFields is a list of field names (e.g. "Kind") to include in API
  5817. // requests with the JSON null value. By default, fields with empty
  5818. // values are omitted from API requests. However, any field with an
  5819. // empty value appearing in NullFields will be sent to the server as
  5820. // null. It is an error if a field in this list has a non-empty value.
  5821. // This may be used to include null fields in Patch requests.
  5822. NullFields []string `json:"-"`
  5823. }
  5824. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5825. type NoMethod DynamicTargetingKey
  5826. raw := NoMethod(*s)
  5827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5828. }
  5829. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5830. type DynamicTargetingKeysListResponse struct {
  5831. // DynamicTargetingKeys: Dynamic targeting key collection.
  5832. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5833. // Kind: Identifies what kind of resource this is. Value: the fixed
  5834. // string "dfareporting#dynamicTargetingKeysListResponse".
  5835. Kind string `json:"kind,omitempty"`
  5836. // ServerResponse contains the HTTP response code and headers from the
  5837. // server.
  5838. googleapi.ServerResponse `json:"-"`
  5839. // ForceSendFields is a list of field names (e.g.
  5840. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5841. // By default, fields with empty values are omitted from API requests.
  5842. // However, any non-pointer, non-interface field appearing in
  5843. // ForceSendFields will be sent to the server regardless of whether the
  5844. // field is empty or not. This may be used to include empty fields in
  5845. // Patch requests.
  5846. ForceSendFields []string `json:"-"`
  5847. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5848. // include in API requests with the JSON null value. By default, fields
  5849. // with empty values are omitted from API requests. However, any field
  5850. // with an empty value appearing in NullFields will be sent to the
  5851. // server as null. It is an error if a field in this list has a
  5852. // non-empty value. This may be used to include null fields in Patch
  5853. // requests.
  5854. NullFields []string `json:"-"`
  5855. }
  5856. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5857. type NoMethod DynamicTargetingKeysListResponse
  5858. raw := NoMethod(*s)
  5859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5860. }
  5861. // EncryptionInfo: A description of how user IDs are encrypted.
  5862. type EncryptionInfo struct {
  5863. // EncryptionEntityId: The encryption entity ID. This should match the
  5864. // encryption configuration for ad serving or Data Transfer.
  5865. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5866. // EncryptionEntityType: The encryption entity type. This should match
  5867. // the encryption configuration for ad serving or Data Transfer.
  5868. //
  5869. // Possible values:
  5870. // "ADWORDS_CUSTOMER"
  5871. // "DBM_ADVERTISER"
  5872. // "DBM_PARTNER"
  5873. // "DCM_ACCOUNT"
  5874. // "DCM_ADVERTISER"
  5875. // "DFP_NETWORK_CODE"
  5876. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5877. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5878. // EncryptionSource: Describes whether the encrypted cookie was received
  5879. // from ad serving (the %m macro) or from Data Transfer.
  5880. //
  5881. // Possible values:
  5882. // "AD_SERVING"
  5883. // "DATA_TRANSFER"
  5884. // "ENCRYPTION_SCOPE_UNKNOWN"
  5885. EncryptionSource string `json:"encryptionSource,omitempty"`
  5886. // Kind: Identifies what kind of resource this is. Value: the fixed
  5887. // string "dfareporting#encryptionInfo".
  5888. Kind string `json:"kind,omitempty"`
  5889. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5890. // to unconditionally include in API requests. By default, fields with
  5891. // empty values are omitted from API requests. However, any non-pointer,
  5892. // non-interface field appearing in ForceSendFields will be sent to the
  5893. // server regardless of whether the field is empty or not. This may be
  5894. // used to include empty fields in Patch requests.
  5895. ForceSendFields []string `json:"-"`
  5896. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5897. // include in API requests with the JSON null value. By default, fields
  5898. // with empty values are omitted from API requests. However, any field
  5899. // with an empty value appearing in NullFields will be sent to the
  5900. // server as null. It is an error if a field in this list has a
  5901. // non-empty value. This may be used to include null fields in Patch
  5902. // requests.
  5903. NullFields []string `json:"-"`
  5904. }
  5905. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5906. type NoMethod EncryptionInfo
  5907. raw := NoMethod(*s)
  5908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5909. }
  5910. // EventTag: Contains properties of an event tag.
  5911. type EventTag struct {
  5912. // AccountId: Account ID of this event tag. This is a read-only field
  5913. // that can be left blank.
  5914. AccountId int64 `json:"accountId,omitempty,string"`
  5915. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5916. // campaignId field is required on insertion.
  5917. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5918. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5919. // advertiser. This is a read-only, auto-generated field.
  5920. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5921. // CampaignId: Campaign ID of this event tag. This field or the
  5922. // advertiserId field is required on insertion.
  5923. CampaignId int64 `json:"campaignId,omitempty,string"`
  5924. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5925. // This is a read-only, auto-generated field.
  5926. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5927. // EnabledByDefault: Whether this event tag should be automatically
  5928. // enabled for all of the advertiser's campaigns and ads.
  5929. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5930. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5931. // that are trafficked through Display & Video 360 to Ad Exchange. This
  5932. // may be useful if the event tag uses a pixel that is unapproved for Ad
  5933. // Exchange bids on one or more networks, such as the Google Display
  5934. // Network.
  5935. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5936. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5937. Id int64 `json:"id,omitempty,string"`
  5938. // Kind: Identifies what kind of resource this is. Value: the fixed
  5939. // string "dfareporting#eventTag".
  5940. Kind string `json:"kind,omitempty"`
  5941. // Name: Name of this event tag. This is a required field and must be
  5942. // less than 256 characters long.
  5943. Name string `json:"name,omitempty"`
  5944. // SiteFilterType: Site filter type for this event tag. If no type is
  5945. // specified then the event tag will be applied to all sites.
  5946. //
  5947. // Possible values:
  5948. // "BLACKLIST"
  5949. // "WHITELIST"
  5950. SiteFilterType string `json:"siteFilterType,omitempty"`
  5951. // SiteIds: Filter list of site IDs associated with this event tag. The
  5952. // siteFilterType determines whether this is a whitelist or blacklist
  5953. // filter.
  5954. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5955. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5956. // read-only field.
  5957. SslCompliant bool `json:"sslCompliant,omitempty"`
  5958. // Status: Status of this event tag. Must be ENABLED for this event tag
  5959. // to fire. This is a required field.
  5960. //
  5961. // Possible values:
  5962. // "DISABLED"
  5963. // "ENABLED"
  5964. Status string `json:"status,omitempty"`
  5965. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5966. // field that can be left blank.
  5967. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5968. // Type: Event tag type. Can be used to specify whether to use a
  5969. // third-party pixel, a third-party JavaScript URL, or a third-party
  5970. // click-through URL for either impression or click tracking. This is a
  5971. // required field.
  5972. //
  5973. // Possible values:
  5974. // "CLICK_THROUGH_EVENT_TAG"
  5975. // "IMPRESSION_IMAGE_EVENT_TAG"
  5976. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5977. Type string `json:"type,omitempty"`
  5978. // Url: Payload URL for this event tag. The URL on a click-through event
  5979. // tag should have a landing page URL appended to the end of it. This
  5980. // field is required on insertion.
  5981. Url string `json:"url,omitempty"`
  5982. // UrlEscapeLevels: Number of times the landing page URL should be
  5983. // URL-escaped before being appended to the click-through event tag URL.
  5984. // Only applies to click-through event tags as specified by the event
  5985. // tag type.
  5986. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5987. // ServerResponse contains the HTTP response code and headers from the
  5988. // server.
  5989. googleapi.ServerResponse `json:"-"`
  5990. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5991. // unconditionally include in API requests. By default, fields with
  5992. // empty values are omitted from API requests. However, any non-pointer,
  5993. // non-interface field appearing in ForceSendFields will be sent to the
  5994. // server regardless of whether the field is empty or not. This may be
  5995. // used to include empty fields in Patch requests.
  5996. ForceSendFields []string `json:"-"`
  5997. // NullFields is a list of field names (e.g. "AccountId") to include in
  5998. // API requests with the JSON null value. By default, fields with empty
  5999. // values are omitted from API requests. However, any field with an
  6000. // empty value appearing in NullFields will be sent to the server as
  6001. // null. It is an error if a field in this list has a non-empty value.
  6002. // This may be used to include null fields in Patch requests.
  6003. NullFields []string `json:"-"`
  6004. }
  6005. func (s *EventTag) MarshalJSON() ([]byte, error) {
  6006. type NoMethod EventTag
  6007. raw := NoMethod(*s)
  6008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6009. }
  6010. // EventTagOverride: Event tag override information.
  6011. type EventTagOverride struct {
  6012. // Enabled: Whether this override is enabled.
  6013. Enabled bool `json:"enabled,omitempty"`
  6014. // Id: ID of this event tag override. This is a read-only,
  6015. // auto-generated field.
  6016. Id int64 `json:"id,omitempty,string"`
  6017. // ForceSendFields is a list of field names (e.g. "Enabled") to
  6018. // unconditionally include in API requests. By default, fields with
  6019. // empty values are omitted from API requests. However, any non-pointer,
  6020. // non-interface field appearing in ForceSendFields will be sent to the
  6021. // server regardless of whether the field is empty or not. This may be
  6022. // used to include empty fields in Patch requests.
  6023. ForceSendFields []string `json:"-"`
  6024. // NullFields is a list of field names (e.g. "Enabled") to include in
  6025. // API requests with the JSON null value. By default, fields with empty
  6026. // values are omitted from API requests. However, any field with an
  6027. // empty value appearing in NullFields will be sent to the server as
  6028. // null. It is an error if a field in this list has a non-empty value.
  6029. // This may be used to include null fields in Patch requests.
  6030. NullFields []string `json:"-"`
  6031. }
  6032. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  6033. type NoMethod EventTagOverride
  6034. raw := NoMethod(*s)
  6035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6036. }
  6037. // EventTagsListResponse: Event Tag List Response
  6038. type EventTagsListResponse struct {
  6039. // EventTags: Event tag collection.
  6040. EventTags []*EventTag `json:"eventTags,omitempty"`
  6041. // Kind: Identifies what kind of resource this is. Value: the fixed
  6042. // string "dfareporting#eventTagsListResponse".
  6043. Kind string `json:"kind,omitempty"`
  6044. // ServerResponse contains the HTTP response code and headers from the
  6045. // server.
  6046. googleapi.ServerResponse `json:"-"`
  6047. // ForceSendFields is a list of field names (e.g. "EventTags") to
  6048. // unconditionally include in API requests. By default, fields with
  6049. // empty values are omitted from API requests. However, any non-pointer,
  6050. // non-interface field appearing in ForceSendFields will be sent to the
  6051. // server regardless of whether the field is empty or not. This may be
  6052. // used to include empty fields in Patch requests.
  6053. ForceSendFields []string `json:"-"`
  6054. // NullFields is a list of field names (e.g. "EventTags") to include in
  6055. // API requests with the JSON null value. By default, fields with empty
  6056. // values are omitted from API requests. However, any field with an
  6057. // empty value appearing in NullFields will be sent to the server as
  6058. // null. It is an error if a field in this list has a non-empty value.
  6059. // This may be used to include null fields in Patch requests.
  6060. NullFields []string `json:"-"`
  6061. }
  6062. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  6063. type NoMethod EventTagsListResponse
  6064. raw := NoMethod(*s)
  6065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6066. }
  6067. // File: Represents a File resource. A file contains the metadata for a
  6068. // report run. It shows the status of the run and holds the URLs to the
  6069. // generated report data if the run is finished and the status is
  6070. // "REPORT_AVAILABLE".
  6071. type File struct {
  6072. // DateRange: The date range for which the file has report data. The
  6073. // date range will always be the absolute date range for which the
  6074. // report is run.
  6075. DateRange *DateRange `json:"dateRange,omitempty"`
  6076. // Etag: The eTag of this response for caching purposes.
  6077. Etag string `json:"etag,omitempty"`
  6078. // FileName: The filename of the file.
  6079. FileName string `json:"fileName,omitempty"`
  6080. // Format: The output format of the report. Only available once the file
  6081. // is available.
  6082. //
  6083. // Possible values:
  6084. // "CSV"
  6085. // "EXCEL"
  6086. Format string `json:"format,omitempty"`
  6087. // Id: The unique ID of this report file.
  6088. Id int64 `json:"id,omitempty,string"`
  6089. // Kind: The kind of resource this is, in this case dfareporting#file.
  6090. Kind string `json:"kind,omitempty"`
  6091. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  6092. // file was last modified.
  6093. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  6094. // ReportId: The ID of the report this file was generated from.
  6095. ReportId int64 `json:"reportId,omitempty,string"`
  6096. // Status: The status of the report file.
  6097. //
  6098. // Possible values:
  6099. // "CANCELLED"
  6100. // "FAILED"
  6101. // "PROCESSING"
  6102. // "REPORT_AVAILABLE"
  6103. Status string `json:"status,omitempty"`
  6104. // Urls: The URLs where the completed report file can be downloaded.
  6105. Urls *FileUrls `json:"urls,omitempty"`
  6106. // ServerResponse contains the HTTP response code and headers from the
  6107. // server.
  6108. googleapi.ServerResponse `json:"-"`
  6109. // ForceSendFields is a list of field names (e.g. "DateRange") to
  6110. // unconditionally include in API requests. By default, fields with
  6111. // empty values are omitted from API requests. However, any non-pointer,
  6112. // non-interface field appearing in ForceSendFields will be sent to the
  6113. // server regardless of whether the field is empty or not. This may be
  6114. // used to include empty fields in Patch requests.
  6115. ForceSendFields []string `json:"-"`
  6116. // NullFields is a list of field names (e.g. "DateRange") to include in
  6117. // API requests with the JSON null value. By default, fields with empty
  6118. // values are omitted from API requests. However, any field with an
  6119. // empty value appearing in NullFields will be sent to the server as
  6120. // null. It is an error if a field in this list has a non-empty value.
  6121. // This may be used to include null fields in Patch requests.
  6122. NullFields []string `json:"-"`
  6123. }
  6124. func (s *File) MarshalJSON() ([]byte, error) {
  6125. type NoMethod File
  6126. raw := NoMethod(*s)
  6127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6128. }
  6129. // FileUrls: The URLs where the completed report file can be downloaded.
  6130. type FileUrls struct {
  6131. // ApiUrl: The URL for downloading the report data through the API.
  6132. ApiUrl string `json:"apiUrl,omitempty"`
  6133. // BrowserUrl: The URL for downloading the report data through a
  6134. // browser.
  6135. BrowserUrl string `json:"browserUrl,omitempty"`
  6136. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  6137. // unconditionally include in API requests. By default, fields with
  6138. // empty values are omitted from API requests. However, any non-pointer,
  6139. // non-interface field appearing in ForceSendFields will be sent to the
  6140. // server regardless of whether the field is empty or not. This may be
  6141. // used to include empty fields in Patch requests.
  6142. ForceSendFields []string `json:"-"`
  6143. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  6144. // requests with the JSON null value. By default, fields with empty
  6145. // values are omitted from API requests. However, any field with an
  6146. // empty value appearing in NullFields will be sent to the server as
  6147. // null. It is an error if a field in this list has a non-empty value.
  6148. // This may be used to include null fields in Patch requests.
  6149. NullFields []string `json:"-"`
  6150. }
  6151. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  6152. type NoMethod FileUrls
  6153. raw := NoMethod(*s)
  6154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6155. }
  6156. // FileList: Represents the list of File resources.
  6157. type FileList struct {
  6158. // Etag: The eTag of this response for caching purposes.
  6159. Etag string `json:"etag,omitempty"`
  6160. // Items: The files returned in this response.
  6161. Items []*File `json:"items,omitempty"`
  6162. // Kind: The kind of list this is, in this case dfareporting#fileList.
  6163. Kind string `json:"kind,omitempty"`
  6164. // NextPageToken: Continuation token used to page through files. To
  6165. // retrieve the next page of results, set the next request's "pageToken"
  6166. // to the value of this field. The page token is only valid for a
  6167. // limited amount of time and should not be persisted.
  6168. NextPageToken string `json:"nextPageToken,omitempty"`
  6169. // ServerResponse contains the HTTP response code and headers from the
  6170. // server.
  6171. googleapi.ServerResponse `json:"-"`
  6172. // ForceSendFields is a list of field names (e.g. "Etag") to
  6173. // unconditionally include in API requests. By default, fields with
  6174. // empty values are omitted from API requests. However, any non-pointer,
  6175. // non-interface field appearing in ForceSendFields will be sent to the
  6176. // server regardless of whether the field is empty or not. This may be
  6177. // used to include empty fields in Patch requests.
  6178. ForceSendFields []string `json:"-"`
  6179. // NullFields is a list of field names (e.g. "Etag") to include in API
  6180. // requests with the JSON null value. By default, fields with empty
  6181. // values are omitted from API requests. However, any field with an
  6182. // empty value appearing in NullFields will be sent to the server as
  6183. // null. It is an error if a field in this list has a non-empty value.
  6184. // This may be used to include null fields in Patch requests.
  6185. NullFields []string `json:"-"`
  6186. }
  6187. func (s *FileList) MarshalJSON() ([]byte, error) {
  6188. type NoMethod FileList
  6189. raw := NoMethod(*s)
  6190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6191. }
  6192. // Flight: Flight
  6193. type Flight struct {
  6194. // EndDate: Inventory item flight end date.
  6195. EndDate string `json:"endDate,omitempty"`
  6196. // RateOrCost: Rate or cost of this flight.
  6197. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  6198. // StartDate: Inventory item flight start date.
  6199. StartDate string `json:"startDate,omitempty"`
  6200. // Units: Units of this flight.
  6201. Units int64 `json:"units,omitempty,string"`
  6202. // ForceSendFields is a list of field names (e.g. "EndDate") to
  6203. // unconditionally include in API requests. By default, fields with
  6204. // empty values are omitted from API requests. However, any non-pointer,
  6205. // non-interface field appearing in ForceSendFields will be sent to the
  6206. // server regardless of whether the field is empty or not. This may be
  6207. // used to include empty fields in Patch requests.
  6208. ForceSendFields []string `json:"-"`
  6209. // NullFields is a list of field names (e.g. "EndDate") to include in
  6210. // API requests with the JSON null value. By default, fields with empty
  6211. // values are omitted from API requests. However, any field with an
  6212. // empty value appearing in NullFields will be sent to the server as
  6213. // null. It is an error if a field in this list has a non-empty value.
  6214. // This may be used to include null fields in Patch requests.
  6215. NullFields []string `json:"-"`
  6216. }
  6217. func (s *Flight) MarshalJSON() ([]byte, error) {
  6218. type NoMethod Flight
  6219. raw := NoMethod(*s)
  6220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6221. }
  6222. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  6223. // GenerateTag Response
  6224. type FloodlightActivitiesGenerateTagResponse struct {
  6225. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  6226. // For global site tags, this is the event snippet.
  6227. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  6228. // GlobalSiteTagGlobalSnippet: The global snippet section of a global
  6229. // site tag. The global site tag sets new cookies on your domain, which
  6230. // will store a unique identifier for a user or the ad click that
  6231. // brought the user to your site. Learn more.
  6232. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"`
  6233. // Kind: Identifies what kind of resource this is. Value: the fixed
  6234. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  6235. Kind string `json:"kind,omitempty"`
  6236. // ServerResponse contains the HTTP response code and headers from the
  6237. // server.
  6238. googleapi.ServerResponse `json:"-"`
  6239. // ForceSendFields is a list of field names (e.g.
  6240. // "FloodlightActivityTag") to unconditionally include in API requests.
  6241. // By default, fields with empty values are omitted from API requests.
  6242. // However, any non-pointer, non-interface field appearing in
  6243. // ForceSendFields will be sent to the server regardless of whether the
  6244. // field is empty or not. This may be used to include empty fields in
  6245. // Patch requests.
  6246. ForceSendFields []string `json:"-"`
  6247. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  6248. // include in API requests with the JSON null value. By default, fields
  6249. // with empty values are omitted from API requests. However, any field
  6250. // with an empty value appearing in NullFields will be sent to the
  6251. // server as null. It is an error if a field in this list has a
  6252. // non-empty value. This may be used to include null fields in Patch
  6253. // requests.
  6254. NullFields []string `json:"-"`
  6255. }
  6256. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  6257. type NoMethod FloodlightActivitiesGenerateTagResponse
  6258. raw := NoMethod(*s)
  6259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6260. }
  6261. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  6262. type FloodlightActivitiesListResponse struct {
  6263. // FloodlightActivities: Floodlight activity collection.
  6264. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  6265. // Kind: Identifies what kind of resource this is. Value: the fixed
  6266. // string "dfareporting#floodlightActivitiesListResponse".
  6267. Kind string `json:"kind,omitempty"`
  6268. // NextPageToken: Pagination token to be used for the next list
  6269. // operation.
  6270. NextPageToken string `json:"nextPageToken,omitempty"`
  6271. // ServerResponse contains the HTTP response code and headers from the
  6272. // server.
  6273. googleapi.ServerResponse `json:"-"`
  6274. // ForceSendFields is a list of field names (e.g.
  6275. // "FloodlightActivities") to unconditionally include in API requests.
  6276. // By default, fields with empty values are omitted from API requests.
  6277. // However, any non-pointer, non-interface field appearing in
  6278. // ForceSendFields will be sent to the server regardless of whether the
  6279. // field is empty or not. This may be used to include empty fields in
  6280. // Patch requests.
  6281. ForceSendFields []string `json:"-"`
  6282. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  6283. // include in API requests with the JSON null value. By default, fields
  6284. // with empty values are omitted from API requests. However, any field
  6285. // with an empty value appearing in NullFields will be sent to the
  6286. // server as null. It is an error if a field in this list has a
  6287. // non-empty value. This may be used to include null fields in Patch
  6288. // requests.
  6289. NullFields []string `json:"-"`
  6290. }
  6291. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  6292. type NoMethod FloodlightActivitiesListResponse
  6293. raw := NoMethod(*s)
  6294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6295. }
  6296. // FloodlightActivity: Contains properties of a Floodlight activity.
  6297. type FloodlightActivity struct {
  6298. // AccountId: Account ID of this floodlight activity. This is a
  6299. // read-only field that can be left blank.
  6300. AccountId int64 `json:"accountId,omitempty,string"`
  6301. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  6302. // field is left blank, the value will be copied over either from the
  6303. // activity group's advertiser or the existing activity's advertiser.
  6304. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6305. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6306. // advertiser. This is a read-only, auto-generated field.
  6307. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6308. // CacheBustingType: Code type used for cache busting in the generated
  6309. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  6310. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  6311. //
  6312. // Possible values:
  6313. // "ACTIVE_SERVER_PAGE"
  6314. // "COLD_FUSION"
  6315. // "JAVASCRIPT"
  6316. // "JSP"
  6317. // "PHP"
  6318. CacheBustingType string `json:"cacheBustingType,omitempty"`
  6319. // CountingMethod: Counting method for conversions for this floodlight
  6320. // activity. This is a required field.
  6321. //
  6322. // Possible values:
  6323. // "ITEMS_SOLD_COUNTING"
  6324. // "SESSION_COUNTING"
  6325. // "STANDARD_COUNTING"
  6326. // "TRANSACTIONS_COUNTING"
  6327. // "UNIQUE_COUNTING"
  6328. CountingMethod string `json:"countingMethod,omitempty"`
  6329. // DefaultTags: Dynamic floodlight tags.
  6330. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  6331. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  6332. // be less than 256 characters long.
  6333. ExpectedUrl string `json:"expectedUrl,omitempty"`
  6334. // FloodlightActivityGroupId: Floodlight activity group ID of this
  6335. // floodlight activity. This is a required field.
  6336. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  6337. // FloodlightActivityGroupName: Name of the associated floodlight
  6338. // activity group. This is a read-only field.
  6339. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  6340. // FloodlightActivityGroupTagString: Tag string of the associated
  6341. // floodlight activity group. This is a read-only field.
  6342. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  6343. // FloodlightActivityGroupType: Type of the associated floodlight
  6344. // activity group. This is a read-only field.
  6345. //
  6346. // Possible values:
  6347. // "COUNTER"
  6348. // "SALE"
  6349. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6350. // FloodlightConfigurationId: Floodlight configuration ID of this
  6351. // floodlight activity. If this field is left blank, the value will be
  6352. // copied over either from the activity group's floodlight configuration
  6353. // or from the existing activity's floodlight configuration.
  6354. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6355. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6356. // of the floodlight configuration. This is a read-only, auto-generated
  6357. // field.
  6358. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6359. // FloodlightTagType: The type of Floodlight tag this activity will
  6360. // generate. This is a required field.
  6361. //
  6362. // Possible values:
  6363. // "GLOBAL_SITE_TAG"
  6364. // "IFRAME"
  6365. // "IMAGE"
  6366. FloodlightTagType string `json:"floodlightTagType,omitempty"`
  6367. // Hidden: Whether this activity is archived.
  6368. Hidden bool `json:"hidden,omitempty"`
  6369. // Id: ID of this floodlight activity. This is a read-only,
  6370. // auto-generated field.
  6371. Id int64 `json:"id,omitempty,string"`
  6372. // IdDimensionValue: Dimension value for the ID of this floodlight
  6373. // activity. This is a read-only, auto-generated field.
  6374. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6375. // Kind: Identifies what kind of resource this is. Value: the fixed
  6376. // string "dfareporting#floodlightActivity".
  6377. Kind string `json:"kind,omitempty"`
  6378. // Name: Name of this floodlight activity. This is a required field.
  6379. // Must be less than 129 characters long and cannot contain quotes.
  6380. Name string `json:"name,omitempty"`
  6381. // Notes: General notes or implementation instructions for the tag.
  6382. Notes string `json:"notes,omitempty"`
  6383. // PublisherTags: Publisher dynamic floodlight tags.
  6384. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6385. // Secure: Whether this tag should use SSL.
  6386. Secure bool `json:"secure,omitempty"`
  6387. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6388. // is a read-only field, its value detected by the system from the
  6389. // floodlight tags.
  6390. SslCompliant bool `json:"sslCompliant,omitempty"`
  6391. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6392. SslRequired bool `json:"sslRequired,omitempty"`
  6393. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6394. // read-only field that can be left blank.
  6395. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6396. // TagFormat: Tag format type for the floodlight activity. If left
  6397. // blank, the tag format will default to HTML.
  6398. //
  6399. // Possible values:
  6400. // "HTML"
  6401. // "XHTML"
  6402. TagFormat string `json:"tagFormat,omitempty"`
  6403. // TagString: Value of the cat= parameter in the floodlight tag, which
  6404. // the ad servers use to identify the activity. This is optional: if
  6405. // empty, a new tag string will be generated for you. This string must
  6406. // be 1 to 8 characters long, with valid characters being
  6407. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6408. // activities of the same activity group. This field is read-only after
  6409. // insertion.
  6410. TagString string `json:"tagString,omitempty"`
  6411. // UserDefinedVariableTypes: List of the user-defined variables used by
  6412. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6413. // of these can have a user defined type.
  6414. // Acceptable values are U1 to U100, inclusive.
  6415. //
  6416. // Possible values:
  6417. // "U1"
  6418. // "U10"
  6419. // "U100"
  6420. // "U11"
  6421. // "U12"
  6422. // "U13"
  6423. // "U14"
  6424. // "U15"
  6425. // "U16"
  6426. // "U17"
  6427. // "U18"
  6428. // "U19"
  6429. // "U2"
  6430. // "U20"
  6431. // "U21"
  6432. // "U22"
  6433. // "U23"
  6434. // "U24"
  6435. // "U25"
  6436. // "U26"
  6437. // "U27"
  6438. // "U28"
  6439. // "U29"
  6440. // "U3"
  6441. // "U30"
  6442. // "U31"
  6443. // "U32"
  6444. // "U33"
  6445. // "U34"
  6446. // "U35"
  6447. // "U36"
  6448. // "U37"
  6449. // "U38"
  6450. // "U39"
  6451. // "U4"
  6452. // "U40"
  6453. // "U41"
  6454. // "U42"
  6455. // "U43"
  6456. // "U44"
  6457. // "U45"
  6458. // "U46"
  6459. // "U47"
  6460. // "U48"
  6461. // "U49"
  6462. // "U5"
  6463. // "U50"
  6464. // "U51"
  6465. // "U52"
  6466. // "U53"
  6467. // "U54"
  6468. // "U55"
  6469. // "U56"
  6470. // "U57"
  6471. // "U58"
  6472. // "U59"
  6473. // "U6"
  6474. // "U60"
  6475. // "U61"
  6476. // "U62"
  6477. // "U63"
  6478. // "U64"
  6479. // "U65"
  6480. // "U66"
  6481. // "U67"
  6482. // "U68"
  6483. // "U69"
  6484. // "U7"
  6485. // "U70"
  6486. // "U71"
  6487. // "U72"
  6488. // "U73"
  6489. // "U74"
  6490. // "U75"
  6491. // "U76"
  6492. // "U77"
  6493. // "U78"
  6494. // "U79"
  6495. // "U8"
  6496. // "U80"
  6497. // "U81"
  6498. // "U82"
  6499. // "U83"
  6500. // "U84"
  6501. // "U85"
  6502. // "U86"
  6503. // "U87"
  6504. // "U88"
  6505. // "U89"
  6506. // "U9"
  6507. // "U90"
  6508. // "U91"
  6509. // "U92"
  6510. // "U93"
  6511. // "U94"
  6512. // "U95"
  6513. // "U96"
  6514. // "U97"
  6515. // "U98"
  6516. // "U99"
  6517. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6518. // ServerResponse contains the HTTP response code and headers from the
  6519. // server.
  6520. googleapi.ServerResponse `json:"-"`
  6521. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6522. // unconditionally include in API requests. By default, fields with
  6523. // empty values are omitted from API requests. However, any non-pointer,
  6524. // non-interface field appearing in ForceSendFields will be sent to the
  6525. // server regardless of whether the field is empty or not. This may be
  6526. // used to include empty fields in Patch requests.
  6527. ForceSendFields []string `json:"-"`
  6528. // NullFields is a list of field names (e.g. "AccountId") to include in
  6529. // API requests with the JSON null value. By default, fields with empty
  6530. // values are omitted from API requests. However, any field with an
  6531. // empty value appearing in NullFields will be sent to the server as
  6532. // null. It is an error if a field in this list has a non-empty value.
  6533. // This may be used to include null fields in Patch requests.
  6534. NullFields []string `json:"-"`
  6535. }
  6536. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6537. type NoMethod FloodlightActivity
  6538. raw := NoMethod(*s)
  6539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6540. }
  6541. // FloodlightActivityDynamicTag: Dynamic Tag
  6542. type FloodlightActivityDynamicTag struct {
  6543. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6544. // field.
  6545. Id int64 `json:"id,omitempty,string"`
  6546. // Name: Name of this tag.
  6547. Name string `json:"name,omitempty"`
  6548. // Tag: Tag code.
  6549. Tag string `json:"tag,omitempty"`
  6550. // ForceSendFields is a list of field names (e.g. "Id") to
  6551. // unconditionally include in API requests. By default, fields with
  6552. // empty values are omitted from API requests. However, any non-pointer,
  6553. // non-interface field appearing in ForceSendFields will be sent to the
  6554. // server regardless of whether the field is empty or not. This may be
  6555. // used to include empty fields in Patch requests.
  6556. ForceSendFields []string `json:"-"`
  6557. // NullFields is a list of field names (e.g. "Id") to include in API
  6558. // requests with the JSON null value. By default, fields with empty
  6559. // values are omitted from API requests. However, any field with an
  6560. // empty value appearing in NullFields will be sent to the server as
  6561. // null. It is an error if a field in this list has a non-empty value.
  6562. // This may be used to include null fields in Patch requests.
  6563. NullFields []string `json:"-"`
  6564. }
  6565. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6566. type NoMethod FloodlightActivityDynamicTag
  6567. raw := NoMethod(*s)
  6568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6569. }
  6570. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6571. // group.
  6572. type FloodlightActivityGroup struct {
  6573. // AccountId: Account ID of this floodlight activity group. This is a
  6574. // read-only field that can be left blank.
  6575. AccountId int64 `json:"accountId,omitempty,string"`
  6576. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6577. // this field is left blank, the value will be copied over either from
  6578. // the floodlight configuration's advertiser or from the existing
  6579. // activity group's advertiser.
  6580. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6581. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6582. // advertiser. This is a read-only, auto-generated field.
  6583. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6584. // FloodlightConfigurationId: Floodlight configuration ID of this
  6585. // floodlight activity group. This is a required field.
  6586. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6587. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6588. // of the floodlight configuration. This is a read-only, auto-generated
  6589. // field.
  6590. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6591. // Id: ID of this floodlight activity group. This is a read-only,
  6592. // auto-generated field.
  6593. Id int64 `json:"id,omitempty,string"`
  6594. // IdDimensionValue: Dimension value for the ID of this floodlight
  6595. // activity group. This is a read-only, auto-generated field.
  6596. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6597. // Kind: Identifies what kind of resource this is. Value: the fixed
  6598. // string "dfareporting#floodlightActivityGroup".
  6599. Kind string `json:"kind,omitempty"`
  6600. // Name: Name of this floodlight activity group. This is a required
  6601. // field. Must be less than 65 characters long and cannot contain
  6602. // quotes.
  6603. Name string `json:"name,omitempty"`
  6604. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6605. // is a read-only field that can be left blank.
  6606. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6607. // TagString: Value of the type= parameter in the floodlight tag, which
  6608. // the ad servers use to identify the activity group that the activity
  6609. // belongs to. This is optional: if empty, a new tag string will be
  6610. // generated for you. This string must be 1 to 8 characters long, with
  6611. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6612. // also be unique among activity groups of the same floodlight
  6613. // configuration. This field is read-only after insertion.
  6614. TagString string `json:"tagString,omitempty"`
  6615. // Type: Type of the floodlight activity group. This is a required field
  6616. // that is read-only after insertion.
  6617. //
  6618. // Possible values:
  6619. // "COUNTER"
  6620. // "SALE"
  6621. Type string `json:"type,omitempty"`
  6622. // ServerResponse contains the HTTP response code and headers from the
  6623. // server.
  6624. googleapi.ServerResponse `json:"-"`
  6625. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6626. // unconditionally include in API requests. By default, fields with
  6627. // empty values are omitted from API requests. However, any non-pointer,
  6628. // non-interface field appearing in ForceSendFields will be sent to the
  6629. // server regardless of whether the field is empty or not. This may be
  6630. // used to include empty fields in Patch requests.
  6631. ForceSendFields []string `json:"-"`
  6632. // NullFields is a list of field names (e.g. "AccountId") to include in
  6633. // API requests with the JSON null value. By default, fields with empty
  6634. // values are omitted from API requests. However, any field with an
  6635. // empty value appearing in NullFields will be sent to the server as
  6636. // null. It is an error if a field in this list has a non-empty value.
  6637. // This may be used to include null fields in Patch requests.
  6638. NullFields []string `json:"-"`
  6639. }
  6640. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6641. type NoMethod FloodlightActivityGroup
  6642. raw := NoMethod(*s)
  6643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6644. }
  6645. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6646. // Response
  6647. type FloodlightActivityGroupsListResponse struct {
  6648. // FloodlightActivityGroups: Floodlight activity group collection.
  6649. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6650. // Kind: Identifies what kind of resource this is. Value: the fixed
  6651. // string "dfareporting#floodlightActivityGroupsListResponse".
  6652. Kind string `json:"kind,omitempty"`
  6653. // NextPageToken: Pagination token to be used for the next list
  6654. // operation.
  6655. NextPageToken string `json:"nextPageToken,omitempty"`
  6656. // ServerResponse contains the HTTP response code and headers from the
  6657. // server.
  6658. googleapi.ServerResponse `json:"-"`
  6659. // ForceSendFields is a list of field names (e.g.
  6660. // "FloodlightActivityGroups") to unconditionally include in API
  6661. // requests. By default, fields with empty values are omitted from API
  6662. // requests. However, any non-pointer, non-interface field appearing in
  6663. // ForceSendFields will be sent to the server regardless of whether the
  6664. // field is empty or not. This may be used to include empty fields in
  6665. // Patch requests.
  6666. ForceSendFields []string `json:"-"`
  6667. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6668. // to include in API requests with the JSON null value. By default,
  6669. // fields with empty values are omitted from API requests. However, any
  6670. // field with an empty value appearing in NullFields will be sent to the
  6671. // server as null. It is an error if a field in this list has a
  6672. // non-empty value. This may be used to include null fields in Patch
  6673. // requests.
  6674. NullFields []string `json:"-"`
  6675. }
  6676. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6677. type NoMethod FloodlightActivityGroupsListResponse
  6678. raw := NoMethod(*s)
  6679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6680. }
  6681. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6682. type FloodlightActivityPublisherDynamicTag struct {
  6683. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6684. ClickThrough bool `json:"clickThrough,omitempty"`
  6685. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6686. // write-only field that can be used as an alternative to the siteId
  6687. // field. When this resource is retrieved, only the siteId field will be
  6688. // populated.
  6689. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6690. // DynamicTag: Dynamic floodlight tag.
  6691. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6692. // SiteId: Site ID of this dynamic tag.
  6693. SiteId int64 `json:"siteId,omitempty,string"`
  6694. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6695. // a read-only, auto-generated field.
  6696. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6697. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6698. ViewThrough bool `json:"viewThrough,omitempty"`
  6699. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6700. // unconditionally include in API requests. By default, fields with
  6701. // empty values are omitted from API requests. However, any non-pointer,
  6702. // non-interface field appearing in ForceSendFields will be sent to the
  6703. // server regardless of whether the field is empty or not. This may be
  6704. // used to include empty fields in Patch requests.
  6705. ForceSendFields []string `json:"-"`
  6706. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6707. // in API requests with the JSON null value. By default, fields with
  6708. // empty values are omitted from API requests. However, any field with
  6709. // an empty value appearing in NullFields will be sent to the server as
  6710. // null. It is an error if a field in this list has a non-empty value.
  6711. // This may be used to include null fields in Patch requests.
  6712. NullFields []string `json:"-"`
  6713. }
  6714. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6715. type NoMethod FloodlightActivityPublisherDynamicTag
  6716. raw := NoMethod(*s)
  6717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6718. }
  6719. // FloodlightConfiguration: Contains properties of a Floodlight
  6720. // configuration.
  6721. type FloodlightConfiguration struct {
  6722. // AccountId: Account ID of this floodlight configuration. This is a
  6723. // read-only field that can be left blank.
  6724. AccountId int64 `json:"accountId,omitempty,string"`
  6725. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6726. // floodlight configuration.
  6727. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6728. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6729. // advertiser. This is a read-only, auto-generated field.
  6730. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6731. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6732. // Google Analytics.
  6733. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6734. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6735. // report is enabled. This report shows detailed pathway information on
  6736. // up to 10 of the most recent ad exposures seen by a user before
  6737. // converting.
  6738. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6739. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6740. // in reports. This is a required field.
  6741. //
  6742. // Possible values:
  6743. // "MONDAY"
  6744. // "SUNDAY"
  6745. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6746. // Id: ID of this floodlight configuration. This is a read-only,
  6747. // auto-generated field.
  6748. Id int64 `json:"id,omitempty,string"`
  6749. // IdDimensionValue: Dimension value for the ID of this floodlight
  6750. // configuration. This is a read-only, auto-generated field.
  6751. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6752. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6753. // is enabled.
  6754. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6755. // Kind: Identifies what kind of resource this is. Value: the fixed
  6756. // string "dfareporting#floodlightConfiguration".
  6757. Kind string `json:"kind,omitempty"`
  6758. // LookbackConfiguration: Lookback window settings for this floodlight
  6759. // configuration.
  6760. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6761. // NaturalSearchConversionAttributionOption: Types of attribution
  6762. // options for natural search conversions.
  6763. //
  6764. // Possible values:
  6765. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6766. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6767. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6768. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6769. // OmnitureSettings: Settings for Campaign Manager Omniture integration.
  6770. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6771. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6772. // a read-only field that can be left blank.
  6773. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6774. // TagSettings: Configuration settings for dynamic and image floodlight
  6775. // tags.
  6776. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6777. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6778. // tokens enabled for this configuration.
  6779. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6780. // UserDefinedVariableConfigurations: List of user defined variables
  6781. // enabled for this configuration.
  6782. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6783. // ServerResponse contains the HTTP response code and headers from the
  6784. // server.
  6785. googleapi.ServerResponse `json:"-"`
  6786. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6787. // unconditionally include in API requests. By default, fields with
  6788. // empty values are omitted from API requests. However, any non-pointer,
  6789. // non-interface field appearing in ForceSendFields will be sent to the
  6790. // server regardless of whether the field is empty or not. This may be
  6791. // used to include empty fields in Patch requests.
  6792. ForceSendFields []string `json:"-"`
  6793. // NullFields is a list of field names (e.g. "AccountId") to include in
  6794. // API requests with the JSON null value. By default, fields with empty
  6795. // values are omitted from API requests. However, any field with an
  6796. // empty value appearing in NullFields will be sent to the server as
  6797. // null. It is an error if a field in this list has a non-empty value.
  6798. // This may be used to include null fields in Patch requests.
  6799. NullFields []string `json:"-"`
  6800. }
  6801. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6802. type NoMethod FloodlightConfiguration
  6803. raw := NoMethod(*s)
  6804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6805. }
  6806. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6807. // Response
  6808. type FloodlightConfigurationsListResponse struct {
  6809. // FloodlightConfigurations: Floodlight configuration collection.
  6810. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6811. // Kind: Identifies what kind of resource this is. Value: the fixed
  6812. // string "dfareporting#floodlightConfigurationsListResponse".
  6813. Kind string `json:"kind,omitempty"`
  6814. // ServerResponse contains the HTTP response code and headers from the
  6815. // server.
  6816. googleapi.ServerResponse `json:"-"`
  6817. // ForceSendFields is a list of field names (e.g.
  6818. // "FloodlightConfigurations") to unconditionally include in API
  6819. // requests. By default, fields with empty values are omitted from API
  6820. // requests. However, any non-pointer, non-interface field appearing in
  6821. // ForceSendFields will be sent to the server regardless of whether the
  6822. // field is empty or not. This may be used to include empty fields in
  6823. // Patch requests.
  6824. ForceSendFields []string `json:"-"`
  6825. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6826. // to include in API requests with the JSON null value. By default,
  6827. // fields with empty values are omitted from API requests. However, any
  6828. // field with an empty value appearing in NullFields will be sent to the
  6829. // server as null. It is an error if a field in this list has a
  6830. // non-empty value. This may be used to include null fields in Patch
  6831. // requests.
  6832. NullFields []string `json:"-"`
  6833. }
  6834. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6835. type NoMethod FloodlightConfigurationsListResponse
  6836. raw := NoMethod(*s)
  6837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6838. }
  6839. // FloodlightReportCompatibleFields: Represents fields that are
  6840. // compatible to be selected for a report of type "FlOODLIGHT".
  6841. type FloodlightReportCompatibleFields struct {
  6842. // DimensionFilters: Dimensions which are compatible to be selected in
  6843. // the "dimensionFilters" section of the report.
  6844. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6845. // Dimensions: Dimensions which are compatible to be selected in the
  6846. // "dimensions" section of the report.
  6847. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6848. // Kind: The kind of resource this is, in this case
  6849. // dfareporting#floodlightReportCompatibleFields.
  6850. Kind string `json:"kind,omitempty"`
  6851. // Metrics: Metrics which are compatible to be selected in the
  6852. // "metricNames" section of the report.
  6853. Metrics []*Metric `json:"metrics,omitempty"`
  6854. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6855. // unconditionally include in API requests. By default, fields with
  6856. // empty values are omitted from API requests. However, any non-pointer,
  6857. // non-interface field appearing in ForceSendFields will be sent to the
  6858. // server regardless of whether the field is empty or not. This may be
  6859. // used to include empty fields in Patch requests.
  6860. ForceSendFields []string `json:"-"`
  6861. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6862. // include in API requests with the JSON null value. By default, fields
  6863. // with empty values are omitted from API requests. However, any field
  6864. // with an empty value appearing in NullFields will be sent to the
  6865. // server as null. It is an error if a field in this list has a
  6866. // non-empty value. This may be used to include null fields in Patch
  6867. // requests.
  6868. NullFields []string `json:"-"`
  6869. }
  6870. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6871. type NoMethod FloodlightReportCompatibleFields
  6872. raw := NoMethod(*s)
  6873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6874. }
  6875. // FrequencyCap: Frequency Cap.
  6876. type FrequencyCap struct {
  6877. // Duration: Duration of time, in seconds, for this frequency cap. The
  6878. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6879. // inclusive.
  6880. Duration int64 `json:"duration,omitempty,string"`
  6881. // Impressions: Number of times an individual user can be served the ad
  6882. // within the specified duration. Acceptable values are 1 to 15,
  6883. // inclusive.
  6884. Impressions int64 `json:"impressions,omitempty,string"`
  6885. // ForceSendFields is a list of field names (e.g. "Duration") to
  6886. // unconditionally include in API requests. By default, fields with
  6887. // empty values are omitted from API requests. However, any non-pointer,
  6888. // non-interface field appearing in ForceSendFields will be sent to the
  6889. // server regardless of whether the field is empty or not. This may be
  6890. // used to include empty fields in Patch requests.
  6891. ForceSendFields []string `json:"-"`
  6892. // NullFields is a list of field names (e.g. "Duration") to include in
  6893. // API requests with the JSON null value. By default, fields with empty
  6894. // values are omitted from API requests. However, any field with an
  6895. // empty value appearing in NullFields will be sent to the server as
  6896. // null. It is an error if a field in this list has a non-empty value.
  6897. // This may be used to include null fields in Patch requests.
  6898. NullFields []string `json:"-"`
  6899. }
  6900. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6901. type NoMethod FrequencyCap
  6902. raw := NoMethod(*s)
  6903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6904. }
  6905. // FsCommand: FsCommand.
  6906. type FsCommand struct {
  6907. // Left: Distance from the left of the browser.Applicable when
  6908. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6909. Left int64 `json:"left,omitempty"`
  6910. // PositionOption: Position in the browser where the window will open.
  6911. //
  6912. // Possible values:
  6913. // "CENTERED"
  6914. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6915. PositionOption string `json:"positionOption,omitempty"`
  6916. // Top: Distance from the top of the browser. Applicable when
  6917. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6918. Top int64 `json:"top,omitempty"`
  6919. // WindowHeight: Height of the window.
  6920. WindowHeight int64 `json:"windowHeight,omitempty"`
  6921. // WindowWidth: Width of the window.
  6922. WindowWidth int64 `json:"windowWidth,omitempty"`
  6923. // ForceSendFields is a list of field names (e.g. "Left") to
  6924. // unconditionally include in API requests. By default, fields with
  6925. // empty values are omitted from API requests. However, any non-pointer,
  6926. // non-interface field appearing in ForceSendFields will be sent to the
  6927. // server regardless of whether the field is empty or not. This may be
  6928. // used to include empty fields in Patch requests.
  6929. ForceSendFields []string `json:"-"`
  6930. // NullFields is a list of field names (e.g. "Left") to include in API
  6931. // requests with the JSON null value. By default, fields with empty
  6932. // values are omitted from API requests. However, any field with an
  6933. // empty value appearing in NullFields will be sent to the server as
  6934. // null. It is an error if a field in this list has a non-empty value.
  6935. // This may be used to include null fields in Patch requests.
  6936. NullFields []string `json:"-"`
  6937. }
  6938. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6939. type NoMethod FsCommand
  6940. raw := NoMethod(*s)
  6941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6942. }
  6943. // GeoTargeting: Geographical Targeting.
  6944. type GeoTargeting struct {
  6945. // Cities: Cities to be targeted. For each city only dartId is required.
  6946. // The other fields are populated automatically when the ad is inserted
  6947. // or updated. If targeting a city, do not target or exclude the country
  6948. // of the city, and do not target the metro or region of the city.
  6949. Cities []*City `json:"cities,omitempty"`
  6950. // Countries: Countries to be targeted or excluded from targeting,
  6951. // depending on the setting of the excludeCountries field. For each
  6952. // country only dartId is required. The other fields are populated
  6953. // automatically when the ad is inserted or updated. If targeting or
  6954. // excluding a country, do not target regions, cities, metros, or postal
  6955. // codes in the same country.
  6956. Countries []*Country `json:"countries,omitempty"`
  6957. // ExcludeCountries: Whether or not to exclude the countries in the
  6958. // countries field from targeting. If false, the countries field refers
  6959. // to countries which will be targeted by the ad.
  6960. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6961. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6962. // The other fields are populated automatically when the ad is inserted
  6963. // or updated. If targeting a metro, do not target or exclude the
  6964. // country of the metro.
  6965. Metros []*Metro `json:"metros,omitempty"`
  6966. // PostalCodes: Postal codes to be targeted. For each postal code only
  6967. // id is required. The other fields are populated automatically when the
  6968. // ad is inserted or updated. If targeting a postal code, do not target
  6969. // or exclude the country of the postal code.
  6970. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6971. // Regions: Regions to be targeted. For each region only dartId is
  6972. // required. The other fields are populated automatically when the ad is
  6973. // inserted or updated. If targeting a region, do not target or exclude
  6974. // the country of the region.
  6975. Regions []*Region `json:"regions,omitempty"`
  6976. // ForceSendFields is a list of field names (e.g. "Cities") to
  6977. // unconditionally include in API requests. By default, fields with
  6978. // empty values are omitted from API requests. However, any non-pointer,
  6979. // non-interface field appearing in ForceSendFields will be sent to the
  6980. // server regardless of whether the field is empty or not. This may be
  6981. // used to include empty fields in Patch requests.
  6982. ForceSendFields []string `json:"-"`
  6983. // NullFields is a list of field names (e.g. "Cities") to include in API
  6984. // requests with the JSON null value. By default, fields with empty
  6985. // values are omitted from API requests. However, any field with an
  6986. // empty value appearing in NullFields will be sent to the server as
  6987. // null. It is an error if a field in this list has a non-empty value.
  6988. // This may be used to include null fields in Patch requests.
  6989. NullFields []string `json:"-"`
  6990. }
  6991. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6992. type NoMethod GeoTargeting
  6993. raw := NoMethod(*s)
  6994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6995. }
  6996. // InventoryItem: Represents a buy from the Planning inventory store.
  6997. type InventoryItem struct {
  6998. // AccountId: Account ID of this inventory item.
  6999. AccountId int64 `json:"accountId,omitempty,string"`
  7000. // AdSlots: Ad slots of this inventory item. If this inventory item
  7001. // represents a standalone placement, there will be exactly one ad slot.
  7002. // If this inventory item represents a placement group, there will be
  7003. // more than one ad slot, each representing one child placement in that
  7004. // placement group.
  7005. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  7006. // AdvertiserId: Advertiser ID of this inventory item.
  7007. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7008. // ContentCategoryId: Content category ID of this inventory item.
  7009. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  7010. // EstimatedClickThroughRate: Estimated click-through rate of this
  7011. // inventory item.
  7012. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  7013. // EstimatedConversionRate: Estimated conversion rate of this inventory
  7014. // item.
  7015. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  7016. // Id: ID of this inventory item.
  7017. Id int64 `json:"id,omitempty,string"`
  7018. // InPlan: Whether this inventory item is in plan.
  7019. InPlan bool `json:"inPlan,omitempty"`
  7020. // Kind: Identifies what kind of resource this is. Value: the fixed
  7021. // string "dfareporting#inventoryItem".
  7022. Kind string `json:"kind,omitempty"`
  7023. // LastModifiedInfo: Information about the most recent modification of
  7024. // this inventory item.
  7025. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7026. // Name: Name of this inventory item. For standalone inventory items,
  7027. // this is the same name as that of its only ad slot. For group
  7028. // inventory items, this can differ from the name of any of its ad
  7029. // slots.
  7030. Name string `json:"name,omitempty"`
  7031. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  7032. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  7033. // OrderId: Order ID of this inventory item.
  7034. OrderId int64 `json:"orderId,omitempty,string"`
  7035. // PlacementStrategyId: Placement strategy ID of this inventory item.
  7036. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  7037. // Pricing: Pricing of this inventory item.
  7038. Pricing *Pricing `json:"pricing,omitempty"`
  7039. // ProjectId: Project ID of this inventory item.
  7040. ProjectId int64 `json:"projectId,omitempty,string"`
  7041. // RfpId: RFP ID of this inventory item.
  7042. RfpId int64 `json:"rfpId,omitempty,string"`
  7043. // SiteId: ID of the site this inventory item is associated with.
  7044. SiteId int64 `json:"siteId,omitempty,string"`
  7045. // SubaccountId: Subaccount ID of this inventory item.
  7046. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7047. // Type: Type of inventory item.
  7048. //
  7049. // Possible values:
  7050. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  7051. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  7052. Type string `json:"type,omitempty"`
  7053. // ServerResponse contains the HTTP response code and headers from the
  7054. // server.
  7055. googleapi.ServerResponse `json:"-"`
  7056. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7057. // unconditionally include in API requests. By default, fields with
  7058. // empty values are omitted from API requests. However, any non-pointer,
  7059. // non-interface field appearing in ForceSendFields will be sent to the
  7060. // server regardless of whether the field is empty or not. This may be
  7061. // used to include empty fields in Patch requests.
  7062. ForceSendFields []string `json:"-"`
  7063. // NullFields is a list of field names (e.g. "AccountId") to include in
  7064. // API requests with the JSON null value. By default, fields with empty
  7065. // values are omitted from API requests. However, any field with an
  7066. // empty value appearing in NullFields will be sent to the server as
  7067. // null. It is an error if a field in this list has a non-empty value.
  7068. // This may be used to include null fields in Patch requests.
  7069. NullFields []string `json:"-"`
  7070. }
  7071. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  7072. type NoMethod InventoryItem
  7073. raw := NoMethod(*s)
  7074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7075. }
  7076. // InventoryItemsListResponse: Inventory item List Response
  7077. type InventoryItemsListResponse struct {
  7078. // InventoryItems: Inventory item collection
  7079. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  7080. // Kind: Identifies what kind of resource this is. Value: the fixed
  7081. // string "dfareporting#inventoryItemsListResponse".
  7082. Kind string `json:"kind,omitempty"`
  7083. // NextPageToken: Pagination token to be used for the next list
  7084. // operation.
  7085. NextPageToken string `json:"nextPageToken,omitempty"`
  7086. // ServerResponse contains the HTTP response code and headers from the
  7087. // server.
  7088. googleapi.ServerResponse `json:"-"`
  7089. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  7090. // unconditionally include in API requests. By default, fields with
  7091. // empty values are omitted from API requests. However, any non-pointer,
  7092. // non-interface field appearing in ForceSendFields will be sent to the
  7093. // server regardless of whether the field is empty or not. This may be
  7094. // used to include empty fields in Patch requests.
  7095. ForceSendFields []string `json:"-"`
  7096. // NullFields is a list of field names (e.g. "InventoryItems") to
  7097. // include in API requests with the JSON null value. By default, fields
  7098. // with empty values are omitted from API requests. However, any field
  7099. // with an empty value appearing in NullFields will be sent to the
  7100. // server as null. It is an error if a field in this list has a
  7101. // non-empty value. This may be used to include null fields in Patch
  7102. // requests.
  7103. NullFields []string `json:"-"`
  7104. }
  7105. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  7106. type NoMethod InventoryItemsListResponse
  7107. raw := NoMethod(*s)
  7108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7109. }
  7110. // KeyValueTargetingExpression: Key Value Targeting Expression.
  7111. type KeyValueTargetingExpression struct {
  7112. // Expression: Keyword expression being targeted by the ad.
  7113. Expression string `json:"expression,omitempty"`
  7114. // ForceSendFields is a list of field names (e.g. "Expression") to
  7115. // unconditionally include in API requests. By default, fields with
  7116. // empty values are omitted from API requests. However, any non-pointer,
  7117. // non-interface field appearing in ForceSendFields will be sent to the
  7118. // server regardless of whether the field is empty or not. This may be
  7119. // used to include empty fields in Patch requests.
  7120. ForceSendFields []string `json:"-"`
  7121. // NullFields is a list of field names (e.g. "Expression") to include in
  7122. // API requests with the JSON null value. By default, fields with empty
  7123. // values are omitted from API requests. However, any field with an
  7124. // empty value appearing in NullFields will be sent to the server as
  7125. // null. It is an error if a field in this list has a non-empty value.
  7126. // This may be used to include null fields in Patch requests.
  7127. NullFields []string `json:"-"`
  7128. }
  7129. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  7130. type NoMethod KeyValueTargetingExpression
  7131. raw := NoMethod(*s)
  7132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7133. }
  7134. // LandingPage: Contains information about where a user's browser is
  7135. // taken after the user clicks an ad.
  7136. type LandingPage struct {
  7137. // AdvertiserId: Advertiser ID of this landing page. This is a required
  7138. // field.
  7139. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7140. // Archived: Whether this landing page has been archived.
  7141. Archived bool `json:"archived,omitempty"`
  7142. // DeepLinks: Links that will direct the user to a mobile app, if
  7143. // installed.
  7144. DeepLinks []*DeepLink `json:"deepLinks,omitempty"`
  7145. // Id: ID of this landing page. This is a read-only, auto-generated
  7146. // field.
  7147. Id int64 `json:"id,omitempty,string"`
  7148. // Kind: Identifies what kind of resource this is. Value: the fixed
  7149. // string "dfareporting#landingPage".
  7150. Kind string `json:"kind,omitempty"`
  7151. // Name: Name of this landing page. This is a required field. It must be
  7152. // less than 256 characters long.
  7153. Name string `json:"name,omitempty"`
  7154. // Url: URL of this landing page. This is a required field.
  7155. Url string `json:"url,omitempty"`
  7156. // ServerResponse contains the HTTP response code and headers from the
  7157. // server.
  7158. googleapi.ServerResponse `json:"-"`
  7159. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  7160. // unconditionally include in API requests. By default, fields with
  7161. // empty values are omitted from API requests. However, any non-pointer,
  7162. // non-interface field appearing in ForceSendFields will be sent to the
  7163. // server regardless of whether the field is empty or not. This may be
  7164. // used to include empty fields in Patch requests.
  7165. ForceSendFields []string `json:"-"`
  7166. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  7167. // in API requests with the JSON null value. By default, fields with
  7168. // empty values are omitted from API requests. However, any field with
  7169. // an empty value appearing in NullFields will be sent to the server as
  7170. // null. It is an error if a field in this list has a non-empty value.
  7171. // This may be used to include null fields in Patch requests.
  7172. NullFields []string `json:"-"`
  7173. }
  7174. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  7175. type NoMethod LandingPage
  7176. raw := NoMethod(*s)
  7177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7178. }
  7179. // Language: Contains information about a language that can be targeted
  7180. // by ads.
  7181. type Language struct {
  7182. // Id: Language ID of this language. This is the ID used for targeting
  7183. // and generating reports.
  7184. Id int64 `json:"id,omitempty,string"`
  7185. // Kind: Identifies what kind of resource this is. Value: the fixed
  7186. // string "dfareporting#language".
  7187. Kind string `json:"kind,omitempty"`
  7188. // LanguageCode: Format of language code is an ISO 639 two-letter
  7189. // language code optionally followed by an underscore followed by an ISO
  7190. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  7191. // Chinese.
  7192. LanguageCode string `json:"languageCode,omitempty"`
  7193. // Name: Name of this language.
  7194. Name string `json:"name,omitempty"`
  7195. // ForceSendFields is a list of field names (e.g. "Id") to
  7196. // unconditionally include in API requests. By default, fields with
  7197. // empty values are omitted from API requests. However, any non-pointer,
  7198. // non-interface field appearing in ForceSendFields will be sent to the
  7199. // server regardless of whether the field is empty or not. This may be
  7200. // used to include empty fields in Patch requests.
  7201. ForceSendFields []string `json:"-"`
  7202. // NullFields is a list of field names (e.g. "Id") to include in API
  7203. // requests with the JSON null value. By default, fields with empty
  7204. // values are omitted from API requests. However, any field with an
  7205. // empty value appearing in NullFields will be sent to the server as
  7206. // null. It is an error if a field in this list has a non-empty value.
  7207. // This may be used to include null fields in Patch requests.
  7208. NullFields []string `json:"-"`
  7209. }
  7210. func (s *Language) MarshalJSON() ([]byte, error) {
  7211. type NoMethod Language
  7212. raw := NoMethod(*s)
  7213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7214. }
  7215. // LanguageTargeting: Language Targeting.
  7216. type LanguageTargeting struct {
  7217. // Languages: Languages that this ad targets. For each language only
  7218. // languageId is required. The other fields are populated automatically
  7219. // when the ad is inserted or updated.
  7220. Languages []*Language `json:"languages,omitempty"`
  7221. // ForceSendFields is a list of field names (e.g. "Languages") to
  7222. // unconditionally include in API requests. By default, fields with
  7223. // empty values are omitted from API requests. However, any non-pointer,
  7224. // non-interface field appearing in ForceSendFields will be sent to the
  7225. // server regardless of whether the field is empty or not. This may be
  7226. // used to include empty fields in Patch requests.
  7227. ForceSendFields []string `json:"-"`
  7228. // NullFields is a list of field names (e.g. "Languages") to include in
  7229. // API requests with the JSON null value. By default, fields with empty
  7230. // values are omitted from API requests. However, any field with an
  7231. // empty value appearing in NullFields will be sent to the server as
  7232. // null. It is an error if a field in this list has a non-empty value.
  7233. // This may be used to include null fields in Patch requests.
  7234. NullFields []string `json:"-"`
  7235. }
  7236. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  7237. type NoMethod LanguageTargeting
  7238. raw := NoMethod(*s)
  7239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7240. }
  7241. // LanguagesListResponse: Language List Response
  7242. type LanguagesListResponse struct {
  7243. // Kind: Identifies what kind of resource this is. Value: the fixed
  7244. // string "dfareporting#languagesListResponse".
  7245. Kind string `json:"kind,omitempty"`
  7246. // Languages: Language collection.
  7247. Languages []*Language `json:"languages,omitempty"`
  7248. // ServerResponse contains the HTTP response code and headers from the
  7249. // server.
  7250. googleapi.ServerResponse `json:"-"`
  7251. // ForceSendFields is a list of field names (e.g. "Kind") to
  7252. // unconditionally include in API requests. By default, fields with
  7253. // empty values are omitted from API requests. However, any non-pointer,
  7254. // non-interface field appearing in ForceSendFields will be sent to the
  7255. // server regardless of whether the field is empty or not. This may be
  7256. // used to include empty fields in Patch requests.
  7257. ForceSendFields []string `json:"-"`
  7258. // NullFields is a list of field names (e.g. "Kind") to include in API
  7259. // requests with the JSON null value. By default, fields with empty
  7260. // values are omitted from API requests. However, any field with an
  7261. // empty value appearing in NullFields will be sent to the server as
  7262. // null. It is an error if a field in this list has a non-empty value.
  7263. // This may be used to include null fields in Patch requests.
  7264. NullFields []string `json:"-"`
  7265. }
  7266. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  7267. type NoMethod LanguagesListResponse
  7268. raw := NoMethod(*s)
  7269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7270. }
  7271. // LastModifiedInfo: Modification timestamp.
  7272. type LastModifiedInfo struct {
  7273. // Time: Timestamp of the last change in milliseconds since epoch.
  7274. Time int64 `json:"time,omitempty,string"`
  7275. // ForceSendFields is a list of field names (e.g. "Time") to
  7276. // unconditionally include in API requests. By default, fields with
  7277. // empty values are omitted from API requests. However, any non-pointer,
  7278. // non-interface field appearing in ForceSendFields will be sent to the
  7279. // server regardless of whether the field is empty or not. This may be
  7280. // used to include empty fields in Patch requests.
  7281. ForceSendFields []string `json:"-"`
  7282. // NullFields is a list of field names (e.g. "Time") to include in API
  7283. // requests with the JSON null value. By default, fields with empty
  7284. // values are omitted from API requests. However, any field with an
  7285. // empty value appearing in NullFields will be sent to the server as
  7286. // null. It is an error if a field in this list has a non-empty value.
  7287. // This may be used to include null fields in Patch requests.
  7288. NullFields []string `json:"-"`
  7289. }
  7290. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  7291. type NoMethod LastModifiedInfo
  7292. raw := NoMethod(*s)
  7293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7294. }
  7295. // ListPopulationClause: A group clause made up of list population terms
  7296. // representing constraints joined by ORs.
  7297. type ListPopulationClause struct {
  7298. // Terms: Terms of this list population clause. Each clause is made up
  7299. // of list population terms representing constraints and are joined by
  7300. // ORs.
  7301. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  7302. // ForceSendFields is a list of field names (e.g. "Terms") to
  7303. // unconditionally include in API requests. By default, fields with
  7304. // empty values are omitted from API requests. However, any non-pointer,
  7305. // non-interface field appearing in ForceSendFields will be sent to the
  7306. // server regardless of whether the field is empty or not. This may be
  7307. // used to include empty fields in Patch requests.
  7308. ForceSendFields []string `json:"-"`
  7309. // NullFields is a list of field names (e.g. "Terms") to include in API
  7310. // requests with the JSON null value. By default, fields with empty
  7311. // values are omitted from API requests. However, any field with an
  7312. // empty value appearing in NullFields will be sent to the server as
  7313. // null. It is an error if a field in this list has a non-empty value.
  7314. // This may be used to include null fields in Patch requests.
  7315. NullFields []string `json:"-"`
  7316. }
  7317. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7318. type NoMethod ListPopulationClause
  7319. raw := NoMethod(*s)
  7320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7321. }
  7322. // ListPopulationRule: Remarketing List Population Rule.
  7323. type ListPopulationRule struct {
  7324. // FloodlightActivityId: Floodlight activity ID associated with this
  7325. // rule. This field can be left blank.
  7326. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7327. // FloodlightActivityName: Name of floodlight activity associated with
  7328. // this rule. This is a read-only, auto-generated field.
  7329. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7330. // ListPopulationClauses: Clauses that make up this list population
  7331. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7332. // up of list population terms which are joined by ORs.
  7333. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7334. // ForceSendFields is a list of field names (e.g.
  7335. // "FloodlightActivityId") to unconditionally include in API requests.
  7336. // By default, fields with empty values are omitted from API requests.
  7337. // However, any non-pointer, non-interface field appearing in
  7338. // ForceSendFields will be sent to the server regardless of whether the
  7339. // field is empty or not. This may be used to include empty fields in
  7340. // Patch requests.
  7341. ForceSendFields []string `json:"-"`
  7342. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7343. // include in API requests with the JSON null value. By default, fields
  7344. // with empty values are omitted from API requests. However, any field
  7345. // with an empty value appearing in NullFields will be sent to the
  7346. // server as null. It is an error if a field in this list has a
  7347. // non-empty value. This may be used to include null fields in Patch
  7348. // requests.
  7349. NullFields []string `json:"-"`
  7350. }
  7351. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7352. type NoMethod ListPopulationRule
  7353. raw := NoMethod(*s)
  7354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7355. }
  7356. // ListPopulationTerm: Remarketing List Population Rule Term.
  7357. type ListPopulationTerm struct {
  7358. // Contains: Will be true if the term should check if the user is in the
  7359. // list and false if the term should check if the user is not in the
  7360. // list. This field is only relevant when type is set to
  7361. // LIST_MEMBERSHIP_TERM. False by default.
  7362. Contains bool `json:"contains,omitempty"`
  7363. // Negation: Whether to negate the comparison result of this term during
  7364. // rule evaluation. This field is only relevant when type is left unset
  7365. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7366. Negation bool `json:"negation,omitempty"`
  7367. // Operator: Comparison operator of this term. This field is only
  7368. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7369. // REFERRER_TERM.
  7370. //
  7371. // Possible values:
  7372. // "NUM_EQUALS"
  7373. // "NUM_GREATER_THAN"
  7374. // "NUM_GREATER_THAN_EQUAL"
  7375. // "NUM_LESS_THAN"
  7376. // "NUM_LESS_THAN_EQUAL"
  7377. // "STRING_CONTAINS"
  7378. // "STRING_EQUALS"
  7379. Operator string `json:"operator,omitempty"`
  7380. // RemarketingListId: ID of the list in question. This field is only
  7381. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7382. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7383. // Type: List population term type determines the applicable fields in
  7384. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7385. // variableName, variableFriendlyName, operator, value, and negation are
  7386. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7387. // contains are applicable. If set to REFERRER_TERM then operator,
  7388. // value, and negation are applicable.
  7389. //
  7390. // Possible values:
  7391. // "CUSTOM_VARIABLE_TERM"
  7392. // "LIST_MEMBERSHIP_TERM"
  7393. // "REFERRER_TERM"
  7394. Type string `json:"type,omitempty"`
  7395. // Value: Literal to compare the variable to. This field is only
  7396. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7397. // REFERRER_TERM.
  7398. Value string `json:"value,omitempty"`
  7399. // VariableFriendlyName: Friendly name of this term's variable. This is
  7400. // a read-only, auto-generated field. This field is only relevant when
  7401. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7402. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7403. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7404. // this term. This field is only relevant when type is set to null,
  7405. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7406. VariableName string `json:"variableName,omitempty"`
  7407. // ForceSendFields is a list of field names (e.g. "Contains") to
  7408. // unconditionally include in API requests. By default, fields with
  7409. // empty values are omitted from API requests. However, any non-pointer,
  7410. // non-interface field appearing in ForceSendFields will be sent to the
  7411. // server regardless of whether the field is empty or not. This may be
  7412. // used to include empty fields in Patch requests.
  7413. ForceSendFields []string `json:"-"`
  7414. // NullFields is a list of field names (e.g. "Contains") to include in
  7415. // API requests with the JSON null value. By default, fields with empty
  7416. // values are omitted from API requests. However, any field with an
  7417. // empty value appearing in NullFields will be sent to the server as
  7418. // null. It is an error if a field in this list has a non-empty value.
  7419. // This may be used to include null fields in Patch requests.
  7420. NullFields []string `json:"-"`
  7421. }
  7422. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7423. type NoMethod ListPopulationTerm
  7424. raw := NoMethod(*s)
  7425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7426. }
  7427. // ListTargetingExpression: Remarketing List Targeting Expression.
  7428. type ListTargetingExpression struct {
  7429. // Expression: Expression describing which lists are being targeted by
  7430. // the ad.
  7431. Expression string `json:"expression,omitempty"`
  7432. // ForceSendFields is a list of field names (e.g. "Expression") to
  7433. // unconditionally include in API requests. By default, fields with
  7434. // empty values are omitted from API requests. However, any non-pointer,
  7435. // non-interface field appearing in ForceSendFields will be sent to the
  7436. // server regardless of whether the field is empty or not. This may be
  7437. // used to include empty fields in Patch requests.
  7438. ForceSendFields []string `json:"-"`
  7439. // NullFields is a list of field names (e.g. "Expression") to include in
  7440. // API requests with the JSON null value. By default, fields with empty
  7441. // values are omitted from API requests. However, any field with an
  7442. // empty value appearing in NullFields will be sent to the server as
  7443. // null. It is an error if a field in this list has a non-empty value.
  7444. // This may be used to include null fields in Patch requests.
  7445. NullFields []string `json:"-"`
  7446. }
  7447. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7448. type NoMethod ListTargetingExpression
  7449. raw := NoMethod(*s)
  7450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7451. }
  7452. // LookbackConfiguration: Lookback configuration settings.
  7453. type LookbackConfiguration struct {
  7454. // ClickDuration: Lookback window, in days, from the last time a given
  7455. // user clicked on one of your ads. If you enter 0, clicks will not be
  7456. // considered as triggering events for floodlight tracking. If you leave
  7457. // this field blank, the default value for your account will be used.
  7458. // Acceptable values are 0 to 90, inclusive.
  7459. ClickDuration int64 `json:"clickDuration,omitempty"`
  7460. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7461. // last time a given user viewed one of your ads. If you enter 0,
  7462. // impressions will not be considered as triggering events for
  7463. // floodlight tracking. If you leave this field blank, the default value
  7464. // for your account will be used. Acceptable values are 0 to 90,
  7465. // inclusive.
  7466. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7467. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7468. // unconditionally include in API requests. By default, fields with
  7469. // empty values are omitted from API requests. However, any non-pointer,
  7470. // non-interface field appearing in ForceSendFields will be sent to the
  7471. // server regardless of whether the field is empty or not. This may be
  7472. // used to include empty fields in Patch requests.
  7473. ForceSendFields []string `json:"-"`
  7474. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7475. // in API requests with the JSON null value. By default, fields with
  7476. // empty values are omitted from API requests. However, any field with
  7477. // an empty value appearing in NullFields will be sent to the server as
  7478. // null. It is an error if a field in this list has a non-empty value.
  7479. // This may be used to include null fields in Patch requests.
  7480. NullFields []string `json:"-"`
  7481. }
  7482. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7483. type NoMethod LookbackConfiguration
  7484. raw := NoMethod(*s)
  7485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7486. }
  7487. // Metric: Represents a metric.
  7488. type Metric struct {
  7489. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7490. Kind string `json:"kind,omitempty"`
  7491. // Name: The metric name, e.g. dfa:impressions
  7492. Name string `json:"name,omitempty"`
  7493. // ForceSendFields is a list of field names (e.g. "Kind") to
  7494. // unconditionally include in API requests. By default, fields with
  7495. // empty values are omitted from API requests. However, any non-pointer,
  7496. // non-interface field appearing in ForceSendFields will be sent to the
  7497. // server regardless of whether the field is empty or not. This may be
  7498. // used to include empty fields in Patch requests.
  7499. ForceSendFields []string `json:"-"`
  7500. // NullFields is a list of field names (e.g. "Kind") to include in API
  7501. // requests with the JSON null value. By default, fields with empty
  7502. // values are omitted from API requests. However, any field with an
  7503. // empty value appearing in NullFields will be sent to the server as
  7504. // null. It is an error if a field in this list has a non-empty value.
  7505. // This may be used to include null fields in Patch requests.
  7506. NullFields []string `json:"-"`
  7507. }
  7508. func (s *Metric) MarshalJSON() ([]byte, error) {
  7509. type NoMethod Metric
  7510. raw := NoMethod(*s)
  7511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7512. }
  7513. // Metro: Contains information about a metro region that can be targeted
  7514. // by ads.
  7515. type Metro struct {
  7516. // CountryCode: Country code of the country to which this metro region
  7517. // belongs.
  7518. CountryCode string `json:"countryCode,omitempty"`
  7519. // CountryDartId: DART ID of the country to which this metro region
  7520. // belongs.
  7521. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7522. // DartId: DART ID of this metro region.
  7523. DartId int64 `json:"dartId,omitempty,string"`
  7524. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7525. // and generating reports, and is equivalent to metro_code.
  7526. DmaId int64 `json:"dmaId,omitempty,string"`
  7527. // Kind: Identifies what kind of resource this is. Value: the fixed
  7528. // string "dfareporting#metro".
  7529. Kind string `json:"kind,omitempty"`
  7530. // MetroCode: Metro code of this metro region. This is equivalent to
  7531. // dma_id.
  7532. MetroCode string `json:"metroCode,omitempty"`
  7533. // Name: Name of this metro region.
  7534. Name string `json:"name,omitempty"`
  7535. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7536. // unconditionally include in API requests. By default, fields with
  7537. // empty values are omitted from API requests. However, any non-pointer,
  7538. // non-interface field appearing in ForceSendFields will be sent to the
  7539. // server regardless of whether the field is empty or not. This may be
  7540. // used to include empty fields in Patch requests.
  7541. ForceSendFields []string `json:"-"`
  7542. // NullFields is a list of field names (e.g. "CountryCode") to include
  7543. // in API requests with the JSON null value. By default, fields with
  7544. // empty values are omitted from API requests. However, any field with
  7545. // an empty value appearing in NullFields will be sent to the server as
  7546. // null. It is an error if a field in this list has a non-empty value.
  7547. // This may be used to include null fields in Patch requests.
  7548. NullFields []string `json:"-"`
  7549. }
  7550. func (s *Metro) MarshalJSON() ([]byte, error) {
  7551. type NoMethod Metro
  7552. raw := NoMethod(*s)
  7553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7554. }
  7555. // MetrosListResponse: Metro List Response
  7556. type MetrosListResponse struct {
  7557. // Kind: Identifies what kind of resource this is. Value: the fixed
  7558. // string "dfareporting#metrosListResponse".
  7559. Kind string `json:"kind,omitempty"`
  7560. // Metros: Metro collection.
  7561. Metros []*Metro `json:"metros,omitempty"`
  7562. // ServerResponse contains the HTTP response code and headers from the
  7563. // server.
  7564. googleapi.ServerResponse `json:"-"`
  7565. // ForceSendFields is a list of field names (e.g. "Kind") to
  7566. // unconditionally include in API requests. By default, fields with
  7567. // empty values are omitted from API requests. However, any non-pointer,
  7568. // non-interface field appearing in ForceSendFields will be sent to the
  7569. // server regardless of whether the field is empty or not. This may be
  7570. // used to include empty fields in Patch requests.
  7571. ForceSendFields []string `json:"-"`
  7572. // NullFields is a list of field names (e.g. "Kind") to include in API
  7573. // requests with the JSON null value. By default, fields with empty
  7574. // values are omitted from API requests. However, any field with an
  7575. // empty value appearing in NullFields will be sent to the server as
  7576. // null. It is an error if a field in this list has a non-empty value.
  7577. // This may be used to include null fields in Patch requests.
  7578. NullFields []string `json:"-"`
  7579. }
  7580. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7581. type NoMethod MetrosListResponse
  7582. raw := NoMethod(*s)
  7583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7584. }
  7585. // MobileApp: Contains information about a mobile app. Used as a landing
  7586. // page deep link.
  7587. type MobileApp struct {
  7588. // Directory: Mobile app directory.
  7589. //
  7590. // Possible values:
  7591. // "APPLE_APP_STORE"
  7592. // "GOOGLE_PLAY_STORE"
  7593. // "UNKNOWN"
  7594. Directory string `json:"directory,omitempty"`
  7595. // Id: ID of this mobile app.
  7596. Id string `json:"id,omitempty"`
  7597. // Kind: Identifies what kind of resource this is. Value: the fixed
  7598. // string "dfareporting#mobileApp".
  7599. Kind string `json:"kind,omitempty"`
  7600. // PublisherName: Publisher name.
  7601. PublisherName string `json:"publisherName,omitempty"`
  7602. // Title: Title of this mobile app.
  7603. Title string `json:"title,omitempty"`
  7604. // ServerResponse contains the HTTP response code and headers from the
  7605. // server.
  7606. googleapi.ServerResponse `json:"-"`
  7607. // ForceSendFields is a list of field names (e.g. "Directory") to
  7608. // unconditionally include in API requests. By default, fields with
  7609. // empty values are omitted from API requests. However, any non-pointer,
  7610. // non-interface field appearing in ForceSendFields will be sent to the
  7611. // server regardless of whether the field is empty or not. This may be
  7612. // used to include empty fields in Patch requests.
  7613. ForceSendFields []string `json:"-"`
  7614. // NullFields is a list of field names (e.g. "Directory") to include in
  7615. // API requests with the JSON null value. By default, fields with empty
  7616. // values are omitted from API requests. However, any field with an
  7617. // empty value appearing in NullFields will be sent to the server as
  7618. // null. It is an error if a field in this list has a non-empty value.
  7619. // This may be used to include null fields in Patch requests.
  7620. NullFields []string `json:"-"`
  7621. }
  7622. func (s *MobileApp) MarshalJSON() ([]byte, error) {
  7623. type NoMethod MobileApp
  7624. raw := NoMethod(*s)
  7625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7626. }
  7627. // MobileAppsListResponse: Mobile app List Response
  7628. type MobileAppsListResponse struct {
  7629. // Kind: Identifies what kind of resource this is. Value: the fixed
  7630. // string "dfareporting#mobileAppsListResponse".
  7631. Kind string `json:"kind,omitempty"`
  7632. // MobileApps: Mobile apps collection.
  7633. MobileApps []*MobileApp `json:"mobileApps,omitempty"`
  7634. // NextPageToken: Pagination token to be used for the next list
  7635. // operation.
  7636. NextPageToken string `json:"nextPageToken,omitempty"`
  7637. // ServerResponse contains the HTTP response code and headers from the
  7638. // server.
  7639. googleapi.ServerResponse `json:"-"`
  7640. // ForceSendFields is a list of field names (e.g. "Kind") to
  7641. // unconditionally include in API requests. By default, fields with
  7642. // empty values are omitted from API requests. However, any non-pointer,
  7643. // non-interface field appearing in ForceSendFields will be sent to the
  7644. // server regardless of whether the field is empty or not. This may be
  7645. // used to include empty fields in Patch requests.
  7646. ForceSendFields []string `json:"-"`
  7647. // NullFields is a list of field names (e.g. "Kind") to include in API
  7648. // requests with the JSON null value. By default, fields with empty
  7649. // values are omitted from API requests. However, any field with an
  7650. // empty value appearing in NullFields will be sent to the server as
  7651. // null. It is an error if a field in this list has a non-empty value.
  7652. // This may be used to include null fields in Patch requests.
  7653. NullFields []string `json:"-"`
  7654. }
  7655. func (s *MobileAppsListResponse) MarshalJSON() ([]byte, error) {
  7656. type NoMethod MobileAppsListResponse
  7657. raw := NoMethod(*s)
  7658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7659. }
  7660. // MobileCarrier: Contains information about a mobile carrier that can
  7661. // be targeted by ads.
  7662. type MobileCarrier struct {
  7663. // CountryCode: Country code of the country to which this mobile carrier
  7664. // belongs.
  7665. CountryCode string `json:"countryCode,omitempty"`
  7666. // CountryDartId: DART ID of the country to which this mobile carrier
  7667. // belongs.
  7668. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7669. // Id: ID of this mobile carrier.
  7670. Id int64 `json:"id,omitempty,string"`
  7671. // Kind: Identifies what kind of resource this is. Value: the fixed
  7672. // string "dfareporting#mobileCarrier".
  7673. Kind string `json:"kind,omitempty"`
  7674. // Name: Name of this mobile carrier.
  7675. Name string `json:"name,omitempty"`
  7676. // ServerResponse contains the HTTP response code and headers from the
  7677. // server.
  7678. googleapi.ServerResponse `json:"-"`
  7679. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7680. // unconditionally include in API requests. By default, fields with
  7681. // empty values are omitted from API requests. However, any non-pointer,
  7682. // non-interface field appearing in ForceSendFields will be sent to the
  7683. // server regardless of whether the field is empty or not. This may be
  7684. // used to include empty fields in Patch requests.
  7685. ForceSendFields []string `json:"-"`
  7686. // NullFields is a list of field names (e.g. "CountryCode") to include
  7687. // in API requests with the JSON null value. By default, fields with
  7688. // empty values are omitted from API requests. However, any field with
  7689. // an empty value appearing in NullFields will be sent to the server as
  7690. // null. It is an error if a field in this list has a non-empty value.
  7691. // This may be used to include null fields in Patch requests.
  7692. NullFields []string `json:"-"`
  7693. }
  7694. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7695. type NoMethod MobileCarrier
  7696. raw := NoMethod(*s)
  7697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7698. }
  7699. // MobileCarriersListResponse: Mobile Carrier List Response
  7700. type MobileCarriersListResponse struct {
  7701. // Kind: Identifies what kind of resource this is. Value: the fixed
  7702. // string "dfareporting#mobileCarriersListResponse".
  7703. Kind string `json:"kind,omitempty"`
  7704. // MobileCarriers: Mobile carrier collection.
  7705. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7706. // ServerResponse contains the HTTP response code and headers from the
  7707. // server.
  7708. googleapi.ServerResponse `json:"-"`
  7709. // ForceSendFields is a list of field names (e.g. "Kind") to
  7710. // unconditionally include in API requests. By default, fields with
  7711. // empty values are omitted from API requests. However, any non-pointer,
  7712. // non-interface field appearing in ForceSendFields will be sent to the
  7713. // server regardless of whether the field is empty or not. This may be
  7714. // used to include empty fields in Patch requests.
  7715. ForceSendFields []string `json:"-"`
  7716. // NullFields is a list of field names (e.g. "Kind") to include in API
  7717. // requests with the JSON null value. By default, fields with empty
  7718. // values are omitted from API requests. However, any field with an
  7719. // empty value appearing in NullFields will be sent to the server as
  7720. // null. It is an error if a field in this list has a non-empty value.
  7721. // This may be used to include null fields in Patch requests.
  7722. NullFields []string `json:"-"`
  7723. }
  7724. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7725. type NoMethod MobileCarriersListResponse
  7726. raw := NoMethod(*s)
  7727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7728. }
  7729. // ObjectFilter: Object Filter.
  7730. type ObjectFilter struct {
  7731. // Kind: Identifies what kind of resource this is. Value: the fixed
  7732. // string "dfareporting#objectFilter".
  7733. Kind string `json:"kind,omitempty"`
  7734. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7735. // objects with these object IDs.
  7736. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7737. // Status: Status of the filter. NONE means the user has access to none
  7738. // of the objects. ALL means the user has access to all objects.
  7739. // ASSIGNED means the user has access to the objects with IDs in the
  7740. // objectIds list.
  7741. //
  7742. // Possible values:
  7743. // "ALL"
  7744. // "ASSIGNED"
  7745. // "NONE"
  7746. Status string `json:"status,omitempty"`
  7747. // ForceSendFields is a list of field names (e.g. "Kind") to
  7748. // unconditionally include in API requests. By default, fields with
  7749. // empty values are omitted from API requests. However, any non-pointer,
  7750. // non-interface field appearing in ForceSendFields will be sent to the
  7751. // server regardless of whether the field is empty or not. This may be
  7752. // used to include empty fields in Patch requests.
  7753. ForceSendFields []string `json:"-"`
  7754. // NullFields is a list of field names (e.g. "Kind") to include in API
  7755. // requests with the JSON null value. By default, fields with empty
  7756. // values are omitted from API requests. However, any field with an
  7757. // empty value appearing in NullFields will be sent to the server as
  7758. // null. It is an error if a field in this list has a non-empty value.
  7759. // This may be used to include null fields in Patch requests.
  7760. NullFields []string `json:"-"`
  7761. }
  7762. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7763. type NoMethod ObjectFilter
  7764. raw := NoMethod(*s)
  7765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7766. }
  7767. // OffsetPosition: Offset Position.
  7768. type OffsetPosition struct {
  7769. // Left: Offset distance from left side of an asset or a window.
  7770. Left int64 `json:"left,omitempty"`
  7771. // Top: Offset distance from top side of an asset or a window.
  7772. Top int64 `json:"top,omitempty"`
  7773. // ForceSendFields is a list of field names (e.g. "Left") to
  7774. // unconditionally include in API requests. By default, fields with
  7775. // empty values are omitted from API requests. However, any non-pointer,
  7776. // non-interface field appearing in ForceSendFields will be sent to the
  7777. // server regardless of whether the field is empty or not. This may be
  7778. // used to include empty fields in Patch requests.
  7779. ForceSendFields []string `json:"-"`
  7780. // NullFields is a list of field names (e.g. "Left") to include in API
  7781. // requests with the JSON null value. By default, fields with empty
  7782. // values are omitted from API requests. However, any field with an
  7783. // empty value appearing in NullFields will be sent to the server as
  7784. // null. It is an error if a field in this list has a non-empty value.
  7785. // This may be used to include null fields in Patch requests.
  7786. NullFields []string `json:"-"`
  7787. }
  7788. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7789. type NoMethod OffsetPosition
  7790. raw := NoMethod(*s)
  7791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7792. }
  7793. // OmnitureSettings: Omniture Integration Settings.
  7794. type OmnitureSettings struct {
  7795. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7796. // Omniture. This property can be enabled only if
  7797. // omnitureIntegrationEnabled is true.
  7798. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7799. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7800. // This property can be enabled only when the "Advanced Ad Serving"
  7801. // account setting is enabled.
  7802. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7803. // ForceSendFields is a list of field names (e.g.
  7804. // "OmnitureCostDataEnabled") to unconditionally include in API
  7805. // requests. By default, fields with empty values are omitted from API
  7806. // requests. However, any non-pointer, non-interface field appearing in
  7807. // ForceSendFields will be sent to the server regardless of whether the
  7808. // field is empty or not. This may be used to include empty fields in
  7809. // Patch requests.
  7810. ForceSendFields []string `json:"-"`
  7811. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7812. // to include in API requests with the JSON null value. By default,
  7813. // fields with empty values are omitted from API requests. However, any
  7814. // field with an empty value appearing in NullFields will be sent to the
  7815. // server as null. It is an error if a field in this list has a
  7816. // non-empty value. This may be used to include null fields in Patch
  7817. // requests.
  7818. NullFields []string `json:"-"`
  7819. }
  7820. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7821. type NoMethod OmnitureSettings
  7822. raw := NoMethod(*s)
  7823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7824. }
  7825. // OperatingSystem: Contains information about an operating system that
  7826. // can be targeted by ads.
  7827. type OperatingSystem struct {
  7828. // DartId: DART ID of this operating system. This is the ID used for
  7829. // targeting.
  7830. DartId int64 `json:"dartId,omitempty,string"`
  7831. // Desktop: Whether this operating system is for desktop.
  7832. Desktop bool `json:"desktop,omitempty"`
  7833. // Kind: Identifies what kind of resource this is. Value: the fixed
  7834. // string "dfareporting#operatingSystem".
  7835. Kind string `json:"kind,omitempty"`
  7836. // Mobile: Whether this operating system is for mobile.
  7837. Mobile bool `json:"mobile,omitempty"`
  7838. // Name: Name of this operating system.
  7839. Name string `json:"name,omitempty"`
  7840. // ServerResponse contains the HTTP response code and headers from the
  7841. // server.
  7842. googleapi.ServerResponse `json:"-"`
  7843. // ForceSendFields is a list of field names (e.g. "DartId") to
  7844. // unconditionally include in API requests. By default, fields with
  7845. // empty values are omitted from API requests. However, any non-pointer,
  7846. // non-interface field appearing in ForceSendFields will be sent to the
  7847. // server regardless of whether the field is empty or not. This may be
  7848. // used to include empty fields in Patch requests.
  7849. ForceSendFields []string `json:"-"`
  7850. // NullFields is a list of field names (e.g. "DartId") to include in API
  7851. // requests with the JSON null value. By default, fields with empty
  7852. // values are omitted from API requests. However, any field with an
  7853. // empty value appearing in NullFields will be sent to the server as
  7854. // null. It is an error if a field in this list has a non-empty value.
  7855. // This may be used to include null fields in Patch requests.
  7856. NullFields []string `json:"-"`
  7857. }
  7858. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7859. type NoMethod OperatingSystem
  7860. raw := NoMethod(*s)
  7861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7862. }
  7863. // OperatingSystemVersion: Contains information about a particular
  7864. // version of an operating system that can be targeted by ads.
  7865. type OperatingSystemVersion struct {
  7866. // Id: ID of this operating system version.
  7867. Id int64 `json:"id,omitempty,string"`
  7868. // Kind: Identifies what kind of resource this is. Value: the fixed
  7869. // string "dfareporting#operatingSystemVersion".
  7870. Kind string `json:"kind,omitempty"`
  7871. // MajorVersion: Major version (leftmost number) of this operating
  7872. // system version.
  7873. MajorVersion string `json:"majorVersion,omitempty"`
  7874. // MinorVersion: Minor version (number after the first dot) of this
  7875. // operating system version.
  7876. MinorVersion string `json:"minorVersion,omitempty"`
  7877. // Name: Name of this operating system version.
  7878. Name string `json:"name,omitempty"`
  7879. // OperatingSystem: Operating system of this operating system version.
  7880. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7881. // ServerResponse contains the HTTP response code and headers from the
  7882. // server.
  7883. googleapi.ServerResponse `json:"-"`
  7884. // ForceSendFields is a list of field names (e.g. "Id") to
  7885. // unconditionally include in API requests. By default, fields with
  7886. // empty values are omitted from API requests. However, any non-pointer,
  7887. // non-interface field appearing in ForceSendFields will be sent to the
  7888. // server regardless of whether the field is empty or not. This may be
  7889. // used to include empty fields in Patch requests.
  7890. ForceSendFields []string `json:"-"`
  7891. // NullFields is a list of field names (e.g. "Id") to include in API
  7892. // requests with the JSON null value. By default, fields with empty
  7893. // values are omitted from API requests. However, any field with an
  7894. // empty value appearing in NullFields will be sent to the server as
  7895. // null. It is an error if a field in this list has a non-empty value.
  7896. // This may be used to include null fields in Patch requests.
  7897. NullFields []string `json:"-"`
  7898. }
  7899. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7900. type NoMethod OperatingSystemVersion
  7901. raw := NoMethod(*s)
  7902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7903. }
  7904. // OperatingSystemVersionsListResponse: Operating System Version List
  7905. // Response
  7906. type OperatingSystemVersionsListResponse struct {
  7907. // Kind: Identifies what kind of resource this is. Value: the fixed
  7908. // string "dfareporting#operatingSystemVersionsListResponse".
  7909. Kind string `json:"kind,omitempty"`
  7910. // OperatingSystemVersions: Operating system version collection.
  7911. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7912. // ServerResponse contains the HTTP response code and headers from the
  7913. // server.
  7914. googleapi.ServerResponse `json:"-"`
  7915. // ForceSendFields is a list of field names (e.g. "Kind") to
  7916. // unconditionally include in API requests. By default, fields with
  7917. // empty values are omitted from API requests. However, any non-pointer,
  7918. // non-interface field appearing in ForceSendFields will be sent to the
  7919. // server regardless of whether the field is empty or not. This may be
  7920. // used to include empty fields in Patch requests.
  7921. ForceSendFields []string `json:"-"`
  7922. // NullFields is a list of field names (e.g. "Kind") to include in API
  7923. // requests with the JSON null value. By default, fields with empty
  7924. // values are omitted from API requests. However, any field with an
  7925. // empty value appearing in NullFields will be sent to the server as
  7926. // null. It is an error if a field in this list has a non-empty value.
  7927. // This may be used to include null fields in Patch requests.
  7928. NullFields []string `json:"-"`
  7929. }
  7930. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7931. type NoMethod OperatingSystemVersionsListResponse
  7932. raw := NoMethod(*s)
  7933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7934. }
  7935. // OperatingSystemsListResponse: Operating System List Response
  7936. type OperatingSystemsListResponse struct {
  7937. // Kind: Identifies what kind of resource this is. Value: the fixed
  7938. // string "dfareporting#operatingSystemsListResponse".
  7939. Kind string `json:"kind,omitempty"`
  7940. // OperatingSystems: Operating system collection.
  7941. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7942. // ServerResponse contains the HTTP response code and headers from the
  7943. // server.
  7944. googleapi.ServerResponse `json:"-"`
  7945. // ForceSendFields is a list of field names (e.g. "Kind") to
  7946. // unconditionally include in API requests. By default, fields with
  7947. // empty values are omitted from API requests. However, any non-pointer,
  7948. // non-interface field appearing in ForceSendFields will be sent to the
  7949. // server regardless of whether the field is empty or not. This may be
  7950. // used to include empty fields in Patch requests.
  7951. ForceSendFields []string `json:"-"`
  7952. // NullFields is a list of field names (e.g. "Kind") to include in API
  7953. // requests with the JSON null value. By default, fields with empty
  7954. // values are omitted from API requests. However, any field with an
  7955. // empty value appearing in NullFields will be sent to the server as
  7956. // null. It is an error if a field in this list has a non-empty value.
  7957. // This may be used to include null fields in Patch requests.
  7958. NullFields []string `json:"-"`
  7959. }
  7960. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7961. type NoMethod OperatingSystemsListResponse
  7962. raw := NoMethod(*s)
  7963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7964. }
  7965. // OptimizationActivity: Creative optimization activity.
  7966. type OptimizationActivity struct {
  7967. // FloodlightActivityId: Floodlight activity ID of this optimization
  7968. // activity. This is a required field.
  7969. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7970. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7971. // floodlight activity. This is a read-only, auto-generated field.
  7972. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7973. // Weight: Weight associated with this optimization. The weight assigned
  7974. // will be understood in proportion to the weights assigned to the other
  7975. // optimization activities. Value must be greater than or equal to 1.
  7976. Weight int64 `json:"weight,omitempty"`
  7977. // ForceSendFields is a list of field names (e.g.
  7978. // "FloodlightActivityId") to unconditionally include in API requests.
  7979. // By default, fields with empty values are omitted from API requests.
  7980. // However, any non-pointer, non-interface field appearing in
  7981. // ForceSendFields will be sent to the server regardless of whether the
  7982. // field is empty or not. This may be used to include empty fields in
  7983. // Patch requests.
  7984. ForceSendFields []string `json:"-"`
  7985. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7986. // include in API requests with the JSON null value. By default, fields
  7987. // with empty values are omitted from API requests. However, any field
  7988. // with an empty value appearing in NullFields will be sent to the
  7989. // server as null. It is an error if a field in this list has a
  7990. // non-empty value. This may be used to include null fields in Patch
  7991. // requests.
  7992. NullFields []string `json:"-"`
  7993. }
  7994. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7995. type NoMethod OptimizationActivity
  7996. raw := NoMethod(*s)
  7997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7998. }
  7999. // Order: Describes properties of a Planning order.
  8000. type Order struct {
  8001. // AccountId: Account ID of this order.
  8002. AccountId int64 `json:"accountId,omitempty,string"`
  8003. // AdvertiserId: Advertiser ID of this order.
  8004. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8005. // ApproverUserProfileIds: IDs for users that have to approve documents
  8006. // created for this order.
  8007. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  8008. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  8009. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  8010. // BuyerOrganizationName: Name of the buyer organization.
  8011. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  8012. // Comments: Comments in this order.
  8013. Comments string `json:"comments,omitempty"`
  8014. // Contacts: Contacts for this order.
  8015. Contacts []*OrderContact `json:"contacts,omitempty"`
  8016. // Id: ID of this order. This is a read-only, auto-generated field.
  8017. Id int64 `json:"id,omitempty,string"`
  8018. // Kind: Identifies what kind of resource this is. Value: the fixed
  8019. // string "dfareporting#order".
  8020. Kind string `json:"kind,omitempty"`
  8021. // LastModifiedInfo: Information about the most recent modification of
  8022. // this order.
  8023. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8024. // Name: Name of this order.
  8025. Name string `json:"name,omitempty"`
  8026. // Notes: Notes of this order.
  8027. Notes string `json:"notes,omitempty"`
  8028. // PlanningTermId: ID of the terms and conditions template used in this
  8029. // order.
  8030. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  8031. // ProjectId: Project ID of this order.
  8032. ProjectId int64 `json:"projectId,omitempty,string"`
  8033. // SellerOrderId: Seller order ID associated with this order.
  8034. SellerOrderId string `json:"sellerOrderId,omitempty"`
  8035. // SellerOrganizationName: Name of the seller organization.
  8036. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  8037. // SiteId: Site IDs this order is associated with.
  8038. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  8039. // SiteNames: Free-form site names this order is associated with.
  8040. SiteNames []string `json:"siteNames,omitempty"`
  8041. // SubaccountId: Subaccount ID of this order.
  8042. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8043. // TermsAndConditions: Terms and conditions of this order.
  8044. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  8045. // ServerResponse contains the HTTP response code and headers from the
  8046. // server.
  8047. googleapi.ServerResponse `json:"-"`
  8048. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8049. // unconditionally include in API requests. By default, fields with
  8050. // empty values are omitted from API requests. However, any non-pointer,
  8051. // non-interface field appearing in ForceSendFields will be sent to the
  8052. // server regardless of whether the field is empty or not. This may be
  8053. // used to include empty fields in Patch requests.
  8054. ForceSendFields []string `json:"-"`
  8055. // NullFields is a list of field names (e.g. "AccountId") to include in
  8056. // API requests with the JSON null value. By default, fields with empty
  8057. // values are omitted from API requests. However, any field with an
  8058. // empty value appearing in NullFields will be sent to the server as
  8059. // null. It is an error if a field in this list has a non-empty value.
  8060. // This may be used to include null fields in Patch requests.
  8061. NullFields []string `json:"-"`
  8062. }
  8063. func (s *Order) MarshalJSON() ([]byte, error) {
  8064. type NoMethod Order
  8065. raw := NoMethod(*s)
  8066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8067. }
  8068. // OrderContact: Contact of an order.
  8069. type OrderContact struct {
  8070. // ContactInfo: Free-form information about this contact. It could be
  8071. // any information related to this contact in addition to type, title,
  8072. // name, and signature user profile ID.
  8073. ContactInfo string `json:"contactInfo,omitempty"`
  8074. // ContactName: Name of this contact.
  8075. ContactName string `json:"contactName,omitempty"`
  8076. // ContactTitle: Title of this contact.
  8077. ContactTitle string `json:"contactTitle,omitempty"`
  8078. // ContactType: Type of this contact.
  8079. //
  8080. // Possible values:
  8081. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  8082. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  8083. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  8084. ContactType string `json:"contactType,omitempty"`
  8085. // SignatureUserProfileId: ID of the user profile containing the
  8086. // signature that will be embedded into order documents.
  8087. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  8088. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  8089. // unconditionally include in API requests. By default, fields with
  8090. // empty values are omitted from API requests. However, any non-pointer,
  8091. // non-interface field appearing in ForceSendFields will be sent to the
  8092. // server regardless of whether the field is empty or not. This may be
  8093. // used to include empty fields in Patch requests.
  8094. ForceSendFields []string `json:"-"`
  8095. // NullFields is a list of field names (e.g. "ContactInfo") to include
  8096. // in API requests with the JSON null value. By default, fields with
  8097. // empty values are omitted from API requests. However, any field with
  8098. // an empty value appearing in NullFields will be sent to the server as
  8099. // null. It is an error if a field in this list has a non-empty value.
  8100. // This may be used to include null fields in Patch requests.
  8101. NullFields []string `json:"-"`
  8102. }
  8103. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  8104. type NoMethod OrderContact
  8105. raw := NoMethod(*s)
  8106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8107. }
  8108. // OrderDocument: Contains properties of a Planning order document.
  8109. type OrderDocument struct {
  8110. // AccountId: Account ID of this order document.
  8111. AccountId int64 `json:"accountId,omitempty,string"`
  8112. // AdvertiserId: Advertiser ID of this order document.
  8113. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8114. // AmendedOrderDocumentId: The amended order document ID of this order
  8115. // document. An order document can be created by optionally amending
  8116. // another order document so that the change history can be preserved.
  8117. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  8118. // ApprovedByUserProfileIds: IDs of users who have approved this order
  8119. // document.
  8120. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  8121. // Cancelled: Whether this order document is cancelled.
  8122. Cancelled bool `json:"cancelled,omitempty"`
  8123. // CreatedInfo: Information about the creation of this order document.
  8124. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  8125. // EffectiveDate: Effective date of this order document.
  8126. EffectiveDate string `json:"effectiveDate,omitempty"`
  8127. // Id: ID of this order document.
  8128. Id int64 `json:"id,omitempty,string"`
  8129. // Kind: Identifies what kind of resource this is. Value: the fixed
  8130. // string "dfareporting#orderDocument".
  8131. Kind string `json:"kind,omitempty"`
  8132. // LastSentRecipients: List of email addresses that received the last
  8133. // sent document.
  8134. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  8135. // LastSentTime: Timestamp of the last email sent with this order
  8136. // document.
  8137. LastSentTime string `json:"lastSentTime,omitempty"`
  8138. // OrderId: ID of the order from which this order document is created.
  8139. OrderId int64 `json:"orderId,omitempty,string"`
  8140. // ProjectId: Project ID of this order document.
  8141. ProjectId int64 `json:"projectId,omitempty,string"`
  8142. // Signed: Whether this order document has been signed.
  8143. Signed bool `json:"signed,omitempty"`
  8144. // SubaccountId: Subaccount ID of this order document.
  8145. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8146. // Title: Title of this order document.
  8147. Title string `json:"title,omitempty"`
  8148. // Type: Type of this order document
  8149. //
  8150. // Possible values:
  8151. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  8152. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  8153. Type string `json:"type,omitempty"`
  8154. // ServerResponse contains the HTTP response code and headers from the
  8155. // server.
  8156. googleapi.ServerResponse `json:"-"`
  8157. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8158. // unconditionally include in API requests. By default, fields with
  8159. // empty values are omitted from API requests. However, any non-pointer,
  8160. // non-interface field appearing in ForceSendFields will be sent to the
  8161. // server regardless of whether the field is empty or not. This may be
  8162. // used to include empty fields in Patch requests.
  8163. ForceSendFields []string `json:"-"`
  8164. // NullFields is a list of field names (e.g. "AccountId") to include in
  8165. // API requests with the JSON null value. By default, fields with empty
  8166. // values are omitted from API requests. However, any field with an
  8167. // empty value appearing in NullFields will be sent to the server as
  8168. // null. It is an error if a field in this list has a non-empty value.
  8169. // This may be used to include null fields in Patch requests.
  8170. NullFields []string `json:"-"`
  8171. }
  8172. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  8173. type NoMethod OrderDocument
  8174. raw := NoMethod(*s)
  8175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8176. }
  8177. // OrderDocumentsListResponse: Order document List Response
  8178. type OrderDocumentsListResponse struct {
  8179. // Kind: Identifies what kind of resource this is. Value: the fixed
  8180. // string "dfareporting#orderDocumentsListResponse".
  8181. Kind string `json:"kind,omitempty"`
  8182. // NextPageToken: Pagination token to be used for the next list
  8183. // operation.
  8184. NextPageToken string `json:"nextPageToken,omitempty"`
  8185. // OrderDocuments: Order document collection
  8186. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  8187. // ServerResponse contains the HTTP response code and headers from the
  8188. // server.
  8189. googleapi.ServerResponse `json:"-"`
  8190. // ForceSendFields is a list of field names (e.g. "Kind") to
  8191. // unconditionally include in API requests. By default, fields with
  8192. // empty values are omitted from API requests. However, any non-pointer,
  8193. // non-interface field appearing in ForceSendFields will be sent to the
  8194. // server regardless of whether the field is empty or not. This may be
  8195. // used to include empty fields in Patch requests.
  8196. ForceSendFields []string `json:"-"`
  8197. // NullFields is a list of field names (e.g. "Kind") to include in API
  8198. // requests with the JSON null value. By default, fields with empty
  8199. // values are omitted from API requests. However, any field with an
  8200. // empty value appearing in NullFields will be sent to the server as
  8201. // null. It is an error if a field in this list has a non-empty value.
  8202. // This may be used to include null fields in Patch requests.
  8203. NullFields []string `json:"-"`
  8204. }
  8205. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  8206. type NoMethod OrderDocumentsListResponse
  8207. raw := NoMethod(*s)
  8208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8209. }
  8210. // OrdersListResponse: Order List Response
  8211. type OrdersListResponse struct {
  8212. // Kind: Identifies what kind of resource this is. Value: the fixed
  8213. // string "dfareporting#ordersListResponse".
  8214. Kind string `json:"kind,omitempty"`
  8215. // NextPageToken: Pagination token to be used for the next list
  8216. // operation.
  8217. NextPageToken string `json:"nextPageToken,omitempty"`
  8218. // Orders: Order collection.
  8219. Orders []*Order `json:"orders,omitempty"`
  8220. // ServerResponse contains the HTTP response code and headers from the
  8221. // server.
  8222. googleapi.ServerResponse `json:"-"`
  8223. // ForceSendFields is a list of field names (e.g. "Kind") to
  8224. // unconditionally include in API requests. By default, fields with
  8225. // empty values are omitted from API requests. However, any non-pointer,
  8226. // non-interface field appearing in ForceSendFields will be sent to the
  8227. // server regardless of whether the field is empty or not. This may be
  8228. // used to include empty fields in Patch requests.
  8229. ForceSendFields []string `json:"-"`
  8230. // NullFields is a list of field names (e.g. "Kind") to include in API
  8231. // requests with the JSON null value. By default, fields with empty
  8232. // values are omitted from API requests. However, any field with an
  8233. // empty value appearing in NullFields will be sent to the server as
  8234. // null. It is an error if a field in this list has a non-empty value.
  8235. // This may be used to include null fields in Patch requests.
  8236. NullFields []string `json:"-"`
  8237. }
  8238. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  8239. type NoMethod OrdersListResponse
  8240. raw := NoMethod(*s)
  8241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8242. }
  8243. // PathToConversionReportCompatibleFields: Represents fields that are
  8244. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  8245. type PathToConversionReportCompatibleFields struct {
  8246. // ConversionDimensions: Conversion dimensions which are compatible to
  8247. // be selected in the "conversionDimensions" section of the report.
  8248. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  8249. // CustomFloodlightVariables: Custom floodlight variables which are
  8250. // compatible to be selected in the "customFloodlightVariables" section
  8251. // of the report.
  8252. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  8253. // Kind: The kind of resource this is, in this case
  8254. // dfareporting#pathToConversionReportCompatibleFields.
  8255. Kind string `json:"kind,omitempty"`
  8256. // Metrics: Metrics which are compatible to be selected in the
  8257. // "metricNames" section of the report.
  8258. Metrics []*Metric `json:"metrics,omitempty"`
  8259. // PerInteractionDimensions: Per-interaction dimensions which are
  8260. // compatible to be selected in the "perInteractionDimensions" section
  8261. // of the report.
  8262. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  8263. // ForceSendFields is a list of field names (e.g.
  8264. // "ConversionDimensions") to unconditionally include in API requests.
  8265. // By default, fields with empty values are omitted from API requests.
  8266. // However, any non-pointer, non-interface field appearing in
  8267. // ForceSendFields will be sent to the server regardless of whether the
  8268. // field is empty or not. This may be used to include empty fields in
  8269. // Patch requests.
  8270. ForceSendFields []string `json:"-"`
  8271. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  8272. // include in API requests with the JSON null value. By default, fields
  8273. // with empty values are omitted from API requests. However, any field
  8274. // with an empty value appearing in NullFields will be sent to the
  8275. // server as null. It is an error if a field in this list has a
  8276. // non-empty value. This may be used to include null fields in Patch
  8277. // requests.
  8278. NullFields []string `json:"-"`
  8279. }
  8280. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8281. type NoMethod PathToConversionReportCompatibleFields
  8282. raw := NoMethod(*s)
  8283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8284. }
  8285. // Placement: Contains properties of a placement.
  8286. type Placement struct {
  8287. // AccountId: Account ID of this placement. This field can be left
  8288. // blank.
  8289. AccountId int64 `json:"accountId,omitempty,string"`
  8290. // AdBlockingOptOut: Whether this placement opts out of ad blocking.
  8291. // When true, ad blocking is disabled for this placement. When false,
  8292. // the campaign and site settings take effect.
  8293. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  8294. // AdditionalSizes: Additional sizes associated with this placement.
  8295. // When inserting or updating a placement, only the size ID field is
  8296. // used.
  8297. AdditionalSizes []*Size `json:"additionalSizes,omitempty"`
  8298. // AdvertiserId: Advertiser ID of this placement. This field can be left
  8299. // blank.
  8300. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8301. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8302. // advertiser. This is a read-only, auto-generated field.
  8303. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8304. // Archived: Whether this placement is archived.
  8305. Archived bool `json:"archived,omitempty"`
  8306. // CampaignId: Campaign ID of this placement. This field is a required
  8307. // field on insertion.
  8308. CampaignId int64 `json:"campaignId,omitempty,string"`
  8309. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8310. // This is a read-only, auto-generated field.
  8311. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8312. // Comment: Comments for this placement.
  8313. Comment string `json:"comment,omitempty"`
  8314. // Compatibility: Placement compatibility. DISPLAY and
  8315. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  8316. // or in mobile apps for regular or interstitial ads respectively. APP
  8317. // and APP_INTERSTITIAL are no longer allowed for new placement
  8318. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  8319. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  8320. // with the VAST standard. This field is required on insertion.
  8321. //
  8322. // Possible values:
  8323. // "APP"
  8324. // "APP_INTERSTITIAL"
  8325. // "DISPLAY"
  8326. // "DISPLAY_INTERSTITIAL"
  8327. // "IN_STREAM_AUDIO"
  8328. // "IN_STREAM_VIDEO"
  8329. Compatibility string `json:"compatibility,omitempty"`
  8330. // ContentCategoryId: ID of the content category assigned to this
  8331. // placement.
  8332. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8333. // CreateInfo: Information about the creation of this placement. This is
  8334. // a read-only field.
  8335. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8336. // DirectorySiteId: Directory site ID of this placement. On insert, you
  8337. // must set either this field or the siteId field to specify the site
  8338. // associated with this placement. This is a required field that is
  8339. // read-only after insertion.
  8340. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8341. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8342. // directory site. This is a read-only, auto-generated field.
  8343. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8344. // ExternalId: External ID for this placement.
  8345. ExternalId string `json:"externalId,omitempty"`
  8346. // Id: ID of this placement. This is a read-only, auto-generated field.
  8347. Id int64 `json:"id,omitempty,string"`
  8348. // IdDimensionValue: Dimension value for the ID of this placement. This
  8349. // is a read-only, auto-generated field.
  8350. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8351. // KeyName: Key name of this placement. This is a read-only,
  8352. // auto-generated field.
  8353. KeyName string `json:"keyName,omitempty"`
  8354. // Kind: Identifies what kind of resource this is. Value: the fixed
  8355. // string "dfareporting#placement".
  8356. Kind string `json:"kind,omitempty"`
  8357. // LastModifiedInfo: Information about the most recent modification of
  8358. // this placement. This is a read-only field.
  8359. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8360. // LookbackConfiguration: Lookback window settings for this placement.
  8361. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  8362. // Name: Name of this placement.This is a required field and must be
  8363. // less than 256 characters long.
  8364. Name string `json:"name,omitempty"`
  8365. // PaymentApproved: Whether payment was approved for this placement.
  8366. // This is a read-only field relevant only to publisher-paid placements.
  8367. PaymentApproved bool `json:"paymentApproved,omitempty"`
  8368. // PaymentSource: Payment source for this placement. This is a required
  8369. // field that is read-only after insertion.
  8370. //
  8371. // Possible values:
  8372. // "PLACEMENT_AGENCY_PAID"
  8373. // "PLACEMENT_PUBLISHER_PAID"
  8374. PaymentSource string `json:"paymentSource,omitempty"`
  8375. // PlacementGroupId: ID of this placement's group, if applicable.
  8376. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  8377. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  8378. // placement group. This is a read-only, auto-generated field.
  8379. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  8380. // PlacementStrategyId: ID of the placement strategy assigned to this
  8381. // placement.
  8382. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8383. // PricingSchedule: Pricing schedule of this placement. This field is
  8384. // required on insertion, specifically subfields startDate, endDate and
  8385. // pricingType.
  8386. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8387. // Primary: Whether this placement is the primary placement of a
  8388. // roadblock (placement group). You cannot change this field from true
  8389. // to false. Setting this field to true will automatically set the
  8390. // primary field on the original primary placement of the roadblock to
  8391. // false, and it will automatically set the roadblock's
  8392. // primaryPlacementId field to the ID of this placement.
  8393. Primary bool `json:"primary,omitempty"`
  8394. // PublisherUpdateInfo: Information about the last publisher update.
  8395. // This is a read-only field.
  8396. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8397. // SiteId: Site ID associated with this placement. On insert, you must
  8398. // set either this field or the directorySiteId field to specify the
  8399. // site associated with this placement. This is a required field that is
  8400. // read-only after insertion.
  8401. SiteId int64 `json:"siteId,omitempty,string"`
  8402. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8403. // a read-only, auto-generated field.
  8404. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8405. // Size: Size associated with this placement. When inserting or updating
  8406. // a placement, only the size ID field is used. This field is required
  8407. // on insertion.
  8408. Size *Size `json:"size,omitempty"`
  8409. // SslRequired: Whether creatives assigned to this placement must be
  8410. // SSL-compliant.
  8411. SslRequired bool `json:"sslRequired,omitempty"`
  8412. // Status: Third-party placement status.
  8413. //
  8414. // Possible values:
  8415. // "ACKNOWLEDGE_ACCEPTANCE"
  8416. // "ACKNOWLEDGE_REJECTION"
  8417. // "DRAFT"
  8418. // "PAYMENT_ACCEPTED"
  8419. // "PAYMENT_REJECTED"
  8420. // "PENDING_REVIEW"
  8421. Status string `json:"status,omitempty"`
  8422. // SubaccountId: Subaccount ID of this placement. This field can be left
  8423. // blank.
  8424. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8425. // TagFormats: Tag formats to generate for this placement. This field is
  8426. // required on insertion.
  8427. // Acceptable values are:
  8428. // - "PLACEMENT_TAG_STANDARD"
  8429. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8430. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8431. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8432. // - "PLACEMENT_TAG_JAVASCRIPT"
  8433. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8434. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8435. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8436. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8437. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8438. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8439. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8440. // - "PLACEMENT_TAG_TRACKING"
  8441. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8442. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8443. //
  8444. // Possible values:
  8445. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8446. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8447. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8448. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8449. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8450. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8451. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8452. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8453. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8454. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8455. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8456. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8457. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8458. // "PLACEMENT_TAG_JAVASCRIPT"
  8459. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8460. // "PLACEMENT_TAG_STANDARD"
  8461. // "PLACEMENT_TAG_TRACKING"
  8462. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8463. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8464. TagFormats []string `json:"tagFormats,omitempty"`
  8465. // TagSetting: Tag settings for this placement.
  8466. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8467. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8468. // disabled for in-stream video creatives for this placement. The same
  8469. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8470. // occurs if either of these settings are true. These settings are
  8471. // distinct from DirectorySites.settings.activeViewOptOut or
  8472. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8473. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8474. // well as display ads, from Verification and ActiveView.
  8475. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8476. // VideoSettings: A collection of settings which affect video creatives
  8477. // served through this placement. Applicable to placements with
  8478. // IN_STREAM_VIDEO compatibility.
  8479. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8480. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8481. // Controls which VPAID format the measurement adapter will use for
  8482. // in-stream video creatives assigned to this placement.
  8483. //
  8484. // Note: Flash is no longer supported. This field now defaults to HTML5
  8485. // when the following values are provided: FLASH, BOTH.
  8486. //
  8487. // Possible values:
  8488. // "BOTH"
  8489. // "DEFAULT"
  8490. // "FLASH"
  8491. // "HTML5"
  8492. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8493. // ServerResponse contains the HTTP response code and headers from the
  8494. // server.
  8495. googleapi.ServerResponse `json:"-"`
  8496. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8497. // unconditionally include in API requests. By default, fields with
  8498. // empty values are omitted from API requests. However, any non-pointer,
  8499. // non-interface field appearing in ForceSendFields will be sent to the
  8500. // server regardless of whether the field is empty or not. This may be
  8501. // used to include empty fields in Patch requests.
  8502. ForceSendFields []string `json:"-"`
  8503. // NullFields is a list of field names (e.g. "AccountId") to include in
  8504. // API requests with the JSON null value. By default, fields with empty
  8505. // values are omitted from API requests. However, any field with an
  8506. // empty value appearing in NullFields will be sent to the server as
  8507. // null. It is an error if a field in this list has a non-empty value.
  8508. // This may be used to include null fields in Patch requests.
  8509. NullFields []string `json:"-"`
  8510. }
  8511. func (s *Placement) MarshalJSON() ([]byte, error) {
  8512. type NoMethod Placement
  8513. raw := NoMethod(*s)
  8514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8515. }
  8516. // PlacementAssignment: Placement Assignment.
  8517. type PlacementAssignment struct {
  8518. // Active: Whether this placement assignment is active. When true, the
  8519. // placement will be included in the ad's rotation.
  8520. Active bool `json:"active,omitempty"`
  8521. // PlacementId: ID of the placement to be assigned. This is a required
  8522. // field.
  8523. PlacementId int64 `json:"placementId,omitempty,string"`
  8524. // PlacementIdDimensionValue: Dimension value for the ID of the
  8525. // placement. This is a read-only, auto-generated field.
  8526. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8527. // SslRequired: Whether the placement to be assigned requires SSL. This
  8528. // is a read-only field that is auto-generated when the ad is inserted
  8529. // or updated.
  8530. SslRequired bool `json:"sslRequired,omitempty"`
  8531. // ForceSendFields is a list of field names (e.g. "Active") to
  8532. // unconditionally include in API requests. By default, fields with
  8533. // empty values are omitted from API requests. However, any non-pointer,
  8534. // non-interface field appearing in ForceSendFields will be sent to the
  8535. // server regardless of whether the field is empty or not. This may be
  8536. // used to include empty fields in Patch requests.
  8537. ForceSendFields []string `json:"-"`
  8538. // NullFields is a list of field names (e.g. "Active") to include in API
  8539. // requests with the JSON null value. By default, fields with empty
  8540. // values are omitted from API requests. However, any field with an
  8541. // empty value appearing in NullFields will be sent to the server as
  8542. // null. It is an error if a field in this list has a non-empty value.
  8543. // This may be used to include null fields in Patch requests.
  8544. NullFields []string `json:"-"`
  8545. }
  8546. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8547. type NoMethod PlacementAssignment
  8548. raw := NoMethod(*s)
  8549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8550. }
  8551. // PlacementGroup: Contains properties of a package or roadblock.
  8552. type PlacementGroup struct {
  8553. // AccountId: Account ID of this placement group. This is a read-only
  8554. // field that can be left blank.
  8555. AccountId int64 `json:"accountId,omitempty,string"`
  8556. // AdvertiserId: Advertiser ID of this placement group. This is a
  8557. // required field on insertion.
  8558. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8559. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8560. // advertiser. This is a read-only, auto-generated field.
  8561. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8562. // Archived: Whether this placement group is archived.
  8563. Archived bool `json:"archived,omitempty"`
  8564. // CampaignId: Campaign ID of this placement group. This field is
  8565. // required on insertion.
  8566. CampaignId int64 `json:"campaignId,omitempty,string"`
  8567. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8568. // This is a read-only, auto-generated field.
  8569. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8570. // ChildPlacementIds: IDs of placements which are assigned to this
  8571. // placement group. This is a read-only, auto-generated field.
  8572. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8573. // Comment: Comments for this placement group.
  8574. Comment string `json:"comment,omitempty"`
  8575. // ContentCategoryId: ID of the content category assigned to this
  8576. // placement group.
  8577. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8578. // CreateInfo: Information about the creation of this placement group.
  8579. // This is a read-only field.
  8580. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8581. // DirectorySiteId: Directory site ID associated with this placement
  8582. // group. On insert, you must set either this field or the site_id field
  8583. // to specify the site associated with this placement group. This is a
  8584. // required field that is read-only after insertion.
  8585. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8586. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8587. // directory site. This is a read-only, auto-generated field.
  8588. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8589. // ExternalId: External ID for this placement.
  8590. ExternalId string `json:"externalId,omitempty"`
  8591. // Id: ID of this placement group. This is a read-only, auto-generated
  8592. // field.
  8593. Id int64 `json:"id,omitempty,string"`
  8594. // IdDimensionValue: Dimension value for the ID of this placement group.
  8595. // This is a read-only, auto-generated field.
  8596. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8597. // Kind: Identifies what kind of resource this is. Value: the fixed
  8598. // string "dfareporting#placementGroup".
  8599. Kind string `json:"kind,omitempty"`
  8600. // LastModifiedInfo: Information about the most recent modification of
  8601. // this placement group. This is a read-only field.
  8602. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8603. // Name: Name of this placement group. This is a required field and must
  8604. // be less than 256 characters long.
  8605. Name string `json:"name,omitempty"`
  8606. // PlacementGroupType: Type of this placement group. A package is a
  8607. // simple group of placements that acts as a single pricing point for a
  8608. // group of tags. A roadblock is a group of placements that not only
  8609. // acts as a single pricing point, but also assumes that all the tags in
  8610. // it will be served at the same time. A roadblock requires one of its
  8611. // assigned placements to be marked as primary for reporting. This field
  8612. // is required on insertion.
  8613. //
  8614. // Possible values:
  8615. // "PLACEMENT_PACKAGE"
  8616. // "PLACEMENT_ROADBLOCK"
  8617. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8618. // PlacementStrategyId: ID of the placement strategy assigned to this
  8619. // placement group.
  8620. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8621. // PricingSchedule: Pricing schedule of this placement group. This field
  8622. // is required on insertion.
  8623. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8624. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8625. // the media cost of a roadblock (placement group). Modifying this field
  8626. // will automatically modify the primary field on all affected roadblock
  8627. // child placements.
  8628. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8629. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8630. // primary placement. This is a read-only, auto-generated field.
  8631. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8632. // SiteId: Site ID associated with this placement group. On insert, you
  8633. // must set either this field or the directorySiteId field to specify
  8634. // the site associated with this placement group. This is a required
  8635. // field that is read-only after insertion.
  8636. SiteId int64 `json:"siteId,omitempty,string"`
  8637. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8638. // a read-only, auto-generated field.
  8639. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8640. // SubaccountId: Subaccount ID of this placement group. This is a
  8641. // read-only field that can be left blank.
  8642. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8643. // ServerResponse contains the HTTP response code and headers from the
  8644. // server.
  8645. googleapi.ServerResponse `json:"-"`
  8646. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8647. // unconditionally include in API requests. By default, fields with
  8648. // empty values are omitted from API requests. However, any non-pointer,
  8649. // non-interface field appearing in ForceSendFields will be sent to the
  8650. // server regardless of whether the field is empty or not. This may be
  8651. // used to include empty fields in Patch requests.
  8652. ForceSendFields []string `json:"-"`
  8653. // NullFields is a list of field names (e.g. "AccountId") to include in
  8654. // API requests with the JSON null value. By default, fields with empty
  8655. // values are omitted from API requests. However, any field with an
  8656. // empty value appearing in NullFields will be sent to the server as
  8657. // null. It is an error if a field in this list has a non-empty value.
  8658. // This may be used to include null fields in Patch requests.
  8659. NullFields []string `json:"-"`
  8660. }
  8661. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8662. type NoMethod PlacementGroup
  8663. raw := NoMethod(*s)
  8664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8665. }
  8666. // PlacementGroupsListResponse: Placement Group List Response
  8667. type PlacementGroupsListResponse struct {
  8668. // Kind: Identifies what kind of resource this is. Value: the fixed
  8669. // string "dfareporting#placementGroupsListResponse".
  8670. Kind string `json:"kind,omitempty"`
  8671. // NextPageToken: Pagination token to be used for the next list
  8672. // operation.
  8673. NextPageToken string `json:"nextPageToken,omitempty"`
  8674. // PlacementGroups: Placement group collection.
  8675. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8676. // ServerResponse contains the HTTP response code and headers from the
  8677. // server.
  8678. googleapi.ServerResponse `json:"-"`
  8679. // ForceSendFields is a list of field names (e.g. "Kind") to
  8680. // unconditionally include in API requests. By default, fields with
  8681. // empty values are omitted from API requests. However, any non-pointer,
  8682. // non-interface field appearing in ForceSendFields will be sent to the
  8683. // server regardless of whether the field is empty or not. This may be
  8684. // used to include empty fields in Patch requests.
  8685. ForceSendFields []string `json:"-"`
  8686. // NullFields is a list of field names (e.g. "Kind") to include in API
  8687. // requests with the JSON null value. By default, fields with empty
  8688. // values are omitted from API requests. However, any field with an
  8689. // empty value appearing in NullFields will be sent to the server as
  8690. // null. It is an error if a field in this list has a non-empty value.
  8691. // This may be used to include null fields in Patch requests.
  8692. NullFields []string `json:"-"`
  8693. }
  8694. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8695. type NoMethod PlacementGroupsListResponse
  8696. raw := NoMethod(*s)
  8697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8698. }
  8699. // PlacementStrategiesListResponse: Placement Strategy List Response
  8700. type PlacementStrategiesListResponse struct {
  8701. // Kind: Identifies what kind of resource this is. Value: the fixed
  8702. // string "dfareporting#placementStrategiesListResponse".
  8703. Kind string `json:"kind,omitempty"`
  8704. // NextPageToken: Pagination token to be used for the next list
  8705. // operation.
  8706. NextPageToken string `json:"nextPageToken,omitempty"`
  8707. // PlacementStrategies: Placement strategy collection.
  8708. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8709. // ServerResponse contains the HTTP response code and headers from the
  8710. // server.
  8711. googleapi.ServerResponse `json:"-"`
  8712. // ForceSendFields is a list of field names (e.g. "Kind") to
  8713. // unconditionally include in API requests. By default, fields with
  8714. // empty values are omitted from API requests. However, any non-pointer,
  8715. // non-interface field appearing in ForceSendFields will be sent to the
  8716. // server regardless of whether the field is empty or not. This may be
  8717. // used to include empty fields in Patch requests.
  8718. ForceSendFields []string `json:"-"`
  8719. // NullFields is a list of field names (e.g. "Kind") to include in API
  8720. // requests with the JSON null value. By default, fields with empty
  8721. // values are omitted from API requests. However, any field with an
  8722. // empty value appearing in NullFields will be sent to the server as
  8723. // null. It is an error if a field in this list has a non-empty value.
  8724. // This may be used to include null fields in Patch requests.
  8725. NullFields []string `json:"-"`
  8726. }
  8727. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8728. type NoMethod PlacementStrategiesListResponse
  8729. raw := NoMethod(*s)
  8730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8731. }
  8732. // PlacementStrategy: Contains properties of a placement strategy.
  8733. type PlacementStrategy struct {
  8734. // AccountId: Account ID of this placement strategy.This is a read-only
  8735. // field that can be left blank.
  8736. AccountId int64 `json:"accountId,omitempty,string"`
  8737. // Id: ID of this placement strategy. This is a read-only,
  8738. // auto-generated field.
  8739. Id int64 `json:"id,omitempty,string"`
  8740. // Kind: Identifies what kind of resource this is. Value: the fixed
  8741. // string "dfareporting#placementStrategy".
  8742. Kind string `json:"kind,omitempty"`
  8743. // Name: Name of this placement strategy. This is a required field. It
  8744. // must be less than 256 characters long and unique among placement
  8745. // strategies of the same account.
  8746. Name string `json:"name,omitempty"`
  8747. // ServerResponse contains the HTTP response code and headers from the
  8748. // server.
  8749. googleapi.ServerResponse `json:"-"`
  8750. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8751. // unconditionally include in API requests. By default, fields with
  8752. // empty values are omitted from API requests. However, any non-pointer,
  8753. // non-interface field appearing in ForceSendFields will be sent to the
  8754. // server regardless of whether the field is empty or not. This may be
  8755. // used to include empty fields in Patch requests.
  8756. ForceSendFields []string `json:"-"`
  8757. // NullFields is a list of field names (e.g. "AccountId") to include in
  8758. // API requests with the JSON null value. By default, fields with empty
  8759. // values are omitted from API requests. However, any field with an
  8760. // empty value appearing in NullFields will be sent to the server as
  8761. // null. It is an error if a field in this list has a non-empty value.
  8762. // This may be used to include null fields in Patch requests.
  8763. NullFields []string `json:"-"`
  8764. }
  8765. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8766. type NoMethod PlacementStrategy
  8767. raw := NoMethod(*s)
  8768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8769. }
  8770. // PlacementTag: Placement Tag
  8771. type PlacementTag struct {
  8772. // PlacementId: Placement ID
  8773. PlacementId int64 `json:"placementId,omitempty,string"`
  8774. // TagDatas: Tags generated for this placement.
  8775. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8776. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8777. // unconditionally include in API requests. By default, fields with
  8778. // empty values are omitted from API requests. However, any non-pointer,
  8779. // non-interface field appearing in ForceSendFields will be sent to the
  8780. // server regardless of whether the field is empty or not. This may be
  8781. // used to include empty fields in Patch requests.
  8782. ForceSendFields []string `json:"-"`
  8783. // NullFields is a list of field names (e.g. "PlacementId") to include
  8784. // in API requests with the JSON null value. By default, fields with
  8785. // empty values are omitted from API requests. However, any field with
  8786. // an empty value appearing in NullFields will be sent to the server as
  8787. // null. It is an error if a field in this list has a non-empty value.
  8788. // This may be used to include null fields in Patch requests.
  8789. NullFields []string `json:"-"`
  8790. }
  8791. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8792. type NoMethod PlacementTag
  8793. raw := NoMethod(*s)
  8794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8795. }
  8796. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8797. type PlacementsGenerateTagsResponse struct {
  8798. // Kind: Identifies what kind of resource this is. Value: the fixed
  8799. // string "dfareporting#placementsGenerateTagsResponse".
  8800. Kind string `json:"kind,omitempty"`
  8801. // PlacementTags: Set of generated tags for the specified placements.
  8802. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8803. // ServerResponse contains the HTTP response code and headers from the
  8804. // server.
  8805. googleapi.ServerResponse `json:"-"`
  8806. // ForceSendFields is a list of field names (e.g. "Kind") to
  8807. // unconditionally include in API requests. By default, fields with
  8808. // empty values are omitted from API requests. However, any non-pointer,
  8809. // non-interface field appearing in ForceSendFields will be sent to the
  8810. // server regardless of whether the field is empty or not. This may be
  8811. // used to include empty fields in Patch requests.
  8812. ForceSendFields []string `json:"-"`
  8813. // NullFields is a list of field names (e.g. "Kind") to include in API
  8814. // requests with the JSON null value. By default, fields with empty
  8815. // values are omitted from API requests. However, any field with an
  8816. // empty value appearing in NullFields will be sent to the server as
  8817. // null. It is an error if a field in this list has a non-empty value.
  8818. // This may be used to include null fields in Patch requests.
  8819. NullFields []string `json:"-"`
  8820. }
  8821. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8822. type NoMethod PlacementsGenerateTagsResponse
  8823. raw := NoMethod(*s)
  8824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8825. }
  8826. // PlacementsListResponse: Placement List Response
  8827. type PlacementsListResponse struct {
  8828. // Kind: Identifies what kind of resource this is. Value: the fixed
  8829. // string "dfareporting#placementsListResponse".
  8830. Kind string `json:"kind,omitempty"`
  8831. // NextPageToken: Pagination token to be used for the next list
  8832. // operation.
  8833. NextPageToken string `json:"nextPageToken,omitempty"`
  8834. // Placements: Placement collection.
  8835. Placements []*Placement `json:"placements,omitempty"`
  8836. // ServerResponse contains the HTTP response code and headers from the
  8837. // server.
  8838. googleapi.ServerResponse `json:"-"`
  8839. // ForceSendFields is a list of field names (e.g. "Kind") to
  8840. // unconditionally include in API requests. By default, fields with
  8841. // empty values are omitted from API requests. However, any non-pointer,
  8842. // non-interface field appearing in ForceSendFields will be sent to the
  8843. // server regardless of whether the field is empty or not. This may be
  8844. // used to include empty fields in Patch requests.
  8845. ForceSendFields []string `json:"-"`
  8846. // NullFields is a list of field names (e.g. "Kind") to include in API
  8847. // requests with the JSON null value. By default, fields with empty
  8848. // values are omitted from API requests. However, any field with an
  8849. // empty value appearing in NullFields will be sent to the server as
  8850. // null. It is an error if a field in this list has a non-empty value.
  8851. // This may be used to include null fields in Patch requests.
  8852. NullFields []string `json:"-"`
  8853. }
  8854. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8855. type NoMethod PlacementsListResponse
  8856. raw := NoMethod(*s)
  8857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8858. }
  8859. // PlatformType: Contains information about a platform type that can be
  8860. // targeted by ads.
  8861. type PlatformType struct {
  8862. // Id: ID of this platform type.
  8863. Id int64 `json:"id,omitempty,string"`
  8864. // Kind: Identifies what kind of resource this is. Value: the fixed
  8865. // string "dfareporting#platformType".
  8866. Kind string `json:"kind,omitempty"`
  8867. // Name: Name of this platform type.
  8868. Name string `json:"name,omitempty"`
  8869. // ServerResponse contains the HTTP response code and headers from the
  8870. // server.
  8871. googleapi.ServerResponse `json:"-"`
  8872. // ForceSendFields is a list of field names (e.g. "Id") to
  8873. // unconditionally include in API requests. By default, fields with
  8874. // empty values are omitted from API requests. However, any non-pointer,
  8875. // non-interface field appearing in ForceSendFields will be sent to the
  8876. // server regardless of whether the field is empty or not. This may be
  8877. // used to include empty fields in Patch requests.
  8878. ForceSendFields []string `json:"-"`
  8879. // NullFields is a list of field names (e.g. "Id") to include in API
  8880. // requests with the JSON null value. By default, fields with empty
  8881. // values are omitted from API requests. However, any field with an
  8882. // empty value appearing in NullFields will be sent to the server as
  8883. // null. It is an error if a field in this list has a non-empty value.
  8884. // This may be used to include null fields in Patch requests.
  8885. NullFields []string `json:"-"`
  8886. }
  8887. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8888. type NoMethod PlatformType
  8889. raw := NoMethod(*s)
  8890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8891. }
  8892. // PlatformTypesListResponse: Platform Type List Response
  8893. type PlatformTypesListResponse struct {
  8894. // Kind: Identifies what kind of resource this is. Value: the fixed
  8895. // string "dfareporting#platformTypesListResponse".
  8896. Kind string `json:"kind,omitempty"`
  8897. // PlatformTypes: Platform type collection.
  8898. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8899. // ServerResponse contains the HTTP response code and headers from the
  8900. // server.
  8901. googleapi.ServerResponse `json:"-"`
  8902. // ForceSendFields is a list of field names (e.g. "Kind") to
  8903. // unconditionally include in API requests. By default, fields with
  8904. // empty values are omitted from API requests. However, any non-pointer,
  8905. // non-interface field appearing in ForceSendFields will be sent to the
  8906. // server regardless of whether the field is empty or not. This may be
  8907. // used to include empty fields in Patch requests.
  8908. ForceSendFields []string `json:"-"`
  8909. // NullFields is a list of field names (e.g. "Kind") to include in API
  8910. // requests with the JSON null value. By default, fields with empty
  8911. // values are omitted from API requests. However, any field with an
  8912. // empty value appearing in NullFields will be sent to the server as
  8913. // null. It is an error if a field in this list has a non-empty value.
  8914. // This may be used to include null fields in Patch requests.
  8915. NullFields []string `json:"-"`
  8916. }
  8917. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8918. type NoMethod PlatformTypesListResponse
  8919. raw := NoMethod(*s)
  8920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8921. }
  8922. // PopupWindowProperties: Popup Window Properties.
  8923. type PopupWindowProperties struct {
  8924. // Dimension: Popup dimension for a creative. This is a read-only field.
  8925. // Applicable to the following creative types: all RICH_MEDIA and all
  8926. // VPAID
  8927. Dimension *Size `json:"dimension,omitempty"`
  8928. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8929. // if positionType is COORDINATES.
  8930. Offset *OffsetPosition `json:"offset,omitempty"`
  8931. // PositionType: Popup window position either centered or at specific
  8932. // coordinate.
  8933. //
  8934. // Possible values:
  8935. // "CENTER"
  8936. // "COORDINATES"
  8937. PositionType string `json:"positionType,omitempty"`
  8938. // ShowAddressBar: Whether to display the browser address bar.
  8939. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8940. // ShowMenuBar: Whether to display the browser menu bar.
  8941. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8942. // ShowScrollBar: Whether to display the browser scroll bar.
  8943. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8944. // ShowStatusBar: Whether to display the browser status bar.
  8945. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8946. // ShowToolBar: Whether to display the browser tool bar.
  8947. ShowToolBar bool `json:"showToolBar,omitempty"`
  8948. // Title: Title of popup window.
  8949. Title string `json:"title,omitempty"`
  8950. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8951. // unconditionally include in API requests. By default, fields with
  8952. // empty values are omitted from API requests. However, any non-pointer,
  8953. // non-interface field appearing in ForceSendFields will be sent to the
  8954. // server regardless of whether the field is empty or not. This may be
  8955. // used to include empty fields in Patch requests.
  8956. ForceSendFields []string `json:"-"`
  8957. // NullFields is a list of field names (e.g. "Dimension") to include in
  8958. // API requests with the JSON null value. By default, fields with empty
  8959. // values are omitted from API requests. However, any field with an
  8960. // empty value appearing in NullFields will be sent to the server as
  8961. // null. It is an error if a field in this list has a non-empty value.
  8962. // This may be used to include null fields in Patch requests.
  8963. NullFields []string `json:"-"`
  8964. }
  8965. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8966. type NoMethod PopupWindowProperties
  8967. raw := NoMethod(*s)
  8968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8969. }
  8970. // PostalCode: Contains information about a postal code that can be
  8971. // targeted by ads.
  8972. type PostalCode struct {
  8973. // Code: Postal code. This is equivalent to the id field.
  8974. Code string `json:"code,omitempty"`
  8975. // CountryCode: Country code of the country to which this postal code
  8976. // belongs.
  8977. CountryCode string `json:"countryCode,omitempty"`
  8978. // CountryDartId: DART ID of the country to which this postal code
  8979. // belongs.
  8980. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8981. // Id: ID of this postal code.
  8982. Id string `json:"id,omitempty"`
  8983. // Kind: Identifies what kind of resource this is. Value: the fixed
  8984. // string "dfareporting#postalCode".
  8985. Kind string `json:"kind,omitempty"`
  8986. // ServerResponse contains the HTTP response code and headers from the
  8987. // server.
  8988. googleapi.ServerResponse `json:"-"`
  8989. // ForceSendFields is a list of field names (e.g. "Code") to
  8990. // unconditionally include in API requests. By default, fields with
  8991. // empty values are omitted from API requests. However, any non-pointer,
  8992. // non-interface field appearing in ForceSendFields will be sent to the
  8993. // server regardless of whether the field is empty or not. This may be
  8994. // used to include empty fields in Patch requests.
  8995. ForceSendFields []string `json:"-"`
  8996. // NullFields is a list of field names (e.g. "Code") to include in API
  8997. // requests with the JSON null value. By default, fields with empty
  8998. // values are omitted from API requests. However, any field with an
  8999. // empty value appearing in NullFields will be sent to the server as
  9000. // null. It is an error if a field in this list has a non-empty value.
  9001. // This may be used to include null fields in Patch requests.
  9002. NullFields []string `json:"-"`
  9003. }
  9004. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  9005. type NoMethod PostalCode
  9006. raw := NoMethod(*s)
  9007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9008. }
  9009. // PostalCodesListResponse: Postal Code List Response
  9010. type PostalCodesListResponse struct {
  9011. // Kind: Identifies what kind of resource this is. Value: the fixed
  9012. // string "dfareporting#postalCodesListResponse".
  9013. Kind string `json:"kind,omitempty"`
  9014. // PostalCodes: Postal code collection.
  9015. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  9016. // ServerResponse contains the HTTP response code and headers from the
  9017. // server.
  9018. googleapi.ServerResponse `json:"-"`
  9019. // ForceSendFields is a list of field names (e.g. "Kind") to
  9020. // unconditionally include in API requests. By default, fields with
  9021. // empty values are omitted from API requests. However, any non-pointer,
  9022. // non-interface field appearing in ForceSendFields will be sent to the
  9023. // server regardless of whether the field is empty or not. This may be
  9024. // used to include empty fields in Patch requests.
  9025. ForceSendFields []string `json:"-"`
  9026. // NullFields is a list of field names (e.g. "Kind") to include in API
  9027. // requests with the JSON null value. By default, fields with empty
  9028. // values are omitted from API requests. However, any field with an
  9029. // empty value appearing in NullFields will be sent to the server as
  9030. // null. It is an error if a field in this list has a non-empty value.
  9031. // This may be used to include null fields in Patch requests.
  9032. NullFields []string `json:"-"`
  9033. }
  9034. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  9035. type NoMethod PostalCodesListResponse
  9036. raw := NoMethod(*s)
  9037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9038. }
  9039. // Pricing: Pricing Information
  9040. type Pricing struct {
  9041. // CapCostType: Cap cost type of this inventory item.
  9042. //
  9043. // Possible values:
  9044. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  9045. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  9046. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  9047. CapCostType string `json:"capCostType,omitempty"`
  9048. // EndDate: End date of this inventory item.
  9049. EndDate string `json:"endDate,omitempty"`
  9050. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  9051. // period) represents the inventory item pricing information for a
  9052. // specific period of time.
  9053. Flights []*Flight `json:"flights,omitempty"`
  9054. // GroupType: Group type of this inventory item if it represents a
  9055. // placement group. Is null otherwise. There are two type of placement
  9056. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  9057. // inventory items that acts as a single pricing point for a group of
  9058. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  9059. // items that not only acts as a single pricing point, but also assumes
  9060. // that all the tags in it will be served at the same time. A roadblock
  9061. // requires one of its assigned inventory items to be marked as primary.
  9062. //
  9063. // Possible values:
  9064. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  9065. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  9066. GroupType string `json:"groupType,omitempty"`
  9067. // PricingType: Pricing type of this inventory item.
  9068. //
  9069. // Possible values:
  9070. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  9071. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  9072. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  9073. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  9074. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  9075. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  9076. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  9077. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  9078. PricingType string `json:"pricingType,omitempty"`
  9079. // StartDate: Start date of this inventory item.
  9080. StartDate string `json:"startDate,omitempty"`
  9081. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  9082. // unconditionally include in API requests. By default, fields with
  9083. // empty values are omitted from API requests. However, any non-pointer,
  9084. // non-interface field appearing in ForceSendFields will be sent to the
  9085. // server regardless of whether the field is empty or not. This may be
  9086. // used to include empty fields in Patch requests.
  9087. ForceSendFields []string `json:"-"`
  9088. // NullFields is a list of field names (e.g. "CapCostType") to include
  9089. // in API requests with the JSON null value. By default, fields with
  9090. // empty values are omitted from API requests. However, any field with
  9091. // an empty value appearing in NullFields will be sent to the server as
  9092. // null. It is an error if a field in this list has a non-empty value.
  9093. // This may be used to include null fields in Patch requests.
  9094. NullFields []string `json:"-"`
  9095. }
  9096. func (s *Pricing) MarshalJSON() ([]byte, error) {
  9097. type NoMethod Pricing
  9098. raw := NoMethod(*s)
  9099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9100. }
  9101. // PricingSchedule: Pricing Schedule
  9102. type PricingSchedule struct {
  9103. // CapCostOption: Placement cap cost option.
  9104. //
  9105. // Possible values:
  9106. // "CAP_COST_CUMULATIVE"
  9107. // "CAP_COST_MONTHLY"
  9108. // "CAP_COST_NONE"
  9109. CapCostOption string `json:"capCostOption,omitempty"`
  9110. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  9111. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  9112. // EndDate: Placement end date. This date must be later than, or the
  9113. // same day as, the placement start date, but not later than the
  9114. // campaign end date. If, for example, you set 6/25/2015 as both the
  9115. // start and end dates, the effective placement date is just that day
  9116. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  9117. // should not be set, as doing so will result in an error. This field is
  9118. // required on insertion.
  9119. EndDate string `json:"endDate,omitempty"`
  9120. // Flighted: Whether this placement is flighted. If true, pricing
  9121. // periods will be computed automatically.
  9122. Flighted bool `json:"flighted,omitempty"`
  9123. // FloodlightActivityId: Floodlight activity ID associated with this
  9124. // placement. This field should be set when placement pricing type is
  9125. // set to PRICING_TYPE_CPA.
  9126. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  9127. // PricingPeriods: Pricing periods for this placement.
  9128. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  9129. // PricingType: Placement pricing type. This field is required on
  9130. // insertion.
  9131. //
  9132. // Possible values:
  9133. // "PRICING_TYPE_CPA"
  9134. // "PRICING_TYPE_CPC"
  9135. // "PRICING_TYPE_CPM"
  9136. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  9137. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  9138. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  9139. PricingType string `json:"pricingType,omitempty"`
  9140. // StartDate: Placement start date. This date must be later than, or the
  9141. // same day as, the campaign start date. The hours, minutes, and seconds
  9142. // of the start date should not be set, as doing so will result in an
  9143. // error. This field is required on insertion.
  9144. StartDate string `json:"startDate,omitempty"`
  9145. // TestingStartDate: Testing start date of this placement. The hours,
  9146. // minutes, and seconds of the start date should not be set, as doing so
  9147. // will result in an error.
  9148. TestingStartDate string `json:"testingStartDate,omitempty"`
  9149. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  9150. // unconditionally include in API requests. By default, fields with
  9151. // empty values are omitted from API requests. However, any non-pointer,
  9152. // non-interface field appearing in ForceSendFields will be sent to the
  9153. // server regardless of whether the field is empty or not. This may be
  9154. // used to include empty fields in Patch requests.
  9155. ForceSendFields []string `json:"-"`
  9156. // NullFields is a list of field names (e.g. "CapCostOption") to include
  9157. // in API requests with the JSON null value. By default, fields with
  9158. // empty values are omitted from API requests. However, any field with
  9159. // an empty value appearing in NullFields will be sent to the server as
  9160. // null. It is an error if a field in this list has a non-empty value.
  9161. // This may be used to include null fields in Patch requests.
  9162. NullFields []string `json:"-"`
  9163. }
  9164. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  9165. type NoMethod PricingSchedule
  9166. raw := NoMethod(*s)
  9167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9168. }
  9169. // PricingSchedulePricingPeriod: Pricing Period
  9170. type PricingSchedulePricingPeriod struct {
  9171. // EndDate: Pricing period end date. This date must be later than, or
  9172. // the same day as, the pricing period start date, but not later than
  9173. // the placement end date. The period end date can be the same date as
  9174. // the period start date. If, for example, you set 6/25/2015 as both the
  9175. // start and end dates, the effective pricing period date is just that
  9176. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  9177. // should not be set, as doing so will result in an error.
  9178. EndDate string `json:"endDate,omitempty"`
  9179. // PricingComment: Comments for this pricing period.
  9180. PricingComment string `json:"pricingComment,omitempty"`
  9181. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  9182. // multipled by 1000000000). Acceptable values are 0 to
  9183. // 1000000000000000000, inclusive.
  9184. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  9185. // StartDate: Pricing period start date. This date must be later than,
  9186. // or the same day as, the placement start date. The hours, minutes, and
  9187. // seconds of the start date should not be set, as doing so will result
  9188. // in an error.
  9189. StartDate string `json:"startDate,omitempty"`
  9190. // Units: Units of this pricing period. Acceptable values are 0 to
  9191. // 10000000000, inclusive.
  9192. Units int64 `json:"units,omitempty,string"`
  9193. // ForceSendFields is a list of field names (e.g. "EndDate") to
  9194. // unconditionally include in API requests. By default, fields with
  9195. // empty values are omitted from API requests. However, any non-pointer,
  9196. // non-interface field appearing in ForceSendFields will be sent to the
  9197. // server regardless of whether the field is empty or not. This may be
  9198. // used to include empty fields in Patch requests.
  9199. ForceSendFields []string `json:"-"`
  9200. // NullFields is a list of field names (e.g. "EndDate") to include in
  9201. // API requests with the JSON null value. By default, fields with empty
  9202. // values are omitted from API requests. However, any field with an
  9203. // empty value appearing in NullFields will be sent to the server as
  9204. // null. It is an error if a field in this list has a non-empty value.
  9205. // This may be used to include null fields in Patch requests.
  9206. NullFields []string `json:"-"`
  9207. }
  9208. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  9209. type NoMethod PricingSchedulePricingPeriod
  9210. raw := NoMethod(*s)
  9211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9212. }
  9213. // Project: Contains properties of a Planning project.
  9214. type Project struct {
  9215. // AccountId: Account ID of this project.
  9216. AccountId int64 `json:"accountId,omitempty,string"`
  9217. // AdvertiserId: Advertiser ID of this project.
  9218. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9219. // AudienceAgeGroup: Audience age group of this project.
  9220. //
  9221. // Possible values:
  9222. // "PLANNING_AUDIENCE_AGE_18_24"
  9223. // "PLANNING_AUDIENCE_AGE_25_34"
  9224. // "PLANNING_AUDIENCE_AGE_35_44"
  9225. // "PLANNING_AUDIENCE_AGE_45_54"
  9226. // "PLANNING_AUDIENCE_AGE_55_64"
  9227. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  9228. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  9229. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  9230. // AudienceGender: Audience gender of this project.
  9231. //
  9232. // Possible values:
  9233. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  9234. // "PLANNING_AUDIENCE_GENDER_MALE"
  9235. AudienceGender string `json:"audienceGender,omitempty"`
  9236. // Budget: Budget of this project in the currency specified by the
  9237. // current account. The value stored in this field represents only the
  9238. // non-fractional amount. For example, for USD, the smallest value that
  9239. // can be represented by this field is 1 US dollar.
  9240. Budget int64 `json:"budget,omitempty,string"`
  9241. // ClientBillingCode: Client billing code of this project.
  9242. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  9243. // ClientName: Name of the project client.
  9244. ClientName string `json:"clientName,omitempty"`
  9245. // EndDate: End date of the project.
  9246. EndDate string `json:"endDate,omitempty"`
  9247. // Id: ID of this project. This is a read-only, auto-generated field.
  9248. Id int64 `json:"id,omitempty,string"`
  9249. // Kind: Identifies what kind of resource this is. Value: the fixed
  9250. // string "dfareporting#project".
  9251. Kind string `json:"kind,omitempty"`
  9252. // LastModifiedInfo: Information about the most recent modification of
  9253. // this project.
  9254. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  9255. // Name: Name of this project.
  9256. Name string `json:"name,omitempty"`
  9257. // Overview: Overview of this project.
  9258. Overview string `json:"overview,omitempty"`
  9259. // StartDate: Start date of the project.
  9260. StartDate string `json:"startDate,omitempty"`
  9261. // SubaccountId: Subaccount ID of this project.
  9262. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9263. // TargetClicks: Number of clicks that the advertiser is targeting.
  9264. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  9265. // TargetConversions: Number of conversions that the advertiser is
  9266. // targeting.
  9267. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  9268. // TargetCpaNanos: CPA that the advertiser is targeting.
  9269. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  9270. // TargetCpcNanos: CPC that the advertiser is targeting.
  9271. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  9272. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  9273. // is targeting.
  9274. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  9275. // TargetCpmNanos: CPM that the advertiser is targeting.
  9276. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  9277. // TargetImpressions: Number of impressions that the advertiser is
  9278. // targeting.
  9279. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  9280. // ServerResponse contains the HTTP response code and headers from the
  9281. // server.
  9282. googleapi.ServerResponse `json:"-"`
  9283. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9284. // unconditionally include in API requests. By default, fields with
  9285. // empty values are omitted from API requests. However, any non-pointer,
  9286. // non-interface field appearing in ForceSendFields will be sent to the
  9287. // server regardless of whether the field is empty or not. This may be
  9288. // used to include empty fields in Patch requests.
  9289. ForceSendFields []string `json:"-"`
  9290. // NullFields is a list of field names (e.g. "AccountId") to include in
  9291. // API requests with the JSON null value. By default, fields with empty
  9292. // values are omitted from API requests. However, any field with an
  9293. // empty value appearing in NullFields will be sent to the server as
  9294. // null. It is an error if a field in this list has a non-empty value.
  9295. // This may be used to include null fields in Patch requests.
  9296. NullFields []string `json:"-"`
  9297. }
  9298. func (s *Project) MarshalJSON() ([]byte, error) {
  9299. type NoMethod Project
  9300. raw := NoMethod(*s)
  9301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9302. }
  9303. // ProjectsListResponse: Project List Response
  9304. type ProjectsListResponse struct {
  9305. // Kind: Identifies what kind of resource this is. Value: the fixed
  9306. // string "dfareporting#projectsListResponse".
  9307. Kind string `json:"kind,omitempty"`
  9308. // NextPageToken: Pagination token to be used for the next list
  9309. // operation.
  9310. NextPageToken string `json:"nextPageToken,omitempty"`
  9311. // Projects: Project collection.
  9312. Projects []*Project `json:"projects,omitempty"`
  9313. // ServerResponse contains the HTTP response code and headers from the
  9314. // server.
  9315. googleapi.ServerResponse `json:"-"`
  9316. // ForceSendFields is a list of field names (e.g. "Kind") to
  9317. // unconditionally include in API requests. By default, fields with
  9318. // empty values are omitted from API requests. However, any non-pointer,
  9319. // non-interface field appearing in ForceSendFields will be sent to the
  9320. // server regardless of whether the field is empty or not. This may be
  9321. // used to include empty fields in Patch requests.
  9322. ForceSendFields []string `json:"-"`
  9323. // NullFields is a list of field names (e.g. "Kind") to include in API
  9324. // requests with the JSON null value. By default, fields with empty
  9325. // values are omitted from API requests. However, any field with an
  9326. // empty value appearing in NullFields will be sent to the server as
  9327. // null. It is an error if a field in this list has a non-empty value.
  9328. // This may be used to include null fields in Patch requests.
  9329. NullFields []string `json:"-"`
  9330. }
  9331. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  9332. type NoMethod ProjectsListResponse
  9333. raw := NoMethod(*s)
  9334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9335. }
  9336. // ReachReportCompatibleFields: Represents fields that are compatible to
  9337. // be selected for a report of type "REACH".
  9338. type ReachReportCompatibleFields struct {
  9339. // DimensionFilters: Dimensions which are compatible to be selected in
  9340. // the "dimensionFilters" section of the report.
  9341. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9342. // Dimensions: Dimensions which are compatible to be selected in the
  9343. // "dimensions" section of the report.
  9344. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9345. // Kind: The kind of resource this is, in this case
  9346. // dfareporting#reachReportCompatibleFields.
  9347. Kind string `json:"kind,omitempty"`
  9348. // Metrics: Metrics which are compatible to be selected in the
  9349. // "metricNames" section of the report.
  9350. Metrics []*Metric `json:"metrics,omitempty"`
  9351. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9352. // as activity metrics to pivot on in the "activities" section of the
  9353. // report.
  9354. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9355. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  9356. // in the "reachByFrequencyMetricNames" section of the report.
  9357. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  9358. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9359. // unconditionally include in API requests. By default, fields with
  9360. // empty values are omitted from API requests. However, any non-pointer,
  9361. // non-interface field appearing in ForceSendFields will be sent to the
  9362. // server regardless of whether the field is empty or not. This may be
  9363. // used to include empty fields in Patch requests.
  9364. ForceSendFields []string `json:"-"`
  9365. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9366. // include in API requests with the JSON null value. By default, fields
  9367. // with empty values are omitted from API requests. However, any field
  9368. // with an empty value appearing in NullFields will be sent to the
  9369. // server as null. It is an error if a field in this list has a
  9370. // non-empty value. This may be used to include null fields in Patch
  9371. // requests.
  9372. NullFields []string `json:"-"`
  9373. }
  9374. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9375. type NoMethod ReachReportCompatibleFields
  9376. raw := NoMethod(*s)
  9377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9378. }
  9379. // Recipient: Represents a recipient.
  9380. type Recipient struct {
  9381. // DeliveryType: The delivery type for the recipient.
  9382. //
  9383. // Possible values:
  9384. // "ATTACHMENT"
  9385. // "LINK"
  9386. DeliveryType string `json:"deliveryType,omitempty"`
  9387. // Email: The email address of the recipient.
  9388. Email string `json:"email,omitempty"`
  9389. // Kind: The kind of resource this is, in this case
  9390. // dfareporting#recipient.
  9391. Kind string `json:"kind,omitempty"`
  9392. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9393. // unconditionally include in API requests. By default, fields with
  9394. // empty values are omitted from API requests. However, any non-pointer,
  9395. // non-interface field appearing in ForceSendFields will be sent to the
  9396. // server regardless of whether the field is empty or not. This may be
  9397. // used to include empty fields in Patch requests.
  9398. ForceSendFields []string `json:"-"`
  9399. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9400. // in API requests with the JSON null value. By default, fields with
  9401. // empty values are omitted from API requests. However, any field with
  9402. // an empty value appearing in NullFields will be sent to the server as
  9403. // null. It is an error if a field in this list has a non-empty value.
  9404. // This may be used to include null fields in Patch requests.
  9405. NullFields []string `json:"-"`
  9406. }
  9407. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9408. type NoMethod Recipient
  9409. raw := NoMethod(*s)
  9410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9411. }
  9412. // Region: Contains information about a region that can be targeted by
  9413. // ads.
  9414. type Region struct {
  9415. // CountryCode: Country code of the country to which this region
  9416. // belongs.
  9417. CountryCode string `json:"countryCode,omitempty"`
  9418. // CountryDartId: DART ID of the country to which this region belongs.
  9419. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9420. // DartId: DART ID of this region.
  9421. DartId int64 `json:"dartId,omitempty,string"`
  9422. // Kind: Identifies what kind of resource this is. Value: the fixed
  9423. // string "dfareporting#region".
  9424. Kind string `json:"kind,omitempty"`
  9425. // Name: Name of this region.
  9426. Name string `json:"name,omitempty"`
  9427. // RegionCode: Region code.
  9428. RegionCode string `json:"regionCode,omitempty"`
  9429. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9430. // unconditionally include in API requests. By default, fields with
  9431. // empty values are omitted from API requests. However, any non-pointer,
  9432. // non-interface field appearing in ForceSendFields will be sent to the
  9433. // server regardless of whether the field is empty or not. This may be
  9434. // used to include empty fields in Patch requests.
  9435. ForceSendFields []string `json:"-"`
  9436. // NullFields is a list of field names (e.g. "CountryCode") to include
  9437. // in API requests with the JSON null value. By default, fields with
  9438. // empty values are omitted from API requests. However, any field with
  9439. // an empty value appearing in NullFields will be sent to the server as
  9440. // null. It is an error if a field in this list has a non-empty value.
  9441. // This may be used to include null fields in Patch requests.
  9442. NullFields []string `json:"-"`
  9443. }
  9444. func (s *Region) MarshalJSON() ([]byte, error) {
  9445. type NoMethod Region
  9446. raw := NoMethod(*s)
  9447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9448. }
  9449. // RegionsListResponse: Region List Response
  9450. type RegionsListResponse struct {
  9451. // Kind: Identifies what kind of resource this is. Value: the fixed
  9452. // string "dfareporting#regionsListResponse".
  9453. Kind string `json:"kind,omitempty"`
  9454. // Regions: Region collection.
  9455. Regions []*Region `json:"regions,omitempty"`
  9456. // ServerResponse contains the HTTP response code and headers from the
  9457. // server.
  9458. googleapi.ServerResponse `json:"-"`
  9459. // ForceSendFields is a list of field names (e.g. "Kind") to
  9460. // unconditionally include in API requests. By default, fields with
  9461. // empty values are omitted from API requests. However, any non-pointer,
  9462. // non-interface field appearing in ForceSendFields will be sent to the
  9463. // server regardless of whether the field is empty or not. This may be
  9464. // used to include empty fields in Patch requests.
  9465. ForceSendFields []string `json:"-"`
  9466. // NullFields is a list of field names (e.g. "Kind") to include in API
  9467. // requests with the JSON null value. By default, fields with empty
  9468. // values are omitted from API requests. However, any field with an
  9469. // empty value appearing in NullFields will be sent to the server as
  9470. // null. It is an error if a field in this list has a non-empty value.
  9471. // This may be used to include null fields in Patch requests.
  9472. NullFields []string `json:"-"`
  9473. }
  9474. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9475. type NoMethod RegionsListResponse
  9476. raw := NoMethod(*s)
  9477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9478. }
  9479. // RemarketingList: Contains properties of a remarketing list.
  9480. // Remarketing enables you to create lists of users who have performed
  9481. // specific actions on a site, then target ads to members of those
  9482. // lists. This resource can be used to manage remarketing lists that are
  9483. // owned by your advertisers. To see all remarketing lists that are
  9484. // visible to your advertisers, including those that are shared to your
  9485. // advertiser or account, use the TargetableRemarketingLists resource.
  9486. type RemarketingList struct {
  9487. // AccountId: Account ID of this remarketing list. This is a read-only,
  9488. // auto-generated field that is only returned in GET requests.
  9489. AccountId int64 `json:"accountId,omitempty,string"`
  9490. // Active: Whether this remarketing list is active.
  9491. Active bool `json:"active,omitempty"`
  9492. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9493. // remarketing list. This is a required field.
  9494. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9495. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9496. // advertiser. This is a read-only, auto-generated field.
  9497. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9498. // Description: Remarketing list description.
  9499. Description string `json:"description,omitempty"`
  9500. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9501. Id int64 `json:"id,omitempty,string"`
  9502. // Kind: Identifies what kind of resource this is. Value: the fixed
  9503. // string "dfareporting#remarketingList".
  9504. Kind string `json:"kind,omitempty"`
  9505. // LifeSpan: Number of days that a user should remain in the remarketing
  9506. // list without an impression. Acceptable values are 1 to 540,
  9507. // inclusive.
  9508. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9509. // ListPopulationRule: Rule used to populate the remarketing list with
  9510. // users.
  9511. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9512. // ListSize: Number of users currently in the list. This is a read-only
  9513. // field.
  9514. ListSize int64 `json:"listSize,omitempty,string"`
  9515. // ListSource: Product from which this remarketing list was originated.
  9516. //
  9517. // Possible values:
  9518. // "REMARKETING_LIST_SOURCE_ADX"
  9519. // "REMARKETING_LIST_SOURCE_DBM"
  9520. // "REMARKETING_LIST_SOURCE_DFA"
  9521. // "REMARKETING_LIST_SOURCE_DFP"
  9522. // "REMARKETING_LIST_SOURCE_DMP"
  9523. // "REMARKETING_LIST_SOURCE_GA"
  9524. // "REMARKETING_LIST_SOURCE_GPLUS"
  9525. // "REMARKETING_LIST_SOURCE_OTHER"
  9526. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9527. // "REMARKETING_LIST_SOURCE_XFP"
  9528. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9529. ListSource string `json:"listSource,omitempty"`
  9530. // Name: Name of the remarketing list. This is a required field. Must be
  9531. // no greater than 128 characters long.
  9532. Name string `json:"name,omitempty"`
  9533. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9534. // read-only, auto-generated field that is only returned in GET
  9535. // requests.
  9536. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9537. // ServerResponse contains the HTTP response code and headers from the
  9538. // server.
  9539. googleapi.ServerResponse `json:"-"`
  9540. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9541. // unconditionally include in API requests. By default, fields with
  9542. // empty values are omitted from API requests. However, any non-pointer,
  9543. // non-interface field appearing in ForceSendFields will be sent to the
  9544. // server regardless of whether the field is empty or not. This may be
  9545. // used to include empty fields in Patch requests.
  9546. ForceSendFields []string `json:"-"`
  9547. // NullFields is a list of field names (e.g. "AccountId") to include in
  9548. // API requests with the JSON null value. By default, fields with empty
  9549. // values are omitted from API requests. However, any field with an
  9550. // empty value appearing in NullFields will be sent to the server as
  9551. // null. It is an error if a field in this list has a non-empty value.
  9552. // This may be used to include null fields in Patch requests.
  9553. NullFields []string `json:"-"`
  9554. }
  9555. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9556. type NoMethod RemarketingList
  9557. raw := NoMethod(*s)
  9558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9559. }
  9560. // RemarketingListShare: Contains properties of a remarketing list's
  9561. // sharing information. Sharing allows other accounts or advertisers to
  9562. // target to your remarketing lists. This resource can be used to manage
  9563. // remarketing list sharing to other accounts and advertisers.
  9564. type RemarketingListShare struct {
  9565. // Kind: Identifies what kind of resource this is. Value: the fixed
  9566. // string "dfareporting#remarketingListShare".
  9567. Kind string `json:"kind,omitempty"`
  9568. // RemarketingListId: Remarketing list ID. This is a read-only,
  9569. // auto-generated field.
  9570. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9571. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9572. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9573. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9574. // with.
  9575. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9576. // ServerResponse contains the HTTP response code and headers from the
  9577. // server.
  9578. googleapi.ServerResponse `json:"-"`
  9579. // ForceSendFields is a list of field names (e.g. "Kind") to
  9580. // unconditionally include in API requests. By default, fields with
  9581. // empty values are omitted from API requests. However, any non-pointer,
  9582. // non-interface field appearing in ForceSendFields will be sent to the
  9583. // server regardless of whether the field is empty or not. This may be
  9584. // used to include empty fields in Patch requests.
  9585. ForceSendFields []string `json:"-"`
  9586. // NullFields is a list of field names (e.g. "Kind") to include in API
  9587. // requests with the JSON null value. By default, fields with empty
  9588. // values are omitted from API requests. However, any field with an
  9589. // empty value appearing in NullFields will be sent to the server as
  9590. // null. It is an error if a field in this list has a non-empty value.
  9591. // This may be used to include null fields in Patch requests.
  9592. NullFields []string `json:"-"`
  9593. }
  9594. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9595. type NoMethod RemarketingListShare
  9596. raw := NoMethod(*s)
  9597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9598. }
  9599. // RemarketingListsListResponse: Remarketing list response
  9600. type RemarketingListsListResponse struct {
  9601. // Kind: Identifies what kind of resource this is. Value: the fixed
  9602. // string "dfareporting#remarketingListsListResponse".
  9603. Kind string `json:"kind,omitempty"`
  9604. // NextPageToken: Pagination token to be used for the next list
  9605. // operation.
  9606. NextPageToken string `json:"nextPageToken,omitempty"`
  9607. // RemarketingLists: Remarketing list collection.
  9608. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9609. // ServerResponse contains the HTTP response code and headers from the
  9610. // server.
  9611. googleapi.ServerResponse `json:"-"`
  9612. // ForceSendFields is a list of field names (e.g. "Kind") to
  9613. // unconditionally include in API requests. By default, fields with
  9614. // empty values are omitted from API requests. However, any non-pointer,
  9615. // non-interface field appearing in ForceSendFields will be sent to the
  9616. // server regardless of whether the field is empty or not. This may be
  9617. // used to include empty fields in Patch requests.
  9618. ForceSendFields []string `json:"-"`
  9619. // NullFields is a list of field names (e.g. "Kind") to include in API
  9620. // requests with the JSON null value. By default, fields with empty
  9621. // values are omitted from API requests. However, any field with an
  9622. // empty value appearing in NullFields will be sent to the server as
  9623. // null. It is an error if a field in this list has a non-empty value.
  9624. // This may be used to include null fields in Patch requests.
  9625. NullFields []string `json:"-"`
  9626. }
  9627. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9628. type NoMethod RemarketingListsListResponse
  9629. raw := NoMethod(*s)
  9630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9631. }
  9632. // Report: Represents a Report resource.
  9633. type Report struct {
  9634. // AccountId: The account ID to which this report belongs.
  9635. AccountId int64 `json:"accountId,omitempty,string"`
  9636. // Criteria: The report criteria for a report of type "STANDARD".
  9637. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9638. // CrossDimensionReachCriteria: The report criteria for a report of type
  9639. // "CROSS_DIMENSION_REACH".
  9640. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9641. // Delivery: The report's email delivery settings.
  9642. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9643. // Etag: The eTag of this response for caching purposes.
  9644. Etag string `json:"etag,omitempty"`
  9645. // FileName: The filename used when generating report files for this
  9646. // report.
  9647. FileName string `json:"fileName,omitempty"`
  9648. // FloodlightCriteria: The report criteria for a report of type
  9649. // "FLOODLIGHT".
  9650. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9651. // Format: The output format of the report. If not specified, default
  9652. // format is "CSV". Note that the actual format in the completed report
  9653. // file might differ if for instance the report's size exceeds the
  9654. // format's capabilities. "CSV" will then be the fallback format.
  9655. //
  9656. // Possible values:
  9657. // "CSV"
  9658. // "EXCEL"
  9659. Format string `json:"format,omitempty"`
  9660. // Id: The unique ID identifying this report resource.
  9661. Id int64 `json:"id,omitempty,string"`
  9662. // Kind: The kind of resource this is, in this case dfareporting#report.
  9663. Kind string `json:"kind,omitempty"`
  9664. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9665. // this report was last modified.
  9666. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9667. // Name: The name of the report.
  9668. Name string `json:"name,omitempty"`
  9669. // OwnerProfileId: The user profile id of the owner of this report.
  9670. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9671. // PathToConversionCriteria: The report criteria for a report of type
  9672. // "PATH_TO_CONVERSION".
  9673. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9674. // ReachCriteria: The report criteria for a report of type "REACH".
  9675. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9676. // Schedule: The report's schedule. Can only be set if the report's
  9677. // 'dateRange' is a relative date range and the relative date range is
  9678. // not "TODAY".
  9679. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9680. // SubAccountId: The subaccount ID to which this report belongs if
  9681. // applicable.
  9682. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9683. // Type: The type of the report.
  9684. //
  9685. // Possible values:
  9686. // "CROSS_DIMENSION_REACH"
  9687. // "FLOODLIGHT"
  9688. // "PATH_TO_CONVERSION"
  9689. // "REACH"
  9690. // "STANDARD"
  9691. Type string `json:"type,omitempty"`
  9692. // ServerResponse contains the HTTP response code and headers from the
  9693. // server.
  9694. googleapi.ServerResponse `json:"-"`
  9695. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9696. // unconditionally include in API requests. By default, fields with
  9697. // empty values are omitted from API requests. However, any non-pointer,
  9698. // non-interface field appearing in ForceSendFields will be sent to the
  9699. // server regardless of whether the field is empty or not. This may be
  9700. // used to include empty fields in Patch requests.
  9701. ForceSendFields []string `json:"-"`
  9702. // NullFields is a list of field names (e.g. "AccountId") to include in
  9703. // API requests with the JSON null value. By default, fields with empty
  9704. // values are omitted from API requests. However, any field with an
  9705. // empty value appearing in NullFields will be sent to the server as
  9706. // null. It is an error if a field in this list has a non-empty value.
  9707. // This may be used to include null fields in Patch requests.
  9708. NullFields []string `json:"-"`
  9709. }
  9710. func (s *Report) MarshalJSON() ([]byte, error) {
  9711. type NoMethod Report
  9712. raw := NoMethod(*s)
  9713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9714. }
  9715. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9716. type ReportCriteria struct {
  9717. // Activities: Activity group.
  9718. Activities *Activities `json:"activities,omitempty"`
  9719. // CustomRichMediaEvents: Custom Rich Media Events group.
  9720. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9721. // DateRange: The date range for which this report should be run.
  9722. DateRange *DateRange `json:"dateRange,omitempty"`
  9723. // DimensionFilters: The list of filters on which dimensions are
  9724. // filtered.
  9725. // Filters for different dimensions are ANDed, filters for the same
  9726. // dimension are grouped together and ORed.
  9727. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9728. // Dimensions: The list of standard dimensions the report should
  9729. // include.
  9730. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9731. // MetricNames: The list of names of metrics the report should include.
  9732. MetricNames []string `json:"metricNames,omitempty"`
  9733. // ForceSendFields is a list of field names (e.g. "Activities") to
  9734. // unconditionally include in API requests. By default, fields with
  9735. // empty values are omitted from API requests. However, any non-pointer,
  9736. // non-interface field appearing in ForceSendFields will be sent to the
  9737. // server regardless of whether the field is empty or not. This may be
  9738. // used to include empty fields in Patch requests.
  9739. ForceSendFields []string `json:"-"`
  9740. // NullFields is a list of field names (e.g. "Activities") to include in
  9741. // API requests with the JSON null value. By default, fields with empty
  9742. // values are omitted from API requests. However, any field with an
  9743. // empty value appearing in NullFields will be sent to the server as
  9744. // null. It is an error if a field in this list has a non-empty value.
  9745. // This may be used to include null fields in Patch requests.
  9746. NullFields []string `json:"-"`
  9747. }
  9748. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9749. type NoMethod ReportCriteria
  9750. raw := NoMethod(*s)
  9751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9752. }
  9753. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9754. // of type "CROSS_DIMENSION_REACH".
  9755. type ReportCrossDimensionReachCriteria struct {
  9756. // Breakdown: The list of dimensions the report should include.
  9757. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9758. // DateRange: The date range this report should be run for.
  9759. DateRange *DateRange `json:"dateRange,omitempty"`
  9760. // Dimension: The dimension option.
  9761. //
  9762. // Possible values:
  9763. // "ADVERTISER"
  9764. // "CAMPAIGN"
  9765. // "SITE_BY_ADVERTISER"
  9766. // "SITE_BY_CAMPAIGN"
  9767. Dimension string `json:"dimension,omitempty"`
  9768. // DimensionFilters: The list of filters on which dimensions are
  9769. // filtered.
  9770. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9771. // MetricNames: The list of names of metrics the report should include.
  9772. MetricNames []string `json:"metricNames,omitempty"`
  9773. // OverlapMetricNames: The list of names of overlap metrics the report
  9774. // should include.
  9775. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9776. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9777. Pivoted bool `json:"pivoted,omitempty"`
  9778. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9779. // unconditionally include in API requests. By default, fields with
  9780. // empty values are omitted from API requests. However, any non-pointer,
  9781. // non-interface field appearing in ForceSendFields will be sent to the
  9782. // server regardless of whether the field is empty or not. This may be
  9783. // used to include empty fields in Patch requests.
  9784. ForceSendFields []string `json:"-"`
  9785. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9786. // API requests with the JSON null value. By default, fields with empty
  9787. // values are omitted from API requests. However, any field with an
  9788. // empty value appearing in NullFields will be sent to the server as
  9789. // null. It is an error if a field in this list has a non-empty value.
  9790. // This may be used to include null fields in Patch requests.
  9791. NullFields []string `json:"-"`
  9792. }
  9793. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9794. type NoMethod ReportCrossDimensionReachCriteria
  9795. raw := NoMethod(*s)
  9796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9797. }
  9798. // ReportDelivery: The report's email delivery settings.
  9799. type ReportDelivery struct {
  9800. // EmailOwner: Whether the report should be emailed to the report owner.
  9801. EmailOwner bool `json:"emailOwner,omitempty"`
  9802. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9803. // receive, if enabled.
  9804. //
  9805. // Possible values:
  9806. // "ATTACHMENT"
  9807. // "LINK"
  9808. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9809. // Message: The message to be sent with each email.
  9810. Message string `json:"message,omitempty"`
  9811. // Recipients: The list of recipients to which to email the report.
  9812. Recipients []*Recipient `json:"recipients,omitempty"`
  9813. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9814. // unconditionally include in API requests. By default, fields with
  9815. // empty values are omitted from API requests. However, any non-pointer,
  9816. // non-interface field appearing in ForceSendFields will be sent to the
  9817. // server regardless of whether the field is empty or not. This may be
  9818. // used to include empty fields in Patch requests.
  9819. ForceSendFields []string `json:"-"`
  9820. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9821. // API requests with the JSON null value. By default, fields with empty
  9822. // values are omitted from API requests. However, any field with an
  9823. // empty value appearing in NullFields will be sent to the server as
  9824. // null. It is an error if a field in this list has a non-empty value.
  9825. // This may be used to include null fields in Patch requests.
  9826. NullFields []string `json:"-"`
  9827. }
  9828. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9829. type NoMethod ReportDelivery
  9830. raw := NoMethod(*s)
  9831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9832. }
  9833. // ReportFloodlightCriteria: The report criteria for a report of type
  9834. // "FLOODLIGHT".
  9835. type ReportFloodlightCriteria struct {
  9836. // CustomRichMediaEvents: The list of custom rich media events to
  9837. // include.
  9838. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9839. // DateRange: The date range this report should be run for.
  9840. DateRange *DateRange `json:"dateRange,omitempty"`
  9841. // DimensionFilters: The list of filters on which dimensions are
  9842. // filtered.
  9843. // Filters for different dimensions are ANDed, filters for the same
  9844. // dimension are grouped together and ORed.
  9845. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9846. // Dimensions: The list of dimensions the report should include.
  9847. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9848. // FloodlightConfigId: The floodlight ID for which to show data in this
  9849. // report. All advertisers associated with that ID will automatically be
  9850. // added. The dimension of the value needs to be
  9851. // 'dfa:floodlightConfigId'.
  9852. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9853. // MetricNames: The list of names of metrics the report should include.
  9854. MetricNames []string `json:"metricNames,omitempty"`
  9855. // ReportProperties: The properties of the report.
  9856. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9857. // ForceSendFields is a list of field names (e.g.
  9858. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9859. // By default, fields with empty values are omitted from API requests.
  9860. // However, any non-pointer, non-interface field appearing in
  9861. // ForceSendFields will be sent to the server regardless of whether the
  9862. // field is empty or not. This may be used to include empty fields in
  9863. // Patch requests.
  9864. ForceSendFields []string `json:"-"`
  9865. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9866. // include in API requests with the JSON null value. By default, fields
  9867. // with empty values are omitted from API requests. However, any field
  9868. // with an empty value appearing in NullFields will be sent to the
  9869. // server as null. It is an error if a field in this list has a
  9870. // non-empty value. This may be used to include null fields in Patch
  9871. // requests.
  9872. NullFields []string `json:"-"`
  9873. }
  9874. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9875. type NoMethod ReportFloodlightCriteria
  9876. raw := NoMethod(*s)
  9877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9878. }
  9879. // ReportFloodlightCriteriaReportProperties: The properties of the
  9880. // report.
  9881. type ReportFloodlightCriteriaReportProperties struct {
  9882. // IncludeAttributedIPConversions: Include conversions that have no
  9883. // cookie, but do have an exposure path.
  9884. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9885. // IncludeUnattributedCookieConversions: Include conversions of users
  9886. // with a DoubleClick cookie but without an exposure. That means the
  9887. // user did not click or see an ad from the advertiser within the
  9888. // Floodlight group, or that the interaction happened outside the
  9889. // lookback window.
  9890. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9891. // IncludeUnattributedIPConversions: Include conversions that have no
  9892. // associated cookies and no exposures. It’s therefore impossible to
  9893. // know how the user was exposed to your ads during the lookback window
  9894. // prior to a conversion.
  9895. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9896. // ForceSendFields is a list of field names (e.g.
  9897. // "IncludeAttributedIPConversions") to unconditionally include in API
  9898. // requests. By default, fields with empty values are omitted from API
  9899. // requests. However, any non-pointer, non-interface field appearing in
  9900. // ForceSendFields will be sent to the server regardless of whether the
  9901. // field is empty or not. This may be used to include empty fields in
  9902. // Patch requests.
  9903. ForceSendFields []string `json:"-"`
  9904. // NullFields is a list of field names (e.g.
  9905. // "IncludeAttributedIPConversions") to include in API requests with the
  9906. // JSON null value. By default, fields with empty values are omitted
  9907. // from API requests. However, any field with an empty value appearing
  9908. // in NullFields will be sent to the server as null. It is an error if a
  9909. // field in this list has a non-empty value. This may be used to include
  9910. // null fields in Patch requests.
  9911. NullFields []string `json:"-"`
  9912. }
  9913. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9914. type NoMethod ReportFloodlightCriteriaReportProperties
  9915. raw := NoMethod(*s)
  9916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9917. }
  9918. // ReportPathToConversionCriteria: The report criteria for a report of
  9919. // type "PATH_TO_CONVERSION".
  9920. type ReportPathToConversionCriteria struct {
  9921. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9922. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9923. // ConversionDimensions: The list of conversion dimensions the report
  9924. // should include.
  9925. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9926. // CustomFloodlightVariables: The list of custom floodlight variables
  9927. // the report should include.
  9928. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9929. // CustomRichMediaEvents: The list of custom rich media events to
  9930. // include.
  9931. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9932. // DateRange: The date range this report should be run for.
  9933. DateRange *DateRange `json:"dateRange,omitempty"`
  9934. // FloodlightConfigId: The floodlight ID for which to show data in this
  9935. // report. All advertisers associated with that ID will automatically be
  9936. // added. The dimension of the value needs to be
  9937. // 'dfa:floodlightConfigId'.
  9938. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9939. // MetricNames: The list of names of metrics the report should include.
  9940. MetricNames []string `json:"metricNames,omitempty"`
  9941. // PerInteractionDimensions: The list of per interaction dimensions the
  9942. // report should include.
  9943. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9944. // ReportProperties: The properties of the report.
  9945. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9946. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9947. // unconditionally include in API requests. By default, fields with
  9948. // empty values are omitted from API requests. However, any non-pointer,
  9949. // non-interface field appearing in ForceSendFields will be sent to the
  9950. // server regardless of whether the field is empty or not. This may be
  9951. // used to include empty fields in Patch requests.
  9952. ForceSendFields []string `json:"-"`
  9953. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9954. // include in API requests with the JSON null value. By default, fields
  9955. // with empty values are omitted from API requests. However, any field
  9956. // with an empty value appearing in NullFields will be sent to the
  9957. // server as null. It is an error if a field in this list has a
  9958. // non-empty value. This may be used to include null fields in Patch
  9959. // requests.
  9960. NullFields []string `json:"-"`
  9961. }
  9962. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9963. type NoMethod ReportPathToConversionCriteria
  9964. raw := NoMethod(*s)
  9965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9966. }
  9967. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9968. // report.
  9969. type ReportPathToConversionCriteriaReportProperties struct {
  9970. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9971. // occurred within the specified period of time before a conversion. By
  9972. // default the value is pulled from Floodlight or you can manually enter
  9973. // a custom value. Valid values: 1-90.
  9974. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9975. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9976. // interaction occurred within the specified period of time before a
  9977. // conversion. By default the value is pulled from Floodlight or you can
  9978. // manually enter a custom value. Valid values: 1-90.
  9979. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9980. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9981. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9982. // IncludeUnattributedCookieConversions: Include conversions of users
  9983. // with a DoubleClick cookie but without an exposure. That means the
  9984. // user did not click or see an ad from the advertiser within the
  9985. // Floodlight group, or that the interaction happened outside the
  9986. // lookback window.
  9987. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9988. // IncludeUnattributedIPConversions: Include conversions that have no
  9989. // associated cookies and no exposures. It’s therefore impossible to
  9990. // know how the user was exposed to your ads during the lookback window
  9991. // prior to a conversion.
  9992. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9993. // MaximumClickInteractions: The maximum number of click interactions to
  9994. // include in the report. Advertisers currently paying for E2C reports
  9995. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9996. // your network is paying for E2C, you can have up to 5 total exposures
  9997. // per report.
  9998. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9999. // MaximumImpressionInteractions: The maximum number of click
  10000. // interactions to include in the report. Advertisers currently paying
  10001. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  10002. // another advertiser in your network is paying for E2C, you can have up
  10003. // to 5 total exposures per report.
  10004. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  10005. // MaximumInteractionGap: The maximum amount of time that can take place
  10006. // between interactions (clicks or impressions) by the same user. Valid
  10007. // values: 1-90.
  10008. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  10009. // PivotOnInteractionPath: Enable pivoting on interaction path.
  10010. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  10011. // ForceSendFields is a list of field names (e.g.
  10012. // "ClicksLookbackWindow") to unconditionally include in API requests.
  10013. // By default, fields with empty values are omitted from API requests.
  10014. // However, any non-pointer, non-interface field appearing in
  10015. // ForceSendFields will be sent to the server regardless of whether the
  10016. // field is empty or not. This may be used to include empty fields in
  10017. // Patch requests.
  10018. ForceSendFields []string `json:"-"`
  10019. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  10020. // include in API requests with the JSON null value. By default, fields
  10021. // with empty values are omitted from API requests. However, any field
  10022. // with an empty value appearing in NullFields will be sent to the
  10023. // server as null. It is an error if a field in this list has a
  10024. // non-empty value. This may be used to include null fields in Patch
  10025. // requests.
  10026. NullFields []string `json:"-"`
  10027. }
  10028. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  10029. type NoMethod ReportPathToConversionCriteriaReportProperties
  10030. raw := NoMethod(*s)
  10031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10032. }
  10033. // ReportReachCriteria: The report criteria for a report of type
  10034. // "REACH".
  10035. type ReportReachCriteria struct {
  10036. // Activities: Activity group.
  10037. Activities *Activities `json:"activities,omitempty"`
  10038. // CustomRichMediaEvents: Custom Rich Media Events group.
  10039. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  10040. // DateRange: The date range this report should be run for.
  10041. DateRange *DateRange `json:"dateRange,omitempty"`
  10042. // DimensionFilters: The list of filters on which dimensions are
  10043. // filtered.
  10044. // Filters for different dimensions are ANDed, filters for the same
  10045. // dimension are grouped together and ORed.
  10046. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  10047. // Dimensions: The list of dimensions the report should include.
  10048. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  10049. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  10050. // combinations in the report. Defaults to false. If enabled, the date
  10051. // range of the report should be within the last 42 days.
  10052. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  10053. // MetricNames: The list of names of metrics the report should include.
  10054. MetricNames []string `json:"metricNames,omitempty"`
  10055. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  10056. // metrics the report should include.
  10057. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  10058. // ForceSendFields is a list of field names (e.g. "Activities") to
  10059. // unconditionally include in API requests. By default, fields with
  10060. // empty values are omitted from API requests. However, any non-pointer,
  10061. // non-interface field appearing in ForceSendFields will be sent to the
  10062. // server regardless of whether the field is empty or not. This may be
  10063. // used to include empty fields in Patch requests.
  10064. ForceSendFields []string `json:"-"`
  10065. // NullFields is a list of field names (e.g. "Activities") to include in
  10066. // API requests with the JSON null value. By default, fields with empty
  10067. // values are omitted from API requests. However, any field with an
  10068. // empty value appearing in NullFields will be sent to the server as
  10069. // null. It is an error if a field in this list has a non-empty value.
  10070. // This may be used to include null fields in Patch requests.
  10071. NullFields []string `json:"-"`
  10072. }
  10073. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  10074. type NoMethod ReportReachCriteria
  10075. raw := NoMethod(*s)
  10076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10077. }
  10078. // ReportSchedule: The report's schedule. Can only be set if the
  10079. // report's 'dateRange' is a relative date range and the relative date
  10080. // range is not "TODAY".
  10081. type ReportSchedule struct {
  10082. // Active: Whether the schedule is active or not. Must be set to either
  10083. // true or false.
  10084. Active bool `json:"active,omitempty"`
  10085. // Every: Defines every how many days, weeks or months the report should
  10086. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  10087. // "MONTHLY".
  10088. Every int64 `json:"every,omitempty"`
  10089. // ExpirationDate: The expiration date when the scheduled report stops
  10090. // running.
  10091. ExpirationDate string `json:"expirationDate,omitempty"`
  10092. // Repeats: The interval for which the report is repeated. Note:
  10093. // - "DAILY" also requires field "every" to be set.
  10094. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  10095. // set.
  10096. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  10097. // set.
  10098. Repeats string `json:"repeats,omitempty"`
  10099. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  10100. // reports should run.
  10101. //
  10102. // Possible values:
  10103. // "FRIDAY"
  10104. // "MONDAY"
  10105. // "SATURDAY"
  10106. // "SUNDAY"
  10107. // "THURSDAY"
  10108. // "TUESDAY"
  10109. // "WEDNESDAY"
  10110. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  10111. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  10112. // whether reports should be repeated on the same day of the month as
  10113. // "startDate" or the same day of the week of the month.
  10114. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  10115. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  10116. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  10117. // Monday of the month.
  10118. //
  10119. // Possible values:
  10120. // "DAY_OF_MONTH"
  10121. // "WEEK_OF_MONTH"
  10122. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  10123. // StartDate: Start date of date range for which scheduled reports
  10124. // should be run.
  10125. StartDate string `json:"startDate,omitempty"`
  10126. // ForceSendFields is a list of field names (e.g. "Active") to
  10127. // unconditionally include in API requests. By default, fields with
  10128. // empty values are omitted from API requests. However, any non-pointer,
  10129. // non-interface field appearing in ForceSendFields will be sent to the
  10130. // server regardless of whether the field is empty or not. This may be
  10131. // used to include empty fields in Patch requests.
  10132. ForceSendFields []string `json:"-"`
  10133. // NullFields is a list of field names (e.g. "Active") to include in API
  10134. // requests with the JSON null value. By default, fields with empty
  10135. // values are omitted from API requests. However, any field with an
  10136. // empty value appearing in NullFields will be sent to the server as
  10137. // null. It is an error if a field in this list has a non-empty value.
  10138. // This may be used to include null fields in Patch requests.
  10139. NullFields []string `json:"-"`
  10140. }
  10141. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  10142. type NoMethod ReportSchedule
  10143. raw := NoMethod(*s)
  10144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10145. }
  10146. // ReportCompatibleFields: Represents fields that are compatible to be
  10147. // selected for a report of type "STANDARD".
  10148. type ReportCompatibleFields struct {
  10149. // DimensionFilters: Dimensions which are compatible to be selected in
  10150. // the "dimensionFilters" section of the report.
  10151. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  10152. // Dimensions: Dimensions which are compatible to be selected in the
  10153. // "dimensions" section of the report.
  10154. Dimensions []*Dimension `json:"dimensions,omitempty"`
  10155. // Kind: The kind of resource this is, in this case
  10156. // dfareporting#reportCompatibleFields.
  10157. Kind string `json:"kind,omitempty"`
  10158. // Metrics: Metrics which are compatible to be selected in the
  10159. // "metricNames" section of the report.
  10160. Metrics []*Metric `json:"metrics,omitempty"`
  10161. // PivotedActivityMetrics: Metrics which are compatible to be selected
  10162. // as activity metrics to pivot on in the "activities" section of the
  10163. // report.
  10164. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  10165. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  10166. // unconditionally include in API requests. By default, fields with
  10167. // empty values are omitted from API requests. However, any non-pointer,
  10168. // non-interface field appearing in ForceSendFields will be sent to the
  10169. // server regardless of whether the field is empty or not. This may be
  10170. // used to include empty fields in Patch requests.
  10171. ForceSendFields []string `json:"-"`
  10172. // NullFields is a list of field names (e.g. "DimensionFilters") to
  10173. // include in API requests with the JSON null value. By default, fields
  10174. // with empty values are omitted from API requests. However, any field
  10175. // with an empty value appearing in NullFields will be sent to the
  10176. // server as null. It is an error if a field in this list has a
  10177. // non-empty value. This may be used to include null fields in Patch
  10178. // requests.
  10179. NullFields []string `json:"-"`
  10180. }
  10181. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  10182. type NoMethod ReportCompatibleFields
  10183. raw := NoMethod(*s)
  10184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10185. }
  10186. // ReportList: Represents the list of reports.
  10187. type ReportList struct {
  10188. // Etag: The eTag of this response for caching purposes.
  10189. Etag string `json:"etag,omitempty"`
  10190. // Items: The reports returned in this response.
  10191. Items []*Report `json:"items,omitempty"`
  10192. // Kind: The kind of list this is, in this case dfareporting#reportList.
  10193. Kind string `json:"kind,omitempty"`
  10194. // NextPageToken: Continuation token used to page through reports. To
  10195. // retrieve the next page of results, set the next request's "pageToken"
  10196. // to the value of this field. The page token is only valid for a
  10197. // limited amount of time and should not be persisted.
  10198. NextPageToken string `json:"nextPageToken,omitempty"`
  10199. // ServerResponse contains the HTTP response code and headers from the
  10200. // server.
  10201. googleapi.ServerResponse `json:"-"`
  10202. // ForceSendFields is a list of field names (e.g. "Etag") to
  10203. // unconditionally include in API requests. By default, fields with
  10204. // empty values are omitted from API requests. However, any non-pointer,
  10205. // non-interface field appearing in ForceSendFields will be sent to the
  10206. // server regardless of whether the field is empty or not. This may be
  10207. // used to include empty fields in Patch requests.
  10208. ForceSendFields []string `json:"-"`
  10209. // NullFields is a list of field names (e.g. "Etag") to include in API
  10210. // requests with the JSON null value. By default, fields with empty
  10211. // values are omitted from API requests. However, any field with an
  10212. // empty value appearing in NullFields will be sent to the server as
  10213. // null. It is an error if a field in this list has a non-empty value.
  10214. // This may be used to include null fields in Patch requests.
  10215. NullFields []string `json:"-"`
  10216. }
  10217. func (s *ReportList) MarshalJSON() ([]byte, error) {
  10218. type NoMethod ReportList
  10219. raw := NoMethod(*s)
  10220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10221. }
  10222. // ReportsConfiguration: Reporting Configuration
  10223. type ReportsConfiguration struct {
  10224. // ExposureToConversionEnabled: Whether the exposure to conversion
  10225. // report is enabled. This report shows detailed pathway information on
  10226. // up to 10 of the most recent ad exposures seen by a user before
  10227. // converting.
  10228. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  10229. // LookbackConfiguration: Default lookback windows for new advertisers
  10230. // in this account.
  10231. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10232. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  10233. // account. This is a required field that can only be changed by a
  10234. // superuser.
  10235. // Acceptable values are:
  10236. //
  10237. // - "1" for "America/New_York"
  10238. // - "2" for "Europe/London"
  10239. // - "3" for "Europe/Paris"
  10240. // - "4" for "Africa/Johannesburg"
  10241. // - "5" for "Asia/Jerusalem"
  10242. // - "6" for "Asia/Shanghai"
  10243. // - "7" for "Asia/Hong_Kong"
  10244. // - "8" for "Asia/Tokyo"
  10245. // - "9" for "Australia/Sydney"
  10246. // - "10" for "Asia/Dubai"
  10247. // - "11" for "America/Los_Angeles"
  10248. // - "12" for "Pacific/Auckland"
  10249. // - "13" for "America/Sao_Paulo"
  10250. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  10251. // ForceSendFields is a list of field names (e.g.
  10252. // "ExposureToConversionEnabled") to unconditionally include in API
  10253. // requests. By default, fields with empty values are omitted from API
  10254. // requests. However, any non-pointer, non-interface field appearing in
  10255. // ForceSendFields will be sent to the server regardless of whether the
  10256. // field is empty or not. This may be used to include empty fields in
  10257. // Patch requests.
  10258. ForceSendFields []string `json:"-"`
  10259. // NullFields is a list of field names (e.g.
  10260. // "ExposureToConversionEnabled") to include in API requests with the
  10261. // JSON null value. By default, fields with empty values are omitted
  10262. // from API requests. However, any field with an empty value appearing
  10263. // in NullFields will be sent to the server as null. It is an error if a
  10264. // field in this list has a non-empty value. This may be used to include
  10265. // null fields in Patch requests.
  10266. NullFields []string `json:"-"`
  10267. }
  10268. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  10269. type NoMethod ReportsConfiguration
  10270. raw := NoMethod(*s)
  10271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10272. }
  10273. // RichMediaExitOverride: Rich Media Exit Override.
  10274. type RichMediaExitOverride struct {
  10275. // ClickThroughUrl: Click-through URL of this rich media exit override.
  10276. // Applicable if the enabled field is set to true.
  10277. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  10278. // Enabled: Whether to use the clickThroughUrl. If false, the
  10279. // creative-level exit will be used.
  10280. Enabled bool `json:"enabled,omitempty"`
  10281. // ExitId: ID for the override to refer to a specific exit in the
  10282. // creative.
  10283. ExitId int64 `json:"exitId,omitempty,string"`
  10284. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  10285. // unconditionally include in API requests. By default, fields with
  10286. // empty values are omitted from API requests. However, any non-pointer,
  10287. // non-interface field appearing in ForceSendFields will be sent to the
  10288. // server regardless of whether the field is empty or not. This may be
  10289. // used to include empty fields in Patch requests.
  10290. ForceSendFields []string `json:"-"`
  10291. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  10292. // include in API requests with the JSON null value. By default, fields
  10293. // with empty values are omitted from API requests. However, any field
  10294. // with an empty value appearing in NullFields will be sent to the
  10295. // server as null. It is an error if a field in this list has a
  10296. // non-empty value. This may be used to include null fields in Patch
  10297. // requests.
  10298. NullFields []string `json:"-"`
  10299. }
  10300. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  10301. type NoMethod RichMediaExitOverride
  10302. raw := NoMethod(*s)
  10303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10304. }
  10305. // Rule: A rule associates an asset with a targeting template for
  10306. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  10307. type Rule struct {
  10308. // AssetId: A creativeAssets[].id. This should refer to one of the
  10309. // parent assets in this creative. This is a required field.
  10310. AssetId int64 `json:"assetId,omitempty,string"`
  10311. // Name: A user-friendly name for this rule. This is a required field.
  10312. Name string `json:"name,omitempty"`
  10313. // TargetingTemplateId: A targeting template ID. The targeting from the
  10314. // targeting template will be used to determine whether this asset
  10315. // should be served. This is a required field.
  10316. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  10317. // ForceSendFields is a list of field names (e.g. "AssetId") to
  10318. // unconditionally include in API requests. By default, fields with
  10319. // empty values are omitted from API requests. However, any non-pointer,
  10320. // non-interface field appearing in ForceSendFields will be sent to the
  10321. // server regardless of whether the field is empty or not. This may be
  10322. // used to include empty fields in Patch requests.
  10323. ForceSendFields []string `json:"-"`
  10324. // NullFields is a list of field names (e.g. "AssetId") to include in
  10325. // API requests with the JSON null value. By default, fields with empty
  10326. // values are omitted from API requests. However, any field with an
  10327. // empty value appearing in NullFields will be sent to the server as
  10328. // null. It is an error if a field in this list has a non-empty value.
  10329. // This may be used to include null fields in Patch requests.
  10330. NullFields []string `json:"-"`
  10331. }
  10332. func (s *Rule) MarshalJSON() ([]byte, error) {
  10333. type NoMethod Rule
  10334. raw := NoMethod(*s)
  10335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10336. }
  10337. // Site: Contains properties of a site.
  10338. type Site struct {
  10339. // AccountId: Account ID of this site. This is a read-only field that
  10340. // can be left blank.
  10341. AccountId int64 `json:"accountId,omitempty,string"`
  10342. // Approved: Whether this site is approved.
  10343. Approved bool `json:"approved,omitempty"`
  10344. // DirectorySiteId: Directory site associated with this site. This is a
  10345. // required field that is read-only after insertion.
  10346. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  10347. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  10348. // directory site. This is a read-only, auto-generated field.
  10349. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  10350. // Id: ID of this site. This is a read-only, auto-generated field.
  10351. Id int64 `json:"id,omitempty,string"`
  10352. // IdDimensionValue: Dimension value for the ID of this site. This is a
  10353. // read-only, auto-generated field.
  10354. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  10355. // KeyName: Key name of this site. This is a read-only, auto-generated
  10356. // field.
  10357. KeyName string `json:"keyName,omitempty"`
  10358. // Kind: Identifies what kind of resource this is. Value: the fixed
  10359. // string "dfareporting#site".
  10360. Kind string `json:"kind,omitempty"`
  10361. // Name: Name of this site.This is a required field. Must be less than
  10362. // 128 characters long. If this site is under a subaccount, the name
  10363. // must be unique among sites of the same subaccount. Otherwise, this
  10364. // site is a top-level site, and the name must be unique among top-level
  10365. // sites of the same account.
  10366. Name string `json:"name,omitempty"`
  10367. // SiteContacts: Site contacts.
  10368. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  10369. // SiteSettings: Site-wide settings.
  10370. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  10371. // SubaccountId: Subaccount ID of this site. This is a read-only field
  10372. // that can be left blank.
  10373. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10374. // ServerResponse contains the HTTP response code and headers from the
  10375. // server.
  10376. googleapi.ServerResponse `json:"-"`
  10377. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10378. // unconditionally include in API requests. By default, fields with
  10379. // empty values are omitted from API requests. However, any non-pointer,
  10380. // non-interface field appearing in ForceSendFields will be sent to the
  10381. // server regardless of whether the field is empty or not. This may be
  10382. // used to include empty fields in Patch requests.
  10383. ForceSendFields []string `json:"-"`
  10384. // NullFields is a list of field names (e.g. "AccountId") to include in
  10385. // API requests with the JSON null value. By default, fields with empty
  10386. // values are omitted from API requests. However, any field with an
  10387. // empty value appearing in NullFields will be sent to the server as
  10388. // null. It is an error if a field in this list has a non-empty value.
  10389. // This may be used to include null fields in Patch requests.
  10390. NullFields []string `json:"-"`
  10391. }
  10392. func (s *Site) MarshalJSON() ([]byte, error) {
  10393. type NoMethod Site
  10394. raw := NoMethod(*s)
  10395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10396. }
  10397. // SiteContact: Site Contact
  10398. type SiteContact struct {
  10399. // Address: Address of this site contact.
  10400. Address string `json:"address,omitempty"`
  10401. // ContactType: Site contact type.
  10402. //
  10403. // Possible values:
  10404. // "SALES_PERSON"
  10405. // "TRAFFICKER"
  10406. ContactType string `json:"contactType,omitempty"`
  10407. // Email: Email address of this site contact. This is a required field.
  10408. Email string `json:"email,omitempty"`
  10409. // FirstName: First name of this site contact.
  10410. FirstName string `json:"firstName,omitempty"`
  10411. // Id: ID of this site contact. This is a read-only, auto-generated
  10412. // field.
  10413. Id int64 `json:"id,omitempty,string"`
  10414. // LastName: Last name of this site contact.
  10415. LastName string `json:"lastName,omitempty"`
  10416. // Phone: Primary phone number of this site contact.
  10417. Phone string `json:"phone,omitempty"`
  10418. // Title: Title or designation of this site contact.
  10419. Title string `json:"title,omitempty"`
  10420. // ForceSendFields is a list of field names (e.g. "Address") to
  10421. // unconditionally include in API requests. By default, fields with
  10422. // empty values are omitted from API requests. However, any non-pointer,
  10423. // non-interface field appearing in ForceSendFields will be sent to the
  10424. // server regardless of whether the field is empty or not. This may be
  10425. // used to include empty fields in Patch requests.
  10426. ForceSendFields []string `json:"-"`
  10427. // NullFields is a list of field names (e.g. "Address") to include in
  10428. // API requests with the JSON null value. By default, fields with empty
  10429. // values are omitted from API requests. However, any field with an
  10430. // empty value appearing in NullFields will be sent to the server as
  10431. // null. It is an error if a field in this list has a non-empty value.
  10432. // This may be used to include null fields in Patch requests.
  10433. NullFields []string `json:"-"`
  10434. }
  10435. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10436. type NoMethod SiteContact
  10437. raw := NoMethod(*s)
  10438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10439. }
  10440. // SiteSettings: Site Settings
  10441. type SiteSettings struct {
  10442. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10443. // site.
  10444. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10445. // AdBlockingOptOut: Whether this site opts out of ad blocking. When
  10446. // true, ad blocking is disabled for all placements under the site,
  10447. // regardless of the individual placement settings. When false, the
  10448. // campaign and placement settings take effect.
  10449. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  10450. // CreativeSettings: Site-wide creative settings.
  10451. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10452. // DisableNewCookie: Whether new cookies are disabled for this site.
  10453. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10454. // LookbackConfiguration: Lookback window settings for this site.
  10455. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10456. // TagSetting: Configuration settings for dynamic and image floodlight
  10457. // tags.
  10458. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10459. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10460. // for in-stream video creatives are disabled by default for new
  10461. // placements created under this site. This value will be used to
  10462. // populate the placement.videoActiveViewOptOut field, when no value is
  10463. // specified for the new placement.
  10464. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10465. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10466. // placements created under this site. This value will be used to
  10467. // populate the placements.vpaidAdapterChoice field, when no value is
  10468. // specified for the new placement. Controls which VPAID format the
  10469. // measurement adapter will use for in-stream video creatives assigned
  10470. // to the placement. The publisher's specifications will typically
  10471. // determine this setting. For VPAID creatives, the adapter format will
  10472. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10473. // adapter).
  10474. //
  10475. // Note: Flash is no longer supported. This field now defaults to HTML5
  10476. // when the following values are provided: FLASH, BOTH.
  10477. //
  10478. // Possible values:
  10479. // "BOTH"
  10480. // "DEFAULT"
  10481. // "FLASH"
  10482. // "HTML5"
  10483. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10484. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10485. // unconditionally include in API requests. By default, fields with
  10486. // empty values are omitted from API requests. However, any non-pointer,
  10487. // non-interface field appearing in ForceSendFields will be sent to the
  10488. // server regardless of whether the field is empty or not. This may be
  10489. // used to include empty fields in Patch requests.
  10490. ForceSendFields []string `json:"-"`
  10491. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10492. // include in API requests with the JSON null value. By default, fields
  10493. // with empty values are omitted from API requests. However, any field
  10494. // with an empty value appearing in NullFields will be sent to the
  10495. // server as null. It is an error if a field in this list has a
  10496. // non-empty value. This may be used to include null fields in Patch
  10497. // requests.
  10498. NullFields []string `json:"-"`
  10499. }
  10500. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10501. type NoMethod SiteSettings
  10502. raw := NoMethod(*s)
  10503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10504. }
  10505. // SitesListResponse: Site List Response
  10506. type SitesListResponse struct {
  10507. // Kind: Identifies what kind of resource this is. Value: the fixed
  10508. // string "dfareporting#sitesListResponse".
  10509. Kind string `json:"kind,omitempty"`
  10510. // NextPageToken: Pagination token to be used for the next list
  10511. // operation.
  10512. NextPageToken string `json:"nextPageToken,omitempty"`
  10513. // Sites: Site collection.
  10514. Sites []*Site `json:"sites,omitempty"`
  10515. // ServerResponse contains the HTTP response code and headers from the
  10516. // server.
  10517. googleapi.ServerResponse `json:"-"`
  10518. // ForceSendFields is a list of field names (e.g. "Kind") to
  10519. // unconditionally include in API requests. By default, fields with
  10520. // empty values are omitted from API requests. However, any non-pointer,
  10521. // non-interface field appearing in ForceSendFields will be sent to the
  10522. // server regardless of whether the field is empty or not. This may be
  10523. // used to include empty fields in Patch requests.
  10524. ForceSendFields []string `json:"-"`
  10525. // NullFields is a list of field names (e.g. "Kind") to include in API
  10526. // requests with the JSON null value. By default, fields with empty
  10527. // values are omitted from API requests. However, any field with an
  10528. // empty value appearing in NullFields will be sent to the server as
  10529. // null. It is an error if a field in this list has a non-empty value.
  10530. // This may be used to include null fields in Patch requests.
  10531. NullFields []string `json:"-"`
  10532. }
  10533. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10534. type NoMethod SitesListResponse
  10535. raw := NoMethod(*s)
  10536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10537. }
  10538. // Size: Represents the dimensions of ads, placements, creatives, or
  10539. // creative assets.
  10540. type Size struct {
  10541. // Height: Height of this size. Acceptable values are 0 to 32767,
  10542. // inclusive.
  10543. Height int64 `json:"height,omitempty"`
  10544. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10545. Iab bool `json:"iab,omitempty"`
  10546. // Id: ID of this size. This is a read-only, auto-generated field.
  10547. Id int64 `json:"id,omitempty,string"`
  10548. // Kind: Identifies what kind of resource this is. Value: the fixed
  10549. // string "dfareporting#size".
  10550. Kind string `json:"kind,omitempty"`
  10551. // Width: Width of this size. Acceptable values are 0 to 32767,
  10552. // inclusive.
  10553. Width int64 `json:"width,omitempty"`
  10554. // ServerResponse contains the HTTP response code and headers from the
  10555. // server.
  10556. googleapi.ServerResponse `json:"-"`
  10557. // ForceSendFields is a list of field names (e.g. "Height") to
  10558. // unconditionally include in API requests. By default, fields with
  10559. // empty values are omitted from API requests. However, any non-pointer,
  10560. // non-interface field appearing in ForceSendFields will be sent to the
  10561. // server regardless of whether the field is empty or not. This may be
  10562. // used to include empty fields in Patch requests.
  10563. ForceSendFields []string `json:"-"`
  10564. // NullFields is a list of field names (e.g. "Height") to include in API
  10565. // requests with the JSON null value. By default, fields with empty
  10566. // values are omitted from API requests. However, any field with an
  10567. // empty value appearing in NullFields will be sent to the server as
  10568. // null. It is an error if a field in this list has a non-empty value.
  10569. // This may be used to include null fields in Patch requests.
  10570. NullFields []string `json:"-"`
  10571. }
  10572. func (s *Size) MarshalJSON() ([]byte, error) {
  10573. type NoMethod Size
  10574. raw := NoMethod(*s)
  10575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10576. }
  10577. // SizesListResponse: Size List Response
  10578. type SizesListResponse struct {
  10579. // Kind: Identifies what kind of resource this is. Value: the fixed
  10580. // string "dfareporting#sizesListResponse".
  10581. Kind string `json:"kind,omitempty"`
  10582. // Sizes: Size collection.
  10583. Sizes []*Size `json:"sizes,omitempty"`
  10584. // ServerResponse contains the HTTP response code and headers from the
  10585. // server.
  10586. googleapi.ServerResponse `json:"-"`
  10587. // ForceSendFields is a list of field names (e.g. "Kind") to
  10588. // unconditionally include in API requests. By default, fields with
  10589. // empty values are omitted from API requests. However, any non-pointer,
  10590. // non-interface field appearing in ForceSendFields will be sent to the
  10591. // server regardless of whether the field is empty or not. This may be
  10592. // used to include empty fields in Patch requests.
  10593. ForceSendFields []string `json:"-"`
  10594. // NullFields is a list of field names (e.g. "Kind") to include in API
  10595. // requests with the JSON null value. By default, fields with empty
  10596. // values are omitted from API requests. However, any field with an
  10597. // empty value appearing in NullFields will be sent to the server as
  10598. // null. It is an error if a field in this list has a non-empty value.
  10599. // This may be used to include null fields in Patch requests.
  10600. NullFields []string `json:"-"`
  10601. }
  10602. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10603. type NoMethod SizesListResponse
  10604. raw := NoMethod(*s)
  10605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10606. }
  10607. // SkippableSetting: Skippable Settings
  10608. type SkippableSetting struct {
  10609. // Kind: Identifies what kind of resource this is. Value: the fixed
  10610. // string "dfareporting#skippableSetting".
  10611. Kind string `json:"kind,omitempty"`
  10612. // ProgressOffset: Amount of time to play videos served to this
  10613. // placement before counting a view. Applicable when skippable is true.
  10614. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10615. // SkipOffset: Amount of time to play videos served to this placement
  10616. // before the skip button should appear. Applicable when skippable is
  10617. // true.
  10618. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10619. // Skippable: Whether the user can skip creatives served to this
  10620. // placement.
  10621. Skippable bool `json:"skippable,omitempty"`
  10622. // ForceSendFields is a list of field names (e.g. "Kind") to
  10623. // unconditionally include in API requests. By default, fields with
  10624. // empty values are omitted from API requests. However, any non-pointer,
  10625. // non-interface field appearing in ForceSendFields will be sent to the
  10626. // server regardless of whether the field is empty or not. This may be
  10627. // used to include empty fields in Patch requests.
  10628. ForceSendFields []string `json:"-"`
  10629. // NullFields is a list of field names (e.g. "Kind") to include in API
  10630. // requests with the JSON null value. By default, fields with empty
  10631. // values are omitted from API requests. However, any field with an
  10632. // empty value appearing in NullFields will be sent to the server as
  10633. // null. It is an error if a field in this list has a non-empty value.
  10634. // This may be used to include null fields in Patch requests.
  10635. NullFields []string `json:"-"`
  10636. }
  10637. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10638. type NoMethod SkippableSetting
  10639. raw := NoMethod(*s)
  10640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10641. }
  10642. // SortedDimension: Represents a sorted dimension.
  10643. type SortedDimension struct {
  10644. // Kind: The kind of resource this is, in this case
  10645. // dfareporting#sortedDimension.
  10646. Kind string `json:"kind,omitempty"`
  10647. // Name: The name of the dimension.
  10648. Name string `json:"name,omitempty"`
  10649. // SortOrder: An optional sort order for the dimension column.
  10650. //
  10651. // Possible values:
  10652. // "ASCENDING"
  10653. // "DESCENDING"
  10654. SortOrder string `json:"sortOrder,omitempty"`
  10655. // ForceSendFields is a list of field names (e.g. "Kind") to
  10656. // unconditionally include in API requests. By default, fields with
  10657. // empty values are omitted from API requests. However, any non-pointer,
  10658. // non-interface field appearing in ForceSendFields will be sent to the
  10659. // server regardless of whether the field is empty or not. This may be
  10660. // used to include empty fields in Patch requests.
  10661. ForceSendFields []string `json:"-"`
  10662. // NullFields is a list of field names (e.g. "Kind") to include in API
  10663. // requests with the JSON null value. By default, fields with empty
  10664. // values are omitted from API requests. However, any field with an
  10665. // empty value appearing in NullFields will be sent to the server as
  10666. // null. It is an error if a field in this list has a non-empty value.
  10667. // This may be used to include null fields in Patch requests.
  10668. NullFields []string `json:"-"`
  10669. }
  10670. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10671. type NoMethod SortedDimension
  10672. raw := NoMethod(*s)
  10673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10674. }
  10675. // Subaccount: Contains properties of a Campaign Manager subaccount.
  10676. type Subaccount struct {
  10677. // AccountId: ID of the account that contains this subaccount. This is a
  10678. // read-only field that can be left blank.
  10679. AccountId int64 `json:"accountId,omitempty,string"`
  10680. // AvailablePermissionIds: IDs of the available user role permissions
  10681. // for this subaccount.
  10682. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10683. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10684. Id int64 `json:"id,omitempty,string"`
  10685. // Kind: Identifies what kind of resource this is. Value: the fixed
  10686. // string "dfareporting#subaccount".
  10687. Kind string `json:"kind,omitempty"`
  10688. // Name: Name of this subaccount. This is a required field. Must be less
  10689. // than 128 characters long and be unique among subaccounts of the same
  10690. // account.
  10691. Name string `json:"name,omitempty"`
  10692. // ServerResponse contains the HTTP response code and headers from the
  10693. // server.
  10694. googleapi.ServerResponse `json:"-"`
  10695. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10696. // unconditionally include in API requests. By default, fields with
  10697. // empty values are omitted from API requests. However, any non-pointer,
  10698. // non-interface field appearing in ForceSendFields will be sent to the
  10699. // server regardless of whether the field is empty or not. This may be
  10700. // used to include empty fields in Patch requests.
  10701. ForceSendFields []string `json:"-"`
  10702. // NullFields is a list of field names (e.g. "AccountId") to include in
  10703. // API requests with the JSON null value. By default, fields with empty
  10704. // values are omitted from API requests. However, any field with an
  10705. // empty value appearing in NullFields will be sent to the server as
  10706. // null. It is an error if a field in this list has a non-empty value.
  10707. // This may be used to include null fields in Patch requests.
  10708. NullFields []string `json:"-"`
  10709. }
  10710. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10711. type NoMethod Subaccount
  10712. raw := NoMethod(*s)
  10713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10714. }
  10715. // SubaccountsListResponse: Subaccount List Response
  10716. type SubaccountsListResponse struct {
  10717. // Kind: Identifies what kind of resource this is. Value: the fixed
  10718. // string "dfareporting#subaccountsListResponse".
  10719. Kind string `json:"kind,omitempty"`
  10720. // NextPageToken: Pagination token to be used for the next list
  10721. // operation.
  10722. NextPageToken string `json:"nextPageToken,omitempty"`
  10723. // Subaccounts: Subaccount collection.
  10724. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10725. // ServerResponse contains the HTTP response code and headers from the
  10726. // server.
  10727. googleapi.ServerResponse `json:"-"`
  10728. // ForceSendFields is a list of field names (e.g. "Kind") to
  10729. // unconditionally include in API requests. By default, fields with
  10730. // empty values are omitted from API requests. However, any non-pointer,
  10731. // non-interface field appearing in ForceSendFields will be sent to the
  10732. // server regardless of whether the field is empty or not. This may be
  10733. // used to include empty fields in Patch requests.
  10734. ForceSendFields []string `json:"-"`
  10735. // NullFields is a list of field names (e.g. "Kind") to include in API
  10736. // requests with the JSON null value. By default, fields with empty
  10737. // values are omitted from API requests. However, any field with an
  10738. // empty value appearing in NullFields will be sent to the server as
  10739. // null. It is an error if a field in this list has a non-empty value.
  10740. // This may be used to include null fields in Patch requests.
  10741. NullFields []string `json:"-"`
  10742. }
  10743. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10744. type NoMethod SubaccountsListResponse
  10745. raw := NoMethod(*s)
  10746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10747. }
  10748. // TagData: Placement Tag Data
  10749. type TagData struct {
  10750. // AdId: Ad associated with this placement tag. Applicable only when
  10751. // format is PLACEMENT_TAG_TRACKING.
  10752. AdId int64 `json:"adId,omitempty,string"`
  10753. // ClickTag: Tag string to record a click.
  10754. ClickTag string `json:"clickTag,omitempty"`
  10755. // CreativeId: Creative associated with this placement tag. Applicable
  10756. // only when format is PLACEMENT_TAG_TRACKING.
  10757. CreativeId int64 `json:"creativeId,omitempty,string"`
  10758. // Format: TagData tag format of this tag.
  10759. //
  10760. // Possible values:
  10761. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10762. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10763. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10764. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10765. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10766. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10767. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10768. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10769. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10770. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10771. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10772. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10773. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10774. // "PLACEMENT_TAG_JAVASCRIPT"
  10775. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10776. // "PLACEMENT_TAG_STANDARD"
  10777. // "PLACEMENT_TAG_TRACKING"
  10778. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10779. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10780. Format string `json:"format,omitempty"`
  10781. // ImpressionTag: Tag string for serving an ad.
  10782. ImpressionTag string `json:"impressionTag,omitempty"`
  10783. // ForceSendFields is a list of field names (e.g. "AdId") to
  10784. // unconditionally include in API requests. By default, fields with
  10785. // empty values are omitted from API requests. However, any non-pointer,
  10786. // non-interface field appearing in ForceSendFields will be sent to the
  10787. // server regardless of whether the field is empty or not. This may be
  10788. // used to include empty fields in Patch requests.
  10789. ForceSendFields []string `json:"-"`
  10790. // NullFields is a list of field names (e.g. "AdId") to include in API
  10791. // requests with the JSON null value. By default, fields with empty
  10792. // values are omitted from API requests. However, any field with an
  10793. // empty value appearing in NullFields will be sent to the server as
  10794. // null. It is an error if a field in this list has a non-empty value.
  10795. // This may be used to include null fields in Patch requests.
  10796. NullFields []string `json:"-"`
  10797. }
  10798. func (s *TagData) MarshalJSON() ([]byte, error) {
  10799. type NoMethod TagData
  10800. raw := NoMethod(*s)
  10801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10802. }
  10803. // TagSetting: Tag Settings
  10804. type TagSetting struct {
  10805. // AdditionalKeyValues: Additional key-values to be included in tags.
  10806. // Each key-value pair must be of the form key=value, and pairs must be
  10807. // separated by a semicolon (;). Keys and values must not contain
  10808. // commas. For example, id=2;color=red is a valid value for this field.
  10809. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10810. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10811. // included in the tags. This setting applies only to placements.
  10812. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10813. // IncludeClickTracking: Whether click-tracking string should be
  10814. // included in the tags.
  10815. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10816. // KeywordOption: Option specifying how keywords are embedded in ad
  10817. // tags. This setting can be used to specify whether keyword
  10818. // placeholders are inserted in placement tags for this site. Publishers
  10819. // can then add keywords to those placeholders.
  10820. //
  10821. // Possible values:
  10822. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10823. // "IGNORE"
  10824. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10825. KeywordOption string `json:"keywordOption,omitempty"`
  10826. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10827. // to unconditionally include in API requests. By default, fields with
  10828. // empty values are omitted from API requests. However, any non-pointer,
  10829. // non-interface field appearing in ForceSendFields will be sent to the
  10830. // server regardless of whether the field is empty or not. This may be
  10831. // used to include empty fields in Patch requests.
  10832. ForceSendFields []string `json:"-"`
  10833. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10834. // include in API requests with the JSON null value. By default, fields
  10835. // with empty values are omitted from API requests. However, any field
  10836. // with an empty value appearing in NullFields will be sent to the
  10837. // server as null. It is an error if a field in this list has a
  10838. // non-empty value. This may be used to include null fields in Patch
  10839. // requests.
  10840. NullFields []string `json:"-"`
  10841. }
  10842. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10843. type NoMethod TagSetting
  10844. raw := NoMethod(*s)
  10845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10846. }
  10847. // TagSettings: Dynamic and Image Tag Settings.
  10848. type TagSettings struct {
  10849. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10850. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10851. // ImageTagEnabled: Whether image tags are enabled.
  10852. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10853. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10854. // to unconditionally include in API requests. By default, fields with
  10855. // empty values are omitted from API requests. However, any non-pointer,
  10856. // non-interface field appearing in ForceSendFields will be sent to the
  10857. // server regardless of whether the field is empty or not. This may be
  10858. // used to include empty fields in Patch requests.
  10859. ForceSendFields []string `json:"-"`
  10860. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10861. // include in API requests with the JSON null value. By default, fields
  10862. // with empty values are omitted from API requests. However, any field
  10863. // with an empty value appearing in NullFields will be sent to the
  10864. // server as null. It is an error if a field in this list has a
  10865. // non-empty value. This may be used to include null fields in Patch
  10866. // requests.
  10867. NullFields []string `json:"-"`
  10868. }
  10869. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10870. type NoMethod TagSettings
  10871. raw := NoMethod(*s)
  10872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10873. }
  10874. // TargetWindow: Target Window.
  10875. type TargetWindow struct {
  10876. // CustomHtml: User-entered value.
  10877. CustomHtml string `json:"customHtml,omitempty"`
  10878. // TargetWindowOption: Type of browser window for which the backup image
  10879. // of the flash creative can be displayed.
  10880. //
  10881. // Possible values:
  10882. // "CURRENT_WINDOW"
  10883. // "CUSTOM"
  10884. // "NEW_WINDOW"
  10885. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10886. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10887. // unconditionally include in API requests. By default, fields with
  10888. // empty values are omitted from API requests. However, any non-pointer,
  10889. // non-interface field appearing in ForceSendFields will be sent to the
  10890. // server regardless of whether the field is empty or not. This may be
  10891. // used to include empty fields in Patch requests.
  10892. ForceSendFields []string `json:"-"`
  10893. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10894. // API requests with the JSON null value. By default, fields with empty
  10895. // values are omitted from API requests. However, any field with an
  10896. // empty value appearing in NullFields will be sent to the server as
  10897. // null. It is an error if a field in this list has a non-empty value.
  10898. // This may be used to include null fields in Patch requests.
  10899. NullFields []string `json:"-"`
  10900. }
  10901. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10902. type NoMethod TargetWindow
  10903. raw := NoMethod(*s)
  10904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10905. }
  10906. // TargetableRemarketingList: Contains properties of a targetable
  10907. // remarketing list. Remarketing enables you to create lists of users
  10908. // who have performed specific actions on a site, then target ads to
  10909. // members of those lists. This resource is a read-only view of a
  10910. // remarketing list to be used to faciliate targeting ads to specific
  10911. // lists. Remarketing lists that are owned by your advertisers and those
  10912. // that are shared to your advertisers or account are accessible via
  10913. // this resource. To manage remarketing lists that are owned by your
  10914. // advertisers, use the RemarketingLists resource.
  10915. type TargetableRemarketingList struct {
  10916. // AccountId: Account ID of this remarketing list. This is a read-only,
  10917. // auto-generated field that is only returned in GET requests.
  10918. AccountId int64 `json:"accountId,omitempty,string"`
  10919. // Active: Whether this targetable remarketing list is active.
  10920. Active bool `json:"active,omitempty"`
  10921. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10922. // targetable remarketing list.
  10923. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10924. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10925. // advertiser.
  10926. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10927. // Description: Targetable remarketing list description.
  10928. Description string `json:"description,omitempty"`
  10929. // Id: Targetable remarketing list ID.
  10930. Id int64 `json:"id,omitempty,string"`
  10931. // Kind: Identifies what kind of resource this is. Value: the fixed
  10932. // string "dfareporting#targetableRemarketingList".
  10933. Kind string `json:"kind,omitempty"`
  10934. // LifeSpan: Number of days that a user should remain in the targetable
  10935. // remarketing list without an impression.
  10936. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10937. // ListSize: Number of users currently in the list. This is a read-only
  10938. // field.
  10939. ListSize int64 `json:"listSize,omitempty,string"`
  10940. // ListSource: Product from which this targetable remarketing list was
  10941. // originated.
  10942. //
  10943. // Possible values:
  10944. // "REMARKETING_LIST_SOURCE_ADX"
  10945. // "REMARKETING_LIST_SOURCE_DBM"
  10946. // "REMARKETING_LIST_SOURCE_DFA"
  10947. // "REMARKETING_LIST_SOURCE_DFP"
  10948. // "REMARKETING_LIST_SOURCE_DMP"
  10949. // "REMARKETING_LIST_SOURCE_GA"
  10950. // "REMARKETING_LIST_SOURCE_GPLUS"
  10951. // "REMARKETING_LIST_SOURCE_OTHER"
  10952. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10953. // "REMARKETING_LIST_SOURCE_XFP"
  10954. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10955. ListSource string `json:"listSource,omitempty"`
  10956. // Name: Name of the targetable remarketing list. Is no greater than 128
  10957. // characters long.
  10958. Name string `json:"name,omitempty"`
  10959. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10960. // read-only, auto-generated field that is only returned in GET
  10961. // requests.
  10962. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10963. // ServerResponse contains the HTTP response code and headers from the
  10964. // server.
  10965. googleapi.ServerResponse `json:"-"`
  10966. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10967. // unconditionally include in API requests. By default, fields with
  10968. // empty values are omitted from API requests. However, any non-pointer,
  10969. // non-interface field appearing in ForceSendFields will be sent to the
  10970. // server regardless of whether the field is empty or not. This may be
  10971. // used to include empty fields in Patch requests.
  10972. ForceSendFields []string `json:"-"`
  10973. // NullFields is a list of field names (e.g. "AccountId") to include in
  10974. // API requests with the JSON null value. By default, fields with empty
  10975. // values are omitted from API requests. However, any field with an
  10976. // empty value appearing in NullFields will be sent to the server as
  10977. // null. It is an error if a field in this list has a non-empty value.
  10978. // This may be used to include null fields in Patch requests.
  10979. NullFields []string `json:"-"`
  10980. }
  10981. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10982. type NoMethod TargetableRemarketingList
  10983. raw := NoMethod(*s)
  10984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10985. }
  10986. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10987. // response
  10988. type TargetableRemarketingListsListResponse struct {
  10989. // Kind: Identifies what kind of resource this is. Value: the fixed
  10990. // string "dfareporting#targetableRemarketingListsListResponse".
  10991. Kind string `json:"kind,omitempty"`
  10992. // NextPageToken: Pagination token to be used for the next list
  10993. // operation.
  10994. NextPageToken string `json:"nextPageToken,omitempty"`
  10995. // TargetableRemarketingLists: Targetable remarketing list collection.
  10996. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10997. // ServerResponse contains the HTTP response code and headers from the
  10998. // server.
  10999. googleapi.ServerResponse `json:"-"`
  11000. // ForceSendFields is a list of field names (e.g. "Kind") to
  11001. // unconditionally include in API requests. By default, fields with
  11002. // empty values are omitted from API requests. However, any non-pointer,
  11003. // non-interface field appearing in ForceSendFields will be sent to the
  11004. // server regardless of whether the field is empty or not. This may be
  11005. // used to include empty fields in Patch requests.
  11006. ForceSendFields []string `json:"-"`
  11007. // NullFields is a list of field names (e.g. "Kind") to include in API
  11008. // requests with the JSON null value. By default, fields with empty
  11009. // values are omitted from API requests. However, any field with an
  11010. // empty value appearing in NullFields will be sent to the server as
  11011. // null. It is an error if a field in this list has a non-empty value.
  11012. // This may be used to include null fields in Patch requests.
  11013. NullFields []string `json:"-"`
  11014. }
  11015. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  11016. type NoMethod TargetableRemarketingListsListResponse
  11017. raw := NoMethod(*s)
  11018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11019. }
  11020. // TargetingTemplate: Contains properties of a targeting template. A
  11021. // targeting template encapsulates targeting information which can be
  11022. // reused across multiple ads.
  11023. type TargetingTemplate struct {
  11024. // AccountId: Account ID of this targeting template. This field, if left
  11025. // unset, will be auto-generated on insert and is read-only after
  11026. // insert.
  11027. AccountId int64 `json:"accountId,omitempty,string"`
  11028. // AdvertiserId: Advertiser ID of this targeting template. This is a
  11029. // required field on insert and is read-only after insert.
  11030. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  11031. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  11032. // advertiser. This is a read-only, auto-generated field.
  11033. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  11034. // DayPartTargeting: Time and day targeting criteria.
  11035. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  11036. // GeoTargeting: Geographical targeting criteria.
  11037. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  11038. // Id: ID of this targeting template. This is a read-only,
  11039. // auto-generated field.
  11040. Id int64 `json:"id,omitempty,string"`
  11041. // KeyValueTargetingExpression: Key-value targeting criteria.
  11042. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  11043. // Kind: Identifies what kind of resource this is. Value: the fixed
  11044. // string "dfareporting#targetingTemplate".
  11045. Kind string `json:"kind,omitempty"`
  11046. // LanguageTargeting: Language targeting criteria.
  11047. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  11048. // ListTargetingExpression: Remarketing list targeting criteria.
  11049. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  11050. // Name: Name of this targeting template. This field is required. It
  11051. // must be less than 256 characters long and unique within an
  11052. // advertiser.
  11053. Name string `json:"name,omitempty"`
  11054. // SubaccountId: Subaccount ID of this targeting template. This field,
  11055. // if left unset, will be auto-generated on insert and is read-only
  11056. // after insert.
  11057. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11058. // TechnologyTargeting: Technology platform targeting criteria.
  11059. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  11060. // ServerResponse contains the HTTP response code and headers from the
  11061. // server.
  11062. googleapi.ServerResponse `json:"-"`
  11063. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11064. // unconditionally include in API requests. By default, fields with
  11065. // empty values are omitted from API requests. However, any non-pointer,
  11066. // non-interface field appearing in ForceSendFields will be sent to the
  11067. // server regardless of whether the field is empty or not. This may be
  11068. // used to include empty fields in Patch requests.
  11069. ForceSendFields []string `json:"-"`
  11070. // NullFields is a list of field names (e.g. "AccountId") to include in
  11071. // API requests with the JSON null value. By default, fields with empty
  11072. // values are omitted from API requests. However, any field with an
  11073. // empty value appearing in NullFields will be sent to the server as
  11074. // null. It is an error if a field in this list has a non-empty value.
  11075. // This may be used to include null fields in Patch requests.
  11076. NullFields []string `json:"-"`
  11077. }
  11078. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  11079. type NoMethod TargetingTemplate
  11080. raw := NoMethod(*s)
  11081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11082. }
  11083. // TargetingTemplatesListResponse: Targeting Template List Response
  11084. type TargetingTemplatesListResponse struct {
  11085. // Kind: Identifies what kind of resource this is. Value: the fixed
  11086. // string "dfareporting#targetingTemplatesListResponse".
  11087. Kind string `json:"kind,omitempty"`
  11088. // NextPageToken: Pagination token to be used for the next list
  11089. // operation.
  11090. NextPageToken string `json:"nextPageToken,omitempty"`
  11091. // TargetingTemplates: Targeting template collection.
  11092. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  11093. // ServerResponse contains the HTTP response code and headers from the
  11094. // server.
  11095. googleapi.ServerResponse `json:"-"`
  11096. // ForceSendFields is a list of field names (e.g. "Kind") to
  11097. // unconditionally include in API requests. By default, fields with
  11098. // empty values are omitted from API requests. However, any non-pointer,
  11099. // non-interface field appearing in ForceSendFields will be sent to the
  11100. // server regardless of whether the field is empty or not. This may be
  11101. // used to include empty fields in Patch requests.
  11102. ForceSendFields []string `json:"-"`
  11103. // NullFields is a list of field names (e.g. "Kind") to include in API
  11104. // requests with the JSON null value. By default, fields with empty
  11105. // values are omitted from API requests. However, any field with an
  11106. // empty value appearing in NullFields will be sent to the server as
  11107. // null. It is an error if a field in this list has a non-empty value.
  11108. // This may be used to include null fields in Patch requests.
  11109. NullFields []string `json:"-"`
  11110. }
  11111. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  11112. type NoMethod TargetingTemplatesListResponse
  11113. raw := NoMethod(*s)
  11114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11115. }
  11116. // TechnologyTargeting: Technology Targeting.
  11117. type TechnologyTargeting struct {
  11118. // Browsers: Browsers that this ad targets. For each browser either set
  11119. // browserVersionId or dartId along with the version numbers. If both
  11120. // are specified, only browserVersionId will be used. The other fields
  11121. // are populated automatically when the ad is inserted or updated.
  11122. Browsers []*Browser `json:"browsers,omitempty"`
  11123. // ConnectionTypes: Connection types that this ad targets. For each
  11124. // connection type only id is required. The other fields are populated
  11125. // automatically when the ad is inserted or updated.
  11126. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  11127. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  11128. // carrier only id is required, and the other fields are populated
  11129. // automatically when the ad is inserted or updated. If targeting a
  11130. // mobile carrier, do not set targeting for any zip codes.
  11131. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  11132. // OperatingSystemVersions: Operating system versions that this ad
  11133. // targets. To target all versions, use operatingSystems. For each
  11134. // operating system version, only id is required. The other fields are
  11135. // populated automatically when the ad is inserted or updated. If
  11136. // targeting an operating system version, do not set targeting for the
  11137. // corresponding operating system in operatingSystems.
  11138. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  11139. // OperatingSystems: Operating systems that this ad targets. To target
  11140. // specific versions, use operatingSystemVersions. For each operating
  11141. // system only dartId is required. The other fields are populated
  11142. // automatically when the ad is inserted or updated. If targeting an
  11143. // operating system, do not set targeting for operating system versions
  11144. // for the same operating system.
  11145. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  11146. // PlatformTypes: Platform types that this ad targets. For example,
  11147. // desktop, mobile, or tablet. For each platform type, only id is
  11148. // required, and the other fields are populated automatically when the
  11149. // ad is inserted or updated.
  11150. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  11151. // ForceSendFields is a list of field names (e.g. "Browsers") to
  11152. // unconditionally include in API requests. By default, fields with
  11153. // empty values are omitted from API requests. However, any non-pointer,
  11154. // non-interface field appearing in ForceSendFields will be sent to the
  11155. // server regardless of whether the field is empty or not. This may be
  11156. // used to include empty fields in Patch requests.
  11157. ForceSendFields []string `json:"-"`
  11158. // NullFields is a list of field names (e.g. "Browsers") to include in
  11159. // API requests with the JSON null value. By default, fields with empty
  11160. // values are omitted from API requests. However, any field with an
  11161. // empty value appearing in NullFields will be sent to the server as
  11162. // null. It is an error if a field in this list has a non-empty value.
  11163. // This may be used to include null fields in Patch requests.
  11164. NullFields []string `json:"-"`
  11165. }
  11166. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  11167. type NoMethod TechnologyTargeting
  11168. raw := NoMethod(*s)
  11169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11170. }
  11171. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  11172. type ThirdPartyAuthenticationToken struct {
  11173. // Name: Name of the third-party authentication token.
  11174. Name string `json:"name,omitempty"`
  11175. // Value: Value of the third-party authentication token. This is a
  11176. // read-only, auto-generated field.
  11177. Value string `json:"value,omitempty"`
  11178. // ForceSendFields is a list of field names (e.g. "Name") to
  11179. // unconditionally include in API requests. By default, fields with
  11180. // empty values are omitted from API requests. However, any non-pointer,
  11181. // non-interface field appearing in ForceSendFields will be sent to the
  11182. // server regardless of whether the field is empty or not. This may be
  11183. // used to include empty fields in Patch requests.
  11184. ForceSendFields []string `json:"-"`
  11185. // NullFields is a list of field names (e.g. "Name") to include in API
  11186. // requests with the JSON null value. By default, fields with empty
  11187. // values are omitted from API requests. However, any field with an
  11188. // empty value appearing in NullFields will be sent to the server as
  11189. // null. It is an error if a field in this list has a non-empty value.
  11190. // This may be used to include null fields in Patch requests.
  11191. NullFields []string `json:"-"`
  11192. }
  11193. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  11194. type NoMethod ThirdPartyAuthenticationToken
  11195. raw := NoMethod(*s)
  11196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11197. }
  11198. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  11199. type ThirdPartyTrackingUrl struct {
  11200. // ThirdPartyUrlType: Third-party URL type for in-stream video and
  11201. // in-stream audio creatives.
  11202. //
  11203. // Possible values:
  11204. // "CLICK_TRACKING"
  11205. // "IMPRESSION"
  11206. // "RICH_MEDIA_BACKUP_IMPRESSION"
  11207. // "RICH_MEDIA_IMPRESSION"
  11208. // "RICH_MEDIA_RM_IMPRESSION"
  11209. // "SURVEY"
  11210. // "VIDEO_COMPLETE"
  11211. // "VIDEO_CUSTOM"
  11212. // "VIDEO_FIRST_QUARTILE"
  11213. // "VIDEO_FULLSCREEN"
  11214. // "VIDEO_MIDPOINT"
  11215. // "VIDEO_MUTE"
  11216. // "VIDEO_PAUSE"
  11217. // "VIDEO_PROGRESS"
  11218. // "VIDEO_REWIND"
  11219. // "VIDEO_SKIP"
  11220. // "VIDEO_START"
  11221. // "VIDEO_STOP"
  11222. // "VIDEO_THIRD_QUARTILE"
  11223. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  11224. // Url: URL for the specified third-party URL type.
  11225. Url string `json:"url,omitempty"`
  11226. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  11227. // to unconditionally include in API requests. By default, fields with
  11228. // empty values are omitted from API requests. However, any non-pointer,
  11229. // non-interface field appearing in ForceSendFields will be sent to the
  11230. // server regardless of whether the field is empty or not. This may be
  11231. // used to include empty fields in Patch requests.
  11232. ForceSendFields []string `json:"-"`
  11233. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  11234. // include in API requests with the JSON null value. By default, fields
  11235. // with empty values are omitted from API requests. However, any field
  11236. // with an empty value appearing in NullFields will be sent to the
  11237. // server as null. It is an error if a field in this list has a
  11238. // non-empty value. This may be used to include null fields in Patch
  11239. // requests.
  11240. NullFields []string `json:"-"`
  11241. }
  11242. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  11243. type NoMethod ThirdPartyTrackingUrl
  11244. raw := NoMethod(*s)
  11245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11246. }
  11247. // TranscodeSetting: Transcode Settings
  11248. type TranscodeSetting struct {
  11249. // EnabledVideoFormats: Whitelist of video formats to be served to this
  11250. // placement. Set this list to null or empty to serve all video formats.
  11251. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  11252. // Kind: Identifies what kind of resource this is. Value: the fixed
  11253. // string "dfareporting#transcodeSetting".
  11254. Kind string `json:"kind,omitempty"`
  11255. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  11256. // to unconditionally include in API requests. By default, fields with
  11257. // empty values are omitted from API requests. However, any non-pointer,
  11258. // non-interface field appearing in ForceSendFields will be sent to the
  11259. // server regardless of whether the field is empty or not. This may be
  11260. // used to include empty fields in Patch requests.
  11261. ForceSendFields []string `json:"-"`
  11262. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  11263. // include in API requests with the JSON null value. By default, fields
  11264. // with empty values are omitted from API requests. However, any field
  11265. // with an empty value appearing in NullFields will be sent to the
  11266. // server as null. It is an error if a field in this list has a
  11267. // non-empty value. This may be used to include null fields in Patch
  11268. // requests.
  11269. NullFields []string `json:"-"`
  11270. }
  11271. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  11272. type NoMethod TranscodeSetting
  11273. raw := NoMethod(*s)
  11274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11275. }
  11276. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  11277. // to the following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and
  11278. // VPAID.
  11279. type UniversalAdId struct {
  11280. // Registry: Registry used for the Ad ID value.
  11281. //
  11282. // Possible values:
  11283. // "AD_ID.ORG"
  11284. // "CLEARCAST"
  11285. // "DCM"
  11286. // "OTHER"
  11287. Registry string `json:"registry,omitempty"`
  11288. // Value: ID value for this creative. Only alphanumeric characters and
  11289. // the following symbols are valid: "_/\-". Maximum length is 64
  11290. // characters. Read only when registry is DCM.
  11291. Value string `json:"value,omitempty"`
  11292. // ForceSendFields is a list of field names (e.g. "Registry") to
  11293. // unconditionally include in API requests. By default, fields with
  11294. // empty values are omitted from API requests. However, any non-pointer,
  11295. // non-interface field appearing in ForceSendFields will be sent to the
  11296. // server regardless of whether the field is empty or not. This may be
  11297. // used to include empty fields in Patch requests.
  11298. ForceSendFields []string `json:"-"`
  11299. // NullFields is a list of field names (e.g. "Registry") to include in
  11300. // API requests with the JSON null value. By default, fields with empty
  11301. // values are omitted from API requests. However, any field with an
  11302. // empty value appearing in NullFields will be sent to the server as
  11303. // null. It is an error if a field in this list has a non-empty value.
  11304. // This may be used to include null fields in Patch requests.
  11305. NullFields []string `json:"-"`
  11306. }
  11307. func (s *UniversalAdId) MarshalJSON() ([]byte, error) {
  11308. type NoMethod UniversalAdId
  11309. raw := NoMethod(*s)
  11310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11311. }
  11312. // UserDefinedVariableConfiguration: User Defined Variable
  11313. // configuration.
  11314. type UserDefinedVariableConfiguration struct {
  11315. // DataType: Data type for the variable. This is a required field.
  11316. //
  11317. // Possible values:
  11318. // "NUMBER"
  11319. // "STRING"
  11320. DataType string `json:"dataType,omitempty"`
  11321. // ReportName: User-friendly name for the variable which will appear in
  11322. // reports. This is a required field, must be less than 64 characters
  11323. // long, and cannot contain the following characters: ""<>".
  11324. ReportName string `json:"reportName,omitempty"`
  11325. // VariableType: Variable name in the tag. This is a required field.
  11326. //
  11327. // Possible values:
  11328. // "U1"
  11329. // "U10"
  11330. // "U100"
  11331. // "U11"
  11332. // "U12"
  11333. // "U13"
  11334. // "U14"
  11335. // "U15"
  11336. // "U16"
  11337. // "U17"
  11338. // "U18"
  11339. // "U19"
  11340. // "U2"
  11341. // "U20"
  11342. // "U21"
  11343. // "U22"
  11344. // "U23"
  11345. // "U24"
  11346. // "U25"
  11347. // "U26"
  11348. // "U27"
  11349. // "U28"
  11350. // "U29"
  11351. // "U3"
  11352. // "U30"
  11353. // "U31"
  11354. // "U32"
  11355. // "U33"
  11356. // "U34"
  11357. // "U35"
  11358. // "U36"
  11359. // "U37"
  11360. // "U38"
  11361. // "U39"
  11362. // "U4"
  11363. // "U40"
  11364. // "U41"
  11365. // "U42"
  11366. // "U43"
  11367. // "U44"
  11368. // "U45"
  11369. // "U46"
  11370. // "U47"
  11371. // "U48"
  11372. // "U49"
  11373. // "U5"
  11374. // "U50"
  11375. // "U51"
  11376. // "U52"
  11377. // "U53"
  11378. // "U54"
  11379. // "U55"
  11380. // "U56"
  11381. // "U57"
  11382. // "U58"
  11383. // "U59"
  11384. // "U6"
  11385. // "U60"
  11386. // "U61"
  11387. // "U62"
  11388. // "U63"
  11389. // "U64"
  11390. // "U65"
  11391. // "U66"
  11392. // "U67"
  11393. // "U68"
  11394. // "U69"
  11395. // "U7"
  11396. // "U70"
  11397. // "U71"
  11398. // "U72"
  11399. // "U73"
  11400. // "U74"
  11401. // "U75"
  11402. // "U76"
  11403. // "U77"
  11404. // "U78"
  11405. // "U79"
  11406. // "U8"
  11407. // "U80"
  11408. // "U81"
  11409. // "U82"
  11410. // "U83"
  11411. // "U84"
  11412. // "U85"
  11413. // "U86"
  11414. // "U87"
  11415. // "U88"
  11416. // "U89"
  11417. // "U9"
  11418. // "U90"
  11419. // "U91"
  11420. // "U92"
  11421. // "U93"
  11422. // "U94"
  11423. // "U95"
  11424. // "U96"
  11425. // "U97"
  11426. // "U98"
  11427. // "U99"
  11428. VariableType string `json:"variableType,omitempty"`
  11429. // ForceSendFields is a list of field names (e.g. "DataType") to
  11430. // unconditionally include in API requests. By default, fields with
  11431. // empty values are omitted from API requests. However, any non-pointer,
  11432. // non-interface field appearing in ForceSendFields will be sent to the
  11433. // server regardless of whether the field is empty or not. This may be
  11434. // used to include empty fields in Patch requests.
  11435. ForceSendFields []string `json:"-"`
  11436. // NullFields is a list of field names (e.g. "DataType") to include in
  11437. // API requests with the JSON null value. By default, fields with empty
  11438. // values are omitted from API requests. However, any field with an
  11439. // empty value appearing in NullFields will be sent to the server as
  11440. // null. It is an error if a field in this list has a non-empty value.
  11441. // This may be used to include null fields in Patch requests.
  11442. NullFields []string `json:"-"`
  11443. }
  11444. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11445. type NoMethod UserDefinedVariableConfiguration
  11446. raw := NoMethod(*s)
  11447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11448. }
  11449. // UserProfile: Represents a UserProfile resource.
  11450. type UserProfile struct {
  11451. // AccountId: The account ID to which this profile belongs.
  11452. AccountId int64 `json:"accountId,omitempty,string"`
  11453. // AccountName: The account name this profile belongs to.
  11454. AccountName string `json:"accountName,omitempty"`
  11455. // Etag: The eTag of this response for caching purposes.
  11456. Etag string `json:"etag,omitempty"`
  11457. // Kind: The kind of resource this is, in this case
  11458. // dfareporting#userProfile.
  11459. Kind string `json:"kind,omitempty"`
  11460. // ProfileId: The unique ID of the user profile.
  11461. ProfileId int64 `json:"profileId,omitempty,string"`
  11462. // SubAccountId: The sub account ID this profile belongs to if
  11463. // applicable.
  11464. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11465. // SubAccountName: The sub account name this profile belongs to if
  11466. // applicable.
  11467. SubAccountName string `json:"subAccountName,omitempty"`
  11468. // UserName: The user name.
  11469. UserName string `json:"userName,omitempty"`
  11470. // ServerResponse contains the HTTP response code and headers from the
  11471. // server.
  11472. googleapi.ServerResponse `json:"-"`
  11473. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11474. // unconditionally include in API requests. By default, fields with
  11475. // empty values are omitted from API requests. However, any non-pointer,
  11476. // non-interface field appearing in ForceSendFields will be sent to the
  11477. // server regardless of whether the field is empty or not. This may be
  11478. // used to include empty fields in Patch requests.
  11479. ForceSendFields []string `json:"-"`
  11480. // NullFields is a list of field names (e.g. "AccountId") to include in
  11481. // API requests with the JSON null value. By default, fields with empty
  11482. // values are omitted from API requests. However, any field with an
  11483. // empty value appearing in NullFields will be sent to the server as
  11484. // null. It is an error if a field in this list has a non-empty value.
  11485. // This may be used to include null fields in Patch requests.
  11486. NullFields []string `json:"-"`
  11487. }
  11488. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11489. type NoMethod UserProfile
  11490. raw := NoMethod(*s)
  11491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11492. }
  11493. // UserProfileList: Represents the list of user profiles.
  11494. type UserProfileList struct {
  11495. // Etag: The eTag of this response for caching purposes.
  11496. Etag string `json:"etag,omitempty"`
  11497. // Items: The user profiles returned in this response.
  11498. Items []*UserProfile `json:"items,omitempty"`
  11499. // Kind: The kind of list this is, in this case
  11500. // dfareporting#userProfileList.
  11501. Kind string `json:"kind,omitempty"`
  11502. // ServerResponse contains the HTTP response code and headers from the
  11503. // server.
  11504. googleapi.ServerResponse `json:"-"`
  11505. // ForceSendFields is a list of field names (e.g. "Etag") to
  11506. // unconditionally include in API requests. By default, fields with
  11507. // empty values are omitted from API requests. However, any non-pointer,
  11508. // non-interface field appearing in ForceSendFields will be sent to the
  11509. // server regardless of whether the field is empty or not. This may be
  11510. // used to include empty fields in Patch requests.
  11511. ForceSendFields []string `json:"-"`
  11512. // NullFields is a list of field names (e.g. "Etag") to include in API
  11513. // requests with the JSON null value. By default, fields with empty
  11514. // values are omitted from API requests. However, any field with an
  11515. // empty value appearing in NullFields will be sent to the server as
  11516. // null. It is an error if a field in this list has a non-empty value.
  11517. // This may be used to include null fields in Patch requests.
  11518. NullFields []string `json:"-"`
  11519. }
  11520. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11521. type NoMethod UserProfileList
  11522. raw := NoMethod(*s)
  11523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11524. }
  11525. // UserRole: Contains properties of auser role, which is used to manage
  11526. // user access.
  11527. type UserRole struct {
  11528. // AccountId: Account ID of this user role. This is a read-only field
  11529. // that can be left blank.
  11530. AccountId int64 `json:"accountId,omitempty,string"`
  11531. // DefaultUserRole: Whether this is a default user role. Default user
  11532. // roles are created by the system for the account/subaccount and cannot
  11533. // be modified or deleted. Each default user role comes with a basic set
  11534. // of preassigned permissions.
  11535. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11536. // Id: ID of this user role. This is a read-only, auto-generated field.
  11537. Id int64 `json:"id,omitempty,string"`
  11538. // Kind: Identifies what kind of resource this is. Value: the fixed
  11539. // string "dfareporting#userRole".
  11540. Kind string `json:"kind,omitempty"`
  11541. // Name: Name of this user role. This is a required field. Must be less
  11542. // than 256 characters long. If this user role is under a subaccount,
  11543. // the name must be unique among sites of the same subaccount.
  11544. // Otherwise, this user role is a top-level user role, and the name must
  11545. // be unique among top-level user roles of the same account.
  11546. Name string `json:"name,omitempty"`
  11547. // ParentUserRoleId: ID of the user role that this user role is based on
  11548. // or copied from. This is a required field.
  11549. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11550. // Permissions: List of permissions associated with this user role.
  11551. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11552. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11553. // field that can be left blank.
  11554. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11555. // ServerResponse contains the HTTP response code and headers from the
  11556. // server.
  11557. googleapi.ServerResponse `json:"-"`
  11558. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11559. // unconditionally include in API requests. By default, fields with
  11560. // empty values are omitted from API requests. However, any non-pointer,
  11561. // non-interface field appearing in ForceSendFields will be sent to the
  11562. // server regardless of whether the field is empty or not. This may be
  11563. // used to include empty fields in Patch requests.
  11564. ForceSendFields []string `json:"-"`
  11565. // NullFields is a list of field names (e.g. "AccountId") to include in
  11566. // API requests with the JSON null value. By default, fields with empty
  11567. // values are omitted from API requests. However, any field with an
  11568. // empty value appearing in NullFields will be sent to the server as
  11569. // null. It is an error if a field in this list has a non-empty value.
  11570. // This may be used to include null fields in Patch requests.
  11571. NullFields []string `json:"-"`
  11572. }
  11573. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11574. type NoMethod UserRole
  11575. raw := NoMethod(*s)
  11576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11577. }
  11578. // UserRolePermission: Contains properties of a user role permission.
  11579. type UserRolePermission struct {
  11580. // Availability: Levels of availability for a user role permission.
  11581. //
  11582. // Possible values:
  11583. // "ACCOUNT_ALWAYS"
  11584. // "ACCOUNT_BY_DEFAULT"
  11585. // "NOT_AVAILABLE_BY_DEFAULT"
  11586. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11587. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11588. Availability string `json:"availability,omitempty"`
  11589. // Id: ID of this user role permission.
  11590. Id int64 `json:"id,omitempty,string"`
  11591. // Kind: Identifies what kind of resource this is. Value: the fixed
  11592. // string "dfareporting#userRolePermission".
  11593. Kind string `json:"kind,omitempty"`
  11594. // Name: Name of this user role permission.
  11595. Name string `json:"name,omitempty"`
  11596. // PermissionGroupId: ID of the permission group that this user role
  11597. // permission belongs to.
  11598. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11599. // ServerResponse contains the HTTP response code and headers from the
  11600. // server.
  11601. googleapi.ServerResponse `json:"-"`
  11602. // ForceSendFields is a list of field names (e.g. "Availability") to
  11603. // unconditionally include in API requests. By default, fields with
  11604. // empty values are omitted from API requests. However, any non-pointer,
  11605. // non-interface field appearing in ForceSendFields will be sent to the
  11606. // server regardless of whether the field is empty or not. This may be
  11607. // used to include empty fields in Patch requests.
  11608. ForceSendFields []string `json:"-"`
  11609. // NullFields is a list of field names (e.g. "Availability") to include
  11610. // in API requests with the JSON null value. By default, fields with
  11611. // empty values are omitted from API requests. However, any field with
  11612. // an empty value appearing in NullFields will be sent to the server as
  11613. // null. It is an error if a field in this list has a non-empty value.
  11614. // This may be used to include null fields in Patch requests.
  11615. NullFields []string `json:"-"`
  11616. }
  11617. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11618. type NoMethod UserRolePermission
  11619. raw := NoMethod(*s)
  11620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11621. }
  11622. // UserRolePermissionGroup: Represents a grouping of related user role
  11623. // permissions.
  11624. type UserRolePermissionGroup struct {
  11625. // Id: ID of this user role permission.
  11626. Id int64 `json:"id,omitempty,string"`
  11627. // Kind: Identifies what kind of resource this is. Value: the fixed
  11628. // string "dfareporting#userRolePermissionGroup".
  11629. Kind string `json:"kind,omitempty"`
  11630. // Name: Name of this user role permission group.
  11631. Name string `json:"name,omitempty"`
  11632. // ServerResponse contains the HTTP response code and headers from the
  11633. // server.
  11634. googleapi.ServerResponse `json:"-"`
  11635. // ForceSendFields is a list of field names (e.g. "Id") to
  11636. // unconditionally include in API requests. By default, fields with
  11637. // empty values are omitted from API requests. However, any non-pointer,
  11638. // non-interface field appearing in ForceSendFields will be sent to the
  11639. // server regardless of whether the field is empty or not. This may be
  11640. // used to include empty fields in Patch requests.
  11641. ForceSendFields []string `json:"-"`
  11642. // NullFields is a list of field names (e.g. "Id") to include in API
  11643. // requests with the JSON null value. By default, fields with empty
  11644. // values are omitted from API requests. However, any field with an
  11645. // empty value appearing in NullFields will be sent to the server as
  11646. // null. It is an error if a field in this list has a non-empty value.
  11647. // This may be used to include null fields in Patch requests.
  11648. NullFields []string `json:"-"`
  11649. }
  11650. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11651. type NoMethod UserRolePermissionGroup
  11652. raw := NoMethod(*s)
  11653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11654. }
  11655. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11656. // Response
  11657. type UserRolePermissionGroupsListResponse struct {
  11658. // Kind: Identifies what kind of resource this is. Value: the fixed
  11659. // string "dfareporting#userRolePermissionGroupsListResponse".
  11660. Kind string `json:"kind,omitempty"`
  11661. // UserRolePermissionGroups: User role permission group collection.
  11662. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11663. // ServerResponse contains the HTTP response code and headers from the
  11664. // server.
  11665. googleapi.ServerResponse `json:"-"`
  11666. // ForceSendFields is a list of field names (e.g. "Kind") to
  11667. // unconditionally include in API requests. By default, fields with
  11668. // empty values are omitted from API requests. However, any non-pointer,
  11669. // non-interface field appearing in ForceSendFields will be sent to the
  11670. // server regardless of whether the field is empty or not. This may be
  11671. // used to include empty fields in Patch requests.
  11672. ForceSendFields []string `json:"-"`
  11673. // NullFields is a list of field names (e.g. "Kind") to include in API
  11674. // requests with the JSON null value. By default, fields with empty
  11675. // values are omitted from API requests. However, any field with an
  11676. // empty value appearing in NullFields will be sent to the server as
  11677. // null. It is an error if a field in this list has a non-empty value.
  11678. // This may be used to include null fields in Patch requests.
  11679. NullFields []string `json:"-"`
  11680. }
  11681. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11682. type NoMethod UserRolePermissionGroupsListResponse
  11683. raw := NoMethod(*s)
  11684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11685. }
  11686. // UserRolePermissionsListResponse: User Role Permission List Response
  11687. type UserRolePermissionsListResponse struct {
  11688. // Kind: Identifies what kind of resource this is. Value: the fixed
  11689. // string "dfareporting#userRolePermissionsListResponse".
  11690. Kind string `json:"kind,omitempty"`
  11691. // UserRolePermissions: User role permission collection.
  11692. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11693. // ServerResponse contains the HTTP response code and headers from the
  11694. // server.
  11695. googleapi.ServerResponse `json:"-"`
  11696. // ForceSendFields is a list of field names (e.g. "Kind") to
  11697. // unconditionally include in API requests. By default, fields with
  11698. // empty values are omitted from API requests. However, any non-pointer,
  11699. // non-interface field appearing in ForceSendFields will be sent to the
  11700. // server regardless of whether the field is empty or not. This may be
  11701. // used to include empty fields in Patch requests.
  11702. ForceSendFields []string `json:"-"`
  11703. // NullFields is a list of field names (e.g. "Kind") to include in API
  11704. // requests with the JSON null value. By default, fields with empty
  11705. // values are omitted from API requests. However, any field with an
  11706. // empty value appearing in NullFields will be sent to the server as
  11707. // null. It is an error if a field in this list has a non-empty value.
  11708. // This may be used to include null fields in Patch requests.
  11709. NullFields []string `json:"-"`
  11710. }
  11711. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11712. type NoMethod UserRolePermissionsListResponse
  11713. raw := NoMethod(*s)
  11714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11715. }
  11716. // UserRolesListResponse: User Role List Response
  11717. type UserRolesListResponse struct {
  11718. // Kind: Identifies what kind of resource this is. Value: the fixed
  11719. // string "dfareporting#userRolesListResponse".
  11720. Kind string `json:"kind,omitempty"`
  11721. // NextPageToken: Pagination token to be used for the next list
  11722. // operation.
  11723. NextPageToken string `json:"nextPageToken,omitempty"`
  11724. // UserRoles: User role collection.
  11725. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11726. // ServerResponse contains the HTTP response code and headers from the
  11727. // server.
  11728. googleapi.ServerResponse `json:"-"`
  11729. // ForceSendFields is a list of field names (e.g. "Kind") to
  11730. // unconditionally include in API requests. By default, fields with
  11731. // empty values are omitted from API requests. However, any non-pointer,
  11732. // non-interface field appearing in ForceSendFields will be sent to the
  11733. // server regardless of whether the field is empty or not. This may be
  11734. // used to include empty fields in Patch requests.
  11735. ForceSendFields []string `json:"-"`
  11736. // NullFields is a list of field names (e.g. "Kind") to include in API
  11737. // requests with the JSON null value. By default, fields with empty
  11738. // values are omitted from API requests. However, any field with an
  11739. // empty value appearing in NullFields will be sent to the server as
  11740. // null. It is an error if a field in this list has a non-empty value.
  11741. // This may be used to include null fields in Patch requests.
  11742. NullFields []string `json:"-"`
  11743. }
  11744. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11745. type NoMethod UserRolesListResponse
  11746. raw := NoMethod(*s)
  11747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11748. }
  11749. // VideoFormat: Contains information about supported video formats.
  11750. type VideoFormat struct {
  11751. // FileType: File type of the video format.
  11752. //
  11753. // Possible values:
  11754. // "FLV"
  11755. // "M3U8"
  11756. // "MP4"
  11757. // "THREEGPP"
  11758. // "WEBM"
  11759. FileType string `json:"fileType,omitempty"`
  11760. // Id: ID of the video format.
  11761. Id int64 `json:"id,omitempty"`
  11762. // Kind: Identifies what kind of resource this is. Value: the fixed
  11763. // string "dfareporting#videoFormat".
  11764. Kind string `json:"kind,omitempty"`
  11765. // Resolution: The resolution of this video format.
  11766. Resolution *Size `json:"resolution,omitempty"`
  11767. // TargetBitRate: The target bit rate of this video format.
  11768. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11769. // ServerResponse contains the HTTP response code and headers from the
  11770. // server.
  11771. googleapi.ServerResponse `json:"-"`
  11772. // ForceSendFields is a list of field names (e.g. "FileType") to
  11773. // unconditionally include in API requests. By default, fields with
  11774. // empty values are omitted from API requests. However, any non-pointer,
  11775. // non-interface field appearing in ForceSendFields will be sent to the
  11776. // server regardless of whether the field is empty or not. This may be
  11777. // used to include empty fields in Patch requests.
  11778. ForceSendFields []string `json:"-"`
  11779. // NullFields is a list of field names (e.g. "FileType") to include in
  11780. // API requests with the JSON null value. By default, fields with empty
  11781. // values are omitted from API requests. However, any field with an
  11782. // empty value appearing in NullFields will be sent to the server as
  11783. // null. It is an error if a field in this list has a non-empty value.
  11784. // This may be used to include null fields in Patch requests.
  11785. NullFields []string `json:"-"`
  11786. }
  11787. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11788. type NoMethod VideoFormat
  11789. raw := NoMethod(*s)
  11790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11791. }
  11792. // VideoFormatsListResponse: Video Format List Response
  11793. type VideoFormatsListResponse struct {
  11794. // Kind: Identifies what kind of resource this is. Value: the fixed
  11795. // string "dfareporting#videoFormatsListResponse".
  11796. Kind string `json:"kind,omitempty"`
  11797. // VideoFormats: Video format collection.
  11798. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11799. // ServerResponse contains the HTTP response code and headers from the
  11800. // server.
  11801. googleapi.ServerResponse `json:"-"`
  11802. // ForceSendFields is a list of field names (e.g. "Kind") to
  11803. // unconditionally include in API requests. By default, fields with
  11804. // empty values are omitted from API requests. However, any non-pointer,
  11805. // non-interface field appearing in ForceSendFields will be sent to the
  11806. // server regardless of whether the field is empty or not. This may be
  11807. // used to include empty fields in Patch requests.
  11808. ForceSendFields []string `json:"-"`
  11809. // NullFields is a list of field names (e.g. "Kind") to include in API
  11810. // requests with the JSON null value. By default, fields with empty
  11811. // values are omitted from API requests. However, any field with an
  11812. // empty value appearing in NullFields will be sent to the server as
  11813. // null. It is an error if a field in this list has a non-empty value.
  11814. // This may be used to include null fields in Patch requests.
  11815. NullFields []string `json:"-"`
  11816. }
  11817. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11818. type NoMethod VideoFormatsListResponse
  11819. raw := NoMethod(*s)
  11820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11821. }
  11822. // VideoOffset: Video Offset
  11823. type VideoOffset struct {
  11824. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11825. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11826. // inclusive.
  11827. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11828. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11829. // is set. Acceptable values are 0 to 86399, inclusive.
  11830. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11831. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11832. // unconditionally include in API requests. By default, fields with
  11833. // empty values are omitted from API requests. However, any non-pointer,
  11834. // non-interface field appearing in ForceSendFields will be sent to the
  11835. // server regardless of whether the field is empty or not. This may be
  11836. // used to include empty fields in Patch requests.
  11837. ForceSendFields []string `json:"-"`
  11838. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11839. // include in API requests with the JSON null value. By default, fields
  11840. // with empty values are omitted from API requests. However, any field
  11841. // with an empty value appearing in NullFields will be sent to the
  11842. // server as null. It is an error if a field in this list has a
  11843. // non-empty value. This may be used to include null fields in Patch
  11844. // requests.
  11845. NullFields []string `json:"-"`
  11846. }
  11847. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11848. type NoMethod VideoOffset
  11849. raw := NoMethod(*s)
  11850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11851. }
  11852. // VideoSettings: Video Settings
  11853. type VideoSettings struct {
  11854. // CompanionSettings: Settings for the companion creatives of video
  11855. // creatives served to this placement.
  11856. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11857. // Kind: Identifies what kind of resource this is. Value: the fixed
  11858. // string "dfareporting#videoSettings".
  11859. Kind string `json:"kind,omitempty"`
  11860. // Orientation: Orientation of a video placement. If this value is set,
  11861. // placement will return assets matching the specified orientation.
  11862. //
  11863. // Possible values:
  11864. // "ANY"
  11865. // "LANDSCAPE"
  11866. // "PORTRAIT"
  11867. Orientation string `json:"orientation,omitempty"`
  11868. // SkippableSettings: Settings for the skippability of video creatives
  11869. // served to this placement. If this object is provided, the
  11870. // creative-level skippable settings will be overridden.
  11871. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11872. // TranscodeSettings: Settings for the transcodes of video creatives
  11873. // served to this placement. If this object is provided, the
  11874. // creative-level transcode settings will be overridden.
  11875. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11876. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11877. // to unconditionally include in API requests. By default, fields with
  11878. // empty values are omitted from API requests. However, any non-pointer,
  11879. // non-interface field appearing in ForceSendFields will be sent to the
  11880. // server regardless of whether the field is empty or not. This may be
  11881. // used to include empty fields in Patch requests.
  11882. ForceSendFields []string `json:"-"`
  11883. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11884. // include in API requests with the JSON null value. By default, fields
  11885. // with empty values are omitted from API requests. However, any field
  11886. // with an empty value appearing in NullFields will be sent to the
  11887. // server as null. It is an error if a field in this list has a
  11888. // non-empty value. This may be used to include null fields in Patch
  11889. // requests.
  11890. NullFields []string `json:"-"`
  11891. }
  11892. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11893. type NoMethod VideoSettings
  11894. raw := NoMethod(*s)
  11895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11896. }
  11897. // method id "dfareporting.accountActiveAdSummaries.get":
  11898. type AccountActiveAdSummariesGetCall struct {
  11899. s *Service
  11900. profileId int64
  11901. summaryAccountId int64
  11902. urlParams_ gensupport.URLParams
  11903. ifNoneMatch_ string
  11904. ctx_ context.Context
  11905. header_ http.Header
  11906. }
  11907. // Get: Gets the account's active ad summary by account ID.
  11908. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11909. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11910. c.profileId = profileId
  11911. c.summaryAccountId = summaryAccountId
  11912. return c
  11913. }
  11914. // Fields allows partial responses to be retrieved. See
  11915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11916. // for more information.
  11917. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11919. return c
  11920. }
  11921. // IfNoneMatch sets the optional parameter which makes the operation
  11922. // fail if the object's ETag matches the given value. This is useful for
  11923. // getting updates only after the object has changed since the last
  11924. // request. Use googleapi.IsNotModified to check whether the response
  11925. // error from Do is the result of In-None-Match.
  11926. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11927. c.ifNoneMatch_ = entityTag
  11928. return c
  11929. }
  11930. // Context sets the context to be used in this call's Do method. Any
  11931. // pending HTTP request will be aborted if the provided context is
  11932. // canceled.
  11933. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11934. c.ctx_ = ctx
  11935. return c
  11936. }
  11937. // Header returns an http.Header that can be modified by the caller to
  11938. // add HTTP headers to the request.
  11939. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11940. if c.header_ == nil {
  11941. c.header_ = make(http.Header)
  11942. }
  11943. return c.header_
  11944. }
  11945. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11946. reqHeaders := make(http.Header)
  11947. for k, v := range c.header_ {
  11948. reqHeaders[k] = v
  11949. }
  11950. reqHeaders.Set("User-Agent", c.s.userAgent())
  11951. if c.ifNoneMatch_ != "" {
  11952. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11953. }
  11954. var body io.Reader = nil
  11955. c.urlParams_.Set("alt", alt)
  11956. c.urlParams_.Set("prettyPrint", "false")
  11957. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11958. urls += "?" + c.urlParams_.Encode()
  11959. req, err := http.NewRequest("GET", urls, body)
  11960. if err != nil {
  11961. return nil, err
  11962. }
  11963. req.Header = reqHeaders
  11964. googleapi.Expand(req.URL, map[string]string{
  11965. "profileId": strconv.FormatInt(c.profileId, 10),
  11966. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11967. })
  11968. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11969. }
  11970. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11971. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11972. // non-2xx status code is an error. Response headers are in either
  11973. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11974. // returned at all) in error.(*googleapi.Error).Header. Use
  11975. // googleapi.IsNotModified to check whether the returned error was
  11976. // because http.StatusNotModified was returned.
  11977. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11978. gensupport.SetOptions(c.urlParams_, opts...)
  11979. res, err := c.doRequest("json")
  11980. if res != nil && res.StatusCode == http.StatusNotModified {
  11981. if res.Body != nil {
  11982. res.Body.Close()
  11983. }
  11984. return nil, &googleapi.Error{
  11985. Code: res.StatusCode,
  11986. Header: res.Header,
  11987. }
  11988. }
  11989. if err != nil {
  11990. return nil, err
  11991. }
  11992. defer googleapi.CloseBody(res)
  11993. if err := googleapi.CheckResponse(res); err != nil {
  11994. return nil, err
  11995. }
  11996. ret := &AccountActiveAdSummary{
  11997. ServerResponse: googleapi.ServerResponse{
  11998. Header: res.Header,
  11999. HTTPStatusCode: res.StatusCode,
  12000. },
  12001. }
  12002. target := &ret
  12003. if err := gensupport.DecodeResponse(target, res); err != nil {
  12004. return nil, err
  12005. }
  12006. return ret, nil
  12007. // {
  12008. // "description": "Gets the account's active ad summary by account ID.",
  12009. // "httpMethod": "GET",
  12010. // "id": "dfareporting.accountActiveAdSummaries.get",
  12011. // "parameterOrder": [
  12012. // "profileId",
  12013. // "summaryAccountId"
  12014. // ],
  12015. // "parameters": {
  12016. // "profileId": {
  12017. // "description": "User profile ID associated with this request.",
  12018. // "format": "int64",
  12019. // "location": "path",
  12020. // "required": true,
  12021. // "type": "string"
  12022. // },
  12023. // "summaryAccountId": {
  12024. // "description": "Account ID.",
  12025. // "format": "int64",
  12026. // "location": "path",
  12027. // "required": true,
  12028. // "type": "string"
  12029. // }
  12030. // },
  12031. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  12032. // "response": {
  12033. // "$ref": "AccountActiveAdSummary"
  12034. // },
  12035. // "scopes": [
  12036. // "https://www.googleapis.com/auth/dfatrafficking"
  12037. // ]
  12038. // }
  12039. }
  12040. // method id "dfareporting.accountPermissionGroups.get":
  12041. type AccountPermissionGroupsGetCall struct {
  12042. s *Service
  12043. profileId int64
  12044. id int64
  12045. urlParams_ gensupport.URLParams
  12046. ifNoneMatch_ string
  12047. ctx_ context.Context
  12048. header_ http.Header
  12049. }
  12050. // Get: Gets one account permission group by ID.
  12051. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  12052. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12053. c.profileId = profileId
  12054. c.id = id
  12055. return c
  12056. }
  12057. // Fields allows partial responses to be retrieved. See
  12058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12059. // for more information.
  12060. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  12061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12062. return c
  12063. }
  12064. // IfNoneMatch sets the optional parameter which makes the operation
  12065. // fail if the object's ETag matches the given value. This is useful for
  12066. // getting updates only after the object has changed since the last
  12067. // request. Use googleapi.IsNotModified to check whether the response
  12068. // error from Do is the result of In-None-Match.
  12069. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  12070. c.ifNoneMatch_ = entityTag
  12071. return c
  12072. }
  12073. // Context sets the context to be used in this call's Do method. Any
  12074. // pending HTTP request will be aborted if the provided context is
  12075. // canceled.
  12076. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  12077. c.ctx_ = ctx
  12078. return c
  12079. }
  12080. // Header returns an http.Header that can be modified by the caller to
  12081. // add HTTP headers to the request.
  12082. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  12083. if c.header_ == nil {
  12084. c.header_ = make(http.Header)
  12085. }
  12086. return c.header_
  12087. }
  12088. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  12089. reqHeaders := make(http.Header)
  12090. for k, v := range c.header_ {
  12091. reqHeaders[k] = v
  12092. }
  12093. reqHeaders.Set("User-Agent", c.s.userAgent())
  12094. if c.ifNoneMatch_ != "" {
  12095. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12096. }
  12097. var body io.Reader = nil
  12098. c.urlParams_.Set("alt", alt)
  12099. c.urlParams_.Set("prettyPrint", "false")
  12100. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  12101. urls += "?" + c.urlParams_.Encode()
  12102. req, err := http.NewRequest("GET", urls, body)
  12103. if err != nil {
  12104. return nil, err
  12105. }
  12106. req.Header = reqHeaders
  12107. googleapi.Expand(req.URL, map[string]string{
  12108. "profileId": strconv.FormatInt(c.profileId, 10),
  12109. "id": strconv.FormatInt(c.id, 10),
  12110. })
  12111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12112. }
  12113. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  12114. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  12115. // non-2xx status code is an error. Response headers are in either
  12116. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  12117. // returned at all) in error.(*googleapi.Error).Header. Use
  12118. // googleapi.IsNotModified to check whether the returned error was
  12119. // because http.StatusNotModified was returned.
  12120. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  12121. gensupport.SetOptions(c.urlParams_, opts...)
  12122. res, err := c.doRequest("json")
  12123. if res != nil && res.StatusCode == http.StatusNotModified {
  12124. if res.Body != nil {
  12125. res.Body.Close()
  12126. }
  12127. return nil, &googleapi.Error{
  12128. Code: res.StatusCode,
  12129. Header: res.Header,
  12130. }
  12131. }
  12132. if err != nil {
  12133. return nil, err
  12134. }
  12135. defer googleapi.CloseBody(res)
  12136. if err := googleapi.CheckResponse(res); err != nil {
  12137. return nil, err
  12138. }
  12139. ret := &AccountPermissionGroup{
  12140. ServerResponse: googleapi.ServerResponse{
  12141. Header: res.Header,
  12142. HTTPStatusCode: res.StatusCode,
  12143. },
  12144. }
  12145. target := &ret
  12146. if err := gensupport.DecodeResponse(target, res); err != nil {
  12147. return nil, err
  12148. }
  12149. return ret, nil
  12150. // {
  12151. // "description": "Gets one account permission group by ID.",
  12152. // "httpMethod": "GET",
  12153. // "id": "dfareporting.accountPermissionGroups.get",
  12154. // "parameterOrder": [
  12155. // "profileId",
  12156. // "id"
  12157. // ],
  12158. // "parameters": {
  12159. // "id": {
  12160. // "description": "Account permission group ID.",
  12161. // "format": "int64",
  12162. // "location": "path",
  12163. // "required": true,
  12164. // "type": "string"
  12165. // },
  12166. // "profileId": {
  12167. // "description": "User profile ID associated with this request.",
  12168. // "format": "int64",
  12169. // "location": "path",
  12170. // "required": true,
  12171. // "type": "string"
  12172. // }
  12173. // },
  12174. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  12175. // "response": {
  12176. // "$ref": "AccountPermissionGroup"
  12177. // },
  12178. // "scopes": [
  12179. // "https://www.googleapis.com/auth/dfatrafficking"
  12180. // ]
  12181. // }
  12182. }
  12183. // method id "dfareporting.accountPermissionGroups.list":
  12184. type AccountPermissionGroupsListCall struct {
  12185. s *Service
  12186. profileId int64
  12187. urlParams_ gensupport.URLParams
  12188. ifNoneMatch_ string
  12189. ctx_ context.Context
  12190. header_ http.Header
  12191. }
  12192. // List: Retrieves the list of account permission groups.
  12193. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  12194. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12195. c.profileId = profileId
  12196. return c
  12197. }
  12198. // Fields allows partial responses to be retrieved. See
  12199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12200. // for more information.
  12201. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  12202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12203. return c
  12204. }
  12205. // IfNoneMatch sets the optional parameter which makes the operation
  12206. // fail if the object's ETag matches the given value. This is useful for
  12207. // getting updates only after the object has changed since the last
  12208. // request. Use googleapi.IsNotModified to check whether the response
  12209. // error from Do is the result of In-None-Match.
  12210. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  12211. c.ifNoneMatch_ = entityTag
  12212. return c
  12213. }
  12214. // Context sets the context to be used in this call's Do method. Any
  12215. // pending HTTP request will be aborted if the provided context is
  12216. // canceled.
  12217. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  12218. c.ctx_ = ctx
  12219. return c
  12220. }
  12221. // Header returns an http.Header that can be modified by the caller to
  12222. // add HTTP headers to the request.
  12223. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  12224. if c.header_ == nil {
  12225. c.header_ = make(http.Header)
  12226. }
  12227. return c.header_
  12228. }
  12229. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  12230. reqHeaders := make(http.Header)
  12231. for k, v := range c.header_ {
  12232. reqHeaders[k] = v
  12233. }
  12234. reqHeaders.Set("User-Agent", c.s.userAgent())
  12235. if c.ifNoneMatch_ != "" {
  12236. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12237. }
  12238. var body io.Reader = nil
  12239. c.urlParams_.Set("alt", alt)
  12240. c.urlParams_.Set("prettyPrint", "false")
  12241. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  12242. urls += "?" + c.urlParams_.Encode()
  12243. req, err := http.NewRequest("GET", urls, body)
  12244. if err != nil {
  12245. return nil, err
  12246. }
  12247. req.Header = reqHeaders
  12248. googleapi.Expand(req.URL, map[string]string{
  12249. "profileId": strconv.FormatInt(c.profileId, 10),
  12250. })
  12251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12252. }
  12253. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  12254. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  12255. // non-nil. Any non-2xx status code is an error. Response headers are in
  12256. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  12257. // (if a response was returned at all) in
  12258. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12259. // whether the returned error was because http.StatusNotModified was
  12260. // returned.
  12261. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  12262. gensupport.SetOptions(c.urlParams_, opts...)
  12263. res, err := c.doRequest("json")
  12264. if res != nil && res.StatusCode == http.StatusNotModified {
  12265. if res.Body != nil {
  12266. res.Body.Close()
  12267. }
  12268. return nil, &googleapi.Error{
  12269. Code: res.StatusCode,
  12270. Header: res.Header,
  12271. }
  12272. }
  12273. if err != nil {
  12274. return nil, err
  12275. }
  12276. defer googleapi.CloseBody(res)
  12277. if err := googleapi.CheckResponse(res); err != nil {
  12278. return nil, err
  12279. }
  12280. ret := &AccountPermissionGroupsListResponse{
  12281. ServerResponse: googleapi.ServerResponse{
  12282. Header: res.Header,
  12283. HTTPStatusCode: res.StatusCode,
  12284. },
  12285. }
  12286. target := &ret
  12287. if err := gensupport.DecodeResponse(target, res); err != nil {
  12288. return nil, err
  12289. }
  12290. return ret, nil
  12291. // {
  12292. // "description": "Retrieves the list of account permission groups.",
  12293. // "httpMethod": "GET",
  12294. // "id": "dfareporting.accountPermissionGroups.list",
  12295. // "parameterOrder": [
  12296. // "profileId"
  12297. // ],
  12298. // "parameters": {
  12299. // "profileId": {
  12300. // "description": "User profile ID associated with this request.",
  12301. // "format": "int64",
  12302. // "location": "path",
  12303. // "required": true,
  12304. // "type": "string"
  12305. // }
  12306. // },
  12307. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  12308. // "response": {
  12309. // "$ref": "AccountPermissionGroupsListResponse"
  12310. // },
  12311. // "scopes": [
  12312. // "https://www.googleapis.com/auth/dfatrafficking"
  12313. // ]
  12314. // }
  12315. }
  12316. // method id "dfareporting.accountPermissions.get":
  12317. type AccountPermissionsGetCall struct {
  12318. s *Service
  12319. profileId int64
  12320. id int64
  12321. urlParams_ gensupport.URLParams
  12322. ifNoneMatch_ string
  12323. ctx_ context.Context
  12324. header_ http.Header
  12325. }
  12326. // Get: Gets one account permission by ID.
  12327. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  12328. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12329. c.profileId = profileId
  12330. c.id = id
  12331. return c
  12332. }
  12333. // Fields allows partial responses to be retrieved. See
  12334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12335. // for more information.
  12336. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  12337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12338. return c
  12339. }
  12340. // IfNoneMatch sets the optional parameter which makes the operation
  12341. // fail if the object's ETag matches the given value. This is useful for
  12342. // getting updates only after the object has changed since the last
  12343. // request. Use googleapi.IsNotModified to check whether the response
  12344. // error from Do is the result of In-None-Match.
  12345. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  12346. c.ifNoneMatch_ = entityTag
  12347. return c
  12348. }
  12349. // Context sets the context to be used in this call's Do method. Any
  12350. // pending HTTP request will be aborted if the provided context is
  12351. // canceled.
  12352. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  12353. c.ctx_ = ctx
  12354. return c
  12355. }
  12356. // Header returns an http.Header that can be modified by the caller to
  12357. // add HTTP headers to the request.
  12358. func (c *AccountPermissionsGetCall) Header() http.Header {
  12359. if c.header_ == nil {
  12360. c.header_ = make(http.Header)
  12361. }
  12362. return c.header_
  12363. }
  12364. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12365. reqHeaders := make(http.Header)
  12366. for k, v := range c.header_ {
  12367. reqHeaders[k] = v
  12368. }
  12369. reqHeaders.Set("User-Agent", c.s.userAgent())
  12370. if c.ifNoneMatch_ != "" {
  12371. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12372. }
  12373. var body io.Reader = nil
  12374. c.urlParams_.Set("alt", alt)
  12375. c.urlParams_.Set("prettyPrint", "false")
  12376. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  12377. urls += "?" + c.urlParams_.Encode()
  12378. req, err := http.NewRequest("GET", urls, body)
  12379. if err != nil {
  12380. return nil, err
  12381. }
  12382. req.Header = reqHeaders
  12383. googleapi.Expand(req.URL, map[string]string{
  12384. "profileId": strconv.FormatInt(c.profileId, 10),
  12385. "id": strconv.FormatInt(c.id, 10),
  12386. })
  12387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12388. }
  12389. // Do executes the "dfareporting.accountPermissions.get" call.
  12390. // Exactly one of *AccountPermission or error will be non-nil. Any
  12391. // non-2xx status code is an error. Response headers are in either
  12392. // *AccountPermission.ServerResponse.Header or (if a response was
  12393. // returned at all) in error.(*googleapi.Error).Header. Use
  12394. // googleapi.IsNotModified to check whether the returned error was
  12395. // because http.StatusNotModified was returned.
  12396. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  12397. gensupport.SetOptions(c.urlParams_, opts...)
  12398. res, err := c.doRequest("json")
  12399. if res != nil && res.StatusCode == http.StatusNotModified {
  12400. if res.Body != nil {
  12401. res.Body.Close()
  12402. }
  12403. return nil, &googleapi.Error{
  12404. Code: res.StatusCode,
  12405. Header: res.Header,
  12406. }
  12407. }
  12408. if err != nil {
  12409. return nil, err
  12410. }
  12411. defer googleapi.CloseBody(res)
  12412. if err := googleapi.CheckResponse(res); err != nil {
  12413. return nil, err
  12414. }
  12415. ret := &AccountPermission{
  12416. ServerResponse: googleapi.ServerResponse{
  12417. Header: res.Header,
  12418. HTTPStatusCode: res.StatusCode,
  12419. },
  12420. }
  12421. target := &ret
  12422. if err := gensupport.DecodeResponse(target, res); err != nil {
  12423. return nil, err
  12424. }
  12425. return ret, nil
  12426. // {
  12427. // "description": "Gets one account permission by ID.",
  12428. // "httpMethod": "GET",
  12429. // "id": "dfareporting.accountPermissions.get",
  12430. // "parameterOrder": [
  12431. // "profileId",
  12432. // "id"
  12433. // ],
  12434. // "parameters": {
  12435. // "id": {
  12436. // "description": "Account permission ID.",
  12437. // "format": "int64",
  12438. // "location": "path",
  12439. // "required": true,
  12440. // "type": "string"
  12441. // },
  12442. // "profileId": {
  12443. // "description": "User profile ID associated with this request.",
  12444. // "format": "int64",
  12445. // "location": "path",
  12446. // "required": true,
  12447. // "type": "string"
  12448. // }
  12449. // },
  12450. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  12451. // "response": {
  12452. // "$ref": "AccountPermission"
  12453. // },
  12454. // "scopes": [
  12455. // "https://www.googleapis.com/auth/dfatrafficking"
  12456. // ]
  12457. // }
  12458. }
  12459. // method id "dfareporting.accountPermissions.list":
  12460. type AccountPermissionsListCall struct {
  12461. s *Service
  12462. profileId int64
  12463. urlParams_ gensupport.URLParams
  12464. ifNoneMatch_ string
  12465. ctx_ context.Context
  12466. header_ http.Header
  12467. }
  12468. // List: Retrieves the list of account permissions.
  12469. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12470. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12471. c.profileId = profileId
  12472. return c
  12473. }
  12474. // Fields allows partial responses to be retrieved. See
  12475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12476. // for more information.
  12477. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12479. return c
  12480. }
  12481. // IfNoneMatch sets the optional parameter which makes the operation
  12482. // fail if the object's ETag matches the given value. This is useful for
  12483. // getting updates only after the object has changed since the last
  12484. // request. Use googleapi.IsNotModified to check whether the response
  12485. // error from Do is the result of In-None-Match.
  12486. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12487. c.ifNoneMatch_ = entityTag
  12488. return c
  12489. }
  12490. // Context sets the context to be used in this call's Do method. Any
  12491. // pending HTTP request will be aborted if the provided context is
  12492. // canceled.
  12493. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12494. c.ctx_ = ctx
  12495. return c
  12496. }
  12497. // Header returns an http.Header that can be modified by the caller to
  12498. // add HTTP headers to the request.
  12499. func (c *AccountPermissionsListCall) Header() http.Header {
  12500. if c.header_ == nil {
  12501. c.header_ = make(http.Header)
  12502. }
  12503. return c.header_
  12504. }
  12505. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12506. reqHeaders := make(http.Header)
  12507. for k, v := range c.header_ {
  12508. reqHeaders[k] = v
  12509. }
  12510. reqHeaders.Set("User-Agent", c.s.userAgent())
  12511. if c.ifNoneMatch_ != "" {
  12512. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12513. }
  12514. var body io.Reader = nil
  12515. c.urlParams_.Set("alt", alt)
  12516. c.urlParams_.Set("prettyPrint", "false")
  12517. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12518. urls += "?" + c.urlParams_.Encode()
  12519. req, err := http.NewRequest("GET", urls, body)
  12520. if err != nil {
  12521. return nil, err
  12522. }
  12523. req.Header = reqHeaders
  12524. googleapi.Expand(req.URL, map[string]string{
  12525. "profileId": strconv.FormatInt(c.profileId, 10),
  12526. })
  12527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12528. }
  12529. // Do executes the "dfareporting.accountPermissions.list" call.
  12530. // Exactly one of *AccountPermissionsListResponse or error will be
  12531. // non-nil. Any non-2xx status code is an error. Response headers are in
  12532. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12533. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12534. // googleapi.IsNotModified to check whether the returned error was
  12535. // because http.StatusNotModified was returned.
  12536. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12537. gensupport.SetOptions(c.urlParams_, opts...)
  12538. res, err := c.doRequest("json")
  12539. if res != nil && res.StatusCode == http.StatusNotModified {
  12540. if res.Body != nil {
  12541. res.Body.Close()
  12542. }
  12543. return nil, &googleapi.Error{
  12544. Code: res.StatusCode,
  12545. Header: res.Header,
  12546. }
  12547. }
  12548. if err != nil {
  12549. return nil, err
  12550. }
  12551. defer googleapi.CloseBody(res)
  12552. if err := googleapi.CheckResponse(res); err != nil {
  12553. return nil, err
  12554. }
  12555. ret := &AccountPermissionsListResponse{
  12556. ServerResponse: googleapi.ServerResponse{
  12557. Header: res.Header,
  12558. HTTPStatusCode: res.StatusCode,
  12559. },
  12560. }
  12561. target := &ret
  12562. if err := gensupport.DecodeResponse(target, res); err != nil {
  12563. return nil, err
  12564. }
  12565. return ret, nil
  12566. // {
  12567. // "description": "Retrieves the list of account permissions.",
  12568. // "httpMethod": "GET",
  12569. // "id": "dfareporting.accountPermissions.list",
  12570. // "parameterOrder": [
  12571. // "profileId"
  12572. // ],
  12573. // "parameters": {
  12574. // "profileId": {
  12575. // "description": "User profile ID associated with this request.",
  12576. // "format": "int64",
  12577. // "location": "path",
  12578. // "required": true,
  12579. // "type": "string"
  12580. // }
  12581. // },
  12582. // "path": "userprofiles/{profileId}/accountPermissions",
  12583. // "response": {
  12584. // "$ref": "AccountPermissionsListResponse"
  12585. // },
  12586. // "scopes": [
  12587. // "https://www.googleapis.com/auth/dfatrafficking"
  12588. // ]
  12589. // }
  12590. }
  12591. // method id "dfareporting.accountUserProfiles.get":
  12592. type AccountUserProfilesGetCall struct {
  12593. s *Service
  12594. profileId int64
  12595. id int64
  12596. urlParams_ gensupport.URLParams
  12597. ifNoneMatch_ string
  12598. ctx_ context.Context
  12599. header_ http.Header
  12600. }
  12601. // Get: Gets one account user profile by ID.
  12602. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12603. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12604. c.profileId = profileId
  12605. c.id = id
  12606. return c
  12607. }
  12608. // Fields allows partial responses to be retrieved. See
  12609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12610. // for more information.
  12611. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12613. return c
  12614. }
  12615. // IfNoneMatch sets the optional parameter which makes the operation
  12616. // fail if the object's ETag matches the given value. This is useful for
  12617. // getting updates only after the object has changed since the last
  12618. // request. Use googleapi.IsNotModified to check whether the response
  12619. // error from Do is the result of In-None-Match.
  12620. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12621. c.ifNoneMatch_ = entityTag
  12622. return c
  12623. }
  12624. // Context sets the context to be used in this call's Do method. Any
  12625. // pending HTTP request will be aborted if the provided context is
  12626. // canceled.
  12627. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12628. c.ctx_ = ctx
  12629. return c
  12630. }
  12631. // Header returns an http.Header that can be modified by the caller to
  12632. // add HTTP headers to the request.
  12633. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12634. if c.header_ == nil {
  12635. c.header_ = make(http.Header)
  12636. }
  12637. return c.header_
  12638. }
  12639. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12640. reqHeaders := make(http.Header)
  12641. for k, v := range c.header_ {
  12642. reqHeaders[k] = v
  12643. }
  12644. reqHeaders.Set("User-Agent", c.s.userAgent())
  12645. if c.ifNoneMatch_ != "" {
  12646. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12647. }
  12648. var body io.Reader = nil
  12649. c.urlParams_.Set("alt", alt)
  12650. c.urlParams_.Set("prettyPrint", "false")
  12651. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12652. urls += "?" + c.urlParams_.Encode()
  12653. req, err := http.NewRequest("GET", urls, body)
  12654. if err != nil {
  12655. return nil, err
  12656. }
  12657. req.Header = reqHeaders
  12658. googleapi.Expand(req.URL, map[string]string{
  12659. "profileId": strconv.FormatInt(c.profileId, 10),
  12660. "id": strconv.FormatInt(c.id, 10),
  12661. })
  12662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12663. }
  12664. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12665. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12666. // non-2xx status code is an error. Response headers are in either
  12667. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12668. // returned at all) in error.(*googleapi.Error).Header. Use
  12669. // googleapi.IsNotModified to check whether the returned error was
  12670. // because http.StatusNotModified was returned.
  12671. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12672. gensupport.SetOptions(c.urlParams_, opts...)
  12673. res, err := c.doRequest("json")
  12674. if res != nil && res.StatusCode == http.StatusNotModified {
  12675. if res.Body != nil {
  12676. res.Body.Close()
  12677. }
  12678. return nil, &googleapi.Error{
  12679. Code: res.StatusCode,
  12680. Header: res.Header,
  12681. }
  12682. }
  12683. if err != nil {
  12684. return nil, err
  12685. }
  12686. defer googleapi.CloseBody(res)
  12687. if err := googleapi.CheckResponse(res); err != nil {
  12688. return nil, err
  12689. }
  12690. ret := &AccountUserProfile{
  12691. ServerResponse: googleapi.ServerResponse{
  12692. Header: res.Header,
  12693. HTTPStatusCode: res.StatusCode,
  12694. },
  12695. }
  12696. target := &ret
  12697. if err := gensupport.DecodeResponse(target, res); err != nil {
  12698. return nil, err
  12699. }
  12700. return ret, nil
  12701. // {
  12702. // "description": "Gets one account user profile by ID.",
  12703. // "httpMethod": "GET",
  12704. // "id": "dfareporting.accountUserProfiles.get",
  12705. // "parameterOrder": [
  12706. // "profileId",
  12707. // "id"
  12708. // ],
  12709. // "parameters": {
  12710. // "id": {
  12711. // "description": "User profile ID.",
  12712. // "format": "int64",
  12713. // "location": "path",
  12714. // "required": true,
  12715. // "type": "string"
  12716. // },
  12717. // "profileId": {
  12718. // "description": "User profile ID associated with this request.",
  12719. // "format": "int64",
  12720. // "location": "path",
  12721. // "required": true,
  12722. // "type": "string"
  12723. // }
  12724. // },
  12725. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12726. // "response": {
  12727. // "$ref": "AccountUserProfile"
  12728. // },
  12729. // "scopes": [
  12730. // "https://www.googleapis.com/auth/dfatrafficking"
  12731. // ]
  12732. // }
  12733. }
  12734. // method id "dfareporting.accountUserProfiles.insert":
  12735. type AccountUserProfilesInsertCall struct {
  12736. s *Service
  12737. profileId int64
  12738. accountuserprofile *AccountUserProfile
  12739. urlParams_ gensupport.URLParams
  12740. ctx_ context.Context
  12741. header_ http.Header
  12742. }
  12743. // Insert: Inserts a new account user profile.
  12744. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12745. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12746. c.profileId = profileId
  12747. c.accountuserprofile = accountuserprofile
  12748. return c
  12749. }
  12750. // Fields allows partial responses to be retrieved. See
  12751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12752. // for more information.
  12753. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12755. return c
  12756. }
  12757. // Context sets the context to be used in this call's Do method. Any
  12758. // pending HTTP request will be aborted if the provided context is
  12759. // canceled.
  12760. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12761. c.ctx_ = ctx
  12762. return c
  12763. }
  12764. // Header returns an http.Header that can be modified by the caller to
  12765. // add HTTP headers to the request.
  12766. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12767. if c.header_ == nil {
  12768. c.header_ = make(http.Header)
  12769. }
  12770. return c.header_
  12771. }
  12772. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12773. reqHeaders := make(http.Header)
  12774. for k, v := range c.header_ {
  12775. reqHeaders[k] = v
  12776. }
  12777. reqHeaders.Set("User-Agent", c.s.userAgent())
  12778. var body io.Reader = nil
  12779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12780. if err != nil {
  12781. return nil, err
  12782. }
  12783. reqHeaders.Set("Content-Type", "application/json")
  12784. c.urlParams_.Set("alt", alt)
  12785. c.urlParams_.Set("prettyPrint", "false")
  12786. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12787. urls += "?" + c.urlParams_.Encode()
  12788. req, err := http.NewRequest("POST", urls, body)
  12789. if err != nil {
  12790. return nil, err
  12791. }
  12792. req.Header = reqHeaders
  12793. googleapi.Expand(req.URL, map[string]string{
  12794. "profileId": strconv.FormatInt(c.profileId, 10),
  12795. })
  12796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12797. }
  12798. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12799. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12800. // non-2xx status code is an error. Response headers are in either
  12801. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12802. // returned at all) in error.(*googleapi.Error).Header. Use
  12803. // googleapi.IsNotModified to check whether the returned error was
  12804. // because http.StatusNotModified was returned.
  12805. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12806. gensupport.SetOptions(c.urlParams_, opts...)
  12807. res, err := c.doRequest("json")
  12808. if res != nil && res.StatusCode == http.StatusNotModified {
  12809. if res.Body != nil {
  12810. res.Body.Close()
  12811. }
  12812. return nil, &googleapi.Error{
  12813. Code: res.StatusCode,
  12814. Header: res.Header,
  12815. }
  12816. }
  12817. if err != nil {
  12818. return nil, err
  12819. }
  12820. defer googleapi.CloseBody(res)
  12821. if err := googleapi.CheckResponse(res); err != nil {
  12822. return nil, err
  12823. }
  12824. ret := &AccountUserProfile{
  12825. ServerResponse: googleapi.ServerResponse{
  12826. Header: res.Header,
  12827. HTTPStatusCode: res.StatusCode,
  12828. },
  12829. }
  12830. target := &ret
  12831. if err := gensupport.DecodeResponse(target, res); err != nil {
  12832. return nil, err
  12833. }
  12834. return ret, nil
  12835. // {
  12836. // "description": "Inserts a new account user profile.",
  12837. // "httpMethod": "POST",
  12838. // "id": "dfareporting.accountUserProfiles.insert",
  12839. // "parameterOrder": [
  12840. // "profileId"
  12841. // ],
  12842. // "parameters": {
  12843. // "profileId": {
  12844. // "description": "User profile ID associated with this request.",
  12845. // "format": "int64",
  12846. // "location": "path",
  12847. // "required": true,
  12848. // "type": "string"
  12849. // }
  12850. // },
  12851. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12852. // "request": {
  12853. // "$ref": "AccountUserProfile"
  12854. // },
  12855. // "response": {
  12856. // "$ref": "AccountUserProfile"
  12857. // },
  12858. // "scopes": [
  12859. // "https://www.googleapis.com/auth/dfatrafficking"
  12860. // ]
  12861. // }
  12862. }
  12863. // method id "dfareporting.accountUserProfiles.list":
  12864. type AccountUserProfilesListCall struct {
  12865. s *Service
  12866. profileId int64
  12867. urlParams_ gensupport.URLParams
  12868. ifNoneMatch_ string
  12869. ctx_ context.Context
  12870. header_ http.Header
  12871. }
  12872. // List: Retrieves a list of account user profiles, possibly filtered.
  12873. // This method supports paging.
  12874. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12875. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12876. c.profileId = profileId
  12877. return c
  12878. }
  12879. // Active sets the optional parameter "active": Select only active user
  12880. // profiles.
  12881. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12882. c.urlParams_.Set("active", fmt.Sprint(active))
  12883. return c
  12884. }
  12885. // Ids sets the optional parameter "ids": Select only user profiles with
  12886. // these IDs.
  12887. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12888. var ids_ []string
  12889. for _, v := range ids {
  12890. ids_ = append(ids_, fmt.Sprint(v))
  12891. }
  12892. c.urlParams_.SetMulti("ids", ids_)
  12893. return c
  12894. }
  12895. // MaxResults sets the optional parameter "maxResults": Maximum number
  12896. // of results to return.
  12897. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12898. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12899. return c
  12900. }
  12901. // PageToken sets the optional parameter "pageToken": Value of the
  12902. // nextPageToken from the previous result page.
  12903. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12904. c.urlParams_.Set("pageToken", pageToken)
  12905. return c
  12906. }
  12907. // SearchString sets the optional parameter "searchString": Allows
  12908. // searching for objects by name, ID or email. Wildcards (*) are
  12909. // allowed. For example, "user profile*2015" will return objects with
  12910. // names like "user profile June 2015", "user profile April 2015", or
  12911. // simply "user profile 2015". Most of the searches also add wildcards
  12912. // implicitly at the start and the end of the search string. For
  12913. // example, a search string of "user profile" will match objects with
  12914. // name "my user profile", "user profile 2015", or simply "user
  12915. // profile".
  12916. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12917. c.urlParams_.Set("searchString", searchString)
  12918. return c
  12919. }
  12920. // SortField sets the optional parameter "sortField": Field by which to
  12921. // sort the list.
  12922. //
  12923. // Possible values:
  12924. // "ID" (default)
  12925. // "NAME"
  12926. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12927. c.urlParams_.Set("sortField", sortField)
  12928. return c
  12929. }
  12930. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12931. // results.
  12932. //
  12933. // Possible values:
  12934. // "ASCENDING" (default)
  12935. // "DESCENDING"
  12936. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12937. c.urlParams_.Set("sortOrder", sortOrder)
  12938. return c
  12939. }
  12940. // SubaccountId sets the optional parameter "subaccountId": Select only
  12941. // user profiles with the specified subaccount ID.
  12942. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12943. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12944. return c
  12945. }
  12946. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12947. // profiles with the specified user role ID.
  12948. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12949. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12950. return c
  12951. }
  12952. // Fields allows partial responses to be retrieved. See
  12953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12954. // for more information.
  12955. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12957. return c
  12958. }
  12959. // IfNoneMatch sets the optional parameter which makes the operation
  12960. // fail if the object's ETag matches the given value. This is useful for
  12961. // getting updates only after the object has changed since the last
  12962. // request. Use googleapi.IsNotModified to check whether the response
  12963. // error from Do is the result of In-None-Match.
  12964. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12965. c.ifNoneMatch_ = entityTag
  12966. return c
  12967. }
  12968. // Context sets the context to be used in this call's Do method. Any
  12969. // pending HTTP request will be aborted if the provided context is
  12970. // canceled.
  12971. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12972. c.ctx_ = ctx
  12973. return c
  12974. }
  12975. // Header returns an http.Header that can be modified by the caller to
  12976. // add HTTP headers to the request.
  12977. func (c *AccountUserProfilesListCall) Header() http.Header {
  12978. if c.header_ == nil {
  12979. c.header_ = make(http.Header)
  12980. }
  12981. return c.header_
  12982. }
  12983. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12984. reqHeaders := make(http.Header)
  12985. for k, v := range c.header_ {
  12986. reqHeaders[k] = v
  12987. }
  12988. reqHeaders.Set("User-Agent", c.s.userAgent())
  12989. if c.ifNoneMatch_ != "" {
  12990. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12991. }
  12992. var body io.Reader = nil
  12993. c.urlParams_.Set("alt", alt)
  12994. c.urlParams_.Set("prettyPrint", "false")
  12995. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12996. urls += "?" + c.urlParams_.Encode()
  12997. req, err := http.NewRequest("GET", urls, body)
  12998. if err != nil {
  12999. return nil, err
  13000. }
  13001. req.Header = reqHeaders
  13002. googleapi.Expand(req.URL, map[string]string{
  13003. "profileId": strconv.FormatInt(c.profileId, 10),
  13004. })
  13005. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13006. }
  13007. // Do executes the "dfareporting.accountUserProfiles.list" call.
  13008. // Exactly one of *AccountUserProfilesListResponse or error will be
  13009. // non-nil. Any non-2xx status code is an error. Response headers are in
  13010. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  13011. // a response was returned at all) in error.(*googleapi.Error).Header.
  13012. // Use googleapi.IsNotModified to check whether the returned error was
  13013. // because http.StatusNotModified was returned.
  13014. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  13015. gensupport.SetOptions(c.urlParams_, opts...)
  13016. res, err := c.doRequest("json")
  13017. if res != nil && res.StatusCode == http.StatusNotModified {
  13018. if res.Body != nil {
  13019. res.Body.Close()
  13020. }
  13021. return nil, &googleapi.Error{
  13022. Code: res.StatusCode,
  13023. Header: res.Header,
  13024. }
  13025. }
  13026. if err != nil {
  13027. return nil, err
  13028. }
  13029. defer googleapi.CloseBody(res)
  13030. if err := googleapi.CheckResponse(res); err != nil {
  13031. return nil, err
  13032. }
  13033. ret := &AccountUserProfilesListResponse{
  13034. ServerResponse: googleapi.ServerResponse{
  13035. Header: res.Header,
  13036. HTTPStatusCode: res.StatusCode,
  13037. },
  13038. }
  13039. target := &ret
  13040. if err := gensupport.DecodeResponse(target, res); err != nil {
  13041. return nil, err
  13042. }
  13043. return ret, nil
  13044. // {
  13045. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  13046. // "httpMethod": "GET",
  13047. // "id": "dfareporting.accountUserProfiles.list",
  13048. // "parameterOrder": [
  13049. // "profileId"
  13050. // ],
  13051. // "parameters": {
  13052. // "active": {
  13053. // "description": "Select only active user profiles.",
  13054. // "location": "query",
  13055. // "type": "boolean"
  13056. // },
  13057. // "ids": {
  13058. // "description": "Select only user profiles with these IDs.",
  13059. // "format": "int64",
  13060. // "location": "query",
  13061. // "repeated": true,
  13062. // "type": "string"
  13063. // },
  13064. // "maxResults": {
  13065. // "default": "1000",
  13066. // "description": "Maximum number of results to return.",
  13067. // "format": "int32",
  13068. // "location": "query",
  13069. // "maximum": "1000",
  13070. // "minimum": "0",
  13071. // "type": "integer"
  13072. // },
  13073. // "pageToken": {
  13074. // "description": "Value of the nextPageToken from the previous result page.",
  13075. // "location": "query",
  13076. // "type": "string"
  13077. // },
  13078. // "profileId": {
  13079. // "description": "User profile ID associated with this request.",
  13080. // "format": "int64",
  13081. // "location": "path",
  13082. // "required": true,
  13083. // "type": "string"
  13084. // },
  13085. // "searchString": {
  13086. // "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\".",
  13087. // "location": "query",
  13088. // "type": "string"
  13089. // },
  13090. // "sortField": {
  13091. // "default": "ID",
  13092. // "description": "Field by which to sort the list.",
  13093. // "enum": [
  13094. // "ID",
  13095. // "NAME"
  13096. // ],
  13097. // "enumDescriptions": [
  13098. // "",
  13099. // ""
  13100. // ],
  13101. // "location": "query",
  13102. // "type": "string"
  13103. // },
  13104. // "sortOrder": {
  13105. // "default": "ASCENDING",
  13106. // "description": "Order of sorted results.",
  13107. // "enum": [
  13108. // "ASCENDING",
  13109. // "DESCENDING"
  13110. // ],
  13111. // "enumDescriptions": [
  13112. // "",
  13113. // ""
  13114. // ],
  13115. // "location": "query",
  13116. // "type": "string"
  13117. // },
  13118. // "subaccountId": {
  13119. // "description": "Select only user profiles with the specified subaccount ID.",
  13120. // "format": "int64",
  13121. // "location": "query",
  13122. // "type": "string"
  13123. // },
  13124. // "userRoleId": {
  13125. // "description": "Select only user profiles with the specified user role ID.",
  13126. // "format": "int64",
  13127. // "location": "query",
  13128. // "type": "string"
  13129. // }
  13130. // },
  13131. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13132. // "response": {
  13133. // "$ref": "AccountUserProfilesListResponse"
  13134. // },
  13135. // "scopes": [
  13136. // "https://www.googleapis.com/auth/dfatrafficking"
  13137. // ]
  13138. // }
  13139. }
  13140. // Pages invokes f for each page of results.
  13141. // A non-nil error returned from f will halt the iteration.
  13142. // The provided context supersedes any context provided to the Context method.
  13143. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  13144. c.ctx_ = ctx
  13145. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13146. for {
  13147. x, err := c.Do()
  13148. if err != nil {
  13149. return err
  13150. }
  13151. if err := f(x); err != nil {
  13152. return err
  13153. }
  13154. if x.NextPageToken == "" {
  13155. return nil
  13156. }
  13157. c.PageToken(x.NextPageToken)
  13158. }
  13159. }
  13160. // method id "dfareporting.accountUserProfiles.patch":
  13161. type AccountUserProfilesPatchCall struct {
  13162. s *Service
  13163. profileId int64
  13164. accountuserprofile *AccountUserProfile
  13165. urlParams_ gensupport.URLParams
  13166. ctx_ context.Context
  13167. header_ http.Header
  13168. }
  13169. // Patch: Updates an existing account user profile. This method supports
  13170. // patch semantics.
  13171. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  13172. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13173. c.profileId = profileId
  13174. c.urlParams_.Set("id", fmt.Sprint(id))
  13175. c.accountuserprofile = accountuserprofile
  13176. return c
  13177. }
  13178. // Fields allows partial responses to be retrieved. See
  13179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13180. // for more information.
  13181. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  13182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13183. return c
  13184. }
  13185. // Context sets the context to be used in this call's Do method. Any
  13186. // pending HTTP request will be aborted if the provided context is
  13187. // canceled.
  13188. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  13189. c.ctx_ = ctx
  13190. return c
  13191. }
  13192. // Header returns an http.Header that can be modified by the caller to
  13193. // add HTTP headers to the request.
  13194. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  13195. if c.header_ == nil {
  13196. c.header_ = make(http.Header)
  13197. }
  13198. return c.header_
  13199. }
  13200. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  13201. reqHeaders := make(http.Header)
  13202. for k, v := range c.header_ {
  13203. reqHeaders[k] = v
  13204. }
  13205. reqHeaders.Set("User-Agent", c.s.userAgent())
  13206. var body io.Reader = nil
  13207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13208. if err != nil {
  13209. return nil, err
  13210. }
  13211. reqHeaders.Set("Content-Type", "application/json")
  13212. c.urlParams_.Set("alt", alt)
  13213. c.urlParams_.Set("prettyPrint", "false")
  13214. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13215. urls += "?" + c.urlParams_.Encode()
  13216. req, err := http.NewRequest("PATCH", urls, body)
  13217. if err != nil {
  13218. return nil, err
  13219. }
  13220. req.Header = reqHeaders
  13221. googleapi.Expand(req.URL, map[string]string{
  13222. "profileId": strconv.FormatInt(c.profileId, 10),
  13223. })
  13224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13225. }
  13226. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  13227. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13228. // non-2xx status code is an error. Response headers are in either
  13229. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13230. // returned at all) in error.(*googleapi.Error).Header. Use
  13231. // googleapi.IsNotModified to check whether the returned error was
  13232. // because http.StatusNotModified was returned.
  13233. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13234. gensupport.SetOptions(c.urlParams_, opts...)
  13235. res, err := c.doRequest("json")
  13236. if res != nil && res.StatusCode == http.StatusNotModified {
  13237. if res.Body != nil {
  13238. res.Body.Close()
  13239. }
  13240. return nil, &googleapi.Error{
  13241. Code: res.StatusCode,
  13242. Header: res.Header,
  13243. }
  13244. }
  13245. if err != nil {
  13246. return nil, err
  13247. }
  13248. defer googleapi.CloseBody(res)
  13249. if err := googleapi.CheckResponse(res); err != nil {
  13250. return nil, err
  13251. }
  13252. ret := &AccountUserProfile{
  13253. ServerResponse: googleapi.ServerResponse{
  13254. Header: res.Header,
  13255. HTTPStatusCode: res.StatusCode,
  13256. },
  13257. }
  13258. target := &ret
  13259. if err := gensupport.DecodeResponse(target, res); err != nil {
  13260. return nil, err
  13261. }
  13262. return ret, nil
  13263. // {
  13264. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  13265. // "httpMethod": "PATCH",
  13266. // "id": "dfareporting.accountUserProfiles.patch",
  13267. // "parameterOrder": [
  13268. // "profileId",
  13269. // "id"
  13270. // ],
  13271. // "parameters": {
  13272. // "id": {
  13273. // "description": "User profile ID.",
  13274. // "format": "int64",
  13275. // "location": "query",
  13276. // "required": true,
  13277. // "type": "string"
  13278. // },
  13279. // "profileId": {
  13280. // "description": "User profile ID associated with this request.",
  13281. // "format": "int64",
  13282. // "location": "path",
  13283. // "required": true,
  13284. // "type": "string"
  13285. // }
  13286. // },
  13287. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13288. // "request": {
  13289. // "$ref": "AccountUserProfile"
  13290. // },
  13291. // "response": {
  13292. // "$ref": "AccountUserProfile"
  13293. // },
  13294. // "scopes": [
  13295. // "https://www.googleapis.com/auth/dfatrafficking"
  13296. // ]
  13297. // }
  13298. }
  13299. // method id "dfareporting.accountUserProfiles.update":
  13300. type AccountUserProfilesUpdateCall struct {
  13301. s *Service
  13302. profileId int64
  13303. accountuserprofile *AccountUserProfile
  13304. urlParams_ gensupport.URLParams
  13305. ctx_ context.Context
  13306. header_ http.Header
  13307. }
  13308. // Update: Updates an existing account user profile.
  13309. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  13310. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13311. c.profileId = profileId
  13312. c.accountuserprofile = accountuserprofile
  13313. return c
  13314. }
  13315. // Fields allows partial responses to be retrieved. See
  13316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13317. // for more information.
  13318. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  13319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13320. return c
  13321. }
  13322. // Context sets the context to be used in this call's Do method. Any
  13323. // pending HTTP request will be aborted if the provided context is
  13324. // canceled.
  13325. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  13326. c.ctx_ = ctx
  13327. return c
  13328. }
  13329. // Header returns an http.Header that can be modified by the caller to
  13330. // add HTTP headers to the request.
  13331. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  13332. if c.header_ == nil {
  13333. c.header_ = make(http.Header)
  13334. }
  13335. return c.header_
  13336. }
  13337. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13338. reqHeaders := make(http.Header)
  13339. for k, v := range c.header_ {
  13340. reqHeaders[k] = v
  13341. }
  13342. reqHeaders.Set("User-Agent", c.s.userAgent())
  13343. var body io.Reader = nil
  13344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13345. if err != nil {
  13346. return nil, err
  13347. }
  13348. reqHeaders.Set("Content-Type", "application/json")
  13349. c.urlParams_.Set("alt", alt)
  13350. c.urlParams_.Set("prettyPrint", "false")
  13351. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13352. urls += "?" + c.urlParams_.Encode()
  13353. req, err := http.NewRequest("PUT", urls, body)
  13354. if err != nil {
  13355. return nil, err
  13356. }
  13357. req.Header = reqHeaders
  13358. googleapi.Expand(req.URL, map[string]string{
  13359. "profileId": strconv.FormatInt(c.profileId, 10),
  13360. })
  13361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13362. }
  13363. // Do executes the "dfareporting.accountUserProfiles.update" call.
  13364. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13365. // non-2xx status code is an error. Response headers are in either
  13366. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13367. // returned at all) in error.(*googleapi.Error).Header. Use
  13368. // googleapi.IsNotModified to check whether the returned error was
  13369. // because http.StatusNotModified was returned.
  13370. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13371. gensupport.SetOptions(c.urlParams_, opts...)
  13372. res, err := c.doRequest("json")
  13373. if res != nil && res.StatusCode == http.StatusNotModified {
  13374. if res.Body != nil {
  13375. res.Body.Close()
  13376. }
  13377. return nil, &googleapi.Error{
  13378. Code: res.StatusCode,
  13379. Header: res.Header,
  13380. }
  13381. }
  13382. if err != nil {
  13383. return nil, err
  13384. }
  13385. defer googleapi.CloseBody(res)
  13386. if err := googleapi.CheckResponse(res); err != nil {
  13387. return nil, err
  13388. }
  13389. ret := &AccountUserProfile{
  13390. ServerResponse: googleapi.ServerResponse{
  13391. Header: res.Header,
  13392. HTTPStatusCode: res.StatusCode,
  13393. },
  13394. }
  13395. target := &ret
  13396. if err := gensupport.DecodeResponse(target, res); err != nil {
  13397. return nil, err
  13398. }
  13399. return ret, nil
  13400. // {
  13401. // "description": "Updates an existing account user profile.",
  13402. // "httpMethod": "PUT",
  13403. // "id": "dfareporting.accountUserProfiles.update",
  13404. // "parameterOrder": [
  13405. // "profileId"
  13406. // ],
  13407. // "parameters": {
  13408. // "profileId": {
  13409. // "description": "User profile ID associated with this request.",
  13410. // "format": "int64",
  13411. // "location": "path",
  13412. // "required": true,
  13413. // "type": "string"
  13414. // }
  13415. // },
  13416. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13417. // "request": {
  13418. // "$ref": "AccountUserProfile"
  13419. // },
  13420. // "response": {
  13421. // "$ref": "AccountUserProfile"
  13422. // },
  13423. // "scopes": [
  13424. // "https://www.googleapis.com/auth/dfatrafficking"
  13425. // ]
  13426. // }
  13427. }
  13428. // method id "dfareporting.accounts.get":
  13429. type AccountsGetCall struct {
  13430. s *Service
  13431. profileId int64
  13432. id int64
  13433. urlParams_ gensupport.URLParams
  13434. ifNoneMatch_ string
  13435. ctx_ context.Context
  13436. header_ http.Header
  13437. }
  13438. // Get: Gets one account by ID.
  13439. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  13440. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13441. c.profileId = profileId
  13442. c.id = id
  13443. return c
  13444. }
  13445. // Fields allows partial responses to be retrieved. See
  13446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13447. // for more information.
  13448. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  13449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13450. return c
  13451. }
  13452. // IfNoneMatch sets the optional parameter which makes the operation
  13453. // fail if the object's ETag matches the given value. This is useful for
  13454. // getting updates only after the object has changed since the last
  13455. // request. Use googleapi.IsNotModified to check whether the response
  13456. // error from Do is the result of In-None-Match.
  13457. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  13458. c.ifNoneMatch_ = entityTag
  13459. return c
  13460. }
  13461. // Context sets the context to be used in this call's Do method. Any
  13462. // pending HTTP request will be aborted if the provided context is
  13463. // canceled.
  13464. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  13465. c.ctx_ = ctx
  13466. return c
  13467. }
  13468. // Header returns an http.Header that can be modified by the caller to
  13469. // add HTTP headers to the request.
  13470. func (c *AccountsGetCall) Header() http.Header {
  13471. if c.header_ == nil {
  13472. c.header_ = make(http.Header)
  13473. }
  13474. return c.header_
  13475. }
  13476. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  13477. reqHeaders := make(http.Header)
  13478. for k, v := range c.header_ {
  13479. reqHeaders[k] = v
  13480. }
  13481. reqHeaders.Set("User-Agent", c.s.userAgent())
  13482. if c.ifNoneMatch_ != "" {
  13483. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13484. }
  13485. var body io.Reader = nil
  13486. c.urlParams_.Set("alt", alt)
  13487. c.urlParams_.Set("prettyPrint", "false")
  13488. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13489. urls += "?" + c.urlParams_.Encode()
  13490. req, err := http.NewRequest("GET", urls, body)
  13491. if err != nil {
  13492. return nil, err
  13493. }
  13494. req.Header = reqHeaders
  13495. googleapi.Expand(req.URL, map[string]string{
  13496. "profileId": strconv.FormatInt(c.profileId, 10),
  13497. "id": strconv.FormatInt(c.id, 10),
  13498. })
  13499. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13500. }
  13501. // Do executes the "dfareporting.accounts.get" call.
  13502. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13503. // code is an error. Response headers are in either
  13504. // *Account.ServerResponse.Header or (if a response was returned at all)
  13505. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13506. // check whether the returned error was because http.StatusNotModified
  13507. // was returned.
  13508. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13509. gensupport.SetOptions(c.urlParams_, opts...)
  13510. res, err := c.doRequest("json")
  13511. if res != nil && res.StatusCode == http.StatusNotModified {
  13512. if res.Body != nil {
  13513. res.Body.Close()
  13514. }
  13515. return nil, &googleapi.Error{
  13516. Code: res.StatusCode,
  13517. Header: res.Header,
  13518. }
  13519. }
  13520. if err != nil {
  13521. return nil, err
  13522. }
  13523. defer googleapi.CloseBody(res)
  13524. if err := googleapi.CheckResponse(res); err != nil {
  13525. return nil, err
  13526. }
  13527. ret := &Account{
  13528. ServerResponse: googleapi.ServerResponse{
  13529. Header: res.Header,
  13530. HTTPStatusCode: res.StatusCode,
  13531. },
  13532. }
  13533. target := &ret
  13534. if err := gensupport.DecodeResponse(target, res); err != nil {
  13535. return nil, err
  13536. }
  13537. return ret, nil
  13538. // {
  13539. // "description": "Gets one account by ID.",
  13540. // "httpMethod": "GET",
  13541. // "id": "dfareporting.accounts.get",
  13542. // "parameterOrder": [
  13543. // "profileId",
  13544. // "id"
  13545. // ],
  13546. // "parameters": {
  13547. // "id": {
  13548. // "description": "Account ID.",
  13549. // "format": "int64",
  13550. // "location": "path",
  13551. // "required": true,
  13552. // "type": "string"
  13553. // },
  13554. // "profileId": {
  13555. // "description": "User profile ID associated with this request.",
  13556. // "format": "int64",
  13557. // "location": "path",
  13558. // "required": true,
  13559. // "type": "string"
  13560. // }
  13561. // },
  13562. // "path": "userprofiles/{profileId}/accounts/{id}",
  13563. // "response": {
  13564. // "$ref": "Account"
  13565. // },
  13566. // "scopes": [
  13567. // "https://www.googleapis.com/auth/dfatrafficking"
  13568. // ]
  13569. // }
  13570. }
  13571. // method id "dfareporting.accounts.list":
  13572. type AccountsListCall struct {
  13573. s *Service
  13574. profileId int64
  13575. urlParams_ gensupport.URLParams
  13576. ifNoneMatch_ string
  13577. ctx_ context.Context
  13578. header_ http.Header
  13579. }
  13580. // List: Retrieves the list of accounts, possibly filtered. This method
  13581. // supports paging.
  13582. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13583. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13584. c.profileId = profileId
  13585. return c
  13586. }
  13587. // Active sets the optional parameter "active": Select only active
  13588. // accounts. Don't set this field to select both active and non-active
  13589. // accounts.
  13590. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13591. c.urlParams_.Set("active", fmt.Sprint(active))
  13592. return c
  13593. }
  13594. // Ids sets the optional parameter "ids": Select only accounts with
  13595. // these IDs.
  13596. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13597. var ids_ []string
  13598. for _, v := range ids {
  13599. ids_ = append(ids_, fmt.Sprint(v))
  13600. }
  13601. c.urlParams_.SetMulti("ids", ids_)
  13602. return c
  13603. }
  13604. // MaxResults sets the optional parameter "maxResults": Maximum number
  13605. // of results to return.
  13606. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13607. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13608. return c
  13609. }
  13610. // PageToken sets the optional parameter "pageToken": Value of the
  13611. // nextPageToken from the previous result page.
  13612. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13613. c.urlParams_.Set("pageToken", pageToken)
  13614. return c
  13615. }
  13616. // SearchString sets the optional parameter "searchString": Allows
  13617. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13618. // example, "account*2015" will return objects with names like "account
  13619. // June 2015", "account April 2015", or simply "account 2015". Most of
  13620. // the searches also add wildcards implicitly at the start and the end
  13621. // of the search string. For example, a search string of "account" will
  13622. // match objects with name "my account", "account 2015", or simply
  13623. // "account".
  13624. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13625. c.urlParams_.Set("searchString", searchString)
  13626. return c
  13627. }
  13628. // SortField sets the optional parameter "sortField": Field by which to
  13629. // sort the list.
  13630. //
  13631. // Possible values:
  13632. // "ID" (default)
  13633. // "NAME"
  13634. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13635. c.urlParams_.Set("sortField", sortField)
  13636. return c
  13637. }
  13638. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13639. // results.
  13640. //
  13641. // Possible values:
  13642. // "ASCENDING" (default)
  13643. // "DESCENDING"
  13644. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13645. c.urlParams_.Set("sortOrder", sortOrder)
  13646. return c
  13647. }
  13648. // Fields allows partial responses to be retrieved. See
  13649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13650. // for more information.
  13651. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13653. return c
  13654. }
  13655. // IfNoneMatch sets the optional parameter which makes the operation
  13656. // fail if the object's ETag matches the given value. This is useful for
  13657. // getting updates only after the object has changed since the last
  13658. // request. Use googleapi.IsNotModified to check whether the response
  13659. // error from Do is the result of In-None-Match.
  13660. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13661. c.ifNoneMatch_ = entityTag
  13662. return c
  13663. }
  13664. // Context sets the context to be used in this call's Do method. Any
  13665. // pending HTTP request will be aborted if the provided context is
  13666. // canceled.
  13667. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13668. c.ctx_ = ctx
  13669. return c
  13670. }
  13671. // Header returns an http.Header that can be modified by the caller to
  13672. // add HTTP headers to the request.
  13673. func (c *AccountsListCall) Header() http.Header {
  13674. if c.header_ == nil {
  13675. c.header_ = make(http.Header)
  13676. }
  13677. return c.header_
  13678. }
  13679. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13680. reqHeaders := make(http.Header)
  13681. for k, v := range c.header_ {
  13682. reqHeaders[k] = v
  13683. }
  13684. reqHeaders.Set("User-Agent", c.s.userAgent())
  13685. if c.ifNoneMatch_ != "" {
  13686. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13687. }
  13688. var body io.Reader = nil
  13689. c.urlParams_.Set("alt", alt)
  13690. c.urlParams_.Set("prettyPrint", "false")
  13691. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13692. urls += "?" + c.urlParams_.Encode()
  13693. req, err := http.NewRequest("GET", urls, body)
  13694. if err != nil {
  13695. return nil, err
  13696. }
  13697. req.Header = reqHeaders
  13698. googleapi.Expand(req.URL, map[string]string{
  13699. "profileId": strconv.FormatInt(c.profileId, 10),
  13700. })
  13701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13702. }
  13703. // Do executes the "dfareporting.accounts.list" call.
  13704. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13705. // non-2xx status code is an error. Response headers are in either
  13706. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13707. // returned at all) in error.(*googleapi.Error).Header. Use
  13708. // googleapi.IsNotModified to check whether the returned error was
  13709. // because http.StatusNotModified was returned.
  13710. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13711. gensupport.SetOptions(c.urlParams_, opts...)
  13712. res, err := c.doRequest("json")
  13713. if res != nil && res.StatusCode == http.StatusNotModified {
  13714. if res.Body != nil {
  13715. res.Body.Close()
  13716. }
  13717. return nil, &googleapi.Error{
  13718. Code: res.StatusCode,
  13719. Header: res.Header,
  13720. }
  13721. }
  13722. if err != nil {
  13723. return nil, err
  13724. }
  13725. defer googleapi.CloseBody(res)
  13726. if err := googleapi.CheckResponse(res); err != nil {
  13727. return nil, err
  13728. }
  13729. ret := &AccountsListResponse{
  13730. ServerResponse: googleapi.ServerResponse{
  13731. Header: res.Header,
  13732. HTTPStatusCode: res.StatusCode,
  13733. },
  13734. }
  13735. target := &ret
  13736. if err := gensupport.DecodeResponse(target, res); err != nil {
  13737. return nil, err
  13738. }
  13739. return ret, nil
  13740. // {
  13741. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13742. // "httpMethod": "GET",
  13743. // "id": "dfareporting.accounts.list",
  13744. // "parameterOrder": [
  13745. // "profileId"
  13746. // ],
  13747. // "parameters": {
  13748. // "active": {
  13749. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13750. // "location": "query",
  13751. // "type": "boolean"
  13752. // },
  13753. // "ids": {
  13754. // "description": "Select only accounts with these IDs.",
  13755. // "format": "int64",
  13756. // "location": "query",
  13757. // "repeated": true,
  13758. // "type": "string"
  13759. // },
  13760. // "maxResults": {
  13761. // "default": "1000",
  13762. // "description": "Maximum number of results to return.",
  13763. // "format": "int32",
  13764. // "location": "query",
  13765. // "maximum": "1000",
  13766. // "minimum": "0",
  13767. // "type": "integer"
  13768. // },
  13769. // "pageToken": {
  13770. // "description": "Value of the nextPageToken from the previous result page.",
  13771. // "location": "query",
  13772. // "type": "string"
  13773. // },
  13774. // "profileId": {
  13775. // "description": "User profile ID associated with this request.",
  13776. // "format": "int64",
  13777. // "location": "path",
  13778. // "required": true,
  13779. // "type": "string"
  13780. // },
  13781. // "searchString": {
  13782. // "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\".",
  13783. // "location": "query",
  13784. // "type": "string"
  13785. // },
  13786. // "sortField": {
  13787. // "default": "ID",
  13788. // "description": "Field by which to sort the list.",
  13789. // "enum": [
  13790. // "ID",
  13791. // "NAME"
  13792. // ],
  13793. // "enumDescriptions": [
  13794. // "",
  13795. // ""
  13796. // ],
  13797. // "location": "query",
  13798. // "type": "string"
  13799. // },
  13800. // "sortOrder": {
  13801. // "default": "ASCENDING",
  13802. // "description": "Order of sorted results.",
  13803. // "enum": [
  13804. // "ASCENDING",
  13805. // "DESCENDING"
  13806. // ],
  13807. // "enumDescriptions": [
  13808. // "",
  13809. // ""
  13810. // ],
  13811. // "location": "query",
  13812. // "type": "string"
  13813. // }
  13814. // },
  13815. // "path": "userprofiles/{profileId}/accounts",
  13816. // "response": {
  13817. // "$ref": "AccountsListResponse"
  13818. // },
  13819. // "scopes": [
  13820. // "https://www.googleapis.com/auth/dfatrafficking"
  13821. // ]
  13822. // }
  13823. }
  13824. // Pages invokes f for each page of results.
  13825. // A non-nil error returned from f will halt the iteration.
  13826. // The provided context supersedes any context provided to the Context method.
  13827. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13828. c.ctx_ = ctx
  13829. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13830. for {
  13831. x, err := c.Do()
  13832. if err != nil {
  13833. return err
  13834. }
  13835. if err := f(x); err != nil {
  13836. return err
  13837. }
  13838. if x.NextPageToken == "" {
  13839. return nil
  13840. }
  13841. c.PageToken(x.NextPageToken)
  13842. }
  13843. }
  13844. // method id "dfareporting.accounts.patch":
  13845. type AccountsPatchCall struct {
  13846. s *Service
  13847. profileId int64
  13848. account *Account
  13849. urlParams_ gensupport.URLParams
  13850. ctx_ context.Context
  13851. header_ http.Header
  13852. }
  13853. // Patch: Updates an existing account. This method supports patch
  13854. // semantics.
  13855. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13856. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13857. c.profileId = profileId
  13858. c.urlParams_.Set("id", fmt.Sprint(id))
  13859. c.account = account
  13860. return c
  13861. }
  13862. // Fields allows partial responses to be retrieved. See
  13863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13864. // for more information.
  13865. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13867. return c
  13868. }
  13869. // Context sets the context to be used in this call's Do method. Any
  13870. // pending HTTP request will be aborted if the provided context is
  13871. // canceled.
  13872. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13873. c.ctx_ = ctx
  13874. return c
  13875. }
  13876. // Header returns an http.Header that can be modified by the caller to
  13877. // add HTTP headers to the request.
  13878. func (c *AccountsPatchCall) Header() http.Header {
  13879. if c.header_ == nil {
  13880. c.header_ = make(http.Header)
  13881. }
  13882. return c.header_
  13883. }
  13884. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13885. reqHeaders := make(http.Header)
  13886. for k, v := range c.header_ {
  13887. reqHeaders[k] = v
  13888. }
  13889. reqHeaders.Set("User-Agent", c.s.userAgent())
  13890. var body io.Reader = nil
  13891. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13892. if err != nil {
  13893. return nil, err
  13894. }
  13895. reqHeaders.Set("Content-Type", "application/json")
  13896. c.urlParams_.Set("alt", alt)
  13897. c.urlParams_.Set("prettyPrint", "false")
  13898. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13899. urls += "?" + c.urlParams_.Encode()
  13900. req, err := http.NewRequest("PATCH", urls, body)
  13901. if err != nil {
  13902. return nil, err
  13903. }
  13904. req.Header = reqHeaders
  13905. googleapi.Expand(req.URL, map[string]string{
  13906. "profileId": strconv.FormatInt(c.profileId, 10),
  13907. })
  13908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13909. }
  13910. // Do executes the "dfareporting.accounts.patch" call.
  13911. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13912. // code is an error. Response headers are in either
  13913. // *Account.ServerResponse.Header or (if a response was returned at all)
  13914. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13915. // check whether the returned error was because http.StatusNotModified
  13916. // was returned.
  13917. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13918. gensupport.SetOptions(c.urlParams_, opts...)
  13919. res, err := c.doRequest("json")
  13920. if res != nil && res.StatusCode == http.StatusNotModified {
  13921. if res.Body != nil {
  13922. res.Body.Close()
  13923. }
  13924. return nil, &googleapi.Error{
  13925. Code: res.StatusCode,
  13926. Header: res.Header,
  13927. }
  13928. }
  13929. if err != nil {
  13930. return nil, err
  13931. }
  13932. defer googleapi.CloseBody(res)
  13933. if err := googleapi.CheckResponse(res); err != nil {
  13934. return nil, err
  13935. }
  13936. ret := &Account{
  13937. ServerResponse: googleapi.ServerResponse{
  13938. Header: res.Header,
  13939. HTTPStatusCode: res.StatusCode,
  13940. },
  13941. }
  13942. target := &ret
  13943. if err := gensupport.DecodeResponse(target, res); err != nil {
  13944. return nil, err
  13945. }
  13946. return ret, nil
  13947. // {
  13948. // "description": "Updates an existing account. This method supports patch semantics.",
  13949. // "httpMethod": "PATCH",
  13950. // "id": "dfareporting.accounts.patch",
  13951. // "parameterOrder": [
  13952. // "profileId",
  13953. // "id"
  13954. // ],
  13955. // "parameters": {
  13956. // "id": {
  13957. // "description": "Account ID.",
  13958. // "format": "int64",
  13959. // "location": "query",
  13960. // "required": true,
  13961. // "type": "string"
  13962. // },
  13963. // "profileId": {
  13964. // "description": "User profile ID associated with this request.",
  13965. // "format": "int64",
  13966. // "location": "path",
  13967. // "required": true,
  13968. // "type": "string"
  13969. // }
  13970. // },
  13971. // "path": "userprofiles/{profileId}/accounts",
  13972. // "request": {
  13973. // "$ref": "Account"
  13974. // },
  13975. // "response": {
  13976. // "$ref": "Account"
  13977. // },
  13978. // "scopes": [
  13979. // "https://www.googleapis.com/auth/dfatrafficking"
  13980. // ]
  13981. // }
  13982. }
  13983. // method id "dfareporting.accounts.update":
  13984. type AccountsUpdateCall struct {
  13985. s *Service
  13986. profileId int64
  13987. account *Account
  13988. urlParams_ gensupport.URLParams
  13989. ctx_ context.Context
  13990. header_ http.Header
  13991. }
  13992. // Update: Updates an existing account.
  13993. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13994. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13995. c.profileId = profileId
  13996. c.account = account
  13997. return c
  13998. }
  13999. // Fields allows partial responses to be retrieved. See
  14000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14001. // for more information.
  14002. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  14003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14004. return c
  14005. }
  14006. // Context sets the context to be used in this call's Do method. Any
  14007. // pending HTTP request will be aborted if the provided context is
  14008. // canceled.
  14009. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  14010. c.ctx_ = ctx
  14011. return c
  14012. }
  14013. // Header returns an http.Header that can be modified by the caller to
  14014. // add HTTP headers to the request.
  14015. func (c *AccountsUpdateCall) Header() http.Header {
  14016. if c.header_ == nil {
  14017. c.header_ = make(http.Header)
  14018. }
  14019. return c.header_
  14020. }
  14021. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14022. reqHeaders := make(http.Header)
  14023. for k, v := range c.header_ {
  14024. reqHeaders[k] = v
  14025. }
  14026. reqHeaders.Set("User-Agent", c.s.userAgent())
  14027. var body io.Reader = nil
  14028. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  14029. if err != nil {
  14030. return nil, err
  14031. }
  14032. reqHeaders.Set("Content-Type", "application/json")
  14033. c.urlParams_.Set("alt", alt)
  14034. c.urlParams_.Set("prettyPrint", "false")
  14035. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  14036. urls += "?" + c.urlParams_.Encode()
  14037. req, err := http.NewRequest("PUT", urls, body)
  14038. if err != nil {
  14039. return nil, err
  14040. }
  14041. req.Header = reqHeaders
  14042. googleapi.Expand(req.URL, map[string]string{
  14043. "profileId": strconv.FormatInt(c.profileId, 10),
  14044. })
  14045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14046. }
  14047. // Do executes the "dfareporting.accounts.update" call.
  14048. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  14049. // code is an error. Response headers are in either
  14050. // *Account.ServerResponse.Header or (if a response was returned at all)
  14051. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14052. // check whether the returned error was because http.StatusNotModified
  14053. // was returned.
  14054. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  14055. gensupport.SetOptions(c.urlParams_, opts...)
  14056. res, err := c.doRequest("json")
  14057. if res != nil && res.StatusCode == http.StatusNotModified {
  14058. if res.Body != nil {
  14059. res.Body.Close()
  14060. }
  14061. return nil, &googleapi.Error{
  14062. Code: res.StatusCode,
  14063. Header: res.Header,
  14064. }
  14065. }
  14066. if err != nil {
  14067. return nil, err
  14068. }
  14069. defer googleapi.CloseBody(res)
  14070. if err := googleapi.CheckResponse(res); err != nil {
  14071. return nil, err
  14072. }
  14073. ret := &Account{
  14074. ServerResponse: googleapi.ServerResponse{
  14075. Header: res.Header,
  14076. HTTPStatusCode: res.StatusCode,
  14077. },
  14078. }
  14079. target := &ret
  14080. if err := gensupport.DecodeResponse(target, res); err != nil {
  14081. return nil, err
  14082. }
  14083. return ret, nil
  14084. // {
  14085. // "description": "Updates an existing account.",
  14086. // "httpMethod": "PUT",
  14087. // "id": "dfareporting.accounts.update",
  14088. // "parameterOrder": [
  14089. // "profileId"
  14090. // ],
  14091. // "parameters": {
  14092. // "profileId": {
  14093. // "description": "User profile ID associated with this request.",
  14094. // "format": "int64",
  14095. // "location": "path",
  14096. // "required": true,
  14097. // "type": "string"
  14098. // }
  14099. // },
  14100. // "path": "userprofiles/{profileId}/accounts",
  14101. // "request": {
  14102. // "$ref": "Account"
  14103. // },
  14104. // "response": {
  14105. // "$ref": "Account"
  14106. // },
  14107. // "scopes": [
  14108. // "https://www.googleapis.com/auth/dfatrafficking"
  14109. // ]
  14110. // }
  14111. }
  14112. // method id "dfareporting.ads.get":
  14113. type AdsGetCall struct {
  14114. s *Service
  14115. profileId int64
  14116. id int64
  14117. urlParams_ gensupport.URLParams
  14118. ifNoneMatch_ string
  14119. ctx_ context.Context
  14120. header_ http.Header
  14121. }
  14122. // Get: Gets one ad by ID.
  14123. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  14124. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14125. c.profileId = profileId
  14126. c.id = id
  14127. return c
  14128. }
  14129. // Fields allows partial responses to be retrieved. See
  14130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14131. // for more information.
  14132. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  14133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14134. return c
  14135. }
  14136. // IfNoneMatch sets the optional parameter which makes the operation
  14137. // fail if the object's ETag matches the given value. This is useful for
  14138. // getting updates only after the object has changed since the last
  14139. // request. Use googleapi.IsNotModified to check whether the response
  14140. // error from Do is the result of In-None-Match.
  14141. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  14142. c.ifNoneMatch_ = entityTag
  14143. return c
  14144. }
  14145. // Context sets the context to be used in this call's Do method. Any
  14146. // pending HTTP request will be aborted if the provided context is
  14147. // canceled.
  14148. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  14149. c.ctx_ = ctx
  14150. return c
  14151. }
  14152. // Header returns an http.Header that can be modified by the caller to
  14153. // add HTTP headers to the request.
  14154. func (c *AdsGetCall) Header() http.Header {
  14155. if c.header_ == nil {
  14156. c.header_ = make(http.Header)
  14157. }
  14158. return c.header_
  14159. }
  14160. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  14161. reqHeaders := make(http.Header)
  14162. for k, v := range c.header_ {
  14163. reqHeaders[k] = v
  14164. }
  14165. reqHeaders.Set("User-Agent", c.s.userAgent())
  14166. if c.ifNoneMatch_ != "" {
  14167. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14168. }
  14169. var body io.Reader = nil
  14170. c.urlParams_.Set("alt", alt)
  14171. c.urlParams_.Set("prettyPrint", "false")
  14172. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  14173. urls += "?" + c.urlParams_.Encode()
  14174. req, err := http.NewRequest("GET", urls, body)
  14175. if err != nil {
  14176. return nil, err
  14177. }
  14178. req.Header = reqHeaders
  14179. googleapi.Expand(req.URL, map[string]string{
  14180. "profileId": strconv.FormatInt(c.profileId, 10),
  14181. "id": strconv.FormatInt(c.id, 10),
  14182. })
  14183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14184. }
  14185. // Do executes the "dfareporting.ads.get" call.
  14186. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14187. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14188. // or (if a response was returned at all) in
  14189. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14190. // whether the returned error was because http.StatusNotModified was
  14191. // returned.
  14192. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14193. gensupport.SetOptions(c.urlParams_, opts...)
  14194. res, err := c.doRequest("json")
  14195. if res != nil && res.StatusCode == http.StatusNotModified {
  14196. if res.Body != nil {
  14197. res.Body.Close()
  14198. }
  14199. return nil, &googleapi.Error{
  14200. Code: res.StatusCode,
  14201. Header: res.Header,
  14202. }
  14203. }
  14204. if err != nil {
  14205. return nil, err
  14206. }
  14207. defer googleapi.CloseBody(res)
  14208. if err := googleapi.CheckResponse(res); err != nil {
  14209. return nil, err
  14210. }
  14211. ret := &Ad{
  14212. ServerResponse: googleapi.ServerResponse{
  14213. Header: res.Header,
  14214. HTTPStatusCode: res.StatusCode,
  14215. },
  14216. }
  14217. target := &ret
  14218. if err := gensupport.DecodeResponse(target, res); err != nil {
  14219. return nil, err
  14220. }
  14221. return ret, nil
  14222. // {
  14223. // "description": "Gets one ad by ID.",
  14224. // "httpMethod": "GET",
  14225. // "id": "dfareporting.ads.get",
  14226. // "parameterOrder": [
  14227. // "profileId",
  14228. // "id"
  14229. // ],
  14230. // "parameters": {
  14231. // "id": {
  14232. // "description": "Ad ID.",
  14233. // "format": "int64",
  14234. // "location": "path",
  14235. // "required": true,
  14236. // "type": "string"
  14237. // },
  14238. // "profileId": {
  14239. // "description": "User profile ID associated with this request.",
  14240. // "format": "int64",
  14241. // "location": "path",
  14242. // "required": true,
  14243. // "type": "string"
  14244. // }
  14245. // },
  14246. // "path": "userprofiles/{profileId}/ads/{id}",
  14247. // "response": {
  14248. // "$ref": "Ad"
  14249. // },
  14250. // "scopes": [
  14251. // "https://www.googleapis.com/auth/dfatrafficking"
  14252. // ]
  14253. // }
  14254. }
  14255. // method id "dfareporting.ads.insert":
  14256. type AdsInsertCall struct {
  14257. s *Service
  14258. profileId int64
  14259. ad *Ad
  14260. urlParams_ gensupport.URLParams
  14261. ctx_ context.Context
  14262. header_ http.Header
  14263. }
  14264. // Insert: Inserts a new ad.
  14265. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  14266. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14267. c.profileId = profileId
  14268. c.ad = ad
  14269. return c
  14270. }
  14271. // Fields allows partial responses to be retrieved. See
  14272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14273. // for more information.
  14274. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  14275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14276. return c
  14277. }
  14278. // Context sets the context to be used in this call's Do method. Any
  14279. // pending HTTP request will be aborted if the provided context is
  14280. // canceled.
  14281. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  14282. c.ctx_ = ctx
  14283. return c
  14284. }
  14285. // Header returns an http.Header that can be modified by the caller to
  14286. // add HTTP headers to the request.
  14287. func (c *AdsInsertCall) Header() http.Header {
  14288. if c.header_ == nil {
  14289. c.header_ = make(http.Header)
  14290. }
  14291. return c.header_
  14292. }
  14293. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  14294. reqHeaders := make(http.Header)
  14295. for k, v := range c.header_ {
  14296. reqHeaders[k] = v
  14297. }
  14298. reqHeaders.Set("User-Agent", c.s.userAgent())
  14299. var body io.Reader = nil
  14300. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14301. if err != nil {
  14302. return nil, err
  14303. }
  14304. reqHeaders.Set("Content-Type", "application/json")
  14305. c.urlParams_.Set("alt", alt)
  14306. c.urlParams_.Set("prettyPrint", "false")
  14307. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14308. urls += "?" + c.urlParams_.Encode()
  14309. req, err := http.NewRequest("POST", urls, body)
  14310. if err != nil {
  14311. return nil, err
  14312. }
  14313. req.Header = reqHeaders
  14314. googleapi.Expand(req.URL, map[string]string{
  14315. "profileId": strconv.FormatInt(c.profileId, 10),
  14316. })
  14317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14318. }
  14319. // Do executes the "dfareporting.ads.insert" call.
  14320. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14321. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14322. // or (if a response was returned at all) in
  14323. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14324. // whether the returned error was because http.StatusNotModified was
  14325. // returned.
  14326. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14327. gensupport.SetOptions(c.urlParams_, opts...)
  14328. res, err := c.doRequest("json")
  14329. if res != nil && res.StatusCode == http.StatusNotModified {
  14330. if res.Body != nil {
  14331. res.Body.Close()
  14332. }
  14333. return nil, &googleapi.Error{
  14334. Code: res.StatusCode,
  14335. Header: res.Header,
  14336. }
  14337. }
  14338. if err != nil {
  14339. return nil, err
  14340. }
  14341. defer googleapi.CloseBody(res)
  14342. if err := googleapi.CheckResponse(res); err != nil {
  14343. return nil, err
  14344. }
  14345. ret := &Ad{
  14346. ServerResponse: googleapi.ServerResponse{
  14347. Header: res.Header,
  14348. HTTPStatusCode: res.StatusCode,
  14349. },
  14350. }
  14351. target := &ret
  14352. if err := gensupport.DecodeResponse(target, res); err != nil {
  14353. return nil, err
  14354. }
  14355. return ret, nil
  14356. // {
  14357. // "description": "Inserts a new ad.",
  14358. // "httpMethod": "POST",
  14359. // "id": "dfareporting.ads.insert",
  14360. // "parameterOrder": [
  14361. // "profileId"
  14362. // ],
  14363. // "parameters": {
  14364. // "profileId": {
  14365. // "description": "User profile ID associated with this request.",
  14366. // "format": "int64",
  14367. // "location": "path",
  14368. // "required": true,
  14369. // "type": "string"
  14370. // }
  14371. // },
  14372. // "path": "userprofiles/{profileId}/ads",
  14373. // "request": {
  14374. // "$ref": "Ad"
  14375. // },
  14376. // "response": {
  14377. // "$ref": "Ad"
  14378. // },
  14379. // "scopes": [
  14380. // "https://www.googleapis.com/auth/dfatrafficking"
  14381. // ]
  14382. // }
  14383. }
  14384. // method id "dfareporting.ads.list":
  14385. type AdsListCall struct {
  14386. s *Service
  14387. profileId int64
  14388. urlParams_ gensupport.URLParams
  14389. ifNoneMatch_ string
  14390. ctx_ context.Context
  14391. header_ http.Header
  14392. }
  14393. // List: Retrieves a list of ads, possibly filtered. This method
  14394. // supports paging.
  14395. func (r *AdsService) List(profileId int64) *AdsListCall {
  14396. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14397. c.profileId = profileId
  14398. return c
  14399. }
  14400. // Active sets the optional parameter "active": Select only active ads.
  14401. func (c *AdsListCall) Active(active bool) *AdsListCall {
  14402. c.urlParams_.Set("active", fmt.Sprint(active))
  14403. return c
  14404. }
  14405. // AdvertiserId sets the optional parameter "advertiserId": Select only
  14406. // ads with this advertiser ID.
  14407. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  14408. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  14409. return c
  14410. }
  14411. // Archived sets the optional parameter "archived": Select only archived
  14412. // ads.
  14413. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  14414. c.urlParams_.Set("archived", fmt.Sprint(archived))
  14415. return c
  14416. }
  14417. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  14418. // Select only ads with these audience segment IDs.
  14419. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  14420. var audienceSegmentIds_ []string
  14421. for _, v := range audienceSegmentIds {
  14422. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  14423. }
  14424. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  14425. return c
  14426. }
  14427. // CampaignIds sets the optional parameter "campaignIds": Select only
  14428. // ads with these campaign IDs.
  14429. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  14430. var campaignIds_ []string
  14431. for _, v := range campaignIds {
  14432. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  14433. }
  14434. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  14435. return c
  14436. }
  14437. // Compatibility sets the optional parameter "compatibility": Select
  14438. // default ads with the specified compatibility. Applicable when type is
  14439. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  14440. // rendering either on desktop or on mobile devices for regular or
  14441. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  14442. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  14443. // in-stream video ads developed with the VAST standard.
  14444. //
  14445. // Possible values:
  14446. // "APP"
  14447. // "APP_INTERSTITIAL"
  14448. // "DISPLAY"
  14449. // "DISPLAY_INTERSTITIAL"
  14450. // "IN_STREAM_AUDIO"
  14451. // "IN_STREAM_VIDEO"
  14452. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  14453. c.urlParams_.Set("compatibility", compatibility)
  14454. return c
  14455. }
  14456. // CreativeIds sets the optional parameter "creativeIds": Select only
  14457. // ads with these creative IDs assigned.
  14458. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  14459. var creativeIds_ []string
  14460. for _, v := range creativeIds {
  14461. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  14462. }
  14463. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  14464. return c
  14465. }
  14466. // CreativeOptimizationConfigurationIds sets the optional parameter
  14467. // "creativeOptimizationConfigurationIds": Select only ads with these
  14468. // creative optimization configuration IDs.
  14469. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  14470. var creativeOptimizationConfigurationIds_ []string
  14471. for _, v := range creativeOptimizationConfigurationIds {
  14472. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  14473. }
  14474. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  14475. return c
  14476. }
  14477. // DynamicClickTracker sets the optional parameter
  14478. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  14479. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  14480. // trackers. If false, select static click trackers. Leave unset to
  14481. // select both.
  14482. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  14483. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  14484. return c
  14485. }
  14486. // Ids sets the optional parameter "ids": Select only ads with these
  14487. // IDs.
  14488. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  14489. var ids_ []string
  14490. for _, v := range ids {
  14491. ids_ = append(ids_, fmt.Sprint(v))
  14492. }
  14493. c.urlParams_.SetMulti("ids", ids_)
  14494. return c
  14495. }
  14496. // LandingPageIds sets the optional parameter "landingPageIds": Select
  14497. // only ads with these landing page IDs.
  14498. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  14499. var landingPageIds_ []string
  14500. for _, v := range landingPageIds {
  14501. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  14502. }
  14503. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14504. return c
  14505. }
  14506. // MaxResults sets the optional parameter "maxResults": Maximum number
  14507. // of results to return.
  14508. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14509. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14510. return c
  14511. }
  14512. // OverriddenEventTagId sets the optional parameter
  14513. // "overriddenEventTagId": Select only ads with this event tag override
  14514. // ID.
  14515. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14516. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14517. return c
  14518. }
  14519. // PageToken sets the optional parameter "pageToken": Value of the
  14520. // nextPageToken from the previous result page.
  14521. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14522. c.urlParams_.Set("pageToken", pageToken)
  14523. return c
  14524. }
  14525. // PlacementIds sets the optional parameter "placementIds": Select only
  14526. // ads with these placement IDs assigned.
  14527. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14528. var placementIds_ []string
  14529. for _, v := range placementIds {
  14530. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14531. }
  14532. c.urlParams_.SetMulti("placementIds", placementIds_)
  14533. return c
  14534. }
  14535. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14536. // Select only ads whose list targeting expression use these remarketing
  14537. // list IDs.
  14538. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14539. var remarketingListIds_ []string
  14540. for _, v := range remarketingListIds {
  14541. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14542. }
  14543. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14544. return c
  14545. }
  14546. // SearchString sets the optional parameter "searchString": Allows
  14547. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14548. // example, "ad*2015" will return objects with names like "ad June
  14549. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14550. // also add wildcards implicitly at the start and the end of the search
  14551. // string. For example, a search string of "ad" will match objects with
  14552. // name "my ad", "ad 2015", or simply "ad".
  14553. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14554. c.urlParams_.Set("searchString", searchString)
  14555. return c
  14556. }
  14557. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14558. // these size IDs.
  14559. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14560. var sizeIds_ []string
  14561. for _, v := range sizeIds {
  14562. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14563. }
  14564. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14565. return c
  14566. }
  14567. // SortField sets the optional parameter "sortField": Field by which to
  14568. // sort the list.
  14569. //
  14570. // Possible values:
  14571. // "ID" (default)
  14572. // "NAME"
  14573. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14574. c.urlParams_.Set("sortField", sortField)
  14575. return c
  14576. }
  14577. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14578. // results.
  14579. //
  14580. // Possible values:
  14581. // "ASCENDING" (default)
  14582. // "DESCENDING"
  14583. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14584. c.urlParams_.Set("sortOrder", sortOrder)
  14585. return c
  14586. }
  14587. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14588. // ads that are SSL-compliant.
  14589. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14590. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14591. return c
  14592. }
  14593. // SslRequired sets the optional parameter "sslRequired": Select only
  14594. // ads that require SSL.
  14595. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14596. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14597. return c
  14598. }
  14599. // Type sets the optional parameter "type": Select only ads with these
  14600. // types.
  14601. //
  14602. // Possible values:
  14603. // "AD_SERVING_CLICK_TRACKER"
  14604. // "AD_SERVING_DEFAULT_AD"
  14605. // "AD_SERVING_STANDARD_AD"
  14606. // "AD_SERVING_TRACKING"
  14607. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14608. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14609. return c
  14610. }
  14611. // Fields allows partial responses to be retrieved. See
  14612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14613. // for more information.
  14614. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14616. return c
  14617. }
  14618. // IfNoneMatch sets the optional parameter which makes the operation
  14619. // fail if the object's ETag matches the given value. This is useful for
  14620. // getting updates only after the object has changed since the last
  14621. // request. Use googleapi.IsNotModified to check whether the response
  14622. // error from Do is the result of In-None-Match.
  14623. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14624. c.ifNoneMatch_ = entityTag
  14625. return c
  14626. }
  14627. // Context sets the context to be used in this call's Do method. Any
  14628. // pending HTTP request will be aborted if the provided context is
  14629. // canceled.
  14630. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14631. c.ctx_ = ctx
  14632. return c
  14633. }
  14634. // Header returns an http.Header that can be modified by the caller to
  14635. // add HTTP headers to the request.
  14636. func (c *AdsListCall) Header() http.Header {
  14637. if c.header_ == nil {
  14638. c.header_ = make(http.Header)
  14639. }
  14640. return c.header_
  14641. }
  14642. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14643. reqHeaders := make(http.Header)
  14644. for k, v := range c.header_ {
  14645. reqHeaders[k] = v
  14646. }
  14647. reqHeaders.Set("User-Agent", c.s.userAgent())
  14648. if c.ifNoneMatch_ != "" {
  14649. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14650. }
  14651. var body io.Reader = nil
  14652. c.urlParams_.Set("alt", alt)
  14653. c.urlParams_.Set("prettyPrint", "false")
  14654. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14655. urls += "?" + c.urlParams_.Encode()
  14656. req, err := http.NewRequest("GET", urls, body)
  14657. if err != nil {
  14658. return nil, err
  14659. }
  14660. req.Header = reqHeaders
  14661. googleapi.Expand(req.URL, map[string]string{
  14662. "profileId": strconv.FormatInt(c.profileId, 10),
  14663. })
  14664. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14665. }
  14666. // Do executes the "dfareporting.ads.list" call.
  14667. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14668. // status code is an error. Response headers are in either
  14669. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14670. // at all) in error.(*googleapi.Error).Header. Use
  14671. // googleapi.IsNotModified to check whether the returned error was
  14672. // because http.StatusNotModified was returned.
  14673. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14674. gensupport.SetOptions(c.urlParams_, opts...)
  14675. res, err := c.doRequest("json")
  14676. if res != nil && res.StatusCode == http.StatusNotModified {
  14677. if res.Body != nil {
  14678. res.Body.Close()
  14679. }
  14680. return nil, &googleapi.Error{
  14681. Code: res.StatusCode,
  14682. Header: res.Header,
  14683. }
  14684. }
  14685. if err != nil {
  14686. return nil, err
  14687. }
  14688. defer googleapi.CloseBody(res)
  14689. if err := googleapi.CheckResponse(res); err != nil {
  14690. return nil, err
  14691. }
  14692. ret := &AdsListResponse{
  14693. ServerResponse: googleapi.ServerResponse{
  14694. Header: res.Header,
  14695. HTTPStatusCode: res.StatusCode,
  14696. },
  14697. }
  14698. target := &ret
  14699. if err := gensupport.DecodeResponse(target, res); err != nil {
  14700. return nil, err
  14701. }
  14702. return ret, nil
  14703. // {
  14704. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14705. // "httpMethod": "GET",
  14706. // "id": "dfareporting.ads.list",
  14707. // "parameterOrder": [
  14708. // "profileId"
  14709. // ],
  14710. // "parameters": {
  14711. // "active": {
  14712. // "description": "Select only active ads.",
  14713. // "location": "query",
  14714. // "type": "boolean"
  14715. // },
  14716. // "advertiserId": {
  14717. // "description": "Select only ads with this advertiser ID.",
  14718. // "format": "int64",
  14719. // "location": "query",
  14720. // "type": "string"
  14721. // },
  14722. // "archived": {
  14723. // "description": "Select only archived ads.",
  14724. // "location": "query",
  14725. // "type": "boolean"
  14726. // },
  14727. // "audienceSegmentIds": {
  14728. // "description": "Select only ads with these audience segment IDs.",
  14729. // "format": "int64",
  14730. // "location": "query",
  14731. // "repeated": true,
  14732. // "type": "string"
  14733. // },
  14734. // "campaignIds": {
  14735. // "description": "Select only ads with these campaign IDs.",
  14736. // "format": "int64",
  14737. // "location": "query",
  14738. // "repeated": true,
  14739. // "type": "string"
  14740. // },
  14741. // "compatibility": {
  14742. // "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.",
  14743. // "enum": [
  14744. // "APP",
  14745. // "APP_INTERSTITIAL",
  14746. // "DISPLAY",
  14747. // "DISPLAY_INTERSTITIAL",
  14748. // "IN_STREAM_AUDIO",
  14749. // "IN_STREAM_VIDEO"
  14750. // ],
  14751. // "enumDescriptions": [
  14752. // "",
  14753. // "",
  14754. // "",
  14755. // "",
  14756. // "",
  14757. // ""
  14758. // ],
  14759. // "location": "query",
  14760. // "type": "string"
  14761. // },
  14762. // "creativeIds": {
  14763. // "description": "Select only ads with these creative IDs assigned.",
  14764. // "format": "int64",
  14765. // "location": "query",
  14766. // "repeated": true,
  14767. // "type": "string"
  14768. // },
  14769. // "creativeOptimizationConfigurationIds": {
  14770. // "description": "Select only ads with these creative optimization configuration IDs.",
  14771. // "format": "int64",
  14772. // "location": "query",
  14773. // "repeated": true,
  14774. // "type": "string"
  14775. // },
  14776. // "dynamicClickTracker": {
  14777. // "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.",
  14778. // "location": "query",
  14779. // "type": "boolean"
  14780. // },
  14781. // "ids": {
  14782. // "description": "Select only ads with these IDs.",
  14783. // "format": "int64",
  14784. // "location": "query",
  14785. // "repeated": true,
  14786. // "type": "string"
  14787. // },
  14788. // "landingPageIds": {
  14789. // "description": "Select only ads with these landing page IDs.",
  14790. // "format": "int64",
  14791. // "location": "query",
  14792. // "repeated": true,
  14793. // "type": "string"
  14794. // },
  14795. // "maxResults": {
  14796. // "default": "1000",
  14797. // "description": "Maximum number of results to return.",
  14798. // "format": "int32",
  14799. // "location": "query",
  14800. // "maximum": "1000",
  14801. // "minimum": "0",
  14802. // "type": "integer"
  14803. // },
  14804. // "overriddenEventTagId": {
  14805. // "description": "Select only ads with this event tag override ID.",
  14806. // "format": "int64",
  14807. // "location": "query",
  14808. // "type": "string"
  14809. // },
  14810. // "pageToken": {
  14811. // "description": "Value of the nextPageToken from the previous result page.",
  14812. // "location": "query",
  14813. // "type": "string"
  14814. // },
  14815. // "placementIds": {
  14816. // "description": "Select only ads with these placement IDs assigned.",
  14817. // "format": "int64",
  14818. // "location": "query",
  14819. // "repeated": true,
  14820. // "type": "string"
  14821. // },
  14822. // "profileId": {
  14823. // "description": "User profile ID associated with this request.",
  14824. // "format": "int64",
  14825. // "location": "path",
  14826. // "required": true,
  14827. // "type": "string"
  14828. // },
  14829. // "remarketingListIds": {
  14830. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14831. // "format": "int64",
  14832. // "location": "query",
  14833. // "repeated": true,
  14834. // "type": "string"
  14835. // },
  14836. // "searchString": {
  14837. // "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\".",
  14838. // "location": "query",
  14839. // "type": "string"
  14840. // },
  14841. // "sizeIds": {
  14842. // "description": "Select only ads with these size IDs.",
  14843. // "format": "int64",
  14844. // "location": "query",
  14845. // "repeated": true,
  14846. // "type": "string"
  14847. // },
  14848. // "sortField": {
  14849. // "default": "ID",
  14850. // "description": "Field by which to sort the list.",
  14851. // "enum": [
  14852. // "ID",
  14853. // "NAME"
  14854. // ],
  14855. // "enumDescriptions": [
  14856. // "",
  14857. // ""
  14858. // ],
  14859. // "location": "query",
  14860. // "type": "string"
  14861. // },
  14862. // "sortOrder": {
  14863. // "default": "ASCENDING",
  14864. // "description": "Order of sorted results.",
  14865. // "enum": [
  14866. // "ASCENDING",
  14867. // "DESCENDING"
  14868. // ],
  14869. // "enumDescriptions": [
  14870. // "",
  14871. // ""
  14872. // ],
  14873. // "location": "query",
  14874. // "type": "string"
  14875. // },
  14876. // "sslCompliant": {
  14877. // "description": "Select only ads that are SSL-compliant.",
  14878. // "location": "query",
  14879. // "type": "boolean"
  14880. // },
  14881. // "sslRequired": {
  14882. // "description": "Select only ads that require SSL.",
  14883. // "location": "query",
  14884. // "type": "boolean"
  14885. // },
  14886. // "type": {
  14887. // "description": "Select only ads with these types.",
  14888. // "enum": [
  14889. // "AD_SERVING_CLICK_TRACKER",
  14890. // "AD_SERVING_DEFAULT_AD",
  14891. // "AD_SERVING_STANDARD_AD",
  14892. // "AD_SERVING_TRACKING"
  14893. // ],
  14894. // "enumDescriptions": [
  14895. // "",
  14896. // "",
  14897. // "",
  14898. // ""
  14899. // ],
  14900. // "location": "query",
  14901. // "repeated": true,
  14902. // "type": "string"
  14903. // }
  14904. // },
  14905. // "path": "userprofiles/{profileId}/ads",
  14906. // "response": {
  14907. // "$ref": "AdsListResponse"
  14908. // },
  14909. // "scopes": [
  14910. // "https://www.googleapis.com/auth/dfatrafficking"
  14911. // ]
  14912. // }
  14913. }
  14914. // Pages invokes f for each page of results.
  14915. // A non-nil error returned from f will halt the iteration.
  14916. // The provided context supersedes any context provided to the Context method.
  14917. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14918. c.ctx_ = ctx
  14919. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14920. for {
  14921. x, err := c.Do()
  14922. if err != nil {
  14923. return err
  14924. }
  14925. if err := f(x); err != nil {
  14926. return err
  14927. }
  14928. if x.NextPageToken == "" {
  14929. return nil
  14930. }
  14931. c.PageToken(x.NextPageToken)
  14932. }
  14933. }
  14934. // method id "dfareporting.ads.patch":
  14935. type AdsPatchCall struct {
  14936. s *Service
  14937. profileId int64
  14938. ad *Ad
  14939. urlParams_ gensupport.URLParams
  14940. ctx_ context.Context
  14941. header_ http.Header
  14942. }
  14943. // Patch: Updates an existing ad. This method supports patch semantics.
  14944. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14945. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14946. c.profileId = profileId
  14947. c.urlParams_.Set("id", fmt.Sprint(id))
  14948. c.ad = ad
  14949. return c
  14950. }
  14951. // Fields allows partial responses to be retrieved. See
  14952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14953. // for more information.
  14954. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14956. return c
  14957. }
  14958. // Context sets the context to be used in this call's Do method. Any
  14959. // pending HTTP request will be aborted if the provided context is
  14960. // canceled.
  14961. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14962. c.ctx_ = ctx
  14963. return c
  14964. }
  14965. // Header returns an http.Header that can be modified by the caller to
  14966. // add HTTP headers to the request.
  14967. func (c *AdsPatchCall) Header() http.Header {
  14968. if c.header_ == nil {
  14969. c.header_ = make(http.Header)
  14970. }
  14971. return c.header_
  14972. }
  14973. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14974. reqHeaders := make(http.Header)
  14975. for k, v := range c.header_ {
  14976. reqHeaders[k] = v
  14977. }
  14978. reqHeaders.Set("User-Agent", c.s.userAgent())
  14979. var body io.Reader = nil
  14980. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14981. if err != nil {
  14982. return nil, err
  14983. }
  14984. reqHeaders.Set("Content-Type", "application/json")
  14985. c.urlParams_.Set("alt", alt)
  14986. c.urlParams_.Set("prettyPrint", "false")
  14987. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14988. urls += "?" + c.urlParams_.Encode()
  14989. req, err := http.NewRequest("PATCH", urls, body)
  14990. if err != nil {
  14991. return nil, err
  14992. }
  14993. req.Header = reqHeaders
  14994. googleapi.Expand(req.URL, map[string]string{
  14995. "profileId": strconv.FormatInt(c.profileId, 10),
  14996. })
  14997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14998. }
  14999. // Do executes the "dfareporting.ads.patch" call.
  15000. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  15001. // is an error. Response headers are in either *Ad.ServerResponse.Header
  15002. // or (if a response was returned at all) in
  15003. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15004. // whether the returned error was because http.StatusNotModified was
  15005. // returned.
  15006. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  15007. gensupport.SetOptions(c.urlParams_, opts...)
  15008. res, err := c.doRequest("json")
  15009. if res != nil && res.StatusCode == http.StatusNotModified {
  15010. if res.Body != nil {
  15011. res.Body.Close()
  15012. }
  15013. return nil, &googleapi.Error{
  15014. Code: res.StatusCode,
  15015. Header: res.Header,
  15016. }
  15017. }
  15018. if err != nil {
  15019. return nil, err
  15020. }
  15021. defer googleapi.CloseBody(res)
  15022. if err := googleapi.CheckResponse(res); err != nil {
  15023. return nil, err
  15024. }
  15025. ret := &Ad{
  15026. ServerResponse: googleapi.ServerResponse{
  15027. Header: res.Header,
  15028. HTTPStatusCode: res.StatusCode,
  15029. },
  15030. }
  15031. target := &ret
  15032. if err := gensupport.DecodeResponse(target, res); err != nil {
  15033. return nil, err
  15034. }
  15035. return ret, nil
  15036. // {
  15037. // "description": "Updates an existing ad. This method supports patch semantics.",
  15038. // "httpMethod": "PATCH",
  15039. // "id": "dfareporting.ads.patch",
  15040. // "parameterOrder": [
  15041. // "profileId",
  15042. // "id"
  15043. // ],
  15044. // "parameters": {
  15045. // "id": {
  15046. // "description": "Ad ID.",
  15047. // "format": "int64",
  15048. // "location": "query",
  15049. // "required": true,
  15050. // "type": "string"
  15051. // },
  15052. // "profileId": {
  15053. // "description": "User profile ID associated with this request.",
  15054. // "format": "int64",
  15055. // "location": "path",
  15056. // "required": true,
  15057. // "type": "string"
  15058. // }
  15059. // },
  15060. // "path": "userprofiles/{profileId}/ads",
  15061. // "request": {
  15062. // "$ref": "Ad"
  15063. // },
  15064. // "response": {
  15065. // "$ref": "Ad"
  15066. // },
  15067. // "scopes": [
  15068. // "https://www.googleapis.com/auth/dfatrafficking"
  15069. // ]
  15070. // }
  15071. }
  15072. // method id "dfareporting.ads.update":
  15073. type AdsUpdateCall struct {
  15074. s *Service
  15075. profileId int64
  15076. ad *Ad
  15077. urlParams_ gensupport.URLParams
  15078. ctx_ context.Context
  15079. header_ http.Header
  15080. }
  15081. // Update: Updates an existing ad.
  15082. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  15083. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15084. c.profileId = profileId
  15085. c.ad = ad
  15086. return c
  15087. }
  15088. // Fields allows partial responses to be retrieved. See
  15089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15090. // for more information.
  15091. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  15092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15093. return c
  15094. }
  15095. // Context sets the context to be used in this call's Do method. Any
  15096. // pending HTTP request will be aborted if the provided context is
  15097. // canceled.
  15098. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  15099. c.ctx_ = ctx
  15100. return c
  15101. }
  15102. // Header returns an http.Header that can be modified by the caller to
  15103. // add HTTP headers to the request.
  15104. func (c *AdsUpdateCall) Header() http.Header {
  15105. if c.header_ == nil {
  15106. c.header_ = make(http.Header)
  15107. }
  15108. return c.header_
  15109. }
  15110. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15111. reqHeaders := make(http.Header)
  15112. for k, v := range c.header_ {
  15113. reqHeaders[k] = v
  15114. }
  15115. reqHeaders.Set("User-Agent", c.s.userAgent())
  15116. var body io.Reader = nil
  15117. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  15118. if err != nil {
  15119. return nil, err
  15120. }
  15121. reqHeaders.Set("Content-Type", "application/json")
  15122. c.urlParams_.Set("alt", alt)
  15123. c.urlParams_.Set("prettyPrint", "false")
  15124. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  15125. urls += "?" + c.urlParams_.Encode()
  15126. req, err := http.NewRequest("PUT", urls, body)
  15127. if err != nil {
  15128. return nil, err
  15129. }
  15130. req.Header = reqHeaders
  15131. googleapi.Expand(req.URL, map[string]string{
  15132. "profileId": strconv.FormatInt(c.profileId, 10),
  15133. })
  15134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15135. }
  15136. // Do executes the "dfareporting.ads.update" call.
  15137. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  15138. // is an error. Response headers are in either *Ad.ServerResponse.Header
  15139. // or (if a response was returned at all) in
  15140. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15141. // whether the returned error was because http.StatusNotModified was
  15142. // returned.
  15143. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  15144. gensupport.SetOptions(c.urlParams_, opts...)
  15145. res, err := c.doRequest("json")
  15146. if res != nil && res.StatusCode == http.StatusNotModified {
  15147. if res.Body != nil {
  15148. res.Body.Close()
  15149. }
  15150. return nil, &googleapi.Error{
  15151. Code: res.StatusCode,
  15152. Header: res.Header,
  15153. }
  15154. }
  15155. if err != nil {
  15156. return nil, err
  15157. }
  15158. defer googleapi.CloseBody(res)
  15159. if err := googleapi.CheckResponse(res); err != nil {
  15160. return nil, err
  15161. }
  15162. ret := &Ad{
  15163. ServerResponse: googleapi.ServerResponse{
  15164. Header: res.Header,
  15165. HTTPStatusCode: res.StatusCode,
  15166. },
  15167. }
  15168. target := &ret
  15169. if err := gensupport.DecodeResponse(target, res); err != nil {
  15170. return nil, err
  15171. }
  15172. return ret, nil
  15173. // {
  15174. // "description": "Updates an existing ad.",
  15175. // "httpMethod": "PUT",
  15176. // "id": "dfareporting.ads.update",
  15177. // "parameterOrder": [
  15178. // "profileId"
  15179. // ],
  15180. // "parameters": {
  15181. // "profileId": {
  15182. // "description": "User profile ID associated with this request.",
  15183. // "format": "int64",
  15184. // "location": "path",
  15185. // "required": true,
  15186. // "type": "string"
  15187. // }
  15188. // },
  15189. // "path": "userprofiles/{profileId}/ads",
  15190. // "request": {
  15191. // "$ref": "Ad"
  15192. // },
  15193. // "response": {
  15194. // "$ref": "Ad"
  15195. // },
  15196. // "scopes": [
  15197. // "https://www.googleapis.com/auth/dfatrafficking"
  15198. // ]
  15199. // }
  15200. }
  15201. // method id "dfareporting.advertiserGroups.delete":
  15202. type AdvertiserGroupsDeleteCall struct {
  15203. s *Service
  15204. profileId int64
  15205. id int64
  15206. urlParams_ gensupport.URLParams
  15207. ctx_ context.Context
  15208. header_ http.Header
  15209. }
  15210. // Delete: Deletes an existing advertiser group.
  15211. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  15212. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15213. c.profileId = profileId
  15214. c.id = id
  15215. return c
  15216. }
  15217. // Fields allows partial responses to be retrieved. See
  15218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15219. // for more information.
  15220. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  15221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15222. return c
  15223. }
  15224. // Context sets the context to be used in this call's Do method. Any
  15225. // pending HTTP request will be aborted if the provided context is
  15226. // canceled.
  15227. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  15228. c.ctx_ = ctx
  15229. return c
  15230. }
  15231. // Header returns an http.Header that can be modified by the caller to
  15232. // add HTTP headers to the request.
  15233. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  15234. if c.header_ == nil {
  15235. c.header_ = make(http.Header)
  15236. }
  15237. return c.header_
  15238. }
  15239. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15240. reqHeaders := make(http.Header)
  15241. for k, v := range c.header_ {
  15242. reqHeaders[k] = v
  15243. }
  15244. reqHeaders.Set("User-Agent", c.s.userAgent())
  15245. var body io.Reader = nil
  15246. c.urlParams_.Set("alt", alt)
  15247. c.urlParams_.Set("prettyPrint", "false")
  15248. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15249. urls += "?" + c.urlParams_.Encode()
  15250. req, err := http.NewRequest("DELETE", urls, body)
  15251. if err != nil {
  15252. return nil, err
  15253. }
  15254. req.Header = reqHeaders
  15255. googleapi.Expand(req.URL, map[string]string{
  15256. "profileId": strconv.FormatInt(c.profileId, 10),
  15257. "id": strconv.FormatInt(c.id, 10),
  15258. })
  15259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15260. }
  15261. // Do executes the "dfareporting.advertiserGroups.delete" call.
  15262. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15263. gensupport.SetOptions(c.urlParams_, opts...)
  15264. res, err := c.doRequest("json")
  15265. if err != nil {
  15266. return err
  15267. }
  15268. defer googleapi.CloseBody(res)
  15269. if err := googleapi.CheckResponse(res); err != nil {
  15270. return err
  15271. }
  15272. return nil
  15273. // {
  15274. // "description": "Deletes an existing advertiser group.",
  15275. // "httpMethod": "DELETE",
  15276. // "id": "dfareporting.advertiserGroups.delete",
  15277. // "parameterOrder": [
  15278. // "profileId",
  15279. // "id"
  15280. // ],
  15281. // "parameters": {
  15282. // "id": {
  15283. // "description": "Advertiser group ID.",
  15284. // "format": "int64",
  15285. // "location": "path",
  15286. // "required": true,
  15287. // "type": "string"
  15288. // },
  15289. // "profileId": {
  15290. // "description": "User profile ID associated with this request.",
  15291. // "format": "int64",
  15292. // "location": "path",
  15293. // "required": true,
  15294. // "type": "string"
  15295. // }
  15296. // },
  15297. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15298. // "scopes": [
  15299. // "https://www.googleapis.com/auth/dfatrafficking"
  15300. // ]
  15301. // }
  15302. }
  15303. // method id "dfareporting.advertiserGroups.get":
  15304. type AdvertiserGroupsGetCall struct {
  15305. s *Service
  15306. profileId int64
  15307. id int64
  15308. urlParams_ gensupport.URLParams
  15309. ifNoneMatch_ string
  15310. ctx_ context.Context
  15311. header_ http.Header
  15312. }
  15313. // Get: Gets one advertiser group by ID.
  15314. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  15315. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15316. c.profileId = profileId
  15317. c.id = id
  15318. return c
  15319. }
  15320. // Fields allows partial responses to be retrieved. See
  15321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15322. // for more information.
  15323. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  15324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15325. return c
  15326. }
  15327. // IfNoneMatch sets the optional parameter which makes the operation
  15328. // fail if the object's ETag matches the given value. This is useful for
  15329. // getting updates only after the object has changed since the last
  15330. // request. Use googleapi.IsNotModified to check whether the response
  15331. // error from Do is the result of In-None-Match.
  15332. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  15333. c.ifNoneMatch_ = entityTag
  15334. return c
  15335. }
  15336. // Context sets the context to be used in this call's Do method. Any
  15337. // pending HTTP request will be aborted if the provided context is
  15338. // canceled.
  15339. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  15340. c.ctx_ = ctx
  15341. return c
  15342. }
  15343. // Header returns an http.Header that can be modified by the caller to
  15344. // add HTTP headers to the request.
  15345. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  15346. if c.header_ == nil {
  15347. c.header_ = make(http.Header)
  15348. }
  15349. return c.header_
  15350. }
  15351. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  15352. reqHeaders := make(http.Header)
  15353. for k, v := range c.header_ {
  15354. reqHeaders[k] = v
  15355. }
  15356. reqHeaders.Set("User-Agent", c.s.userAgent())
  15357. if c.ifNoneMatch_ != "" {
  15358. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15359. }
  15360. var body io.Reader = nil
  15361. c.urlParams_.Set("alt", alt)
  15362. c.urlParams_.Set("prettyPrint", "false")
  15363. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15364. urls += "?" + c.urlParams_.Encode()
  15365. req, err := http.NewRequest("GET", urls, body)
  15366. if err != nil {
  15367. return nil, err
  15368. }
  15369. req.Header = reqHeaders
  15370. googleapi.Expand(req.URL, map[string]string{
  15371. "profileId": strconv.FormatInt(c.profileId, 10),
  15372. "id": strconv.FormatInt(c.id, 10),
  15373. })
  15374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15375. }
  15376. // Do executes the "dfareporting.advertiserGroups.get" call.
  15377. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15378. // status code is an error. Response headers are in either
  15379. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15380. // at all) in error.(*googleapi.Error).Header. Use
  15381. // googleapi.IsNotModified to check whether the returned error was
  15382. // because http.StatusNotModified was returned.
  15383. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15384. gensupport.SetOptions(c.urlParams_, opts...)
  15385. res, err := c.doRequest("json")
  15386. if res != nil && res.StatusCode == http.StatusNotModified {
  15387. if res.Body != nil {
  15388. res.Body.Close()
  15389. }
  15390. return nil, &googleapi.Error{
  15391. Code: res.StatusCode,
  15392. Header: res.Header,
  15393. }
  15394. }
  15395. if err != nil {
  15396. return nil, err
  15397. }
  15398. defer googleapi.CloseBody(res)
  15399. if err := googleapi.CheckResponse(res); err != nil {
  15400. return nil, err
  15401. }
  15402. ret := &AdvertiserGroup{
  15403. ServerResponse: googleapi.ServerResponse{
  15404. Header: res.Header,
  15405. HTTPStatusCode: res.StatusCode,
  15406. },
  15407. }
  15408. target := &ret
  15409. if err := gensupport.DecodeResponse(target, res); err != nil {
  15410. return nil, err
  15411. }
  15412. return ret, nil
  15413. // {
  15414. // "description": "Gets one advertiser group by ID.",
  15415. // "httpMethod": "GET",
  15416. // "id": "dfareporting.advertiserGroups.get",
  15417. // "parameterOrder": [
  15418. // "profileId",
  15419. // "id"
  15420. // ],
  15421. // "parameters": {
  15422. // "id": {
  15423. // "description": "Advertiser group ID.",
  15424. // "format": "int64",
  15425. // "location": "path",
  15426. // "required": true,
  15427. // "type": "string"
  15428. // },
  15429. // "profileId": {
  15430. // "description": "User profile ID associated with this request.",
  15431. // "format": "int64",
  15432. // "location": "path",
  15433. // "required": true,
  15434. // "type": "string"
  15435. // }
  15436. // },
  15437. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15438. // "response": {
  15439. // "$ref": "AdvertiserGroup"
  15440. // },
  15441. // "scopes": [
  15442. // "https://www.googleapis.com/auth/dfatrafficking"
  15443. // ]
  15444. // }
  15445. }
  15446. // method id "dfareporting.advertiserGroups.insert":
  15447. type AdvertiserGroupsInsertCall struct {
  15448. s *Service
  15449. profileId int64
  15450. advertisergroup *AdvertiserGroup
  15451. urlParams_ gensupport.URLParams
  15452. ctx_ context.Context
  15453. header_ http.Header
  15454. }
  15455. // Insert: Inserts a new advertiser group.
  15456. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  15457. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15458. c.profileId = profileId
  15459. c.advertisergroup = advertisergroup
  15460. return c
  15461. }
  15462. // Fields allows partial responses to be retrieved. See
  15463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15464. // for more information.
  15465. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  15466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15467. return c
  15468. }
  15469. // Context sets the context to be used in this call's Do method. Any
  15470. // pending HTTP request will be aborted if the provided context is
  15471. // canceled.
  15472. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  15473. c.ctx_ = ctx
  15474. return c
  15475. }
  15476. // Header returns an http.Header that can be modified by the caller to
  15477. // add HTTP headers to the request.
  15478. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  15479. if c.header_ == nil {
  15480. c.header_ = make(http.Header)
  15481. }
  15482. return c.header_
  15483. }
  15484. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  15485. reqHeaders := make(http.Header)
  15486. for k, v := range c.header_ {
  15487. reqHeaders[k] = v
  15488. }
  15489. reqHeaders.Set("User-Agent", c.s.userAgent())
  15490. var body io.Reader = nil
  15491. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15492. if err != nil {
  15493. return nil, err
  15494. }
  15495. reqHeaders.Set("Content-Type", "application/json")
  15496. c.urlParams_.Set("alt", alt)
  15497. c.urlParams_.Set("prettyPrint", "false")
  15498. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15499. urls += "?" + c.urlParams_.Encode()
  15500. req, err := http.NewRequest("POST", urls, body)
  15501. if err != nil {
  15502. return nil, err
  15503. }
  15504. req.Header = reqHeaders
  15505. googleapi.Expand(req.URL, map[string]string{
  15506. "profileId": strconv.FormatInt(c.profileId, 10),
  15507. })
  15508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15509. }
  15510. // Do executes the "dfareporting.advertiserGroups.insert" call.
  15511. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15512. // status code is an error. Response headers are in either
  15513. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15514. // at all) in error.(*googleapi.Error).Header. Use
  15515. // googleapi.IsNotModified to check whether the returned error was
  15516. // because http.StatusNotModified was returned.
  15517. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15518. gensupport.SetOptions(c.urlParams_, opts...)
  15519. res, err := c.doRequest("json")
  15520. if res != nil && res.StatusCode == http.StatusNotModified {
  15521. if res.Body != nil {
  15522. res.Body.Close()
  15523. }
  15524. return nil, &googleapi.Error{
  15525. Code: res.StatusCode,
  15526. Header: res.Header,
  15527. }
  15528. }
  15529. if err != nil {
  15530. return nil, err
  15531. }
  15532. defer googleapi.CloseBody(res)
  15533. if err := googleapi.CheckResponse(res); err != nil {
  15534. return nil, err
  15535. }
  15536. ret := &AdvertiserGroup{
  15537. ServerResponse: googleapi.ServerResponse{
  15538. Header: res.Header,
  15539. HTTPStatusCode: res.StatusCode,
  15540. },
  15541. }
  15542. target := &ret
  15543. if err := gensupport.DecodeResponse(target, res); err != nil {
  15544. return nil, err
  15545. }
  15546. return ret, nil
  15547. // {
  15548. // "description": "Inserts a new advertiser group.",
  15549. // "httpMethod": "POST",
  15550. // "id": "dfareporting.advertiserGroups.insert",
  15551. // "parameterOrder": [
  15552. // "profileId"
  15553. // ],
  15554. // "parameters": {
  15555. // "profileId": {
  15556. // "description": "User profile ID associated with this request.",
  15557. // "format": "int64",
  15558. // "location": "path",
  15559. // "required": true,
  15560. // "type": "string"
  15561. // }
  15562. // },
  15563. // "path": "userprofiles/{profileId}/advertiserGroups",
  15564. // "request": {
  15565. // "$ref": "AdvertiserGroup"
  15566. // },
  15567. // "response": {
  15568. // "$ref": "AdvertiserGroup"
  15569. // },
  15570. // "scopes": [
  15571. // "https://www.googleapis.com/auth/dfatrafficking"
  15572. // ]
  15573. // }
  15574. }
  15575. // method id "dfareporting.advertiserGroups.list":
  15576. type AdvertiserGroupsListCall struct {
  15577. s *Service
  15578. profileId int64
  15579. urlParams_ gensupport.URLParams
  15580. ifNoneMatch_ string
  15581. ctx_ context.Context
  15582. header_ http.Header
  15583. }
  15584. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15585. // method supports paging.
  15586. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15587. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15588. c.profileId = profileId
  15589. return c
  15590. }
  15591. // Ids sets the optional parameter "ids": Select only advertiser groups
  15592. // with these IDs.
  15593. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15594. var ids_ []string
  15595. for _, v := range ids {
  15596. ids_ = append(ids_, fmt.Sprint(v))
  15597. }
  15598. c.urlParams_.SetMulti("ids", ids_)
  15599. return c
  15600. }
  15601. // MaxResults sets the optional parameter "maxResults": Maximum number
  15602. // of results to return.
  15603. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15604. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15605. return c
  15606. }
  15607. // PageToken sets the optional parameter "pageToken": Value of the
  15608. // nextPageToken from the previous result page.
  15609. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15610. c.urlParams_.Set("pageToken", pageToken)
  15611. return c
  15612. }
  15613. // SearchString sets the optional parameter "searchString": Allows
  15614. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15615. // example, "advertiser*2015" will return objects with names like
  15616. // "advertiser group June 2015", "advertiser group April 2015", or
  15617. // simply "advertiser group 2015". Most of the searches also add
  15618. // wildcards implicitly at the start and the end of the search string.
  15619. // For example, a search string of "advertisergroup" will match objects
  15620. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15621. // "advertisergroup".
  15622. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15623. c.urlParams_.Set("searchString", searchString)
  15624. return c
  15625. }
  15626. // SortField sets the optional parameter "sortField": Field by which to
  15627. // sort the list.
  15628. //
  15629. // Possible values:
  15630. // "ID" (default)
  15631. // "NAME"
  15632. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15633. c.urlParams_.Set("sortField", sortField)
  15634. return c
  15635. }
  15636. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15637. // results.
  15638. //
  15639. // Possible values:
  15640. // "ASCENDING" (default)
  15641. // "DESCENDING"
  15642. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15643. c.urlParams_.Set("sortOrder", sortOrder)
  15644. return c
  15645. }
  15646. // Fields allows partial responses to be retrieved. See
  15647. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15648. // for more information.
  15649. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15651. return c
  15652. }
  15653. // IfNoneMatch sets the optional parameter which makes the operation
  15654. // fail if the object's ETag matches the given value. This is useful for
  15655. // getting updates only after the object has changed since the last
  15656. // request. Use googleapi.IsNotModified to check whether the response
  15657. // error from Do is the result of In-None-Match.
  15658. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15659. c.ifNoneMatch_ = entityTag
  15660. return c
  15661. }
  15662. // Context sets the context to be used in this call's Do method. Any
  15663. // pending HTTP request will be aborted if the provided context is
  15664. // canceled.
  15665. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15666. c.ctx_ = ctx
  15667. return c
  15668. }
  15669. // Header returns an http.Header that can be modified by the caller to
  15670. // add HTTP headers to the request.
  15671. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15672. if c.header_ == nil {
  15673. c.header_ = make(http.Header)
  15674. }
  15675. return c.header_
  15676. }
  15677. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15678. reqHeaders := make(http.Header)
  15679. for k, v := range c.header_ {
  15680. reqHeaders[k] = v
  15681. }
  15682. reqHeaders.Set("User-Agent", c.s.userAgent())
  15683. if c.ifNoneMatch_ != "" {
  15684. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15685. }
  15686. var body io.Reader = nil
  15687. c.urlParams_.Set("alt", alt)
  15688. c.urlParams_.Set("prettyPrint", "false")
  15689. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15690. urls += "?" + c.urlParams_.Encode()
  15691. req, err := http.NewRequest("GET", urls, body)
  15692. if err != nil {
  15693. return nil, err
  15694. }
  15695. req.Header = reqHeaders
  15696. googleapi.Expand(req.URL, map[string]string{
  15697. "profileId": strconv.FormatInt(c.profileId, 10),
  15698. })
  15699. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15700. }
  15701. // Do executes the "dfareporting.advertiserGroups.list" call.
  15702. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15703. // non-nil. Any non-2xx status code is an error. Response headers are in
  15704. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15705. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15706. // googleapi.IsNotModified to check whether the returned error was
  15707. // because http.StatusNotModified was returned.
  15708. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15709. gensupport.SetOptions(c.urlParams_, opts...)
  15710. res, err := c.doRequest("json")
  15711. if res != nil && res.StatusCode == http.StatusNotModified {
  15712. if res.Body != nil {
  15713. res.Body.Close()
  15714. }
  15715. return nil, &googleapi.Error{
  15716. Code: res.StatusCode,
  15717. Header: res.Header,
  15718. }
  15719. }
  15720. if err != nil {
  15721. return nil, err
  15722. }
  15723. defer googleapi.CloseBody(res)
  15724. if err := googleapi.CheckResponse(res); err != nil {
  15725. return nil, err
  15726. }
  15727. ret := &AdvertiserGroupsListResponse{
  15728. ServerResponse: googleapi.ServerResponse{
  15729. Header: res.Header,
  15730. HTTPStatusCode: res.StatusCode,
  15731. },
  15732. }
  15733. target := &ret
  15734. if err := gensupport.DecodeResponse(target, res); err != nil {
  15735. return nil, err
  15736. }
  15737. return ret, nil
  15738. // {
  15739. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15740. // "httpMethod": "GET",
  15741. // "id": "dfareporting.advertiserGroups.list",
  15742. // "parameterOrder": [
  15743. // "profileId"
  15744. // ],
  15745. // "parameters": {
  15746. // "ids": {
  15747. // "description": "Select only advertiser groups with these IDs.",
  15748. // "format": "int64",
  15749. // "location": "query",
  15750. // "repeated": true,
  15751. // "type": "string"
  15752. // },
  15753. // "maxResults": {
  15754. // "default": "1000",
  15755. // "description": "Maximum number of results to return.",
  15756. // "format": "int32",
  15757. // "location": "query",
  15758. // "maximum": "1000",
  15759. // "minimum": "0",
  15760. // "type": "integer"
  15761. // },
  15762. // "pageToken": {
  15763. // "description": "Value of the nextPageToken from the previous result page.",
  15764. // "location": "query",
  15765. // "type": "string"
  15766. // },
  15767. // "profileId": {
  15768. // "description": "User profile ID associated with this request.",
  15769. // "format": "int64",
  15770. // "location": "path",
  15771. // "required": true,
  15772. // "type": "string"
  15773. // },
  15774. // "searchString": {
  15775. // "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\".",
  15776. // "location": "query",
  15777. // "type": "string"
  15778. // },
  15779. // "sortField": {
  15780. // "default": "ID",
  15781. // "description": "Field by which to sort the list.",
  15782. // "enum": [
  15783. // "ID",
  15784. // "NAME"
  15785. // ],
  15786. // "enumDescriptions": [
  15787. // "",
  15788. // ""
  15789. // ],
  15790. // "location": "query",
  15791. // "type": "string"
  15792. // },
  15793. // "sortOrder": {
  15794. // "default": "ASCENDING",
  15795. // "description": "Order of sorted results.",
  15796. // "enum": [
  15797. // "ASCENDING",
  15798. // "DESCENDING"
  15799. // ],
  15800. // "enumDescriptions": [
  15801. // "",
  15802. // ""
  15803. // ],
  15804. // "location": "query",
  15805. // "type": "string"
  15806. // }
  15807. // },
  15808. // "path": "userprofiles/{profileId}/advertiserGroups",
  15809. // "response": {
  15810. // "$ref": "AdvertiserGroupsListResponse"
  15811. // },
  15812. // "scopes": [
  15813. // "https://www.googleapis.com/auth/dfatrafficking"
  15814. // ]
  15815. // }
  15816. }
  15817. // Pages invokes f for each page of results.
  15818. // A non-nil error returned from f will halt the iteration.
  15819. // The provided context supersedes any context provided to the Context method.
  15820. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15821. c.ctx_ = ctx
  15822. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15823. for {
  15824. x, err := c.Do()
  15825. if err != nil {
  15826. return err
  15827. }
  15828. if err := f(x); err != nil {
  15829. return err
  15830. }
  15831. if x.NextPageToken == "" {
  15832. return nil
  15833. }
  15834. c.PageToken(x.NextPageToken)
  15835. }
  15836. }
  15837. // method id "dfareporting.advertiserGroups.patch":
  15838. type AdvertiserGroupsPatchCall struct {
  15839. s *Service
  15840. profileId int64
  15841. advertisergroup *AdvertiserGroup
  15842. urlParams_ gensupport.URLParams
  15843. ctx_ context.Context
  15844. header_ http.Header
  15845. }
  15846. // Patch: Updates an existing advertiser group. This method supports
  15847. // patch semantics.
  15848. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15849. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15850. c.profileId = profileId
  15851. c.urlParams_.Set("id", fmt.Sprint(id))
  15852. c.advertisergroup = advertisergroup
  15853. return c
  15854. }
  15855. // Fields allows partial responses to be retrieved. See
  15856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15857. // for more information.
  15858. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15860. return c
  15861. }
  15862. // Context sets the context to be used in this call's Do method. Any
  15863. // pending HTTP request will be aborted if the provided context is
  15864. // canceled.
  15865. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15866. c.ctx_ = ctx
  15867. return c
  15868. }
  15869. // Header returns an http.Header that can be modified by the caller to
  15870. // add HTTP headers to the request.
  15871. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15872. if c.header_ == nil {
  15873. c.header_ = make(http.Header)
  15874. }
  15875. return c.header_
  15876. }
  15877. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15878. reqHeaders := make(http.Header)
  15879. for k, v := range c.header_ {
  15880. reqHeaders[k] = v
  15881. }
  15882. reqHeaders.Set("User-Agent", c.s.userAgent())
  15883. var body io.Reader = nil
  15884. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15885. if err != nil {
  15886. return nil, err
  15887. }
  15888. reqHeaders.Set("Content-Type", "application/json")
  15889. c.urlParams_.Set("alt", alt)
  15890. c.urlParams_.Set("prettyPrint", "false")
  15891. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15892. urls += "?" + c.urlParams_.Encode()
  15893. req, err := http.NewRequest("PATCH", urls, body)
  15894. if err != nil {
  15895. return nil, err
  15896. }
  15897. req.Header = reqHeaders
  15898. googleapi.Expand(req.URL, map[string]string{
  15899. "profileId": strconv.FormatInt(c.profileId, 10),
  15900. })
  15901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15902. }
  15903. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15904. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15905. // status code is an error. Response headers are in either
  15906. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15907. // at all) in error.(*googleapi.Error).Header. Use
  15908. // googleapi.IsNotModified to check whether the returned error was
  15909. // because http.StatusNotModified was returned.
  15910. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15911. gensupport.SetOptions(c.urlParams_, opts...)
  15912. res, err := c.doRequest("json")
  15913. if res != nil && res.StatusCode == http.StatusNotModified {
  15914. if res.Body != nil {
  15915. res.Body.Close()
  15916. }
  15917. return nil, &googleapi.Error{
  15918. Code: res.StatusCode,
  15919. Header: res.Header,
  15920. }
  15921. }
  15922. if err != nil {
  15923. return nil, err
  15924. }
  15925. defer googleapi.CloseBody(res)
  15926. if err := googleapi.CheckResponse(res); err != nil {
  15927. return nil, err
  15928. }
  15929. ret := &AdvertiserGroup{
  15930. ServerResponse: googleapi.ServerResponse{
  15931. Header: res.Header,
  15932. HTTPStatusCode: res.StatusCode,
  15933. },
  15934. }
  15935. target := &ret
  15936. if err := gensupport.DecodeResponse(target, res); err != nil {
  15937. return nil, err
  15938. }
  15939. return ret, nil
  15940. // {
  15941. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15942. // "httpMethod": "PATCH",
  15943. // "id": "dfareporting.advertiserGroups.patch",
  15944. // "parameterOrder": [
  15945. // "profileId",
  15946. // "id"
  15947. // ],
  15948. // "parameters": {
  15949. // "id": {
  15950. // "description": "Advertiser group ID.",
  15951. // "format": "int64",
  15952. // "location": "query",
  15953. // "required": true,
  15954. // "type": "string"
  15955. // },
  15956. // "profileId": {
  15957. // "description": "User profile ID associated with this request.",
  15958. // "format": "int64",
  15959. // "location": "path",
  15960. // "required": true,
  15961. // "type": "string"
  15962. // }
  15963. // },
  15964. // "path": "userprofiles/{profileId}/advertiserGroups",
  15965. // "request": {
  15966. // "$ref": "AdvertiserGroup"
  15967. // },
  15968. // "response": {
  15969. // "$ref": "AdvertiserGroup"
  15970. // },
  15971. // "scopes": [
  15972. // "https://www.googleapis.com/auth/dfatrafficking"
  15973. // ]
  15974. // }
  15975. }
  15976. // method id "dfareporting.advertiserGroups.update":
  15977. type AdvertiserGroupsUpdateCall struct {
  15978. s *Service
  15979. profileId int64
  15980. advertisergroup *AdvertiserGroup
  15981. urlParams_ gensupport.URLParams
  15982. ctx_ context.Context
  15983. header_ http.Header
  15984. }
  15985. // Update: Updates an existing advertiser group.
  15986. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15987. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15988. c.profileId = profileId
  15989. c.advertisergroup = advertisergroup
  15990. return c
  15991. }
  15992. // Fields allows partial responses to be retrieved. See
  15993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15994. // for more information.
  15995. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15997. return c
  15998. }
  15999. // Context sets the context to be used in this call's Do method. Any
  16000. // pending HTTP request will be aborted if the provided context is
  16001. // canceled.
  16002. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  16003. c.ctx_ = ctx
  16004. return c
  16005. }
  16006. // Header returns an http.Header that can be modified by the caller to
  16007. // add HTTP headers to the request.
  16008. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  16009. if c.header_ == nil {
  16010. c.header_ = make(http.Header)
  16011. }
  16012. return c.header_
  16013. }
  16014. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  16015. reqHeaders := make(http.Header)
  16016. for k, v := range c.header_ {
  16017. reqHeaders[k] = v
  16018. }
  16019. reqHeaders.Set("User-Agent", c.s.userAgent())
  16020. var body io.Reader = nil
  16021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  16022. if err != nil {
  16023. return nil, err
  16024. }
  16025. reqHeaders.Set("Content-Type", "application/json")
  16026. c.urlParams_.Set("alt", alt)
  16027. c.urlParams_.Set("prettyPrint", "false")
  16028. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  16029. urls += "?" + c.urlParams_.Encode()
  16030. req, err := http.NewRequest("PUT", urls, body)
  16031. if err != nil {
  16032. return nil, err
  16033. }
  16034. req.Header = reqHeaders
  16035. googleapi.Expand(req.URL, map[string]string{
  16036. "profileId": strconv.FormatInt(c.profileId, 10),
  16037. })
  16038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16039. }
  16040. // Do executes the "dfareporting.advertiserGroups.update" call.
  16041. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  16042. // status code is an error. Response headers are in either
  16043. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  16044. // at all) in error.(*googleapi.Error).Header. Use
  16045. // googleapi.IsNotModified to check whether the returned error was
  16046. // because http.StatusNotModified was returned.
  16047. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  16048. gensupport.SetOptions(c.urlParams_, opts...)
  16049. res, err := c.doRequest("json")
  16050. if res != nil && res.StatusCode == http.StatusNotModified {
  16051. if res.Body != nil {
  16052. res.Body.Close()
  16053. }
  16054. return nil, &googleapi.Error{
  16055. Code: res.StatusCode,
  16056. Header: res.Header,
  16057. }
  16058. }
  16059. if err != nil {
  16060. return nil, err
  16061. }
  16062. defer googleapi.CloseBody(res)
  16063. if err := googleapi.CheckResponse(res); err != nil {
  16064. return nil, err
  16065. }
  16066. ret := &AdvertiserGroup{
  16067. ServerResponse: googleapi.ServerResponse{
  16068. Header: res.Header,
  16069. HTTPStatusCode: res.StatusCode,
  16070. },
  16071. }
  16072. target := &ret
  16073. if err := gensupport.DecodeResponse(target, res); err != nil {
  16074. return nil, err
  16075. }
  16076. return ret, nil
  16077. // {
  16078. // "description": "Updates an existing advertiser group.",
  16079. // "httpMethod": "PUT",
  16080. // "id": "dfareporting.advertiserGroups.update",
  16081. // "parameterOrder": [
  16082. // "profileId"
  16083. // ],
  16084. // "parameters": {
  16085. // "profileId": {
  16086. // "description": "User profile ID associated with this request.",
  16087. // "format": "int64",
  16088. // "location": "path",
  16089. // "required": true,
  16090. // "type": "string"
  16091. // }
  16092. // },
  16093. // "path": "userprofiles/{profileId}/advertiserGroups",
  16094. // "request": {
  16095. // "$ref": "AdvertiserGroup"
  16096. // },
  16097. // "response": {
  16098. // "$ref": "AdvertiserGroup"
  16099. // },
  16100. // "scopes": [
  16101. // "https://www.googleapis.com/auth/dfatrafficking"
  16102. // ]
  16103. // }
  16104. }
  16105. // method id "dfareporting.advertiserLandingPages.get":
  16106. type AdvertiserLandingPagesGetCall struct {
  16107. s *Service
  16108. profileId int64
  16109. id int64
  16110. urlParams_ gensupport.URLParams
  16111. ifNoneMatch_ string
  16112. ctx_ context.Context
  16113. header_ http.Header
  16114. }
  16115. // Get: Gets one landing page by ID.
  16116. func (r *AdvertiserLandingPagesService) Get(profileId int64, id int64) *AdvertiserLandingPagesGetCall {
  16117. c := &AdvertiserLandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16118. c.profileId = profileId
  16119. c.id = id
  16120. return c
  16121. }
  16122. // Fields allows partial responses to be retrieved. See
  16123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16124. // for more information.
  16125. func (c *AdvertiserLandingPagesGetCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesGetCall {
  16126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16127. return c
  16128. }
  16129. // IfNoneMatch sets the optional parameter which makes the operation
  16130. // fail if the object's ETag matches the given value. This is useful for
  16131. // getting updates only after the object has changed since the last
  16132. // request. Use googleapi.IsNotModified to check whether the response
  16133. // error from Do is the result of In-None-Match.
  16134. func (c *AdvertiserLandingPagesGetCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesGetCall {
  16135. c.ifNoneMatch_ = entityTag
  16136. return c
  16137. }
  16138. // Context sets the context to be used in this call's Do method. Any
  16139. // pending HTTP request will be aborted if the provided context is
  16140. // canceled.
  16141. func (c *AdvertiserLandingPagesGetCall) Context(ctx context.Context) *AdvertiserLandingPagesGetCall {
  16142. c.ctx_ = ctx
  16143. return c
  16144. }
  16145. // Header returns an http.Header that can be modified by the caller to
  16146. // add HTTP headers to the request.
  16147. func (c *AdvertiserLandingPagesGetCall) Header() http.Header {
  16148. if c.header_ == nil {
  16149. c.header_ = make(http.Header)
  16150. }
  16151. return c.header_
  16152. }
  16153. func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  16154. reqHeaders := make(http.Header)
  16155. for k, v := range c.header_ {
  16156. reqHeaders[k] = v
  16157. }
  16158. reqHeaders.Set("User-Agent", c.s.userAgent())
  16159. if c.ifNoneMatch_ != "" {
  16160. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16161. }
  16162. var body io.Reader = nil
  16163. c.urlParams_.Set("alt", alt)
  16164. c.urlParams_.Set("prettyPrint", "false")
  16165. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages/{id}")
  16166. urls += "?" + c.urlParams_.Encode()
  16167. req, err := http.NewRequest("GET", urls, body)
  16168. if err != nil {
  16169. return nil, err
  16170. }
  16171. req.Header = reqHeaders
  16172. googleapi.Expand(req.URL, map[string]string{
  16173. "profileId": strconv.FormatInt(c.profileId, 10),
  16174. "id": strconv.FormatInt(c.id, 10),
  16175. })
  16176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16177. }
  16178. // Do executes the "dfareporting.advertiserLandingPages.get" call.
  16179. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16180. // status code is an error. Response headers are in either
  16181. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16183. // to check whether the returned error was because
  16184. // http.StatusNotModified was returned.
  16185. func (c *AdvertiserLandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16186. gensupport.SetOptions(c.urlParams_, opts...)
  16187. res, err := c.doRequest("json")
  16188. if res != nil && res.StatusCode == http.StatusNotModified {
  16189. if res.Body != nil {
  16190. res.Body.Close()
  16191. }
  16192. return nil, &googleapi.Error{
  16193. Code: res.StatusCode,
  16194. Header: res.Header,
  16195. }
  16196. }
  16197. if err != nil {
  16198. return nil, err
  16199. }
  16200. defer googleapi.CloseBody(res)
  16201. if err := googleapi.CheckResponse(res); err != nil {
  16202. return nil, err
  16203. }
  16204. ret := &LandingPage{
  16205. ServerResponse: googleapi.ServerResponse{
  16206. Header: res.Header,
  16207. HTTPStatusCode: res.StatusCode,
  16208. },
  16209. }
  16210. target := &ret
  16211. if err := gensupport.DecodeResponse(target, res); err != nil {
  16212. return nil, err
  16213. }
  16214. return ret, nil
  16215. // {
  16216. // "description": "Gets one landing page by ID.",
  16217. // "httpMethod": "GET",
  16218. // "id": "dfareporting.advertiserLandingPages.get",
  16219. // "parameterOrder": [
  16220. // "profileId",
  16221. // "id"
  16222. // ],
  16223. // "parameters": {
  16224. // "id": {
  16225. // "description": "Landing page ID.",
  16226. // "format": "int64",
  16227. // "location": "path",
  16228. // "required": true,
  16229. // "type": "string"
  16230. // },
  16231. // "profileId": {
  16232. // "description": "User profile ID associated with this request.",
  16233. // "format": "int64",
  16234. // "location": "path",
  16235. // "required": true,
  16236. // "type": "string"
  16237. // }
  16238. // },
  16239. // "path": "userprofiles/{profileId}/advertiserLandingPages/{id}",
  16240. // "response": {
  16241. // "$ref": "LandingPage"
  16242. // },
  16243. // "scopes": [
  16244. // "https://www.googleapis.com/auth/dfatrafficking"
  16245. // ]
  16246. // }
  16247. }
  16248. // method id "dfareporting.advertiserLandingPages.insert":
  16249. type AdvertiserLandingPagesInsertCall struct {
  16250. s *Service
  16251. profileId int64
  16252. landingpage *LandingPage
  16253. urlParams_ gensupport.URLParams
  16254. ctx_ context.Context
  16255. header_ http.Header
  16256. }
  16257. // Insert: Inserts a new landing page.
  16258. func (r *AdvertiserLandingPagesService) Insert(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesInsertCall {
  16259. c := &AdvertiserLandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16260. c.profileId = profileId
  16261. c.landingpage = landingpage
  16262. return c
  16263. }
  16264. // Fields allows partial responses to be retrieved. See
  16265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16266. // for more information.
  16267. func (c *AdvertiserLandingPagesInsertCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesInsertCall {
  16268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16269. return c
  16270. }
  16271. // Context sets the context to be used in this call's Do method. Any
  16272. // pending HTTP request will be aborted if the provided context is
  16273. // canceled.
  16274. func (c *AdvertiserLandingPagesInsertCall) Context(ctx context.Context) *AdvertiserLandingPagesInsertCall {
  16275. c.ctx_ = ctx
  16276. return c
  16277. }
  16278. // Header returns an http.Header that can be modified by the caller to
  16279. // add HTTP headers to the request.
  16280. func (c *AdvertiserLandingPagesInsertCall) Header() http.Header {
  16281. if c.header_ == nil {
  16282. c.header_ = make(http.Header)
  16283. }
  16284. return c.header_
  16285. }
  16286. func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  16287. reqHeaders := make(http.Header)
  16288. for k, v := range c.header_ {
  16289. reqHeaders[k] = v
  16290. }
  16291. reqHeaders.Set("User-Agent", c.s.userAgent())
  16292. var body io.Reader = nil
  16293. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16294. if err != nil {
  16295. return nil, err
  16296. }
  16297. reqHeaders.Set("Content-Type", "application/json")
  16298. c.urlParams_.Set("alt", alt)
  16299. c.urlParams_.Set("prettyPrint", "false")
  16300. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16301. urls += "?" + c.urlParams_.Encode()
  16302. req, err := http.NewRequest("POST", urls, body)
  16303. if err != nil {
  16304. return nil, err
  16305. }
  16306. req.Header = reqHeaders
  16307. googleapi.Expand(req.URL, map[string]string{
  16308. "profileId": strconv.FormatInt(c.profileId, 10),
  16309. })
  16310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16311. }
  16312. // Do executes the "dfareporting.advertiserLandingPages.insert" call.
  16313. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16314. // status code is an error. Response headers are in either
  16315. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16316. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16317. // to check whether the returned error was because
  16318. // http.StatusNotModified was returned.
  16319. func (c *AdvertiserLandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16320. gensupport.SetOptions(c.urlParams_, opts...)
  16321. res, err := c.doRequest("json")
  16322. if res != nil && res.StatusCode == http.StatusNotModified {
  16323. if res.Body != nil {
  16324. res.Body.Close()
  16325. }
  16326. return nil, &googleapi.Error{
  16327. Code: res.StatusCode,
  16328. Header: res.Header,
  16329. }
  16330. }
  16331. if err != nil {
  16332. return nil, err
  16333. }
  16334. defer googleapi.CloseBody(res)
  16335. if err := googleapi.CheckResponse(res); err != nil {
  16336. return nil, err
  16337. }
  16338. ret := &LandingPage{
  16339. ServerResponse: googleapi.ServerResponse{
  16340. Header: res.Header,
  16341. HTTPStatusCode: res.StatusCode,
  16342. },
  16343. }
  16344. target := &ret
  16345. if err := gensupport.DecodeResponse(target, res); err != nil {
  16346. return nil, err
  16347. }
  16348. return ret, nil
  16349. // {
  16350. // "description": "Inserts a new landing page.",
  16351. // "httpMethod": "POST",
  16352. // "id": "dfareporting.advertiserLandingPages.insert",
  16353. // "parameterOrder": [
  16354. // "profileId"
  16355. // ],
  16356. // "parameters": {
  16357. // "profileId": {
  16358. // "description": "User profile ID associated with this request.",
  16359. // "format": "int64",
  16360. // "location": "path",
  16361. // "required": true,
  16362. // "type": "string"
  16363. // }
  16364. // },
  16365. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16366. // "request": {
  16367. // "$ref": "LandingPage"
  16368. // },
  16369. // "response": {
  16370. // "$ref": "LandingPage"
  16371. // },
  16372. // "scopes": [
  16373. // "https://www.googleapis.com/auth/dfatrafficking"
  16374. // ]
  16375. // }
  16376. }
  16377. // method id "dfareporting.advertiserLandingPages.list":
  16378. type AdvertiserLandingPagesListCall struct {
  16379. s *Service
  16380. profileId int64
  16381. urlParams_ gensupport.URLParams
  16382. ifNoneMatch_ string
  16383. ctx_ context.Context
  16384. header_ http.Header
  16385. }
  16386. // List: Retrieves a list of landing pages.
  16387. func (r *AdvertiserLandingPagesService) List(profileId int64) *AdvertiserLandingPagesListCall {
  16388. c := &AdvertiserLandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16389. c.profileId = profileId
  16390. return c
  16391. }
  16392. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  16393. // only landing pages that belong to these advertisers.
  16394. func (c *AdvertiserLandingPagesListCall) AdvertiserIds(advertiserIds ...int64) *AdvertiserLandingPagesListCall {
  16395. var advertiserIds_ []string
  16396. for _, v := range advertiserIds {
  16397. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  16398. }
  16399. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  16400. return c
  16401. }
  16402. // Archived sets the optional parameter "archived": Select only archived
  16403. // landing pages. Don't set this field to select both archived and
  16404. // non-archived landing pages.
  16405. func (c *AdvertiserLandingPagesListCall) Archived(archived bool) *AdvertiserLandingPagesListCall {
  16406. c.urlParams_.Set("archived", fmt.Sprint(archived))
  16407. return c
  16408. }
  16409. // CampaignIds sets the optional parameter "campaignIds": Select only
  16410. // landing pages that are associated with these campaigns.
  16411. func (c *AdvertiserLandingPagesListCall) CampaignIds(campaignIds ...int64) *AdvertiserLandingPagesListCall {
  16412. var campaignIds_ []string
  16413. for _, v := range campaignIds {
  16414. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  16415. }
  16416. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  16417. return c
  16418. }
  16419. // Ids sets the optional parameter "ids": Select only landing pages with
  16420. // these IDs.
  16421. func (c *AdvertiserLandingPagesListCall) Ids(ids ...int64) *AdvertiserLandingPagesListCall {
  16422. var ids_ []string
  16423. for _, v := range ids {
  16424. ids_ = append(ids_, fmt.Sprint(v))
  16425. }
  16426. c.urlParams_.SetMulti("ids", ids_)
  16427. return c
  16428. }
  16429. // MaxResults sets the optional parameter "maxResults": Maximum number
  16430. // of results to return.
  16431. func (c *AdvertiserLandingPagesListCall) MaxResults(maxResults int64) *AdvertiserLandingPagesListCall {
  16432. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16433. return c
  16434. }
  16435. // PageToken sets the optional parameter "pageToken": Value of the
  16436. // nextPageToken from the previous result page.
  16437. func (c *AdvertiserLandingPagesListCall) PageToken(pageToken string) *AdvertiserLandingPagesListCall {
  16438. c.urlParams_.Set("pageToken", pageToken)
  16439. return c
  16440. }
  16441. // SearchString sets the optional parameter "searchString": Allows
  16442. // searching for landing pages by name or ID. Wildcards (*) are allowed.
  16443. // For example, "landingpage*2017" will return landing pages with names
  16444. // like "landingpage July 2017", "landingpage March 2017", or simply
  16445. // "landingpage 2017". Most of the searches also add wildcards
  16446. // implicitly at the start and the end of the search string. For
  16447. // example, a search string of "landingpage" will match campaigns with
  16448. // name "my landingpage", "landingpage 2015", or simply "landingpage".
  16449. func (c *AdvertiserLandingPagesListCall) SearchString(searchString string) *AdvertiserLandingPagesListCall {
  16450. c.urlParams_.Set("searchString", searchString)
  16451. return c
  16452. }
  16453. // SortField sets the optional parameter "sortField": Field by which to
  16454. // sort the list.
  16455. //
  16456. // Possible values:
  16457. // "ID" (default)
  16458. // "NAME"
  16459. func (c *AdvertiserLandingPagesListCall) SortField(sortField string) *AdvertiserLandingPagesListCall {
  16460. c.urlParams_.Set("sortField", sortField)
  16461. return c
  16462. }
  16463. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16464. // results.
  16465. //
  16466. // Possible values:
  16467. // "ASCENDING" (default)
  16468. // "DESCENDING"
  16469. func (c *AdvertiserLandingPagesListCall) SortOrder(sortOrder string) *AdvertiserLandingPagesListCall {
  16470. c.urlParams_.Set("sortOrder", sortOrder)
  16471. return c
  16472. }
  16473. // SubaccountId sets the optional parameter "subaccountId": Select only
  16474. // landing pages that belong to this subaccount.
  16475. func (c *AdvertiserLandingPagesListCall) SubaccountId(subaccountId int64) *AdvertiserLandingPagesListCall {
  16476. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16477. return c
  16478. }
  16479. // Fields allows partial responses to be retrieved. See
  16480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16481. // for more information.
  16482. func (c *AdvertiserLandingPagesListCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesListCall {
  16483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16484. return c
  16485. }
  16486. // IfNoneMatch sets the optional parameter which makes the operation
  16487. // fail if the object's ETag matches the given value. This is useful for
  16488. // getting updates only after the object has changed since the last
  16489. // request. Use googleapi.IsNotModified to check whether the response
  16490. // error from Do is the result of In-None-Match.
  16491. func (c *AdvertiserLandingPagesListCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesListCall {
  16492. c.ifNoneMatch_ = entityTag
  16493. return c
  16494. }
  16495. // Context sets the context to be used in this call's Do method. Any
  16496. // pending HTTP request will be aborted if the provided context is
  16497. // canceled.
  16498. func (c *AdvertiserLandingPagesListCall) Context(ctx context.Context) *AdvertiserLandingPagesListCall {
  16499. c.ctx_ = ctx
  16500. return c
  16501. }
  16502. // Header returns an http.Header that can be modified by the caller to
  16503. // add HTTP headers to the request.
  16504. func (c *AdvertiserLandingPagesListCall) Header() http.Header {
  16505. if c.header_ == nil {
  16506. c.header_ = make(http.Header)
  16507. }
  16508. return c.header_
  16509. }
  16510. func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  16511. reqHeaders := make(http.Header)
  16512. for k, v := range c.header_ {
  16513. reqHeaders[k] = v
  16514. }
  16515. reqHeaders.Set("User-Agent", c.s.userAgent())
  16516. if c.ifNoneMatch_ != "" {
  16517. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16518. }
  16519. var body io.Reader = nil
  16520. c.urlParams_.Set("alt", alt)
  16521. c.urlParams_.Set("prettyPrint", "false")
  16522. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16523. urls += "?" + c.urlParams_.Encode()
  16524. req, err := http.NewRequest("GET", urls, body)
  16525. if err != nil {
  16526. return nil, err
  16527. }
  16528. req.Header = reqHeaders
  16529. googleapi.Expand(req.URL, map[string]string{
  16530. "profileId": strconv.FormatInt(c.profileId, 10),
  16531. })
  16532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16533. }
  16534. // Do executes the "dfareporting.advertiserLandingPages.list" call.
  16535. // Exactly one of *AdvertiserLandingPagesListResponse or error will be
  16536. // non-nil. Any non-2xx status code is an error. Response headers are in
  16537. // either *AdvertiserLandingPagesListResponse.ServerResponse.Header or
  16538. // (if a response was returned at all) in
  16539. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16540. // whether the returned error was because http.StatusNotModified was
  16541. // returned.
  16542. func (c *AdvertiserLandingPagesListCall) Do(opts ...googleapi.CallOption) (*AdvertiserLandingPagesListResponse, error) {
  16543. gensupport.SetOptions(c.urlParams_, opts...)
  16544. res, err := c.doRequest("json")
  16545. if res != nil && res.StatusCode == http.StatusNotModified {
  16546. if res.Body != nil {
  16547. res.Body.Close()
  16548. }
  16549. return nil, &googleapi.Error{
  16550. Code: res.StatusCode,
  16551. Header: res.Header,
  16552. }
  16553. }
  16554. if err != nil {
  16555. return nil, err
  16556. }
  16557. defer googleapi.CloseBody(res)
  16558. if err := googleapi.CheckResponse(res); err != nil {
  16559. return nil, err
  16560. }
  16561. ret := &AdvertiserLandingPagesListResponse{
  16562. ServerResponse: googleapi.ServerResponse{
  16563. Header: res.Header,
  16564. HTTPStatusCode: res.StatusCode,
  16565. },
  16566. }
  16567. target := &ret
  16568. if err := gensupport.DecodeResponse(target, res); err != nil {
  16569. return nil, err
  16570. }
  16571. return ret, nil
  16572. // {
  16573. // "description": "Retrieves a list of landing pages.",
  16574. // "httpMethod": "GET",
  16575. // "id": "dfareporting.advertiserLandingPages.list",
  16576. // "parameterOrder": [
  16577. // "profileId"
  16578. // ],
  16579. // "parameters": {
  16580. // "advertiserIds": {
  16581. // "description": "Select only landing pages that belong to these advertisers.",
  16582. // "format": "int64",
  16583. // "location": "query",
  16584. // "repeated": true,
  16585. // "type": "string"
  16586. // },
  16587. // "archived": {
  16588. // "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.",
  16589. // "location": "query",
  16590. // "type": "boolean"
  16591. // },
  16592. // "campaignIds": {
  16593. // "description": "Select only landing pages that are associated with these campaigns.",
  16594. // "format": "int64",
  16595. // "location": "query",
  16596. // "repeated": true,
  16597. // "type": "string"
  16598. // },
  16599. // "ids": {
  16600. // "description": "Select only landing pages with these IDs.",
  16601. // "format": "int64",
  16602. // "location": "query",
  16603. // "repeated": true,
  16604. // "type": "string"
  16605. // },
  16606. // "maxResults": {
  16607. // "default": "1000",
  16608. // "description": "Maximum number of results to return.",
  16609. // "format": "int32",
  16610. // "location": "query",
  16611. // "maximum": "1000",
  16612. // "minimum": "0",
  16613. // "type": "integer"
  16614. // },
  16615. // "pageToken": {
  16616. // "description": "Value of the nextPageToken from the previous result page.",
  16617. // "location": "query",
  16618. // "type": "string"
  16619. // },
  16620. // "profileId": {
  16621. // "description": "User profile ID associated with this request.",
  16622. // "format": "int64",
  16623. // "location": "path",
  16624. // "required": true,
  16625. // "type": "string"
  16626. // },
  16627. // "searchString": {
  16628. // "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\".",
  16629. // "location": "query",
  16630. // "type": "string"
  16631. // },
  16632. // "sortField": {
  16633. // "default": "ID",
  16634. // "description": "Field by which to sort the list.",
  16635. // "enum": [
  16636. // "ID",
  16637. // "NAME"
  16638. // ],
  16639. // "enumDescriptions": [
  16640. // "",
  16641. // ""
  16642. // ],
  16643. // "location": "query",
  16644. // "type": "string"
  16645. // },
  16646. // "sortOrder": {
  16647. // "default": "ASCENDING",
  16648. // "description": "Order of sorted results.",
  16649. // "enum": [
  16650. // "ASCENDING",
  16651. // "DESCENDING"
  16652. // ],
  16653. // "enumDescriptions": [
  16654. // "",
  16655. // ""
  16656. // ],
  16657. // "location": "query",
  16658. // "type": "string"
  16659. // },
  16660. // "subaccountId": {
  16661. // "description": "Select only landing pages that belong to this subaccount.",
  16662. // "format": "int64",
  16663. // "location": "query",
  16664. // "type": "string"
  16665. // }
  16666. // },
  16667. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16668. // "response": {
  16669. // "$ref": "AdvertiserLandingPagesListResponse"
  16670. // },
  16671. // "scopes": [
  16672. // "https://www.googleapis.com/auth/dfatrafficking"
  16673. // ]
  16674. // }
  16675. }
  16676. // Pages invokes f for each page of results.
  16677. // A non-nil error returned from f will halt the iteration.
  16678. // The provided context supersedes any context provided to the Context method.
  16679. func (c *AdvertiserLandingPagesListCall) Pages(ctx context.Context, f func(*AdvertiserLandingPagesListResponse) error) error {
  16680. c.ctx_ = ctx
  16681. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16682. for {
  16683. x, err := c.Do()
  16684. if err != nil {
  16685. return err
  16686. }
  16687. if err := f(x); err != nil {
  16688. return err
  16689. }
  16690. if x.NextPageToken == "" {
  16691. return nil
  16692. }
  16693. c.PageToken(x.NextPageToken)
  16694. }
  16695. }
  16696. // method id "dfareporting.advertiserLandingPages.patch":
  16697. type AdvertiserLandingPagesPatchCall struct {
  16698. s *Service
  16699. profileId int64
  16700. landingpage *LandingPage
  16701. urlParams_ gensupport.URLParams
  16702. ctx_ context.Context
  16703. header_ http.Header
  16704. }
  16705. // Patch: Updates an existing landing page. This method supports patch
  16706. // semantics.
  16707. func (r *AdvertiserLandingPagesService) Patch(profileId int64, id int64, landingpage *LandingPage) *AdvertiserLandingPagesPatchCall {
  16708. c := &AdvertiserLandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16709. c.profileId = profileId
  16710. c.urlParams_.Set("id", fmt.Sprint(id))
  16711. c.landingpage = landingpage
  16712. return c
  16713. }
  16714. // Fields allows partial responses to be retrieved. See
  16715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16716. // for more information.
  16717. func (c *AdvertiserLandingPagesPatchCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesPatchCall {
  16718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16719. return c
  16720. }
  16721. // Context sets the context to be used in this call's Do method. Any
  16722. // pending HTTP request will be aborted if the provided context is
  16723. // canceled.
  16724. func (c *AdvertiserLandingPagesPatchCall) Context(ctx context.Context) *AdvertiserLandingPagesPatchCall {
  16725. c.ctx_ = ctx
  16726. return c
  16727. }
  16728. // Header returns an http.Header that can be modified by the caller to
  16729. // add HTTP headers to the request.
  16730. func (c *AdvertiserLandingPagesPatchCall) Header() http.Header {
  16731. if c.header_ == nil {
  16732. c.header_ = make(http.Header)
  16733. }
  16734. return c.header_
  16735. }
  16736. func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  16737. reqHeaders := make(http.Header)
  16738. for k, v := range c.header_ {
  16739. reqHeaders[k] = v
  16740. }
  16741. reqHeaders.Set("User-Agent", c.s.userAgent())
  16742. var body io.Reader = nil
  16743. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16744. if err != nil {
  16745. return nil, err
  16746. }
  16747. reqHeaders.Set("Content-Type", "application/json")
  16748. c.urlParams_.Set("alt", alt)
  16749. c.urlParams_.Set("prettyPrint", "false")
  16750. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16751. urls += "?" + c.urlParams_.Encode()
  16752. req, err := http.NewRequest("PATCH", urls, body)
  16753. if err != nil {
  16754. return nil, err
  16755. }
  16756. req.Header = reqHeaders
  16757. googleapi.Expand(req.URL, map[string]string{
  16758. "profileId": strconv.FormatInt(c.profileId, 10),
  16759. })
  16760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16761. }
  16762. // Do executes the "dfareporting.advertiserLandingPages.patch" call.
  16763. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16764. // status code is an error. Response headers are in either
  16765. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16766. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16767. // to check whether the returned error was because
  16768. // http.StatusNotModified was returned.
  16769. func (c *AdvertiserLandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16770. gensupport.SetOptions(c.urlParams_, opts...)
  16771. res, err := c.doRequest("json")
  16772. if res != nil && res.StatusCode == http.StatusNotModified {
  16773. if res.Body != nil {
  16774. res.Body.Close()
  16775. }
  16776. return nil, &googleapi.Error{
  16777. Code: res.StatusCode,
  16778. Header: res.Header,
  16779. }
  16780. }
  16781. if err != nil {
  16782. return nil, err
  16783. }
  16784. defer googleapi.CloseBody(res)
  16785. if err := googleapi.CheckResponse(res); err != nil {
  16786. return nil, err
  16787. }
  16788. ret := &LandingPage{
  16789. ServerResponse: googleapi.ServerResponse{
  16790. Header: res.Header,
  16791. HTTPStatusCode: res.StatusCode,
  16792. },
  16793. }
  16794. target := &ret
  16795. if err := gensupport.DecodeResponse(target, res); err != nil {
  16796. return nil, err
  16797. }
  16798. return ret, nil
  16799. // {
  16800. // "description": "Updates an existing landing page. This method supports patch semantics.",
  16801. // "httpMethod": "PATCH",
  16802. // "id": "dfareporting.advertiserLandingPages.patch",
  16803. // "parameterOrder": [
  16804. // "profileId",
  16805. // "id"
  16806. // ],
  16807. // "parameters": {
  16808. // "id": {
  16809. // "description": "Landing page ID.",
  16810. // "format": "int64",
  16811. // "location": "query",
  16812. // "required": true,
  16813. // "type": "string"
  16814. // },
  16815. // "profileId": {
  16816. // "description": "User profile ID associated with this request.",
  16817. // "format": "int64",
  16818. // "location": "path",
  16819. // "required": true,
  16820. // "type": "string"
  16821. // }
  16822. // },
  16823. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16824. // "request": {
  16825. // "$ref": "LandingPage"
  16826. // },
  16827. // "response": {
  16828. // "$ref": "LandingPage"
  16829. // },
  16830. // "scopes": [
  16831. // "https://www.googleapis.com/auth/dfatrafficking"
  16832. // ]
  16833. // }
  16834. }
  16835. // method id "dfareporting.advertiserLandingPages.update":
  16836. type AdvertiserLandingPagesUpdateCall struct {
  16837. s *Service
  16838. profileId int64
  16839. landingpage *LandingPage
  16840. urlParams_ gensupport.URLParams
  16841. ctx_ context.Context
  16842. header_ http.Header
  16843. }
  16844. // Update: Updates an existing landing page.
  16845. func (r *AdvertiserLandingPagesService) Update(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesUpdateCall {
  16846. c := &AdvertiserLandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16847. c.profileId = profileId
  16848. c.landingpage = landingpage
  16849. return c
  16850. }
  16851. // Fields allows partial responses to be retrieved. See
  16852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16853. // for more information.
  16854. func (c *AdvertiserLandingPagesUpdateCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesUpdateCall {
  16855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16856. return c
  16857. }
  16858. // Context sets the context to be used in this call's Do method. Any
  16859. // pending HTTP request will be aborted if the provided context is
  16860. // canceled.
  16861. func (c *AdvertiserLandingPagesUpdateCall) Context(ctx context.Context) *AdvertiserLandingPagesUpdateCall {
  16862. c.ctx_ = ctx
  16863. return c
  16864. }
  16865. // Header returns an http.Header that can be modified by the caller to
  16866. // add HTTP headers to the request.
  16867. func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header {
  16868. if c.header_ == nil {
  16869. c.header_ = make(http.Header)
  16870. }
  16871. return c.header_
  16872. }
  16873. func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16874. reqHeaders := make(http.Header)
  16875. for k, v := range c.header_ {
  16876. reqHeaders[k] = v
  16877. }
  16878. reqHeaders.Set("User-Agent", c.s.userAgent())
  16879. var body io.Reader = nil
  16880. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16881. if err != nil {
  16882. return nil, err
  16883. }
  16884. reqHeaders.Set("Content-Type", "application/json")
  16885. c.urlParams_.Set("alt", alt)
  16886. c.urlParams_.Set("prettyPrint", "false")
  16887. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16888. urls += "?" + c.urlParams_.Encode()
  16889. req, err := http.NewRequest("PUT", urls, body)
  16890. if err != nil {
  16891. return nil, err
  16892. }
  16893. req.Header = reqHeaders
  16894. googleapi.Expand(req.URL, map[string]string{
  16895. "profileId": strconv.FormatInt(c.profileId, 10),
  16896. })
  16897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16898. }
  16899. // Do executes the "dfareporting.advertiserLandingPages.update" call.
  16900. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16901. // status code is an error. Response headers are in either
  16902. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16904. // to check whether the returned error was because
  16905. // http.StatusNotModified was returned.
  16906. func (c *AdvertiserLandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16907. gensupport.SetOptions(c.urlParams_, opts...)
  16908. res, err := c.doRequest("json")
  16909. if res != nil && res.StatusCode == http.StatusNotModified {
  16910. if res.Body != nil {
  16911. res.Body.Close()
  16912. }
  16913. return nil, &googleapi.Error{
  16914. Code: res.StatusCode,
  16915. Header: res.Header,
  16916. }
  16917. }
  16918. if err != nil {
  16919. return nil, err
  16920. }
  16921. defer googleapi.CloseBody(res)
  16922. if err := googleapi.CheckResponse(res); err != nil {
  16923. return nil, err
  16924. }
  16925. ret := &LandingPage{
  16926. ServerResponse: googleapi.ServerResponse{
  16927. Header: res.Header,
  16928. HTTPStatusCode: res.StatusCode,
  16929. },
  16930. }
  16931. target := &ret
  16932. if err := gensupport.DecodeResponse(target, res); err != nil {
  16933. return nil, err
  16934. }
  16935. return ret, nil
  16936. // {
  16937. // "description": "Updates an existing landing page.",
  16938. // "httpMethod": "PUT",
  16939. // "id": "dfareporting.advertiserLandingPages.update",
  16940. // "parameterOrder": [
  16941. // "profileId"
  16942. // ],
  16943. // "parameters": {
  16944. // "profileId": {
  16945. // "description": "User profile ID associated with this request.",
  16946. // "format": "int64",
  16947. // "location": "path",
  16948. // "required": true,
  16949. // "type": "string"
  16950. // }
  16951. // },
  16952. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16953. // "request": {
  16954. // "$ref": "LandingPage"
  16955. // },
  16956. // "response": {
  16957. // "$ref": "LandingPage"
  16958. // },
  16959. // "scopes": [
  16960. // "https://www.googleapis.com/auth/dfatrafficking"
  16961. // ]
  16962. // }
  16963. }
  16964. // method id "dfareporting.advertisers.get":
  16965. type AdvertisersGetCall struct {
  16966. s *Service
  16967. profileId int64
  16968. id int64
  16969. urlParams_ gensupport.URLParams
  16970. ifNoneMatch_ string
  16971. ctx_ context.Context
  16972. header_ http.Header
  16973. }
  16974. // Get: Gets one advertiser by ID.
  16975. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  16976. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16977. c.profileId = profileId
  16978. c.id = id
  16979. return c
  16980. }
  16981. // Fields allows partial responses to be retrieved. See
  16982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16983. // for more information.
  16984. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  16985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16986. return c
  16987. }
  16988. // IfNoneMatch sets the optional parameter which makes the operation
  16989. // fail if the object's ETag matches the given value. This is useful for
  16990. // getting updates only after the object has changed since the last
  16991. // request. Use googleapi.IsNotModified to check whether the response
  16992. // error from Do is the result of In-None-Match.
  16993. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  16994. c.ifNoneMatch_ = entityTag
  16995. return c
  16996. }
  16997. // Context sets the context to be used in this call's Do method. Any
  16998. // pending HTTP request will be aborted if the provided context is
  16999. // canceled.
  17000. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  17001. c.ctx_ = ctx
  17002. return c
  17003. }
  17004. // Header returns an http.Header that can be modified by the caller to
  17005. // add HTTP headers to the request.
  17006. func (c *AdvertisersGetCall) Header() http.Header {
  17007. if c.header_ == nil {
  17008. c.header_ = make(http.Header)
  17009. }
  17010. return c.header_
  17011. }
  17012. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  17013. reqHeaders := make(http.Header)
  17014. for k, v := range c.header_ {
  17015. reqHeaders[k] = v
  17016. }
  17017. reqHeaders.Set("User-Agent", c.s.userAgent())
  17018. if c.ifNoneMatch_ != "" {
  17019. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17020. }
  17021. var body io.Reader = nil
  17022. c.urlParams_.Set("alt", alt)
  17023. c.urlParams_.Set("prettyPrint", "false")
  17024. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  17025. urls += "?" + c.urlParams_.Encode()
  17026. req, err := http.NewRequest("GET", urls, body)
  17027. if err != nil {
  17028. return nil, err
  17029. }
  17030. req.Header = reqHeaders
  17031. googleapi.Expand(req.URL, map[string]string{
  17032. "profileId": strconv.FormatInt(c.profileId, 10),
  17033. "id": strconv.FormatInt(c.id, 10),
  17034. })
  17035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17036. }
  17037. // Do executes the "dfareporting.advertisers.get" call.
  17038. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17039. // status code is an error. Response headers are in either
  17040. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17041. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17042. // to check whether the returned error was because
  17043. // http.StatusNotModified was returned.
  17044. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17045. gensupport.SetOptions(c.urlParams_, opts...)
  17046. res, err := c.doRequest("json")
  17047. if res != nil && res.StatusCode == http.StatusNotModified {
  17048. if res.Body != nil {
  17049. res.Body.Close()
  17050. }
  17051. return nil, &googleapi.Error{
  17052. Code: res.StatusCode,
  17053. Header: res.Header,
  17054. }
  17055. }
  17056. if err != nil {
  17057. return nil, err
  17058. }
  17059. defer googleapi.CloseBody(res)
  17060. if err := googleapi.CheckResponse(res); err != nil {
  17061. return nil, err
  17062. }
  17063. ret := &Advertiser{
  17064. ServerResponse: googleapi.ServerResponse{
  17065. Header: res.Header,
  17066. HTTPStatusCode: res.StatusCode,
  17067. },
  17068. }
  17069. target := &ret
  17070. if err := gensupport.DecodeResponse(target, res); err != nil {
  17071. return nil, err
  17072. }
  17073. return ret, nil
  17074. // {
  17075. // "description": "Gets one advertiser by ID.",
  17076. // "httpMethod": "GET",
  17077. // "id": "dfareporting.advertisers.get",
  17078. // "parameterOrder": [
  17079. // "profileId",
  17080. // "id"
  17081. // ],
  17082. // "parameters": {
  17083. // "id": {
  17084. // "description": "Advertiser ID.",
  17085. // "format": "int64",
  17086. // "location": "path",
  17087. // "required": true,
  17088. // "type": "string"
  17089. // },
  17090. // "profileId": {
  17091. // "description": "User profile ID associated with this request.",
  17092. // "format": "int64",
  17093. // "location": "path",
  17094. // "required": true,
  17095. // "type": "string"
  17096. // }
  17097. // },
  17098. // "path": "userprofiles/{profileId}/advertisers/{id}",
  17099. // "response": {
  17100. // "$ref": "Advertiser"
  17101. // },
  17102. // "scopes": [
  17103. // "https://www.googleapis.com/auth/dfatrafficking"
  17104. // ]
  17105. // }
  17106. }
  17107. // method id "dfareporting.advertisers.insert":
  17108. type AdvertisersInsertCall struct {
  17109. s *Service
  17110. profileId int64
  17111. advertiser *Advertiser
  17112. urlParams_ gensupport.URLParams
  17113. ctx_ context.Context
  17114. header_ http.Header
  17115. }
  17116. // Insert: Inserts a new advertiser.
  17117. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  17118. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17119. c.profileId = profileId
  17120. c.advertiser = advertiser
  17121. return c
  17122. }
  17123. // Fields allows partial responses to be retrieved. See
  17124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17125. // for more information.
  17126. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  17127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17128. return c
  17129. }
  17130. // Context sets the context to be used in this call's Do method. Any
  17131. // pending HTTP request will be aborted if the provided context is
  17132. // canceled.
  17133. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  17134. c.ctx_ = ctx
  17135. return c
  17136. }
  17137. // Header returns an http.Header that can be modified by the caller to
  17138. // add HTTP headers to the request.
  17139. func (c *AdvertisersInsertCall) Header() http.Header {
  17140. if c.header_ == nil {
  17141. c.header_ = make(http.Header)
  17142. }
  17143. return c.header_
  17144. }
  17145. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  17146. reqHeaders := make(http.Header)
  17147. for k, v := range c.header_ {
  17148. reqHeaders[k] = v
  17149. }
  17150. reqHeaders.Set("User-Agent", c.s.userAgent())
  17151. var body io.Reader = nil
  17152. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17153. if err != nil {
  17154. return nil, err
  17155. }
  17156. reqHeaders.Set("Content-Type", "application/json")
  17157. c.urlParams_.Set("alt", alt)
  17158. c.urlParams_.Set("prettyPrint", "false")
  17159. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17160. urls += "?" + c.urlParams_.Encode()
  17161. req, err := http.NewRequest("POST", urls, body)
  17162. if err != nil {
  17163. return nil, err
  17164. }
  17165. req.Header = reqHeaders
  17166. googleapi.Expand(req.URL, map[string]string{
  17167. "profileId": strconv.FormatInt(c.profileId, 10),
  17168. })
  17169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17170. }
  17171. // Do executes the "dfareporting.advertisers.insert" call.
  17172. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17173. // status code is an error. Response headers are in either
  17174. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17176. // to check whether the returned error was because
  17177. // http.StatusNotModified was returned.
  17178. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17179. gensupport.SetOptions(c.urlParams_, opts...)
  17180. res, err := c.doRequest("json")
  17181. if res != nil && res.StatusCode == http.StatusNotModified {
  17182. if res.Body != nil {
  17183. res.Body.Close()
  17184. }
  17185. return nil, &googleapi.Error{
  17186. Code: res.StatusCode,
  17187. Header: res.Header,
  17188. }
  17189. }
  17190. if err != nil {
  17191. return nil, err
  17192. }
  17193. defer googleapi.CloseBody(res)
  17194. if err := googleapi.CheckResponse(res); err != nil {
  17195. return nil, err
  17196. }
  17197. ret := &Advertiser{
  17198. ServerResponse: googleapi.ServerResponse{
  17199. Header: res.Header,
  17200. HTTPStatusCode: res.StatusCode,
  17201. },
  17202. }
  17203. target := &ret
  17204. if err := gensupport.DecodeResponse(target, res); err != nil {
  17205. return nil, err
  17206. }
  17207. return ret, nil
  17208. // {
  17209. // "description": "Inserts a new advertiser.",
  17210. // "httpMethod": "POST",
  17211. // "id": "dfareporting.advertisers.insert",
  17212. // "parameterOrder": [
  17213. // "profileId"
  17214. // ],
  17215. // "parameters": {
  17216. // "profileId": {
  17217. // "description": "User profile ID associated with this request.",
  17218. // "format": "int64",
  17219. // "location": "path",
  17220. // "required": true,
  17221. // "type": "string"
  17222. // }
  17223. // },
  17224. // "path": "userprofiles/{profileId}/advertisers",
  17225. // "request": {
  17226. // "$ref": "Advertiser"
  17227. // },
  17228. // "response": {
  17229. // "$ref": "Advertiser"
  17230. // },
  17231. // "scopes": [
  17232. // "https://www.googleapis.com/auth/dfatrafficking"
  17233. // ]
  17234. // }
  17235. }
  17236. // method id "dfareporting.advertisers.list":
  17237. type AdvertisersListCall struct {
  17238. s *Service
  17239. profileId int64
  17240. urlParams_ gensupport.URLParams
  17241. ifNoneMatch_ string
  17242. ctx_ context.Context
  17243. header_ http.Header
  17244. }
  17245. // List: Retrieves a list of advertisers, possibly filtered. This method
  17246. // supports paging.
  17247. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  17248. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17249. c.profileId = profileId
  17250. return c
  17251. }
  17252. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17253. // Select only advertisers with these advertiser group IDs.
  17254. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  17255. var advertiserGroupIds_ []string
  17256. for _, v := range advertiserGroupIds {
  17257. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17258. }
  17259. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17260. return c
  17261. }
  17262. // FloodlightConfigurationIds sets the optional parameter
  17263. // "floodlightConfigurationIds": Select only advertisers with these
  17264. // floodlight configuration IDs.
  17265. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  17266. var floodlightConfigurationIds_ []string
  17267. for _, v := range floodlightConfigurationIds {
  17268. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  17269. }
  17270. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  17271. return c
  17272. }
  17273. // Ids sets the optional parameter "ids": Select only advertisers with
  17274. // these IDs.
  17275. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  17276. var ids_ []string
  17277. for _, v := range ids {
  17278. ids_ = append(ids_, fmt.Sprint(v))
  17279. }
  17280. c.urlParams_.SetMulti("ids", ids_)
  17281. return c
  17282. }
  17283. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  17284. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  17285. // do not belong to any advertiser group.
  17286. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  17287. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  17288. return c
  17289. }
  17290. // MaxResults sets the optional parameter "maxResults": Maximum number
  17291. // of results to return.
  17292. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  17293. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17294. return c
  17295. }
  17296. // OnlyParent sets the optional parameter "onlyParent": Select only
  17297. // advertisers which use another advertiser's floodlight configuration.
  17298. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  17299. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  17300. return c
  17301. }
  17302. // PageToken sets the optional parameter "pageToken": Value of the
  17303. // nextPageToken from the previous result page.
  17304. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  17305. c.urlParams_.Set("pageToken", pageToken)
  17306. return c
  17307. }
  17308. // SearchString sets the optional parameter "searchString": Allows
  17309. // searching for objects by name or ID. Wildcards (*) are allowed. For
  17310. // example, "advertiser*2015" will return objects with names like
  17311. // "advertiser June 2015", "advertiser April 2015", or simply
  17312. // "advertiser 2015". Most of the searches also add wildcards implicitly
  17313. // at the start and the end of the search string. For example, a search
  17314. // string of "advertiser" will match objects with name "my advertiser",
  17315. // "advertiser 2015", or simply "advertiser".
  17316. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  17317. c.urlParams_.Set("searchString", searchString)
  17318. return c
  17319. }
  17320. // SortField sets the optional parameter "sortField": Field by which to
  17321. // sort the list.
  17322. //
  17323. // Possible values:
  17324. // "ID" (default)
  17325. // "NAME"
  17326. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  17327. c.urlParams_.Set("sortField", sortField)
  17328. return c
  17329. }
  17330. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17331. // results.
  17332. //
  17333. // Possible values:
  17334. // "ASCENDING" (default)
  17335. // "DESCENDING"
  17336. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  17337. c.urlParams_.Set("sortOrder", sortOrder)
  17338. return c
  17339. }
  17340. // Status sets the optional parameter "status": Select only advertisers
  17341. // with the specified status.
  17342. //
  17343. // Possible values:
  17344. // "APPROVED"
  17345. // "ON_HOLD"
  17346. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  17347. c.urlParams_.Set("status", status)
  17348. return c
  17349. }
  17350. // SubaccountId sets the optional parameter "subaccountId": Select only
  17351. // advertisers with these subaccount IDs.
  17352. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  17353. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17354. return c
  17355. }
  17356. // Fields allows partial responses to be retrieved. See
  17357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17358. // for more information.
  17359. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  17360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17361. return c
  17362. }
  17363. // IfNoneMatch sets the optional parameter which makes the operation
  17364. // fail if the object's ETag matches the given value. This is useful for
  17365. // getting updates only after the object has changed since the last
  17366. // request. Use googleapi.IsNotModified to check whether the response
  17367. // error from Do is the result of In-None-Match.
  17368. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  17369. c.ifNoneMatch_ = entityTag
  17370. return c
  17371. }
  17372. // Context sets the context to be used in this call's Do method. Any
  17373. // pending HTTP request will be aborted if the provided context is
  17374. // canceled.
  17375. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  17376. c.ctx_ = ctx
  17377. return c
  17378. }
  17379. // Header returns an http.Header that can be modified by the caller to
  17380. // add HTTP headers to the request.
  17381. func (c *AdvertisersListCall) Header() http.Header {
  17382. if c.header_ == nil {
  17383. c.header_ = make(http.Header)
  17384. }
  17385. return c.header_
  17386. }
  17387. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  17388. reqHeaders := make(http.Header)
  17389. for k, v := range c.header_ {
  17390. reqHeaders[k] = v
  17391. }
  17392. reqHeaders.Set("User-Agent", c.s.userAgent())
  17393. if c.ifNoneMatch_ != "" {
  17394. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17395. }
  17396. var body io.Reader = nil
  17397. c.urlParams_.Set("alt", alt)
  17398. c.urlParams_.Set("prettyPrint", "false")
  17399. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17400. urls += "?" + c.urlParams_.Encode()
  17401. req, err := http.NewRequest("GET", urls, body)
  17402. if err != nil {
  17403. return nil, err
  17404. }
  17405. req.Header = reqHeaders
  17406. googleapi.Expand(req.URL, map[string]string{
  17407. "profileId": strconv.FormatInt(c.profileId, 10),
  17408. })
  17409. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17410. }
  17411. // Do executes the "dfareporting.advertisers.list" call.
  17412. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  17413. // non-2xx status code is an error. Response headers are in either
  17414. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  17415. // returned at all) in error.(*googleapi.Error).Header. Use
  17416. // googleapi.IsNotModified to check whether the returned error was
  17417. // because http.StatusNotModified was returned.
  17418. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  17419. gensupport.SetOptions(c.urlParams_, opts...)
  17420. res, err := c.doRequest("json")
  17421. if res != nil && res.StatusCode == http.StatusNotModified {
  17422. if res.Body != nil {
  17423. res.Body.Close()
  17424. }
  17425. return nil, &googleapi.Error{
  17426. Code: res.StatusCode,
  17427. Header: res.Header,
  17428. }
  17429. }
  17430. if err != nil {
  17431. return nil, err
  17432. }
  17433. defer googleapi.CloseBody(res)
  17434. if err := googleapi.CheckResponse(res); err != nil {
  17435. return nil, err
  17436. }
  17437. ret := &AdvertisersListResponse{
  17438. ServerResponse: googleapi.ServerResponse{
  17439. Header: res.Header,
  17440. HTTPStatusCode: res.StatusCode,
  17441. },
  17442. }
  17443. target := &ret
  17444. if err := gensupport.DecodeResponse(target, res); err != nil {
  17445. return nil, err
  17446. }
  17447. return ret, nil
  17448. // {
  17449. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  17450. // "httpMethod": "GET",
  17451. // "id": "dfareporting.advertisers.list",
  17452. // "parameterOrder": [
  17453. // "profileId"
  17454. // ],
  17455. // "parameters": {
  17456. // "advertiserGroupIds": {
  17457. // "description": "Select only advertisers with these advertiser group IDs.",
  17458. // "format": "int64",
  17459. // "location": "query",
  17460. // "repeated": true,
  17461. // "type": "string"
  17462. // },
  17463. // "floodlightConfigurationIds": {
  17464. // "description": "Select only advertisers with these floodlight configuration IDs.",
  17465. // "format": "int64",
  17466. // "location": "query",
  17467. // "repeated": true,
  17468. // "type": "string"
  17469. // },
  17470. // "ids": {
  17471. // "description": "Select only advertisers with these IDs.",
  17472. // "format": "int64",
  17473. // "location": "query",
  17474. // "repeated": true,
  17475. // "type": "string"
  17476. // },
  17477. // "includeAdvertisersWithoutGroupsOnly": {
  17478. // "description": "Select only advertisers which do not belong to any advertiser group.",
  17479. // "location": "query",
  17480. // "type": "boolean"
  17481. // },
  17482. // "maxResults": {
  17483. // "default": "1000",
  17484. // "description": "Maximum number of results to return.",
  17485. // "format": "int32",
  17486. // "location": "query",
  17487. // "maximum": "1000",
  17488. // "minimum": "0",
  17489. // "type": "integer"
  17490. // },
  17491. // "onlyParent": {
  17492. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  17493. // "location": "query",
  17494. // "type": "boolean"
  17495. // },
  17496. // "pageToken": {
  17497. // "description": "Value of the nextPageToken from the previous result page.",
  17498. // "location": "query",
  17499. // "type": "string"
  17500. // },
  17501. // "profileId": {
  17502. // "description": "User profile ID associated with this request.",
  17503. // "format": "int64",
  17504. // "location": "path",
  17505. // "required": true,
  17506. // "type": "string"
  17507. // },
  17508. // "searchString": {
  17509. // "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\".",
  17510. // "location": "query",
  17511. // "type": "string"
  17512. // },
  17513. // "sortField": {
  17514. // "default": "ID",
  17515. // "description": "Field by which to sort the list.",
  17516. // "enum": [
  17517. // "ID",
  17518. // "NAME"
  17519. // ],
  17520. // "enumDescriptions": [
  17521. // "",
  17522. // ""
  17523. // ],
  17524. // "location": "query",
  17525. // "type": "string"
  17526. // },
  17527. // "sortOrder": {
  17528. // "default": "ASCENDING",
  17529. // "description": "Order of sorted results.",
  17530. // "enum": [
  17531. // "ASCENDING",
  17532. // "DESCENDING"
  17533. // ],
  17534. // "enumDescriptions": [
  17535. // "",
  17536. // ""
  17537. // ],
  17538. // "location": "query",
  17539. // "type": "string"
  17540. // },
  17541. // "status": {
  17542. // "description": "Select only advertisers with the specified status.",
  17543. // "enum": [
  17544. // "APPROVED",
  17545. // "ON_HOLD"
  17546. // ],
  17547. // "enumDescriptions": [
  17548. // "",
  17549. // ""
  17550. // ],
  17551. // "location": "query",
  17552. // "type": "string"
  17553. // },
  17554. // "subaccountId": {
  17555. // "description": "Select only advertisers with these subaccount IDs.",
  17556. // "format": "int64",
  17557. // "location": "query",
  17558. // "type": "string"
  17559. // }
  17560. // },
  17561. // "path": "userprofiles/{profileId}/advertisers",
  17562. // "response": {
  17563. // "$ref": "AdvertisersListResponse"
  17564. // },
  17565. // "scopes": [
  17566. // "https://www.googleapis.com/auth/dfatrafficking"
  17567. // ]
  17568. // }
  17569. }
  17570. // Pages invokes f for each page of results.
  17571. // A non-nil error returned from f will halt the iteration.
  17572. // The provided context supersedes any context provided to the Context method.
  17573. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  17574. c.ctx_ = ctx
  17575. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17576. for {
  17577. x, err := c.Do()
  17578. if err != nil {
  17579. return err
  17580. }
  17581. if err := f(x); err != nil {
  17582. return err
  17583. }
  17584. if x.NextPageToken == "" {
  17585. return nil
  17586. }
  17587. c.PageToken(x.NextPageToken)
  17588. }
  17589. }
  17590. // method id "dfareporting.advertisers.patch":
  17591. type AdvertisersPatchCall struct {
  17592. s *Service
  17593. profileId int64
  17594. advertiser *Advertiser
  17595. urlParams_ gensupport.URLParams
  17596. ctx_ context.Context
  17597. header_ http.Header
  17598. }
  17599. // Patch: Updates an existing advertiser. This method supports patch
  17600. // semantics.
  17601. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  17602. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17603. c.profileId = profileId
  17604. c.urlParams_.Set("id", fmt.Sprint(id))
  17605. c.advertiser = advertiser
  17606. return c
  17607. }
  17608. // Fields allows partial responses to be retrieved. See
  17609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17610. // for more information.
  17611. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  17612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17613. return c
  17614. }
  17615. // Context sets the context to be used in this call's Do method. Any
  17616. // pending HTTP request will be aborted if the provided context is
  17617. // canceled.
  17618. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  17619. c.ctx_ = ctx
  17620. return c
  17621. }
  17622. // Header returns an http.Header that can be modified by the caller to
  17623. // add HTTP headers to the request.
  17624. func (c *AdvertisersPatchCall) Header() http.Header {
  17625. if c.header_ == nil {
  17626. c.header_ = make(http.Header)
  17627. }
  17628. return c.header_
  17629. }
  17630. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  17631. reqHeaders := make(http.Header)
  17632. for k, v := range c.header_ {
  17633. reqHeaders[k] = v
  17634. }
  17635. reqHeaders.Set("User-Agent", c.s.userAgent())
  17636. var body io.Reader = nil
  17637. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17638. if err != nil {
  17639. return nil, err
  17640. }
  17641. reqHeaders.Set("Content-Type", "application/json")
  17642. c.urlParams_.Set("alt", alt)
  17643. c.urlParams_.Set("prettyPrint", "false")
  17644. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17645. urls += "?" + c.urlParams_.Encode()
  17646. req, err := http.NewRequest("PATCH", urls, body)
  17647. if err != nil {
  17648. return nil, err
  17649. }
  17650. req.Header = reqHeaders
  17651. googleapi.Expand(req.URL, map[string]string{
  17652. "profileId": strconv.FormatInt(c.profileId, 10),
  17653. })
  17654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17655. }
  17656. // Do executes the "dfareporting.advertisers.patch" call.
  17657. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17658. // status code is an error. Response headers are in either
  17659. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17660. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17661. // to check whether the returned error was because
  17662. // http.StatusNotModified was returned.
  17663. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17664. gensupport.SetOptions(c.urlParams_, opts...)
  17665. res, err := c.doRequest("json")
  17666. if res != nil && res.StatusCode == http.StatusNotModified {
  17667. if res.Body != nil {
  17668. res.Body.Close()
  17669. }
  17670. return nil, &googleapi.Error{
  17671. Code: res.StatusCode,
  17672. Header: res.Header,
  17673. }
  17674. }
  17675. if err != nil {
  17676. return nil, err
  17677. }
  17678. defer googleapi.CloseBody(res)
  17679. if err := googleapi.CheckResponse(res); err != nil {
  17680. return nil, err
  17681. }
  17682. ret := &Advertiser{
  17683. ServerResponse: googleapi.ServerResponse{
  17684. Header: res.Header,
  17685. HTTPStatusCode: res.StatusCode,
  17686. },
  17687. }
  17688. target := &ret
  17689. if err := gensupport.DecodeResponse(target, res); err != nil {
  17690. return nil, err
  17691. }
  17692. return ret, nil
  17693. // {
  17694. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  17695. // "httpMethod": "PATCH",
  17696. // "id": "dfareporting.advertisers.patch",
  17697. // "parameterOrder": [
  17698. // "profileId",
  17699. // "id"
  17700. // ],
  17701. // "parameters": {
  17702. // "id": {
  17703. // "description": "Advertiser ID.",
  17704. // "format": "int64",
  17705. // "location": "query",
  17706. // "required": true,
  17707. // "type": "string"
  17708. // },
  17709. // "profileId": {
  17710. // "description": "User profile ID associated with this request.",
  17711. // "format": "int64",
  17712. // "location": "path",
  17713. // "required": true,
  17714. // "type": "string"
  17715. // }
  17716. // },
  17717. // "path": "userprofiles/{profileId}/advertisers",
  17718. // "request": {
  17719. // "$ref": "Advertiser"
  17720. // },
  17721. // "response": {
  17722. // "$ref": "Advertiser"
  17723. // },
  17724. // "scopes": [
  17725. // "https://www.googleapis.com/auth/dfatrafficking"
  17726. // ]
  17727. // }
  17728. }
  17729. // method id "dfareporting.advertisers.update":
  17730. type AdvertisersUpdateCall struct {
  17731. s *Service
  17732. profileId int64
  17733. advertiser *Advertiser
  17734. urlParams_ gensupport.URLParams
  17735. ctx_ context.Context
  17736. header_ http.Header
  17737. }
  17738. // Update: Updates an existing advertiser.
  17739. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  17740. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17741. c.profileId = profileId
  17742. c.advertiser = advertiser
  17743. return c
  17744. }
  17745. // Fields allows partial responses to be retrieved. See
  17746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17747. // for more information.
  17748. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  17749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17750. return c
  17751. }
  17752. // Context sets the context to be used in this call's Do method. Any
  17753. // pending HTTP request will be aborted if the provided context is
  17754. // canceled.
  17755. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  17756. c.ctx_ = ctx
  17757. return c
  17758. }
  17759. // Header returns an http.Header that can be modified by the caller to
  17760. // add HTTP headers to the request.
  17761. func (c *AdvertisersUpdateCall) Header() http.Header {
  17762. if c.header_ == nil {
  17763. c.header_ = make(http.Header)
  17764. }
  17765. return c.header_
  17766. }
  17767. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  17768. reqHeaders := make(http.Header)
  17769. for k, v := range c.header_ {
  17770. reqHeaders[k] = v
  17771. }
  17772. reqHeaders.Set("User-Agent", c.s.userAgent())
  17773. var body io.Reader = nil
  17774. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17775. if err != nil {
  17776. return nil, err
  17777. }
  17778. reqHeaders.Set("Content-Type", "application/json")
  17779. c.urlParams_.Set("alt", alt)
  17780. c.urlParams_.Set("prettyPrint", "false")
  17781. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17782. urls += "?" + c.urlParams_.Encode()
  17783. req, err := http.NewRequest("PUT", urls, body)
  17784. if err != nil {
  17785. return nil, err
  17786. }
  17787. req.Header = reqHeaders
  17788. googleapi.Expand(req.URL, map[string]string{
  17789. "profileId": strconv.FormatInt(c.profileId, 10),
  17790. })
  17791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17792. }
  17793. // Do executes the "dfareporting.advertisers.update" call.
  17794. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17795. // status code is an error. Response headers are in either
  17796. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17797. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17798. // to check whether the returned error was because
  17799. // http.StatusNotModified was returned.
  17800. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17801. gensupport.SetOptions(c.urlParams_, opts...)
  17802. res, err := c.doRequest("json")
  17803. if res != nil && res.StatusCode == http.StatusNotModified {
  17804. if res.Body != nil {
  17805. res.Body.Close()
  17806. }
  17807. return nil, &googleapi.Error{
  17808. Code: res.StatusCode,
  17809. Header: res.Header,
  17810. }
  17811. }
  17812. if err != nil {
  17813. return nil, err
  17814. }
  17815. defer googleapi.CloseBody(res)
  17816. if err := googleapi.CheckResponse(res); err != nil {
  17817. return nil, err
  17818. }
  17819. ret := &Advertiser{
  17820. ServerResponse: googleapi.ServerResponse{
  17821. Header: res.Header,
  17822. HTTPStatusCode: res.StatusCode,
  17823. },
  17824. }
  17825. target := &ret
  17826. if err := gensupport.DecodeResponse(target, res); err != nil {
  17827. return nil, err
  17828. }
  17829. return ret, nil
  17830. // {
  17831. // "description": "Updates an existing advertiser.",
  17832. // "httpMethod": "PUT",
  17833. // "id": "dfareporting.advertisers.update",
  17834. // "parameterOrder": [
  17835. // "profileId"
  17836. // ],
  17837. // "parameters": {
  17838. // "profileId": {
  17839. // "description": "User profile ID associated with this request.",
  17840. // "format": "int64",
  17841. // "location": "path",
  17842. // "required": true,
  17843. // "type": "string"
  17844. // }
  17845. // },
  17846. // "path": "userprofiles/{profileId}/advertisers",
  17847. // "request": {
  17848. // "$ref": "Advertiser"
  17849. // },
  17850. // "response": {
  17851. // "$ref": "Advertiser"
  17852. // },
  17853. // "scopes": [
  17854. // "https://www.googleapis.com/auth/dfatrafficking"
  17855. // ]
  17856. // }
  17857. }
  17858. // method id "dfareporting.browsers.list":
  17859. type BrowsersListCall struct {
  17860. s *Service
  17861. profileId int64
  17862. urlParams_ gensupport.URLParams
  17863. ifNoneMatch_ string
  17864. ctx_ context.Context
  17865. header_ http.Header
  17866. }
  17867. // List: Retrieves a list of browsers.
  17868. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  17869. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17870. c.profileId = profileId
  17871. return c
  17872. }
  17873. // Fields allows partial responses to be retrieved. See
  17874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17875. // for more information.
  17876. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  17877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17878. return c
  17879. }
  17880. // IfNoneMatch sets the optional parameter which makes the operation
  17881. // fail if the object's ETag matches the given value. This is useful for
  17882. // getting updates only after the object has changed since the last
  17883. // request. Use googleapi.IsNotModified to check whether the response
  17884. // error from Do is the result of In-None-Match.
  17885. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  17886. c.ifNoneMatch_ = entityTag
  17887. return c
  17888. }
  17889. // Context sets the context to be used in this call's Do method. Any
  17890. // pending HTTP request will be aborted if the provided context is
  17891. // canceled.
  17892. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  17893. c.ctx_ = ctx
  17894. return c
  17895. }
  17896. // Header returns an http.Header that can be modified by the caller to
  17897. // add HTTP headers to the request.
  17898. func (c *BrowsersListCall) Header() http.Header {
  17899. if c.header_ == nil {
  17900. c.header_ = make(http.Header)
  17901. }
  17902. return c.header_
  17903. }
  17904. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  17905. reqHeaders := make(http.Header)
  17906. for k, v := range c.header_ {
  17907. reqHeaders[k] = v
  17908. }
  17909. reqHeaders.Set("User-Agent", c.s.userAgent())
  17910. if c.ifNoneMatch_ != "" {
  17911. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17912. }
  17913. var body io.Reader = nil
  17914. c.urlParams_.Set("alt", alt)
  17915. c.urlParams_.Set("prettyPrint", "false")
  17916. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  17917. urls += "?" + c.urlParams_.Encode()
  17918. req, err := http.NewRequest("GET", urls, body)
  17919. if err != nil {
  17920. return nil, err
  17921. }
  17922. req.Header = reqHeaders
  17923. googleapi.Expand(req.URL, map[string]string{
  17924. "profileId": strconv.FormatInt(c.profileId, 10),
  17925. })
  17926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17927. }
  17928. // Do executes the "dfareporting.browsers.list" call.
  17929. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  17930. // non-2xx status code is an error. Response headers are in either
  17931. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  17932. // returned at all) in error.(*googleapi.Error).Header. Use
  17933. // googleapi.IsNotModified to check whether the returned error was
  17934. // because http.StatusNotModified was returned.
  17935. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  17936. gensupport.SetOptions(c.urlParams_, opts...)
  17937. res, err := c.doRequest("json")
  17938. if res != nil && res.StatusCode == http.StatusNotModified {
  17939. if res.Body != nil {
  17940. res.Body.Close()
  17941. }
  17942. return nil, &googleapi.Error{
  17943. Code: res.StatusCode,
  17944. Header: res.Header,
  17945. }
  17946. }
  17947. if err != nil {
  17948. return nil, err
  17949. }
  17950. defer googleapi.CloseBody(res)
  17951. if err := googleapi.CheckResponse(res); err != nil {
  17952. return nil, err
  17953. }
  17954. ret := &BrowsersListResponse{
  17955. ServerResponse: googleapi.ServerResponse{
  17956. Header: res.Header,
  17957. HTTPStatusCode: res.StatusCode,
  17958. },
  17959. }
  17960. target := &ret
  17961. if err := gensupport.DecodeResponse(target, res); err != nil {
  17962. return nil, err
  17963. }
  17964. return ret, nil
  17965. // {
  17966. // "description": "Retrieves a list of browsers.",
  17967. // "httpMethod": "GET",
  17968. // "id": "dfareporting.browsers.list",
  17969. // "parameterOrder": [
  17970. // "profileId"
  17971. // ],
  17972. // "parameters": {
  17973. // "profileId": {
  17974. // "description": "User profile ID associated with this request.",
  17975. // "format": "int64",
  17976. // "location": "path",
  17977. // "required": true,
  17978. // "type": "string"
  17979. // }
  17980. // },
  17981. // "path": "userprofiles/{profileId}/browsers",
  17982. // "response": {
  17983. // "$ref": "BrowsersListResponse"
  17984. // },
  17985. // "scopes": [
  17986. // "https://www.googleapis.com/auth/dfatrafficking"
  17987. // ]
  17988. // }
  17989. }
  17990. // method id "dfareporting.campaignCreativeAssociations.insert":
  17991. type CampaignCreativeAssociationsInsertCall struct {
  17992. s *Service
  17993. profileId int64
  17994. campaignId int64
  17995. campaigncreativeassociation *CampaignCreativeAssociation
  17996. urlParams_ gensupport.URLParams
  17997. ctx_ context.Context
  17998. header_ http.Header
  17999. }
  18000. // Insert: Associates a creative with the specified campaign. This
  18001. // method creates a default ad with dimensions matching the creative in
  18002. // the campaign if such a default ad does not exist already.
  18003. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  18004. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18005. c.profileId = profileId
  18006. c.campaignId = campaignId
  18007. c.campaigncreativeassociation = campaigncreativeassociation
  18008. return c
  18009. }
  18010. // Fields allows partial responses to be retrieved. See
  18011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18012. // for more information.
  18013. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  18014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18015. return c
  18016. }
  18017. // Context sets the context to be used in this call's Do method. Any
  18018. // pending HTTP request will be aborted if the provided context is
  18019. // canceled.
  18020. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  18021. c.ctx_ = ctx
  18022. return c
  18023. }
  18024. // Header returns an http.Header that can be modified by the caller to
  18025. // add HTTP headers to the request.
  18026. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  18027. if c.header_ == nil {
  18028. c.header_ = make(http.Header)
  18029. }
  18030. return c.header_
  18031. }
  18032. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  18033. reqHeaders := make(http.Header)
  18034. for k, v := range c.header_ {
  18035. reqHeaders[k] = v
  18036. }
  18037. reqHeaders.Set("User-Agent", c.s.userAgent())
  18038. var body io.Reader = nil
  18039. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  18040. if err != nil {
  18041. return nil, err
  18042. }
  18043. reqHeaders.Set("Content-Type", "application/json")
  18044. c.urlParams_.Set("alt", alt)
  18045. c.urlParams_.Set("prettyPrint", "false")
  18046. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  18047. urls += "?" + c.urlParams_.Encode()
  18048. req, err := http.NewRequest("POST", urls, body)
  18049. if err != nil {
  18050. return nil, err
  18051. }
  18052. req.Header = reqHeaders
  18053. googleapi.Expand(req.URL, map[string]string{
  18054. "profileId": strconv.FormatInt(c.profileId, 10),
  18055. "campaignId": strconv.FormatInt(c.campaignId, 10),
  18056. })
  18057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18058. }
  18059. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  18060. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  18061. // Any non-2xx status code is an error. Response headers are in either
  18062. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  18063. // was returned at all) in error.(*googleapi.Error).Header. Use
  18064. // googleapi.IsNotModified to check whether the returned error was
  18065. // because http.StatusNotModified was returned.
  18066. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  18067. gensupport.SetOptions(c.urlParams_, opts...)
  18068. res, err := c.doRequest("json")
  18069. if res != nil && res.StatusCode == http.StatusNotModified {
  18070. if res.Body != nil {
  18071. res.Body.Close()
  18072. }
  18073. return nil, &googleapi.Error{
  18074. Code: res.StatusCode,
  18075. Header: res.Header,
  18076. }
  18077. }
  18078. if err != nil {
  18079. return nil, err
  18080. }
  18081. defer googleapi.CloseBody(res)
  18082. if err := googleapi.CheckResponse(res); err != nil {
  18083. return nil, err
  18084. }
  18085. ret := &CampaignCreativeAssociation{
  18086. ServerResponse: googleapi.ServerResponse{
  18087. Header: res.Header,
  18088. HTTPStatusCode: res.StatusCode,
  18089. },
  18090. }
  18091. target := &ret
  18092. if err := gensupport.DecodeResponse(target, res); err != nil {
  18093. return nil, err
  18094. }
  18095. return ret, nil
  18096. // {
  18097. // "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.",
  18098. // "httpMethod": "POST",
  18099. // "id": "dfareporting.campaignCreativeAssociations.insert",
  18100. // "parameterOrder": [
  18101. // "profileId",
  18102. // "campaignId"
  18103. // ],
  18104. // "parameters": {
  18105. // "campaignId": {
  18106. // "description": "Campaign ID in this association.",
  18107. // "format": "int64",
  18108. // "location": "path",
  18109. // "required": true,
  18110. // "type": "string"
  18111. // },
  18112. // "profileId": {
  18113. // "description": "User profile ID associated with this request.",
  18114. // "format": "int64",
  18115. // "location": "path",
  18116. // "required": true,
  18117. // "type": "string"
  18118. // }
  18119. // },
  18120. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18121. // "request": {
  18122. // "$ref": "CampaignCreativeAssociation"
  18123. // },
  18124. // "response": {
  18125. // "$ref": "CampaignCreativeAssociation"
  18126. // },
  18127. // "scopes": [
  18128. // "https://www.googleapis.com/auth/dfatrafficking"
  18129. // ]
  18130. // }
  18131. }
  18132. // method id "dfareporting.campaignCreativeAssociations.list":
  18133. type CampaignCreativeAssociationsListCall struct {
  18134. s *Service
  18135. profileId int64
  18136. campaignId int64
  18137. urlParams_ gensupport.URLParams
  18138. ifNoneMatch_ string
  18139. ctx_ context.Context
  18140. header_ http.Header
  18141. }
  18142. // List: Retrieves the list of creative IDs associated with the
  18143. // specified campaign. This method supports paging.
  18144. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  18145. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18146. c.profileId = profileId
  18147. c.campaignId = campaignId
  18148. return c
  18149. }
  18150. // MaxResults sets the optional parameter "maxResults": Maximum number
  18151. // of results to return.
  18152. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  18153. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18154. return c
  18155. }
  18156. // PageToken sets the optional parameter "pageToken": Value of the
  18157. // nextPageToken from the previous result page.
  18158. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  18159. c.urlParams_.Set("pageToken", pageToken)
  18160. return c
  18161. }
  18162. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18163. // results.
  18164. //
  18165. // Possible values:
  18166. // "ASCENDING" (default)
  18167. // "DESCENDING"
  18168. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  18169. c.urlParams_.Set("sortOrder", sortOrder)
  18170. return c
  18171. }
  18172. // Fields allows partial responses to be retrieved. See
  18173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18174. // for more information.
  18175. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  18176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18177. return c
  18178. }
  18179. // IfNoneMatch sets the optional parameter which makes the operation
  18180. // fail if the object's ETag matches the given value. This is useful for
  18181. // getting updates only after the object has changed since the last
  18182. // request. Use googleapi.IsNotModified to check whether the response
  18183. // error from Do is the result of In-None-Match.
  18184. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  18185. c.ifNoneMatch_ = entityTag
  18186. return c
  18187. }
  18188. // Context sets the context to be used in this call's Do method. Any
  18189. // pending HTTP request will be aborted if the provided context is
  18190. // canceled.
  18191. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  18192. c.ctx_ = ctx
  18193. return c
  18194. }
  18195. // Header returns an http.Header that can be modified by the caller to
  18196. // add HTTP headers to the request.
  18197. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  18198. if c.header_ == nil {
  18199. c.header_ = make(http.Header)
  18200. }
  18201. return c.header_
  18202. }
  18203. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  18204. reqHeaders := make(http.Header)
  18205. for k, v := range c.header_ {
  18206. reqHeaders[k] = v
  18207. }
  18208. reqHeaders.Set("User-Agent", c.s.userAgent())
  18209. if c.ifNoneMatch_ != "" {
  18210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18211. }
  18212. var body io.Reader = nil
  18213. c.urlParams_.Set("alt", alt)
  18214. c.urlParams_.Set("prettyPrint", "false")
  18215. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  18216. urls += "?" + c.urlParams_.Encode()
  18217. req, err := http.NewRequest("GET", urls, body)
  18218. if err != nil {
  18219. return nil, err
  18220. }
  18221. req.Header = reqHeaders
  18222. googleapi.Expand(req.URL, map[string]string{
  18223. "profileId": strconv.FormatInt(c.profileId, 10),
  18224. "campaignId": strconv.FormatInt(c.campaignId, 10),
  18225. })
  18226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18227. }
  18228. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  18229. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  18230. // will be non-nil. Any non-2xx status code is an error. Response
  18231. // headers are in either
  18232. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  18233. // (if a response was returned at all) in
  18234. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18235. // whether the returned error was because http.StatusNotModified was
  18236. // returned.
  18237. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  18238. gensupport.SetOptions(c.urlParams_, opts...)
  18239. res, err := c.doRequest("json")
  18240. if res != nil && res.StatusCode == http.StatusNotModified {
  18241. if res.Body != nil {
  18242. res.Body.Close()
  18243. }
  18244. return nil, &googleapi.Error{
  18245. Code: res.StatusCode,
  18246. Header: res.Header,
  18247. }
  18248. }
  18249. if err != nil {
  18250. return nil, err
  18251. }
  18252. defer googleapi.CloseBody(res)
  18253. if err := googleapi.CheckResponse(res); err != nil {
  18254. return nil, err
  18255. }
  18256. ret := &CampaignCreativeAssociationsListResponse{
  18257. ServerResponse: googleapi.ServerResponse{
  18258. Header: res.Header,
  18259. HTTPStatusCode: res.StatusCode,
  18260. },
  18261. }
  18262. target := &ret
  18263. if err := gensupport.DecodeResponse(target, res); err != nil {
  18264. return nil, err
  18265. }
  18266. return ret, nil
  18267. // {
  18268. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  18269. // "httpMethod": "GET",
  18270. // "id": "dfareporting.campaignCreativeAssociations.list",
  18271. // "parameterOrder": [
  18272. // "profileId",
  18273. // "campaignId"
  18274. // ],
  18275. // "parameters": {
  18276. // "campaignId": {
  18277. // "description": "Campaign ID in this association.",
  18278. // "format": "int64",
  18279. // "location": "path",
  18280. // "required": true,
  18281. // "type": "string"
  18282. // },
  18283. // "maxResults": {
  18284. // "default": "1000",
  18285. // "description": "Maximum number of results to return.",
  18286. // "format": "int32",
  18287. // "location": "query",
  18288. // "maximum": "1000",
  18289. // "minimum": "0",
  18290. // "type": "integer"
  18291. // },
  18292. // "pageToken": {
  18293. // "description": "Value of the nextPageToken from the previous result page.",
  18294. // "location": "query",
  18295. // "type": "string"
  18296. // },
  18297. // "profileId": {
  18298. // "description": "User profile ID associated with this request.",
  18299. // "format": "int64",
  18300. // "location": "path",
  18301. // "required": true,
  18302. // "type": "string"
  18303. // },
  18304. // "sortOrder": {
  18305. // "default": "ASCENDING",
  18306. // "description": "Order of sorted results.",
  18307. // "enum": [
  18308. // "ASCENDING",
  18309. // "DESCENDING"
  18310. // ],
  18311. // "enumDescriptions": [
  18312. // "",
  18313. // ""
  18314. // ],
  18315. // "location": "query",
  18316. // "type": "string"
  18317. // }
  18318. // },
  18319. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18320. // "response": {
  18321. // "$ref": "CampaignCreativeAssociationsListResponse"
  18322. // },
  18323. // "scopes": [
  18324. // "https://www.googleapis.com/auth/dfatrafficking"
  18325. // ]
  18326. // }
  18327. }
  18328. // Pages invokes f for each page of results.
  18329. // A non-nil error returned from f will halt the iteration.
  18330. // The provided context supersedes any context provided to the Context method.
  18331. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  18332. c.ctx_ = ctx
  18333. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18334. for {
  18335. x, err := c.Do()
  18336. if err != nil {
  18337. return err
  18338. }
  18339. if err := f(x); err != nil {
  18340. return err
  18341. }
  18342. if x.NextPageToken == "" {
  18343. return nil
  18344. }
  18345. c.PageToken(x.NextPageToken)
  18346. }
  18347. }
  18348. // method id "dfareporting.campaigns.get":
  18349. type CampaignsGetCall struct {
  18350. s *Service
  18351. profileId int64
  18352. id int64
  18353. urlParams_ gensupport.URLParams
  18354. ifNoneMatch_ string
  18355. ctx_ context.Context
  18356. header_ http.Header
  18357. }
  18358. // Get: Gets one campaign by ID.
  18359. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  18360. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18361. c.profileId = profileId
  18362. c.id = id
  18363. return c
  18364. }
  18365. // Fields allows partial responses to be retrieved. See
  18366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18367. // for more information.
  18368. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  18369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18370. return c
  18371. }
  18372. // IfNoneMatch sets the optional parameter which makes the operation
  18373. // fail if the object's ETag matches the given value. This is useful for
  18374. // getting updates only after the object has changed since the last
  18375. // request. Use googleapi.IsNotModified to check whether the response
  18376. // error from Do is the result of In-None-Match.
  18377. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  18378. c.ifNoneMatch_ = entityTag
  18379. return c
  18380. }
  18381. // Context sets the context to be used in this call's Do method. Any
  18382. // pending HTTP request will be aborted if the provided context is
  18383. // canceled.
  18384. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  18385. c.ctx_ = ctx
  18386. return c
  18387. }
  18388. // Header returns an http.Header that can be modified by the caller to
  18389. // add HTTP headers to the request.
  18390. func (c *CampaignsGetCall) Header() http.Header {
  18391. if c.header_ == nil {
  18392. c.header_ = make(http.Header)
  18393. }
  18394. return c.header_
  18395. }
  18396. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  18397. reqHeaders := make(http.Header)
  18398. for k, v := range c.header_ {
  18399. reqHeaders[k] = v
  18400. }
  18401. reqHeaders.Set("User-Agent", c.s.userAgent())
  18402. if c.ifNoneMatch_ != "" {
  18403. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18404. }
  18405. var body io.Reader = nil
  18406. c.urlParams_.Set("alt", alt)
  18407. c.urlParams_.Set("prettyPrint", "false")
  18408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  18409. urls += "?" + c.urlParams_.Encode()
  18410. req, err := http.NewRequest("GET", urls, body)
  18411. if err != nil {
  18412. return nil, err
  18413. }
  18414. req.Header = reqHeaders
  18415. googleapi.Expand(req.URL, map[string]string{
  18416. "profileId": strconv.FormatInt(c.profileId, 10),
  18417. "id": strconv.FormatInt(c.id, 10),
  18418. })
  18419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18420. }
  18421. // Do executes the "dfareporting.campaigns.get" call.
  18422. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18423. // code is an error. Response headers are in either
  18424. // *Campaign.ServerResponse.Header or (if a response was returned at
  18425. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18426. // to check whether the returned error was because
  18427. // http.StatusNotModified was returned.
  18428. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18429. gensupport.SetOptions(c.urlParams_, opts...)
  18430. res, err := c.doRequest("json")
  18431. if res != nil && res.StatusCode == http.StatusNotModified {
  18432. if res.Body != nil {
  18433. res.Body.Close()
  18434. }
  18435. return nil, &googleapi.Error{
  18436. Code: res.StatusCode,
  18437. Header: res.Header,
  18438. }
  18439. }
  18440. if err != nil {
  18441. return nil, err
  18442. }
  18443. defer googleapi.CloseBody(res)
  18444. if err := googleapi.CheckResponse(res); err != nil {
  18445. return nil, err
  18446. }
  18447. ret := &Campaign{
  18448. ServerResponse: googleapi.ServerResponse{
  18449. Header: res.Header,
  18450. HTTPStatusCode: res.StatusCode,
  18451. },
  18452. }
  18453. target := &ret
  18454. if err := gensupport.DecodeResponse(target, res); err != nil {
  18455. return nil, err
  18456. }
  18457. return ret, nil
  18458. // {
  18459. // "description": "Gets one campaign by ID.",
  18460. // "httpMethod": "GET",
  18461. // "id": "dfareporting.campaigns.get",
  18462. // "parameterOrder": [
  18463. // "profileId",
  18464. // "id"
  18465. // ],
  18466. // "parameters": {
  18467. // "id": {
  18468. // "description": "Campaign ID.",
  18469. // "format": "int64",
  18470. // "location": "path",
  18471. // "required": true,
  18472. // "type": "string"
  18473. // },
  18474. // "profileId": {
  18475. // "description": "User profile ID associated with this request.",
  18476. // "format": "int64",
  18477. // "location": "path",
  18478. // "required": true,
  18479. // "type": "string"
  18480. // }
  18481. // },
  18482. // "path": "userprofiles/{profileId}/campaigns/{id}",
  18483. // "response": {
  18484. // "$ref": "Campaign"
  18485. // },
  18486. // "scopes": [
  18487. // "https://www.googleapis.com/auth/dfatrafficking"
  18488. // ]
  18489. // }
  18490. }
  18491. // method id "dfareporting.campaigns.insert":
  18492. type CampaignsInsertCall struct {
  18493. s *Service
  18494. profileId int64
  18495. campaign *Campaign
  18496. urlParams_ gensupport.URLParams
  18497. ctx_ context.Context
  18498. header_ http.Header
  18499. }
  18500. // Insert: Inserts a new campaign.
  18501. func (r *CampaignsService) Insert(profileId int64, campaign *Campaign) *CampaignsInsertCall {
  18502. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18503. c.profileId = profileId
  18504. c.campaign = campaign
  18505. return c
  18506. }
  18507. // Fields allows partial responses to be retrieved. See
  18508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18509. // for more information.
  18510. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  18511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18512. return c
  18513. }
  18514. // Context sets the context to be used in this call's Do method. Any
  18515. // pending HTTP request will be aborted if the provided context is
  18516. // canceled.
  18517. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  18518. c.ctx_ = ctx
  18519. return c
  18520. }
  18521. // Header returns an http.Header that can be modified by the caller to
  18522. // add HTTP headers to the request.
  18523. func (c *CampaignsInsertCall) Header() http.Header {
  18524. if c.header_ == nil {
  18525. c.header_ = make(http.Header)
  18526. }
  18527. return c.header_
  18528. }
  18529. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  18530. reqHeaders := make(http.Header)
  18531. for k, v := range c.header_ {
  18532. reqHeaders[k] = v
  18533. }
  18534. reqHeaders.Set("User-Agent", c.s.userAgent())
  18535. var body io.Reader = nil
  18536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18537. if err != nil {
  18538. return nil, err
  18539. }
  18540. reqHeaders.Set("Content-Type", "application/json")
  18541. c.urlParams_.Set("alt", alt)
  18542. c.urlParams_.Set("prettyPrint", "false")
  18543. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18544. urls += "?" + c.urlParams_.Encode()
  18545. req, err := http.NewRequest("POST", urls, body)
  18546. if err != nil {
  18547. return nil, err
  18548. }
  18549. req.Header = reqHeaders
  18550. googleapi.Expand(req.URL, map[string]string{
  18551. "profileId": strconv.FormatInt(c.profileId, 10),
  18552. })
  18553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18554. }
  18555. // Do executes the "dfareporting.campaigns.insert" call.
  18556. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18557. // code is an error. Response headers are in either
  18558. // *Campaign.ServerResponse.Header or (if a response was returned at
  18559. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18560. // to check whether the returned error was because
  18561. // http.StatusNotModified was returned.
  18562. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18563. gensupport.SetOptions(c.urlParams_, opts...)
  18564. res, err := c.doRequest("json")
  18565. if res != nil && res.StatusCode == http.StatusNotModified {
  18566. if res.Body != nil {
  18567. res.Body.Close()
  18568. }
  18569. return nil, &googleapi.Error{
  18570. Code: res.StatusCode,
  18571. Header: res.Header,
  18572. }
  18573. }
  18574. if err != nil {
  18575. return nil, err
  18576. }
  18577. defer googleapi.CloseBody(res)
  18578. if err := googleapi.CheckResponse(res); err != nil {
  18579. return nil, err
  18580. }
  18581. ret := &Campaign{
  18582. ServerResponse: googleapi.ServerResponse{
  18583. Header: res.Header,
  18584. HTTPStatusCode: res.StatusCode,
  18585. },
  18586. }
  18587. target := &ret
  18588. if err := gensupport.DecodeResponse(target, res); err != nil {
  18589. return nil, err
  18590. }
  18591. return ret, nil
  18592. // {
  18593. // "description": "Inserts a new campaign.",
  18594. // "httpMethod": "POST",
  18595. // "id": "dfareporting.campaigns.insert",
  18596. // "parameterOrder": [
  18597. // "profileId"
  18598. // ],
  18599. // "parameters": {
  18600. // "profileId": {
  18601. // "description": "User profile ID associated with this request.",
  18602. // "format": "int64",
  18603. // "location": "path",
  18604. // "required": true,
  18605. // "type": "string"
  18606. // }
  18607. // },
  18608. // "path": "userprofiles/{profileId}/campaigns",
  18609. // "request": {
  18610. // "$ref": "Campaign"
  18611. // },
  18612. // "response": {
  18613. // "$ref": "Campaign"
  18614. // },
  18615. // "scopes": [
  18616. // "https://www.googleapis.com/auth/dfatrafficking"
  18617. // ]
  18618. // }
  18619. }
  18620. // method id "dfareporting.campaigns.list":
  18621. type CampaignsListCall struct {
  18622. s *Service
  18623. profileId int64
  18624. urlParams_ gensupport.URLParams
  18625. ifNoneMatch_ string
  18626. ctx_ context.Context
  18627. header_ http.Header
  18628. }
  18629. // List: Retrieves a list of campaigns, possibly filtered. This method
  18630. // supports paging.
  18631. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  18632. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18633. c.profileId = profileId
  18634. return c
  18635. }
  18636. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  18637. // Select only campaigns whose advertisers belong to these advertiser
  18638. // groups.
  18639. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  18640. var advertiserGroupIds_ []string
  18641. for _, v := range advertiserGroupIds {
  18642. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  18643. }
  18644. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  18645. return c
  18646. }
  18647. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  18648. // only campaigns that belong to these advertisers.
  18649. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  18650. var advertiserIds_ []string
  18651. for _, v := range advertiserIds {
  18652. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  18653. }
  18654. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  18655. return c
  18656. }
  18657. // Archived sets the optional parameter "archived": Select only archived
  18658. // campaigns. Don't set this field to select both archived and
  18659. // non-archived campaigns.
  18660. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  18661. c.urlParams_.Set("archived", fmt.Sprint(archived))
  18662. return c
  18663. }
  18664. // AtLeastOneOptimizationActivity sets the optional parameter
  18665. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  18666. // least one optimization activity.
  18667. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  18668. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  18669. return c
  18670. }
  18671. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  18672. // campaigns with these IDs.
  18673. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  18674. var excludedIds_ []string
  18675. for _, v := range excludedIds {
  18676. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  18677. }
  18678. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  18679. return c
  18680. }
  18681. // Ids sets the optional parameter "ids": Select only campaigns with
  18682. // these IDs.
  18683. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  18684. var ids_ []string
  18685. for _, v := range ids {
  18686. ids_ = append(ids_, fmt.Sprint(v))
  18687. }
  18688. c.urlParams_.SetMulti("ids", ids_)
  18689. return c
  18690. }
  18691. // MaxResults sets the optional parameter "maxResults": Maximum number
  18692. // of results to return.
  18693. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  18694. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18695. return c
  18696. }
  18697. // OverriddenEventTagId sets the optional parameter
  18698. // "overriddenEventTagId": Select only campaigns that have overridden
  18699. // this event tag ID.
  18700. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  18701. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  18702. return c
  18703. }
  18704. // PageToken sets the optional parameter "pageToken": Value of the
  18705. // nextPageToken from the previous result page.
  18706. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  18707. c.urlParams_.Set("pageToken", pageToken)
  18708. return c
  18709. }
  18710. // SearchString sets the optional parameter "searchString": Allows
  18711. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  18712. // example, "campaign*2015" will return campaigns with names like
  18713. // "campaign June 2015", "campaign April 2015", or simply "campaign
  18714. // 2015". Most of the searches also add wildcards implicitly at the
  18715. // start and the end of the search string. For example, a search string
  18716. // of "campaign" will match campaigns with name "my campaign", "campaign
  18717. // 2015", or simply "campaign".
  18718. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  18719. c.urlParams_.Set("searchString", searchString)
  18720. return c
  18721. }
  18722. // SortField sets the optional parameter "sortField": Field by which to
  18723. // sort the list.
  18724. //
  18725. // Possible values:
  18726. // "ID" (default)
  18727. // "NAME"
  18728. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  18729. c.urlParams_.Set("sortField", sortField)
  18730. return c
  18731. }
  18732. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18733. // results.
  18734. //
  18735. // Possible values:
  18736. // "ASCENDING" (default)
  18737. // "DESCENDING"
  18738. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  18739. c.urlParams_.Set("sortOrder", sortOrder)
  18740. return c
  18741. }
  18742. // SubaccountId sets the optional parameter "subaccountId": Select only
  18743. // campaigns that belong to this subaccount.
  18744. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  18745. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  18746. return c
  18747. }
  18748. // Fields allows partial responses to be retrieved. See
  18749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18750. // for more information.
  18751. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  18752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18753. return c
  18754. }
  18755. // IfNoneMatch sets the optional parameter which makes the operation
  18756. // fail if the object's ETag matches the given value. This is useful for
  18757. // getting updates only after the object has changed since the last
  18758. // request. Use googleapi.IsNotModified to check whether the response
  18759. // error from Do is the result of In-None-Match.
  18760. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  18761. c.ifNoneMatch_ = entityTag
  18762. return c
  18763. }
  18764. // Context sets the context to be used in this call's Do method. Any
  18765. // pending HTTP request will be aborted if the provided context is
  18766. // canceled.
  18767. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  18768. c.ctx_ = ctx
  18769. return c
  18770. }
  18771. // Header returns an http.Header that can be modified by the caller to
  18772. // add HTTP headers to the request.
  18773. func (c *CampaignsListCall) Header() http.Header {
  18774. if c.header_ == nil {
  18775. c.header_ = make(http.Header)
  18776. }
  18777. return c.header_
  18778. }
  18779. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  18780. reqHeaders := make(http.Header)
  18781. for k, v := range c.header_ {
  18782. reqHeaders[k] = v
  18783. }
  18784. reqHeaders.Set("User-Agent", c.s.userAgent())
  18785. if c.ifNoneMatch_ != "" {
  18786. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18787. }
  18788. var body io.Reader = nil
  18789. c.urlParams_.Set("alt", alt)
  18790. c.urlParams_.Set("prettyPrint", "false")
  18791. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18792. urls += "?" + c.urlParams_.Encode()
  18793. req, err := http.NewRequest("GET", urls, body)
  18794. if err != nil {
  18795. return nil, err
  18796. }
  18797. req.Header = reqHeaders
  18798. googleapi.Expand(req.URL, map[string]string{
  18799. "profileId": strconv.FormatInt(c.profileId, 10),
  18800. })
  18801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18802. }
  18803. // Do executes the "dfareporting.campaigns.list" call.
  18804. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  18805. // non-2xx status code is an error. Response headers are in either
  18806. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  18807. // returned at all) in error.(*googleapi.Error).Header. Use
  18808. // googleapi.IsNotModified to check whether the returned error was
  18809. // because http.StatusNotModified was returned.
  18810. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  18811. gensupport.SetOptions(c.urlParams_, opts...)
  18812. res, err := c.doRequest("json")
  18813. if res != nil && res.StatusCode == http.StatusNotModified {
  18814. if res.Body != nil {
  18815. res.Body.Close()
  18816. }
  18817. return nil, &googleapi.Error{
  18818. Code: res.StatusCode,
  18819. Header: res.Header,
  18820. }
  18821. }
  18822. if err != nil {
  18823. return nil, err
  18824. }
  18825. defer googleapi.CloseBody(res)
  18826. if err := googleapi.CheckResponse(res); err != nil {
  18827. return nil, err
  18828. }
  18829. ret := &CampaignsListResponse{
  18830. ServerResponse: googleapi.ServerResponse{
  18831. Header: res.Header,
  18832. HTTPStatusCode: res.StatusCode,
  18833. },
  18834. }
  18835. target := &ret
  18836. if err := gensupport.DecodeResponse(target, res); err != nil {
  18837. return nil, err
  18838. }
  18839. return ret, nil
  18840. // {
  18841. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  18842. // "httpMethod": "GET",
  18843. // "id": "dfareporting.campaigns.list",
  18844. // "parameterOrder": [
  18845. // "profileId"
  18846. // ],
  18847. // "parameters": {
  18848. // "advertiserGroupIds": {
  18849. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  18850. // "format": "int64",
  18851. // "location": "query",
  18852. // "repeated": true,
  18853. // "type": "string"
  18854. // },
  18855. // "advertiserIds": {
  18856. // "description": "Select only campaigns that belong to these advertisers.",
  18857. // "format": "int64",
  18858. // "location": "query",
  18859. // "repeated": true,
  18860. // "type": "string"
  18861. // },
  18862. // "archived": {
  18863. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  18864. // "location": "query",
  18865. // "type": "boolean"
  18866. // },
  18867. // "atLeastOneOptimizationActivity": {
  18868. // "description": "Select only campaigns that have at least one optimization activity.",
  18869. // "location": "query",
  18870. // "type": "boolean"
  18871. // },
  18872. // "excludedIds": {
  18873. // "description": "Exclude campaigns with these IDs.",
  18874. // "format": "int64",
  18875. // "location": "query",
  18876. // "repeated": true,
  18877. // "type": "string"
  18878. // },
  18879. // "ids": {
  18880. // "description": "Select only campaigns with these IDs.",
  18881. // "format": "int64",
  18882. // "location": "query",
  18883. // "repeated": true,
  18884. // "type": "string"
  18885. // },
  18886. // "maxResults": {
  18887. // "default": "1000",
  18888. // "description": "Maximum number of results to return.",
  18889. // "format": "int32",
  18890. // "location": "query",
  18891. // "maximum": "1000",
  18892. // "minimum": "0",
  18893. // "type": "integer"
  18894. // },
  18895. // "overriddenEventTagId": {
  18896. // "description": "Select only campaigns that have overridden this event tag ID.",
  18897. // "format": "int64",
  18898. // "location": "query",
  18899. // "type": "string"
  18900. // },
  18901. // "pageToken": {
  18902. // "description": "Value of the nextPageToken from the previous result page.",
  18903. // "location": "query",
  18904. // "type": "string"
  18905. // },
  18906. // "profileId": {
  18907. // "description": "User profile ID associated with this request.",
  18908. // "format": "int64",
  18909. // "location": "path",
  18910. // "required": true,
  18911. // "type": "string"
  18912. // },
  18913. // "searchString": {
  18914. // "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\".",
  18915. // "location": "query",
  18916. // "type": "string"
  18917. // },
  18918. // "sortField": {
  18919. // "default": "ID",
  18920. // "description": "Field by which to sort the list.",
  18921. // "enum": [
  18922. // "ID",
  18923. // "NAME"
  18924. // ],
  18925. // "enumDescriptions": [
  18926. // "",
  18927. // ""
  18928. // ],
  18929. // "location": "query",
  18930. // "type": "string"
  18931. // },
  18932. // "sortOrder": {
  18933. // "default": "ASCENDING",
  18934. // "description": "Order of sorted results.",
  18935. // "enum": [
  18936. // "ASCENDING",
  18937. // "DESCENDING"
  18938. // ],
  18939. // "enumDescriptions": [
  18940. // "",
  18941. // ""
  18942. // ],
  18943. // "location": "query",
  18944. // "type": "string"
  18945. // },
  18946. // "subaccountId": {
  18947. // "description": "Select only campaigns that belong to this subaccount.",
  18948. // "format": "int64",
  18949. // "location": "query",
  18950. // "type": "string"
  18951. // }
  18952. // },
  18953. // "path": "userprofiles/{profileId}/campaigns",
  18954. // "response": {
  18955. // "$ref": "CampaignsListResponse"
  18956. // },
  18957. // "scopes": [
  18958. // "https://www.googleapis.com/auth/dfatrafficking"
  18959. // ]
  18960. // }
  18961. }
  18962. // Pages invokes f for each page of results.
  18963. // A non-nil error returned from f will halt the iteration.
  18964. // The provided context supersedes any context provided to the Context method.
  18965. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  18966. c.ctx_ = ctx
  18967. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18968. for {
  18969. x, err := c.Do()
  18970. if err != nil {
  18971. return err
  18972. }
  18973. if err := f(x); err != nil {
  18974. return err
  18975. }
  18976. if x.NextPageToken == "" {
  18977. return nil
  18978. }
  18979. c.PageToken(x.NextPageToken)
  18980. }
  18981. }
  18982. // method id "dfareporting.campaigns.patch":
  18983. type CampaignsPatchCall struct {
  18984. s *Service
  18985. profileId int64
  18986. campaign *Campaign
  18987. urlParams_ gensupport.URLParams
  18988. ctx_ context.Context
  18989. header_ http.Header
  18990. }
  18991. // Patch: Updates an existing campaign. This method supports patch
  18992. // semantics.
  18993. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  18994. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18995. c.profileId = profileId
  18996. c.urlParams_.Set("id", fmt.Sprint(id))
  18997. c.campaign = campaign
  18998. return c
  18999. }
  19000. // Fields allows partial responses to be retrieved. See
  19001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19002. // for more information.
  19003. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  19004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19005. return c
  19006. }
  19007. // Context sets the context to be used in this call's Do method. Any
  19008. // pending HTTP request will be aborted if the provided context is
  19009. // canceled.
  19010. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  19011. c.ctx_ = ctx
  19012. return c
  19013. }
  19014. // Header returns an http.Header that can be modified by the caller to
  19015. // add HTTP headers to the request.
  19016. func (c *CampaignsPatchCall) Header() http.Header {
  19017. if c.header_ == nil {
  19018. c.header_ = make(http.Header)
  19019. }
  19020. return c.header_
  19021. }
  19022. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  19023. reqHeaders := make(http.Header)
  19024. for k, v := range c.header_ {
  19025. reqHeaders[k] = v
  19026. }
  19027. reqHeaders.Set("User-Agent", c.s.userAgent())
  19028. var body io.Reader = nil
  19029. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  19030. if err != nil {
  19031. return nil, err
  19032. }
  19033. reqHeaders.Set("Content-Type", "application/json")
  19034. c.urlParams_.Set("alt", alt)
  19035. c.urlParams_.Set("prettyPrint", "false")
  19036. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  19037. urls += "?" + c.urlParams_.Encode()
  19038. req, err := http.NewRequest("PATCH", urls, body)
  19039. if err != nil {
  19040. return nil, err
  19041. }
  19042. req.Header = reqHeaders
  19043. googleapi.Expand(req.URL, map[string]string{
  19044. "profileId": strconv.FormatInt(c.profileId, 10),
  19045. })
  19046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19047. }
  19048. // Do executes the "dfareporting.campaigns.patch" call.
  19049. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  19050. // code is an error. Response headers are in either
  19051. // *Campaign.ServerResponse.Header or (if a response was returned at
  19052. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19053. // to check whether the returned error was because
  19054. // http.StatusNotModified was returned.
  19055. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  19056. gensupport.SetOptions(c.urlParams_, opts...)
  19057. res, err := c.doRequest("json")
  19058. if res != nil && res.StatusCode == http.StatusNotModified {
  19059. if res.Body != nil {
  19060. res.Body.Close()
  19061. }
  19062. return nil, &googleapi.Error{
  19063. Code: res.StatusCode,
  19064. Header: res.Header,
  19065. }
  19066. }
  19067. if err != nil {
  19068. return nil, err
  19069. }
  19070. defer googleapi.CloseBody(res)
  19071. if err := googleapi.CheckResponse(res); err != nil {
  19072. return nil, err
  19073. }
  19074. ret := &Campaign{
  19075. ServerResponse: googleapi.ServerResponse{
  19076. Header: res.Header,
  19077. HTTPStatusCode: res.StatusCode,
  19078. },
  19079. }
  19080. target := &ret
  19081. if err := gensupport.DecodeResponse(target, res); err != nil {
  19082. return nil, err
  19083. }
  19084. return ret, nil
  19085. // {
  19086. // "description": "Updates an existing campaign. This method supports patch semantics.",
  19087. // "httpMethod": "PATCH",
  19088. // "id": "dfareporting.campaigns.patch",
  19089. // "parameterOrder": [
  19090. // "profileId",
  19091. // "id"
  19092. // ],
  19093. // "parameters": {
  19094. // "id": {
  19095. // "description": "Campaign ID.",
  19096. // "format": "int64",
  19097. // "location": "query",
  19098. // "required": true,
  19099. // "type": "string"
  19100. // },
  19101. // "profileId": {
  19102. // "description": "User profile ID associated with this request.",
  19103. // "format": "int64",
  19104. // "location": "path",
  19105. // "required": true,
  19106. // "type": "string"
  19107. // }
  19108. // },
  19109. // "path": "userprofiles/{profileId}/campaigns",
  19110. // "request": {
  19111. // "$ref": "Campaign"
  19112. // },
  19113. // "response": {
  19114. // "$ref": "Campaign"
  19115. // },
  19116. // "scopes": [
  19117. // "https://www.googleapis.com/auth/dfatrafficking"
  19118. // ]
  19119. // }
  19120. }
  19121. // method id "dfareporting.campaigns.update":
  19122. type CampaignsUpdateCall struct {
  19123. s *Service
  19124. profileId int64
  19125. campaign *Campaign
  19126. urlParams_ gensupport.URLParams
  19127. ctx_ context.Context
  19128. header_ http.Header
  19129. }
  19130. // Update: Updates an existing campaign.
  19131. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  19132. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19133. c.profileId = profileId
  19134. c.campaign = campaign
  19135. return c
  19136. }
  19137. // Fields allows partial responses to be retrieved. See
  19138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19139. // for more information.
  19140. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  19141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19142. return c
  19143. }
  19144. // Context sets the context to be used in this call's Do method. Any
  19145. // pending HTTP request will be aborted if the provided context is
  19146. // canceled.
  19147. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  19148. c.ctx_ = ctx
  19149. return c
  19150. }
  19151. // Header returns an http.Header that can be modified by the caller to
  19152. // add HTTP headers to the request.
  19153. func (c *CampaignsUpdateCall) Header() http.Header {
  19154. if c.header_ == nil {
  19155. c.header_ = make(http.Header)
  19156. }
  19157. return c.header_
  19158. }
  19159. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  19160. reqHeaders := make(http.Header)
  19161. for k, v := range c.header_ {
  19162. reqHeaders[k] = v
  19163. }
  19164. reqHeaders.Set("User-Agent", c.s.userAgent())
  19165. var body io.Reader = nil
  19166. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  19167. if err != nil {
  19168. return nil, err
  19169. }
  19170. reqHeaders.Set("Content-Type", "application/json")
  19171. c.urlParams_.Set("alt", alt)
  19172. c.urlParams_.Set("prettyPrint", "false")
  19173. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  19174. urls += "?" + c.urlParams_.Encode()
  19175. req, err := http.NewRequest("PUT", urls, body)
  19176. if err != nil {
  19177. return nil, err
  19178. }
  19179. req.Header = reqHeaders
  19180. googleapi.Expand(req.URL, map[string]string{
  19181. "profileId": strconv.FormatInt(c.profileId, 10),
  19182. })
  19183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19184. }
  19185. // Do executes the "dfareporting.campaigns.update" call.
  19186. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  19187. // code is an error. Response headers are in either
  19188. // *Campaign.ServerResponse.Header or (if a response was returned at
  19189. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19190. // to check whether the returned error was because
  19191. // http.StatusNotModified was returned.
  19192. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  19193. gensupport.SetOptions(c.urlParams_, opts...)
  19194. res, err := c.doRequest("json")
  19195. if res != nil && res.StatusCode == http.StatusNotModified {
  19196. if res.Body != nil {
  19197. res.Body.Close()
  19198. }
  19199. return nil, &googleapi.Error{
  19200. Code: res.StatusCode,
  19201. Header: res.Header,
  19202. }
  19203. }
  19204. if err != nil {
  19205. return nil, err
  19206. }
  19207. defer googleapi.CloseBody(res)
  19208. if err := googleapi.CheckResponse(res); err != nil {
  19209. return nil, err
  19210. }
  19211. ret := &Campaign{
  19212. ServerResponse: googleapi.ServerResponse{
  19213. Header: res.Header,
  19214. HTTPStatusCode: res.StatusCode,
  19215. },
  19216. }
  19217. target := &ret
  19218. if err := gensupport.DecodeResponse(target, res); err != nil {
  19219. return nil, err
  19220. }
  19221. return ret, nil
  19222. // {
  19223. // "description": "Updates an existing campaign.",
  19224. // "httpMethod": "PUT",
  19225. // "id": "dfareporting.campaigns.update",
  19226. // "parameterOrder": [
  19227. // "profileId"
  19228. // ],
  19229. // "parameters": {
  19230. // "profileId": {
  19231. // "description": "User profile ID associated with this request.",
  19232. // "format": "int64",
  19233. // "location": "path",
  19234. // "required": true,
  19235. // "type": "string"
  19236. // }
  19237. // },
  19238. // "path": "userprofiles/{profileId}/campaigns",
  19239. // "request": {
  19240. // "$ref": "Campaign"
  19241. // },
  19242. // "response": {
  19243. // "$ref": "Campaign"
  19244. // },
  19245. // "scopes": [
  19246. // "https://www.googleapis.com/auth/dfatrafficking"
  19247. // ]
  19248. // }
  19249. }
  19250. // method id "dfareporting.changeLogs.get":
  19251. type ChangeLogsGetCall struct {
  19252. s *Service
  19253. profileId int64
  19254. id int64
  19255. urlParams_ gensupport.URLParams
  19256. ifNoneMatch_ string
  19257. ctx_ context.Context
  19258. header_ http.Header
  19259. }
  19260. // Get: Gets one change log by ID.
  19261. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  19262. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19263. c.profileId = profileId
  19264. c.id = id
  19265. return c
  19266. }
  19267. // Fields allows partial responses to be retrieved. See
  19268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19269. // for more information.
  19270. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  19271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19272. return c
  19273. }
  19274. // IfNoneMatch sets the optional parameter which makes the operation
  19275. // fail if the object's ETag matches the given value. This is useful for
  19276. // getting updates only after the object has changed since the last
  19277. // request. Use googleapi.IsNotModified to check whether the response
  19278. // error from Do is the result of In-None-Match.
  19279. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  19280. c.ifNoneMatch_ = entityTag
  19281. return c
  19282. }
  19283. // Context sets the context to be used in this call's Do method. Any
  19284. // pending HTTP request will be aborted if the provided context is
  19285. // canceled.
  19286. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  19287. c.ctx_ = ctx
  19288. return c
  19289. }
  19290. // Header returns an http.Header that can be modified by the caller to
  19291. // add HTTP headers to the request.
  19292. func (c *ChangeLogsGetCall) Header() http.Header {
  19293. if c.header_ == nil {
  19294. c.header_ = make(http.Header)
  19295. }
  19296. return c.header_
  19297. }
  19298. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  19299. reqHeaders := make(http.Header)
  19300. for k, v := range c.header_ {
  19301. reqHeaders[k] = v
  19302. }
  19303. reqHeaders.Set("User-Agent", c.s.userAgent())
  19304. if c.ifNoneMatch_ != "" {
  19305. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19306. }
  19307. var body io.Reader = nil
  19308. c.urlParams_.Set("alt", alt)
  19309. c.urlParams_.Set("prettyPrint", "false")
  19310. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  19311. urls += "?" + c.urlParams_.Encode()
  19312. req, err := http.NewRequest("GET", urls, body)
  19313. if err != nil {
  19314. return nil, err
  19315. }
  19316. req.Header = reqHeaders
  19317. googleapi.Expand(req.URL, map[string]string{
  19318. "profileId": strconv.FormatInt(c.profileId, 10),
  19319. "id": strconv.FormatInt(c.id, 10),
  19320. })
  19321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19322. }
  19323. // Do executes the "dfareporting.changeLogs.get" call.
  19324. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  19325. // status code is an error. Response headers are in either
  19326. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  19327. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19328. // to check whether the returned error was because
  19329. // http.StatusNotModified was returned.
  19330. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  19331. gensupport.SetOptions(c.urlParams_, opts...)
  19332. res, err := c.doRequest("json")
  19333. if res != nil && res.StatusCode == http.StatusNotModified {
  19334. if res.Body != nil {
  19335. res.Body.Close()
  19336. }
  19337. return nil, &googleapi.Error{
  19338. Code: res.StatusCode,
  19339. Header: res.Header,
  19340. }
  19341. }
  19342. if err != nil {
  19343. return nil, err
  19344. }
  19345. defer googleapi.CloseBody(res)
  19346. if err := googleapi.CheckResponse(res); err != nil {
  19347. return nil, err
  19348. }
  19349. ret := &ChangeLog{
  19350. ServerResponse: googleapi.ServerResponse{
  19351. Header: res.Header,
  19352. HTTPStatusCode: res.StatusCode,
  19353. },
  19354. }
  19355. target := &ret
  19356. if err := gensupport.DecodeResponse(target, res); err != nil {
  19357. return nil, err
  19358. }
  19359. return ret, nil
  19360. // {
  19361. // "description": "Gets one change log by ID.",
  19362. // "httpMethod": "GET",
  19363. // "id": "dfareporting.changeLogs.get",
  19364. // "parameterOrder": [
  19365. // "profileId",
  19366. // "id"
  19367. // ],
  19368. // "parameters": {
  19369. // "id": {
  19370. // "description": "Change log ID.",
  19371. // "format": "int64",
  19372. // "location": "path",
  19373. // "required": true,
  19374. // "type": "string"
  19375. // },
  19376. // "profileId": {
  19377. // "description": "User profile ID associated with this request.",
  19378. // "format": "int64",
  19379. // "location": "path",
  19380. // "required": true,
  19381. // "type": "string"
  19382. // }
  19383. // },
  19384. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  19385. // "response": {
  19386. // "$ref": "ChangeLog"
  19387. // },
  19388. // "scopes": [
  19389. // "https://www.googleapis.com/auth/dfatrafficking"
  19390. // ]
  19391. // }
  19392. }
  19393. // method id "dfareporting.changeLogs.list":
  19394. type ChangeLogsListCall struct {
  19395. s *Service
  19396. profileId int64
  19397. urlParams_ gensupport.URLParams
  19398. ifNoneMatch_ string
  19399. ctx_ context.Context
  19400. header_ http.Header
  19401. }
  19402. // List: Retrieves a list of change logs. This method supports paging.
  19403. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  19404. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19405. c.profileId = profileId
  19406. return c
  19407. }
  19408. // Action sets the optional parameter "action": Select only change logs
  19409. // with the specified action.
  19410. //
  19411. // Possible values:
  19412. // "ACTION_ADD"
  19413. // "ACTION_ASSIGN"
  19414. // "ACTION_ASSOCIATE"
  19415. // "ACTION_CREATE"
  19416. // "ACTION_DELETE"
  19417. // "ACTION_DISABLE"
  19418. // "ACTION_EMAIL_TAGS"
  19419. // "ACTION_ENABLE"
  19420. // "ACTION_LINK"
  19421. // "ACTION_MARK_AS_DEFAULT"
  19422. // "ACTION_PUSH"
  19423. // "ACTION_REMOVE"
  19424. // "ACTION_SEND"
  19425. // "ACTION_SHARE"
  19426. // "ACTION_UNASSIGN"
  19427. // "ACTION_UNLINK"
  19428. // "ACTION_UPDATE"
  19429. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  19430. c.urlParams_.Set("action", action)
  19431. return c
  19432. }
  19433. // Ids sets the optional parameter "ids": Select only change logs with
  19434. // these IDs.
  19435. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  19436. var ids_ []string
  19437. for _, v := range ids {
  19438. ids_ = append(ids_, fmt.Sprint(v))
  19439. }
  19440. c.urlParams_.SetMulti("ids", ids_)
  19441. return c
  19442. }
  19443. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  19444. // only change logs whose change time is before the specified
  19445. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  19446. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19447. // America/New York time zone, the format is
  19448. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19449. // the letter T, the hour (24-hour clock system), minute, second, and
  19450. // then the time zone offset.
  19451. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  19452. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  19453. return c
  19454. }
  19455. // MaxResults sets the optional parameter "maxResults": Maximum number
  19456. // of results to return.
  19457. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  19458. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19459. return c
  19460. }
  19461. // MinChangeTime sets the optional parameter "minChangeTime": Select
  19462. // only change logs whose change time is before the specified
  19463. // minChangeTime.The time should be formatted as an RFC3339 date/time
  19464. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19465. // America/New York time zone, the format is
  19466. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19467. // the letter T, the hour (24-hour clock system), minute, second, and
  19468. // then the time zone offset.
  19469. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  19470. c.urlParams_.Set("minChangeTime", minChangeTime)
  19471. return c
  19472. }
  19473. // ObjectIds sets the optional parameter "objectIds": Select only change
  19474. // logs with these object IDs.
  19475. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  19476. var objectIds_ []string
  19477. for _, v := range objectIds {
  19478. objectIds_ = append(objectIds_, fmt.Sprint(v))
  19479. }
  19480. c.urlParams_.SetMulti("objectIds", objectIds_)
  19481. return c
  19482. }
  19483. // ObjectType sets the optional parameter "objectType": Select only
  19484. // change logs with the specified object type.
  19485. //
  19486. // Possible values:
  19487. // "OBJECT_ACCOUNT"
  19488. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  19489. // "OBJECT_AD"
  19490. // "OBJECT_ADVERTISER"
  19491. // "OBJECT_ADVERTISER_GROUP"
  19492. // "OBJECT_BILLING_ACCOUNT_GROUP"
  19493. // "OBJECT_BILLING_FEATURE"
  19494. // "OBJECT_BILLING_MINIMUM_FEE"
  19495. // "OBJECT_BILLING_PROFILE"
  19496. // "OBJECT_CAMPAIGN"
  19497. // "OBJECT_CONTENT_CATEGORY"
  19498. // "OBJECT_CREATIVE"
  19499. // "OBJECT_CREATIVE_ASSET"
  19500. // "OBJECT_CREATIVE_BUNDLE"
  19501. // "OBJECT_CREATIVE_FIELD"
  19502. // "OBJECT_CREATIVE_GROUP"
  19503. // "OBJECT_DFA_SITE"
  19504. // "OBJECT_EVENT_TAG"
  19505. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  19506. // "OBJECT_FLOODLIGHT_ACTVITY"
  19507. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  19508. // "OBJECT_INSTREAM_CREATIVE"
  19509. // "OBJECT_LANDING_PAGE"
  19510. // "OBJECT_MEDIA_ORDER"
  19511. // "OBJECT_PLACEMENT"
  19512. // "OBJECT_PLACEMENT_STRATEGY"
  19513. // "OBJECT_PLAYSTORE_LINK"
  19514. // "OBJECT_PROVIDED_LIST_CLIENT"
  19515. // "OBJECT_RATE_CARD"
  19516. // "OBJECT_REMARKETING_LIST"
  19517. // "OBJECT_RICHMEDIA_CREATIVE"
  19518. // "OBJECT_SD_SITE"
  19519. // "OBJECT_SEARCH_LIFT_STUDY"
  19520. // "OBJECT_SIZE"
  19521. // "OBJECT_SUBACCOUNT"
  19522. // "OBJECT_TARGETING_TEMPLATE"
  19523. // "OBJECT_USER_PROFILE"
  19524. // "OBJECT_USER_PROFILE_FILTER"
  19525. // "OBJECT_USER_ROLE"
  19526. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  19527. c.urlParams_.Set("objectType", objectType)
  19528. return c
  19529. }
  19530. // PageToken sets the optional parameter "pageToken": Value of the
  19531. // nextPageToken from the previous result page.
  19532. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  19533. c.urlParams_.Set("pageToken", pageToken)
  19534. return c
  19535. }
  19536. // SearchString sets the optional parameter "searchString": Select only
  19537. // change logs whose object ID, user name, old or new values match the
  19538. // search string.
  19539. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  19540. c.urlParams_.Set("searchString", searchString)
  19541. return c
  19542. }
  19543. // UserProfileIds sets the optional parameter "userProfileIds": Select
  19544. // only change logs with these user profile IDs.
  19545. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  19546. var userProfileIds_ []string
  19547. for _, v := range userProfileIds {
  19548. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  19549. }
  19550. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  19551. return c
  19552. }
  19553. // Fields allows partial responses to be retrieved. See
  19554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19555. // for more information.
  19556. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  19557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19558. return c
  19559. }
  19560. // IfNoneMatch sets the optional parameter which makes the operation
  19561. // fail if the object's ETag matches the given value. This is useful for
  19562. // getting updates only after the object has changed since the last
  19563. // request. Use googleapi.IsNotModified to check whether the response
  19564. // error from Do is the result of In-None-Match.
  19565. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  19566. c.ifNoneMatch_ = entityTag
  19567. return c
  19568. }
  19569. // Context sets the context to be used in this call's Do method. Any
  19570. // pending HTTP request will be aborted if the provided context is
  19571. // canceled.
  19572. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  19573. c.ctx_ = ctx
  19574. return c
  19575. }
  19576. // Header returns an http.Header that can be modified by the caller to
  19577. // add HTTP headers to the request.
  19578. func (c *ChangeLogsListCall) Header() http.Header {
  19579. if c.header_ == nil {
  19580. c.header_ = make(http.Header)
  19581. }
  19582. return c.header_
  19583. }
  19584. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  19585. reqHeaders := make(http.Header)
  19586. for k, v := range c.header_ {
  19587. reqHeaders[k] = v
  19588. }
  19589. reqHeaders.Set("User-Agent", c.s.userAgent())
  19590. if c.ifNoneMatch_ != "" {
  19591. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19592. }
  19593. var body io.Reader = nil
  19594. c.urlParams_.Set("alt", alt)
  19595. c.urlParams_.Set("prettyPrint", "false")
  19596. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  19597. urls += "?" + c.urlParams_.Encode()
  19598. req, err := http.NewRequest("GET", urls, body)
  19599. if err != nil {
  19600. return nil, err
  19601. }
  19602. req.Header = reqHeaders
  19603. googleapi.Expand(req.URL, map[string]string{
  19604. "profileId": strconv.FormatInt(c.profileId, 10),
  19605. })
  19606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19607. }
  19608. // Do executes the "dfareporting.changeLogs.list" call.
  19609. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  19610. // non-2xx status code is an error. Response headers are in either
  19611. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  19612. // returned at all) in error.(*googleapi.Error).Header. Use
  19613. // googleapi.IsNotModified to check whether the returned error was
  19614. // because http.StatusNotModified was returned.
  19615. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  19616. gensupport.SetOptions(c.urlParams_, opts...)
  19617. res, err := c.doRequest("json")
  19618. if res != nil && res.StatusCode == http.StatusNotModified {
  19619. if res.Body != nil {
  19620. res.Body.Close()
  19621. }
  19622. return nil, &googleapi.Error{
  19623. Code: res.StatusCode,
  19624. Header: res.Header,
  19625. }
  19626. }
  19627. if err != nil {
  19628. return nil, err
  19629. }
  19630. defer googleapi.CloseBody(res)
  19631. if err := googleapi.CheckResponse(res); err != nil {
  19632. return nil, err
  19633. }
  19634. ret := &ChangeLogsListResponse{
  19635. ServerResponse: googleapi.ServerResponse{
  19636. Header: res.Header,
  19637. HTTPStatusCode: res.StatusCode,
  19638. },
  19639. }
  19640. target := &ret
  19641. if err := gensupport.DecodeResponse(target, res); err != nil {
  19642. return nil, err
  19643. }
  19644. return ret, nil
  19645. // {
  19646. // "description": "Retrieves a list of change logs. This method supports paging.",
  19647. // "httpMethod": "GET",
  19648. // "id": "dfareporting.changeLogs.list",
  19649. // "parameterOrder": [
  19650. // "profileId"
  19651. // ],
  19652. // "parameters": {
  19653. // "action": {
  19654. // "description": "Select only change logs with the specified action.",
  19655. // "enum": [
  19656. // "ACTION_ADD",
  19657. // "ACTION_ASSIGN",
  19658. // "ACTION_ASSOCIATE",
  19659. // "ACTION_CREATE",
  19660. // "ACTION_DELETE",
  19661. // "ACTION_DISABLE",
  19662. // "ACTION_EMAIL_TAGS",
  19663. // "ACTION_ENABLE",
  19664. // "ACTION_LINK",
  19665. // "ACTION_MARK_AS_DEFAULT",
  19666. // "ACTION_PUSH",
  19667. // "ACTION_REMOVE",
  19668. // "ACTION_SEND",
  19669. // "ACTION_SHARE",
  19670. // "ACTION_UNASSIGN",
  19671. // "ACTION_UNLINK",
  19672. // "ACTION_UPDATE"
  19673. // ],
  19674. // "enumDescriptions": [
  19675. // "",
  19676. // "",
  19677. // "",
  19678. // "",
  19679. // "",
  19680. // "",
  19681. // "",
  19682. // "",
  19683. // "",
  19684. // "",
  19685. // "",
  19686. // "",
  19687. // "",
  19688. // "",
  19689. // "",
  19690. // "",
  19691. // ""
  19692. // ],
  19693. // "location": "query",
  19694. // "type": "string"
  19695. // },
  19696. // "ids": {
  19697. // "description": "Select only change logs with these IDs.",
  19698. // "format": "int64",
  19699. // "location": "query",
  19700. // "repeated": true,
  19701. // "type": "string"
  19702. // },
  19703. // "maxChangeTime": {
  19704. // "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.",
  19705. // "location": "query",
  19706. // "type": "string"
  19707. // },
  19708. // "maxResults": {
  19709. // "default": "1000",
  19710. // "description": "Maximum number of results to return.",
  19711. // "format": "int32",
  19712. // "location": "query",
  19713. // "maximum": "1000",
  19714. // "minimum": "0",
  19715. // "type": "integer"
  19716. // },
  19717. // "minChangeTime": {
  19718. // "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.",
  19719. // "location": "query",
  19720. // "type": "string"
  19721. // },
  19722. // "objectIds": {
  19723. // "description": "Select only change logs with these object IDs.",
  19724. // "format": "int64",
  19725. // "location": "query",
  19726. // "repeated": true,
  19727. // "type": "string"
  19728. // },
  19729. // "objectType": {
  19730. // "description": "Select only change logs with the specified object type.",
  19731. // "enum": [
  19732. // "OBJECT_ACCOUNT",
  19733. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  19734. // "OBJECT_AD",
  19735. // "OBJECT_ADVERTISER",
  19736. // "OBJECT_ADVERTISER_GROUP",
  19737. // "OBJECT_BILLING_ACCOUNT_GROUP",
  19738. // "OBJECT_BILLING_FEATURE",
  19739. // "OBJECT_BILLING_MINIMUM_FEE",
  19740. // "OBJECT_BILLING_PROFILE",
  19741. // "OBJECT_CAMPAIGN",
  19742. // "OBJECT_CONTENT_CATEGORY",
  19743. // "OBJECT_CREATIVE",
  19744. // "OBJECT_CREATIVE_ASSET",
  19745. // "OBJECT_CREATIVE_BUNDLE",
  19746. // "OBJECT_CREATIVE_FIELD",
  19747. // "OBJECT_CREATIVE_GROUP",
  19748. // "OBJECT_DFA_SITE",
  19749. // "OBJECT_EVENT_TAG",
  19750. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  19751. // "OBJECT_FLOODLIGHT_ACTVITY",
  19752. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  19753. // "OBJECT_INSTREAM_CREATIVE",
  19754. // "OBJECT_LANDING_PAGE",
  19755. // "OBJECT_MEDIA_ORDER",
  19756. // "OBJECT_PLACEMENT",
  19757. // "OBJECT_PLACEMENT_STRATEGY",
  19758. // "OBJECT_PLAYSTORE_LINK",
  19759. // "OBJECT_PROVIDED_LIST_CLIENT",
  19760. // "OBJECT_RATE_CARD",
  19761. // "OBJECT_REMARKETING_LIST",
  19762. // "OBJECT_RICHMEDIA_CREATIVE",
  19763. // "OBJECT_SD_SITE",
  19764. // "OBJECT_SEARCH_LIFT_STUDY",
  19765. // "OBJECT_SIZE",
  19766. // "OBJECT_SUBACCOUNT",
  19767. // "OBJECT_TARGETING_TEMPLATE",
  19768. // "OBJECT_USER_PROFILE",
  19769. // "OBJECT_USER_PROFILE_FILTER",
  19770. // "OBJECT_USER_ROLE"
  19771. // ],
  19772. // "enumDescriptions": [
  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. // "",
  19800. // "",
  19801. // "",
  19802. // "",
  19803. // "",
  19804. // "",
  19805. // "",
  19806. // "",
  19807. // "",
  19808. // "",
  19809. // "",
  19810. // "",
  19811. // ""
  19812. // ],
  19813. // "location": "query",
  19814. // "type": "string"
  19815. // },
  19816. // "pageToken": {
  19817. // "description": "Value of the nextPageToken from the previous result page.",
  19818. // "location": "query",
  19819. // "type": "string"
  19820. // },
  19821. // "profileId": {
  19822. // "description": "User profile ID associated with this request.",
  19823. // "format": "int64",
  19824. // "location": "path",
  19825. // "required": true,
  19826. // "type": "string"
  19827. // },
  19828. // "searchString": {
  19829. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  19830. // "location": "query",
  19831. // "type": "string"
  19832. // },
  19833. // "userProfileIds": {
  19834. // "description": "Select only change logs with these user profile IDs.",
  19835. // "format": "int64",
  19836. // "location": "query",
  19837. // "repeated": true,
  19838. // "type": "string"
  19839. // }
  19840. // },
  19841. // "path": "userprofiles/{profileId}/changeLogs",
  19842. // "response": {
  19843. // "$ref": "ChangeLogsListResponse"
  19844. // },
  19845. // "scopes": [
  19846. // "https://www.googleapis.com/auth/dfatrafficking"
  19847. // ]
  19848. // }
  19849. }
  19850. // Pages invokes f for each page of results.
  19851. // A non-nil error returned from f will halt the iteration.
  19852. // The provided context supersedes any context provided to the Context method.
  19853. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  19854. c.ctx_ = ctx
  19855. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19856. for {
  19857. x, err := c.Do()
  19858. if err != nil {
  19859. return err
  19860. }
  19861. if err := f(x); err != nil {
  19862. return err
  19863. }
  19864. if x.NextPageToken == "" {
  19865. return nil
  19866. }
  19867. c.PageToken(x.NextPageToken)
  19868. }
  19869. }
  19870. // method id "dfareporting.cities.list":
  19871. type CitiesListCall struct {
  19872. s *Service
  19873. profileId int64
  19874. urlParams_ gensupport.URLParams
  19875. ifNoneMatch_ string
  19876. ctx_ context.Context
  19877. header_ http.Header
  19878. }
  19879. // List: Retrieves a list of cities, possibly filtered.
  19880. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  19881. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19882. c.profileId = profileId
  19883. return c
  19884. }
  19885. // CountryDartIds sets the optional parameter "countryDartIds": Select
  19886. // only cities from these countries.
  19887. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  19888. var countryDartIds_ []string
  19889. for _, v := range countryDartIds {
  19890. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  19891. }
  19892. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  19893. return c
  19894. }
  19895. // DartIds sets the optional parameter "dartIds": Select only cities
  19896. // with these DART IDs.
  19897. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  19898. var dartIds_ []string
  19899. for _, v := range dartIds {
  19900. dartIds_ = append(dartIds_, fmt.Sprint(v))
  19901. }
  19902. c.urlParams_.SetMulti("dartIds", dartIds_)
  19903. return c
  19904. }
  19905. // NamePrefix sets the optional parameter "namePrefix": Select only
  19906. // cities with names starting with this prefix.
  19907. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  19908. c.urlParams_.Set("namePrefix", namePrefix)
  19909. return c
  19910. }
  19911. // RegionDartIds sets the optional parameter "regionDartIds": Select
  19912. // only cities from these regions.
  19913. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  19914. var regionDartIds_ []string
  19915. for _, v := range regionDartIds {
  19916. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  19917. }
  19918. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  19919. return c
  19920. }
  19921. // Fields allows partial responses to be retrieved. See
  19922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19923. // for more information.
  19924. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  19925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19926. return c
  19927. }
  19928. // IfNoneMatch sets the optional parameter which makes the operation
  19929. // fail if the object's ETag matches the given value. This is useful for
  19930. // getting updates only after the object has changed since the last
  19931. // request. Use googleapi.IsNotModified to check whether the response
  19932. // error from Do is the result of In-None-Match.
  19933. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  19934. c.ifNoneMatch_ = entityTag
  19935. return c
  19936. }
  19937. // Context sets the context to be used in this call's Do method. Any
  19938. // pending HTTP request will be aborted if the provided context is
  19939. // canceled.
  19940. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  19941. c.ctx_ = ctx
  19942. return c
  19943. }
  19944. // Header returns an http.Header that can be modified by the caller to
  19945. // add HTTP headers to the request.
  19946. func (c *CitiesListCall) Header() http.Header {
  19947. if c.header_ == nil {
  19948. c.header_ = make(http.Header)
  19949. }
  19950. return c.header_
  19951. }
  19952. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  19953. reqHeaders := make(http.Header)
  19954. for k, v := range c.header_ {
  19955. reqHeaders[k] = v
  19956. }
  19957. reqHeaders.Set("User-Agent", c.s.userAgent())
  19958. if c.ifNoneMatch_ != "" {
  19959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19960. }
  19961. var body io.Reader = nil
  19962. c.urlParams_.Set("alt", alt)
  19963. c.urlParams_.Set("prettyPrint", "false")
  19964. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  19965. urls += "?" + c.urlParams_.Encode()
  19966. req, err := http.NewRequest("GET", urls, body)
  19967. if err != nil {
  19968. return nil, err
  19969. }
  19970. req.Header = reqHeaders
  19971. googleapi.Expand(req.URL, map[string]string{
  19972. "profileId": strconv.FormatInt(c.profileId, 10),
  19973. })
  19974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19975. }
  19976. // Do executes the "dfareporting.cities.list" call.
  19977. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  19978. // non-2xx status code is an error. Response headers are in either
  19979. // *CitiesListResponse.ServerResponse.Header or (if a response was
  19980. // returned at all) in error.(*googleapi.Error).Header. Use
  19981. // googleapi.IsNotModified to check whether the returned error was
  19982. // because http.StatusNotModified was returned.
  19983. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  19984. gensupport.SetOptions(c.urlParams_, opts...)
  19985. res, err := c.doRequest("json")
  19986. if res != nil && res.StatusCode == http.StatusNotModified {
  19987. if res.Body != nil {
  19988. res.Body.Close()
  19989. }
  19990. return nil, &googleapi.Error{
  19991. Code: res.StatusCode,
  19992. Header: res.Header,
  19993. }
  19994. }
  19995. if err != nil {
  19996. return nil, err
  19997. }
  19998. defer googleapi.CloseBody(res)
  19999. if err := googleapi.CheckResponse(res); err != nil {
  20000. return nil, err
  20001. }
  20002. ret := &CitiesListResponse{
  20003. ServerResponse: googleapi.ServerResponse{
  20004. Header: res.Header,
  20005. HTTPStatusCode: res.StatusCode,
  20006. },
  20007. }
  20008. target := &ret
  20009. if err := gensupport.DecodeResponse(target, res); err != nil {
  20010. return nil, err
  20011. }
  20012. return ret, nil
  20013. // {
  20014. // "description": "Retrieves a list of cities, possibly filtered.",
  20015. // "httpMethod": "GET",
  20016. // "id": "dfareporting.cities.list",
  20017. // "parameterOrder": [
  20018. // "profileId"
  20019. // ],
  20020. // "parameters": {
  20021. // "countryDartIds": {
  20022. // "description": "Select only cities from these countries.",
  20023. // "format": "int64",
  20024. // "location": "query",
  20025. // "repeated": true,
  20026. // "type": "string"
  20027. // },
  20028. // "dartIds": {
  20029. // "description": "Select only cities with these DART IDs.",
  20030. // "format": "int64",
  20031. // "location": "query",
  20032. // "repeated": true,
  20033. // "type": "string"
  20034. // },
  20035. // "namePrefix": {
  20036. // "description": "Select only cities with names starting with this prefix.",
  20037. // "location": "query",
  20038. // "type": "string"
  20039. // },
  20040. // "profileId": {
  20041. // "description": "User profile ID associated with this request.",
  20042. // "format": "int64",
  20043. // "location": "path",
  20044. // "required": true,
  20045. // "type": "string"
  20046. // },
  20047. // "regionDartIds": {
  20048. // "description": "Select only cities from these regions.",
  20049. // "format": "int64",
  20050. // "location": "query",
  20051. // "repeated": true,
  20052. // "type": "string"
  20053. // }
  20054. // },
  20055. // "path": "userprofiles/{profileId}/cities",
  20056. // "response": {
  20057. // "$ref": "CitiesListResponse"
  20058. // },
  20059. // "scopes": [
  20060. // "https://www.googleapis.com/auth/dfatrafficking"
  20061. // ]
  20062. // }
  20063. }
  20064. // method id "dfareporting.connectionTypes.get":
  20065. type ConnectionTypesGetCall struct {
  20066. s *Service
  20067. profileId int64
  20068. id int64
  20069. urlParams_ gensupport.URLParams
  20070. ifNoneMatch_ string
  20071. ctx_ context.Context
  20072. header_ http.Header
  20073. }
  20074. // Get: Gets one connection type by ID.
  20075. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  20076. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20077. c.profileId = profileId
  20078. c.id = id
  20079. return c
  20080. }
  20081. // Fields allows partial responses to be retrieved. See
  20082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20083. // for more information.
  20084. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  20085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20086. return c
  20087. }
  20088. // IfNoneMatch sets the optional parameter which makes the operation
  20089. // fail if the object's ETag matches the given value. This is useful for
  20090. // getting updates only after the object has changed since the last
  20091. // request. Use googleapi.IsNotModified to check whether the response
  20092. // error from Do is the result of In-None-Match.
  20093. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  20094. c.ifNoneMatch_ = entityTag
  20095. return c
  20096. }
  20097. // Context sets the context to be used in this call's Do method. Any
  20098. // pending HTTP request will be aborted if the provided context is
  20099. // canceled.
  20100. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  20101. c.ctx_ = ctx
  20102. return c
  20103. }
  20104. // Header returns an http.Header that can be modified by the caller to
  20105. // add HTTP headers to the request.
  20106. func (c *ConnectionTypesGetCall) Header() http.Header {
  20107. if c.header_ == nil {
  20108. c.header_ = make(http.Header)
  20109. }
  20110. return c.header_
  20111. }
  20112. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  20113. reqHeaders := make(http.Header)
  20114. for k, v := range c.header_ {
  20115. reqHeaders[k] = v
  20116. }
  20117. reqHeaders.Set("User-Agent", c.s.userAgent())
  20118. if c.ifNoneMatch_ != "" {
  20119. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20120. }
  20121. var body io.Reader = nil
  20122. c.urlParams_.Set("alt", alt)
  20123. c.urlParams_.Set("prettyPrint", "false")
  20124. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  20125. urls += "?" + c.urlParams_.Encode()
  20126. req, err := http.NewRequest("GET", urls, body)
  20127. if err != nil {
  20128. return nil, err
  20129. }
  20130. req.Header = reqHeaders
  20131. googleapi.Expand(req.URL, map[string]string{
  20132. "profileId": strconv.FormatInt(c.profileId, 10),
  20133. "id": strconv.FormatInt(c.id, 10),
  20134. })
  20135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20136. }
  20137. // Do executes the "dfareporting.connectionTypes.get" call.
  20138. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  20139. // status code is an error. Response headers are in either
  20140. // *ConnectionType.ServerResponse.Header or (if a response was returned
  20141. // at all) in error.(*googleapi.Error).Header. Use
  20142. // googleapi.IsNotModified to check whether the returned error was
  20143. // because http.StatusNotModified was returned.
  20144. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  20145. gensupport.SetOptions(c.urlParams_, opts...)
  20146. res, err := c.doRequest("json")
  20147. if res != nil && res.StatusCode == http.StatusNotModified {
  20148. if res.Body != nil {
  20149. res.Body.Close()
  20150. }
  20151. return nil, &googleapi.Error{
  20152. Code: res.StatusCode,
  20153. Header: res.Header,
  20154. }
  20155. }
  20156. if err != nil {
  20157. return nil, err
  20158. }
  20159. defer googleapi.CloseBody(res)
  20160. if err := googleapi.CheckResponse(res); err != nil {
  20161. return nil, err
  20162. }
  20163. ret := &ConnectionType{
  20164. ServerResponse: googleapi.ServerResponse{
  20165. Header: res.Header,
  20166. HTTPStatusCode: res.StatusCode,
  20167. },
  20168. }
  20169. target := &ret
  20170. if err := gensupport.DecodeResponse(target, res); err != nil {
  20171. return nil, err
  20172. }
  20173. return ret, nil
  20174. // {
  20175. // "description": "Gets one connection type by ID.",
  20176. // "httpMethod": "GET",
  20177. // "id": "dfareporting.connectionTypes.get",
  20178. // "parameterOrder": [
  20179. // "profileId",
  20180. // "id"
  20181. // ],
  20182. // "parameters": {
  20183. // "id": {
  20184. // "description": "Connection type ID.",
  20185. // "format": "int64",
  20186. // "location": "path",
  20187. // "required": true,
  20188. // "type": "string"
  20189. // },
  20190. // "profileId": {
  20191. // "description": "User profile ID associated with this request.",
  20192. // "format": "int64",
  20193. // "location": "path",
  20194. // "required": true,
  20195. // "type": "string"
  20196. // }
  20197. // },
  20198. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  20199. // "response": {
  20200. // "$ref": "ConnectionType"
  20201. // },
  20202. // "scopes": [
  20203. // "https://www.googleapis.com/auth/dfatrafficking"
  20204. // ]
  20205. // }
  20206. }
  20207. // method id "dfareporting.connectionTypes.list":
  20208. type ConnectionTypesListCall struct {
  20209. s *Service
  20210. profileId int64
  20211. urlParams_ gensupport.URLParams
  20212. ifNoneMatch_ string
  20213. ctx_ context.Context
  20214. header_ http.Header
  20215. }
  20216. // List: Retrieves a list of connection types.
  20217. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  20218. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20219. c.profileId = profileId
  20220. return c
  20221. }
  20222. // Fields allows partial responses to be retrieved. See
  20223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20224. // for more information.
  20225. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  20226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20227. return c
  20228. }
  20229. // IfNoneMatch sets the optional parameter which makes the operation
  20230. // fail if the object's ETag matches the given value. This is useful for
  20231. // getting updates only after the object has changed since the last
  20232. // request. Use googleapi.IsNotModified to check whether the response
  20233. // error from Do is the result of In-None-Match.
  20234. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  20235. c.ifNoneMatch_ = entityTag
  20236. return c
  20237. }
  20238. // Context sets the context to be used in this call's Do method. Any
  20239. // pending HTTP request will be aborted if the provided context is
  20240. // canceled.
  20241. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  20242. c.ctx_ = ctx
  20243. return c
  20244. }
  20245. // Header returns an http.Header that can be modified by the caller to
  20246. // add HTTP headers to the request.
  20247. func (c *ConnectionTypesListCall) Header() http.Header {
  20248. if c.header_ == nil {
  20249. c.header_ = make(http.Header)
  20250. }
  20251. return c.header_
  20252. }
  20253. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  20254. reqHeaders := make(http.Header)
  20255. for k, v := range c.header_ {
  20256. reqHeaders[k] = v
  20257. }
  20258. reqHeaders.Set("User-Agent", c.s.userAgent())
  20259. if c.ifNoneMatch_ != "" {
  20260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20261. }
  20262. var body io.Reader = nil
  20263. c.urlParams_.Set("alt", alt)
  20264. c.urlParams_.Set("prettyPrint", "false")
  20265. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  20266. urls += "?" + c.urlParams_.Encode()
  20267. req, err := http.NewRequest("GET", urls, body)
  20268. if err != nil {
  20269. return nil, err
  20270. }
  20271. req.Header = reqHeaders
  20272. googleapi.Expand(req.URL, map[string]string{
  20273. "profileId": strconv.FormatInt(c.profileId, 10),
  20274. })
  20275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20276. }
  20277. // Do executes the "dfareporting.connectionTypes.list" call.
  20278. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  20279. // Any non-2xx status code is an error. Response headers are in either
  20280. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  20281. // was returned at all) in error.(*googleapi.Error).Header. Use
  20282. // googleapi.IsNotModified to check whether the returned error was
  20283. // because http.StatusNotModified was returned.
  20284. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  20285. gensupport.SetOptions(c.urlParams_, opts...)
  20286. res, err := c.doRequest("json")
  20287. if res != nil && res.StatusCode == http.StatusNotModified {
  20288. if res.Body != nil {
  20289. res.Body.Close()
  20290. }
  20291. return nil, &googleapi.Error{
  20292. Code: res.StatusCode,
  20293. Header: res.Header,
  20294. }
  20295. }
  20296. if err != nil {
  20297. return nil, err
  20298. }
  20299. defer googleapi.CloseBody(res)
  20300. if err := googleapi.CheckResponse(res); err != nil {
  20301. return nil, err
  20302. }
  20303. ret := &ConnectionTypesListResponse{
  20304. ServerResponse: googleapi.ServerResponse{
  20305. Header: res.Header,
  20306. HTTPStatusCode: res.StatusCode,
  20307. },
  20308. }
  20309. target := &ret
  20310. if err := gensupport.DecodeResponse(target, res); err != nil {
  20311. return nil, err
  20312. }
  20313. return ret, nil
  20314. // {
  20315. // "description": "Retrieves a list of connection types.",
  20316. // "httpMethod": "GET",
  20317. // "id": "dfareporting.connectionTypes.list",
  20318. // "parameterOrder": [
  20319. // "profileId"
  20320. // ],
  20321. // "parameters": {
  20322. // "profileId": {
  20323. // "description": "User profile ID associated with this request.",
  20324. // "format": "int64",
  20325. // "location": "path",
  20326. // "required": true,
  20327. // "type": "string"
  20328. // }
  20329. // },
  20330. // "path": "userprofiles/{profileId}/connectionTypes",
  20331. // "response": {
  20332. // "$ref": "ConnectionTypesListResponse"
  20333. // },
  20334. // "scopes": [
  20335. // "https://www.googleapis.com/auth/dfatrafficking"
  20336. // ]
  20337. // }
  20338. }
  20339. // method id "dfareporting.contentCategories.delete":
  20340. type ContentCategoriesDeleteCall struct {
  20341. s *Service
  20342. profileId int64
  20343. id int64
  20344. urlParams_ gensupport.URLParams
  20345. ctx_ context.Context
  20346. header_ http.Header
  20347. }
  20348. // Delete: Deletes an existing content category.
  20349. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  20350. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20351. c.profileId = profileId
  20352. c.id = id
  20353. return c
  20354. }
  20355. // Fields allows partial responses to be retrieved. See
  20356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20357. // for more information.
  20358. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  20359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20360. return c
  20361. }
  20362. // Context sets the context to be used in this call's Do method. Any
  20363. // pending HTTP request will be aborted if the provided context is
  20364. // canceled.
  20365. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  20366. c.ctx_ = ctx
  20367. return c
  20368. }
  20369. // Header returns an http.Header that can be modified by the caller to
  20370. // add HTTP headers to the request.
  20371. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  20372. if c.header_ == nil {
  20373. c.header_ = make(http.Header)
  20374. }
  20375. return c.header_
  20376. }
  20377. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20378. reqHeaders := make(http.Header)
  20379. for k, v := range c.header_ {
  20380. reqHeaders[k] = v
  20381. }
  20382. reqHeaders.Set("User-Agent", c.s.userAgent())
  20383. var body io.Reader = nil
  20384. c.urlParams_.Set("alt", alt)
  20385. c.urlParams_.Set("prettyPrint", "false")
  20386. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20387. urls += "?" + c.urlParams_.Encode()
  20388. req, err := http.NewRequest("DELETE", urls, body)
  20389. if err != nil {
  20390. return nil, err
  20391. }
  20392. req.Header = reqHeaders
  20393. googleapi.Expand(req.URL, map[string]string{
  20394. "profileId": strconv.FormatInt(c.profileId, 10),
  20395. "id": strconv.FormatInt(c.id, 10),
  20396. })
  20397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20398. }
  20399. // Do executes the "dfareporting.contentCategories.delete" call.
  20400. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20401. gensupport.SetOptions(c.urlParams_, opts...)
  20402. res, err := c.doRequest("json")
  20403. if err != nil {
  20404. return err
  20405. }
  20406. defer googleapi.CloseBody(res)
  20407. if err := googleapi.CheckResponse(res); err != nil {
  20408. return err
  20409. }
  20410. return nil
  20411. // {
  20412. // "description": "Deletes an existing content category.",
  20413. // "httpMethod": "DELETE",
  20414. // "id": "dfareporting.contentCategories.delete",
  20415. // "parameterOrder": [
  20416. // "profileId",
  20417. // "id"
  20418. // ],
  20419. // "parameters": {
  20420. // "id": {
  20421. // "description": "Content category ID.",
  20422. // "format": "int64",
  20423. // "location": "path",
  20424. // "required": true,
  20425. // "type": "string"
  20426. // },
  20427. // "profileId": {
  20428. // "description": "User profile ID associated with this request.",
  20429. // "format": "int64",
  20430. // "location": "path",
  20431. // "required": true,
  20432. // "type": "string"
  20433. // }
  20434. // },
  20435. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20436. // "scopes": [
  20437. // "https://www.googleapis.com/auth/dfatrafficking"
  20438. // ]
  20439. // }
  20440. }
  20441. // method id "dfareporting.contentCategories.get":
  20442. type ContentCategoriesGetCall struct {
  20443. s *Service
  20444. profileId int64
  20445. id int64
  20446. urlParams_ gensupport.URLParams
  20447. ifNoneMatch_ string
  20448. ctx_ context.Context
  20449. header_ http.Header
  20450. }
  20451. // Get: Gets one content category by ID.
  20452. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  20453. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20454. c.profileId = profileId
  20455. c.id = id
  20456. return c
  20457. }
  20458. // Fields allows partial responses to be retrieved. See
  20459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20460. // for more information.
  20461. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  20462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20463. return c
  20464. }
  20465. // IfNoneMatch sets the optional parameter which makes the operation
  20466. // fail if the object's ETag matches the given value. This is useful for
  20467. // getting updates only after the object has changed since the last
  20468. // request. Use googleapi.IsNotModified to check whether the response
  20469. // error from Do is the result of In-None-Match.
  20470. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  20471. c.ifNoneMatch_ = entityTag
  20472. return c
  20473. }
  20474. // Context sets the context to be used in this call's Do method. Any
  20475. // pending HTTP request will be aborted if the provided context is
  20476. // canceled.
  20477. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  20478. c.ctx_ = ctx
  20479. return c
  20480. }
  20481. // Header returns an http.Header that can be modified by the caller to
  20482. // add HTTP headers to the request.
  20483. func (c *ContentCategoriesGetCall) Header() http.Header {
  20484. if c.header_ == nil {
  20485. c.header_ = make(http.Header)
  20486. }
  20487. return c.header_
  20488. }
  20489. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  20490. reqHeaders := make(http.Header)
  20491. for k, v := range c.header_ {
  20492. reqHeaders[k] = v
  20493. }
  20494. reqHeaders.Set("User-Agent", c.s.userAgent())
  20495. if c.ifNoneMatch_ != "" {
  20496. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20497. }
  20498. var body io.Reader = nil
  20499. c.urlParams_.Set("alt", alt)
  20500. c.urlParams_.Set("prettyPrint", "false")
  20501. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20502. urls += "?" + c.urlParams_.Encode()
  20503. req, err := http.NewRequest("GET", urls, body)
  20504. if err != nil {
  20505. return nil, err
  20506. }
  20507. req.Header = reqHeaders
  20508. googleapi.Expand(req.URL, map[string]string{
  20509. "profileId": strconv.FormatInt(c.profileId, 10),
  20510. "id": strconv.FormatInt(c.id, 10),
  20511. })
  20512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20513. }
  20514. // Do executes the "dfareporting.contentCategories.get" call.
  20515. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20516. // status code is an error. Response headers are in either
  20517. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20518. // at all) in error.(*googleapi.Error).Header. Use
  20519. // googleapi.IsNotModified to check whether the returned error was
  20520. // because http.StatusNotModified was returned.
  20521. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20522. gensupport.SetOptions(c.urlParams_, opts...)
  20523. res, err := c.doRequest("json")
  20524. if res != nil && res.StatusCode == http.StatusNotModified {
  20525. if res.Body != nil {
  20526. res.Body.Close()
  20527. }
  20528. return nil, &googleapi.Error{
  20529. Code: res.StatusCode,
  20530. Header: res.Header,
  20531. }
  20532. }
  20533. if err != nil {
  20534. return nil, err
  20535. }
  20536. defer googleapi.CloseBody(res)
  20537. if err := googleapi.CheckResponse(res); err != nil {
  20538. return nil, err
  20539. }
  20540. ret := &ContentCategory{
  20541. ServerResponse: googleapi.ServerResponse{
  20542. Header: res.Header,
  20543. HTTPStatusCode: res.StatusCode,
  20544. },
  20545. }
  20546. target := &ret
  20547. if err := gensupport.DecodeResponse(target, res); err != nil {
  20548. return nil, err
  20549. }
  20550. return ret, nil
  20551. // {
  20552. // "description": "Gets one content category by ID.",
  20553. // "httpMethod": "GET",
  20554. // "id": "dfareporting.contentCategories.get",
  20555. // "parameterOrder": [
  20556. // "profileId",
  20557. // "id"
  20558. // ],
  20559. // "parameters": {
  20560. // "id": {
  20561. // "description": "Content category ID.",
  20562. // "format": "int64",
  20563. // "location": "path",
  20564. // "required": true,
  20565. // "type": "string"
  20566. // },
  20567. // "profileId": {
  20568. // "description": "User profile ID associated with this request.",
  20569. // "format": "int64",
  20570. // "location": "path",
  20571. // "required": true,
  20572. // "type": "string"
  20573. // }
  20574. // },
  20575. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20576. // "response": {
  20577. // "$ref": "ContentCategory"
  20578. // },
  20579. // "scopes": [
  20580. // "https://www.googleapis.com/auth/dfatrafficking"
  20581. // ]
  20582. // }
  20583. }
  20584. // method id "dfareporting.contentCategories.insert":
  20585. type ContentCategoriesInsertCall struct {
  20586. s *Service
  20587. profileId int64
  20588. contentcategory *ContentCategory
  20589. urlParams_ gensupport.URLParams
  20590. ctx_ context.Context
  20591. header_ http.Header
  20592. }
  20593. // Insert: Inserts a new content category.
  20594. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  20595. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20596. c.profileId = profileId
  20597. c.contentcategory = contentcategory
  20598. return c
  20599. }
  20600. // Fields allows partial responses to be retrieved. See
  20601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20602. // for more information.
  20603. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  20604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20605. return c
  20606. }
  20607. // Context sets the context to be used in this call's Do method. Any
  20608. // pending HTTP request will be aborted if the provided context is
  20609. // canceled.
  20610. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  20611. c.ctx_ = ctx
  20612. return c
  20613. }
  20614. // Header returns an http.Header that can be modified by the caller to
  20615. // add HTTP headers to the request.
  20616. func (c *ContentCategoriesInsertCall) Header() http.Header {
  20617. if c.header_ == nil {
  20618. c.header_ = make(http.Header)
  20619. }
  20620. return c.header_
  20621. }
  20622. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  20623. reqHeaders := make(http.Header)
  20624. for k, v := range c.header_ {
  20625. reqHeaders[k] = v
  20626. }
  20627. reqHeaders.Set("User-Agent", c.s.userAgent())
  20628. var body io.Reader = nil
  20629. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20630. if err != nil {
  20631. return nil, err
  20632. }
  20633. reqHeaders.Set("Content-Type", "application/json")
  20634. c.urlParams_.Set("alt", alt)
  20635. c.urlParams_.Set("prettyPrint", "false")
  20636. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20637. urls += "?" + c.urlParams_.Encode()
  20638. req, err := http.NewRequest("POST", urls, body)
  20639. if err != nil {
  20640. return nil, err
  20641. }
  20642. req.Header = reqHeaders
  20643. googleapi.Expand(req.URL, map[string]string{
  20644. "profileId": strconv.FormatInt(c.profileId, 10),
  20645. })
  20646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20647. }
  20648. // Do executes the "dfareporting.contentCategories.insert" call.
  20649. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20650. // status code is an error. Response headers are in either
  20651. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20652. // at all) in error.(*googleapi.Error).Header. Use
  20653. // googleapi.IsNotModified to check whether the returned error was
  20654. // because http.StatusNotModified was returned.
  20655. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20656. gensupport.SetOptions(c.urlParams_, opts...)
  20657. res, err := c.doRequest("json")
  20658. if res != nil && res.StatusCode == http.StatusNotModified {
  20659. if res.Body != nil {
  20660. res.Body.Close()
  20661. }
  20662. return nil, &googleapi.Error{
  20663. Code: res.StatusCode,
  20664. Header: res.Header,
  20665. }
  20666. }
  20667. if err != nil {
  20668. return nil, err
  20669. }
  20670. defer googleapi.CloseBody(res)
  20671. if err := googleapi.CheckResponse(res); err != nil {
  20672. return nil, err
  20673. }
  20674. ret := &ContentCategory{
  20675. ServerResponse: googleapi.ServerResponse{
  20676. Header: res.Header,
  20677. HTTPStatusCode: res.StatusCode,
  20678. },
  20679. }
  20680. target := &ret
  20681. if err := gensupport.DecodeResponse(target, res); err != nil {
  20682. return nil, err
  20683. }
  20684. return ret, nil
  20685. // {
  20686. // "description": "Inserts a new content category.",
  20687. // "httpMethod": "POST",
  20688. // "id": "dfareporting.contentCategories.insert",
  20689. // "parameterOrder": [
  20690. // "profileId"
  20691. // ],
  20692. // "parameters": {
  20693. // "profileId": {
  20694. // "description": "User profile ID associated with this request.",
  20695. // "format": "int64",
  20696. // "location": "path",
  20697. // "required": true,
  20698. // "type": "string"
  20699. // }
  20700. // },
  20701. // "path": "userprofiles/{profileId}/contentCategories",
  20702. // "request": {
  20703. // "$ref": "ContentCategory"
  20704. // },
  20705. // "response": {
  20706. // "$ref": "ContentCategory"
  20707. // },
  20708. // "scopes": [
  20709. // "https://www.googleapis.com/auth/dfatrafficking"
  20710. // ]
  20711. // }
  20712. }
  20713. // method id "dfareporting.contentCategories.list":
  20714. type ContentCategoriesListCall struct {
  20715. s *Service
  20716. profileId int64
  20717. urlParams_ gensupport.URLParams
  20718. ifNoneMatch_ string
  20719. ctx_ context.Context
  20720. header_ http.Header
  20721. }
  20722. // List: Retrieves a list of content categories, possibly filtered. This
  20723. // method supports paging.
  20724. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  20725. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20726. c.profileId = profileId
  20727. return c
  20728. }
  20729. // Ids sets the optional parameter "ids": Select only content categories
  20730. // with these IDs.
  20731. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  20732. var ids_ []string
  20733. for _, v := range ids {
  20734. ids_ = append(ids_, fmt.Sprint(v))
  20735. }
  20736. c.urlParams_.SetMulti("ids", ids_)
  20737. return c
  20738. }
  20739. // MaxResults sets the optional parameter "maxResults": Maximum number
  20740. // of results to return.
  20741. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  20742. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20743. return c
  20744. }
  20745. // PageToken sets the optional parameter "pageToken": Value of the
  20746. // nextPageToken from the previous result page.
  20747. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  20748. c.urlParams_.Set("pageToken", pageToken)
  20749. return c
  20750. }
  20751. // SearchString sets the optional parameter "searchString": Allows
  20752. // searching for objects by name or ID. Wildcards (*) are allowed. For
  20753. // example, "contentcategory*2015" will return objects with names like
  20754. // "contentcategory June 2015", "contentcategory April 2015", or simply
  20755. // "contentcategory 2015". Most of the searches also add wildcards
  20756. // implicitly at the start and the end of the search string. For
  20757. // example, a search string of "contentcategory" will match objects with
  20758. // name "my contentcategory", "contentcategory 2015", or simply
  20759. // "contentcategory".
  20760. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  20761. c.urlParams_.Set("searchString", searchString)
  20762. return c
  20763. }
  20764. // SortField sets the optional parameter "sortField": Field by which to
  20765. // sort the list.
  20766. //
  20767. // Possible values:
  20768. // "ID" (default)
  20769. // "NAME"
  20770. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  20771. c.urlParams_.Set("sortField", sortField)
  20772. return c
  20773. }
  20774. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20775. // results.
  20776. //
  20777. // Possible values:
  20778. // "ASCENDING" (default)
  20779. // "DESCENDING"
  20780. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  20781. c.urlParams_.Set("sortOrder", sortOrder)
  20782. return c
  20783. }
  20784. // Fields allows partial responses to be retrieved. See
  20785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20786. // for more information.
  20787. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  20788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20789. return c
  20790. }
  20791. // IfNoneMatch sets the optional parameter which makes the operation
  20792. // fail if the object's ETag matches the given value. This is useful for
  20793. // getting updates only after the object has changed since the last
  20794. // request. Use googleapi.IsNotModified to check whether the response
  20795. // error from Do is the result of In-None-Match.
  20796. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  20797. c.ifNoneMatch_ = entityTag
  20798. return c
  20799. }
  20800. // Context sets the context to be used in this call's Do method. Any
  20801. // pending HTTP request will be aborted if the provided context is
  20802. // canceled.
  20803. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  20804. c.ctx_ = ctx
  20805. return c
  20806. }
  20807. // Header returns an http.Header that can be modified by the caller to
  20808. // add HTTP headers to the request.
  20809. func (c *ContentCategoriesListCall) Header() http.Header {
  20810. if c.header_ == nil {
  20811. c.header_ = make(http.Header)
  20812. }
  20813. return c.header_
  20814. }
  20815. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  20816. reqHeaders := make(http.Header)
  20817. for k, v := range c.header_ {
  20818. reqHeaders[k] = v
  20819. }
  20820. reqHeaders.Set("User-Agent", c.s.userAgent())
  20821. if c.ifNoneMatch_ != "" {
  20822. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20823. }
  20824. var body io.Reader = nil
  20825. c.urlParams_.Set("alt", alt)
  20826. c.urlParams_.Set("prettyPrint", "false")
  20827. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20828. urls += "?" + c.urlParams_.Encode()
  20829. req, err := http.NewRequest("GET", urls, body)
  20830. if err != nil {
  20831. return nil, err
  20832. }
  20833. req.Header = reqHeaders
  20834. googleapi.Expand(req.URL, map[string]string{
  20835. "profileId": strconv.FormatInt(c.profileId, 10),
  20836. })
  20837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20838. }
  20839. // Do executes the "dfareporting.contentCategories.list" call.
  20840. // Exactly one of *ContentCategoriesListResponse or error will be
  20841. // non-nil. Any non-2xx status code is an error. Response headers are in
  20842. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  20843. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20844. // googleapi.IsNotModified to check whether the returned error was
  20845. // because http.StatusNotModified was returned.
  20846. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  20847. gensupport.SetOptions(c.urlParams_, opts...)
  20848. res, err := c.doRequest("json")
  20849. if res != nil && res.StatusCode == http.StatusNotModified {
  20850. if res.Body != nil {
  20851. res.Body.Close()
  20852. }
  20853. return nil, &googleapi.Error{
  20854. Code: res.StatusCode,
  20855. Header: res.Header,
  20856. }
  20857. }
  20858. if err != nil {
  20859. return nil, err
  20860. }
  20861. defer googleapi.CloseBody(res)
  20862. if err := googleapi.CheckResponse(res); err != nil {
  20863. return nil, err
  20864. }
  20865. ret := &ContentCategoriesListResponse{
  20866. ServerResponse: googleapi.ServerResponse{
  20867. Header: res.Header,
  20868. HTTPStatusCode: res.StatusCode,
  20869. },
  20870. }
  20871. target := &ret
  20872. if err := gensupport.DecodeResponse(target, res); err != nil {
  20873. return nil, err
  20874. }
  20875. return ret, nil
  20876. // {
  20877. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  20878. // "httpMethod": "GET",
  20879. // "id": "dfareporting.contentCategories.list",
  20880. // "parameterOrder": [
  20881. // "profileId"
  20882. // ],
  20883. // "parameters": {
  20884. // "ids": {
  20885. // "description": "Select only content categories with these IDs.",
  20886. // "format": "int64",
  20887. // "location": "query",
  20888. // "repeated": true,
  20889. // "type": "string"
  20890. // },
  20891. // "maxResults": {
  20892. // "default": "1000",
  20893. // "description": "Maximum number of results to return.",
  20894. // "format": "int32",
  20895. // "location": "query",
  20896. // "maximum": "1000",
  20897. // "minimum": "0",
  20898. // "type": "integer"
  20899. // },
  20900. // "pageToken": {
  20901. // "description": "Value of the nextPageToken from the previous result page.",
  20902. // "location": "query",
  20903. // "type": "string"
  20904. // },
  20905. // "profileId": {
  20906. // "description": "User profile ID associated with this request.",
  20907. // "format": "int64",
  20908. // "location": "path",
  20909. // "required": true,
  20910. // "type": "string"
  20911. // },
  20912. // "searchString": {
  20913. // "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\".",
  20914. // "location": "query",
  20915. // "type": "string"
  20916. // },
  20917. // "sortField": {
  20918. // "default": "ID",
  20919. // "description": "Field by which to sort the list.",
  20920. // "enum": [
  20921. // "ID",
  20922. // "NAME"
  20923. // ],
  20924. // "enumDescriptions": [
  20925. // "",
  20926. // ""
  20927. // ],
  20928. // "location": "query",
  20929. // "type": "string"
  20930. // },
  20931. // "sortOrder": {
  20932. // "default": "ASCENDING",
  20933. // "description": "Order of sorted results.",
  20934. // "enum": [
  20935. // "ASCENDING",
  20936. // "DESCENDING"
  20937. // ],
  20938. // "enumDescriptions": [
  20939. // "",
  20940. // ""
  20941. // ],
  20942. // "location": "query",
  20943. // "type": "string"
  20944. // }
  20945. // },
  20946. // "path": "userprofiles/{profileId}/contentCategories",
  20947. // "response": {
  20948. // "$ref": "ContentCategoriesListResponse"
  20949. // },
  20950. // "scopes": [
  20951. // "https://www.googleapis.com/auth/dfatrafficking"
  20952. // ]
  20953. // }
  20954. }
  20955. // Pages invokes f for each page of results.
  20956. // A non-nil error returned from f will halt the iteration.
  20957. // The provided context supersedes any context provided to the Context method.
  20958. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  20959. c.ctx_ = ctx
  20960. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20961. for {
  20962. x, err := c.Do()
  20963. if err != nil {
  20964. return err
  20965. }
  20966. if err := f(x); err != nil {
  20967. return err
  20968. }
  20969. if x.NextPageToken == "" {
  20970. return nil
  20971. }
  20972. c.PageToken(x.NextPageToken)
  20973. }
  20974. }
  20975. // method id "dfareporting.contentCategories.patch":
  20976. type ContentCategoriesPatchCall struct {
  20977. s *Service
  20978. profileId int64
  20979. contentcategory *ContentCategory
  20980. urlParams_ gensupport.URLParams
  20981. ctx_ context.Context
  20982. header_ http.Header
  20983. }
  20984. // Patch: Updates an existing content category. This method supports
  20985. // patch semantics.
  20986. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  20987. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20988. c.profileId = profileId
  20989. c.urlParams_.Set("id", fmt.Sprint(id))
  20990. c.contentcategory = contentcategory
  20991. return c
  20992. }
  20993. // Fields allows partial responses to be retrieved. See
  20994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20995. // for more information.
  20996. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  20997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20998. return c
  20999. }
  21000. // Context sets the context to be used in this call's Do method. Any
  21001. // pending HTTP request will be aborted if the provided context is
  21002. // canceled.
  21003. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  21004. c.ctx_ = ctx
  21005. return c
  21006. }
  21007. // Header returns an http.Header that can be modified by the caller to
  21008. // add HTTP headers to the request.
  21009. func (c *ContentCategoriesPatchCall) Header() http.Header {
  21010. if c.header_ == nil {
  21011. c.header_ = make(http.Header)
  21012. }
  21013. return c.header_
  21014. }
  21015. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  21016. reqHeaders := make(http.Header)
  21017. for k, v := range c.header_ {
  21018. reqHeaders[k] = v
  21019. }
  21020. reqHeaders.Set("User-Agent", c.s.userAgent())
  21021. var body io.Reader = nil
  21022. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  21023. if err != nil {
  21024. return nil, err
  21025. }
  21026. reqHeaders.Set("Content-Type", "application/json")
  21027. c.urlParams_.Set("alt", alt)
  21028. c.urlParams_.Set("prettyPrint", "false")
  21029. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  21030. urls += "?" + c.urlParams_.Encode()
  21031. req, err := http.NewRequest("PATCH", urls, body)
  21032. if err != nil {
  21033. return nil, err
  21034. }
  21035. req.Header = reqHeaders
  21036. googleapi.Expand(req.URL, map[string]string{
  21037. "profileId": strconv.FormatInt(c.profileId, 10),
  21038. })
  21039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21040. }
  21041. // Do executes the "dfareporting.contentCategories.patch" call.
  21042. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  21043. // status code is an error. Response headers are in either
  21044. // *ContentCategory.ServerResponse.Header or (if a response was returned
  21045. // at all) in error.(*googleapi.Error).Header. Use
  21046. // googleapi.IsNotModified to check whether the returned error was
  21047. // because http.StatusNotModified was returned.
  21048. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  21049. gensupport.SetOptions(c.urlParams_, opts...)
  21050. res, err := c.doRequest("json")
  21051. if res != nil && res.StatusCode == http.StatusNotModified {
  21052. if res.Body != nil {
  21053. res.Body.Close()
  21054. }
  21055. return nil, &googleapi.Error{
  21056. Code: res.StatusCode,
  21057. Header: res.Header,
  21058. }
  21059. }
  21060. if err != nil {
  21061. return nil, err
  21062. }
  21063. defer googleapi.CloseBody(res)
  21064. if err := googleapi.CheckResponse(res); err != nil {
  21065. return nil, err
  21066. }
  21067. ret := &ContentCategory{
  21068. ServerResponse: googleapi.ServerResponse{
  21069. Header: res.Header,
  21070. HTTPStatusCode: res.StatusCode,
  21071. },
  21072. }
  21073. target := &ret
  21074. if err := gensupport.DecodeResponse(target, res); err != nil {
  21075. return nil, err
  21076. }
  21077. return ret, nil
  21078. // {
  21079. // "description": "Updates an existing content category. This method supports patch semantics.",
  21080. // "httpMethod": "PATCH",
  21081. // "id": "dfareporting.contentCategories.patch",
  21082. // "parameterOrder": [
  21083. // "profileId",
  21084. // "id"
  21085. // ],
  21086. // "parameters": {
  21087. // "id": {
  21088. // "description": "Content category ID.",
  21089. // "format": "int64",
  21090. // "location": "query",
  21091. // "required": true,
  21092. // "type": "string"
  21093. // },
  21094. // "profileId": {
  21095. // "description": "User profile ID associated with this request.",
  21096. // "format": "int64",
  21097. // "location": "path",
  21098. // "required": true,
  21099. // "type": "string"
  21100. // }
  21101. // },
  21102. // "path": "userprofiles/{profileId}/contentCategories",
  21103. // "request": {
  21104. // "$ref": "ContentCategory"
  21105. // },
  21106. // "response": {
  21107. // "$ref": "ContentCategory"
  21108. // },
  21109. // "scopes": [
  21110. // "https://www.googleapis.com/auth/dfatrafficking"
  21111. // ]
  21112. // }
  21113. }
  21114. // method id "dfareporting.contentCategories.update":
  21115. type ContentCategoriesUpdateCall struct {
  21116. s *Service
  21117. profileId int64
  21118. contentcategory *ContentCategory
  21119. urlParams_ gensupport.URLParams
  21120. ctx_ context.Context
  21121. header_ http.Header
  21122. }
  21123. // Update: Updates an existing content category.
  21124. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  21125. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21126. c.profileId = profileId
  21127. c.contentcategory = contentcategory
  21128. return c
  21129. }
  21130. // Fields allows partial responses to be retrieved. See
  21131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21132. // for more information.
  21133. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  21134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21135. return c
  21136. }
  21137. // Context sets the context to be used in this call's Do method. Any
  21138. // pending HTTP request will be aborted if the provided context is
  21139. // canceled.
  21140. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  21141. c.ctx_ = ctx
  21142. return c
  21143. }
  21144. // Header returns an http.Header that can be modified by the caller to
  21145. // add HTTP headers to the request.
  21146. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  21147. if c.header_ == nil {
  21148. c.header_ = make(http.Header)
  21149. }
  21150. return c.header_
  21151. }
  21152. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  21153. reqHeaders := make(http.Header)
  21154. for k, v := range c.header_ {
  21155. reqHeaders[k] = v
  21156. }
  21157. reqHeaders.Set("User-Agent", c.s.userAgent())
  21158. var body io.Reader = nil
  21159. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  21160. if err != nil {
  21161. return nil, err
  21162. }
  21163. reqHeaders.Set("Content-Type", "application/json")
  21164. c.urlParams_.Set("alt", alt)
  21165. c.urlParams_.Set("prettyPrint", "false")
  21166. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  21167. urls += "?" + c.urlParams_.Encode()
  21168. req, err := http.NewRequest("PUT", urls, body)
  21169. if err != nil {
  21170. return nil, err
  21171. }
  21172. req.Header = reqHeaders
  21173. googleapi.Expand(req.URL, map[string]string{
  21174. "profileId": strconv.FormatInt(c.profileId, 10),
  21175. })
  21176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21177. }
  21178. // Do executes the "dfareporting.contentCategories.update" call.
  21179. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  21180. // status code is an error. Response headers are in either
  21181. // *ContentCategory.ServerResponse.Header or (if a response was returned
  21182. // at all) in error.(*googleapi.Error).Header. Use
  21183. // googleapi.IsNotModified to check whether the returned error was
  21184. // because http.StatusNotModified was returned.
  21185. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  21186. gensupport.SetOptions(c.urlParams_, opts...)
  21187. res, err := c.doRequest("json")
  21188. if res != nil && res.StatusCode == http.StatusNotModified {
  21189. if res.Body != nil {
  21190. res.Body.Close()
  21191. }
  21192. return nil, &googleapi.Error{
  21193. Code: res.StatusCode,
  21194. Header: res.Header,
  21195. }
  21196. }
  21197. if err != nil {
  21198. return nil, err
  21199. }
  21200. defer googleapi.CloseBody(res)
  21201. if err := googleapi.CheckResponse(res); err != nil {
  21202. return nil, err
  21203. }
  21204. ret := &ContentCategory{
  21205. ServerResponse: googleapi.ServerResponse{
  21206. Header: res.Header,
  21207. HTTPStatusCode: res.StatusCode,
  21208. },
  21209. }
  21210. target := &ret
  21211. if err := gensupport.DecodeResponse(target, res); err != nil {
  21212. return nil, err
  21213. }
  21214. return ret, nil
  21215. // {
  21216. // "description": "Updates an existing content category.",
  21217. // "httpMethod": "PUT",
  21218. // "id": "dfareporting.contentCategories.update",
  21219. // "parameterOrder": [
  21220. // "profileId"
  21221. // ],
  21222. // "parameters": {
  21223. // "profileId": {
  21224. // "description": "User profile ID associated with this request.",
  21225. // "format": "int64",
  21226. // "location": "path",
  21227. // "required": true,
  21228. // "type": "string"
  21229. // }
  21230. // },
  21231. // "path": "userprofiles/{profileId}/contentCategories",
  21232. // "request": {
  21233. // "$ref": "ContentCategory"
  21234. // },
  21235. // "response": {
  21236. // "$ref": "ContentCategory"
  21237. // },
  21238. // "scopes": [
  21239. // "https://www.googleapis.com/auth/dfatrafficking"
  21240. // ]
  21241. // }
  21242. }
  21243. // method id "dfareporting.conversions.batchinsert":
  21244. type ConversionsBatchinsertCall struct {
  21245. s *Service
  21246. profileId int64
  21247. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  21248. urlParams_ gensupport.URLParams
  21249. ctx_ context.Context
  21250. header_ http.Header
  21251. }
  21252. // Batchinsert: Inserts conversions.
  21253. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  21254. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21255. c.profileId = profileId
  21256. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  21257. return c
  21258. }
  21259. // Fields allows partial responses to be retrieved. See
  21260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21261. // for more information.
  21262. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  21263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21264. return c
  21265. }
  21266. // Context sets the context to be used in this call's Do method. Any
  21267. // pending HTTP request will be aborted if the provided context is
  21268. // canceled.
  21269. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  21270. c.ctx_ = ctx
  21271. return c
  21272. }
  21273. // Header returns an http.Header that can be modified by the caller to
  21274. // add HTTP headers to the request.
  21275. func (c *ConversionsBatchinsertCall) Header() http.Header {
  21276. if c.header_ == nil {
  21277. c.header_ = make(http.Header)
  21278. }
  21279. return c.header_
  21280. }
  21281. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  21282. reqHeaders := make(http.Header)
  21283. for k, v := range c.header_ {
  21284. reqHeaders[k] = v
  21285. }
  21286. reqHeaders.Set("User-Agent", c.s.userAgent())
  21287. var body io.Reader = nil
  21288. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  21289. if err != nil {
  21290. return nil, err
  21291. }
  21292. reqHeaders.Set("Content-Type", "application/json")
  21293. c.urlParams_.Set("alt", alt)
  21294. c.urlParams_.Set("prettyPrint", "false")
  21295. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  21296. urls += "?" + c.urlParams_.Encode()
  21297. req, err := http.NewRequest("POST", urls, body)
  21298. if err != nil {
  21299. return nil, err
  21300. }
  21301. req.Header = reqHeaders
  21302. googleapi.Expand(req.URL, map[string]string{
  21303. "profileId": strconv.FormatInt(c.profileId, 10),
  21304. })
  21305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21306. }
  21307. // Do executes the "dfareporting.conversions.batchinsert" call.
  21308. // Exactly one of *ConversionsBatchInsertResponse or error will be
  21309. // non-nil. Any non-2xx status code is an error. Response headers are in
  21310. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  21311. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21312. // googleapi.IsNotModified to check whether the returned error was
  21313. // because http.StatusNotModified was returned.
  21314. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  21315. gensupport.SetOptions(c.urlParams_, opts...)
  21316. res, err := c.doRequest("json")
  21317. if res != nil && res.StatusCode == http.StatusNotModified {
  21318. if res.Body != nil {
  21319. res.Body.Close()
  21320. }
  21321. return nil, &googleapi.Error{
  21322. Code: res.StatusCode,
  21323. Header: res.Header,
  21324. }
  21325. }
  21326. if err != nil {
  21327. return nil, err
  21328. }
  21329. defer googleapi.CloseBody(res)
  21330. if err := googleapi.CheckResponse(res); err != nil {
  21331. return nil, err
  21332. }
  21333. ret := &ConversionsBatchInsertResponse{
  21334. ServerResponse: googleapi.ServerResponse{
  21335. Header: res.Header,
  21336. HTTPStatusCode: res.StatusCode,
  21337. },
  21338. }
  21339. target := &ret
  21340. if err := gensupport.DecodeResponse(target, res); err != nil {
  21341. return nil, err
  21342. }
  21343. return ret, nil
  21344. // {
  21345. // "description": "Inserts conversions.",
  21346. // "httpMethod": "POST",
  21347. // "id": "dfareporting.conversions.batchinsert",
  21348. // "parameterOrder": [
  21349. // "profileId"
  21350. // ],
  21351. // "parameters": {
  21352. // "profileId": {
  21353. // "description": "User profile ID associated with this request.",
  21354. // "format": "int64",
  21355. // "location": "path",
  21356. // "required": true,
  21357. // "type": "string"
  21358. // }
  21359. // },
  21360. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  21361. // "request": {
  21362. // "$ref": "ConversionsBatchInsertRequest"
  21363. // },
  21364. // "response": {
  21365. // "$ref": "ConversionsBatchInsertResponse"
  21366. // },
  21367. // "scopes": [
  21368. // "https://www.googleapis.com/auth/ddmconversions"
  21369. // ]
  21370. // }
  21371. }
  21372. // method id "dfareporting.conversions.batchupdate":
  21373. type ConversionsBatchupdateCall struct {
  21374. s *Service
  21375. profileId int64
  21376. conversionsbatchupdaterequest *ConversionsBatchUpdateRequest
  21377. urlParams_ gensupport.URLParams
  21378. ctx_ context.Context
  21379. header_ http.Header
  21380. }
  21381. // Batchupdate: Updates existing conversions.
  21382. func (r *ConversionsService) Batchupdate(profileId int64, conversionsbatchupdaterequest *ConversionsBatchUpdateRequest) *ConversionsBatchupdateCall {
  21383. c := &ConversionsBatchupdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21384. c.profileId = profileId
  21385. c.conversionsbatchupdaterequest = conversionsbatchupdaterequest
  21386. return c
  21387. }
  21388. // Fields allows partial responses to be retrieved. See
  21389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21390. // for more information.
  21391. func (c *ConversionsBatchupdateCall) Fields(s ...googleapi.Field) *ConversionsBatchupdateCall {
  21392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21393. return c
  21394. }
  21395. // Context sets the context to be used in this call's Do method. Any
  21396. // pending HTTP request will be aborted if the provided context is
  21397. // canceled.
  21398. func (c *ConversionsBatchupdateCall) Context(ctx context.Context) *ConversionsBatchupdateCall {
  21399. c.ctx_ = ctx
  21400. return c
  21401. }
  21402. // Header returns an http.Header that can be modified by the caller to
  21403. // add HTTP headers to the request.
  21404. func (c *ConversionsBatchupdateCall) Header() http.Header {
  21405. if c.header_ == nil {
  21406. c.header_ = make(http.Header)
  21407. }
  21408. return c.header_
  21409. }
  21410. func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) {
  21411. reqHeaders := make(http.Header)
  21412. for k, v := range c.header_ {
  21413. reqHeaders[k] = v
  21414. }
  21415. reqHeaders.Set("User-Agent", c.s.userAgent())
  21416. var body io.Reader = nil
  21417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest)
  21418. if err != nil {
  21419. return nil, err
  21420. }
  21421. reqHeaders.Set("Content-Type", "application/json")
  21422. c.urlParams_.Set("alt", alt)
  21423. c.urlParams_.Set("prettyPrint", "false")
  21424. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchupdate")
  21425. urls += "?" + c.urlParams_.Encode()
  21426. req, err := http.NewRequest("POST", urls, body)
  21427. if err != nil {
  21428. return nil, err
  21429. }
  21430. req.Header = reqHeaders
  21431. googleapi.Expand(req.URL, map[string]string{
  21432. "profileId": strconv.FormatInt(c.profileId, 10),
  21433. })
  21434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21435. }
  21436. // Do executes the "dfareporting.conversions.batchupdate" call.
  21437. // Exactly one of *ConversionsBatchUpdateResponse or error will be
  21438. // non-nil. Any non-2xx status code is an error. Response headers are in
  21439. // either *ConversionsBatchUpdateResponse.ServerResponse.Header or (if a
  21440. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21441. // googleapi.IsNotModified to check whether the returned error was
  21442. // because http.StatusNotModified was returned.
  21443. func (c *ConversionsBatchupdateCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchUpdateResponse, error) {
  21444. gensupport.SetOptions(c.urlParams_, opts...)
  21445. res, err := c.doRequest("json")
  21446. if res != nil && res.StatusCode == http.StatusNotModified {
  21447. if res.Body != nil {
  21448. res.Body.Close()
  21449. }
  21450. return nil, &googleapi.Error{
  21451. Code: res.StatusCode,
  21452. Header: res.Header,
  21453. }
  21454. }
  21455. if err != nil {
  21456. return nil, err
  21457. }
  21458. defer googleapi.CloseBody(res)
  21459. if err := googleapi.CheckResponse(res); err != nil {
  21460. return nil, err
  21461. }
  21462. ret := &ConversionsBatchUpdateResponse{
  21463. ServerResponse: googleapi.ServerResponse{
  21464. Header: res.Header,
  21465. HTTPStatusCode: res.StatusCode,
  21466. },
  21467. }
  21468. target := &ret
  21469. if err := gensupport.DecodeResponse(target, res); err != nil {
  21470. return nil, err
  21471. }
  21472. return ret, nil
  21473. // {
  21474. // "description": "Updates existing conversions.",
  21475. // "httpMethod": "POST",
  21476. // "id": "dfareporting.conversions.batchupdate",
  21477. // "parameterOrder": [
  21478. // "profileId"
  21479. // ],
  21480. // "parameters": {
  21481. // "profileId": {
  21482. // "description": "User profile ID associated with this request.",
  21483. // "format": "int64",
  21484. // "location": "path",
  21485. // "required": true,
  21486. // "type": "string"
  21487. // }
  21488. // },
  21489. // "path": "userprofiles/{profileId}/conversions/batchupdate",
  21490. // "request": {
  21491. // "$ref": "ConversionsBatchUpdateRequest"
  21492. // },
  21493. // "response": {
  21494. // "$ref": "ConversionsBatchUpdateResponse"
  21495. // },
  21496. // "scopes": [
  21497. // "https://www.googleapis.com/auth/ddmconversions"
  21498. // ]
  21499. // }
  21500. }
  21501. // method id "dfareporting.countries.get":
  21502. type CountriesGetCall struct {
  21503. s *Service
  21504. profileId int64
  21505. dartId int64
  21506. urlParams_ gensupport.URLParams
  21507. ifNoneMatch_ string
  21508. ctx_ context.Context
  21509. header_ http.Header
  21510. }
  21511. // Get: Gets one country by ID.
  21512. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  21513. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21514. c.profileId = profileId
  21515. c.dartId = dartId
  21516. return c
  21517. }
  21518. // Fields allows partial responses to be retrieved. See
  21519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21520. // for more information.
  21521. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  21522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21523. return c
  21524. }
  21525. // IfNoneMatch sets the optional parameter which makes the operation
  21526. // fail if the object's ETag matches the given value. This is useful for
  21527. // getting updates only after the object has changed since the last
  21528. // request. Use googleapi.IsNotModified to check whether the response
  21529. // error from Do is the result of In-None-Match.
  21530. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  21531. c.ifNoneMatch_ = entityTag
  21532. return c
  21533. }
  21534. // Context sets the context to be used in this call's Do method. Any
  21535. // pending HTTP request will be aborted if the provided context is
  21536. // canceled.
  21537. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  21538. c.ctx_ = ctx
  21539. return c
  21540. }
  21541. // Header returns an http.Header that can be modified by the caller to
  21542. // add HTTP headers to the request.
  21543. func (c *CountriesGetCall) Header() http.Header {
  21544. if c.header_ == nil {
  21545. c.header_ = make(http.Header)
  21546. }
  21547. return c.header_
  21548. }
  21549. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  21550. reqHeaders := make(http.Header)
  21551. for k, v := range c.header_ {
  21552. reqHeaders[k] = v
  21553. }
  21554. reqHeaders.Set("User-Agent", c.s.userAgent())
  21555. if c.ifNoneMatch_ != "" {
  21556. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21557. }
  21558. var body io.Reader = nil
  21559. c.urlParams_.Set("alt", alt)
  21560. c.urlParams_.Set("prettyPrint", "false")
  21561. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  21562. urls += "?" + c.urlParams_.Encode()
  21563. req, err := http.NewRequest("GET", urls, body)
  21564. if err != nil {
  21565. return nil, err
  21566. }
  21567. req.Header = reqHeaders
  21568. googleapi.Expand(req.URL, map[string]string{
  21569. "profileId": strconv.FormatInt(c.profileId, 10),
  21570. "dartId": strconv.FormatInt(c.dartId, 10),
  21571. })
  21572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21573. }
  21574. // Do executes the "dfareporting.countries.get" call.
  21575. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  21576. // code is an error. Response headers are in either
  21577. // *Country.ServerResponse.Header or (if a response was returned at all)
  21578. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21579. // check whether the returned error was because http.StatusNotModified
  21580. // was returned.
  21581. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  21582. gensupport.SetOptions(c.urlParams_, opts...)
  21583. res, err := c.doRequest("json")
  21584. if res != nil && res.StatusCode == http.StatusNotModified {
  21585. if res.Body != nil {
  21586. res.Body.Close()
  21587. }
  21588. return nil, &googleapi.Error{
  21589. Code: res.StatusCode,
  21590. Header: res.Header,
  21591. }
  21592. }
  21593. if err != nil {
  21594. return nil, err
  21595. }
  21596. defer googleapi.CloseBody(res)
  21597. if err := googleapi.CheckResponse(res); err != nil {
  21598. return nil, err
  21599. }
  21600. ret := &Country{
  21601. ServerResponse: googleapi.ServerResponse{
  21602. Header: res.Header,
  21603. HTTPStatusCode: res.StatusCode,
  21604. },
  21605. }
  21606. target := &ret
  21607. if err := gensupport.DecodeResponse(target, res); err != nil {
  21608. return nil, err
  21609. }
  21610. return ret, nil
  21611. // {
  21612. // "description": "Gets one country by ID.",
  21613. // "httpMethod": "GET",
  21614. // "id": "dfareporting.countries.get",
  21615. // "parameterOrder": [
  21616. // "profileId",
  21617. // "dartId"
  21618. // ],
  21619. // "parameters": {
  21620. // "dartId": {
  21621. // "description": "Country DART ID.",
  21622. // "format": "int64",
  21623. // "location": "path",
  21624. // "required": true,
  21625. // "type": "string"
  21626. // },
  21627. // "profileId": {
  21628. // "description": "User profile ID associated with this request.",
  21629. // "format": "int64",
  21630. // "location": "path",
  21631. // "required": true,
  21632. // "type": "string"
  21633. // }
  21634. // },
  21635. // "path": "userprofiles/{profileId}/countries/{dartId}",
  21636. // "response": {
  21637. // "$ref": "Country"
  21638. // },
  21639. // "scopes": [
  21640. // "https://www.googleapis.com/auth/dfatrafficking"
  21641. // ]
  21642. // }
  21643. }
  21644. // method id "dfareporting.countries.list":
  21645. type CountriesListCall struct {
  21646. s *Service
  21647. profileId int64
  21648. urlParams_ gensupport.URLParams
  21649. ifNoneMatch_ string
  21650. ctx_ context.Context
  21651. header_ http.Header
  21652. }
  21653. // List: Retrieves a list of countries.
  21654. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  21655. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21656. c.profileId = profileId
  21657. return c
  21658. }
  21659. // Fields allows partial responses to be retrieved. See
  21660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21661. // for more information.
  21662. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  21663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21664. return c
  21665. }
  21666. // IfNoneMatch sets the optional parameter which makes the operation
  21667. // fail if the object's ETag matches the given value. This is useful for
  21668. // getting updates only after the object has changed since the last
  21669. // request. Use googleapi.IsNotModified to check whether the response
  21670. // error from Do is the result of In-None-Match.
  21671. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  21672. c.ifNoneMatch_ = entityTag
  21673. return c
  21674. }
  21675. // Context sets the context to be used in this call's Do method. Any
  21676. // pending HTTP request will be aborted if the provided context is
  21677. // canceled.
  21678. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  21679. c.ctx_ = ctx
  21680. return c
  21681. }
  21682. // Header returns an http.Header that can be modified by the caller to
  21683. // add HTTP headers to the request.
  21684. func (c *CountriesListCall) Header() http.Header {
  21685. if c.header_ == nil {
  21686. c.header_ = make(http.Header)
  21687. }
  21688. return c.header_
  21689. }
  21690. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  21691. reqHeaders := make(http.Header)
  21692. for k, v := range c.header_ {
  21693. reqHeaders[k] = v
  21694. }
  21695. reqHeaders.Set("User-Agent", c.s.userAgent())
  21696. if c.ifNoneMatch_ != "" {
  21697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21698. }
  21699. var body io.Reader = nil
  21700. c.urlParams_.Set("alt", alt)
  21701. c.urlParams_.Set("prettyPrint", "false")
  21702. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  21703. urls += "?" + c.urlParams_.Encode()
  21704. req, err := http.NewRequest("GET", urls, body)
  21705. if err != nil {
  21706. return nil, err
  21707. }
  21708. req.Header = reqHeaders
  21709. googleapi.Expand(req.URL, map[string]string{
  21710. "profileId": strconv.FormatInt(c.profileId, 10),
  21711. })
  21712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21713. }
  21714. // Do executes the "dfareporting.countries.list" call.
  21715. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  21716. // non-2xx status code is an error. Response headers are in either
  21717. // *CountriesListResponse.ServerResponse.Header or (if a response was
  21718. // returned at all) in error.(*googleapi.Error).Header. Use
  21719. // googleapi.IsNotModified to check whether the returned error was
  21720. // because http.StatusNotModified was returned.
  21721. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  21722. gensupport.SetOptions(c.urlParams_, opts...)
  21723. res, err := c.doRequest("json")
  21724. if res != nil && res.StatusCode == http.StatusNotModified {
  21725. if res.Body != nil {
  21726. res.Body.Close()
  21727. }
  21728. return nil, &googleapi.Error{
  21729. Code: res.StatusCode,
  21730. Header: res.Header,
  21731. }
  21732. }
  21733. if err != nil {
  21734. return nil, err
  21735. }
  21736. defer googleapi.CloseBody(res)
  21737. if err := googleapi.CheckResponse(res); err != nil {
  21738. return nil, err
  21739. }
  21740. ret := &CountriesListResponse{
  21741. ServerResponse: googleapi.ServerResponse{
  21742. Header: res.Header,
  21743. HTTPStatusCode: res.StatusCode,
  21744. },
  21745. }
  21746. target := &ret
  21747. if err := gensupport.DecodeResponse(target, res); err != nil {
  21748. return nil, err
  21749. }
  21750. return ret, nil
  21751. // {
  21752. // "description": "Retrieves a list of countries.",
  21753. // "httpMethod": "GET",
  21754. // "id": "dfareporting.countries.list",
  21755. // "parameterOrder": [
  21756. // "profileId"
  21757. // ],
  21758. // "parameters": {
  21759. // "profileId": {
  21760. // "description": "User profile ID associated with this request.",
  21761. // "format": "int64",
  21762. // "location": "path",
  21763. // "required": true,
  21764. // "type": "string"
  21765. // }
  21766. // },
  21767. // "path": "userprofiles/{profileId}/countries",
  21768. // "response": {
  21769. // "$ref": "CountriesListResponse"
  21770. // },
  21771. // "scopes": [
  21772. // "https://www.googleapis.com/auth/dfatrafficking"
  21773. // ]
  21774. // }
  21775. }
  21776. // method id "dfareporting.creativeAssets.insert":
  21777. type CreativeAssetsInsertCall struct {
  21778. s *Service
  21779. profileId int64
  21780. advertiserId int64
  21781. creativeassetmetadata *CreativeAssetMetadata
  21782. urlParams_ gensupport.URLParams
  21783. mediaInfo_ *gensupport.MediaInfo
  21784. ctx_ context.Context
  21785. header_ http.Header
  21786. }
  21787. // Insert: Inserts a new creative asset.
  21788. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  21789. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21790. c.profileId = profileId
  21791. c.advertiserId = advertiserId
  21792. c.creativeassetmetadata = creativeassetmetadata
  21793. return c
  21794. }
  21795. // Media specifies the media to upload in one or more chunks. The chunk
  21796. // size may be controlled by supplying a MediaOption generated by
  21797. // googleapi.ChunkSize. The chunk size defaults to
  21798. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21799. // upload request will be determined by sniffing the contents of r,
  21800. // unless a MediaOption generated by googleapi.ContentType is
  21801. // supplied.
  21802. // At most one of Media and ResumableMedia may be set.
  21803. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  21804. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21805. return c
  21806. }
  21807. // ResumableMedia specifies the media to upload in chunks and can be
  21808. // canceled with ctx.
  21809. //
  21810. // Deprecated: use Media instead.
  21811. //
  21812. // At most one of Media and ResumableMedia may be set. mediaType
  21813. // identifies the MIME media type of the upload, such as "image/png". If
  21814. // mediaType is "", it will be auto-detected. The provided ctx will
  21815. // supersede any context previously provided to the Context method.
  21816. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  21817. c.ctx_ = ctx
  21818. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21819. return c
  21820. }
  21821. // ProgressUpdater provides a callback function that will be called
  21822. // after every chunk. It should be a low-latency function in order to
  21823. // not slow down the upload operation. This should only be called when
  21824. // using ResumableMedia (as opposed to Media).
  21825. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  21826. c.mediaInfo_.SetProgressUpdater(pu)
  21827. return c
  21828. }
  21829. // Fields allows partial responses to be retrieved. See
  21830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21831. // for more information.
  21832. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  21833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21834. return c
  21835. }
  21836. // Context sets the context to be used in this call's Do method. Any
  21837. // pending HTTP request will be aborted if the provided context is
  21838. // canceled.
  21839. // This context will supersede any context previously provided to the
  21840. // ResumableMedia method.
  21841. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  21842. c.ctx_ = ctx
  21843. return c
  21844. }
  21845. // Header returns an http.Header that can be modified by the caller to
  21846. // add HTTP headers to the request.
  21847. func (c *CreativeAssetsInsertCall) Header() http.Header {
  21848. if c.header_ == nil {
  21849. c.header_ = make(http.Header)
  21850. }
  21851. return c.header_
  21852. }
  21853. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  21854. reqHeaders := make(http.Header)
  21855. for k, v := range c.header_ {
  21856. reqHeaders[k] = v
  21857. }
  21858. reqHeaders.Set("User-Agent", c.s.userAgent())
  21859. var body io.Reader = nil
  21860. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  21861. if err != nil {
  21862. return nil, err
  21863. }
  21864. reqHeaders.Set("Content-Type", "application/json")
  21865. c.urlParams_.Set("alt", alt)
  21866. c.urlParams_.Set("prettyPrint", "false")
  21867. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  21868. if c.mediaInfo_ != nil {
  21869. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21870. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21871. }
  21872. if body == nil {
  21873. body = new(bytes.Buffer)
  21874. reqHeaders.Set("Content-Type", "application/json")
  21875. }
  21876. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21877. defer cleanup()
  21878. urls += "?" + c.urlParams_.Encode()
  21879. req, err := http.NewRequest("POST", urls, body)
  21880. if err != nil {
  21881. return nil, err
  21882. }
  21883. req.Header = reqHeaders
  21884. req.GetBody = getBody
  21885. googleapi.Expand(req.URL, map[string]string{
  21886. "profileId": strconv.FormatInt(c.profileId, 10),
  21887. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  21888. })
  21889. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21890. }
  21891. // Do executes the "dfareporting.creativeAssets.insert" call.
  21892. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  21893. // non-2xx status code is an error. Response headers are in either
  21894. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  21895. // returned at all) in error.(*googleapi.Error).Header. Use
  21896. // googleapi.IsNotModified to check whether the returned error was
  21897. // because http.StatusNotModified was returned.
  21898. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  21899. gensupport.SetOptions(c.urlParams_, opts...)
  21900. res, err := c.doRequest("json")
  21901. if res != nil && res.StatusCode == http.StatusNotModified {
  21902. if res.Body != nil {
  21903. res.Body.Close()
  21904. }
  21905. return nil, &googleapi.Error{
  21906. Code: res.StatusCode,
  21907. Header: res.Header,
  21908. }
  21909. }
  21910. if err != nil {
  21911. return nil, err
  21912. }
  21913. defer googleapi.CloseBody(res)
  21914. if err := googleapi.CheckResponse(res); err != nil {
  21915. return nil, err
  21916. }
  21917. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21918. if rx != nil {
  21919. rx.Client = c.s.client
  21920. rx.UserAgent = c.s.userAgent()
  21921. ctx := c.ctx_
  21922. if ctx == nil {
  21923. ctx = context.TODO()
  21924. }
  21925. res, err = rx.Upload(ctx)
  21926. if err != nil {
  21927. return nil, err
  21928. }
  21929. defer res.Body.Close()
  21930. if err := googleapi.CheckResponse(res); err != nil {
  21931. return nil, err
  21932. }
  21933. }
  21934. ret := &CreativeAssetMetadata{
  21935. ServerResponse: googleapi.ServerResponse{
  21936. Header: res.Header,
  21937. HTTPStatusCode: res.StatusCode,
  21938. },
  21939. }
  21940. target := &ret
  21941. if err := gensupport.DecodeResponse(target, res); err != nil {
  21942. return nil, err
  21943. }
  21944. return ret, nil
  21945. // {
  21946. // "description": "Inserts a new creative asset.",
  21947. // "httpMethod": "POST",
  21948. // "id": "dfareporting.creativeAssets.insert",
  21949. // "mediaUpload": {
  21950. // "accept": [
  21951. // "*/*"
  21952. // ],
  21953. // "maxSize": "1024MB",
  21954. // "protocols": {
  21955. // "resumable": {
  21956. // "multipart": true,
  21957. // "path": "/resumable/upload/dfareporting/v3.2/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21958. // },
  21959. // "simple": {
  21960. // "multipart": true,
  21961. // "path": "/upload/dfareporting/v3.2/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21962. // }
  21963. // }
  21964. // },
  21965. // "parameterOrder": [
  21966. // "profileId",
  21967. // "advertiserId"
  21968. // ],
  21969. // "parameters": {
  21970. // "advertiserId": {
  21971. // "description": "Advertiser ID of this creative. This is a required field.",
  21972. // "format": "int64",
  21973. // "location": "path",
  21974. // "required": true,
  21975. // "type": "string"
  21976. // },
  21977. // "profileId": {
  21978. // "description": "User profile ID associated with this request.",
  21979. // "format": "int64",
  21980. // "location": "path",
  21981. // "required": true,
  21982. // "type": "string"
  21983. // }
  21984. // },
  21985. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  21986. // "request": {
  21987. // "$ref": "CreativeAssetMetadata"
  21988. // },
  21989. // "response": {
  21990. // "$ref": "CreativeAssetMetadata"
  21991. // },
  21992. // "scopes": [
  21993. // "https://www.googleapis.com/auth/dfatrafficking"
  21994. // ],
  21995. // "supportsMediaUpload": true
  21996. // }
  21997. }
  21998. // method id "dfareporting.creativeFieldValues.delete":
  21999. type CreativeFieldValuesDeleteCall struct {
  22000. s *Service
  22001. profileId int64
  22002. creativeFieldId int64
  22003. id int64
  22004. urlParams_ gensupport.URLParams
  22005. ctx_ context.Context
  22006. header_ http.Header
  22007. }
  22008. // Delete: Deletes an existing creative field value.
  22009. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  22010. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22011. c.profileId = profileId
  22012. c.creativeFieldId = creativeFieldId
  22013. c.id = id
  22014. return c
  22015. }
  22016. // Fields allows partial responses to be retrieved. See
  22017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22018. // for more information.
  22019. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  22020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22021. return c
  22022. }
  22023. // Context sets the context to be used in this call's Do method. Any
  22024. // pending HTTP request will be aborted if the provided context is
  22025. // canceled.
  22026. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  22027. c.ctx_ = ctx
  22028. return c
  22029. }
  22030. // Header returns an http.Header that can be modified by the caller to
  22031. // add HTTP headers to the request.
  22032. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  22033. if c.header_ == nil {
  22034. c.header_ = make(http.Header)
  22035. }
  22036. return c.header_
  22037. }
  22038. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  22039. reqHeaders := make(http.Header)
  22040. for k, v := range c.header_ {
  22041. reqHeaders[k] = v
  22042. }
  22043. reqHeaders.Set("User-Agent", c.s.userAgent())
  22044. var body io.Reader = nil
  22045. c.urlParams_.Set("alt", alt)
  22046. c.urlParams_.Set("prettyPrint", "false")
  22047. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  22048. urls += "?" + c.urlParams_.Encode()
  22049. req, err := http.NewRequest("DELETE", urls, body)
  22050. if err != nil {
  22051. return nil, err
  22052. }
  22053. req.Header = reqHeaders
  22054. googleapi.Expand(req.URL, map[string]string{
  22055. "profileId": strconv.FormatInt(c.profileId, 10),
  22056. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22057. "id": strconv.FormatInt(c.id, 10),
  22058. })
  22059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22060. }
  22061. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  22062. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  22063. gensupport.SetOptions(c.urlParams_, opts...)
  22064. res, err := c.doRequest("json")
  22065. if err != nil {
  22066. return err
  22067. }
  22068. defer googleapi.CloseBody(res)
  22069. if err := googleapi.CheckResponse(res); err != nil {
  22070. return err
  22071. }
  22072. return nil
  22073. // {
  22074. // "description": "Deletes an existing creative field value.",
  22075. // "httpMethod": "DELETE",
  22076. // "id": "dfareporting.creativeFieldValues.delete",
  22077. // "parameterOrder": [
  22078. // "profileId",
  22079. // "creativeFieldId",
  22080. // "id"
  22081. // ],
  22082. // "parameters": {
  22083. // "creativeFieldId": {
  22084. // "description": "Creative field ID for this creative field value.",
  22085. // "format": "int64",
  22086. // "location": "path",
  22087. // "required": true,
  22088. // "type": "string"
  22089. // },
  22090. // "id": {
  22091. // "description": "Creative Field Value ID",
  22092. // "format": "int64",
  22093. // "location": "path",
  22094. // "required": true,
  22095. // "type": "string"
  22096. // },
  22097. // "profileId": {
  22098. // "description": "User profile ID associated with this request.",
  22099. // "format": "int64",
  22100. // "location": "path",
  22101. // "required": true,
  22102. // "type": "string"
  22103. // }
  22104. // },
  22105. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22106. // "scopes": [
  22107. // "https://www.googleapis.com/auth/dfatrafficking"
  22108. // ]
  22109. // }
  22110. }
  22111. // method id "dfareporting.creativeFieldValues.get":
  22112. type CreativeFieldValuesGetCall struct {
  22113. s *Service
  22114. profileId int64
  22115. creativeFieldId int64
  22116. id int64
  22117. urlParams_ gensupport.URLParams
  22118. ifNoneMatch_ string
  22119. ctx_ context.Context
  22120. header_ http.Header
  22121. }
  22122. // Get: Gets one creative field value by ID.
  22123. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  22124. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22125. c.profileId = profileId
  22126. c.creativeFieldId = creativeFieldId
  22127. c.id = id
  22128. return c
  22129. }
  22130. // Fields allows partial responses to be retrieved. See
  22131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22132. // for more information.
  22133. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  22134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22135. return c
  22136. }
  22137. // IfNoneMatch sets the optional parameter which makes the operation
  22138. // fail if the object's ETag matches the given value. This is useful for
  22139. // getting updates only after the object has changed since the last
  22140. // request. Use googleapi.IsNotModified to check whether the response
  22141. // error from Do is the result of In-None-Match.
  22142. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  22143. c.ifNoneMatch_ = entityTag
  22144. return c
  22145. }
  22146. // Context sets the context to be used in this call's Do method. Any
  22147. // pending HTTP request will be aborted if the provided context is
  22148. // canceled.
  22149. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  22150. c.ctx_ = ctx
  22151. return c
  22152. }
  22153. // Header returns an http.Header that can be modified by the caller to
  22154. // add HTTP headers to the request.
  22155. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  22156. if c.header_ == nil {
  22157. c.header_ = make(http.Header)
  22158. }
  22159. return c.header_
  22160. }
  22161. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  22162. reqHeaders := make(http.Header)
  22163. for k, v := range c.header_ {
  22164. reqHeaders[k] = v
  22165. }
  22166. reqHeaders.Set("User-Agent", c.s.userAgent())
  22167. if c.ifNoneMatch_ != "" {
  22168. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22169. }
  22170. var body io.Reader = nil
  22171. c.urlParams_.Set("alt", alt)
  22172. c.urlParams_.Set("prettyPrint", "false")
  22173. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  22174. urls += "?" + c.urlParams_.Encode()
  22175. req, err := http.NewRequest("GET", urls, body)
  22176. if err != nil {
  22177. return nil, err
  22178. }
  22179. req.Header = reqHeaders
  22180. googleapi.Expand(req.URL, map[string]string{
  22181. "profileId": strconv.FormatInt(c.profileId, 10),
  22182. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22183. "id": strconv.FormatInt(c.id, 10),
  22184. })
  22185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22186. }
  22187. // Do executes the "dfareporting.creativeFieldValues.get" call.
  22188. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22189. // non-2xx status code is an error. Response headers are in either
  22190. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22191. // returned at all) in error.(*googleapi.Error).Header. Use
  22192. // googleapi.IsNotModified to check whether the returned error was
  22193. // because http.StatusNotModified was returned.
  22194. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22195. gensupport.SetOptions(c.urlParams_, opts...)
  22196. res, err := c.doRequest("json")
  22197. if res != nil && res.StatusCode == http.StatusNotModified {
  22198. if res.Body != nil {
  22199. res.Body.Close()
  22200. }
  22201. return nil, &googleapi.Error{
  22202. Code: res.StatusCode,
  22203. Header: res.Header,
  22204. }
  22205. }
  22206. if err != nil {
  22207. return nil, err
  22208. }
  22209. defer googleapi.CloseBody(res)
  22210. if err := googleapi.CheckResponse(res); err != nil {
  22211. return nil, err
  22212. }
  22213. ret := &CreativeFieldValue{
  22214. ServerResponse: googleapi.ServerResponse{
  22215. Header: res.Header,
  22216. HTTPStatusCode: res.StatusCode,
  22217. },
  22218. }
  22219. target := &ret
  22220. if err := gensupport.DecodeResponse(target, res); err != nil {
  22221. return nil, err
  22222. }
  22223. return ret, nil
  22224. // {
  22225. // "description": "Gets one creative field value by ID.",
  22226. // "httpMethod": "GET",
  22227. // "id": "dfareporting.creativeFieldValues.get",
  22228. // "parameterOrder": [
  22229. // "profileId",
  22230. // "creativeFieldId",
  22231. // "id"
  22232. // ],
  22233. // "parameters": {
  22234. // "creativeFieldId": {
  22235. // "description": "Creative field ID for this creative field value.",
  22236. // "format": "int64",
  22237. // "location": "path",
  22238. // "required": true,
  22239. // "type": "string"
  22240. // },
  22241. // "id": {
  22242. // "description": "Creative Field Value ID",
  22243. // "format": "int64",
  22244. // "location": "path",
  22245. // "required": true,
  22246. // "type": "string"
  22247. // },
  22248. // "profileId": {
  22249. // "description": "User profile ID associated with this request.",
  22250. // "format": "int64",
  22251. // "location": "path",
  22252. // "required": true,
  22253. // "type": "string"
  22254. // }
  22255. // },
  22256. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22257. // "response": {
  22258. // "$ref": "CreativeFieldValue"
  22259. // },
  22260. // "scopes": [
  22261. // "https://www.googleapis.com/auth/dfatrafficking"
  22262. // ]
  22263. // }
  22264. }
  22265. // method id "dfareporting.creativeFieldValues.insert":
  22266. type CreativeFieldValuesInsertCall struct {
  22267. s *Service
  22268. profileId int64
  22269. creativeFieldId int64
  22270. creativefieldvalue *CreativeFieldValue
  22271. urlParams_ gensupport.URLParams
  22272. ctx_ context.Context
  22273. header_ http.Header
  22274. }
  22275. // Insert: Inserts a new creative field value.
  22276. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  22277. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22278. c.profileId = profileId
  22279. c.creativeFieldId = creativeFieldId
  22280. c.creativefieldvalue = creativefieldvalue
  22281. return c
  22282. }
  22283. // Fields allows partial responses to be retrieved. See
  22284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22285. // for more information.
  22286. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  22287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22288. return c
  22289. }
  22290. // Context sets the context to be used in this call's Do method. Any
  22291. // pending HTTP request will be aborted if the provided context is
  22292. // canceled.
  22293. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  22294. c.ctx_ = ctx
  22295. return c
  22296. }
  22297. // Header returns an http.Header that can be modified by the caller to
  22298. // add HTTP headers to the request.
  22299. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  22300. if c.header_ == nil {
  22301. c.header_ = make(http.Header)
  22302. }
  22303. return c.header_
  22304. }
  22305. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  22306. reqHeaders := make(http.Header)
  22307. for k, v := range c.header_ {
  22308. reqHeaders[k] = v
  22309. }
  22310. reqHeaders.Set("User-Agent", c.s.userAgent())
  22311. var body io.Reader = nil
  22312. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22313. if err != nil {
  22314. return nil, err
  22315. }
  22316. reqHeaders.Set("Content-Type", "application/json")
  22317. c.urlParams_.Set("alt", alt)
  22318. c.urlParams_.Set("prettyPrint", "false")
  22319. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22320. urls += "?" + c.urlParams_.Encode()
  22321. req, err := http.NewRequest("POST", urls, body)
  22322. if err != nil {
  22323. return nil, err
  22324. }
  22325. req.Header = reqHeaders
  22326. googleapi.Expand(req.URL, map[string]string{
  22327. "profileId": strconv.FormatInt(c.profileId, 10),
  22328. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22329. })
  22330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22331. }
  22332. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  22333. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22334. // non-2xx status code is an error. Response headers are in either
  22335. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22336. // returned at all) in error.(*googleapi.Error).Header. Use
  22337. // googleapi.IsNotModified to check whether the returned error was
  22338. // because http.StatusNotModified was returned.
  22339. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22340. gensupport.SetOptions(c.urlParams_, opts...)
  22341. res, err := c.doRequest("json")
  22342. if res != nil && res.StatusCode == http.StatusNotModified {
  22343. if res.Body != nil {
  22344. res.Body.Close()
  22345. }
  22346. return nil, &googleapi.Error{
  22347. Code: res.StatusCode,
  22348. Header: res.Header,
  22349. }
  22350. }
  22351. if err != nil {
  22352. return nil, err
  22353. }
  22354. defer googleapi.CloseBody(res)
  22355. if err := googleapi.CheckResponse(res); err != nil {
  22356. return nil, err
  22357. }
  22358. ret := &CreativeFieldValue{
  22359. ServerResponse: googleapi.ServerResponse{
  22360. Header: res.Header,
  22361. HTTPStatusCode: res.StatusCode,
  22362. },
  22363. }
  22364. target := &ret
  22365. if err := gensupport.DecodeResponse(target, res); err != nil {
  22366. return nil, err
  22367. }
  22368. return ret, nil
  22369. // {
  22370. // "description": "Inserts a new creative field value.",
  22371. // "httpMethod": "POST",
  22372. // "id": "dfareporting.creativeFieldValues.insert",
  22373. // "parameterOrder": [
  22374. // "profileId",
  22375. // "creativeFieldId"
  22376. // ],
  22377. // "parameters": {
  22378. // "creativeFieldId": {
  22379. // "description": "Creative field ID for this creative field value.",
  22380. // "format": "int64",
  22381. // "location": "path",
  22382. // "required": true,
  22383. // "type": "string"
  22384. // },
  22385. // "profileId": {
  22386. // "description": "User profile ID associated with this request.",
  22387. // "format": "int64",
  22388. // "location": "path",
  22389. // "required": true,
  22390. // "type": "string"
  22391. // }
  22392. // },
  22393. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22394. // "request": {
  22395. // "$ref": "CreativeFieldValue"
  22396. // },
  22397. // "response": {
  22398. // "$ref": "CreativeFieldValue"
  22399. // },
  22400. // "scopes": [
  22401. // "https://www.googleapis.com/auth/dfatrafficking"
  22402. // ]
  22403. // }
  22404. }
  22405. // method id "dfareporting.creativeFieldValues.list":
  22406. type CreativeFieldValuesListCall struct {
  22407. s *Service
  22408. profileId int64
  22409. creativeFieldId int64
  22410. urlParams_ gensupport.URLParams
  22411. ifNoneMatch_ string
  22412. ctx_ context.Context
  22413. header_ http.Header
  22414. }
  22415. // List: Retrieves a list of creative field values, possibly filtered.
  22416. // This method supports paging.
  22417. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  22418. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22419. c.profileId = profileId
  22420. c.creativeFieldId = creativeFieldId
  22421. return c
  22422. }
  22423. // Ids sets the optional parameter "ids": Select only creative field
  22424. // values with these IDs.
  22425. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  22426. var ids_ []string
  22427. for _, v := range ids {
  22428. ids_ = append(ids_, fmt.Sprint(v))
  22429. }
  22430. c.urlParams_.SetMulti("ids", ids_)
  22431. return c
  22432. }
  22433. // MaxResults sets the optional parameter "maxResults": Maximum number
  22434. // of results to return.
  22435. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  22436. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22437. return c
  22438. }
  22439. // PageToken sets the optional parameter "pageToken": Value of the
  22440. // nextPageToken from the previous result page.
  22441. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  22442. c.urlParams_.Set("pageToken", pageToken)
  22443. return c
  22444. }
  22445. // SearchString sets the optional parameter "searchString": Allows
  22446. // searching for creative field values by their values. Wildcards (e.g.
  22447. // *) are not allowed.
  22448. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  22449. c.urlParams_.Set("searchString", searchString)
  22450. return c
  22451. }
  22452. // SortField sets the optional parameter "sortField": Field by which to
  22453. // sort the list.
  22454. //
  22455. // Possible values:
  22456. // "ID" (default)
  22457. // "VALUE"
  22458. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  22459. c.urlParams_.Set("sortField", sortField)
  22460. return c
  22461. }
  22462. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22463. // results.
  22464. //
  22465. // Possible values:
  22466. // "ASCENDING" (default)
  22467. // "DESCENDING"
  22468. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  22469. c.urlParams_.Set("sortOrder", sortOrder)
  22470. return c
  22471. }
  22472. // Fields allows partial responses to be retrieved. See
  22473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22474. // for more information.
  22475. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  22476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22477. return c
  22478. }
  22479. // IfNoneMatch sets the optional parameter which makes the operation
  22480. // fail if the object's ETag matches the given value. This is useful for
  22481. // getting updates only after the object has changed since the last
  22482. // request. Use googleapi.IsNotModified to check whether the response
  22483. // error from Do is the result of In-None-Match.
  22484. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  22485. c.ifNoneMatch_ = entityTag
  22486. return c
  22487. }
  22488. // Context sets the context to be used in this call's Do method. Any
  22489. // pending HTTP request will be aborted if the provided context is
  22490. // canceled.
  22491. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  22492. c.ctx_ = ctx
  22493. return c
  22494. }
  22495. // Header returns an http.Header that can be modified by the caller to
  22496. // add HTTP headers to the request.
  22497. func (c *CreativeFieldValuesListCall) Header() http.Header {
  22498. if c.header_ == nil {
  22499. c.header_ = make(http.Header)
  22500. }
  22501. return c.header_
  22502. }
  22503. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  22504. reqHeaders := make(http.Header)
  22505. for k, v := range c.header_ {
  22506. reqHeaders[k] = v
  22507. }
  22508. reqHeaders.Set("User-Agent", c.s.userAgent())
  22509. if c.ifNoneMatch_ != "" {
  22510. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22511. }
  22512. var body io.Reader = nil
  22513. c.urlParams_.Set("alt", alt)
  22514. c.urlParams_.Set("prettyPrint", "false")
  22515. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22516. urls += "?" + c.urlParams_.Encode()
  22517. req, err := http.NewRequest("GET", urls, body)
  22518. if err != nil {
  22519. return nil, err
  22520. }
  22521. req.Header = reqHeaders
  22522. googleapi.Expand(req.URL, map[string]string{
  22523. "profileId": strconv.FormatInt(c.profileId, 10),
  22524. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22525. })
  22526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22527. }
  22528. // Do executes the "dfareporting.creativeFieldValues.list" call.
  22529. // Exactly one of *CreativeFieldValuesListResponse or error will be
  22530. // non-nil. Any non-2xx status code is an error. Response headers are in
  22531. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  22532. // a response was returned at all) in error.(*googleapi.Error).Header.
  22533. // Use googleapi.IsNotModified to check whether the returned error was
  22534. // because http.StatusNotModified was returned.
  22535. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  22536. gensupport.SetOptions(c.urlParams_, opts...)
  22537. res, err := c.doRequest("json")
  22538. if res != nil && res.StatusCode == http.StatusNotModified {
  22539. if res.Body != nil {
  22540. res.Body.Close()
  22541. }
  22542. return nil, &googleapi.Error{
  22543. Code: res.StatusCode,
  22544. Header: res.Header,
  22545. }
  22546. }
  22547. if err != nil {
  22548. return nil, err
  22549. }
  22550. defer googleapi.CloseBody(res)
  22551. if err := googleapi.CheckResponse(res); err != nil {
  22552. return nil, err
  22553. }
  22554. ret := &CreativeFieldValuesListResponse{
  22555. ServerResponse: googleapi.ServerResponse{
  22556. Header: res.Header,
  22557. HTTPStatusCode: res.StatusCode,
  22558. },
  22559. }
  22560. target := &ret
  22561. if err := gensupport.DecodeResponse(target, res); err != nil {
  22562. return nil, err
  22563. }
  22564. return ret, nil
  22565. // {
  22566. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  22567. // "httpMethod": "GET",
  22568. // "id": "dfareporting.creativeFieldValues.list",
  22569. // "parameterOrder": [
  22570. // "profileId",
  22571. // "creativeFieldId"
  22572. // ],
  22573. // "parameters": {
  22574. // "creativeFieldId": {
  22575. // "description": "Creative field ID for this creative field value.",
  22576. // "format": "int64",
  22577. // "location": "path",
  22578. // "required": true,
  22579. // "type": "string"
  22580. // },
  22581. // "ids": {
  22582. // "description": "Select only creative field values with these IDs.",
  22583. // "format": "int64",
  22584. // "location": "query",
  22585. // "repeated": true,
  22586. // "type": "string"
  22587. // },
  22588. // "maxResults": {
  22589. // "default": "1000",
  22590. // "description": "Maximum number of results to return.",
  22591. // "format": "int32",
  22592. // "location": "query",
  22593. // "maximum": "1000",
  22594. // "minimum": "0",
  22595. // "type": "integer"
  22596. // },
  22597. // "pageToken": {
  22598. // "description": "Value of the nextPageToken from the previous result page.",
  22599. // "location": "query",
  22600. // "type": "string"
  22601. // },
  22602. // "profileId": {
  22603. // "description": "User profile ID associated with this request.",
  22604. // "format": "int64",
  22605. // "location": "path",
  22606. // "required": true,
  22607. // "type": "string"
  22608. // },
  22609. // "searchString": {
  22610. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  22611. // "location": "query",
  22612. // "type": "string"
  22613. // },
  22614. // "sortField": {
  22615. // "default": "ID",
  22616. // "description": "Field by which to sort the list.",
  22617. // "enum": [
  22618. // "ID",
  22619. // "VALUE"
  22620. // ],
  22621. // "enumDescriptions": [
  22622. // "",
  22623. // ""
  22624. // ],
  22625. // "location": "query",
  22626. // "type": "string"
  22627. // },
  22628. // "sortOrder": {
  22629. // "default": "ASCENDING",
  22630. // "description": "Order of sorted results.",
  22631. // "enum": [
  22632. // "ASCENDING",
  22633. // "DESCENDING"
  22634. // ],
  22635. // "enumDescriptions": [
  22636. // "",
  22637. // ""
  22638. // ],
  22639. // "location": "query",
  22640. // "type": "string"
  22641. // }
  22642. // },
  22643. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22644. // "response": {
  22645. // "$ref": "CreativeFieldValuesListResponse"
  22646. // },
  22647. // "scopes": [
  22648. // "https://www.googleapis.com/auth/dfatrafficking"
  22649. // ]
  22650. // }
  22651. }
  22652. // Pages invokes f for each page of results.
  22653. // A non-nil error returned from f will halt the iteration.
  22654. // The provided context supersedes any context provided to the Context method.
  22655. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  22656. c.ctx_ = ctx
  22657. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22658. for {
  22659. x, err := c.Do()
  22660. if err != nil {
  22661. return err
  22662. }
  22663. if err := f(x); err != nil {
  22664. return err
  22665. }
  22666. if x.NextPageToken == "" {
  22667. return nil
  22668. }
  22669. c.PageToken(x.NextPageToken)
  22670. }
  22671. }
  22672. // method id "dfareporting.creativeFieldValues.patch":
  22673. type CreativeFieldValuesPatchCall struct {
  22674. s *Service
  22675. profileId int64
  22676. creativeFieldId int64
  22677. creativefieldvalue *CreativeFieldValue
  22678. urlParams_ gensupport.URLParams
  22679. ctx_ context.Context
  22680. header_ http.Header
  22681. }
  22682. // Patch: Updates an existing creative field value. This method supports
  22683. // patch semantics.
  22684. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  22685. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22686. c.profileId = profileId
  22687. c.creativeFieldId = creativeFieldId
  22688. c.urlParams_.Set("id", fmt.Sprint(id))
  22689. c.creativefieldvalue = creativefieldvalue
  22690. return c
  22691. }
  22692. // Fields allows partial responses to be retrieved. See
  22693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22694. // for more information.
  22695. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  22696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22697. return c
  22698. }
  22699. // Context sets the context to be used in this call's Do method. Any
  22700. // pending HTTP request will be aborted if the provided context is
  22701. // canceled.
  22702. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  22703. c.ctx_ = ctx
  22704. return c
  22705. }
  22706. // Header returns an http.Header that can be modified by the caller to
  22707. // add HTTP headers to the request.
  22708. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  22709. if c.header_ == nil {
  22710. c.header_ = make(http.Header)
  22711. }
  22712. return c.header_
  22713. }
  22714. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  22715. reqHeaders := make(http.Header)
  22716. for k, v := range c.header_ {
  22717. reqHeaders[k] = v
  22718. }
  22719. reqHeaders.Set("User-Agent", c.s.userAgent())
  22720. var body io.Reader = nil
  22721. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22722. if err != nil {
  22723. return nil, err
  22724. }
  22725. reqHeaders.Set("Content-Type", "application/json")
  22726. c.urlParams_.Set("alt", alt)
  22727. c.urlParams_.Set("prettyPrint", "false")
  22728. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22729. urls += "?" + c.urlParams_.Encode()
  22730. req, err := http.NewRequest("PATCH", urls, body)
  22731. if err != nil {
  22732. return nil, err
  22733. }
  22734. req.Header = reqHeaders
  22735. googleapi.Expand(req.URL, map[string]string{
  22736. "profileId": strconv.FormatInt(c.profileId, 10),
  22737. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22738. })
  22739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22740. }
  22741. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  22742. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22743. // non-2xx status code is an error. Response headers are in either
  22744. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22745. // returned at all) in error.(*googleapi.Error).Header. Use
  22746. // googleapi.IsNotModified to check whether the returned error was
  22747. // because http.StatusNotModified was returned.
  22748. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22749. gensupport.SetOptions(c.urlParams_, opts...)
  22750. res, err := c.doRequest("json")
  22751. if res != nil && res.StatusCode == http.StatusNotModified {
  22752. if res.Body != nil {
  22753. res.Body.Close()
  22754. }
  22755. return nil, &googleapi.Error{
  22756. Code: res.StatusCode,
  22757. Header: res.Header,
  22758. }
  22759. }
  22760. if err != nil {
  22761. return nil, err
  22762. }
  22763. defer googleapi.CloseBody(res)
  22764. if err := googleapi.CheckResponse(res); err != nil {
  22765. return nil, err
  22766. }
  22767. ret := &CreativeFieldValue{
  22768. ServerResponse: googleapi.ServerResponse{
  22769. Header: res.Header,
  22770. HTTPStatusCode: res.StatusCode,
  22771. },
  22772. }
  22773. target := &ret
  22774. if err := gensupport.DecodeResponse(target, res); err != nil {
  22775. return nil, err
  22776. }
  22777. return ret, nil
  22778. // {
  22779. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  22780. // "httpMethod": "PATCH",
  22781. // "id": "dfareporting.creativeFieldValues.patch",
  22782. // "parameterOrder": [
  22783. // "profileId",
  22784. // "creativeFieldId",
  22785. // "id"
  22786. // ],
  22787. // "parameters": {
  22788. // "creativeFieldId": {
  22789. // "description": "Creative field ID for this creative field value.",
  22790. // "format": "int64",
  22791. // "location": "path",
  22792. // "required": true,
  22793. // "type": "string"
  22794. // },
  22795. // "id": {
  22796. // "description": "Creative Field Value ID",
  22797. // "format": "int64",
  22798. // "location": "query",
  22799. // "required": true,
  22800. // "type": "string"
  22801. // },
  22802. // "profileId": {
  22803. // "description": "User profile ID associated with this request.",
  22804. // "format": "int64",
  22805. // "location": "path",
  22806. // "required": true,
  22807. // "type": "string"
  22808. // }
  22809. // },
  22810. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22811. // "request": {
  22812. // "$ref": "CreativeFieldValue"
  22813. // },
  22814. // "response": {
  22815. // "$ref": "CreativeFieldValue"
  22816. // },
  22817. // "scopes": [
  22818. // "https://www.googleapis.com/auth/dfatrafficking"
  22819. // ]
  22820. // }
  22821. }
  22822. // method id "dfareporting.creativeFieldValues.update":
  22823. type CreativeFieldValuesUpdateCall struct {
  22824. s *Service
  22825. profileId int64
  22826. creativeFieldId int64
  22827. creativefieldvalue *CreativeFieldValue
  22828. urlParams_ gensupport.URLParams
  22829. ctx_ context.Context
  22830. header_ http.Header
  22831. }
  22832. // Update: Updates an existing creative field value.
  22833. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  22834. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22835. c.profileId = profileId
  22836. c.creativeFieldId = creativeFieldId
  22837. c.creativefieldvalue = creativefieldvalue
  22838. return c
  22839. }
  22840. // Fields allows partial responses to be retrieved. See
  22841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22842. // for more information.
  22843. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  22844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22845. return c
  22846. }
  22847. // Context sets the context to be used in this call's Do method. Any
  22848. // pending HTTP request will be aborted if the provided context is
  22849. // canceled.
  22850. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  22851. c.ctx_ = ctx
  22852. return c
  22853. }
  22854. // Header returns an http.Header that can be modified by the caller to
  22855. // add HTTP headers to the request.
  22856. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  22857. if c.header_ == nil {
  22858. c.header_ = make(http.Header)
  22859. }
  22860. return c.header_
  22861. }
  22862. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  22863. reqHeaders := make(http.Header)
  22864. for k, v := range c.header_ {
  22865. reqHeaders[k] = v
  22866. }
  22867. reqHeaders.Set("User-Agent", c.s.userAgent())
  22868. var body io.Reader = nil
  22869. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22870. if err != nil {
  22871. return nil, err
  22872. }
  22873. reqHeaders.Set("Content-Type", "application/json")
  22874. c.urlParams_.Set("alt", alt)
  22875. c.urlParams_.Set("prettyPrint", "false")
  22876. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22877. urls += "?" + c.urlParams_.Encode()
  22878. req, err := http.NewRequest("PUT", urls, body)
  22879. if err != nil {
  22880. return nil, err
  22881. }
  22882. req.Header = reqHeaders
  22883. googleapi.Expand(req.URL, map[string]string{
  22884. "profileId": strconv.FormatInt(c.profileId, 10),
  22885. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22886. })
  22887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22888. }
  22889. // Do executes the "dfareporting.creativeFieldValues.update" call.
  22890. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22891. // non-2xx status code is an error. Response headers are in either
  22892. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22893. // returned at all) in error.(*googleapi.Error).Header. Use
  22894. // googleapi.IsNotModified to check whether the returned error was
  22895. // because http.StatusNotModified was returned.
  22896. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22897. gensupport.SetOptions(c.urlParams_, opts...)
  22898. res, err := c.doRequest("json")
  22899. if res != nil && res.StatusCode == http.StatusNotModified {
  22900. if res.Body != nil {
  22901. res.Body.Close()
  22902. }
  22903. return nil, &googleapi.Error{
  22904. Code: res.StatusCode,
  22905. Header: res.Header,
  22906. }
  22907. }
  22908. if err != nil {
  22909. return nil, err
  22910. }
  22911. defer googleapi.CloseBody(res)
  22912. if err := googleapi.CheckResponse(res); err != nil {
  22913. return nil, err
  22914. }
  22915. ret := &CreativeFieldValue{
  22916. ServerResponse: googleapi.ServerResponse{
  22917. Header: res.Header,
  22918. HTTPStatusCode: res.StatusCode,
  22919. },
  22920. }
  22921. target := &ret
  22922. if err := gensupport.DecodeResponse(target, res); err != nil {
  22923. return nil, err
  22924. }
  22925. return ret, nil
  22926. // {
  22927. // "description": "Updates an existing creative field value.",
  22928. // "httpMethod": "PUT",
  22929. // "id": "dfareporting.creativeFieldValues.update",
  22930. // "parameterOrder": [
  22931. // "profileId",
  22932. // "creativeFieldId"
  22933. // ],
  22934. // "parameters": {
  22935. // "creativeFieldId": {
  22936. // "description": "Creative field ID for this creative field value.",
  22937. // "format": "int64",
  22938. // "location": "path",
  22939. // "required": true,
  22940. // "type": "string"
  22941. // },
  22942. // "profileId": {
  22943. // "description": "User profile ID associated with this request.",
  22944. // "format": "int64",
  22945. // "location": "path",
  22946. // "required": true,
  22947. // "type": "string"
  22948. // }
  22949. // },
  22950. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22951. // "request": {
  22952. // "$ref": "CreativeFieldValue"
  22953. // },
  22954. // "response": {
  22955. // "$ref": "CreativeFieldValue"
  22956. // },
  22957. // "scopes": [
  22958. // "https://www.googleapis.com/auth/dfatrafficking"
  22959. // ]
  22960. // }
  22961. }
  22962. // method id "dfareporting.creativeFields.delete":
  22963. type CreativeFieldsDeleteCall struct {
  22964. s *Service
  22965. profileId int64
  22966. id int64
  22967. urlParams_ gensupport.URLParams
  22968. ctx_ context.Context
  22969. header_ http.Header
  22970. }
  22971. // Delete: Deletes an existing creative field.
  22972. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  22973. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22974. c.profileId = profileId
  22975. c.id = id
  22976. return c
  22977. }
  22978. // Fields allows partial responses to be retrieved. See
  22979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22980. // for more information.
  22981. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  22982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22983. return c
  22984. }
  22985. // Context sets the context to be used in this call's Do method. Any
  22986. // pending HTTP request will be aborted if the provided context is
  22987. // canceled.
  22988. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  22989. c.ctx_ = ctx
  22990. return c
  22991. }
  22992. // Header returns an http.Header that can be modified by the caller to
  22993. // add HTTP headers to the request.
  22994. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  22995. if c.header_ == nil {
  22996. c.header_ = make(http.Header)
  22997. }
  22998. return c.header_
  22999. }
  23000. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  23001. reqHeaders := make(http.Header)
  23002. for k, v := range c.header_ {
  23003. reqHeaders[k] = v
  23004. }
  23005. reqHeaders.Set("User-Agent", c.s.userAgent())
  23006. var body io.Reader = nil
  23007. c.urlParams_.Set("alt", alt)
  23008. c.urlParams_.Set("prettyPrint", "false")
  23009. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  23010. urls += "?" + c.urlParams_.Encode()
  23011. req, err := http.NewRequest("DELETE", urls, body)
  23012. if err != nil {
  23013. return nil, err
  23014. }
  23015. req.Header = reqHeaders
  23016. googleapi.Expand(req.URL, map[string]string{
  23017. "profileId": strconv.FormatInt(c.profileId, 10),
  23018. "id": strconv.FormatInt(c.id, 10),
  23019. })
  23020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23021. }
  23022. // Do executes the "dfareporting.creativeFields.delete" call.
  23023. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  23024. gensupport.SetOptions(c.urlParams_, opts...)
  23025. res, err := c.doRequest("json")
  23026. if err != nil {
  23027. return err
  23028. }
  23029. defer googleapi.CloseBody(res)
  23030. if err := googleapi.CheckResponse(res); err != nil {
  23031. return err
  23032. }
  23033. return nil
  23034. // {
  23035. // "description": "Deletes an existing creative field.",
  23036. // "httpMethod": "DELETE",
  23037. // "id": "dfareporting.creativeFields.delete",
  23038. // "parameterOrder": [
  23039. // "profileId",
  23040. // "id"
  23041. // ],
  23042. // "parameters": {
  23043. // "id": {
  23044. // "description": "Creative Field ID",
  23045. // "format": "int64",
  23046. // "location": "path",
  23047. // "required": true,
  23048. // "type": "string"
  23049. // },
  23050. // "profileId": {
  23051. // "description": "User profile ID associated with this request.",
  23052. // "format": "int64",
  23053. // "location": "path",
  23054. // "required": true,
  23055. // "type": "string"
  23056. // }
  23057. // },
  23058. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  23059. // "scopes": [
  23060. // "https://www.googleapis.com/auth/dfatrafficking"
  23061. // ]
  23062. // }
  23063. }
  23064. // method id "dfareporting.creativeFields.get":
  23065. type CreativeFieldsGetCall struct {
  23066. s *Service
  23067. profileId int64
  23068. id int64
  23069. urlParams_ gensupport.URLParams
  23070. ifNoneMatch_ string
  23071. ctx_ context.Context
  23072. header_ http.Header
  23073. }
  23074. // Get: Gets one creative field by ID.
  23075. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  23076. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23077. c.profileId = profileId
  23078. c.id = id
  23079. return c
  23080. }
  23081. // Fields allows partial responses to be retrieved. See
  23082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23083. // for more information.
  23084. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  23085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23086. return c
  23087. }
  23088. // IfNoneMatch sets the optional parameter which makes the operation
  23089. // fail if the object's ETag matches the given value. This is useful for
  23090. // getting updates only after the object has changed since the last
  23091. // request. Use googleapi.IsNotModified to check whether the response
  23092. // error from Do is the result of In-None-Match.
  23093. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  23094. c.ifNoneMatch_ = entityTag
  23095. return c
  23096. }
  23097. // Context sets the context to be used in this call's Do method. Any
  23098. // pending HTTP request will be aborted if the provided context is
  23099. // canceled.
  23100. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  23101. c.ctx_ = ctx
  23102. return c
  23103. }
  23104. // Header returns an http.Header that can be modified by the caller to
  23105. // add HTTP headers to the request.
  23106. func (c *CreativeFieldsGetCall) Header() http.Header {
  23107. if c.header_ == nil {
  23108. c.header_ = make(http.Header)
  23109. }
  23110. return c.header_
  23111. }
  23112. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  23113. reqHeaders := make(http.Header)
  23114. for k, v := range c.header_ {
  23115. reqHeaders[k] = v
  23116. }
  23117. reqHeaders.Set("User-Agent", c.s.userAgent())
  23118. if c.ifNoneMatch_ != "" {
  23119. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23120. }
  23121. var body io.Reader = nil
  23122. c.urlParams_.Set("alt", alt)
  23123. c.urlParams_.Set("prettyPrint", "false")
  23124. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  23125. urls += "?" + c.urlParams_.Encode()
  23126. req, err := http.NewRequest("GET", urls, body)
  23127. if err != nil {
  23128. return nil, err
  23129. }
  23130. req.Header = reqHeaders
  23131. googleapi.Expand(req.URL, map[string]string{
  23132. "profileId": strconv.FormatInt(c.profileId, 10),
  23133. "id": strconv.FormatInt(c.id, 10),
  23134. })
  23135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23136. }
  23137. // Do executes the "dfareporting.creativeFields.get" call.
  23138. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23139. // status code is an error. Response headers are in either
  23140. // *CreativeField.ServerResponse.Header or (if a response was returned
  23141. // at all) in error.(*googleapi.Error).Header. Use
  23142. // googleapi.IsNotModified to check whether the returned error was
  23143. // because http.StatusNotModified was returned.
  23144. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23145. gensupport.SetOptions(c.urlParams_, opts...)
  23146. res, err := c.doRequest("json")
  23147. if res != nil && res.StatusCode == http.StatusNotModified {
  23148. if res.Body != nil {
  23149. res.Body.Close()
  23150. }
  23151. return nil, &googleapi.Error{
  23152. Code: res.StatusCode,
  23153. Header: res.Header,
  23154. }
  23155. }
  23156. if err != nil {
  23157. return nil, err
  23158. }
  23159. defer googleapi.CloseBody(res)
  23160. if err := googleapi.CheckResponse(res); err != nil {
  23161. return nil, err
  23162. }
  23163. ret := &CreativeField{
  23164. ServerResponse: googleapi.ServerResponse{
  23165. Header: res.Header,
  23166. HTTPStatusCode: res.StatusCode,
  23167. },
  23168. }
  23169. target := &ret
  23170. if err := gensupport.DecodeResponse(target, res); err != nil {
  23171. return nil, err
  23172. }
  23173. return ret, nil
  23174. // {
  23175. // "description": "Gets one creative field by ID.",
  23176. // "httpMethod": "GET",
  23177. // "id": "dfareporting.creativeFields.get",
  23178. // "parameterOrder": [
  23179. // "profileId",
  23180. // "id"
  23181. // ],
  23182. // "parameters": {
  23183. // "id": {
  23184. // "description": "Creative Field ID",
  23185. // "format": "int64",
  23186. // "location": "path",
  23187. // "required": true,
  23188. // "type": "string"
  23189. // },
  23190. // "profileId": {
  23191. // "description": "User profile ID associated with this request.",
  23192. // "format": "int64",
  23193. // "location": "path",
  23194. // "required": true,
  23195. // "type": "string"
  23196. // }
  23197. // },
  23198. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  23199. // "response": {
  23200. // "$ref": "CreativeField"
  23201. // },
  23202. // "scopes": [
  23203. // "https://www.googleapis.com/auth/dfatrafficking"
  23204. // ]
  23205. // }
  23206. }
  23207. // method id "dfareporting.creativeFields.insert":
  23208. type CreativeFieldsInsertCall struct {
  23209. s *Service
  23210. profileId int64
  23211. creativefield *CreativeField
  23212. urlParams_ gensupport.URLParams
  23213. ctx_ context.Context
  23214. header_ http.Header
  23215. }
  23216. // Insert: Inserts a new creative field.
  23217. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  23218. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23219. c.profileId = profileId
  23220. c.creativefield = creativefield
  23221. return c
  23222. }
  23223. // Fields allows partial responses to be retrieved. See
  23224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23225. // for more information.
  23226. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  23227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23228. return c
  23229. }
  23230. // Context sets the context to be used in this call's Do method. Any
  23231. // pending HTTP request will be aborted if the provided context is
  23232. // canceled.
  23233. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  23234. c.ctx_ = ctx
  23235. return c
  23236. }
  23237. // Header returns an http.Header that can be modified by the caller to
  23238. // add HTTP headers to the request.
  23239. func (c *CreativeFieldsInsertCall) Header() http.Header {
  23240. if c.header_ == nil {
  23241. c.header_ = make(http.Header)
  23242. }
  23243. return c.header_
  23244. }
  23245. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  23246. reqHeaders := make(http.Header)
  23247. for k, v := range c.header_ {
  23248. reqHeaders[k] = v
  23249. }
  23250. reqHeaders.Set("User-Agent", c.s.userAgent())
  23251. var body io.Reader = nil
  23252. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23253. if err != nil {
  23254. return nil, err
  23255. }
  23256. reqHeaders.Set("Content-Type", "application/json")
  23257. c.urlParams_.Set("alt", alt)
  23258. c.urlParams_.Set("prettyPrint", "false")
  23259. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23260. urls += "?" + c.urlParams_.Encode()
  23261. req, err := http.NewRequest("POST", urls, body)
  23262. if err != nil {
  23263. return nil, err
  23264. }
  23265. req.Header = reqHeaders
  23266. googleapi.Expand(req.URL, map[string]string{
  23267. "profileId": strconv.FormatInt(c.profileId, 10),
  23268. })
  23269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23270. }
  23271. // Do executes the "dfareporting.creativeFields.insert" call.
  23272. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23273. // status code is an error. Response headers are in either
  23274. // *CreativeField.ServerResponse.Header or (if a response was returned
  23275. // at all) in error.(*googleapi.Error).Header. Use
  23276. // googleapi.IsNotModified to check whether the returned error was
  23277. // because http.StatusNotModified was returned.
  23278. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23279. gensupport.SetOptions(c.urlParams_, opts...)
  23280. res, err := c.doRequest("json")
  23281. if res != nil && res.StatusCode == http.StatusNotModified {
  23282. if res.Body != nil {
  23283. res.Body.Close()
  23284. }
  23285. return nil, &googleapi.Error{
  23286. Code: res.StatusCode,
  23287. Header: res.Header,
  23288. }
  23289. }
  23290. if err != nil {
  23291. return nil, err
  23292. }
  23293. defer googleapi.CloseBody(res)
  23294. if err := googleapi.CheckResponse(res); err != nil {
  23295. return nil, err
  23296. }
  23297. ret := &CreativeField{
  23298. ServerResponse: googleapi.ServerResponse{
  23299. Header: res.Header,
  23300. HTTPStatusCode: res.StatusCode,
  23301. },
  23302. }
  23303. target := &ret
  23304. if err := gensupport.DecodeResponse(target, res); err != nil {
  23305. return nil, err
  23306. }
  23307. return ret, nil
  23308. // {
  23309. // "description": "Inserts a new creative field.",
  23310. // "httpMethod": "POST",
  23311. // "id": "dfareporting.creativeFields.insert",
  23312. // "parameterOrder": [
  23313. // "profileId"
  23314. // ],
  23315. // "parameters": {
  23316. // "profileId": {
  23317. // "description": "User profile ID associated with this request.",
  23318. // "format": "int64",
  23319. // "location": "path",
  23320. // "required": true,
  23321. // "type": "string"
  23322. // }
  23323. // },
  23324. // "path": "userprofiles/{profileId}/creativeFields",
  23325. // "request": {
  23326. // "$ref": "CreativeField"
  23327. // },
  23328. // "response": {
  23329. // "$ref": "CreativeField"
  23330. // },
  23331. // "scopes": [
  23332. // "https://www.googleapis.com/auth/dfatrafficking"
  23333. // ]
  23334. // }
  23335. }
  23336. // method id "dfareporting.creativeFields.list":
  23337. type CreativeFieldsListCall struct {
  23338. s *Service
  23339. profileId int64
  23340. urlParams_ gensupport.URLParams
  23341. ifNoneMatch_ string
  23342. ctx_ context.Context
  23343. header_ http.Header
  23344. }
  23345. // List: Retrieves a list of creative fields, possibly filtered. This
  23346. // method supports paging.
  23347. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  23348. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23349. c.profileId = profileId
  23350. return c
  23351. }
  23352. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23353. // only creative fields that belong to these advertisers.
  23354. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  23355. var advertiserIds_ []string
  23356. for _, v := range advertiserIds {
  23357. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23358. }
  23359. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23360. return c
  23361. }
  23362. // Ids sets the optional parameter "ids": Select only creative fields
  23363. // with these IDs.
  23364. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  23365. var ids_ []string
  23366. for _, v := range ids {
  23367. ids_ = append(ids_, fmt.Sprint(v))
  23368. }
  23369. c.urlParams_.SetMulti("ids", ids_)
  23370. return c
  23371. }
  23372. // MaxResults sets the optional parameter "maxResults": Maximum number
  23373. // of results to return.
  23374. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  23375. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23376. return c
  23377. }
  23378. // PageToken sets the optional parameter "pageToken": Value of the
  23379. // nextPageToken from the previous result page.
  23380. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  23381. c.urlParams_.Set("pageToken", pageToken)
  23382. return c
  23383. }
  23384. // SearchString sets the optional parameter "searchString": Allows
  23385. // searching for creative fields by name or ID. Wildcards (*) are
  23386. // allowed. For example, "creativefield*2015" will return creative
  23387. // fields with names like "creativefield June 2015", "creativefield
  23388. // April 2015", or simply "creativefield 2015". Most of the searches
  23389. // also add wild-cards implicitly at the start and the end of the search
  23390. // string. For example, a search string of "creativefield" will match
  23391. // creative fields with the name "my creativefield", "creativefield
  23392. // 2015", or simply "creativefield".
  23393. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  23394. c.urlParams_.Set("searchString", searchString)
  23395. return c
  23396. }
  23397. // SortField sets the optional parameter "sortField": Field by which to
  23398. // sort the list.
  23399. //
  23400. // Possible values:
  23401. // "ID" (default)
  23402. // "NAME"
  23403. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  23404. c.urlParams_.Set("sortField", sortField)
  23405. return c
  23406. }
  23407. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23408. // results.
  23409. //
  23410. // Possible values:
  23411. // "ASCENDING" (default)
  23412. // "DESCENDING"
  23413. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  23414. c.urlParams_.Set("sortOrder", sortOrder)
  23415. return c
  23416. }
  23417. // Fields allows partial responses to be retrieved. See
  23418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23419. // for more information.
  23420. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  23421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23422. return c
  23423. }
  23424. // IfNoneMatch sets the optional parameter which makes the operation
  23425. // fail if the object's ETag matches the given value. This is useful for
  23426. // getting updates only after the object has changed since the last
  23427. // request. Use googleapi.IsNotModified to check whether the response
  23428. // error from Do is the result of In-None-Match.
  23429. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  23430. c.ifNoneMatch_ = entityTag
  23431. return c
  23432. }
  23433. // Context sets the context to be used in this call's Do method. Any
  23434. // pending HTTP request will be aborted if the provided context is
  23435. // canceled.
  23436. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  23437. c.ctx_ = ctx
  23438. return c
  23439. }
  23440. // Header returns an http.Header that can be modified by the caller to
  23441. // add HTTP headers to the request.
  23442. func (c *CreativeFieldsListCall) Header() http.Header {
  23443. if c.header_ == nil {
  23444. c.header_ = make(http.Header)
  23445. }
  23446. return c.header_
  23447. }
  23448. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  23449. reqHeaders := make(http.Header)
  23450. for k, v := range c.header_ {
  23451. reqHeaders[k] = v
  23452. }
  23453. reqHeaders.Set("User-Agent", c.s.userAgent())
  23454. if c.ifNoneMatch_ != "" {
  23455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23456. }
  23457. var body io.Reader = nil
  23458. c.urlParams_.Set("alt", alt)
  23459. c.urlParams_.Set("prettyPrint", "false")
  23460. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23461. urls += "?" + c.urlParams_.Encode()
  23462. req, err := http.NewRequest("GET", urls, body)
  23463. if err != nil {
  23464. return nil, err
  23465. }
  23466. req.Header = reqHeaders
  23467. googleapi.Expand(req.URL, map[string]string{
  23468. "profileId": strconv.FormatInt(c.profileId, 10),
  23469. })
  23470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23471. }
  23472. // Do executes the "dfareporting.creativeFields.list" call.
  23473. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  23474. // Any non-2xx status code is an error. Response headers are in either
  23475. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  23476. // was returned at all) in error.(*googleapi.Error).Header. Use
  23477. // googleapi.IsNotModified to check whether the returned error was
  23478. // because http.StatusNotModified was returned.
  23479. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  23480. gensupport.SetOptions(c.urlParams_, opts...)
  23481. res, err := c.doRequest("json")
  23482. if res != nil && res.StatusCode == http.StatusNotModified {
  23483. if res.Body != nil {
  23484. res.Body.Close()
  23485. }
  23486. return nil, &googleapi.Error{
  23487. Code: res.StatusCode,
  23488. Header: res.Header,
  23489. }
  23490. }
  23491. if err != nil {
  23492. return nil, err
  23493. }
  23494. defer googleapi.CloseBody(res)
  23495. if err := googleapi.CheckResponse(res); err != nil {
  23496. return nil, err
  23497. }
  23498. ret := &CreativeFieldsListResponse{
  23499. ServerResponse: googleapi.ServerResponse{
  23500. Header: res.Header,
  23501. HTTPStatusCode: res.StatusCode,
  23502. },
  23503. }
  23504. target := &ret
  23505. if err := gensupport.DecodeResponse(target, res); err != nil {
  23506. return nil, err
  23507. }
  23508. return ret, nil
  23509. // {
  23510. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  23511. // "httpMethod": "GET",
  23512. // "id": "dfareporting.creativeFields.list",
  23513. // "parameterOrder": [
  23514. // "profileId"
  23515. // ],
  23516. // "parameters": {
  23517. // "advertiserIds": {
  23518. // "description": "Select only creative fields that belong to these advertisers.",
  23519. // "format": "int64",
  23520. // "location": "query",
  23521. // "repeated": true,
  23522. // "type": "string"
  23523. // },
  23524. // "ids": {
  23525. // "description": "Select only creative fields with these IDs.",
  23526. // "format": "int64",
  23527. // "location": "query",
  23528. // "repeated": true,
  23529. // "type": "string"
  23530. // },
  23531. // "maxResults": {
  23532. // "default": "1000",
  23533. // "description": "Maximum number of results to return.",
  23534. // "format": "int32",
  23535. // "location": "query",
  23536. // "maximum": "1000",
  23537. // "minimum": "0",
  23538. // "type": "integer"
  23539. // },
  23540. // "pageToken": {
  23541. // "description": "Value of the nextPageToken from the previous result page.",
  23542. // "location": "query",
  23543. // "type": "string"
  23544. // },
  23545. // "profileId": {
  23546. // "description": "User profile ID associated with this request.",
  23547. // "format": "int64",
  23548. // "location": "path",
  23549. // "required": true,
  23550. // "type": "string"
  23551. // },
  23552. // "searchString": {
  23553. // "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\".",
  23554. // "location": "query",
  23555. // "type": "string"
  23556. // },
  23557. // "sortField": {
  23558. // "default": "ID",
  23559. // "description": "Field by which to sort the list.",
  23560. // "enum": [
  23561. // "ID",
  23562. // "NAME"
  23563. // ],
  23564. // "enumDescriptions": [
  23565. // "",
  23566. // ""
  23567. // ],
  23568. // "location": "query",
  23569. // "type": "string"
  23570. // },
  23571. // "sortOrder": {
  23572. // "default": "ASCENDING",
  23573. // "description": "Order of sorted results.",
  23574. // "enum": [
  23575. // "ASCENDING",
  23576. // "DESCENDING"
  23577. // ],
  23578. // "enumDescriptions": [
  23579. // "",
  23580. // ""
  23581. // ],
  23582. // "location": "query",
  23583. // "type": "string"
  23584. // }
  23585. // },
  23586. // "path": "userprofiles/{profileId}/creativeFields",
  23587. // "response": {
  23588. // "$ref": "CreativeFieldsListResponse"
  23589. // },
  23590. // "scopes": [
  23591. // "https://www.googleapis.com/auth/dfatrafficking"
  23592. // ]
  23593. // }
  23594. }
  23595. // Pages invokes f for each page of results.
  23596. // A non-nil error returned from f will halt the iteration.
  23597. // The provided context supersedes any context provided to the Context method.
  23598. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  23599. c.ctx_ = ctx
  23600. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23601. for {
  23602. x, err := c.Do()
  23603. if err != nil {
  23604. return err
  23605. }
  23606. if err := f(x); err != nil {
  23607. return err
  23608. }
  23609. if x.NextPageToken == "" {
  23610. return nil
  23611. }
  23612. c.PageToken(x.NextPageToken)
  23613. }
  23614. }
  23615. // method id "dfareporting.creativeFields.patch":
  23616. type CreativeFieldsPatchCall struct {
  23617. s *Service
  23618. profileId int64
  23619. creativefield *CreativeField
  23620. urlParams_ gensupport.URLParams
  23621. ctx_ context.Context
  23622. header_ http.Header
  23623. }
  23624. // Patch: Updates an existing creative field. This method supports patch
  23625. // semantics.
  23626. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  23627. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23628. c.profileId = profileId
  23629. c.urlParams_.Set("id", fmt.Sprint(id))
  23630. c.creativefield = creativefield
  23631. return c
  23632. }
  23633. // Fields allows partial responses to be retrieved. See
  23634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23635. // for more information.
  23636. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  23637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23638. return c
  23639. }
  23640. // Context sets the context to be used in this call's Do method. Any
  23641. // pending HTTP request will be aborted if the provided context is
  23642. // canceled.
  23643. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  23644. c.ctx_ = ctx
  23645. return c
  23646. }
  23647. // Header returns an http.Header that can be modified by the caller to
  23648. // add HTTP headers to the request.
  23649. func (c *CreativeFieldsPatchCall) Header() http.Header {
  23650. if c.header_ == nil {
  23651. c.header_ = make(http.Header)
  23652. }
  23653. return c.header_
  23654. }
  23655. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  23656. reqHeaders := make(http.Header)
  23657. for k, v := range c.header_ {
  23658. reqHeaders[k] = v
  23659. }
  23660. reqHeaders.Set("User-Agent", c.s.userAgent())
  23661. var body io.Reader = nil
  23662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23663. if err != nil {
  23664. return nil, err
  23665. }
  23666. reqHeaders.Set("Content-Type", "application/json")
  23667. c.urlParams_.Set("alt", alt)
  23668. c.urlParams_.Set("prettyPrint", "false")
  23669. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23670. urls += "?" + c.urlParams_.Encode()
  23671. req, err := http.NewRequest("PATCH", urls, body)
  23672. if err != nil {
  23673. return nil, err
  23674. }
  23675. req.Header = reqHeaders
  23676. googleapi.Expand(req.URL, map[string]string{
  23677. "profileId": strconv.FormatInt(c.profileId, 10),
  23678. })
  23679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23680. }
  23681. // Do executes the "dfareporting.creativeFields.patch" call.
  23682. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23683. // status code is an error. Response headers are in either
  23684. // *CreativeField.ServerResponse.Header or (if a response was returned
  23685. // at all) in error.(*googleapi.Error).Header. Use
  23686. // googleapi.IsNotModified to check whether the returned error was
  23687. // because http.StatusNotModified was returned.
  23688. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23689. gensupport.SetOptions(c.urlParams_, opts...)
  23690. res, err := c.doRequest("json")
  23691. if res != nil && res.StatusCode == http.StatusNotModified {
  23692. if res.Body != nil {
  23693. res.Body.Close()
  23694. }
  23695. return nil, &googleapi.Error{
  23696. Code: res.StatusCode,
  23697. Header: res.Header,
  23698. }
  23699. }
  23700. if err != nil {
  23701. return nil, err
  23702. }
  23703. defer googleapi.CloseBody(res)
  23704. if err := googleapi.CheckResponse(res); err != nil {
  23705. return nil, err
  23706. }
  23707. ret := &CreativeField{
  23708. ServerResponse: googleapi.ServerResponse{
  23709. Header: res.Header,
  23710. HTTPStatusCode: res.StatusCode,
  23711. },
  23712. }
  23713. target := &ret
  23714. if err := gensupport.DecodeResponse(target, res); err != nil {
  23715. return nil, err
  23716. }
  23717. return ret, nil
  23718. // {
  23719. // "description": "Updates an existing creative field. This method supports patch semantics.",
  23720. // "httpMethod": "PATCH",
  23721. // "id": "dfareporting.creativeFields.patch",
  23722. // "parameterOrder": [
  23723. // "profileId",
  23724. // "id"
  23725. // ],
  23726. // "parameters": {
  23727. // "id": {
  23728. // "description": "Creative Field ID",
  23729. // "format": "int64",
  23730. // "location": "query",
  23731. // "required": true,
  23732. // "type": "string"
  23733. // },
  23734. // "profileId": {
  23735. // "description": "User profile ID associated with this request.",
  23736. // "format": "int64",
  23737. // "location": "path",
  23738. // "required": true,
  23739. // "type": "string"
  23740. // }
  23741. // },
  23742. // "path": "userprofiles/{profileId}/creativeFields",
  23743. // "request": {
  23744. // "$ref": "CreativeField"
  23745. // },
  23746. // "response": {
  23747. // "$ref": "CreativeField"
  23748. // },
  23749. // "scopes": [
  23750. // "https://www.googleapis.com/auth/dfatrafficking"
  23751. // ]
  23752. // }
  23753. }
  23754. // method id "dfareporting.creativeFields.update":
  23755. type CreativeFieldsUpdateCall struct {
  23756. s *Service
  23757. profileId int64
  23758. creativefield *CreativeField
  23759. urlParams_ gensupport.URLParams
  23760. ctx_ context.Context
  23761. header_ http.Header
  23762. }
  23763. // Update: Updates an existing creative field.
  23764. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  23765. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23766. c.profileId = profileId
  23767. c.creativefield = creativefield
  23768. return c
  23769. }
  23770. // Fields allows partial responses to be retrieved. See
  23771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23772. // for more information.
  23773. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  23774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23775. return c
  23776. }
  23777. // Context sets the context to be used in this call's Do method. Any
  23778. // pending HTTP request will be aborted if the provided context is
  23779. // canceled.
  23780. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  23781. c.ctx_ = ctx
  23782. return c
  23783. }
  23784. // Header returns an http.Header that can be modified by the caller to
  23785. // add HTTP headers to the request.
  23786. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  23787. if c.header_ == nil {
  23788. c.header_ = make(http.Header)
  23789. }
  23790. return c.header_
  23791. }
  23792. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23793. reqHeaders := make(http.Header)
  23794. for k, v := range c.header_ {
  23795. reqHeaders[k] = v
  23796. }
  23797. reqHeaders.Set("User-Agent", c.s.userAgent())
  23798. var body io.Reader = nil
  23799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23800. if err != nil {
  23801. return nil, err
  23802. }
  23803. reqHeaders.Set("Content-Type", "application/json")
  23804. c.urlParams_.Set("alt", alt)
  23805. c.urlParams_.Set("prettyPrint", "false")
  23806. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23807. urls += "?" + c.urlParams_.Encode()
  23808. req, err := http.NewRequest("PUT", urls, body)
  23809. if err != nil {
  23810. return nil, err
  23811. }
  23812. req.Header = reqHeaders
  23813. googleapi.Expand(req.URL, map[string]string{
  23814. "profileId": strconv.FormatInt(c.profileId, 10),
  23815. })
  23816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23817. }
  23818. // Do executes the "dfareporting.creativeFields.update" call.
  23819. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23820. // status code is an error. Response headers are in either
  23821. // *CreativeField.ServerResponse.Header or (if a response was returned
  23822. // at all) in error.(*googleapi.Error).Header. Use
  23823. // googleapi.IsNotModified to check whether the returned error was
  23824. // because http.StatusNotModified was returned.
  23825. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23826. gensupport.SetOptions(c.urlParams_, opts...)
  23827. res, err := c.doRequest("json")
  23828. if res != nil && res.StatusCode == http.StatusNotModified {
  23829. if res.Body != nil {
  23830. res.Body.Close()
  23831. }
  23832. return nil, &googleapi.Error{
  23833. Code: res.StatusCode,
  23834. Header: res.Header,
  23835. }
  23836. }
  23837. if err != nil {
  23838. return nil, err
  23839. }
  23840. defer googleapi.CloseBody(res)
  23841. if err := googleapi.CheckResponse(res); err != nil {
  23842. return nil, err
  23843. }
  23844. ret := &CreativeField{
  23845. ServerResponse: googleapi.ServerResponse{
  23846. Header: res.Header,
  23847. HTTPStatusCode: res.StatusCode,
  23848. },
  23849. }
  23850. target := &ret
  23851. if err := gensupport.DecodeResponse(target, res); err != nil {
  23852. return nil, err
  23853. }
  23854. return ret, nil
  23855. // {
  23856. // "description": "Updates an existing creative field.",
  23857. // "httpMethod": "PUT",
  23858. // "id": "dfareporting.creativeFields.update",
  23859. // "parameterOrder": [
  23860. // "profileId"
  23861. // ],
  23862. // "parameters": {
  23863. // "profileId": {
  23864. // "description": "User profile ID associated with this request.",
  23865. // "format": "int64",
  23866. // "location": "path",
  23867. // "required": true,
  23868. // "type": "string"
  23869. // }
  23870. // },
  23871. // "path": "userprofiles/{profileId}/creativeFields",
  23872. // "request": {
  23873. // "$ref": "CreativeField"
  23874. // },
  23875. // "response": {
  23876. // "$ref": "CreativeField"
  23877. // },
  23878. // "scopes": [
  23879. // "https://www.googleapis.com/auth/dfatrafficking"
  23880. // ]
  23881. // }
  23882. }
  23883. // method id "dfareporting.creativeGroups.get":
  23884. type CreativeGroupsGetCall struct {
  23885. s *Service
  23886. profileId int64
  23887. id int64
  23888. urlParams_ gensupport.URLParams
  23889. ifNoneMatch_ string
  23890. ctx_ context.Context
  23891. header_ http.Header
  23892. }
  23893. // Get: Gets one creative group by ID.
  23894. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  23895. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23896. c.profileId = profileId
  23897. c.id = id
  23898. return c
  23899. }
  23900. // Fields allows partial responses to be retrieved. See
  23901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23902. // for more information.
  23903. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  23904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23905. return c
  23906. }
  23907. // IfNoneMatch sets the optional parameter which makes the operation
  23908. // fail if the object's ETag matches the given value. This is useful for
  23909. // getting updates only after the object has changed since the last
  23910. // request. Use googleapi.IsNotModified to check whether the response
  23911. // error from Do is the result of In-None-Match.
  23912. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  23913. c.ifNoneMatch_ = entityTag
  23914. return c
  23915. }
  23916. // Context sets the context to be used in this call's Do method. Any
  23917. // pending HTTP request will be aborted if the provided context is
  23918. // canceled.
  23919. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  23920. c.ctx_ = ctx
  23921. return c
  23922. }
  23923. // Header returns an http.Header that can be modified by the caller to
  23924. // add HTTP headers to the request.
  23925. func (c *CreativeGroupsGetCall) Header() http.Header {
  23926. if c.header_ == nil {
  23927. c.header_ = make(http.Header)
  23928. }
  23929. return c.header_
  23930. }
  23931. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  23932. reqHeaders := make(http.Header)
  23933. for k, v := range c.header_ {
  23934. reqHeaders[k] = v
  23935. }
  23936. reqHeaders.Set("User-Agent", c.s.userAgent())
  23937. if c.ifNoneMatch_ != "" {
  23938. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23939. }
  23940. var body io.Reader = nil
  23941. c.urlParams_.Set("alt", alt)
  23942. c.urlParams_.Set("prettyPrint", "false")
  23943. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  23944. urls += "?" + c.urlParams_.Encode()
  23945. req, err := http.NewRequest("GET", urls, body)
  23946. if err != nil {
  23947. return nil, err
  23948. }
  23949. req.Header = reqHeaders
  23950. googleapi.Expand(req.URL, map[string]string{
  23951. "profileId": strconv.FormatInt(c.profileId, 10),
  23952. "id": strconv.FormatInt(c.id, 10),
  23953. })
  23954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23955. }
  23956. // Do executes the "dfareporting.creativeGroups.get" call.
  23957. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23958. // status code is an error. Response headers are in either
  23959. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23960. // at all) in error.(*googleapi.Error).Header. Use
  23961. // googleapi.IsNotModified to check whether the returned error was
  23962. // because http.StatusNotModified was returned.
  23963. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23964. gensupport.SetOptions(c.urlParams_, opts...)
  23965. res, err := c.doRequest("json")
  23966. if res != nil && res.StatusCode == http.StatusNotModified {
  23967. if res.Body != nil {
  23968. res.Body.Close()
  23969. }
  23970. return nil, &googleapi.Error{
  23971. Code: res.StatusCode,
  23972. Header: res.Header,
  23973. }
  23974. }
  23975. if err != nil {
  23976. return nil, err
  23977. }
  23978. defer googleapi.CloseBody(res)
  23979. if err := googleapi.CheckResponse(res); err != nil {
  23980. return nil, err
  23981. }
  23982. ret := &CreativeGroup{
  23983. ServerResponse: googleapi.ServerResponse{
  23984. Header: res.Header,
  23985. HTTPStatusCode: res.StatusCode,
  23986. },
  23987. }
  23988. target := &ret
  23989. if err := gensupport.DecodeResponse(target, res); err != nil {
  23990. return nil, err
  23991. }
  23992. return ret, nil
  23993. // {
  23994. // "description": "Gets one creative group by ID.",
  23995. // "httpMethod": "GET",
  23996. // "id": "dfareporting.creativeGroups.get",
  23997. // "parameterOrder": [
  23998. // "profileId",
  23999. // "id"
  24000. // ],
  24001. // "parameters": {
  24002. // "id": {
  24003. // "description": "Creative group ID.",
  24004. // "format": "int64",
  24005. // "location": "path",
  24006. // "required": true,
  24007. // "type": "string"
  24008. // },
  24009. // "profileId": {
  24010. // "description": "User profile ID associated with this request.",
  24011. // "format": "int64",
  24012. // "location": "path",
  24013. // "required": true,
  24014. // "type": "string"
  24015. // }
  24016. // },
  24017. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  24018. // "response": {
  24019. // "$ref": "CreativeGroup"
  24020. // },
  24021. // "scopes": [
  24022. // "https://www.googleapis.com/auth/dfatrafficking"
  24023. // ]
  24024. // }
  24025. }
  24026. // method id "dfareporting.creativeGroups.insert":
  24027. type CreativeGroupsInsertCall struct {
  24028. s *Service
  24029. profileId int64
  24030. creativegroup *CreativeGroup
  24031. urlParams_ gensupport.URLParams
  24032. ctx_ context.Context
  24033. header_ http.Header
  24034. }
  24035. // Insert: Inserts a new creative group.
  24036. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  24037. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24038. c.profileId = profileId
  24039. c.creativegroup = creativegroup
  24040. return c
  24041. }
  24042. // Fields allows partial responses to be retrieved. See
  24043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24044. // for more information.
  24045. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  24046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24047. return c
  24048. }
  24049. // Context sets the context to be used in this call's Do method. Any
  24050. // pending HTTP request will be aborted if the provided context is
  24051. // canceled.
  24052. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  24053. c.ctx_ = ctx
  24054. return c
  24055. }
  24056. // Header returns an http.Header that can be modified by the caller to
  24057. // add HTTP headers to the request.
  24058. func (c *CreativeGroupsInsertCall) Header() http.Header {
  24059. if c.header_ == nil {
  24060. c.header_ = make(http.Header)
  24061. }
  24062. return c.header_
  24063. }
  24064. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  24065. reqHeaders := make(http.Header)
  24066. for k, v := range c.header_ {
  24067. reqHeaders[k] = v
  24068. }
  24069. reqHeaders.Set("User-Agent", c.s.userAgent())
  24070. var body io.Reader = nil
  24071. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24072. if err != nil {
  24073. return nil, err
  24074. }
  24075. reqHeaders.Set("Content-Type", "application/json")
  24076. c.urlParams_.Set("alt", alt)
  24077. c.urlParams_.Set("prettyPrint", "false")
  24078. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24079. urls += "?" + c.urlParams_.Encode()
  24080. req, err := http.NewRequest("POST", urls, body)
  24081. if err != nil {
  24082. return nil, err
  24083. }
  24084. req.Header = reqHeaders
  24085. googleapi.Expand(req.URL, map[string]string{
  24086. "profileId": strconv.FormatInt(c.profileId, 10),
  24087. })
  24088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24089. }
  24090. // Do executes the "dfareporting.creativeGroups.insert" call.
  24091. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24092. // status code is an error. Response headers are in either
  24093. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24094. // at all) in error.(*googleapi.Error).Header. Use
  24095. // googleapi.IsNotModified to check whether the returned error was
  24096. // because http.StatusNotModified was returned.
  24097. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24098. gensupport.SetOptions(c.urlParams_, opts...)
  24099. res, err := c.doRequest("json")
  24100. if res != nil && res.StatusCode == http.StatusNotModified {
  24101. if res.Body != nil {
  24102. res.Body.Close()
  24103. }
  24104. return nil, &googleapi.Error{
  24105. Code: res.StatusCode,
  24106. Header: res.Header,
  24107. }
  24108. }
  24109. if err != nil {
  24110. return nil, err
  24111. }
  24112. defer googleapi.CloseBody(res)
  24113. if err := googleapi.CheckResponse(res); err != nil {
  24114. return nil, err
  24115. }
  24116. ret := &CreativeGroup{
  24117. ServerResponse: googleapi.ServerResponse{
  24118. Header: res.Header,
  24119. HTTPStatusCode: res.StatusCode,
  24120. },
  24121. }
  24122. target := &ret
  24123. if err := gensupport.DecodeResponse(target, res); err != nil {
  24124. return nil, err
  24125. }
  24126. return ret, nil
  24127. // {
  24128. // "description": "Inserts a new creative group.",
  24129. // "httpMethod": "POST",
  24130. // "id": "dfareporting.creativeGroups.insert",
  24131. // "parameterOrder": [
  24132. // "profileId"
  24133. // ],
  24134. // "parameters": {
  24135. // "profileId": {
  24136. // "description": "User profile ID associated with this request.",
  24137. // "format": "int64",
  24138. // "location": "path",
  24139. // "required": true,
  24140. // "type": "string"
  24141. // }
  24142. // },
  24143. // "path": "userprofiles/{profileId}/creativeGroups",
  24144. // "request": {
  24145. // "$ref": "CreativeGroup"
  24146. // },
  24147. // "response": {
  24148. // "$ref": "CreativeGroup"
  24149. // },
  24150. // "scopes": [
  24151. // "https://www.googleapis.com/auth/dfatrafficking"
  24152. // ]
  24153. // }
  24154. }
  24155. // method id "dfareporting.creativeGroups.list":
  24156. type CreativeGroupsListCall struct {
  24157. s *Service
  24158. profileId int64
  24159. urlParams_ gensupport.URLParams
  24160. ifNoneMatch_ string
  24161. ctx_ context.Context
  24162. header_ http.Header
  24163. }
  24164. // List: Retrieves a list of creative groups, possibly filtered. This
  24165. // method supports paging.
  24166. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  24167. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24168. c.profileId = profileId
  24169. return c
  24170. }
  24171. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  24172. // only creative groups that belong to these advertisers.
  24173. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  24174. var advertiserIds_ []string
  24175. for _, v := range advertiserIds {
  24176. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  24177. }
  24178. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  24179. return c
  24180. }
  24181. // GroupNumber sets the optional parameter "groupNumber": Select only
  24182. // creative groups that belong to this subgroup.
  24183. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  24184. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  24185. return c
  24186. }
  24187. // Ids sets the optional parameter "ids": Select only creative groups
  24188. // with these IDs.
  24189. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  24190. var ids_ []string
  24191. for _, v := range ids {
  24192. ids_ = append(ids_, fmt.Sprint(v))
  24193. }
  24194. c.urlParams_.SetMulti("ids", ids_)
  24195. return c
  24196. }
  24197. // MaxResults sets the optional parameter "maxResults": Maximum number
  24198. // of results to return.
  24199. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  24200. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24201. return c
  24202. }
  24203. // PageToken sets the optional parameter "pageToken": Value of the
  24204. // nextPageToken from the previous result page.
  24205. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  24206. c.urlParams_.Set("pageToken", pageToken)
  24207. return c
  24208. }
  24209. // SearchString sets the optional parameter "searchString": Allows
  24210. // searching for creative groups by name or ID. Wildcards (*) are
  24211. // allowed. For example, "creativegroup*2015" will return creative
  24212. // groups with names like "creativegroup June 2015", "creativegroup
  24213. // April 2015", or simply "creativegroup 2015". Most of the searches
  24214. // also add wild-cards implicitly at the start and the end of the search
  24215. // string. For example, a search string of "creativegroup" will match
  24216. // creative groups with the name "my creativegroup", "creativegroup
  24217. // 2015", or simply "creativegroup".
  24218. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  24219. c.urlParams_.Set("searchString", searchString)
  24220. return c
  24221. }
  24222. // SortField sets the optional parameter "sortField": Field by which to
  24223. // sort the list.
  24224. //
  24225. // Possible values:
  24226. // "ID" (default)
  24227. // "NAME"
  24228. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  24229. c.urlParams_.Set("sortField", sortField)
  24230. return c
  24231. }
  24232. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24233. // results.
  24234. //
  24235. // Possible values:
  24236. // "ASCENDING" (default)
  24237. // "DESCENDING"
  24238. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  24239. c.urlParams_.Set("sortOrder", sortOrder)
  24240. return c
  24241. }
  24242. // Fields allows partial responses to be retrieved. See
  24243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24244. // for more information.
  24245. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  24246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24247. return c
  24248. }
  24249. // IfNoneMatch sets the optional parameter which makes the operation
  24250. // fail if the object's ETag matches the given value. This is useful for
  24251. // getting updates only after the object has changed since the last
  24252. // request. Use googleapi.IsNotModified to check whether the response
  24253. // error from Do is the result of In-None-Match.
  24254. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  24255. c.ifNoneMatch_ = entityTag
  24256. return c
  24257. }
  24258. // Context sets the context to be used in this call's Do method. Any
  24259. // pending HTTP request will be aborted if the provided context is
  24260. // canceled.
  24261. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  24262. c.ctx_ = ctx
  24263. return c
  24264. }
  24265. // Header returns an http.Header that can be modified by the caller to
  24266. // add HTTP headers to the request.
  24267. func (c *CreativeGroupsListCall) Header() http.Header {
  24268. if c.header_ == nil {
  24269. c.header_ = make(http.Header)
  24270. }
  24271. return c.header_
  24272. }
  24273. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  24274. reqHeaders := make(http.Header)
  24275. for k, v := range c.header_ {
  24276. reqHeaders[k] = v
  24277. }
  24278. reqHeaders.Set("User-Agent", c.s.userAgent())
  24279. if c.ifNoneMatch_ != "" {
  24280. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24281. }
  24282. var body io.Reader = nil
  24283. c.urlParams_.Set("alt", alt)
  24284. c.urlParams_.Set("prettyPrint", "false")
  24285. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24286. urls += "?" + c.urlParams_.Encode()
  24287. req, err := http.NewRequest("GET", urls, body)
  24288. if err != nil {
  24289. return nil, err
  24290. }
  24291. req.Header = reqHeaders
  24292. googleapi.Expand(req.URL, map[string]string{
  24293. "profileId": strconv.FormatInt(c.profileId, 10),
  24294. })
  24295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24296. }
  24297. // Do executes the "dfareporting.creativeGroups.list" call.
  24298. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  24299. // Any non-2xx status code is an error. Response headers are in either
  24300. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  24301. // was returned at all) in error.(*googleapi.Error).Header. Use
  24302. // googleapi.IsNotModified to check whether the returned error was
  24303. // because http.StatusNotModified was returned.
  24304. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  24305. gensupport.SetOptions(c.urlParams_, opts...)
  24306. res, err := c.doRequest("json")
  24307. if res != nil && res.StatusCode == http.StatusNotModified {
  24308. if res.Body != nil {
  24309. res.Body.Close()
  24310. }
  24311. return nil, &googleapi.Error{
  24312. Code: res.StatusCode,
  24313. Header: res.Header,
  24314. }
  24315. }
  24316. if err != nil {
  24317. return nil, err
  24318. }
  24319. defer googleapi.CloseBody(res)
  24320. if err := googleapi.CheckResponse(res); err != nil {
  24321. return nil, err
  24322. }
  24323. ret := &CreativeGroupsListResponse{
  24324. ServerResponse: googleapi.ServerResponse{
  24325. Header: res.Header,
  24326. HTTPStatusCode: res.StatusCode,
  24327. },
  24328. }
  24329. target := &ret
  24330. if err := gensupport.DecodeResponse(target, res); err != nil {
  24331. return nil, err
  24332. }
  24333. return ret, nil
  24334. // {
  24335. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  24336. // "httpMethod": "GET",
  24337. // "id": "dfareporting.creativeGroups.list",
  24338. // "parameterOrder": [
  24339. // "profileId"
  24340. // ],
  24341. // "parameters": {
  24342. // "advertiserIds": {
  24343. // "description": "Select only creative groups that belong to these advertisers.",
  24344. // "format": "int64",
  24345. // "location": "query",
  24346. // "repeated": true,
  24347. // "type": "string"
  24348. // },
  24349. // "groupNumber": {
  24350. // "description": "Select only creative groups that belong to this subgroup.",
  24351. // "format": "int32",
  24352. // "location": "query",
  24353. // "maximum": "2",
  24354. // "minimum": "1",
  24355. // "type": "integer"
  24356. // },
  24357. // "ids": {
  24358. // "description": "Select only creative groups with these IDs.",
  24359. // "format": "int64",
  24360. // "location": "query",
  24361. // "repeated": true,
  24362. // "type": "string"
  24363. // },
  24364. // "maxResults": {
  24365. // "default": "1000",
  24366. // "description": "Maximum number of results to return.",
  24367. // "format": "int32",
  24368. // "location": "query",
  24369. // "maximum": "1000",
  24370. // "minimum": "0",
  24371. // "type": "integer"
  24372. // },
  24373. // "pageToken": {
  24374. // "description": "Value of the nextPageToken from the previous result page.",
  24375. // "location": "query",
  24376. // "type": "string"
  24377. // },
  24378. // "profileId": {
  24379. // "description": "User profile ID associated with this request.",
  24380. // "format": "int64",
  24381. // "location": "path",
  24382. // "required": true,
  24383. // "type": "string"
  24384. // },
  24385. // "searchString": {
  24386. // "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\".",
  24387. // "location": "query",
  24388. // "type": "string"
  24389. // },
  24390. // "sortField": {
  24391. // "default": "ID",
  24392. // "description": "Field by which to sort the list.",
  24393. // "enum": [
  24394. // "ID",
  24395. // "NAME"
  24396. // ],
  24397. // "enumDescriptions": [
  24398. // "",
  24399. // ""
  24400. // ],
  24401. // "location": "query",
  24402. // "type": "string"
  24403. // },
  24404. // "sortOrder": {
  24405. // "default": "ASCENDING",
  24406. // "description": "Order of sorted results.",
  24407. // "enum": [
  24408. // "ASCENDING",
  24409. // "DESCENDING"
  24410. // ],
  24411. // "enumDescriptions": [
  24412. // "",
  24413. // ""
  24414. // ],
  24415. // "location": "query",
  24416. // "type": "string"
  24417. // }
  24418. // },
  24419. // "path": "userprofiles/{profileId}/creativeGroups",
  24420. // "response": {
  24421. // "$ref": "CreativeGroupsListResponse"
  24422. // },
  24423. // "scopes": [
  24424. // "https://www.googleapis.com/auth/dfatrafficking"
  24425. // ]
  24426. // }
  24427. }
  24428. // Pages invokes f for each page of results.
  24429. // A non-nil error returned from f will halt the iteration.
  24430. // The provided context supersedes any context provided to the Context method.
  24431. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  24432. c.ctx_ = ctx
  24433. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24434. for {
  24435. x, err := c.Do()
  24436. if err != nil {
  24437. return err
  24438. }
  24439. if err := f(x); err != nil {
  24440. return err
  24441. }
  24442. if x.NextPageToken == "" {
  24443. return nil
  24444. }
  24445. c.PageToken(x.NextPageToken)
  24446. }
  24447. }
  24448. // method id "dfareporting.creativeGroups.patch":
  24449. type CreativeGroupsPatchCall struct {
  24450. s *Service
  24451. profileId int64
  24452. creativegroup *CreativeGroup
  24453. urlParams_ gensupport.URLParams
  24454. ctx_ context.Context
  24455. header_ http.Header
  24456. }
  24457. // Patch: Updates an existing creative group. This method supports patch
  24458. // semantics.
  24459. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  24460. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24461. c.profileId = profileId
  24462. c.urlParams_.Set("id", fmt.Sprint(id))
  24463. c.creativegroup = creativegroup
  24464. return c
  24465. }
  24466. // Fields allows partial responses to be retrieved. See
  24467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24468. // for more information.
  24469. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  24470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24471. return c
  24472. }
  24473. // Context sets the context to be used in this call's Do method. Any
  24474. // pending HTTP request will be aborted if the provided context is
  24475. // canceled.
  24476. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  24477. c.ctx_ = ctx
  24478. return c
  24479. }
  24480. // Header returns an http.Header that can be modified by the caller to
  24481. // add HTTP headers to the request.
  24482. func (c *CreativeGroupsPatchCall) Header() http.Header {
  24483. if c.header_ == nil {
  24484. c.header_ = make(http.Header)
  24485. }
  24486. return c.header_
  24487. }
  24488. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  24489. reqHeaders := make(http.Header)
  24490. for k, v := range c.header_ {
  24491. reqHeaders[k] = v
  24492. }
  24493. reqHeaders.Set("User-Agent", c.s.userAgent())
  24494. var body io.Reader = nil
  24495. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24496. if err != nil {
  24497. return nil, err
  24498. }
  24499. reqHeaders.Set("Content-Type", "application/json")
  24500. c.urlParams_.Set("alt", alt)
  24501. c.urlParams_.Set("prettyPrint", "false")
  24502. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24503. urls += "?" + c.urlParams_.Encode()
  24504. req, err := http.NewRequest("PATCH", urls, body)
  24505. if err != nil {
  24506. return nil, err
  24507. }
  24508. req.Header = reqHeaders
  24509. googleapi.Expand(req.URL, map[string]string{
  24510. "profileId": strconv.FormatInt(c.profileId, 10),
  24511. })
  24512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24513. }
  24514. // Do executes the "dfareporting.creativeGroups.patch" call.
  24515. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24516. // status code is an error. Response headers are in either
  24517. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24518. // at all) in error.(*googleapi.Error).Header. Use
  24519. // googleapi.IsNotModified to check whether the returned error was
  24520. // because http.StatusNotModified was returned.
  24521. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24522. gensupport.SetOptions(c.urlParams_, opts...)
  24523. res, err := c.doRequest("json")
  24524. if res != nil && res.StatusCode == http.StatusNotModified {
  24525. if res.Body != nil {
  24526. res.Body.Close()
  24527. }
  24528. return nil, &googleapi.Error{
  24529. Code: res.StatusCode,
  24530. Header: res.Header,
  24531. }
  24532. }
  24533. if err != nil {
  24534. return nil, err
  24535. }
  24536. defer googleapi.CloseBody(res)
  24537. if err := googleapi.CheckResponse(res); err != nil {
  24538. return nil, err
  24539. }
  24540. ret := &CreativeGroup{
  24541. ServerResponse: googleapi.ServerResponse{
  24542. Header: res.Header,
  24543. HTTPStatusCode: res.StatusCode,
  24544. },
  24545. }
  24546. target := &ret
  24547. if err := gensupport.DecodeResponse(target, res); err != nil {
  24548. return nil, err
  24549. }
  24550. return ret, nil
  24551. // {
  24552. // "description": "Updates an existing creative group. This method supports patch semantics.",
  24553. // "httpMethod": "PATCH",
  24554. // "id": "dfareporting.creativeGroups.patch",
  24555. // "parameterOrder": [
  24556. // "profileId",
  24557. // "id"
  24558. // ],
  24559. // "parameters": {
  24560. // "id": {
  24561. // "description": "Creative group ID.",
  24562. // "format": "int64",
  24563. // "location": "query",
  24564. // "required": true,
  24565. // "type": "string"
  24566. // },
  24567. // "profileId": {
  24568. // "description": "User profile ID associated with this request.",
  24569. // "format": "int64",
  24570. // "location": "path",
  24571. // "required": true,
  24572. // "type": "string"
  24573. // }
  24574. // },
  24575. // "path": "userprofiles/{profileId}/creativeGroups",
  24576. // "request": {
  24577. // "$ref": "CreativeGroup"
  24578. // },
  24579. // "response": {
  24580. // "$ref": "CreativeGroup"
  24581. // },
  24582. // "scopes": [
  24583. // "https://www.googleapis.com/auth/dfatrafficking"
  24584. // ]
  24585. // }
  24586. }
  24587. // method id "dfareporting.creativeGroups.update":
  24588. type CreativeGroupsUpdateCall struct {
  24589. s *Service
  24590. profileId int64
  24591. creativegroup *CreativeGroup
  24592. urlParams_ gensupport.URLParams
  24593. ctx_ context.Context
  24594. header_ http.Header
  24595. }
  24596. // Update: Updates an existing creative group.
  24597. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  24598. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24599. c.profileId = profileId
  24600. c.creativegroup = creativegroup
  24601. return c
  24602. }
  24603. // Fields allows partial responses to be retrieved. See
  24604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24605. // for more information.
  24606. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  24607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24608. return c
  24609. }
  24610. // Context sets the context to be used in this call's Do method. Any
  24611. // pending HTTP request will be aborted if the provided context is
  24612. // canceled.
  24613. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  24614. c.ctx_ = ctx
  24615. return c
  24616. }
  24617. // Header returns an http.Header that can be modified by the caller to
  24618. // add HTTP headers to the request.
  24619. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  24620. if c.header_ == nil {
  24621. c.header_ = make(http.Header)
  24622. }
  24623. return c.header_
  24624. }
  24625. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  24626. reqHeaders := make(http.Header)
  24627. for k, v := range c.header_ {
  24628. reqHeaders[k] = v
  24629. }
  24630. reqHeaders.Set("User-Agent", c.s.userAgent())
  24631. var body io.Reader = nil
  24632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24633. if err != nil {
  24634. return nil, err
  24635. }
  24636. reqHeaders.Set("Content-Type", "application/json")
  24637. c.urlParams_.Set("alt", alt)
  24638. c.urlParams_.Set("prettyPrint", "false")
  24639. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24640. urls += "?" + c.urlParams_.Encode()
  24641. req, err := http.NewRequest("PUT", urls, body)
  24642. if err != nil {
  24643. return nil, err
  24644. }
  24645. req.Header = reqHeaders
  24646. googleapi.Expand(req.URL, map[string]string{
  24647. "profileId": strconv.FormatInt(c.profileId, 10),
  24648. })
  24649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24650. }
  24651. // Do executes the "dfareporting.creativeGroups.update" call.
  24652. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24653. // status code is an error. Response headers are in either
  24654. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24655. // at all) in error.(*googleapi.Error).Header. Use
  24656. // googleapi.IsNotModified to check whether the returned error was
  24657. // because http.StatusNotModified was returned.
  24658. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24659. gensupport.SetOptions(c.urlParams_, opts...)
  24660. res, err := c.doRequest("json")
  24661. if res != nil && res.StatusCode == http.StatusNotModified {
  24662. if res.Body != nil {
  24663. res.Body.Close()
  24664. }
  24665. return nil, &googleapi.Error{
  24666. Code: res.StatusCode,
  24667. Header: res.Header,
  24668. }
  24669. }
  24670. if err != nil {
  24671. return nil, err
  24672. }
  24673. defer googleapi.CloseBody(res)
  24674. if err := googleapi.CheckResponse(res); err != nil {
  24675. return nil, err
  24676. }
  24677. ret := &CreativeGroup{
  24678. ServerResponse: googleapi.ServerResponse{
  24679. Header: res.Header,
  24680. HTTPStatusCode: res.StatusCode,
  24681. },
  24682. }
  24683. target := &ret
  24684. if err := gensupport.DecodeResponse(target, res); err != nil {
  24685. return nil, err
  24686. }
  24687. return ret, nil
  24688. // {
  24689. // "description": "Updates an existing creative group.",
  24690. // "httpMethod": "PUT",
  24691. // "id": "dfareporting.creativeGroups.update",
  24692. // "parameterOrder": [
  24693. // "profileId"
  24694. // ],
  24695. // "parameters": {
  24696. // "profileId": {
  24697. // "description": "User profile ID associated with this request.",
  24698. // "format": "int64",
  24699. // "location": "path",
  24700. // "required": true,
  24701. // "type": "string"
  24702. // }
  24703. // },
  24704. // "path": "userprofiles/{profileId}/creativeGroups",
  24705. // "request": {
  24706. // "$ref": "CreativeGroup"
  24707. // },
  24708. // "response": {
  24709. // "$ref": "CreativeGroup"
  24710. // },
  24711. // "scopes": [
  24712. // "https://www.googleapis.com/auth/dfatrafficking"
  24713. // ]
  24714. // }
  24715. }
  24716. // method id "dfareporting.creatives.get":
  24717. type CreativesGetCall struct {
  24718. s *Service
  24719. profileId int64
  24720. id int64
  24721. urlParams_ gensupport.URLParams
  24722. ifNoneMatch_ string
  24723. ctx_ context.Context
  24724. header_ http.Header
  24725. }
  24726. // Get: Gets one creative by ID.
  24727. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  24728. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24729. c.profileId = profileId
  24730. c.id = id
  24731. return c
  24732. }
  24733. // Fields allows partial responses to be retrieved. See
  24734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24735. // for more information.
  24736. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  24737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24738. return c
  24739. }
  24740. // IfNoneMatch sets the optional parameter which makes the operation
  24741. // fail if the object's ETag matches the given value. This is useful for
  24742. // getting updates only after the object has changed since the last
  24743. // request. Use googleapi.IsNotModified to check whether the response
  24744. // error from Do is the result of In-None-Match.
  24745. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  24746. c.ifNoneMatch_ = entityTag
  24747. return c
  24748. }
  24749. // Context sets the context to be used in this call's Do method. Any
  24750. // pending HTTP request will be aborted if the provided context is
  24751. // canceled.
  24752. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  24753. c.ctx_ = ctx
  24754. return c
  24755. }
  24756. // Header returns an http.Header that can be modified by the caller to
  24757. // add HTTP headers to the request.
  24758. func (c *CreativesGetCall) Header() http.Header {
  24759. if c.header_ == nil {
  24760. c.header_ = make(http.Header)
  24761. }
  24762. return c.header_
  24763. }
  24764. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  24765. reqHeaders := make(http.Header)
  24766. for k, v := range c.header_ {
  24767. reqHeaders[k] = v
  24768. }
  24769. reqHeaders.Set("User-Agent", c.s.userAgent())
  24770. if c.ifNoneMatch_ != "" {
  24771. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24772. }
  24773. var body io.Reader = nil
  24774. c.urlParams_.Set("alt", alt)
  24775. c.urlParams_.Set("prettyPrint", "false")
  24776. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  24777. urls += "?" + c.urlParams_.Encode()
  24778. req, err := http.NewRequest("GET", urls, body)
  24779. if err != nil {
  24780. return nil, err
  24781. }
  24782. req.Header = reqHeaders
  24783. googleapi.Expand(req.URL, map[string]string{
  24784. "profileId": strconv.FormatInt(c.profileId, 10),
  24785. "id": strconv.FormatInt(c.id, 10),
  24786. })
  24787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24788. }
  24789. // Do executes the "dfareporting.creatives.get" call.
  24790. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24791. // code is an error. Response headers are in either
  24792. // *Creative.ServerResponse.Header or (if a response was returned at
  24793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24794. // to check whether the returned error was because
  24795. // http.StatusNotModified was returned.
  24796. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24797. gensupport.SetOptions(c.urlParams_, opts...)
  24798. res, err := c.doRequest("json")
  24799. if res != nil && res.StatusCode == http.StatusNotModified {
  24800. if res.Body != nil {
  24801. res.Body.Close()
  24802. }
  24803. return nil, &googleapi.Error{
  24804. Code: res.StatusCode,
  24805. Header: res.Header,
  24806. }
  24807. }
  24808. if err != nil {
  24809. return nil, err
  24810. }
  24811. defer googleapi.CloseBody(res)
  24812. if err := googleapi.CheckResponse(res); err != nil {
  24813. return nil, err
  24814. }
  24815. ret := &Creative{
  24816. ServerResponse: googleapi.ServerResponse{
  24817. Header: res.Header,
  24818. HTTPStatusCode: res.StatusCode,
  24819. },
  24820. }
  24821. target := &ret
  24822. if err := gensupport.DecodeResponse(target, res); err != nil {
  24823. return nil, err
  24824. }
  24825. return ret, nil
  24826. // {
  24827. // "description": "Gets one creative by ID.",
  24828. // "httpMethod": "GET",
  24829. // "id": "dfareporting.creatives.get",
  24830. // "parameterOrder": [
  24831. // "profileId",
  24832. // "id"
  24833. // ],
  24834. // "parameters": {
  24835. // "id": {
  24836. // "description": "Creative ID.",
  24837. // "format": "int64",
  24838. // "location": "path",
  24839. // "required": true,
  24840. // "type": "string"
  24841. // },
  24842. // "profileId": {
  24843. // "description": "User profile ID associated with this request.",
  24844. // "format": "int64",
  24845. // "location": "path",
  24846. // "required": true,
  24847. // "type": "string"
  24848. // }
  24849. // },
  24850. // "path": "userprofiles/{profileId}/creatives/{id}",
  24851. // "response": {
  24852. // "$ref": "Creative"
  24853. // },
  24854. // "scopes": [
  24855. // "https://www.googleapis.com/auth/dfatrafficking"
  24856. // ]
  24857. // }
  24858. }
  24859. // method id "dfareporting.creatives.insert":
  24860. type CreativesInsertCall struct {
  24861. s *Service
  24862. profileId int64
  24863. creative *Creative
  24864. urlParams_ gensupport.URLParams
  24865. ctx_ context.Context
  24866. header_ http.Header
  24867. }
  24868. // Insert: Inserts a new creative.
  24869. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  24870. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24871. c.profileId = profileId
  24872. c.creative = creative
  24873. return c
  24874. }
  24875. // Fields allows partial responses to be retrieved. See
  24876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24877. // for more information.
  24878. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  24879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24880. return c
  24881. }
  24882. // Context sets the context to be used in this call's Do method. Any
  24883. // pending HTTP request will be aborted if the provided context is
  24884. // canceled.
  24885. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  24886. c.ctx_ = ctx
  24887. return c
  24888. }
  24889. // Header returns an http.Header that can be modified by the caller to
  24890. // add HTTP headers to the request.
  24891. func (c *CreativesInsertCall) Header() http.Header {
  24892. if c.header_ == nil {
  24893. c.header_ = make(http.Header)
  24894. }
  24895. return c.header_
  24896. }
  24897. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  24898. reqHeaders := make(http.Header)
  24899. for k, v := range c.header_ {
  24900. reqHeaders[k] = v
  24901. }
  24902. reqHeaders.Set("User-Agent", c.s.userAgent())
  24903. var body io.Reader = nil
  24904. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24905. if err != nil {
  24906. return nil, err
  24907. }
  24908. reqHeaders.Set("Content-Type", "application/json")
  24909. c.urlParams_.Set("alt", alt)
  24910. c.urlParams_.Set("prettyPrint", "false")
  24911. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24912. urls += "?" + c.urlParams_.Encode()
  24913. req, err := http.NewRequest("POST", urls, body)
  24914. if err != nil {
  24915. return nil, err
  24916. }
  24917. req.Header = reqHeaders
  24918. googleapi.Expand(req.URL, map[string]string{
  24919. "profileId": strconv.FormatInt(c.profileId, 10),
  24920. })
  24921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24922. }
  24923. // Do executes the "dfareporting.creatives.insert" call.
  24924. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24925. // code is an error. Response headers are in either
  24926. // *Creative.ServerResponse.Header or (if a response was returned at
  24927. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24928. // to check whether the returned error was because
  24929. // http.StatusNotModified was returned.
  24930. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24931. gensupport.SetOptions(c.urlParams_, opts...)
  24932. res, err := c.doRequest("json")
  24933. if res != nil && res.StatusCode == http.StatusNotModified {
  24934. if res.Body != nil {
  24935. res.Body.Close()
  24936. }
  24937. return nil, &googleapi.Error{
  24938. Code: res.StatusCode,
  24939. Header: res.Header,
  24940. }
  24941. }
  24942. if err != nil {
  24943. return nil, err
  24944. }
  24945. defer googleapi.CloseBody(res)
  24946. if err := googleapi.CheckResponse(res); err != nil {
  24947. return nil, err
  24948. }
  24949. ret := &Creative{
  24950. ServerResponse: googleapi.ServerResponse{
  24951. Header: res.Header,
  24952. HTTPStatusCode: res.StatusCode,
  24953. },
  24954. }
  24955. target := &ret
  24956. if err := gensupport.DecodeResponse(target, res); err != nil {
  24957. return nil, err
  24958. }
  24959. return ret, nil
  24960. // {
  24961. // "description": "Inserts a new creative.",
  24962. // "httpMethod": "POST",
  24963. // "id": "dfareporting.creatives.insert",
  24964. // "parameterOrder": [
  24965. // "profileId"
  24966. // ],
  24967. // "parameters": {
  24968. // "profileId": {
  24969. // "description": "User profile ID associated with this request.",
  24970. // "format": "int64",
  24971. // "location": "path",
  24972. // "required": true,
  24973. // "type": "string"
  24974. // }
  24975. // },
  24976. // "path": "userprofiles/{profileId}/creatives",
  24977. // "request": {
  24978. // "$ref": "Creative"
  24979. // },
  24980. // "response": {
  24981. // "$ref": "Creative"
  24982. // },
  24983. // "scopes": [
  24984. // "https://www.googleapis.com/auth/dfatrafficking"
  24985. // ]
  24986. // }
  24987. }
  24988. // method id "dfareporting.creatives.list":
  24989. type CreativesListCall struct {
  24990. s *Service
  24991. profileId int64
  24992. urlParams_ gensupport.URLParams
  24993. ifNoneMatch_ string
  24994. ctx_ context.Context
  24995. header_ http.Header
  24996. }
  24997. // List: Retrieves a list of creatives, possibly filtered. This method
  24998. // supports paging.
  24999. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  25000. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25001. c.profileId = profileId
  25002. return c
  25003. }
  25004. // Active sets the optional parameter "active": Select only active
  25005. // creatives. Leave blank to select active and inactive creatives.
  25006. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  25007. c.urlParams_.Set("active", fmt.Sprint(active))
  25008. return c
  25009. }
  25010. // AdvertiserId sets the optional parameter "advertiserId": Select only
  25011. // creatives with this advertiser ID.
  25012. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  25013. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  25014. return c
  25015. }
  25016. // Archived sets the optional parameter "archived": Select only archived
  25017. // creatives. Leave blank to select archived and unarchived creatives.
  25018. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  25019. c.urlParams_.Set("archived", fmt.Sprint(archived))
  25020. return c
  25021. }
  25022. // CampaignId sets the optional parameter "campaignId": Select only
  25023. // creatives with this campaign ID.
  25024. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  25025. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  25026. return c
  25027. }
  25028. // CompanionCreativeIds sets the optional parameter
  25029. // "companionCreativeIds": Select only in-stream video creatives with
  25030. // these companion IDs.
  25031. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  25032. var companionCreativeIds_ []string
  25033. for _, v := range companionCreativeIds {
  25034. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  25035. }
  25036. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  25037. return c
  25038. }
  25039. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  25040. // Select only creatives with these creative field IDs.
  25041. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  25042. var creativeFieldIds_ []string
  25043. for _, v := range creativeFieldIds {
  25044. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  25045. }
  25046. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  25047. return c
  25048. }
  25049. // Ids sets the optional parameter "ids": Select only creatives with
  25050. // these IDs.
  25051. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  25052. var ids_ []string
  25053. for _, v := range ids {
  25054. ids_ = append(ids_, fmt.Sprint(v))
  25055. }
  25056. c.urlParams_.SetMulti("ids", ids_)
  25057. return c
  25058. }
  25059. // MaxResults sets the optional parameter "maxResults": Maximum number
  25060. // of results to return.
  25061. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  25062. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25063. return c
  25064. }
  25065. // PageToken sets the optional parameter "pageToken": Value of the
  25066. // nextPageToken from the previous result page.
  25067. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  25068. c.urlParams_.Set("pageToken", pageToken)
  25069. return c
  25070. }
  25071. // RenderingIds sets the optional parameter "renderingIds": Select only
  25072. // creatives with these rendering IDs.
  25073. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  25074. var renderingIds_ []string
  25075. for _, v := range renderingIds {
  25076. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  25077. }
  25078. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  25079. return c
  25080. }
  25081. // SearchString sets the optional parameter "searchString": Allows
  25082. // searching for objects by name or ID. Wildcards (*) are allowed. For
  25083. // example, "creative*2015" will return objects with names like
  25084. // "creative June 2015", "creative April 2015", or simply "creative
  25085. // 2015". Most of the searches also add wildcards implicitly at the
  25086. // start and the end of the search string. For example, a search string
  25087. // of "creative" will match objects with name "my creative", "creative
  25088. // 2015", or simply "creative".
  25089. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  25090. c.urlParams_.Set("searchString", searchString)
  25091. return c
  25092. }
  25093. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  25094. // with these size IDs.
  25095. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  25096. var sizeIds_ []string
  25097. for _, v := range sizeIds {
  25098. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  25099. }
  25100. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  25101. return c
  25102. }
  25103. // SortField sets the optional parameter "sortField": Field by which to
  25104. // sort the list.
  25105. //
  25106. // Possible values:
  25107. // "ID" (default)
  25108. // "NAME"
  25109. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  25110. c.urlParams_.Set("sortField", sortField)
  25111. return c
  25112. }
  25113. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  25114. // results.
  25115. //
  25116. // Possible values:
  25117. // "ASCENDING" (default)
  25118. // "DESCENDING"
  25119. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  25120. c.urlParams_.Set("sortOrder", sortOrder)
  25121. return c
  25122. }
  25123. // StudioCreativeId sets the optional parameter "studioCreativeId":
  25124. // Select only creatives corresponding to this Studio creative ID.
  25125. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  25126. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  25127. return c
  25128. }
  25129. // Types sets the optional parameter "types": Select only creatives with
  25130. // these creative types.
  25131. //
  25132. // Possible values:
  25133. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  25134. // "CUSTOM_DISPLAY"
  25135. // "CUSTOM_DISPLAY_INTERSTITIAL"
  25136. // "DISPLAY"
  25137. // "DISPLAY_IMAGE_GALLERY"
  25138. // "DISPLAY_REDIRECT"
  25139. // "FLASH_INPAGE"
  25140. // "HTML5_BANNER"
  25141. // "IMAGE"
  25142. // "INSTREAM_AUDIO"
  25143. // "INSTREAM_VIDEO"
  25144. // "INSTREAM_VIDEO_REDIRECT"
  25145. // "INTERNAL_REDIRECT"
  25146. // "INTERSTITIAL_INTERNAL_REDIRECT"
  25147. // "RICH_MEDIA_DISPLAY_BANNER"
  25148. // "RICH_MEDIA_DISPLAY_EXPANDING"
  25149. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  25150. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  25151. // "RICH_MEDIA_IM_EXPAND"
  25152. // "RICH_MEDIA_INPAGE_FLOATING"
  25153. // "RICH_MEDIA_MOBILE_IN_APP"
  25154. // "RICH_MEDIA_PEEL_DOWN"
  25155. // "TRACKING_TEXT"
  25156. // "VPAID_LINEAR_VIDEO"
  25157. // "VPAID_NON_LINEAR_VIDEO"
  25158. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  25159. c.urlParams_.SetMulti("types", append([]string{}, types...))
  25160. return c
  25161. }
  25162. // Fields allows partial responses to be retrieved. See
  25163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25164. // for more information.
  25165. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  25166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25167. return c
  25168. }
  25169. // IfNoneMatch sets the optional parameter which makes the operation
  25170. // fail if the object's ETag matches the given value. This is useful for
  25171. // getting updates only after the object has changed since the last
  25172. // request. Use googleapi.IsNotModified to check whether the response
  25173. // error from Do is the result of In-None-Match.
  25174. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  25175. c.ifNoneMatch_ = entityTag
  25176. return c
  25177. }
  25178. // Context sets the context to be used in this call's Do method. Any
  25179. // pending HTTP request will be aborted if the provided context is
  25180. // canceled.
  25181. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  25182. c.ctx_ = ctx
  25183. return c
  25184. }
  25185. // Header returns an http.Header that can be modified by the caller to
  25186. // add HTTP headers to the request.
  25187. func (c *CreativesListCall) Header() http.Header {
  25188. if c.header_ == nil {
  25189. c.header_ = make(http.Header)
  25190. }
  25191. return c.header_
  25192. }
  25193. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  25194. reqHeaders := make(http.Header)
  25195. for k, v := range c.header_ {
  25196. reqHeaders[k] = v
  25197. }
  25198. reqHeaders.Set("User-Agent", c.s.userAgent())
  25199. if c.ifNoneMatch_ != "" {
  25200. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25201. }
  25202. var body io.Reader = nil
  25203. c.urlParams_.Set("alt", alt)
  25204. c.urlParams_.Set("prettyPrint", "false")
  25205. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25206. urls += "?" + c.urlParams_.Encode()
  25207. req, err := http.NewRequest("GET", urls, body)
  25208. if err != nil {
  25209. return nil, err
  25210. }
  25211. req.Header = reqHeaders
  25212. googleapi.Expand(req.URL, map[string]string{
  25213. "profileId": strconv.FormatInt(c.profileId, 10),
  25214. })
  25215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25216. }
  25217. // Do executes the "dfareporting.creatives.list" call.
  25218. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  25219. // non-2xx status code is an error. Response headers are in either
  25220. // *CreativesListResponse.ServerResponse.Header or (if a response was
  25221. // returned at all) in error.(*googleapi.Error).Header. Use
  25222. // googleapi.IsNotModified to check whether the returned error was
  25223. // because http.StatusNotModified was returned.
  25224. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  25225. gensupport.SetOptions(c.urlParams_, opts...)
  25226. res, err := c.doRequest("json")
  25227. if res != nil && res.StatusCode == http.StatusNotModified {
  25228. if res.Body != nil {
  25229. res.Body.Close()
  25230. }
  25231. return nil, &googleapi.Error{
  25232. Code: res.StatusCode,
  25233. Header: res.Header,
  25234. }
  25235. }
  25236. if err != nil {
  25237. return nil, err
  25238. }
  25239. defer googleapi.CloseBody(res)
  25240. if err := googleapi.CheckResponse(res); err != nil {
  25241. return nil, err
  25242. }
  25243. ret := &CreativesListResponse{
  25244. ServerResponse: googleapi.ServerResponse{
  25245. Header: res.Header,
  25246. HTTPStatusCode: res.StatusCode,
  25247. },
  25248. }
  25249. target := &ret
  25250. if err := gensupport.DecodeResponse(target, res); err != nil {
  25251. return nil, err
  25252. }
  25253. return ret, nil
  25254. // {
  25255. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  25256. // "httpMethod": "GET",
  25257. // "id": "dfareporting.creatives.list",
  25258. // "parameterOrder": [
  25259. // "profileId"
  25260. // ],
  25261. // "parameters": {
  25262. // "active": {
  25263. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  25264. // "location": "query",
  25265. // "type": "boolean"
  25266. // },
  25267. // "advertiserId": {
  25268. // "description": "Select only creatives with this advertiser ID.",
  25269. // "format": "int64",
  25270. // "location": "query",
  25271. // "type": "string"
  25272. // },
  25273. // "archived": {
  25274. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  25275. // "location": "query",
  25276. // "type": "boolean"
  25277. // },
  25278. // "campaignId": {
  25279. // "description": "Select only creatives with this campaign ID.",
  25280. // "format": "int64",
  25281. // "location": "query",
  25282. // "type": "string"
  25283. // },
  25284. // "companionCreativeIds": {
  25285. // "description": "Select only in-stream video creatives with these companion IDs.",
  25286. // "format": "int64",
  25287. // "location": "query",
  25288. // "repeated": true,
  25289. // "type": "string"
  25290. // },
  25291. // "creativeFieldIds": {
  25292. // "description": "Select only creatives with these creative field IDs.",
  25293. // "format": "int64",
  25294. // "location": "query",
  25295. // "repeated": true,
  25296. // "type": "string"
  25297. // },
  25298. // "ids": {
  25299. // "description": "Select only creatives with these IDs.",
  25300. // "format": "int64",
  25301. // "location": "query",
  25302. // "repeated": true,
  25303. // "type": "string"
  25304. // },
  25305. // "maxResults": {
  25306. // "default": "1000",
  25307. // "description": "Maximum number of results to return.",
  25308. // "format": "int32",
  25309. // "location": "query",
  25310. // "maximum": "1000",
  25311. // "minimum": "0",
  25312. // "type": "integer"
  25313. // },
  25314. // "pageToken": {
  25315. // "description": "Value of the nextPageToken from the previous result page.",
  25316. // "location": "query",
  25317. // "type": "string"
  25318. // },
  25319. // "profileId": {
  25320. // "description": "User profile ID associated with this request.",
  25321. // "format": "int64",
  25322. // "location": "path",
  25323. // "required": true,
  25324. // "type": "string"
  25325. // },
  25326. // "renderingIds": {
  25327. // "description": "Select only creatives with these rendering IDs.",
  25328. // "format": "int64",
  25329. // "location": "query",
  25330. // "repeated": true,
  25331. // "type": "string"
  25332. // },
  25333. // "searchString": {
  25334. // "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\".",
  25335. // "location": "query",
  25336. // "type": "string"
  25337. // },
  25338. // "sizeIds": {
  25339. // "description": "Select only creatives with these size IDs.",
  25340. // "format": "int64",
  25341. // "location": "query",
  25342. // "repeated": true,
  25343. // "type": "string"
  25344. // },
  25345. // "sortField": {
  25346. // "default": "ID",
  25347. // "description": "Field by which to sort the list.",
  25348. // "enum": [
  25349. // "ID",
  25350. // "NAME"
  25351. // ],
  25352. // "enumDescriptions": [
  25353. // "",
  25354. // ""
  25355. // ],
  25356. // "location": "query",
  25357. // "type": "string"
  25358. // },
  25359. // "sortOrder": {
  25360. // "default": "ASCENDING",
  25361. // "description": "Order of sorted results.",
  25362. // "enum": [
  25363. // "ASCENDING",
  25364. // "DESCENDING"
  25365. // ],
  25366. // "enumDescriptions": [
  25367. // "",
  25368. // ""
  25369. // ],
  25370. // "location": "query",
  25371. // "type": "string"
  25372. // },
  25373. // "studioCreativeId": {
  25374. // "description": "Select only creatives corresponding to this Studio creative ID.",
  25375. // "format": "int64",
  25376. // "location": "query",
  25377. // "type": "string"
  25378. // },
  25379. // "types": {
  25380. // "description": "Select only creatives with these creative types.",
  25381. // "enum": [
  25382. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  25383. // "CUSTOM_DISPLAY",
  25384. // "CUSTOM_DISPLAY_INTERSTITIAL",
  25385. // "DISPLAY",
  25386. // "DISPLAY_IMAGE_GALLERY",
  25387. // "DISPLAY_REDIRECT",
  25388. // "FLASH_INPAGE",
  25389. // "HTML5_BANNER",
  25390. // "IMAGE",
  25391. // "INSTREAM_AUDIO",
  25392. // "INSTREAM_VIDEO",
  25393. // "INSTREAM_VIDEO_REDIRECT",
  25394. // "INTERNAL_REDIRECT",
  25395. // "INTERSTITIAL_INTERNAL_REDIRECT",
  25396. // "RICH_MEDIA_DISPLAY_BANNER",
  25397. // "RICH_MEDIA_DISPLAY_EXPANDING",
  25398. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  25399. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  25400. // "RICH_MEDIA_IM_EXPAND",
  25401. // "RICH_MEDIA_INPAGE_FLOATING",
  25402. // "RICH_MEDIA_MOBILE_IN_APP",
  25403. // "RICH_MEDIA_PEEL_DOWN",
  25404. // "TRACKING_TEXT",
  25405. // "VPAID_LINEAR_VIDEO",
  25406. // "VPAID_NON_LINEAR_VIDEO"
  25407. // ],
  25408. // "enumDescriptions": [
  25409. // "",
  25410. // "",
  25411. // "",
  25412. // "",
  25413. // "",
  25414. // "",
  25415. // "",
  25416. // "",
  25417. // "",
  25418. // "",
  25419. // "",
  25420. // "",
  25421. // "",
  25422. // "",
  25423. // "",
  25424. // "",
  25425. // "",
  25426. // "",
  25427. // "",
  25428. // "",
  25429. // "",
  25430. // "",
  25431. // "",
  25432. // "",
  25433. // ""
  25434. // ],
  25435. // "location": "query",
  25436. // "repeated": true,
  25437. // "type": "string"
  25438. // }
  25439. // },
  25440. // "path": "userprofiles/{profileId}/creatives",
  25441. // "response": {
  25442. // "$ref": "CreativesListResponse"
  25443. // },
  25444. // "scopes": [
  25445. // "https://www.googleapis.com/auth/dfatrafficking"
  25446. // ]
  25447. // }
  25448. }
  25449. // Pages invokes f for each page of results.
  25450. // A non-nil error returned from f will halt the iteration.
  25451. // The provided context supersedes any context provided to the Context method.
  25452. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  25453. c.ctx_ = ctx
  25454. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25455. for {
  25456. x, err := c.Do()
  25457. if err != nil {
  25458. return err
  25459. }
  25460. if err := f(x); err != nil {
  25461. return err
  25462. }
  25463. if x.NextPageToken == "" {
  25464. return nil
  25465. }
  25466. c.PageToken(x.NextPageToken)
  25467. }
  25468. }
  25469. // method id "dfareporting.creatives.patch":
  25470. type CreativesPatchCall struct {
  25471. s *Service
  25472. profileId int64
  25473. creative *Creative
  25474. urlParams_ gensupport.URLParams
  25475. ctx_ context.Context
  25476. header_ http.Header
  25477. }
  25478. // Patch: Updates an existing creative. This method supports patch
  25479. // semantics.
  25480. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  25481. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25482. c.profileId = profileId
  25483. c.urlParams_.Set("id", fmt.Sprint(id))
  25484. c.creative = creative
  25485. return c
  25486. }
  25487. // Fields allows partial responses to be retrieved. See
  25488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25489. // for more information.
  25490. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  25491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25492. return c
  25493. }
  25494. // Context sets the context to be used in this call's Do method. Any
  25495. // pending HTTP request will be aborted if the provided context is
  25496. // canceled.
  25497. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  25498. c.ctx_ = ctx
  25499. return c
  25500. }
  25501. // Header returns an http.Header that can be modified by the caller to
  25502. // add HTTP headers to the request.
  25503. func (c *CreativesPatchCall) Header() http.Header {
  25504. if c.header_ == nil {
  25505. c.header_ = make(http.Header)
  25506. }
  25507. return c.header_
  25508. }
  25509. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  25510. reqHeaders := make(http.Header)
  25511. for k, v := range c.header_ {
  25512. reqHeaders[k] = v
  25513. }
  25514. reqHeaders.Set("User-Agent", c.s.userAgent())
  25515. var body io.Reader = nil
  25516. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25517. if err != nil {
  25518. return nil, err
  25519. }
  25520. reqHeaders.Set("Content-Type", "application/json")
  25521. c.urlParams_.Set("alt", alt)
  25522. c.urlParams_.Set("prettyPrint", "false")
  25523. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25524. urls += "?" + c.urlParams_.Encode()
  25525. req, err := http.NewRequest("PATCH", urls, body)
  25526. if err != nil {
  25527. return nil, err
  25528. }
  25529. req.Header = reqHeaders
  25530. googleapi.Expand(req.URL, map[string]string{
  25531. "profileId": strconv.FormatInt(c.profileId, 10),
  25532. })
  25533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25534. }
  25535. // Do executes the "dfareporting.creatives.patch" call.
  25536. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25537. // code is an error. Response headers are in either
  25538. // *Creative.ServerResponse.Header or (if a response was returned at
  25539. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25540. // to check whether the returned error was because
  25541. // http.StatusNotModified was returned.
  25542. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25543. gensupport.SetOptions(c.urlParams_, opts...)
  25544. res, err := c.doRequest("json")
  25545. if res != nil && res.StatusCode == http.StatusNotModified {
  25546. if res.Body != nil {
  25547. res.Body.Close()
  25548. }
  25549. return nil, &googleapi.Error{
  25550. Code: res.StatusCode,
  25551. Header: res.Header,
  25552. }
  25553. }
  25554. if err != nil {
  25555. return nil, err
  25556. }
  25557. defer googleapi.CloseBody(res)
  25558. if err := googleapi.CheckResponse(res); err != nil {
  25559. return nil, err
  25560. }
  25561. ret := &Creative{
  25562. ServerResponse: googleapi.ServerResponse{
  25563. Header: res.Header,
  25564. HTTPStatusCode: res.StatusCode,
  25565. },
  25566. }
  25567. target := &ret
  25568. if err := gensupport.DecodeResponse(target, res); err != nil {
  25569. return nil, err
  25570. }
  25571. return ret, nil
  25572. // {
  25573. // "description": "Updates an existing creative. This method supports patch semantics.",
  25574. // "httpMethod": "PATCH",
  25575. // "id": "dfareporting.creatives.patch",
  25576. // "parameterOrder": [
  25577. // "profileId",
  25578. // "id"
  25579. // ],
  25580. // "parameters": {
  25581. // "id": {
  25582. // "description": "Creative ID.",
  25583. // "format": "int64",
  25584. // "location": "query",
  25585. // "required": true,
  25586. // "type": "string"
  25587. // },
  25588. // "profileId": {
  25589. // "description": "User profile ID associated with this request.",
  25590. // "format": "int64",
  25591. // "location": "path",
  25592. // "required": true,
  25593. // "type": "string"
  25594. // }
  25595. // },
  25596. // "path": "userprofiles/{profileId}/creatives",
  25597. // "request": {
  25598. // "$ref": "Creative"
  25599. // },
  25600. // "response": {
  25601. // "$ref": "Creative"
  25602. // },
  25603. // "scopes": [
  25604. // "https://www.googleapis.com/auth/dfatrafficking"
  25605. // ]
  25606. // }
  25607. }
  25608. // method id "dfareporting.creatives.update":
  25609. type CreativesUpdateCall struct {
  25610. s *Service
  25611. profileId int64
  25612. creative *Creative
  25613. urlParams_ gensupport.URLParams
  25614. ctx_ context.Context
  25615. header_ http.Header
  25616. }
  25617. // Update: Updates an existing creative.
  25618. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  25619. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25620. c.profileId = profileId
  25621. c.creative = creative
  25622. return c
  25623. }
  25624. // Fields allows partial responses to be retrieved. See
  25625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25626. // for more information.
  25627. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  25628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25629. return c
  25630. }
  25631. // Context sets the context to be used in this call's Do method. Any
  25632. // pending HTTP request will be aborted if the provided context is
  25633. // canceled.
  25634. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  25635. c.ctx_ = ctx
  25636. return c
  25637. }
  25638. // Header returns an http.Header that can be modified by the caller to
  25639. // add HTTP headers to the request.
  25640. func (c *CreativesUpdateCall) Header() http.Header {
  25641. if c.header_ == nil {
  25642. c.header_ = make(http.Header)
  25643. }
  25644. return c.header_
  25645. }
  25646. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  25647. reqHeaders := make(http.Header)
  25648. for k, v := range c.header_ {
  25649. reqHeaders[k] = v
  25650. }
  25651. reqHeaders.Set("User-Agent", c.s.userAgent())
  25652. var body io.Reader = nil
  25653. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25654. if err != nil {
  25655. return nil, err
  25656. }
  25657. reqHeaders.Set("Content-Type", "application/json")
  25658. c.urlParams_.Set("alt", alt)
  25659. c.urlParams_.Set("prettyPrint", "false")
  25660. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25661. urls += "?" + c.urlParams_.Encode()
  25662. req, err := http.NewRequest("PUT", urls, body)
  25663. if err != nil {
  25664. return nil, err
  25665. }
  25666. req.Header = reqHeaders
  25667. googleapi.Expand(req.URL, map[string]string{
  25668. "profileId": strconv.FormatInt(c.profileId, 10),
  25669. })
  25670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25671. }
  25672. // Do executes the "dfareporting.creatives.update" call.
  25673. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25674. // code is an error. Response headers are in either
  25675. // *Creative.ServerResponse.Header or (if a response was returned at
  25676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25677. // to check whether the returned error was because
  25678. // http.StatusNotModified was returned.
  25679. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25680. gensupport.SetOptions(c.urlParams_, opts...)
  25681. res, err := c.doRequest("json")
  25682. if res != nil && res.StatusCode == http.StatusNotModified {
  25683. if res.Body != nil {
  25684. res.Body.Close()
  25685. }
  25686. return nil, &googleapi.Error{
  25687. Code: res.StatusCode,
  25688. Header: res.Header,
  25689. }
  25690. }
  25691. if err != nil {
  25692. return nil, err
  25693. }
  25694. defer googleapi.CloseBody(res)
  25695. if err := googleapi.CheckResponse(res); err != nil {
  25696. return nil, err
  25697. }
  25698. ret := &Creative{
  25699. ServerResponse: googleapi.ServerResponse{
  25700. Header: res.Header,
  25701. HTTPStatusCode: res.StatusCode,
  25702. },
  25703. }
  25704. target := &ret
  25705. if err := gensupport.DecodeResponse(target, res); err != nil {
  25706. return nil, err
  25707. }
  25708. return ret, nil
  25709. // {
  25710. // "description": "Updates an existing creative.",
  25711. // "httpMethod": "PUT",
  25712. // "id": "dfareporting.creatives.update",
  25713. // "parameterOrder": [
  25714. // "profileId"
  25715. // ],
  25716. // "parameters": {
  25717. // "profileId": {
  25718. // "description": "User profile ID associated with this request.",
  25719. // "format": "int64",
  25720. // "location": "path",
  25721. // "required": true,
  25722. // "type": "string"
  25723. // }
  25724. // },
  25725. // "path": "userprofiles/{profileId}/creatives",
  25726. // "request": {
  25727. // "$ref": "Creative"
  25728. // },
  25729. // "response": {
  25730. // "$ref": "Creative"
  25731. // },
  25732. // "scopes": [
  25733. // "https://www.googleapis.com/auth/dfatrafficking"
  25734. // ]
  25735. // }
  25736. }
  25737. // method id "dfareporting.dimensionValues.query":
  25738. type DimensionValuesQueryCall struct {
  25739. s *Service
  25740. profileId int64
  25741. dimensionvaluerequest *DimensionValueRequest
  25742. urlParams_ gensupport.URLParams
  25743. ctx_ context.Context
  25744. header_ http.Header
  25745. }
  25746. // Query: Retrieves list of report dimension values for a list of
  25747. // filters.
  25748. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  25749. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25750. c.profileId = profileId
  25751. c.dimensionvaluerequest = dimensionvaluerequest
  25752. return c
  25753. }
  25754. // MaxResults sets the optional parameter "maxResults": Maximum number
  25755. // of results to return.
  25756. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  25757. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25758. return c
  25759. }
  25760. // PageToken sets the optional parameter "pageToken": The value of the
  25761. // nextToken from the previous result page.
  25762. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  25763. c.urlParams_.Set("pageToken", pageToken)
  25764. return c
  25765. }
  25766. // Fields allows partial responses to be retrieved. See
  25767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25768. // for more information.
  25769. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  25770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25771. return c
  25772. }
  25773. // Context sets the context to be used in this call's Do method. Any
  25774. // pending HTTP request will be aborted if the provided context is
  25775. // canceled.
  25776. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  25777. c.ctx_ = ctx
  25778. return c
  25779. }
  25780. // Header returns an http.Header that can be modified by the caller to
  25781. // add HTTP headers to the request.
  25782. func (c *DimensionValuesQueryCall) Header() http.Header {
  25783. if c.header_ == nil {
  25784. c.header_ = make(http.Header)
  25785. }
  25786. return c.header_
  25787. }
  25788. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  25789. reqHeaders := make(http.Header)
  25790. for k, v := range c.header_ {
  25791. reqHeaders[k] = v
  25792. }
  25793. reqHeaders.Set("User-Agent", c.s.userAgent())
  25794. var body io.Reader = nil
  25795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  25796. if err != nil {
  25797. return nil, err
  25798. }
  25799. reqHeaders.Set("Content-Type", "application/json")
  25800. c.urlParams_.Set("alt", alt)
  25801. c.urlParams_.Set("prettyPrint", "false")
  25802. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  25803. urls += "?" + c.urlParams_.Encode()
  25804. req, err := http.NewRequest("POST", urls, body)
  25805. if err != nil {
  25806. return nil, err
  25807. }
  25808. req.Header = reqHeaders
  25809. googleapi.Expand(req.URL, map[string]string{
  25810. "profileId": strconv.FormatInt(c.profileId, 10),
  25811. })
  25812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25813. }
  25814. // Do executes the "dfareporting.dimensionValues.query" call.
  25815. // Exactly one of *DimensionValueList or error will be non-nil. Any
  25816. // non-2xx status code is an error. Response headers are in either
  25817. // *DimensionValueList.ServerResponse.Header or (if a response was
  25818. // returned at all) in error.(*googleapi.Error).Header. Use
  25819. // googleapi.IsNotModified to check whether the returned error was
  25820. // because http.StatusNotModified was returned.
  25821. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  25822. gensupport.SetOptions(c.urlParams_, opts...)
  25823. res, err := c.doRequest("json")
  25824. if res != nil && res.StatusCode == http.StatusNotModified {
  25825. if res.Body != nil {
  25826. res.Body.Close()
  25827. }
  25828. return nil, &googleapi.Error{
  25829. Code: res.StatusCode,
  25830. Header: res.Header,
  25831. }
  25832. }
  25833. if err != nil {
  25834. return nil, err
  25835. }
  25836. defer googleapi.CloseBody(res)
  25837. if err := googleapi.CheckResponse(res); err != nil {
  25838. return nil, err
  25839. }
  25840. ret := &DimensionValueList{
  25841. ServerResponse: googleapi.ServerResponse{
  25842. Header: res.Header,
  25843. HTTPStatusCode: res.StatusCode,
  25844. },
  25845. }
  25846. target := &ret
  25847. if err := gensupport.DecodeResponse(target, res); err != nil {
  25848. return nil, err
  25849. }
  25850. return ret, nil
  25851. // {
  25852. // "description": "Retrieves list of report dimension values for a list of filters.",
  25853. // "httpMethod": "POST",
  25854. // "id": "dfareporting.dimensionValues.query",
  25855. // "parameterOrder": [
  25856. // "profileId"
  25857. // ],
  25858. // "parameters": {
  25859. // "maxResults": {
  25860. // "default": "100",
  25861. // "description": "Maximum number of results to return.",
  25862. // "format": "int32",
  25863. // "location": "query",
  25864. // "maximum": "100",
  25865. // "minimum": "0",
  25866. // "type": "integer"
  25867. // },
  25868. // "pageToken": {
  25869. // "description": "The value of the nextToken from the previous result page.",
  25870. // "location": "query",
  25871. // "type": "string"
  25872. // },
  25873. // "profileId": {
  25874. // "description": "The DFA user profile ID.",
  25875. // "format": "int64",
  25876. // "location": "path",
  25877. // "required": true,
  25878. // "type": "string"
  25879. // }
  25880. // },
  25881. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  25882. // "request": {
  25883. // "$ref": "DimensionValueRequest"
  25884. // },
  25885. // "response": {
  25886. // "$ref": "DimensionValueList"
  25887. // },
  25888. // "scopes": [
  25889. // "https://www.googleapis.com/auth/dfareporting"
  25890. // ]
  25891. // }
  25892. }
  25893. // Pages invokes f for each page of results.
  25894. // A non-nil error returned from f will halt the iteration.
  25895. // The provided context supersedes any context provided to the Context method.
  25896. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  25897. c.ctx_ = ctx
  25898. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25899. for {
  25900. x, err := c.Do()
  25901. if err != nil {
  25902. return err
  25903. }
  25904. if err := f(x); err != nil {
  25905. return err
  25906. }
  25907. if x.NextPageToken == "" {
  25908. return nil
  25909. }
  25910. c.PageToken(x.NextPageToken)
  25911. }
  25912. }
  25913. // method id "dfareporting.directorySiteContacts.get":
  25914. type DirectorySiteContactsGetCall struct {
  25915. s *Service
  25916. profileId int64
  25917. id int64
  25918. urlParams_ gensupport.URLParams
  25919. ifNoneMatch_ string
  25920. ctx_ context.Context
  25921. header_ http.Header
  25922. }
  25923. // Get: Gets one directory site contact by ID.
  25924. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  25925. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25926. c.profileId = profileId
  25927. c.id = id
  25928. return c
  25929. }
  25930. // Fields allows partial responses to be retrieved. See
  25931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25932. // for more information.
  25933. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  25934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25935. return c
  25936. }
  25937. // IfNoneMatch sets the optional parameter which makes the operation
  25938. // fail if the object's ETag matches the given value. This is useful for
  25939. // getting updates only after the object has changed since the last
  25940. // request. Use googleapi.IsNotModified to check whether the response
  25941. // error from Do is the result of In-None-Match.
  25942. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  25943. c.ifNoneMatch_ = entityTag
  25944. return c
  25945. }
  25946. // Context sets the context to be used in this call's Do method. Any
  25947. // pending HTTP request will be aborted if the provided context is
  25948. // canceled.
  25949. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  25950. c.ctx_ = ctx
  25951. return c
  25952. }
  25953. // Header returns an http.Header that can be modified by the caller to
  25954. // add HTTP headers to the request.
  25955. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  25956. if c.header_ == nil {
  25957. c.header_ = make(http.Header)
  25958. }
  25959. return c.header_
  25960. }
  25961. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  25962. reqHeaders := make(http.Header)
  25963. for k, v := range c.header_ {
  25964. reqHeaders[k] = v
  25965. }
  25966. reqHeaders.Set("User-Agent", c.s.userAgent())
  25967. if c.ifNoneMatch_ != "" {
  25968. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25969. }
  25970. var body io.Reader = nil
  25971. c.urlParams_.Set("alt", alt)
  25972. c.urlParams_.Set("prettyPrint", "false")
  25973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  25974. urls += "?" + c.urlParams_.Encode()
  25975. req, err := http.NewRequest("GET", urls, body)
  25976. if err != nil {
  25977. return nil, err
  25978. }
  25979. req.Header = reqHeaders
  25980. googleapi.Expand(req.URL, map[string]string{
  25981. "profileId": strconv.FormatInt(c.profileId, 10),
  25982. "id": strconv.FormatInt(c.id, 10),
  25983. })
  25984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25985. }
  25986. // Do executes the "dfareporting.directorySiteContacts.get" call.
  25987. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  25988. // non-2xx status code is an error. Response headers are in either
  25989. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  25990. // returned at all) in error.(*googleapi.Error).Header. Use
  25991. // googleapi.IsNotModified to check whether the returned error was
  25992. // because http.StatusNotModified was returned.
  25993. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  25994. gensupport.SetOptions(c.urlParams_, opts...)
  25995. res, err := c.doRequest("json")
  25996. if res != nil && res.StatusCode == http.StatusNotModified {
  25997. if res.Body != nil {
  25998. res.Body.Close()
  25999. }
  26000. return nil, &googleapi.Error{
  26001. Code: res.StatusCode,
  26002. Header: res.Header,
  26003. }
  26004. }
  26005. if err != nil {
  26006. return nil, err
  26007. }
  26008. defer googleapi.CloseBody(res)
  26009. if err := googleapi.CheckResponse(res); err != nil {
  26010. return nil, err
  26011. }
  26012. ret := &DirectorySiteContact{
  26013. ServerResponse: googleapi.ServerResponse{
  26014. Header: res.Header,
  26015. HTTPStatusCode: res.StatusCode,
  26016. },
  26017. }
  26018. target := &ret
  26019. if err := gensupport.DecodeResponse(target, res); err != nil {
  26020. return nil, err
  26021. }
  26022. return ret, nil
  26023. // {
  26024. // "description": "Gets one directory site contact by ID.",
  26025. // "httpMethod": "GET",
  26026. // "id": "dfareporting.directorySiteContacts.get",
  26027. // "parameterOrder": [
  26028. // "profileId",
  26029. // "id"
  26030. // ],
  26031. // "parameters": {
  26032. // "id": {
  26033. // "description": "Directory site contact ID.",
  26034. // "format": "int64",
  26035. // "location": "path",
  26036. // "required": true,
  26037. // "type": "string"
  26038. // },
  26039. // "profileId": {
  26040. // "description": "User profile ID associated with this request.",
  26041. // "format": "int64",
  26042. // "location": "path",
  26043. // "required": true,
  26044. // "type": "string"
  26045. // }
  26046. // },
  26047. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  26048. // "response": {
  26049. // "$ref": "DirectorySiteContact"
  26050. // },
  26051. // "scopes": [
  26052. // "https://www.googleapis.com/auth/dfatrafficking"
  26053. // ]
  26054. // }
  26055. }
  26056. // method id "dfareporting.directorySiteContacts.list":
  26057. type DirectorySiteContactsListCall struct {
  26058. s *Service
  26059. profileId int64
  26060. urlParams_ gensupport.URLParams
  26061. ifNoneMatch_ string
  26062. ctx_ context.Context
  26063. header_ http.Header
  26064. }
  26065. // List: Retrieves a list of directory site contacts, possibly filtered.
  26066. // This method supports paging.
  26067. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  26068. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26069. c.profileId = profileId
  26070. return c
  26071. }
  26072. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  26073. // Select only directory site contacts with these directory site IDs.
  26074. // This is a required field.
  26075. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  26076. var directorySiteIds_ []string
  26077. for _, v := range directorySiteIds {
  26078. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  26079. }
  26080. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  26081. return c
  26082. }
  26083. // Ids sets the optional parameter "ids": Select only directory site
  26084. // contacts with these IDs.
  26085. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  26086. var ids_ []string
  26087. for _, v := range ids {
  26088. ids_ = append(ids_, fmt.Sprint(v))
  26089. }
  26090. c.urlParams_.SetMulti("ids", ids_)
  26091. return c
  26092. }
  26093. // MaxResults sets the optional parameter "maxResults": Maximum number
  26094. // of results to return.
  26095. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  26096. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26097. return c
  26098. }
  26099. // PageToken sets the optional parameter "pageToken": Value of the
  26100. // nextPageToken from the previous result page.
  26101. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  26102. c.urlParams_.Set("pageToken", pageToken)
  26103. return c
  26104. }
  26105. // SearchString sets the optional parameter "searchString": Allows
  26106. // searching for objects by name, ID or email. Wildcards (*) are
  26107. // allowed. For example, "directory site contact*2015" will return
  26108. // objects with names like "directory site contact June 2015",
  26109. // "directory site contact April 2015", or simply "directory site
  26110. // contact 2015". Most of the searches also add wildcards implicitly at
  26111. // the start and the end of the search string. For example, a search
  26112. // string of "directory site contact" will match objects with name "my
  26113. // directory site contact", "directory site contact 2015", or simply
  26114. // "directory site contact".
  26115. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  26116. c.urlParams_.Set("searchString", searchString)
  26117. return c
  26118. }
  26119. // SortField sets the optional parameter "sortField": Field by which to
  26120. // sort the list.
  26121. //
  26122. // Possible values:
  26123. // "ID" (default)
  26124. // "NAME"
  26125. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  26126. c.urlParams_.Set("sortField", sortField)
  26127. return c
  26128. }
  26129. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26130. // results.
  26131. //
  26132. // Possible values:
  26133. // "ASCENDING" (default)
  26134. // "DESCENDING"
  26135. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  26136. c.urlParams_.Set("sortOrder", sortOrder)
  26137. return c
  26138. }
  26139. // Fields allows partial responses to be retrieved. See
  26140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26141. // for more information.
  26142. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  26143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26144. return c
  26145. }
  26146. // IfNoneMatch sets the optional parameter which makes the operation
  26147. // fail if the object's ETag matches the given value. This is useful for
  26148. // getting updates only after the object has changed since the last
  26149. // request. Use googleapi.IsNotModified to check whether the response
  26150. // error from Do is the result of In-None-Match.
  26151. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  26152. c.ifNoneMatch_ = entityTag
  26153. return c
  26154. }
  26155. // Context sets the context to be used in this call's Do method. Any
  26156. // pending HTTP request will be aborted if the provided context is
  26157. // canceled.
  26158. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  26159. c.ctx_ = ctx
  26160. return c
  26161. }
  26162. // Header returns an http.Header that can be modified by the caller to
  26163. // add HTTP headers to the request.
  26164. func (c *DirectorySiteContactsListCall) Header() http.Header {
  26165. if c.header_ == nil {
  26166. c.header_ = make(http.Header)
  26167. }
  26168. return c.header_
  26169. }
  26170. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  26171. reqHeaders := make(http.Header)
  26172. for k, v := range c.header_ {
  26173. reqHeaders[k] = v
  26174. }
  26175. reqHeaders.Set("User-Agent", c.s.userAgent())
  26176. if c.ifNoneMatch_ != "" {
  26177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26178. }
  26179. var body io.Reader = nil
  26180. c.urlParams_.Set("alt", alt)
  26181. c.urlParams_.Set("prettyPrint", "false")
  26182. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  26183. urls += "?" + c.urlParams_.Encode()
  26184. req, err := http.NewRequest("GET", urls, body)
  26185. if err != nil {
  26186. return nil, err
  26187. }
  26188. req.Header = reqHeaders
  26189. googleapi.Expand(req.URL, map[string]string{
  26190. "profileId": strconv.FormatInt(c.profileId, 10),
  26191. })
  26192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26193. }
  26194. // Do executes the "dfareporting.directorySiteContacts.list" call.
  26195. // Exactly one of *DirectorySiteContactsListResponse or error will be
  26196. // non-nil. Any non-2xx status code is an error. Response headers are in
  26197. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  26198. // (if a response was returned at all) in
  26199. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  26200. // whether the returned error was because http.StatusNotModified was
  26201. // returned.
  26202. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  26203. gensupport.SetOptions(c.urlParams_, opts...)
  26204. res, err := c.doRequest("json")
  26205. if res != nil && res.StatusCode == http.StatusNotModified {
  26206. if res.Body != nil {
  26207. res.Body.Close()
  26208. }
  26209. return nil, &googleapi.Error{
  26210. Code: res.StatusCode,
  26211. Header: res.Header,
  26212. }
  26213. }
  26214. if err != nil {
  26215. return nil, err
  26216. }
  26217. defer googleapi.CloseBody(res)
  26218. if err := googleapi.CheckResponse(res); err != nil {
  26219. return nil, err
  26220. }
  26221. ret := &DirectorySiteContactsListResponse{
  26222. ServerResponse: googleapi.ServerResponse{
  26223. Header: res.Header,
  26224. HTTPStatusCode: res.StatusCode,
  26225. },
  26226. }
  26227. target := &ret
  26228. if err := gensupport.DecodeResponse(target, res); err != nil {
  26229. return nil, err
  26230. }
  26231. return ret, nil
  26232. // {
  26233. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  26234. // "httpMethod": "GET",
  26235. // "id": "dfareporting.directorySiteContacts.list",
  26236. // "parameterOrder": [
  26237. // "profileId"
  26238. // ],
  26239. // "parameters": {
  26240. // "directorySiteIds": {
  26241. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  26242. // "format": "int64",
  26243. // "location": "query",
  26244. // "repeated": true,
  26245. // "type": "string"
  26246. // },
  26247. // "ids": {
  26248. // "description": "Select only directory site contacts with these IDs.",
  26249. // "format": "int64",
  26250. // "location": "query",
  26251. // "repeated": true,
  26252. // "type": "string"
  26253. // },
  26254. // "maxResults": {
  26255. // "default": "1000",
  26256. // "description": "Maximum number of results to return.",
  26257. // "format": "int32",
  26258. // "location": "query",
  26259. // "maximum": "1000",
  26260. // "minimum": "0",
  26261. // "type": "integer"
  26262. // },
  26263. // "pageToken": {
  26264. // "description": "Value of the nextPageToken from the previous result page.",
  26265. // "location": "query",
  26266. // "type": "string"
  26267. // },
  26268. // "profileId": {
  26269. // "description": "User profile ID associated with this request.",
  26270. // "format": "int64",
  26271. // "location": "path",
  26272. // "required": true,
  26273. // "type": "string"
  26274. // },
  26275. // "searchString": {
  26276. // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".",
  26277. // "location": "query",
  26278. // "type": "string"
  26279. // },
  26280. // "sortField": {
  26281. // "default": "ID",
  26282. // "description": "Field by which to sort the list.",
  26283. // "enum": [
  26284. // "ID",
  26285. // "NAME"
  26286. // ],
  26287. // "enumDescriptions": [
  26288. // "",
  26289. // ""
  26290. // ],
  26291. // "location": "query",
  26292. // "type": "string"
  26293. // },
  26294. // "sortOrder": {
  26295. // "default": "ASCENDING",
  26296. // "description": "Order of sorted results.",
  26297. // "enum": [
  26298. // "ASCENDING",
  26299. // "DESCENDING"
  26300. // ],
  26301. // "enumDescriptions": [
  26302. // "",
  26303. // ""
  26304. // ],
  26305. // "location": "query",
  26306. // "type": "string"
  26307. // }
  26308. // },
  26309. // "path": "userprofiles/{profileId}/directorySiteContacts",
  26310. // "response": {
  26311. // "$ref": "DirectorySiteContactsListResponse"
  26312. // },
  26313. // "scopes": [
  26314. // "https://www.googleapis.com/auth/dfatrafficking"
  26315. // ]
  26316. // }
  26317. }
  26318. // Pages invokes f for each page of results.
  26319. // A non-nil error returned from f will halt the iteration.
  26320. // The provided context supersedes any context provided to the Context method.
  26321. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  26322. c.ctx_ = ctx
  26323. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26324. for {
  26325. x, err := c.Do()
  26326. if err != nil {
  26327. return err
  26328. }
  26329. if err := f(x); err != nil {
  26330. return err
  26331. }
  26332. if x.NextPageToken == "" {
  26333. return nil
  26334. }
  26335. c.PageToken(x.NextPageToken)
  26336. }
  26337. }
  26338. // method id "dfareporting.directorySites.get":
  26339. type DirectorySitesGetCall struct {
  26340. s *Service
  26341. profileId int64
  26342. id int64
  26343. urlParams_ gensupport.URLParams
  26344. ifNoneMatch_ string
  26345. ctx_ context.Context
  26346. header_ http.Header
  26347. }
  26348. // Get: Gets one directory site by ID.
  26349. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  26350. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26351. c.profileId = profileId
  26352. c.id = id
  26353. return c
  26354. }
  26355. // Fields allows partial responses to be retrieved. See
  26356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26357. // for more information.
  26358. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  26359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26360. return c
  26361. }
  26362. // IfNoneMatch sets the optional parameter which makes the operation
  26363. // fail if the object's ETag matches the given value. This is useful for
  26364. // getting updates only after the object has changed since the last
  26365. // request. Use googleapi.IsNotModified to check whether the response
  26366. // error from Do is the result of In-None-Match.
  26367. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  26368. c.ifNoneMatch_ = entityTag
  26369. return c
  26370. }
  26371. // Context sets the context to be used in this call's Do method. Any
  26372. // pending HTTP request will be aborted if the provided context is
  26373. // canceled.
  26374. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  26375. c.ctx_ = ctx
  26376. return c
  26377. }
  26378. // Header returns an http.Header that can be modified by the caller to
  26379. // add HTTP headers to the request.
  26380. func (c *DirectorySitesGetCall) Header() http.Header {
  26381. if c.header_ == nil {
  26382. c.header_ = make(http.Header)
  26383. }
  26384. return c.header_
  26385. }
  26386. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  26387. reqHeaders := make(http.Header)
  26388. for k, v := range c.header_ {
  26389. reqHeaders[k] = v
  26390. }
  26391. reqHeaders.Set("User-Agent", c.s.userAgent())
  26392. if c.ifNoneMatch_ != "" {
  26393. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26394. }
  26395. var body io.Reader = nil
  26396. c.urlParams_.Set("alt", alt)
  26397. c.urlParams_.Set("prettyPrint", "false")
  26398. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  26399. urls += "?" + c.urlParams_.Encode()
  26400. req, err := http.NewRequest("GET", urls, body)
  26401. if err != nil {
  26402. return nil, err
  26403. }
  26404. req.Header = reqHeaders
  26405. googleapi.Expand(req.URL, map[string]string{
  26406. "profileId": strconv.FormatInt(c.profileId, 10),
  26407. "id": strconv.FormatInt(c.id, 10),
  26408. })
  26409. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26410. }
  26411. // Do executes the "dfareporting.directorySites.get" call.
  26412. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26413. // status code is an error. Response headers are in either
  26414. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26415. // at all) in error.(*googleapi.Error).Header. Use
  26416. // googleapi.IsNotModified to check whether the returned error was
  26417. // because http.StatusNotModified was returned.
  26418. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26419. gensupport.SetOptions(c.urlParams_, opts...)
  26420. res, err := c.doRequest("json")
  26421. if res != nil && res.StatusCode == http.StatusNotModified {
  26422. if res.Body != nil {
  26423. res.Body.Close()
  26424. }
  26425. return nil, &googleapi.Error{
  26426. Code: res.StatusCode,
  26427. Header: res.Header,
  26428. }
  26429. }
  26430. if err != nil {
  26431. return nil, err
  26432. }
  26433. defer googleapi.CloseBody(res)
  26434. if err := googleapi.CheckResponse(res); err != nil {
  26435. return nil, err
  26436. }
  26437. ret := &DirectorySite{
  26438. ServerResponse: googleapi.ServerResponse{
  26439. Header: res.Header,
  26440. HTTPStatusCode: res.StatusCode,
  26441. },
  26442. }
  26443. target := &ret
  26444. if err := gensupport.DecodeResponse(target, res); err != nil {
  26445. return nil, err
  26446. }
  26447. return ret, nil
  26448. // {
  26449. // "description": "Gets one directory site by ID.",
  26450. // "httpMethod": "GET",
  26451. // "id": "dfareporting.directorySites.get",
  26452. // "parameterOrder": [
  26453. // "profileId",
  26454. // "id"
  26455. // ],
  26456. // "parameters": {
  26457. // "id": {
  26458. // "description": "Directory site ID.",
  26459. // "format": "int64",
  26460. // "location": "path",
  26461. // "required": true,
  26462. // "type": "string"
  26463. // },
  26464. // "profileId": {
  26465. // "description": "User profile ID associated with this request.",
  26466. // "format": "int64",
  26467. // "location": "path",
  26468. // "required": true,
  26469. // "type": "string"
  26470. // }
  26471. // },
  26472. // "path": "userprofiles/{profileId}/directorySites/{id}",
  26473. // "response": {
  26474. // "$ref": "DirectorySite"
  26475. // },
  26476. // "scopes": [
  26477. // "https://www.googleapis.com/auth/dfatrafficking"
  26478. // ]
  26479. // }
  26480. }
  26481. // method id "dfareporting.directorySites.insert":
  26482. type DirectorySitesInsertCall struct {
  26483. s *Service
  26484. profileId int64
  26485. directorysite *DirectorySite
  26486. urlParams_ gensupport.URLParams
  26487. ctx_ context.Context
  26488. header_ http.Header
  26489. }
  26490. // Insert: Inserts a new directory site.
  26491. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  26492. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26493. c.profileId = profileId
  26494. c.directorysite = directorysite
  26495. return c
  26496. }
  26497. // Fields allows partial responses to be retrieved. See
  26498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26499. // for more information.
  26500. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  26501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26502. return c
  26503. }
  26504. // Context sets the context to be used in this call's Do method. Any
  26505. // pending HTTP request will be aborted if the provided context is
  26506. // canceled.
  26507. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  26508. c.ctx_ = ctx
  26509. return c
  26510. }
  26511. // Header returns an http.Header that can be modified by the caller to
  26512. // add HTTP headers to the request.
  26513. func (c *DirectorySitesInsertCall) Header() http.Header {
  26514. if c.header_ == nil {
  26515. c.header_ = make(http.Header)
  26516. }
  26517. return c.header_
  26518. }
  26519. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  26520. reqHeaders := make(http.Header)
  26521. for k, v := range c.header_ {
  26522. reqHeaders[k] = v
  26523. }
  26524. reqHeaders.Set("User-Agent", c.s.userAgent())
  26525. var body io.Reader = nil
  26526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  26527. if err != nil {
  26528. return nil, err
  26529. }
  26530. reqHeaders.Set("Content-Type", "application/json")
  26531. c.urlParams_.Set("alt", alt)
  26532. c.urlParams_.Set("prettyPrint", "false")
  26533. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26534. urls += "?" + c.urlParams_.Encode()
  26535. req, err := http.NewRequest("POST", urls, body)
  26536. if err != nil {
  26537. return nil, err
  26538. }
  26539. req.Header = reqHeaders
  26540. googleapi.Expand(req.URL, map[string]string{
  26541. "profileId": strconv.FormatInt(c.profileId, 10),
  26542. })
  26543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26544. }
  26545. // Do executes the "dfareporting.directorySites.insert" call.
  26546. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26547. // status code is an error. Response headers are in either
  26548. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26549. // at all) in error.(*googleapi.Error).Header. Use
  26550. // googleapi.IsNotModified to check whether the returned error was
  26551. // because http.StatusNotModified was returned.
  26552. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26553. gensupport.SetOptions(c.urlParams_, opts...)
  26554. res, err := c.doRequest("json")
  26555. if res != nil && res.StatusCode == http.StatusNotModified {
  26556. if res.Body != nil {
  26557. res.Body.Close()
  26558. }
  26559. return nil, &googleapi.Error{
  26560. Code: res.StatusCode,
  26561. Header: res.Header,
  26562. }
  26563. }
  26564. if err != nil {
  26565. return nil, err
  26566. }
  26567. defer googleapi.CloseBody(res)
  26568. if err := googleapi.CheckResponse(res); err != nil {
  26569. return nil, err
  26570. }
  26571. ret := &DirectorySite{
  26572. ServerResponse: googleapi.ServerResponse{
  26573. Header: res.Header,
  26574. HTTPStatusCode: res.StatusCode,
  26575. },
  26576. }
  26577. target := &ret
  26578. if err := gensupport.DecodeResponse(target, res); err != nil {
  26579. return nil, err
  26580. }
  26581. return ret, nil
  26582. // {
  26583. // "description": "Inserts a new directory site.",
  26584. // "httpMethod": "POST",
  26585. // "id": "dfareporting.directorySites.insert",
  26586. // "parameterOrder": [
  26587. // "profileId"
  26588. // ],
  26589. // "parameters": {
  26590. // "profileId": {
  26591. // "description": "User profile ID associated with this request.",
  26592. // "format": "int64",
  26593. // "location": "path",
  26594. // "required": true,
  26595. // "type": "string"
  26596. // }
  26597. // },
  26598. // "path": "userprofiles/{profileId}/directorySites",
  26599. // "request": {
  26600. // "$ref": "DirectorySite"
  26601. // },
  26602. // "response": {
  26603. // "$ref": "DirectorySite"
  26604. // },
  26605. // "scopes": [
  26606. // "https://www.googleapis.com/auth/dfatrafficking"
  26607. // ]
  26608. // }
  26609. }
  26610. // method id "dfareporting.directorySites.list":
  26611. type DirectorySitesListCall struct {
  26612. s *Service
  26613. profileId int64
  26614. urlParams_ gensupport.URLParams
  26615. ifNoneMatch_ string
  26616. ctx_ context.Context
  26617. header_ http.Header
  26618. }
  26619. // List: Retrieves a list of directory sites, possibly filtered. This
  26620. // method supports paging.
  26621. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  26622. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26623. c.profileId = profileId
  26624. return c
  26625. }
  26626. // AcceptsInStreamVideoPlacements sets the optional parameter
  26627. // "acceptsInStreamVideoPlacements": This search filter is no longer
  26628. // supported and will have no effect on the results returned.
  26629. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  26630. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  26631. return c
  26632. }
  26633. // AcceptsInterstitialPlacements sets the optional parameter
  26634. // "acceptsInterstitialPlacements": This search filter is no longer
  26635. // supported and will have no effect on the results returned.
  26636. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  26637. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  26638. return c
  26639. }
  26640. // AcceptsPublisherPaidPlacements sets the optional parameter
  26641. // "acceptsPublisherPaidPlacements": Select only directory sites that
  26642. // accept publisher paid placements. This field can be left blank.
  26643. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  26644. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  26645. return c
  26646. }
  26647. // Active sets the optional parameter "active": Select only active
  26648. // directory sites. Leave blank to retrieve both active and inactive
  26649. // directory sites.
  26650. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  26651. c.urlParams_.Set("active", fmt.Sprint(active))
  26652. return c
  26653. }
  26654. // CountryId sets the optional parameter "countryId": Select only
  26655. // directory sites with this country ID.
  26656. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  26657. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  26658. return c
  26659. }
  26660. // DfpNetworkCode sets the optional parameter "dfpNetworkCode": Select
  26661. // only directory sites with this Ad Manager network code.
  26662. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  26663. c.urlParams_.Set("dfpNetworkCode", dfpNetworkCode)
  26664. return c
  26665. }
  26666. // Ids sets the optional parameter "ids": Select only directory sites
  26667. // with these IDs.
  26668. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  26669. var ids_ []string
  26670. for _, v := range ids {
  26671. ids_ = append(ids_, fmt.Sprint(v))
  26672. }
  26673. c.urlParams_.SetMulti("ids", ids_)
  26674. return c
  26675. }
  26676. // MaxResults sets the optional parameter "maxResults": Maximum number
  26677. // of results to return.
  26678. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  26679. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26680. return c
  26681. }
  26682. // PageToken sets the optional parameter "pageToken": Value of the
  26683. // nextPageToken from the previous result page.
  26684. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  26685. c.urlParams_.Set("pageToken", pageToken)
  26686. return c
  26687. }
  26688. // ParentId sets the optional parameter "parentId": Select only
  26689. // directory sites with this parent ID.
  26690. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  26691. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  26692. return c
  26693. }
  26694. // SearchString sets the optional parameter "searchString": Allows
  26695. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  26696. // For example, "directory site*2015" will return objects with names
  26697. // like "directory site June 2015", "directory site April 2015", or
  26698. // simply "directory site 2015". Most of the searches also add wildcards
  26699. // implicitly at the start and the end of the search string. For
  26700. // example, a search string of "directory site" will match objects with
  26701. // name "my directory site", "directory site 2015" or simply, "directory
  26702. // site".
  26703. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  26704. c.urlParams_.Set("searchString", searchString)
  26705. return c
  26706. }
  26707. // SortField sets the optional parameter "sortField": Field by which to
  26708. // sort the list.
  26709. //
  26710. // Possible values:
  26711. // "ID" (default)
  26712. // "NAME"
  26713. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  26714. c.urlParams_.Set("sortField", sortField)
  26715. return c
  26716. }
  26717. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26718. // results.
  26719. //
  26720. // Possible values:
  26721. // "ASCENDING" (default)
  26722. // "DESCENDING"
  26723. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  26724. c.urlParams_.Set("sortOrder", sortOrder)
  26725. return c
  26726. }
  26727. // Fields allows partial responses to be retrieved. See
  26728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26729. // for more information.
  26730. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  26731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26732. return c
  26733. }
  26734. // IfNoneMatch sets the optional parameter which makes the operation
  26735. // fail if the object's ETag matches the given value. This is useful for
  26736. // getting updates only after the object has changed since the last
  26737. // request. Use googleapi.IsNotModified to check whether the response
  26738. // error from Do is the result of In-None-Match.
  26739. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  26740. c.ifNoneMatch_ = entityTag
  26741. return c
  26742. }
  26743. // Context sets the context to be used in this call's Do method. Any
  26744. // pending HTTP request will be aborted if the provided context is
  26745. // canceled.
  26746. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  26747. c.ctx_ = ctx
  26748. return c
  26749. }
  26750. // Header returns an http.Header that can be modified by the caller to
  26751. // add HTTP headers to the request.
  26752. func (c *DirectorySitesListCall) Header() http.Header {
  26753. if c.header_ == nil {
  26754. c.header_ = make(http.Header)
  26755. }
  26756. return c.header_
  26757. }
  26758. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  26759. reqHeaders := make(http.Header)
  26760. for k, v := range c.header_ {
  26761. reqHeaders[k] = v
  26762. }
  26763. reqHeaders.Set("User-Agent", c.s.userAgent())
  26764. if c.ifNoneMatch_ != "" {
  26765. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26766. }
  26767. var body io.Reader = nil
  26768. c.urlParams_.Set("alt", alt)
  26769. c.urlParams_.Set("prettyPrint", "false")
  26770. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26771. urls += "?" + c.urlParams_.Encode()
  26772. req, err := http.NewRequest("GET", urls, body)
  26773. if err != nil {
  26774. return nil, err
  26775. }
  26776. req.Header = reqHeaders
  26777. googleapi.Expand(req.URL, map[string]string{
  26778. "profileId": strconv.FormatInt(c.profileId, 10),
  26779. })
  26780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26781. }
  26782. // Do executes the "dfareporting.directorySites.list" call.
  26783. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  26784. // Any non-2xx status code is an error. Response headers are in either
  26785. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  26786. // was returned at all) in error.(*googleapi.Error).Header. Use
  26787. // googleapi.IsNotModified to check whether the returned error was
  26788. // because http.StatusNotModified was returned.
  26789. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  26790. gensupport.SetOptions(c.urlParams_, opts...)
  26791. res, err := c.doRequest("json")
  26792. if res != nil && res.StatusCode == http.StatusNotModified {
  26793. if res.Body != nil {
  26794. res.Body.Close()
  26795. }
  26796. return nil, &googleapi.Error{
  26797. Code: res.StatusCode,
  26798. Header: res.Header,
  26799. }
  26800. }
  26801. if err != nil {
  26802. return nil, err
  26803. }
  26804. defer googleapi.CloseBody(res)
  26805. if err := googleapi.CheckResponse(res); err != nil {
  26806. return nil, err
  26807. }
  26808. ret := &DirectorySitesListResponse{
  26809. ServerResponse: googleapi.ServerResponse{
  26810. Header: res.Header,
  26811. HTTPStatusCode: res.StatusCode,
  26812. },
  26813. }
  26814. target := &ret
  26815. if err := gensupport.DecodeResponse(target, res); err != nil {
  26816. return nil, err
  26817. }
  26818. return ret, nil
  26819. // {
  26820. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  26821. // "httpMethod": "GET",
  26822. // "id": "dfareporting.directorySites.list",
  26823. // "parameterOrder": [
  26824. // "profileId"
  26825. // ],
  26826. // "parameters": {
  26827. // "acceptsInStreamVideoPlacements": {
  26828. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26829. // "location": "query",
  26830. // "type": "boolean"
  26831. // },
  26832. // "acceptsInterstitialPlacements": {
  26833. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26834. // "location": "query",
  26835. // "type": "boolean"
  26836. // },
  26837. // "acceptsPublisherPaidPlacements": {
  26838. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  26839. // "location": "query",
  26840. // "type": "boolean"
  26841. // },
  26842. // "active": {
  26843. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  26844. // "location": "query",
  26845. // "type": "boolean"
  26846. // },
  26847. // "countryId": {
  26848. // "description": "Select only directory sites with this country ID.",
  26849. // "format": "int64",
  26850. // "location": "query",
  26851. // "type": "string"
  26852. // },
  26853. // "dfpNetworkCode": {
  26854. // "description": "Select only directory sites with this Ad Manager network code.",
  26855. // "location": "query",
  26856. // "type": "string"
  26857. // },
  26858. // "ids": {
  26859. // "description": "Select only directory sites with these IDs.",
  26860. // "format": "int64",
  26861. // "location": "query",
  26862. // "repeated": true,
  26863. // "type": "string"
  26864. // },
  26865. // "maxResults": {
  26866. // "default": "1000",
  26867. // "description": "Maximum number of results to return.",
  26868. // "format": "int32",
  26869. // "location": "query",
  26870. // "maximum": "1000",
  26871. // "minimum": "0",
  26872. // "type": "integer"
  26873. // },
  26874. // "pageToken": {
  26875. // "description": "Value of the nextPageToken from the previous result page.",
  26876. // "location": "query",
  26877. // "type": "string"
  26878. // },
  26879. // "parentId": {
  26880. // "description": "Select only directory sites with this parent ID.",
  26881. // "format": "int64",
  26882. // "location": "query",
  26883. // "type": "string"
  26884. // },
  26885. // "profileId": {
  26886. // "description": "User profile ID associated with this request.",
  26887. // "format": "int64",
  26888. // "location": "path",
  26889. // "required": true,
  26890. // "type": "string"
  26891. // },
  26892. // "searchString": {
  26893. // "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\".",
  26894. // "location": "query",
  26895. // "type": "string"
  26896. // },
  26897. // "sortField": {
  26898. // "default": "ID",
  26899. // "description": "Field by which to sort the list.",
  26900. // "enum": [
  26901. // "ID",
  26902. // "NAME"
  26903. // ],
  26904. // "enumDescriptions": [
  26905. // "",
  26906. // ""
  26907. // ],
  26908. // "location": "query",
  26909. // "type": "string"
  26910. // },
  26911. // "sortOrder": {
  26912. // "default": "ASCENDING",
  26913. // "description": "Order of sorted results.",
  26914. // "enum": [
  26915. // "ASCENDING",
  26916. // "DESCENDING"
  26917. // ],
  26918. // "enumDescriptions": [
  26919. // "",
  26920. // ""
  26921. // ],
  26922. // "location": "query",
  26923. // "type": "string"
  26924. // }
  26925. // },
  26926. // "path": "userprofiles/{profileId}/directorySites",
  26927. // "response": {
  26928. // "$ref": "DirectorySitesListResponse"
  26929. // },
  26930. // "scopes": [
  26931. // "https://www.googleapis.com/auth/dfatrafficking"
  26932. // ]
  26933. // }
  26934. }
  26935. // Pages invokes f for each page of results.
  26936. // A non-nil error returned from f will halt the iteration.
  26937. // The provided context supersedes any context provided to the Context method.
  26938. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  26939. c.ctx_ = ctx
  26940. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26941. for {
  26942. x, err := c.Do()
  26943. if err != nil {
  26944. return err
  26945. }
  26946. if err := f(x); err != nil {
  26947. return err
  26948. }
  26949. if x.NextPageToken == "" {
  26950. return nil
  26951. }
  26952. c.PageToken(x.NextPageToken)
  26953. }
  26954. }
  26955. // method id "dfareporting.dynamicTargetingKeys.delete":
  26956. type DynamicTargetingKeysDeleteCall struct {
  26957. s *Service
  26958. profileId int64
  26959. objectId int64
  26960. urlParams_ gensupport.URLParams
  26961. ctx_ context.Context
  26962. header_ http.Header
  26963. }
  26964. // Delete: Deletes an existing dynamic targeting key.
  26965. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  26966. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26967. c.profileId = profileId
  26968. c.objectId = objectId
  26969. c.urlParams_.Set("name", name)
  26970. c.urlParams_.Set("objectType", objectType)
  26971. return c
  26972. }
  26973. // Fields allows partial responses to be retrieved. See
  26974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26975. // for more information.
  26976. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  26977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26978. return c
  26979. }
  26980. // Context sets the context to be used in this call's Do method. Any
  26981. // pending HTTP request will be aborted if the provided context is
  26982. // canceled.
  26983. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  26984. c.ctx_ = ctx
  26985. return c
  26986. }
  26987. // Header returns an http.Header that can be modified by the caller to
  26988. // add HTTP headers to the request.
  26989. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  26990. if c.header_ == nil {
  26991. c.header_ = make(http.Header)
  26992. }
  26993. return c.header_
  26994. }
  26995. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  26996. reqHeaders := make(http.Header)
  26997. for k, v := range c.header_ {
  26998. reqHeaders[k] = v
  26999. }
  27000. reqHeaders.Set("User-Agent", c.s.userAgent())
  27001. var body io.Reader = nil
  27002. c.urlParams_.Set("alt", alt)
  27003. c.urlParams_.Set("prettyPrint", "false")
  27004. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  27005. urls += "?" + c.urlParams_.Encode()
  27006. req, err := http.NewRequest("DELETE", urls, body)
  27007. if err != nil {
  27008. return nil, err
  27009. }
  27010. req.Header = reqHeaders
  27011. googleapi.Expand(req.URL, map[string]string{
  27012. "profileId": strconv.FormatInt(c.profileId, 10),
  27013. "objectId": strconv.FormatInt(c.objectId, 10),
  27014. })
  27015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27016. }
  27017. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  27018. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  27019. gensupport.SetOptions(c.urlParams_, opts...)
  27020. res, err := c.doRequest("json")
  27021. if err != nil {
  27022. return err
  27023. }
  27024. defer googleapi.CloseBody(res)
  27025. if err := googleapi.CheckResponse(res); err != nil {
  27026. return err
  27027. }
  27028. return nil
  27029. // {
  27030. // "description": "Deletes an existing dynamic targeting key.",
  27031. // "httpMethod": "DELETE",
  27032. // "id": "dfareporting.dynamicTargetingKeys.delete",
  27033. // "parameterOrder": [
  27034. // "profileId",
  27035. // "objectId",
  27036. // "name",
  27037. // "objectType"
  27038. // ],
  27039. // "parameters": {
  27040. // "name": {
  27041. // "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.",
  27042. // "location": "query",
  27043. // "required": true,
  27044. // "type": "string"
  27045. // },
  27046. // "objectId": {
  27047. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  27048. // "format": "int64",
  27049. // "location": "path",
  27050. // "required": true,
  27051. // "type": "string"
  27052. // },
  27053. // "objectType": {
  27054. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  27055. // "enum": [
  27056. // "OBJECT_AD",
  27057. // "OBJECT_ADVERTISER",
  27058. // "OBJECT_CREATIVE",
  27059. // "OBJECT_PLACEMENT"
  27060. // ],
  27061. // "enumDescriptions": [
  27062. // "",
  27063. // "",
  27064. // "",
  27065. // ""
  27066. // ],
  27067. // "location": "query",
  27068. // "required": true,
  27069. // "type": "string"
  27070. // },
  27071. // "profileId": {
  27072. // "description": "User profile ID associated with this request.",
  27073. // "format": "int64",
  27074. // "location": "path",
  27075. // "required": true,
  27076. // "type": "string"
  27077. // }
  27078. // },
  27079. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  27080. // "scopes": [
  27081. // "https://www.googleapis.com/auth/dfatrafficking"
  27082. // ]
  27083. // }
  27084. }
  27085. // method id "dfareporting.dynamicTargetingKeys.insert":
  27086. type DynamicTargetingKeysInsertCall struct {
  27087. s *Service
  27088. profileId int64
  27089. dynamictargetingkey *DynamicTargetingKey
  27090. urlParams_ gensupport.URLParams
  27091. ctx_ context.Context
  27092. header_ http.Header
  27093. }
  27094. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  27095. // the advertiser level before being assigned to the advertiser's ads,
  27096. // creatives, or placements. There is a maximum of 1000 keys per
  27097. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  27098. // creative, or placement.
  27099. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  27100. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27101. c.profileId = profileId
  27102. c.dynamictargetingkey = dynamictargetingkey
  27103. return c
  27104. }
  27105. // Fields allows partial responses to be retrieved. See
  27106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27107. // for more information.
  27108. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  27109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27110. return c
  27111. }
  27112. // Context sets the context to be used in this call's Do method. Any
  27113. // pending HTTP request will be aborted if the provided context is
  27114. // canceled.
  27115. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  27116. c.ctx_ = ctx
  27117. return c
  27118. }
  27119. // Header returns an http.Header that can be modified by the caller to
  27120. // add HTTP headers to the request.
  27121. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  27122. if c.header_ == nil {
  27123. c.header_ = make(http.Header)
  27124. }
  27125. return c.header_
  27126. }
  27127. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  27128. reqHeaders := make(http.Header)
  27129. for k, v := range c.header_ {
  27130. reqHeaders[k] = v
  27131. }
  27132. reqHeaders.Set("User-Agent", c.s.userAgent())
  27133. var body io.Reader = nil
  27134. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  27135. if err != nil {
  27136. return nil, err
  27137. }
  27138. reqHeaders.Set("Content-Type", "application/json")
  27139. c.urlParams_.Set("alt", alt)
  27140. c.urlParams_.Set("prettyPrint", "false")
  27141. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  27142. urls += "?" + c.urlParams_.Encode()
  27143. req, err := http.NewRequest("POST", urls, body)
  27144. if err != nil {
  27145. return nil, err
  27146. }
  27147. req.Header = reqHeaders
  27148. googleapi.Expand(req.URL, map[string]string{
  27149. "profileId": strconv.FormatInt(c.profileId, 10),
  27150. })
  27151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27152. }
  27153. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  27154. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  27155. // non-2xx status code is an error. Response headers are in either
  27156. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  27157. // returned at all) in error.(*googleapi.Error).Header. Use
  27158. // googleapi.IsNotModified to check whether the returned error was
  27159. // because http.StatusNotModified was returned.
  27160. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  27161. gensupport.SetOptions(c.urlParams_, opts...)
  27162. res, err := c.doRequest("json")
  27163. if res != nil && res.StatusCode == http.StatusNotModified {
  27164. if res.Body != nil {
  27165. res.Body.Close()
  27166. }
  27167. return nil, &googleapi.Error{
  27168. Code: res.StatusCode,
  27169. Header: res.Header,
  27170. }
  27171. }
  27172. if err != nil {
  27173. return nil, err
  27174. }
  27175. defer googleapi.CloseBody(res)
  27176. if err := googleapi.CheckResponse(res); err != nil {
  27177. return nil, err
  27178. }
  27179. ret := &DynamicTargetingKey{
  27180. ServerResponse: googleapi.ServerResponse{
  27181. Header: res.Header,
  27182. HTTPStatusCode: res.StatusCode,
  27183. },
  27184. }
  27185. target := &ret
  27186. if err := gensupport.DecodeResponse(target, res); err != nil {
  27187. return nil, err
  27188. }
  27189. return ret, nil
  27190. // {
  27191. // "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.",
  27192. // "httpMethod": "POST",
  27193. // "id": "dfareporting.dynamicTargetingKeys.insert",
  27194. // "parameterOrder": [
  27195. // "profileId"
  27196. // ],
  27197. // "parameters": {
  27198. // "profileId": {
  27199. // "description": "User profile ID associated with this request.",
  27200. // "format": "int64",
  27201. // "location": "path",
  27202. // "required": true,
  27203. // "type": "string"
  27204. // }
  27205. // },
  27206. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  27207. // "request": {
  27208. // "$ref": "DynamicTargetingKey"
  27209. // },
  27210. // "response": {
  27211. // "$ref": "DynamicTargetingKey"
  27212. // },
  27213. // "scopes": [
  27214. // "https://www.googleapis.com/auth/dfatrafficking"
  27215. // ]
  27216. // }
  27217. }
  27218. // method id "dfareporting.dynamicTargetingKeys.list":
  27219. type DynamicTargetingKeysListCall struct {
  27220. s *Service
  27221. profileId int64
  27222. urlParams_ gensupport.URLParams
  27223. ifNoneMatch_ string
  27224. ctx_ context.Context
  27225. header_ http.Header
  27226. }
  27227. // List: Retrieves a list of dynamic targeting keys.
  27228. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  27229. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27230. c.profileId = profileId
  27231. return c
  27232. }
  27233. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27234. // dynamic targeting keys whose object has this advertiser ID.
  27235. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  27236. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27237. return c
  27238. }
  27239. // Names sets the optional parameter "names": Select only dynamic
  27240. // targeting keys exactly matching these names.
  27241. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  27242. c.urlParams_.SetMulti("names", append([]string{}, names...))
  27243. return c
  27244. }
  27245. // ObjectId sets the optional parameter "objectId": Select only dynamic
  27246. // targeting keys with this object ID.
  27247. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  27248. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  27249. return c
  27250. }
  27251. // ObjectType sets the optional parameter "objectType": Select only
  27252. // dynamic targeting keys with this object type.
  27253. //
  27254. // Possible values:
  27255. // "OBJECT_AD"
  27256. // "OBJECT_ADVERTISER"
  27257. // "OBJECT_CREATIVE"
  27258. // "OBJECT_PLACEMENT"
  27259. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  27260. c.urlParams_.Set("objectType", objectType)
  27261. return c
  27262. }
  27263. // Fields allows partial responses to be retrieved. See
  27264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27265. // for more information.
  27266. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  27267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27268. return c
  27269. }
  27270. // IfNoneMatch sets the optional parameter which makes the operation
  27271. // fail if the object's ETag matches the given value. This is useful for
  27272. // getting updates only after the object has changed since the last
  27273. // request. Use googleapi.IsNotModified to check whether the response
  27274. // error from Do is the result of In-None-Match.
  27275. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  27276. c.ifNoneMatch_ = entityTag
  27277. return c
  27278. }
  27279. // Context sets the context to be used in this call's Do method. Any
  27280. // pending HTTP request will be aborted if the provided context is
  27281. // canceled.
  27282. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  27283. c.ctx_ = ctx
  27284. return c
  27285. }
  27286. // Header returns an http.Header that can be modified by the caller to
  27287. // add HTTP headers to the request.
  27288. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  27289. if c.header_ == nil {
  27290. c.header_ = make(http.Header)
  27291. }
  27292. return c.header_
  27293. }
  27294. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  27295. reqHeaders := make(http.Header)
  27296. for k, v := range c.header_ {
  27297. reqHeaders[k] = v
  27298. }
  27299. reqHeaders.Set("User-Agent", c.s.userAgent())
  27300. if c.ifNoneMatch_ != "" {
  27301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27302. }
  27303. var body io.Reader = nil
  27304. c.urlParams_.Set("alt", alt)
  27305. c.urlParams_.Set("prettyPrint", "false")
  27306. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  27307. urls += "?" + c.urlParams_.Encode()
  27308. req, err := http.NewRequest("GET", urls, body)
  27309. if err != nil {
  27310. return nil, err
  27311. }
  27312. req.Header = reqHeaders
  27313. googleapi.Expand(req.URL, map[string]string{
  27314. "profileId": strconv.FormatInt(c.profileId, 10),
  27315. })
  27316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27317. }
  27318. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  27319. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  27320. // non-nil. Any non-2xx status code is an error. Response headers are in
  27321. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  27322. // a response was returned at all) in error.(*googleapi.Error).Header.
  27323. // Use googleapi.IsNotModified to check whether the returned error was
  27324. // because http.StatusNotModified was returned.
  27325. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  27326. gensupport.SetOptions(c.urlParams_, opts...)
  27327. res, err := c.doRequest("json")
  27328. if res != nil && res.StatusCode == http.StatusNotModified {
  27329. if res.Body != nil {
  27330. res.Body.Close()
  27331. }
  27332. return nil, &googleapi.Error{
  27333. Code: res.StatusCode,
  27334. Header: res.Header,
  27335. }
  27336. }
  27337. if err != nil {
  27338. return nil, err
  27339. }
  27340. defer googleapi.CloseBody(res)
  27341. if err := googleapi.CheckResponse(res); err != nil {
  27342. return nil, err
  27343. }
  27344. ret := &DynamicTargetingKeysListResponse{
  27345. ServerResponse: googleapi.ServerResponse{
  27346. Header: res.Header,
  27347. HTTPStatusCode: res.StatusCode,
  27348. },
  27349. }
  27350. target := &ret
  27351. if err := gensupport.DecodeResponse(target, res); err != nil {
  27352. return nil, err
  27353. }
  27354. return ret, nil
  27355. // {
  27356. // "description": "Retrieves a list of dynamic targeting keys.",
  27357. // "httpMethod": "GET",
  27358. // "id": "dfareporting.dynamicTargetingKeys.list",
  27359. // "parameterOrder": [
  27360. // "profileId"
  27361. // ],
  27362. // "parameters": {
  27363. // "advertiserId": {
  27364. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  27365. // "format": "int64",
  27366. // "location": "query",
  27367. // "type": "string"
  27368. // },
  27369. // "names": {
  27370. // "description": "Select only dynamic targeting keys exactly matching these names.",
  27371. // "location": "query",
  27372. // "repeated": true,
  27373. // "type": "string"
  27374. // },
  27375. // "objectId": {
  27376. // "description": "Select only dynamic targeting keys with this object ID.",
  27377. // "format": "int64",
  27378. // "location": "query",
  27379. // "type": "string"
  27380. // },
  27381. // "objectType": {
  27382. // "description": "Select only dynamic targeting keys with this object type.",
  27383. // "enum": [
  27384. // "OBJECT_AD",
  27385. // "OBJECT_ADVERTISER",
  27386. // "OBJECT_CREATIVE",
  27387. // "OBJECT_PLACEMENT"
  27388. // ],
  27389. // "enumDescriptions": [
  27390. // "",
  27391. // "",
  27392. // "",
  27393. // ""
  27394. // ],
  27395. // "location": "query",
  27396. // "type": "string"
  27397. // },
  27398. // "profileId": {
  27399. // "description": "User profile ID associated with this request.",
  27400. // "format": "int64",
  27401. // "location": "path",
  27402. // "required": true,
  27403. // "type": "string"
  27404. // }
  27405. // },
  27406. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  27407. // "response": {
  27408. // "$ref": "DynamicTargetingKeysListResponse"
  27409. // },
  27410. // "scopes": [
  27411. // "https://www.googleapis.com/auth/dfatrafficking"
  27412. // ]
  27413. // }
  27414. }
  27415. // method id "dfareporting.eventTags.delete":
  27416. type EventTagsDeleteCall struct {
  27417. s *Service
  27418. profileId int64
  27419. id int64
  27420. urlParams_ gensupport.URLParams
  27421. ctx_ context.Context
  27422. header_ http.Header
  27423. }
  27424. // Delete: Deletes an existing event tag.
  27425. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  27426. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27427. c.profileId = profileId
  27428. c.id = id
  27429. return c
  27430. }
  27431. // Fields allows partial responses to be retrieved. See
  27432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27433. // for more information.
  27434. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  27435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27436. return c
  27437. }
  27438. // Context sets the context to be used in this call's Do method. Any
  27439. // pending HTTP request will be aborted if the provided context is
  27440. // canceled.
  27441. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  27442. c.ctx_ = ctx
  27443. return c
  27444. }
  27445. // Header returns an http.Header that can be modified by the caller to
  27446. // add HTTP headers to the request.
  27447. func (c *EventTagsDeleteCall) Header() http.Header {
  27448. if c.header_ == nil {
  27449. c.header_ = make(http.Header)
  27450. }
  27451. return c.header_
  27452. }
  27453. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  27454. reqHeaders := make(http.Header)
  27455. for k, v := range c.header_ {
  27456. reqHeaders[k] = v
  27457. }
  27458. reqHeaders.Set("User-Agent", c.s.userAgent())
  27459. var body io.Reader = nil
  27460. c.urlParams_.Set("alt", alt)
  27461. c.urlParams_.Set("prettyPrint", "false")
  27462. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27463. urls += "?" + c.urlParams_.Encode()
  27464. req, err := http.NewRequest("DELETE", urls, body)
  27465. if err != nil {
  27466. return nil, err
  27467. }
  27468. req.Header = reqHeaders
  27469. googleapi.Expand(req.URL, map[string]string{
  27470. "profileId": strconv.FormatInt(c.profileId, 10),
  27471. "id": strconv.FormatInt(c.id, 10),
  27472. })
  27473. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27474. }
  27475. // Do executes the "dfareporting.eventTags.delete" call.
  27476. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  27477. gensupport.SetOptions(c.urlParams_, opts...)
  27478. res, err := c.doRequest("json")
  27479. if err != nil {
  27480. return err
  27481. }
  27482. defer googleapi.CloseBody(res)
  27483. if err := googleapi.CheckResponse(res); err != nil {
  27484. return err
  27485. }
  27486. return nil
  27487. // {
  27488. // "description": "Deletes an existing event tag.",
  27489. // "httpMethod": "DELETE",
  27490. // "id": "dfareporting.eventTags.delete",
  27491. // "parameterOrder": [
  27492. // "profileId",
  27493. // "id"
  27494. // ],
  27495. // "parameters": {
  27496. // "id": {
  27497. // "description": "Event tag ID.",
  27498. // "format": "int64",
  27499. // "location": "path",
  27500. // "required": true,
  27501. // "type": "string"
  27502. // },
  27503. // "profileId": {
  27504. // "description": "User profile ID associated with this request.",
  27505. // "format": "int64",
  27506. // "location": "path",
  27507. // "required": true,
  27508. // "type": "string"
  27509. // }
  27510. // },
  27511. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27512. // "scopes": [
  27513. // "https://www.googleapis.com/auth/dfatrafficking"
  27514. // ]
  27515. // }
  27516. }
  27517. // method id "dfareporting.eventTags.get":
  27518. type EventTagsGetCall struct {
  27519. s *Service
  27520. profileId int64
  27521. id int64
  27522. urlParams_ gensupport.URLParams
  27523. ifNoneMatch_ string
  27524. ctx_ context.Context
  27525. header_ http.Header
  27526. }
  27527. // Get: Gets one event tag by ID.
  27528. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  27529. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27530. c.profileId = profileId
  27531. c.id = id
  27532. return c
  27533. }
  27534. // Fields allows partial responses to be retrieved. See
  27535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27536. // for more information.
  27537. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  27538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27539. return c
  27540. }
  27541. // IfNoneMatch sets the optional parameter which makes the operation
  27542. // fail if the object's ETag matches the given value. This is useful for
  27543. // getting updates only after the object has changed since the last
  27544. // request. Use googleapi.IsNotModified to check whether the response
  27545. // error from Do is the result of In-None-Match.
  27546. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  27547. c.ifNoneMatch_ = entityTag
  27548. return c
  27549. }
  27550. // Context sets the context to be used in this call's Do method. Any
  27551. // pending HTTP request will be aborted if the provided context is
  27552. // canceled.
  27553. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  27554. c.ctx_ = ctx
  27555. return c
  27556. }
  27557. // Header returns an http.Header that can be modified by the caller to
  27558. // add HTTP headers to the request.
  27559. func (c *EventTagsGetCall) Header() http.Header {
  27560. if c.header_ == nil {
  27561. c.header_ = make(http.Header)
  27562. }
  27563. return c.header_
  27564. }
  27565. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  27566. reqHeaders := make(http.Header)
  27567. for k, v := range c.header_ {
  27568. reqHeaders[k] = v
  27569. }
  27570. reqHeaders.Set("User-Agent", c.s.userAgent())
  27571. if c.ifNoneMatch_ != "" {
  27572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27573. }
  27574. var body io.Reader = nil
  27575. c.urlParams_.Set("alt", alt)
  27576. c.urlParams_.Set("prettyPrint", "false")
  27577. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27578. urls += "?" + c.urlParams_.Encode()
  27579. req, err := http.NewRequest("GET", urls, body)
  27580. if err != nil {
  27581. return nil, err
  27582. }
  27583. req.Header = reqHeaders
  27584. googleapi.Expand(req.URL, map[string]string{
  27585. "profileId": strconv.FormatInt(c.profileId, 10),
  27586. "id": strconv.FormatInt(c.id, 10),
  27587. })
  27588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27589. }
  27590. // Do executes the "dfareporting.eventTags.get" call.
  27591. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27592. // code is an error. Response headers are in either
  27593. // *EventTag.ServerResponse.Header or (if a response was returned at
  27594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27595. // to check whether the returned error was because
  27596. // http.StatusNotModified was returned.
  27597. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27598. gensupport.SetOptions(c.urlParams_, opts...)
  27599. res, err := c.doRequest("json")
  27600. if res != nil && res.StatusCode == http.StatusNotModified {
  27601. if res.Body != nil {
  27602. res.Body.Close()
  27603. }
  27604. return nil, &googleapi.Error{
  27605. Code: res.StatusCode,
  27606. Header: res.Header,
  27607. }
  27608. }
  27609. if err != nil {
  27610. return nil, err
  27611. }
  27612. defer googleapi.CloseBody(res)
  27613. if err := googleapi.CheckResponse(res); err != nil {
  27614. return nil, err
  27615. }
  27616. ret := &EventTag{
  27617. ServerResponse: googleapi.ServerResponse{
  27618. Header: res.Header,
  27619. HTTPStatusCode: res.StatusCode,
  27620. },
  27621. }
  27622. target := &ret
  27623. if err := gensupport.DecodeResponse(target, res); err != nil {
  27624. return nil, err
  27625. }
  27626. return ret, nil
  27627. // {
  27628. // "description": "Gets one event tag by ID.",
  27629. // "httpMethod": "GET",
  27630. // "id": "dfareporting.eventTags.get",
  27631. // "parameterOrder": [
  27632. // "profileId",
  27633. // "id"
  27634. // ],
  27635. // "parameters": {
  27636. // "id": {
  27637. // "description": "Event tag ID.",
  27638. // "format": "int64",
  27639. // "location": "path",
  27640. // "required": true,
  27641. // "type": "string"
  27642. // },
  27643. // "profileId": {
  27644. // "description": "User profile ID associated with this request.",
  27645. // "format": "int64",
  27646. // "location": "path",
  27647. // "required": true,
  27648. // "type": "string"
  27649. // }
  27650. // },
  27651. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27652. // "response": {
  27653. // "$ref": "EventTag"
  27654. // },
  27655. // "scopes": [
  27656. // "https://www.googleapis.com/auth/dfatrafficking"
  27657. // ]
  27658. // }
  27659. }
  27660. // method id "dfareporting.eventTags.insert":
  27661. type EventTagsInsertCall struct {
  27662. s *Service
  27663. profileId int64
  27664. eventtag *EventTag
  27665. urlParams_ gensupport.URLParams
  27666. ctx_ context.Context
  27667. header_ http.Header
  27668. }
  27669. // Insert: Inserts a new event tag.
  27670. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  27671. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27672. c.profileId = profileId
  27673. c.eventtag = eventtag
  27674. return c
  27675. }
  27676. // Fields allows partial responses to be retrieved. See
  27677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27678. // for more information.
  27679. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  27680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27681. return c
  27682. }
  27683. // Context sets the context to be used in this call's Do method. Any
  27684. // pending HTTP request will be aborted if the provided context is
  27685. // canceled.
  27686. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  27687. c.ctx_ = ctx
  27688. return c
  27689. }
  27690. // Header returns an http.Header that can be modified by the caller to
  27691. // add HTTP headers to the request.
  27692. func (c *EventTagsInsertCall) Header() http.Header {
  27693. if c.header_ == nil {
  27694. c.header_ = make(http.Header)
  27695. }
  27696. return c.header_
  27697. }
  27698. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  27699. reqHeaders := make(http.Header)
  27700. for k, v := range c.header_ {
  27701. reqHeaders[k] = v
  27702. }
  27703. reqHeaders.Set("User-Agent", c.s.userAgent())
  27704. var body io.Reader = nil
  27705. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27706. if err != nil {
  27707. return nil, err
  27708. }
  27709. reqHeaders.Set("Content-Type", "application/json")
  27710. c.urlParams_.Set("alt", alt)
  27711. c.urlParams_.Set("prettyPrint", "false")
  27712. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27713. urls += "?" + c.urlParams_.Encode()
  27714. req, err := http.NewRequest("POST", urls, body)
  27715. if err != nil {
  27716. return nil, err
  27717. }
  27718. req.Header = reqHeaders
  27719. googleapi.Expand(req.URL, map[string]string{
  27720. "profileId": strconv.FormatInt(c.profileId, 10),
  27721. })
  27722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27723. }
  27724. // Do executes the "dfareporting.eventTags.insert" call.
  27725. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27726. // code is an error. Response headers are in either
  27727. // *EventTag.ServerResponse.Header or (if a response was returned at
  27728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27729. // to check whether the returned error was because
  27730. // http.StatusNotModified was returned.
  27731. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27732. gensupport.SetOptions(c.urlParams_, opts...)
  27733. res, err := c.doRequest("json")
  27734. if res != nil && res.StatusCode == http.StatusNotModified {
  27735. if res.Body != nil {
  27736. res.Body.Close()
  27737. }
  27738. return nil, &googleapi.Error{
  27739. Code: res.StatusCode,
  27740. Header: res.Header,
  27741. }
  27742. }
  27743. if err != nil {
  27744. return nil, err
  27745. }
  27746. defer googleapi.CloseBody(res)
  27747. if err := googleapi.CheckResponse(res); err != nil {
  27748. return nil, err
  27749. }
  27750. ret := &EventTag{
  27751. ServerResponse: googleapi.ServerResponse{
  27752. Header: res.Header,
  27753. HTTPStatusCode: res.StatusCode,
  27754. },
  27755. }
  27756. target := &ret
  27757. if err := gensupport.DecodeResponse(target, res); err != nil {
  27758. return nil, err
  27759. }
  27760. return ret, nil
  27761. // {
  27762. // "description": "Inserts a new event tag.",
  27763. // "httpMethod": "POST",
  27764. // "id": "dfareporting.eventTags.insert",
  27765. // "parameterOrder": [
  27766. // "profileId"
  27767. // ],
  27768. // "parameters": {
  27769. // "profileId": {
  27770. // "description": "User profile ID associated with this request.",
  27771. // "format": "int64",
  27772. // "location": "path",
  27773. // "required": true,
  27774. // "type": "string"
  27775. // }
  27776. // },
  27777. // "path": "userprofiles/{profileId}/eventTags",
  27778. // "request": {
  27779. // "$ref": "EventTag"
  27780. // },
  27781. // "response": {
  27782. // "$ref": "EventTag"
  27783. // },
  27784. // "scopes": [
  27785. // "https://www.googleapis.com/auth/dfatrafficking"
  27786. // ]
  27787. // }
  27788. }
  27789. // method id "dfareporting.eventTags.list":
  27790. type EventTagsListCall struct {
  27791. s *Service
  27792. profileId int64
  27793. urlParams_ gensupport.URLParams
  27794. ifNoneMatch_ string
  27795. ctx_ context.Context
  27796. header_ http.Header
  27797. }
  27798. // List: Retrieves a list of event tags, possibly filtered.
  27799. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  27800. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27801. c.profileId = profileId
  27802. return c
  27803. }
  27804. // AdId sets the optional parameter "adId": Select only event tags that
  27805. // belong to this ad.
  27806. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  27807. c.urlParams_.Set("adId", fmt.Sprint(adId))
  27808. return c
  27809. }
  27810. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27811. // event tags that belong to this advertiser.
  27812. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  27813. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27814. return c
  27815. }
  27816. // CampaignId sets the optional parameter "campaignId": Select only
  27817. // event tags that belong to this campaign.
  27818. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  27819. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  27820. return c
  27821. }
  27822. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  27823. // Examine only the specified campaign or advertiser's event tags for
  27824. // matching selector criteria. When set to false, the parent advertiser
  27825. // and parent campaign of the specified ad or campaign is examined as
  27826. // well. In addition, when set to false, the status field is examined as
  27827. // well, along with the enabledByDefault field. This parameter can not
  27828. // be set to true when adId is specified as ads do not define their own
  27829. // even tags.
  27830. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  27831. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  27832. return c
  27833. }
  27834. // Enabled sets the optional parameter "enabled": Select only enabled
  27835. // event tags. What is considered enabled or disabled depends on the
  27836. // definitionsOnly parameter. When definitionsOnly is set to true, only
  27837. // the specified advertiser or campaign's event tags' enabledByDefault
  27838. // field is examined. When definitionsOnly is set to false, the
  27839. // specified ad or specified campaign's parent advertiser's or parent
  27840. // campaign's event tags' enabledByDefault and status fields are
  27841. // examined as well.
  27842. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  27843. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  27844. return c
  27845. }
  27846. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  27847. // only event tags with the specified event tag types. Event tag types
  27848. // can be used to specify whether to use a third-party pixel, a
  27849. // third-party JavaScript URL, or a third-party click-through URL for
  27850. // either impression or click tracking.
  27851. //
  27852. // Possible values:
  27853. // "CLICK_THROUGH_EVENT_TAG"
  27854. // "IMPRESSION_IMAGE_EVENT_TAG"
  27855. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27856. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  27857. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  27858. return c
  27859. }
  27860. // Ids sets the optional parameter "ids": Select only event tags with
  27861. // these IDs.
  27862. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  27863. var ids_ []string
  27864. for _, v := range ids {
  27865. ids_ = append(ids_, fmt.Sprint(v))
  27866. }
  27867. c.urlParams_.SetMulti("ids", ids_)
  27868. return c
  27869. }
  27870. // SearchString sets the optional parameter "searchString": Allows
  27871. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27872. // example, "eventtag*2015" will return objects with names like
  27873. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  27874. // 2015". Most of the searches also add wildcards implicitly at the
  27875. // start and the end of the search string. For example, a search string
  27876. // of "eventtag" will match objects with name "my eventtag", "eventtag
  27877. // 2015", or simply "eventtag".
  27878. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  27879. c.urlParams_.Set("searchString", searchString)
  27880. return c
  27881. }
  27882. // SortField sets the optional parameter "sortField": Field by which to
  27883. // sort the list.
  27884. //
  27885. // Possible values:
  27886. // "ID" (default)
  27887. // "NAME"
  27888. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  27889. c.urlParams_.Set("sortField", sortField)
  27890. return c
  27891. }
  27892. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27893. // results.
  27894. //
  27895. // Possible values:
  27896. // "ASCENDING" (default)
  27897. // "DESCENDING"
  27898. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  27899. c.urlParams_.Set("sortOrder", sortOrder)
  27900. return c
  27901. }
  27902. // Fields allows partial responses to be retrieved. See
  27903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27904. // for more information.
  27905. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  27906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27907. return c
  27908. }
  27909. // IfNoneMatch sets the optional parameter which makes the operation
  27910. // fail if the object's ETag matches the given value. This is useful for
  27911. // getting updates only after the object has changed since the last
  27912. // request. Use googleapi.IsNotModified to check whether the response
  27913. // error from Do is the result of In-None-Match.
  27914. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  27915. c.ifNoneMatch_ = entityTag
  27916. return c
  27917. }
  27918. // Context sets the context to be used in this call's Do method. Any
  27919. // pending HTTP request will be aborted if the provided context is
  27920. // canceled.
  27921. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  27922. c.ctx_ = ctx
  27923. return c
  27924. }
  27925. // Header returns an http.Header that can be modified by the caller to
  27926. // add HTTP headers to the request.
  27927. func (c *EventTagsListCall) Header() http.Header {
  27928. if c.header_ == nil {
  27929. c.header_ = make(http.Header)
  27930. }
  27931. return c.header_
  27932. }
  27933. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  27934. reqHeaders := make(http.Header)
  27935. for k, v := range c.header_ {
  27936. reqHeaders[k] = v
  27937. }
  27938. reqHeaders.Set("User-Agent", c.s.userAgent())
  27939. if c.ifNoneMatch_ != "" {
  27940. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27941. }
  27942. var body io.Reader = nil
  27943. c.urlParams_.Set("alt", alt)
  27944. c.urlParams_.Set("prettyPrint", "false")
  27945. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27946. urls += "?" + c.urlParams_.Encode()
  27947. req, err := http.NewRequest("GET", urls, body)
  27948. if err != nil {
  27949. return nil, err
  27950. }
  27951. req.Header = reqHeaders
  27952. googleapi.Expand(req.URL, map[string]string{
  27953. "profileId": strconv.FormatInt(c.profileId, 10),
  27954. })
  27955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27956. }
  27957. // Do executes the "dfareporting.eventTags.list" call.
  27958. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  27959. // non-2xx status code is an error. Response headers are in either
  27960. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  27961. // returned at all) in error.(*googleapi.Error).Header. Use
  27962. // googleapi.IsNotModified to check whether the returned error was
  27963. // because http.StatusNotModified was returned.
  27964. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  27965. gensupport.SetOptions(c.urlParams_, opts...)
  27966. res, err := c.doRequest("json")
  27967. if res != nil && res.StatusCode == http.StatusNotModified {
  27968. if res.Body != nil {
  27969. res.Body.Close()
  27970. }
  27971. return nil, &googleapi.Error{
  27972. Code: res.StatusCode,
  27973. Header: res.Header,
  27974. }
  27975. }
  27976. if err != nil {
  27977. return nil, err
  27978. }
  27979. defer googleapi.CloseBody(res)
  27980. if err := googleapi.CheckResponse(res); err != nil {
  27981. return nil, err
  27982. }
  27983. ret := &EventTagsListResponse{
  27984. ServerResponse: googleapi.ServerResponse{
  27985. Header: res.Header,
  27986. HTTPStatusCode: res.StatusCode,
  27987. },
  27988. }
  27989. target := &ret
  27990. if err := gensupport.DecodeResponse(target, res); err != nil {
  27991. return nil, err
  27992. }
  27993. return ret, nil
  27994. // {
  27995. // "description": "Retrieves a list of event tags, possibly filtered.",
  27996. // "httpMethod": "GET",
  27997. // "id": "dfareporting.eventTags.list",
  27998. // "parameterOrder": [
  27999. // "profileId"
  28000. // ],
  28001. // "parameters": {
  28002. // "adId": {
  28003. // "description": "Select only event tags that belong to this ad.",
  28004. // "format": "int64",
  28005. // "location": "query",
  28006. // "type": "string"
  28007. // },
  28008. // "advertiserId": {
  28009. // "description": "Select only event tags that belong to this advertiser.",
  28010. // "format": "int64",
  28011. // "location": "query",
  28012. // "type": "string"
  28013. // },
  28014. // "campaignId": {
  28015. // "description": "Select only event tags that belong to this campaign.",
  28016. // "format": "int64",
  28017. // "location": "query",
  28018. // "type": "string"
  28019. // },
  28020. // "definitionsOnly": {
  28021. // "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.",
  28022. // "location": "query",
  28023. // "type": "boolean"
  28024. // },
  28025. // "enabled": {
  28026. // "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.",
  28027. // "location": "query",
  28028. // "type": "boolean"
  28029. // },
  28030. // "eventTagTypes": {
  28031. // "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.",
  28032. // "enum": [
  28033. // "CLICK_THROUGH_EVENT_TAG",
  28034. // "IMPRESSION_IMAGE_EVENT_TAG",
  28035. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  28036. // ],
  28037. // "enumDescriptions": [
  28038. // "",
  28039. // "",
  28040. // ""
  28041. // ],
  28042. // "location": "query",
  28043. // "repeated": true,
  28044. // "type": "string"
  28045. // },
  28046. // "ids": {
  28047. // "description": "Select only event tags with these IDs.",
  28048. // "format": "int64",
  28049. // "location": "query",
  28050. // "repeated": true,
  28051. // "type": "string"
  28052. // },
  28053. // "profileId": {
  28054. // "description": "User profile ID associated with this request.",
  28055. // "format": "int64",
  28056. // "location": "path",
  28057. // "required": true,
  28058. // "type": "string"
  28059. // },
  28060. // "searchString": {
  28061. // "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\".",
  28062. // "location": "query",
  28063. // "type": "string"
  28064. // },
  28065. // "sortField": {
  28066. // "default": "ID",
  28067. // "description": "Field by which to sort the list.",
  28068. // "enum": [
  28069. // "ID",
  28070. // "NAME"
  28071. // ],
  28072. // "enumDescriptions": [
  28073. // "",
  28074. // ""
  28075. // ],
  28076. // "location": "query",
  28077. // "type": "string"
  28078. // },
  28079. // "sortOrder": {
  28080. // "default": "ASCENDING",
  28081. // "description": "Order of sorted results.",
  28082. // "enum": [
  28083. // "ASCENDING",
  28084. // "DESCENDING"
  28085. // ],
  28086. // "enumDescriptions": [
  28087. // "",
  28088. // ""
  28089. // ],
  28090. // "location": "query",
  28091. // "type": "string"
  28092. // }
  28093. // },
  28094. // "path": "userprofiles/{profileId}/eventTags",
  28095. // "response": {
  28096. // "$ref": "EventTagsListResponse"
  28097. // },
  28098. // "scopes": [
  28099. // "https://www.googleapis.com/auth/dfatrafficking"
  28100. // ]
  28101. // }
  28102. }
  28103. // method id "dfareporting.eventTags.patch":
  28104. type EventTagsPatchCall struct {
  28105. s *Service
  28106. profileId int64
  28107. eventtag *EventTag
  28108. urlParams_ gensupport.URLParams
  28109. ctx_ context.Context
  28110. header_ http.Header
  28111. }
  28112. // Patch: Updates an existing event tag. This method supports patch
  28113. // semantics.
  28114. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  28115. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28116. c.profileId = profileId
  28117. c.urlParams_.Set("id", fmt.Sprint(id))
  28118. c.eventtag = eventtag
  28119. return c
  28120. }
  28121. // Fields allows partial responses to be retrieved. See
  28122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28123. // for more information.
  28124. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  28125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28126. return c
  28127. }
  28128. // Context sets the context to be used in this call's Do method. Any
  28129. // pending HTTP request will be aborted if the provided context is
  28130. // canceled.
  28131. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  28132. c.ctx_ = ctx
  28133. return c
  28134. }
  28135. // Header returns an http.Header that can be modified by the caller to
  28136. // add HTTP headers to the request.
  28137. func (c *EventTagsPatchCall) Header() http.Header {
  28138. if c.header_ == nil {
  28139. c.header_ = make(http.Header)
  28140. }
  28141. return c.header_
  28142. }
  28143. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  28144. reqHeaders := make(http.Header)
  28145. for k, v := range c.header_ {
  28146. reqHeaders[k] = v
  28147. }
  28148. reqHeaders.Set("User-Agent", c.s.userAgent())
  28149. var body io.Reader = nil
  28150. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  28151. if err != nil {
  28152. return nil, err
  28153. }
  28154. reqHeaders.Set("Content-Type", "application/json")
  28155. c.urlParams_.Set("alt", alt)
  28156. c.urlParams_.Set("prettyPrint", "false")
  28157. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  28158. urls += "?" + c.urlParams_.Encode()
  28159. req, err := http.NewRequest("PATCH", urls, body)
  28160. if err != nil {
  28161. return nil, err
  28162. }
  28163. req.Header = reqHeaders
  28164. googleapi.Expand(req.URL, map[string]string{
  28165. "profileId": strconv.FormatInt(c.profileId, 10),
  28166. })
  28167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28168. }
  28169. // Do executes the "dfareporting.eventTags.patch" call.
  28170. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  28171. // code is an error. Response headers are in either
  28172. // *EventTag.ServerResponse.Header or (if a response was returned at
  28173. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28174. // to check whether the returned error was because
  28175. // http.StatusNotModified was returned.
  28176. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  28177. gensupport.SetOptions(c.urlParams_, opts...)
  28178. res, err := c.doRequest("json")
  28179. if res != nil && res.StatusCode == http.StatusNotModified {
  28180. if res.Body != nil {
  28181. res.Body.Close()
  28182. }
  28183. return nil, &googleapi.Error{
  28184. Code: res.StatusCode,
  28185. Header: res.Header,
  28186. }
  28187. }
  28188. if err != nil {
  28189. return nil, err
  28190. }
  28191. defer googleapi.CloseBody(res)
  28192. if err := googleapi.CheckResponse(res); err != nil {
  28193. return nil, err
  28194. }
  28195. ret := &EventTag{
  28196. ServerResponse: googleapi.ServerResponse{
  28197. Header: res.Header,
  28198. HTTPStatusCode: res.StatusCode,
  28199. },
  28200. }
  28201. target := &ret
  28202. if err := gensupport.DecodeResponse(target, res); err != nil {
  28203. return nil, err
  28204. }
  28205. return ret, nil
  28206. // {
  28207. // "description": "Updates an existing event tag. This method supports patch semantics.",
  28208. // "httpMethod": "PATCH",
  28209. // "id": "dfareporting.eventTags.patch",
  28210. // "parameterOrder": [
  28211. // "profileId",
  28212. // "id"
  28213. // ],
  28214. // "parameters": {
  28215. // "id": {
  28216. // "description": "Event tag ID.",
  28217. // "format": "int64",
  28218. // "location": "query",
  28219. // "required": true,
  28220. // "type": "string"
  28221. // },
  28222. // "profileId": {
  28223. // "description": "User profile ID associated with this request.",
  28224. // "format": "int64",
  28225. // "location": "path",
  28226. // "required": true,
  28227. // "type": "string"
  28228. // }
  28229. // },
  28230. // "path": "userprofiles/{profileId}/eventTags",
  28231. // "request": {
  28232. // "$ref": "EventTag"
  28233. // },
  28234. // "response": {
  28235. // "$ref": "EventTag"
  28236. // },
  28237. // "scopes": [
  28238. // "https://www.googleapis.com/auth/dfatrafficking"
  28239. // ]
  28240. // }
  28241. }
  28242. // method id "dfareporting.eventTags.update":
  28243. type EventTagsUpdateCall struct {
  28244. s *Service
  28245. profileId int64
  28246. eventtag *EventTag
  28247. urlParams_ gensupport.URLParams
  28248. ctx_ context.Context
  28249. header_ http.Header
  28250. }
  28251. // Update: Updates an existing event tag.
  28252. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  28253. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28254. c.profileId = profileId
  28255. c.eventtag = eventtag
  28256. return c
  28257. }
  28258. // Fields allows partial responses to be retrieved. See
  28259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28260. // for more information.
  28261. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  28262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28263. return c
  28264. }
  28265. // Context sets the context to be used in this call's Do method. Any
  28266. // pending HTTP request will be aborted if the provided context is
  28267. // canceled.
  28268. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  28269. c.ctx_ = ctx
  28270. return c
  28271. }
  28272. // Header returns an http.Header that can be modified by the caller to
  28273. // add HTTP headers to the request.
  28274. func (c *EventTagsUpdateCall) Header() http.Header {
  28275. if c.header_ == nil {
  28276. c.header_ = make(http.Header)
  28277. }
  28278. return c.header_
  28279. }
  28280. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  28281. reqHeaders := make(http.Header)
  28282. for k, v := range c.header_ {
  28283. reqHeaders[k] = v
  28284. }
  28285. reqHeaders.Set("User-Agent", c.s.userAgent())
  28286. var body io.Reader = nil
  28287. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  28288. if err != nil {
  28289. return nil, err
  28290. }
  28291. reqHeaders.Set("Content-Type", "application/json")
  28292. c.urlParams_.Set("alt", alt)
  28293. c.urlParams_.Set("prettyPrint", "false")
  28294. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  28295. urls += "?" + c.urlParams_.Encode()
  28296. req, err := http.NewRequest("PUT", urls, body)
  28297. if err != nil {
  28298. return nil, err
  28299. }
  28300. req.Header = reqHeaders
  28301. googleapi.Expand(req.URL, map[string]string{
  28302. "profileId": strconv.FormatInt(c.profileId, 10),
  28303. })
  28304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28305. }
  28306. // Do executes the "dfareporting.eventTags.update" call.
  28307. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  28308. // code is an error. Response headers are in either
  28309. // *EventTag.ServerResponse.Header or (if a response was returned at
  28310. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28311. // to check whether the returned error was because
  28312. // http.StatusNotModified was returned.
  28313. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  28314. gensupport.SetOptions(c.urlParams_, opts...)
  28315. res, err := c.doRequest("json")
  28316. if res != nil && res.StatusCode == http.StatusNotModified {
  28317. if res.Body != nil {
  28318. res.Body.Close()
  28319. }
  28320. return nil, &googleapi.Error{
  28321. Code: res.StatusCode,
  28322. Header: res.Header,
  28323. }
  28324. }
  28325. if err != nil {
  28326. return nil, err
  28327. }
  28328. defer googleapi.CloseBody(res)
  28329. if err := googleapi.CheckResponse(res); err != nil {
  28330. return nil, err
  28331. }
  28332. ret := &EventTag{
  28333. ServerResponse: googleapi.ServerResponse{
  28334. Header: res.Header,
  28335. HTTPStatusCode: res.StatusCode,
  28336. },
  28337. }
  28338. target := &ret
  28339. if err := gensupport.DecodeResponse(target, res); err != nil {
  28340. return nil, err
  28341. }
  28342. return ret, nil
  28343. // {
  28344. // "description": "Updates an existing event tag.",
  28345. // "httpMethod": "PUT",
  28346. // "id": "dfareporting.eventTags.update",
  28347. // "parameterOrder": [
  28348. // "profileId"
  28349. // ],
  28350. // "parameters": {
  28351. // "profileId": {
  28352. // "description": "User profile ID associated with this request.",
  28353. // "format": "int64",
  28354. // "location": "path",
  28355. // "required": true,
  28356. // "type": "string"
  28357. // }
  28358. // },
  28359. // "path": "userprofiles/{profileId}/eventTags",
  28360. // "request": {
  28361. // "$ref": "EventTag"
  28362. // },
  28363. // "response": {
  28364. // "$ref": "EventTag"
  28365. // },
  28366. // "scopes": [
  28367. // "https://www.googleapis.com/auth/dfatrafficking"
  28368. // ]
  28369. // }
  28370. }
  28371. // method id "dfareporting.files.get":
  28372. type FilesGetCall struct {
  28373. s *Service
  28374. reportId int64
  28375. fileId int64
  28376. urlParams_ gensupport.URLParams
  28377. ifNoneMatch_ string
  28378. ctx_ context.Context
  28379. header_ http.Header
  28380. }
  28381. // Get: Retrieves a report file by its report ID and file ID. This
  28382. // method supports media download.
  28383. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  28384. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28385. c.reportId = reportId
  28386. c.fileId = fileId
  28387. return c
  28388. }
  28389. // Fields allows partial responses to be retrieved. See
  28390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28391. // for more information.
  28392. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  28393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28394. return c
  28395. }
  28396. // IfNoneMatch sets the optional parameter which makes the operation
  28397. // fail if the object's ETag matches the given value. This is useful for
  28398. // getting updates only after the object has changed since the last
  28399. // request. Use googleapi.IsNotModified to check whether the response
  28400. // error from Do is the result of In-None-Match.
  28401. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  28402. c.ifNoneMatch_ = entityTag
  28403. return c
  28404. }
  28405. // Context sets the context to be used in this call's Do and Download
  28406. // methods. Any pending HTTP request will be aborted if the provided
  28407. // context is canceled.
  28408. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  28409. c.ctx_ = ctx
  28410. return c
  28411. }
  28412. // Header returns an http.Header that can be modified by the caller to
  28413. // add HTTP headers to the request.
  28414. func (c *FilesGetCall) Header() http.Header {
  28415. if c.header_ == nil {
  28416. c.header_ = make(http.Header)
  28417. }
  28418. return c.header_
  28419. }
  28420. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  28421. reqHeaders := make(http.Header)
  28422. for k, v := range c.header_ {
  28423. reqHeaders[k] = v
  28424. }
  28425. reqHeaders.Set("User-Agent", c.s.userAgent())
  28426. if c.ifNoneMatch_ != "" {
  28427. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28428. }
  28429. var body io.Reader = nil
  28430. c.urlParams_.Set("alt", alt)
  28431. c.urlParams_.Set("prettyPrint", "false")
  28432. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  28433. urls += "?" + c.urlParams_.Encode()
  28434. req, err := http.NewRequest("GET", urls, body)
  28435. if err != nil {
  28436. return nil, err
  28437. }
  28438. req.Header = reqHeaders
  28439. googleapi.Expand(req.URL, map[string]string{
  28440. "reportId": strconv.FormatInt(c.reportId, 10),
  28441. "fileId": strconv.FormatInt(c.fileId, 10),
  28442. })
  28443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28444. }
  28445. // Download fetches the API endpoint's "media" value, instead of the normal
  28446. // API response value. If the returned error is nil, the Response is guaranteed to
  28447. // have a 2xx status code. Callers must close the Response.Body as usual.
  28448. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  28449. gensupport.SetOptions(c.urlParams_, opts...)
  28450. res, err := c.doRequest("media")
  28451. if err != nil {
  28452. return nil, err
  28453. }
  28454. if err := googleapi.CheckMediaResponse(res); err != nil {
  28455. res.Body.Close()
  28456. return nil, err
  28457. }
  28458. return res, nil
  28459. }
  28460. // Do executes the "dfareporting.files.get" call.
  28461. // Exactly one of *File or error will be non-nil. Any non-2xx status
  28462. // code is an error. Response headers are in either
  28463. // *File.ServerResponse.Header or (if a response was returned at all) in
  28464. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28465. // whether the returned error was because http.StatusNotModified was
  28466. // returned.
  28467. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  28468. gensupport.SetOptions(c.urlParams_, opts...)
  28469. res, err := c.doRequest("json")
  28470. if res != nil && res.StatusCode == http.StatusNotModified {
  28471. if res.Body != nil {
  28472. res.Body.Close()
  28473. }
  28474. return nil, &googleapi.Error{
  28475. Code: res.StatusCode,
  28476. Header: res.Header,
  28477. }
  28478. }
  28479. if err != nil {
  28480. return nil, err
  28481. }
  28482. defer googleapi.CloseBody(res)
  28483. if err := googleapi.CheckResponse(res); err != nil {
  28484. return nil, err
  28485. }
  28486. ret := &File{
  28487. ServerResponse: googleapi.ServerResponse{
  28488. Header: res.Header,
  28489. HTTPStatusCode: res.StatusCode,
  28490. },
  28491. }
  28492. target := &ret
  28493. if err := gensupport.DecodeResponse(target, res); err != nil {
  28494. return nil, err
  28495. }
  28496. return ret, nil
  28497. // {
  28498. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  28499. // "httpMethod": "GET",
  28500. // "id": "dfareporting.files.get",
  28501. // "parameterOrder": [
  28502. // "reportId",
  28503. // "fileId"
  28504. // ],
  28505. // "parameters": {
  28506. // "fileId": {
  28507. // "description": "The ID of the report file.",
  28508. // "format": "int64",
  28509. // "location": "path",
  28510. // "required": true,
  28511. // "type": "string"
  28512. // },
  28513. // "reportId": {
  28514. // "description": "The ID of the report.",
  28515. // "format": "int64",
  28516. // "location": "path",
  28517. // "required": true,
  28518. // "type": "string"
  28519. // }
  28520. // },
  28521. // "path": "reports/{reportId}/files/{fileId}",
  28522. // "response": {
  28523. // "$ref": "File"
  28524. // },
  28525. // "scopes": [
  28526. // "https://www.googleapis.com/auth/dfareporting"
  28527. // ],
  28528. // "supportsMediaDownload": true
  28529. // }
  28530. }
  28531. // method id "dfareporting.files.list":
  28532. type FilesListCall struct {
  28533. s *Service
  28534. profileId int64
  28535. urlParams_ gensupport.URLParams
  28536. ifNoneMatch_ string
  28537. ctx_ context.Context
  28538. header_ http.Header
  28539. }
  28540. // List: Lists files for a user profile.
  28541. func (r *FilesService) List(profileId int64) *FilesListCall {
  28542. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28543. c.profileId = profileId
  28544. return c
  28545. }
  28546. // MaxResults sets the optional parameter "maxResults": Maximum number
  28547. // of results to return.
  28548. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  28549. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28550. return c
  28551. }
  28552. // PageToken sets the optional parameter "pageToken": The value of the
  28553. // nextToken from the previous result page.
  28554. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  28555. c.urlParams_.Set("pageToken", pageToken)
  28556. return c
  28557. }
  28558. // Scope sets the optional parameter "scope": The scope that defines
  28559. // which results are returned.
  28560. //
  28561. // Possible values:
  28562. // "ALL" - All files in account.
  28563. // "MINE" (default) - My files.
  28564. // "SHARED_WITH_ME" - Files shared with me.
  28565. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  28566. c.urlParams_.Set("scope", scope)
  28567. return c
  28568. }
  28569. // SortField sets the optional parameter "sortField": The field by which
  28570. // to sort the list.
  28571. //
  28572. // Possible values:
  28573. // "ID" - Sort by file ID.
  28574. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  28575. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  28576. c.urlParams_.Set("sortField", sortField)
  28577. return c
  28578. }
  28579. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28580. // results.
  28581. //
  28582. // Possible values:
  28583. // "ASCENDING" - Ascending order.
  28584. // "DESCENDING" (default) - Descending order.
  28585. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  28586. c.urlParams_.Set("sortOrder", sortOrder)
  28587. return c
  28588. }
  28589. // Fields allows partial responses to be retrieved. See
  28590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28591. // for more information.
  28592. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  28593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28594. return c
  28595. }
  28596. // IfNoneMatch sets the optional parameter which makes the operation
  28597. // fail if the object's ETag matches the given value. This is useful for
  28598. // getting updates only after the object has changed since the last
  28599. // request. Use googleapi.IsNotModified to check whether the response
  28600. // error from Do is the result of In-None-Match.
  28601. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  28602. c.ifNoneMatch_ = entityTag
  28603. return c
  28604. }
  28605. // Context sets the context to be used in this call's Do method. Any
  28606. // pending HTTP request will be aborted if the provided context is
  28607. // canceled.
  28608. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  28609. c.ctx_ = ctx
  28610. return c
  28611. }
  28612. // Header returns an http.Header that can be modified by the caller to
  28613. // add HTTP headers to the request.
  28614. func (c *FilesListCall) Header() http.Header {
  28615. if c.header_ == nil {
  28616. c.header_ = make(http.Header)
  28617. }
  28618. return c.header_
  28619. }
  28620. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  28621. reqHeaders := make(http.Header)
  28622. for k, v := range c.header_ {
  28623. reqHeaders[k] = v
  28624. }
  28625. reqHeaders.Set("User-Agent", c.s.userAgent())
  28626. if c.ifNoneMatch_ != "" {
  28627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28628. }
  28629. var body io.Reader = nil
  28630. c.urlParams_.Set("alt", alt)
  28631. c.urlParams_.Set("prettyPrint", "false")
  28632. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  28633. urls += "?" + c.urlParams_.Encode()
  28634. req, err := http.NewRequest("GET", urls, body)
  28635. if err != nil {
  28636. return nil, err
  28637. }
  28638. req.Header = reqHeaders
  28639. googleapi.Expand(req.URL, map[string]string{
  28640. "profileId": strconv.FormatInt(c.profileId, 10),
  28641. })
  28642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28643. }
  28644. // Do executes the "dfareporting.files.list" call.
  28645. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  28646. // code is an error. Response headers are in either
  28647. // *FileList.ServerResponse.Header or (if a response was returned at
  28648. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28649. // to check whether the returned error was because
  28650. // http.StatusNotModified was returned.
  28651. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  28652. gensupport.SetOptions(c.urlParams_, opts...)
  28653. res, err := c.doRequest("json")
  28654. if res != nil && res.StatusCode == http.StatusNotModified {
  28655. if res.Body != nil {
  28656. res.Body.Close()
  28657. }
  28658. return nil, &googleapi.Error{
  28659. Code: res.StatusCode,
  28660. Header: res.Header,
  28661. }
  28662. }
  28663. if err != nil {
  28664. return nil, err
  28665. }
  28666. defer googleapi.CloseBody(res)
  28667. if err := googleapi.CheckResponse(res); err != nil {
  28668. return nil, err
  28669. }
  28670. ret := &FileList{
  28671. ServerResponse: googleapi.ServerResponse{
  28672. Header: res.Header,
  28673. HTTPStatusCode: res.StatusCode,
  28674. },
  28675. }
  28676. target := &ret
  28677. if err := gensupport.DecodeResponse(target, res); err != nil {
  28678. return nil, err
  28679. }
  28680. return ret, nil
  28681. // {
  28682. // "description": "Lists files for a user profile.",
  28683. // "httpMethod": "GET",
  28684. // "id": "dfareporting.files.list",
  28685. // "parameterOrder": [
  28686. // "profileId"
  28687. // ],
  28688. // "parameters": {
  28689. // "maxResults": {
  28690. // "default": "10",
  28691. // "description": "Maximum number of results to return.",
  28692. // "format": "int32",
  28693. // "location": "query",
  28694. // "maximum": "10",
  28695. // "minimum": "0",
  28696. // "type": "integer"
  28697. // },
  28698. // "pageToken": {
  28699. // "description": "The value of the nextToken from the previous result page.",
  28700. // "location": "query",
  28701. // "type": "string"
  28702. // },
  28703. // "profileId": {
  28704. // "description": "The DFA profile ID.",
  28705. // "format": "int64",
  28706. // "location": "path",
  28707. // "required": true,
  28708. // "type": "string"
  28709. // },
  28710. // "scope": {
  28711. // "default": "MINE",
  28712. // "description": "The scope that defines which results are returned.",
  28713. // "enum": [
  28714. // "ALL",
  28715. // "MINE",
  28716. // "SHARED_WITH_ME"
  28717. // ],
  28718. // "enumDescriptions": [
  28719. // "All files in account.",
  28720. // "My files.",
  28721. // "Files shared with me."
  28722. // ],
  28723. // "location": "query",
  28724. // "type": "string"
  28725. // },
  28726. // "sortField": {
  28727. // "default": "LAST_MODIFIED_TIME",
  28728. // "description": "The field by which to sort the list.",
  28729. // "enum": [
  28730. // "ID",
  28731. // "LAST_MODIFIED_TIME"
  28732. // ],
  28733. // "enumDescriptions": [
  28734. // "Sort by file ID.",
  28735. // "Sort by 'lastmodifiedAt' field."
  28736. // ],
  28737. // "location": "query",
  28738. // "type": "string"
  28739. // },
  28740. // "sortOrder": {
  28741. // "default": "DESCENDING",
  28742. // "description": "Order of sorted results.",
  28743. // "enum": [
  28744. // "ASCENDING",
  28745. // "DESCENDING"
  28746. // ],
  28747. // "enumDescriptions": [
  28748. // "Ascending order.",
  28749. // "Descending order."
  28750. // ],
  28751. // "location": "query",
  28752. // "type": "string"
  28753. // }
  28754. // },
  28755. // "path": "userprofiles/{profileId}/files",
  28756. // "response": {
  28757. // "$ref": "FileList"
  28758. // },
  28759. // "scopes": [
  28760. // "https://www.googleapis.com/auth/dfareporting"
  28761. // ]
  28762. // }
  28763. }
  28764. // Pages invokes f for each page of results.
  28765. // A non-nil error returned from f will halt the iteration.
  28766. // The provided context supersedes any context provided to the Context method.
  28767. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  28768. c.ctx_ = ctx
  28769. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28770. for {
  28771. x, err := c.Do()
  28772. if err != nil {
  28773. return err
  28774. }
  28775. if err := f(x); err != nil {
  28776. return err
  28777. }
  28778. if x.NextPageToken == "" {
  28779. return nil
  28780. }
  28781. c.PageToken(x.NextPageToken)
  28782. }
  28783. }
  28784. // method id "dfareporting.floodlightActivities.delete":
  28785. type FloodlightActivitiesDeleteCall struct {
  28786. s *Service
  28787. profileId int64
  28788. id int64
  28789. urlParams_ gensupport.URLParams
  28790. ctx_ context.Context
  28791. header_ http.Header
  28792. }
  28793. // Delete: Deletes an existing floodlight activity.
  28794. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  28795. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28796. c.profileId = profileId
  28797. c.id = id
  28798. return c
  28799. }
  28800. // Fields allows partial responses to be retrieved. See
  28801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28802. // for more information.
  28803. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  28804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28805. return c
  28806. }
  28807. // Context sets the context to be used in this call's Do method. Any
  28808. // pending HTTP request will be aborted if the provided context is
  28809. // canceled.
  28810. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  28811. c.ctx_ = ctx
  28812. return c
  28813. }
  28814. // Header returns an http.Header that can be modified by the caller to
  28815. // add HTTP headers to the request.
  28816. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  28817. if c.header_ == nil {
  28818. c.header_ = make(http.Header)
  28819. }
  28820. return c.header_
  28821. }
  28822. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28823. reqHeaders := make(http.Header)
  28824. for k, v := range c.header_ {
  28825. reqHeaders[k] = v
  28826. }
  28827. reqHeaders.Set("User-Agent", c.s.userAgent())
  28828. var body io.Reader = nil
  28829. c.urlParams_.Set("alt", alt)
  28830. c.urlParams_.Set("prettyPrint", "false")
  28831. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28832. urls += "?" + c.urlParams_.Encode()
  28833. req, err := http.NewRequest("DELETE", urls, body)
  28834. if err != nil {
  28835. return nil, err
  28836. }
  28837. req.Header = reqHeaders
  28838. googleapi.Expand(req.URL, map[string]string{
  28839. "profileId": strconv.FormatInt(c.profileId, 10),
  28840. "id": strconv.FormatInt(c.id, 10),
  28841. })
  28842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28843. }
  28844. // Do executes the "dfareporting.floodlightActivities.delete" call.
  28845. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  28846. gensupport.SetOptions(c.urlParams_, opts...)
  28847. res, err := c.doRequest("json")
  28848. if err != nil {
  28849. return err
  28850. }
  28851. defer googleapi.CloseBody(res)
  28852. if err := googleapi.CheckResponse(res); err != nil {
  28853. return err
  28854. }
  28855. return nil
  28856. // {
  28857. // "description": "Deletes an existing floodlight activity.",
  28858. // "httpMethod": "DELETE",
  28859. // "id": "dfareporting.floodlightActivities.delete",
  28860. // "parameterOrder": [
  28861. // "profileId",
  28862. // "id"
  28863. // ],
  28864. // "parameters": {
  28865. // "id": {
  28866. // "description": "Floodlight activity ID.",
  28867. // "format": "int64",
  28868. // "location": "path",
  28869. // "required": true,
  28870. // "type": "string"
  28871. // },
  28872. // "profileId": {
  28873. // "description": "User profile ID associated with this request.",
  28874. // "format": "int64",
  28875. // "location": "path",
  28876. // "required": true,
  28877. // "type": "string"
  28878. // }
  28879. // },
  28880. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28881. // "scopes": [
  28882. // "https://www.googleapis.com/auth/dfatrafficking"
  28883. // ]
  28884. // }
  28885. }
  28886. // method id "dfareporting.floodlightActivities.generatetag":
  28887. type FloodlightActivitiesGeneratetagCall struct {
  28888. s *Service
  28889. profileId int64
  28890. urlParams_ gensupport.URLParams
  28891. ctx_ context.Context
  28892. header_ http.Header
  28893. }
  28894. // Generatetag: Generates a tag for a floodlight activity.
  28895. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  28896. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28897. c.profileId = profileId
  28898. return c
  28899. }
  28900. // FloodlightActivityId sets the optional parameter
  28901. // "floodlightActivityId": Floodlight activity ID for which we want to
  28902. // generate a tag.
  28903. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  28904. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  28905. return c
  28906. }
  28907. // Fields allows partial responses to be retrieved. See
  28908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28909. // for more information.
  28910. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  28911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28912. return c
  28913. }
  28914. // Context sets the context to be used in this call's Do method. Any
  28915. // pending HTTP request will be aborted if the provided context is
  28916. // canceled.
  28917. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  28918. c.ctx_ = ctx
  28919. return c
  28920. }
  28921. // Header returns an http.Header that can be modified by the caller to
  28922. // add HTTP headers to the request.
  28923. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  28924. if c.header_ == nil {
  28925. c.header_ = make(http.Header)
  28926. }
  28927. return c.header_
  28928. }
  28929. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  28930. reqHeaders := make(http.Header)
  28931. for k, v := range c.header_ {
  28932. reqHeaders[k] = v
  28933. }
  28934. reqHeaders.Set("User-Agent", c.s.userAgent())
  28935. var body io.Reader = nil
  28936. c.urlParams_.Set("alt", alt)
  28937. c.urlParams_.Set("prettyPrint", "false")
  28938. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  28939. urls += "?" + c.urlParams_.Encode()
  28940. req, err := http.NewRequest("POST", urls, body)
  28941. if err != nil {
  28942. return nil, err
  28943. }
  28944. req.Header = reqHeaders
  28945. googleapi.Expand(req.URL, map[string]string{
  28946. "profileId": strconv.FormatInt(c.profileId, 10),
  28947. })
  28948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28949. }
  28950. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  28951. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  28952. // be non-nil. Any non-2xx status code is an error. Response headers are
  28953. // in either
  28954. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  28955. // a response was returned at all) in error.(*googleapi.Error).Header.
  28956. // Use googleapi.IsNotModified to check whether the returned error was
  28957. // because http.StatusNotModified was returned.
  28958. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  28959. gensupport.SetOptions(c.urlParams_, opts...)
  28960. res, err := c.doRequest("json")
  28961. if res != nil && res.StatusCode == http.StatusNotModified {
  28962. if res.Body != nil {
  28963. res.Body.Close()
  28964. }
  28965. return nil, &googleapi.Error{
  28966. Code: res.StatusCode,
  28967. Header: res.Header,
  28968. }
  28969. }
  28970. if err != nil {
  28971. return nil, err
  28972. }
  28973. defer googleapi.CloseBody(res)
  28974. if err := googleapi.CheckResponse(res); err != nil {
  28975. return nil, err
  28976. }
  28977. ret := &FloodlightActivitiesGenerateTagResponse{
  28978. ServerResponse: googleapi.ServerResponse{
  28979. Header: res.Header,
  28980. HTTPStatusCode: res.StatusCode,
  28981. },
  28982. }
  28983. target := &ret
  28984. if err := gensupport.DecodeResponse(target, res); err != nil {
  28985. return nil, err
  28986. }
  28987. return ret, nil
  28988. // {
  28989. // "description": "Generates a tag for a floodlight activity.",
  28990. // "httpMethod": "POST",
  28991. // "id": "dfareporting.floodlightActivities.generatetag",
  28992. // "parameterOrder": [
  28993. // "profileId"
  28994. // ],
  28995. // "parameters": {
  28996. // "floodlightActivityId": {
  28997. // "description": "Floodlight activity ID for which we want to generate a tag.",
  28998. // "format": "int64",
  28999. // "location": "query",
  29000. // "type": "string"
  29001. // },
  29002. // "profileId": {
  29003. // "description": "User profile ID associated with this request.",
  29004. // "format": "int64",
  29005. // "location": "path",
  29006. // "required": true,
  29007. // "type": "string"
  29008. // }
  29009. // },
  29010. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  29011. // "response": {
  29012. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  29013. // },
  29014. // "scopes": [
  29015. // "https://www.googleapis.com/auth/dfatrafficking"
  29016. // ]
  29017. // }
  29018. }
  29019. // method id "dfareporting.floodlightActivities.get":
  29020. type FloodlightActivitiesGetCall struct {
  29021. s *Service
  29022. profileId int64
  29023. id int64
  29024. urlParams_ gensupport.URLParams
  29025. ifNoneMatch_ string
  29026. ctx_ context.Context
  29027. header_ http.Header
  29028. }
  29029. // Get: Gets one floodlight activity by ID.
  29030. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  29031. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29032. c.profileId = profileId
  29033. c.id = id
  29034. return c
  29035. }
  29036. // Fields allows partial responses to be retrieved. See
  29037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29038. // for more information.
  29039. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  29040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29041. return c
  29042. }
  29043. // IfNoneMatch sets the optional parameter which makes the operation
  29044. // fail if the object's ETag matches the given value. This is useful for
  29045. // getting updates only after the object has changed since the last
  29046. // request. Use googleapi.IsNotModified to check whether the response
  29047. // error from Do is the result of In-None-Match.
  29048. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  29049. c.ifNoneMatch_ = entityTag
  29050. return c
  29051. }
  29052. // Context sets the context to be used in this call's Do method. Any
  29053. // pending HTTP request will be aborted if the provided context is
  29054. // canceled.
  29055. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  29056. c.ctx_ = ctx
  29057. return c
  29058. }
  29059. // Header returns an http.Header that can be modified by the caller to
  29060. // add HTTP headers to the request.
  29061. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  29062. if c.header_ == nil {
  29063. c.header_ = make(http.Header)
  29064. }
  29065. return c.header_
  29066. }
  29067. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  29068. reqHeaders := make(http.Header)
  29069. for k, v := range c.header_ {
  29070. reqHeaders[k] = v
  29071. }
  29072. reqHeaders.Set("User-Agent", c.s.userAgent())
  29073. if c.ifNoneMatch_ != "" {
  29074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29075. }
  29076. var body io.Reader = nil
  29077. c.urlParams_.Set("alt", alt)
  29078. c.urlParams_.Set("prettyPrint", "false")
  29079. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  29080. urls += "?" + c.urlParams_.Encode()
  29081. req, err := http.NewRequest("GET", urls, body)
  29082. if err != nil {
  29083. return nil, err
  29084. }
  29085. req.Header = reqHeaders
  29086. googleapi.Expand(req.URL, map[string]string{
  29087. "profileId": strconv.FormatInt(c.profileId, 10),
  29088. "id": strconv.FormatInt(c.id, 10),
  29089. })
  29090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29091. }
  29092. // Do executes the "dfareporting.floodlightActivities.get" call.
  29093. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29094. // non-2xx status code is an error. Response headers are in either
  29095. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29096. // returned at all) in error.(*googleapi.Error).Header. Use
  29097. // googleapi.IsNotModified to check whether the returned error was
  29098. // because http.StatusNotModified was returned.
  29099. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29100. gensupport.SetOptions(c.urlParams_, opts...)
  29101. res, err := c.doRequest("json")
  29102. if res != nil && res.StatusCode == http.StatusNotModified {
  29103. if res.Body != nil {
  29104. res.Body.Close()
  29105. }
  29106. return nil, &googleapi.Error{
  29107. Code: res.StatusCode,
  29108. Header: res.Header,
  29109. }
  29110. }
  29111. if err != nil {
  29112. return nil, err
  29113. }
  29114. defer googleapi.CloseBody(res)
  29115. if err := googleapi.CheckResponse(res); err != nil {
  29116. return nil, err
  29117. }
  29118. ret := &FloodlightActivity{
  29119. ServerResponse: googleapi.ServerResponse{
  29120. Header: res.Header,
  29121. HTTPStatusCode: res.StatusCode,
  29122. },
  29123. }
  29124. target := &ret
  29125. if err := gensupport.DecodeResponse(target, res); err != nil {
  29126. return nil, err
  29127. }
  29128. return ret, nil
  29129. // {
  29130. // "description": "Gets one floodlight activity by ID.",
  29131. // "httpMethod": "GET",
  29132. // "id": "dfareporting.floodlightActivities.get",
  29133. // "parameterOrder": [
  29134. // "profileId",
  29135. // "id"
  29136. // ],
  29137. // "parameters": {
  29138. // "id": {
  29139. // "description": "Floodlight activity ID.",
  29140. // "format": "int64",
  29141. // "location": "path",
  29142. // "required": true,
  29143. // "type": "string"
  29144. // },
  29145. // "profileId": {
  29146. // "description": "User profile ID associated with this request.",
  29147. // "format": "int64",
  29148. // "location": "path",
  29149. // "required": true,
  29150. // "type": "string"
  29151. // }
  29152. // },
  29153. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  29154. // "response": {
  29155. // "$ref": "FloodlightActivity"
  29156. // },
  29157. // "scopes": [
  29158. // "https://www.googleapis.com/auth/dfatrafficking"
  29159. // ]
  29160. // }
  29161. }
  29162. // method id "dfareporting.floodlightActivities.insert":
  29163. type FloodlightActivitiesInsertCall struct {
  29164. s *Service
  29165. profileId int64
  29166. floodlightactivity *FloodlightActivity
  29167. urlParams_ gensupport.URLParams
  29168. ctx_ context.Context
  29169. header_ http.Header
  29170. }
  29171. // Insert: Inserts a new floodlight activity.
  29172. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  29173. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29174. c.profileId = profileId
  29175. c.floodlightactivity = floodlightactivity
  29176. return c
  29177. }
  29178. // Fields allows partial responses to be retrieved. See
  29179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29180. // for more information.
  29181. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  29182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29183. return c
  29184. }
  29185. // Context sets the context to be used in this call's Do method. Any
  29186. // pending HTTP request will be aborted if the provided context is
  29187. // canceled.
  29188. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  29189. c.ctx_ = ctx
  29190. return c
  29191. }
  29192. // Header returns an http.Header that can be modified by the caller to
  29193. // add HTTP headers to the request.
  29194. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  29195. if c.header_ == nil {
  29196. c.header_ = make(http.Header)
  29197. }
  29198. return c.header_
  29199. }
  29200. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  29201. reqHeaders := make(http.Header)
  29202. for k, v := range c.header_ {
  29203. reqHeaders[k] = v
  29204. }
  29205. reqHeaders.Set("User-Agent", c.s.userAgent())
  29206. var body io.Reader = nil
  29207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29208. if err != nil {
  29209. return nil, err
  29210. }
  29211. reqHeaders.Set("Content-Type", "application/json")
  29212. c.urlParams_.Set("alt", alt)
  29213. c.urlParams_.Set("prettyPrint", "false")
  29214. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29215. urls += "?" + c.urlParams_.Encode()
  29216. req, err := http.NewRequest("POST", urls, body)
  29217. if err != nil {
  29218. return nil, err
  29219. }
  29220. req.Header = reqHeaders
  29221. googleapi.Expand(req.URL, map[string]string{
  29222. "profileId": strconv.FormatInt(c.profileId, 10),
  29223. })
  29224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29225. }
  29226. // Do executes the "dfareporting.floodlightActivities.insert" call.
  29227. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29228. // non-2xx status code is an error. Response headers are in either
  29229. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29230. // returned at all) in error.(*googleapi.Error).Header. Use
  29231. // googleapi.IsNotModified to check whether the returned error was
  29232. // because http.StatusNotModified was returned.
  29233. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29234. gensupport.SetOptions(c.urlParams_, opts...)
  29235. res, err := c.doRequest("json")
  29236. if res != nil && res.StatusCode == http.StatusNotModified {
  29237. if res.Body != nil {
  29238. res.Body.Close()
  29239. }
  29240. return nil, &googleapi.Error{
  29241. Code: res.StatusCode,
  29242. Header: res.Header,
  29243. }
  29244. }
  29245. if err != nil {
  29246. return nil, err
  29247. }
  29248. defer googleapi.CloseBody(res)
  29249. if err := googleapi.CheckResponse(res); err != nil {
  29250. return nil, err
  29251. }
  29252. ret := &FloodlightActivity{
  29253. ServerResponse: googleapi.ServerResponse{
  29254. Header: res.Header,
  29255. HTTPStatusCode: res.StatusCode,
  29256. },
  29257. }
  29258. target := &ret
  29259. if err := gensupport.DecodeResponse(target, res); err != nil {
  29260. return nil, err
  29261. }
  29262. return ret, nil
  29263. // {
  29264. // "description": "Inserts a new floodlight activity.",
  29265. // "httpMethod": "POST",
  29266. // "id": "dfareporting.floodlightActivities.insert",
  29267. // "parameterOrder": [
  29268. // "profileId"
  29269. // ],
  29270. // "parameters": {
  29271. // "profileId": {
  29272. // "description": "User profile ID associated with this request.",
  29273. // "format": "int64",
  29274. // "location": "path",
  29275. // "required": true,
  29276. // "type": "string"
  29277. // }
  29278. // },
  29279. // "path": "userprofiles/{profileId}/floodlightActivities",
  29280. // "request": {
  29281. // "$ref": "FloodlightActivity"
  29282. // },
  29283. // "response": {
  29284. // "$ref": "FloodlightActivity"
  29285. // },
  29286. // "scopes": [
  29287. // "https://www.googleapis.com/auth/dfatrafficking"
  29288. // ]
  29289. // }
  29290. }
  29291. // method id "dfareporting.floodlightActivities.list":
  29292. type FloodlightActivitiesListCall struct {
  29293. s *Service
  29294. profileId int64
  29295. urlParams_ gensupport.URLParams
  29296. ifNoneMatch_ string
  29297. ctx_ context.Context
  29298. header_ http.Header
  29299. }
  29300. // List: Retrieves a list of floodlight activities, possibly filtered.
  29301. // This method supports paging.
  29302. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  29303. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29304. c.profileId = profileId
  29305. return c
  29306. }
  29307. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29308. // floodlight activities for the specified advertiser ID. Must specify
  29309. // either ids, advertiserId, or floodlightConfigurationId for a
  29310. // non-empty result.
  29311. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  29312. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29313. return c
  29314. }
  29315. // FloodlightActivityGroupIds sets the optional parameter
  29316. // "floodlightActivityGroupIds": Select only floodlight activities with
  29317. // the specified floodlight activity group IDs.
  29318. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  29319. var floodlightActivityGroupIds_ []string
  29320. for _, v := range floodlightActivityGroupIds {
  29321. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  29322. }
  29323. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  29324. return c
  29325. }
  29326. // FloodlightActivityGroupName sets the optional parameter
  29327. // "floodlightActivityGroupName": Select only floodlight activities with
  29328. // the specified floodlight activity group name.
  29329. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  29330. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  29331. return c
  29332. }
  29333. // FloodlightActivityGroupTagString sets the optional parameter
  29334. // "floodlightActivityGroupTagString": Select only floodlight activities
  29335. // with the specified floodlight activity group tag string.
  29336. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  29337. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  29338. return c
  29339. }
  29340. // FloodlightActivityGroupType sets the optional parameter
  29341. // "floodlightActivityGroupType": Select only floodlight activities with
  29342. // the specified floodlight activity group type.
  29343. //
  29344. // Possible values:
  29345. // "COUNTER"
  29346. // "SALE"
  29347. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  29348. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  29349. return c
  29350. }
  29351. // FloodlightConfigurationId sets the optional parameter
  29352. // "floodlightConfigurationId": Select only floodlight activities for
  29353. // the specified floodlight configuration ID. Must specify either ids,
  29354. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29355. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  29356. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29357. return c
  29358. }
  29359. // Ids sets the optional parameter "ids": Select only floodlight
  29360. // activities with the specified IDs. Must specify either ids,
  29361. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29362. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  29363. var ids_ []string
  29364. for _, v := range ids {
  29365. ids_ = append(ids_, fmt.Sprint(v))
  29366. }
  29367. c.urlParams_.SetMulti("ids", ids_)
  29368. return c
  29369. }
  29370. // MaxResults sets the optional parameter "maxResults": Maximum number
  29371. // of results to return.
  29372. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  29373. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29374. return c
  29375. }
  29376. // PageToken sets the optional parameter "pageToken": Value of the
  29377. // nextPageToken from the previous result page.
  29378. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  29379. c.urlParams_.Set("pageToken", pageToken)
  29380. return c
  29381. }
  29382. // SearchString sets the optional parameter "searchString": Allows
  29383. // searching for objects by name or ID. Wildcards (*) are allowed. For
  29384. // example, "floodlightactivity*2015" will return objects with names
  29385. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  29386. // or simply "floodlightactivity 2015". Most of the searches also add
  29387. // wildcards implicitly at the start and the end of the search string.
  29388. // For example, a search string of "floodlightactivity" will match
  29389. // objects with name "my floodlightactivity activity",
  29390. // "floodlightactivity 2015", or simply "floodlightactivity".
  29391. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  29392. c.urlParams_.Set("searchString", searchString)
  29393. return c
  29394. }
  29395. // SortField sets the optional parameter "sortField": Field by which to
  29396. // sort the list.
  29397. //
  29398. // Possible values:
  29399. // "ID" (default)
  29400. // "NAME"
  29401. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  29402. c.urlParams_.Set("sortField", sortField)
  29403. return c
  29404. }
  29405. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29406. // results.
  29407. //
  29408. // Possible values:
  29409. // "ASCENDING" (default)
  29410. // "DESCENDING"
  29411. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  29412. c.urlParams_.Set("sortOrder", sortOrder)
  29413. return c
  29414. }
  29415. // TagString sets the optional parameter "tagString": Select only
  29416. // floodlight activities with the specified tag string.
  29417. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  29418. c.urlParams_.Set("tagString", tagString)
  29419. return c
  29420. }
  29421. // Fields allows partial responses to be retrieved. See
  29422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29423. // for more information.
  29424. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  29425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29426. return c
  29427. }
  29428. // IfNoneMatch sets the optional parameter which makes the operation
  29429. // fail if the object's ETag matches the given value. This is useful for
  29430. // getting updates only after the object has changed since the last
  29431. // request. Use googleapi.IsNotModified to check whether the response
  29432. // error from Do is the result of In-None-Match.
  29433. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  29434. c.ifNoneMatch_ = entityTag
  29435. return c
  29436. }
  29437. // Context sets the context to be used in this call's Do method. Any
  29438. // pending HTTP request will be aborted if the provided context is
  29439. // canceled.
  29440. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  29441. c.ctx_ = ctx
  29442. return c
  29443. }
  29444. // Header returns an http.Header that can be modified by the caller to
  29445. // add HTTP headers to the request.
  29446. func (c *FloodlightActivitiesListCall) Header() http.Header {
  29447. if c.header_ == nil {
  29448. c.header_ = make(http.Header)
  29449. }
  29450. return c.header_
  29451. }
  29452. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  29453. reqHeaders := make(http.Header)
  29454. for k, v := range c.header_ {
  29455. reqHeaders[k] = v
  29456. }
  29457. reqHeaders.Set("User-Agent", c.s.userAgent())
  29458. if c.ifNoneMatch_ != "" {
  29459. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29460. }
  29461. var body io.Reader = nil
  29462. c.urlParams_.Set("alt", alt)
  29463. c.urlParams_.Set("prettyPrint", "false")
  29464. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29465. urls += "?" + c.urlParams_.Encode()
  29466. req, err := http.NewRequest("GET", urls, body)
  29467. if err != nil {
  29468. return nil, err
  29469. }
  29470. req.Header = reqHeaders
  29471. googleapi.Expand(req.URL, map[string]string{
  29472. "profileId": strconv.FormatInt(c.profileId, 10),
  29473. })
  29474. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29475. }
  29476. // Do executes the "dfareporting.floodlightActivities.list" call.
  29477. // Exactly one of *FloodlightActivitiesListResponse or error will be
  29478. // non-nil. Any non-2xx status code is an error. Response headers are in
  29479. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  29480. // a response was returned at all) in error.(*googleapi.Error).Header.
  29481. // Use googleapi.IsNotModified to check whether the returned error was
  29482. // because http.StatusNotModified was returned.
  29483. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  29484. gensupport.SetOptions(c.urlParams_, opts...)
  29485. res, err := c.doRequest("json")
  29486. if res != nil && res.StatusCode == http.StatusNotModified {
  29487. if res.Body != nil {
  29488. res.Body.Close()
  29489. }
  29490. return nil, &googleapi.Error{
  29491. Code: res.StatusCode,
  29492. Header: res.Header,
  29493. }
  29494. }
  29495. if err != nil {
  29496. return nil, err
  29497. }
  29498. defer googleapi.CloseBody(res)
  29499. if err := googleapi.CheckResponse(res); err != nil {
  29500. return nil, err
  29501. }
  29502. ret := &FloodlightActivitiesListResponse{
  29503. ServerResponse: googleapi.ServerResponse{
  29504. Header: res.Header,
  29505. HTTPStatusCode: res.StatusCode,
  29506. },
  29507. }
  29508. target := &ret
  29509. if err := gensupport.DecodeResponse(target, res); err != nil {
  29510. return nil, err
  29511. }
  29512. return ret, nil
  29513. // {
  29514. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  29515. // "httpMethod": "GET",
  29516. // "id": "dfareporting.floodlightActivities.list",
  29517. // "parameterOrder": [
  29518. // "profileId"
  29519. // ],
  29520. // "parameters": {
  29521. // "advertiserId": {
  29522. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29523. // "format": "int64",
  29524. // "location": "query",
  29525. // "type": "string"
  29526. // },
  29527. // "floodlightActivityGroupIds": {
  29528. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  29529. // "format": "int64",
  29530. // "location": "query",
  29531. // "repeated": true,
  29532. // "type": "string"
  29533. // },
  29534. // "floodlightActivityGroupName": {
  29535. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  29536. // "location": "query",
  29537. // "type": "string"
  29538. // },
  29539. // "floodlightActivityGroupTagString": {
  29540. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  29541. // "location": "query",
  29542. // "type": "string"
  29543. // },
  29544. // "floodlightActivityGroupType": {
  29545. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  29546. // "enum": [
  29547. // "COUNTER",
  29548. // "SALE"
  29549. // ],
  29550. // "enumDescriptions": [
  29551. // "",
  29552. // ""
  29553. // ],
  29554. // "location": "query",
  29555. // "type": "string"
  29556. // },
  29557. // "floodlightConfigurationId": {
  29558. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29559. // "format": "int64",
  29560. // "location": "query",
  29561. // "type": "string"
  29562. // },
  29563. // "ids": {
  29564. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29565. // "format": "int64",
  29566. // "location": "query",
  29567. // "repeated": true,
  29568. // "type": "string"
  29569. // },
  29570. // "maxResults": {
  29571. // "default": "1000",
  29572. // "description": "Maximum number of results to return.",
  29573. // "format": "int32",
  29574. // "location": "query",
  29575. // "maximum": "1000",
  29576. // "minimum": "0",
  29577. // "type": "integer"
  29578. // },
  29579. // "pageToken": {
  29580. // "description": "Value of the nextPageToken from the previous result page.",
  29581. // "location": "query",
  29582. // "type": "string"
  29583. // },
  29584. // "profileId": {
  29585. // "description": "User profile ID associated with this request.",
  29586. // "format": "int64",
  29587. // "location": "path",
  29588. // "required": true,
  29589. // "type": "string"
  29590. // },
  29591. // "searchString": {
  29592. // "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\".",
  29593. // "location": "query",
  29594. // "type": "string"
  29595. // },
  29596. // "sortField": {
  29597. // "default": "ID",
  29598. // "description": "Field by which to sort the list.",
  29599. // "enum": [
  29600. // "ID",
  29601. // "NAME"
  29602. // ],
  29603. // "enumDescriptions": [
  29604. // "",
  29605. // ""
  29606. // ],
  29607. // "location": "query",
  29608. // "type": "string"
  29609. // },
  29610. // "sortOrder": {
  29611. // "default": "ASCENDING",
  29612. // "description": "Order of sorted results.",
  29613. // "enum": [
  29614. // "ASCENDING",
  29615. // "DESCENDING"
  29616. // ],
  29617. // "enumDescriptions": [
  29618. // "",
  29619. // ""
  29620. // ],
  29621. // "location": "query",
  29622. // "type": "string"
  29623. // },
  29624. // "tagString": {
  29625. // "description": "Select only floodlight activities with the specified tag string.",
  29626. // "location": "query",
  29627. // "type": "string"
  29628. // }
  29629. // },
  29630. // "path": "userprofiles/{profileId}/floodlightActivities",
  29631. // "response": {
  29632. // "$ref": "FloodlightActivitiesListResponse"
  29633. // },
  29634. // "scopes": [
  29635. // "https://www.googleapis.com/auth/dfatrafficking"
  29636. // ]
  29637. // }
  29638. }
  29639. // Pages invokes f for each page of results.
  29640. // A non-nil error returned from f will halt the iteration.
  29641. // The provided context supersedes any context provided to the Context method.
  29642. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  29643. c.ctx_ = ctx
  29644. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29645. for {
  29646. x, err := c.Do()
  29647. if err != nil {
  29648. return err
  29649. }
  29650. if err := f(x); err != nil {
  29651. return err
  29652. }
  29653. if x.NextPageToken == "" {
  29654. return nil
  29655. }
  29656. c.PageToken(x.NextPageToken)
  29657. }
  29658. }
  29659. // method id "dfareporting.floodlightActivities.patch":
  29660. type FloodlightActivitiesPatchCall struct {
  29661. s *Service
  29662. profileId int64
  29663. floodlightactivity *FloodlightActivity
  29664. urlParams_ gensupport.URLParams
  29665. ctx_ context.Context
  29666. header_ http.Header
  29667. }
  29668. // Patch: Updates an existing floodlight activity. This method supports
  29669. // patch semantics.
  29670. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  29671. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29672. c.profileId = profileId
  29673. c.urlParams_.Set("id", fmt.Sprint(id))
  29674. c.floodlightactivity = floodlightactivity
  29675. return c
  29676. }
  29677. // Fields allows partial responses to be retrieved. See
  29678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29679. // for more information.
  29680. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  29681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29682. return c
  29683. }
  29684. // Context sets the context to be used in this call's Do method. Any
  29685. // pending HTTP request will be aborted if the provided context is
  29686. // canceled.
  29687. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  29688. c.ctx_ = ctx
  29689. return c
  29690. }
  29691. // Header returns an http.Header that can be modified by the caller to
  29692. // add HTTP headers to the request.
  29693. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  29694. if c.header_ == nil {
  29695. c.header_ = make(http.Header)
  29696. }
  29697. return c.header_
  29698. }
  29699. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  29700. reqHeaders := make(http.Header)
  29701. for k, v := range c.header_ {
  29702. reqHeaders[k] = v
  29703. }
  29704. reqHeaders.Set("User-Agent", c.s.userAgent())
  29705. var body io.Reader = nil
  29706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29707. if err != nil {
  29708. return nil, err
  29709. }
  29710. reqHeaders.Set("Content-Type", "application/json")
  29711. c.urlParams_.Set("alt", alt)
  29712. c.urlParams_.Set("prettyPrint", "false")
  29713. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29714. urls += "?" + c.urlParams_.Encode()
  29715. req, err := http.NewRequest("PATCH", urls, body)
  29716. if err != nil {
  29717. return nil, err
  29718. }
  29719. req.Header = reqHeaders
  29720. googleapi.Expand(req.URL, map[string]string{
  29721. "profileId": strconv.FormatInt(c.profileId, 10),
  29722. })
  29723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29724. }
  29725. // Do executes the "dfareporting.floodlightActivities.patch" call.
  29726. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29727. // non-2xx status code is an error. Response headers are in either
  29728. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29729. // returned at all) in error.(*googleapi.Error).Header. Use
  29730. // googleapi.IsNotModified to check whether the returned error was
  29731. // because http.StatusNotModified was returned.
  29732. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29733. gensupport.SetOptions(c.urlParams_, opts...)
  29734. res, err := c.doRequest("json")
  29735. if res != nil && res.StatusCode == http.StatusNotModified {
  29736. if res.Body != nil {
  29737. res.Body.Close()
  29738. }
  29739. return nil, &googleapi.Error{
  29740. Code: res.StatusCode,
  29741. Header: res.Header,
  29742. }
  29743. }
  29744. if err != nil {
  29745. return nil, err
  29746. }
  29747. defer googleapi.CloseBody(res)
  29748. if err := googleapi.CheckResponse(res); err != nil {
  29749. return nil, err
  29750. }
  29751. ret := &FloodlightActivity{
  29752. ServerResponse: googleapi.ServerResponse{
  29753. Header: res.Header,
  29754. HTTPStatusCode: res.StatusCode,
  29755. },
  29756. }
  29757. target := &ret
  29758. if err := gensupport.DecodeResponse(target, res); err != nil {
  29759. return nil, err
  29760. }
  29761. return ret, nil
  29762. // {
  29763. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  29764. // "httpMethod": "PATCH",
  29765. // "id": "dfareporting.floodlightActivities.patch",
  29766. // "parameterOrder": [
  29767. // "profileId",
  29768. // "id"
  29769. // ],
  29770. // "parameters": {
  29771. // "id": {
  29772. // "description": "Floodlight activity ID.",
  29773. // "format": "int64",
  29774. // "location": "query",
  29775. // "required": true,
  29776. // "type": "string"
  29777. // },
  29778. // "profileId": {
  29779. // "description": "User profile ID associated with this request.",
  29780. // "format": "int64",
  29781. // "location": "path",
  29782. // "required": true,
  29783. // "type": "string"
  29784. // }
  29785. // },
  29786. // "path": "userprofiles/{profileId}/floodlightActivities",
  29787. // "request": {
  29788. // "$ref": "FloodlightActivity"
  29789. // },
  29790. // "response": {
  29791. // "$ref": "FloodlightActivity"
  29792. // },
  29793. // "scopes": [
  29794. // "https://www.googleapis.com/auth/dfatrafficking"
  29795. // ]
  29796. // }
  29797. }
  29798. // method id "dfareporting.floodlightActivities.update":
  29799. type FloodlightActivitiesUpdateCall struct {
  29800. s *Service
  29801. profileId int64
  29802. floodlightactivity *FloodlightActivity
  29803. urlParams_ gensupport.URLParams
  29804. ctx_ context.Context
  29805. header_ http.Header
  29806. }
  29807. // Update: Updates an existing floodlight activity.
  29808. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  29809. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29810. c.profileId = profileId
  29811. c.floodlightactivity = floodlightactivity
  29812. return c
  29813. }
  29814. // Fields allows partial responses to be retrieved. See
  29815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29816. // for more information.
  29817. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  29818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29819. return c
  29820. }
  29821. // Context sets the context to be used in this call's Do method. Any
  29822. // pending HTTP request will be aborted if the provided context is
  29823. // canceled.
  29824. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  29825. c.ctx_ = ctx
  29826. return c
  29827. }
  29828. // Header returns an http.Header that can be modified by the caller to
  29829. // add HTTP headers to the request.
  29830. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  29831. if c.header_ == nil {
  29832. c.header_ = make(http.Header)
  29833. }
  29834. return c.header_
  29835. }
  29836. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  29837. reqHeaders := make(http.Header)
  29838. for k, v := range c.header_ {
  29839. reqHeaders[k] = v
  29840. }
  29841. reqHeaders.Set("User-Agent", c.s.userAgent())
  29842. var body io.Reader = nil
  29843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29844. if err != nil {
  29845. return nil, err
  29846. }
  29847. reqHeaders.Set("Content-Type", "application/json")
  29848. c.urlParams_.Set("alt", alt)
  29849. c.urlParams_.Set("prettyPrint", "false")
  29850. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29851. urls += "?" + c.urlParams_.Encode()
  29852. req, err := http.NewRequest("PUT", urls, body)
  29853. if err != nil {
  29854. return nil, err
  29855. }
  29856. req.Header = reqHeaders
  29857. googleapi.Expand(req.URL, map[string]string{
  29858. "profileId": strconv.FormatInt(c.profileId, 10),
  29859. })
  29860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29861. }
  29862. // Do executes the "dfareporting.floodlightActivities.update" call.
  29863. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29864. // non-2xx status code is an error. Response headers are in either
  29865. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29866. // returned at all) in error.(*googleapi.Error).Header. Use
  29867. // googleapi.IsNotModified to check whether the returned error was
  29868. // because http.StatusNotModified was returned.
  29869. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29870. gensupport.SetOptions(c.urlParams_, opts...)
  29871. res, err := c.doRequest("json")
  29872. if res != nil && res.StatusCode == http.StatusNotModified {
  29873. if res.Body != nil {
  29874. res.Body.Close()
  29875. }
  29876. return nil, &googleapi.Error{
  29877. Code: res.StatusCode,
  29878. Header: res.Header,
  29879. }
  29880. }
  29881. if err != nil {
  29882. return nil, err
  29883. }
  29884. defer googleapi.CloseBody(res)
  29885. if err := googleapi.CheckResponse(res); err != nil {
  29886. return nil, err
  29887. }
  29888. ret := &FloodlightActivity{
  29889. ServerResponse: googleapi.ServerResponse{
  29890. Header: res.Header,
  29891. HTTPStatusCode: res.StatusCode,
  29892. },
  29893. }
  29894. target := &ret
  29895. if err := gensupport.DecodeResponse(target, res); err != nil {
  29896. return nil, err
  29897. }
  29898. return ret, nil
  29899. // {
  29900. // "description": "Updates an existing floodlight activity.",
  29901. // "httpMethod": "PUT",
  29902. // "id": "dfareporting.floodlightActivities.update",
  29903. // "parameterOrder": [
  29904. // "profileId"
  29905. // ],
  29906. // "parameters": {
  29907. // "profileId": {
  29908. // "description": "User profile ID associated with this request.",
  29909. // "format": "int64",
  29910. // "location": "path",
  29911. // "required": true,
  29912. // "type": "string"
  29913. // }
  29914. // },
  29915. // "path": "userprofiles/{profileId}/floodlightActivities",
  29916. // "request": {
  29917. // "$ref": "FloodlightActivity"
  29918. // },
  29919. // "response": {
  29920. // "$ref": "FloodlightActivity"
  29921. // },
  29922. // "scopes": [
  29923. // "https://www.googleapis.com/auth/dfatrafficking"
  29924. // ]
  29925. // }
  29926. }
  29927. // method id "dfareporting.floodlightActivityGroups.get":
  29928. type FloodlightActivityGroupsGetCall struct {
  29929. s *Service
  29930. profileId int64
  29931. id int64
  29932. urlParams_ gensupport.URLParams
  29933. ifNoneMatch_ string
  29934. ctx_ context.Context
  29935. header_ http.Header
  29936. }
  29937. // Get: Gets one floodlight activity group by ID.
  29938. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  29939. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29940. c.profileId = profileId
  29941. c.id = id
  29942. return c
  29943. }
  29944. // Fields allows partial responses to be retrieved. See
  29945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29946. // for more information.
  29947. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  29948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29949. return c
  29950. }
  29951. // IfNoneMatch sets the optional parameter which makes the operation
  29952. // fail if the object's ETag matches the given value. This is useful for
  29953. // getting updates only after the object has changed since the last
  29954. // request. Use googleapi.IsNotModified to check whether the response
  29955. // error from Do is the result of In-None-Match.
  29956. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  29957. c.ifNoneMatch_ = entityTag
  29958. return c
  29959. }
  29960. // Context sets the context to be used in this call's Do method. Any
  29961. // pending HTTP request will be aborted if the provided context is
  29962. // canceled.
  29963. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  29964. c.ctx_ = ctx
  29965. return c
  29966. }
  29967. // Header returns an http.Header that can be modified by the caller to
  29968. // add HTTP headers to the request.
  29969. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  29970. if c.header_ == nil {
  29971. c.header_ = make(http.Header)
  29972. }
  29973. return c.header_
  29974. }
  29975. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  29976. reqHeaders := make(http.Header)
  29977. for k, v := range c.header_ {
  29978. reqHeaders[k] = v
  29979. }
  29980. reqHeaders.Set("User-Agent", c.s.userAgent())
  29981. if c.ifNoneMatch_ != "" {
  29982. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29983. }
  29984. var body io.Reader = nil
  29985. c.urlParams_.Set("alt", alt)
  29986. c.urlParams_.Set("prettyPrint", "false")
  29987. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  29988. urls += "?" + c.urlParams_.Encode()
  29989. req, err := http.NewRequest("GET", urls, body)
  29990. if err != nil {
  29991. return nil, err
  29992. }
  29993. req.Header = reqHeaders
  29994. googleapi.Expand(req.URL, map[string]string{
  29995. "profileId": strconv.FormatInt(c.profileId, 10),
  29996. "id": strconv.FormatInt(c.id, 10),
  29997. })
  29998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29999. }
  30000. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  30001. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30002. // non-2xx status code is an error. Response headers are in either
  30003. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30004. // returned at all) in error.(*googleapi.Error).Header. Use
  30005. // googleapi.IsNotModified to check whether the returned error was
  30006. // because http.StatusNotModified was returned.
  30007. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30008. gensupport.SetOptions(c.urlParams_, opts...)
  30009. res, err := c.doRequest("json")
  30010. if res != nil && res.StatusCode == http.StatusNotModified {
  30011. if res.Body != nil {
  30012. res.Body.Close()
  30013. }
  30014. return nil, &googleapi.Error{
  30015. Code: res.StatusCode,
  30016. Header: res.Header,
  30017. }
  30018. }
  30019. if err != nil {
  30020. return nil, err
  30021. }
  30022. defer googleapi.CloseBody(res)
  30023. if err := googleapi.CheckResponse(res); err != nil {
  30024. return nil, err
  30025. }
  30026. ret := &FloodlightActivityGroup{
  30027. ServerResponse: googleapi.ServerResponse{
  30028. Header: res.Header,
  30029. HTTPStatusCode: res.StatusCode,
  30030. },
  30031. }
  30032. target := &ret
  30033. if err := gensupport.DecodeResponse(target, res); err != nil {
  30034. return nil, err
  30035. }
  30036. return ret, nil
  30037. // {
  30038. // "description": "Gets one floodlight activity group by ID.",
  30039. // "httpMethod": "GET",
  30040. // "id": "dfareporting.floodlightActivityGroups.get",
  30041. // "parameterOrder": [
  30042. // "profileId",
  30043. // "id"
  30044. // ],
  30045. // "parameters": {
  30046. // "id": {
  30047. // "description": "Floodlight activity Group ID.",
  30048. // "format": "int64",
  30049. // "location": "path",
  30050. // "required": true,
  30051. // "type": "string"
  30052. // },
  30053. // "profileId": {
  30054. // "description": "User profile ID associated with this request.",
  30055. // "format": "int64",
  30056. // "location": "path",
  30057. // "required": true,
  30058. // "type": "string"
  30059. // }
  30060. // },
  30061. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  30062. // "response": {
  30063. // "$ref": "FloodlightActivityGroup"
  30064. // },
  30065. // "scopes": [
  30066. // "https://www.googleapis.com/auth/dfatrafficking"
  30067. // ]
  30068. // }
  30069. }
  30070. // method id "dfareporting.floodlightActivityGroups.insert":
  30071. type FloodlightActivityGroupsInsertCall struct {
  30072. s *Service
  30073. profileId int64
  30074. floodlightactivitygroup *FloodlightActivityGroup
  30075. urlParams_ gensupport.URLParams
  30076. ctx_ context.Context
  30077. header_ http.Header
  30078. }
  30079. // Insert: Inserts a new floodlight activity group.
  30080. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  30081. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30082. c.profileId = profileId
  30083. c.floodlightactivitygroup = floodlightactivitygroup
  30084. return c
  30085. }
  30086. // Fields allows partial responses to be retrieved. See
  30087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30088. // for more information.
  30089. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  30090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30091. return c
  30092. }
  30093. // Context sets the context to be used in this call's Do method. Any
  30094. // pending HTTP request will be aborted if the provided context is
  30095. // canceled.
  30096. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  30097. c.ctx_ = ctx
  30098. return c
  30099. }
  30100. // Header returns an http.Header that can be modified by the caller to
  30101. // add HTTP headers to the request.
  30102. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  30103. if c.header_ == nil {
  30104. c.header_ = make(http.Header)
  30105. }
  30106. return c.header_
  30107. }
  30108. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  30109. reqHeaders := make(http.Header)
  30110. for k, v := range c.header_ {
  30111. reqHeaders[k] = v
  30112. }
  30113. reqHeaders.Set("User-Agent", c.s.userAgent())
  30114. var body io.Reader = nil
  30115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30116. if err != nil {
  30117. return nil, err
  30118. }
  30119. reqHeaders.Set("Content-Type", "application/json")
  30120. c.urlParams_.Set("alt", alt)
  30121. c.urlParams_.Set("prettyPrint", "false")
  30122. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30123. urls += "?" + c.urlParams_.Encode()
  30124. req, err := http.NewRequest("POST", urls, body)
  30125. if err != nil {
  30126. return nil, err
  30127. }
  30128. req.Header = reqHeaders
  30129. googleapi.Expand(req.URL, map[string]string{
  30130. "profileId": strconv.FormatInt(c.profileId, 10),
  30131. })
  30132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30133. }
  30134. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  30135. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30136. // non-2xx status code is an error. Response headers are in either
  30137. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30138. // returned at all) in error.(*googleapi.Error).Header. Use
  30139. // googleapi.IsNotModified to check whether the returned error was
  30140. // because http.StatusNotModified was returned.
  30141. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30142. gensupport.SetOptions(c.urlParams_, opts...)
  30143. res, err := c.doRequest("json")
  30144. if res != nil && res.StatusCode == http.StatusNotModified {
  30145. if res.Body != nil {
  30146. res.Body.Close()
  30147. }
  30148. return nil, &googleapi.Error{
  30149. Code: res.StatusCode,
  30150. Header: res.Header,
  30151. }
  30152. }
  30153. if err != nil {
  30154. return nil, err
  30155. }
  30156. defer googleapi.CloseBody(res)
  30157. if err := googleapi.CheckResponse(res); err != nil {
  30158. return nil, err
  30159. }
  30160. ret := &FloodlightActivityGroup{
  30161. ServerResponse: googleapi.ServerResponse{
  30162. Header: res.Header,
  30163. HTTPStatusCode: res.StatusCode,
  30164. },
  30165. }
  30166. target := &ret
  30167. if err := gensupport.DecodeResponse(target, res); err != nil {
  30168. return nil, err
  30169. }
  30170. return ret, nil
  30171. // {
  30172. // "description": "Inserts a new floodlight activity group.",
  30173. // "httpMethod": "POST",
  30174. // "id": "dfareporting.floodlightActivityGroups.insert",
  30175. // "parameterOrder": [
  30176. // "profileId"
  30177. // ],
  30178. // "parameters": {
  30179. // "profileId": {
  30180. // "description": "User profile ID associated with this request.",
  30181. // "format": "int64",
  30182. // "location": "path",
  30183. // "required": true,
  30184. // "type": "string"
  30185. // }
  30186. // },
  30187. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30188. // "request": {
  30189. // "$ref": "FloodlightActivityGroup"
  30190. // },
  30191. // "response": {
  30192. // "$ref": "FloodlightActivityGroup"
  30193. // },
  30194. // "scopes": [
  30195. // "https://www.googleapis.com/auth/dfatrafficking"
  30196. // ]
  30197. // }
  30198. }
  30199. // method id "dfareporting.floodlightActivityGroups.list":
  30200. type FloodlightActivityGroupsListCall struct {
  30201. s *Service
  30202. profileId int64
  30203. urlParams_ gensupport.URLParams
  30204. ifNoneMatch_ string
  30205. ctx_ context.Context
  30206. header_ http.Header
  30207. }
  30208. // List: Retrieves a list of floodlight activity groups, possibly
  30209. // filtered. This method supports paging.
  30210. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  30211. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30212. c.profileId = profileId
  30213. return c
  30214. }
  30215. // AdvertiserId sets the optional parameter "advertiserId": Select only
  30216. // floodlight activity groups with the specified advertiser ID. Must
  30217. // specify either advertiserId or floodlightConfigurationId for a
  30218. // non-empty result.
  30219. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  30220. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  30221. return c
  30222. }
  30223. // FloodlightConfigurationId sets the optional parameter
  30224. // "floodlightConfigurationId": Select only floodlight activity groups
  30225. // with the specified floodlight configuration ID. Must specify either
  30226. // advertiserId, or floodlightConfigurationId for a non-empty result.
  30227. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  30228. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  30229. return c
  30230. }
  30231. // Ids sets the optional parameter "ids": Select only floodlight
  30232. // activity groups with the specified IDs. Must specify either
  30233. // advertiserId or floodlightConfigurationId for a non-empty result.
  30234. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  30235. var ids_ []string
  30236. for _, v := range ids {
  30237. ids_ = append(ids_, fmt.Sprint(v))
  30238. }
  30239. c.urlParams_.SetMulti("ids", ids_)
  30240. return c
  30241. }
  30242. // MaxResults sets the optional parameter "maxResults": Maximum number
  30243. // of results to return.
  30244. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  30245. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30246. return c
  30247. }
  30248. // PageToken sets the optional parameter "pageToken": Value of the
  30249. // nextPageToken from the previous result page.
  30250. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  30251. c.urlParams_.Set("pageToken", pageToken)
  30252. return c
  30253. }
  30254. // SearchString sets the optional parameter "searchString": Allows
  30255. // searching for objects by name or ID. Wildcards (*) are allowed. For
  30256. // example, "floodlightactivitygroup*2015" will return objects with
  30257. // names like "floodlightactivitygroup June 2015",
  30258. // "floodlightactivitygroup April 2015", or simply
  30259. // "floodlightactivitygroup 2015". Most of the searches also add
  30260. // wildcards implicitly at the start and the end of the search string.
  30261. // For example, a search string of "floodlightactivitygroup" will match
  30262. // objects with name "my floodlightactivitygroup activity",
  30263. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  30264. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  30265. c.urlParams_.Set("searchString", searchString)
  30266. return c
  30267. }
  30268. // SortField sets the optional parameter "sortField": Field by which to
  30269. // sort the list.
  30270. //
  30271. // Possible values:
  30272. // "ID" (default)
  30273. // "NAME"
  30274. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  30275. c.urlParams_.Set("sortField", sortField)
  30276. return c
  30277. }
  30278. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  30279. // results.
  30280. //
  30281. // Possible values:
  30282. // "ASCENDING" (default)
  30283. // "DESCENDING"
  30284. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  30285. c.urlParams_.Set("sortOrder", sortOrder)
  30286. return c
  30287. }
  30288. // Type sets the optional parameter "type": Select only floodlight
  30289. // activity groups with the specified floodlight activity group type.
  30290. //
  30291. // Possible values:
  30292. // "COUNTER"
  30293. // "SALE"
  30294. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  30295. c.urlParams_.Set("type", type_)
  30296. return c
  30297. }
  30298. // Fields allows partial responses to be retrieved. See
  30299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30300. // for more information.
  30301. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  30302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30303. return c
  30304. }
  30305. // IfNoneMatch sets the optional parameter which makes the operation
  30306. // fail if the object's ETag matches the given value. This is useful for
  30307. // getting updates only after the object has changed since the last
  30308. // request. Use googleapi.IsNotModified to check whether the response
  30309. // error from Do is the result of In-None-Match.
  30310. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  30311. c.ifNoneMatch_ = entityTag
  30312. return c
  30313. }
  30314. // Context sets the context to be used in this call's Do method. Any
  30315. // pending HTTP request will be aborted if the provided context is
  30316. // canceled.
  30317. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  30318. c.ctx_ = ctx
  30319. return c
  30320. }
  30321. // Header returns an http.Header that can be modified by the caller to
  30322. // add HTTP headers to the request.
  30323. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  30324. if c.header_ == nil {
  30325. c.header_ = make(http.Header)
  30326. }
  30327. return c.header_
  30328. }
  30329. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  30330. reqHeaders := make(http.Header)
  30331. for k, v := range c.header_ {
  30332. reqHeaders[k] = v
  30333. }
  30334. reqHeaders.Set("User-Agent", c.s.userAgent())
  30335. if c.ifNoneMatch_ != "" {
  30336. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30337. }
  30338. var body io.Reader = nil
  30339. c.urlParams_.Set("alt", alt)
  30340. c.urlParams_.Set("prettyPrint", "false")
  30341. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30342. urls += "?" + c.urlParams_.Encode()
  30343. req, err := http.NewRequest("GET", urls, body)
  30344. if err != nil {
  30345. return nil, err
  30346. }
  30347. req.Header = reqHeaders
  30348. googleapi.Expand(req.URL, map[string]string{
  30349. "profileId": strconv.FormatInt(c.profileId, 10),
  30350. })
  30351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30352. }
  30353. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  30354. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  30355. // non-nil. Any non-2xx status code is an error. Response headers are in
  30356. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  30357. // (if a response was returned at all) in
  30358. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30359. // whether the returned error was because http.StatusNotModified was
  30360. // returned.
  30361. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  30362. gensupport.SetOptions(c.urlParams_, opts...)
  30363. res, err := c.doRequest("json")
  30364. if res != nil && res.StatusCode == http.StatusNotModified {
  30365. if res.Body != nil {
  30366. res.Body.Close()
  30367. }
  30368. return nil, &googleapi.Error{
  30369. Code: res.StatusCode,
  30370. Header: res.Header,
  30371. }
  30372. }
  30373. if err != nil {
  30374. return nil, err
  30375. }
  30376. defer googleapi.CloseBody(res)
  30377. if err := googleapi.CheckResponse(res); err != nil {
  30378. return nil, err
  30379. }
  30380. ret := &FloodlightActivityGroupsListResponse{
  30381. ServerResponse: googleapi.ServerResponse{
  30382. Header: res.Header,
  30383. HTTPStatusCode: res.StatusCode,
  30384. },
  30385. }
  30386. target := &ret
  30387. if err := gensupport.DecodeResponse(target, res); err != nil {
  30388. return nil, err
  30389. }
  30390. return ret, nil
  30391. // {
  30392. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  30393. // "httpMethod": "GET",
  30394. // "id": "dfareporting.floodlightActivityGroups.list",
  30395. // "parameterOrder": [
  30396. // "profileId"
  30397. // ],
  30398. // "parameters": {
  30399. // "advertiserId": {
  30400. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  30401. // "format": "int64",
  30402. // "location": "query",
  30403. // "type": "string"
  30404. // },
  30405. // "floodlightConfigurationId": {
  30406. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  30407. // "format": "int64",
  30408. // "location": "query",
  30409. // "type": "string"
  30410. // },
  30411. // "ids": {
  30412. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  30413. // "format": "int64",
  30414. // "location": "query",
  30415. // "repeated": true,
  30416. // "type": "string"
  30417. // },
  30418. // "maxResults": {
  30419. // "default": "1000",
  30420. // "description": "Maximum number of results to return.",
  30421. // "format": "int32",
  30422. // "location": "query",
  30423. // "maximum": "1000",
  30424. // "minimum": "0",
  30425. // "type": "integer"
  30426. // },
  30427. // "pageToken": {
  30428. // "description": "Value of the nextPageToken from the previous result page.",
  30429. // "location": "query",
  30430. // "type": "string"
  30431. // },
  30432. // "profileId": {
  30433. // "description": "User profile ID associated with this request.",
  30434. // "format": "int64",
  30435. // "location": "path",
  30436. // "required": true,
  30437. // "type": "string"
  30438. // },
  30439. // "searchString": {
  30440. // "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\".",
  30441. // "location": "query",
  30442. // "type": "string"
  30443. // },
  30444. // "sortField": {
  30445. // "default": "ID",
  30446. // "description": "Field by which to sort the list.",
  30447. // "enum": [
  30448. // "ID",
  30449. // "NAME"
  30450. // ],
  30451. // "enumDescriptions": [
  30452. // "",
  30453. // ""
  30454. // ],
  30455. // "location": "query",
  30456. // "type": "string"
  30457. // },
  30458. // "sortOrder": {
  30459. // "default": "ASCENDING",
  30460. // "description": "Order of sorted results.",
  30461. // "enum": [
  30462. // "ASCENDING",
  30463. // "DESCENDING"
  30464. // ],
  30465. // "enumDescriptions": [
  30466. // "",
  30467. // ""
  30468. // ],
  30469. // "location": "query",
  30470. // "type": "string"
  30471. // },
  30472. // "type": {
  30473. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  30474. // "enum": [
  30475. // "COUNTER",
  30476. // "SALE"
  30477. // ],
  30478. // "enumDescriptions": [
  30479. // "",
  30480. // ""
  30481. // ],
  30482. // "location": "query",
  30483. // "type": "string"
  30484. // }
  30485. // },
  30486. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30487. // "response": {
  30488. // "$ref": "FloodlightActivityGroupsListResponse"
  30489. // },
  30490. // "scopes": [
  30491. // "https://www.googleapis.com/auth/dfatrafficking"
  30492. // ]
  30493. // }
  30494. }
  30495. // Pages invokes f for each page of results.
  30496. // A non-nil error returned from f will halt the iteration.
  30497. // The provided context supersedes any context provided to the Context method.
  30498. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  30499. c.ctx_ = ctx
  30500. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30501. for {
  30502. x, err := c.Do()
  30503. if err != nil {
  30504. return err
  30505. }
  30506. if err := f(x); err != nil {
  30507. return err
  30508. }
  30509. if x.NextPageToken == "" {
  30510. return nil
  30511. }
  30512. c.PageToken(x.NextPageToken)
  30513. }
  30514. }
  30515. // method id "dfareporting.floodlightActivityGroups.patch":
  30516. type FloodlightActivityGroupsPatchCall struct {
  30517. s *Service
  30518. profileId int64
  30519. floodlightactivitygroup *FloodlightActivityGroup
  30520. urlParams_ gensupport.URLParams
  30521. ctx_ context.Context
  30522. header_ http.Header
  30523. }
  30524. // Patch: Updates an existing floodlight activity group. This method
  30525. // supports patch semantics.
  30526. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  30527. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30528. c.profileId = profileId
  30529. c.urlParams_.Set("id", fmt.Sprint(id))
  30530. c.floodlightactivitygroup = floodlightactivitygroup
  30531. return c
  30532. }
  30533. // Fields allows partial responses to be retrieved. See
  30534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30535. // for more information.
  30536. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  30537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30538. return c
  30539. }
  30540. // Context sets the context to be used in this call's Do method. Any
  30541. // pending HTTP request will be aborted if the provided context is
  30542. // canceled.
  30543. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  30544. c.ctx_ = ctx
  30545. return c
  30546. }
  30547. // Header returns an http.Header that can be modified by the caller to
  30548. // add HTTP headers to the request.
  30549. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  30550. if c.header_ == nil {
  30551. c.header_ = make(http.Header)
  30552. }
  30553. return c.header_
  30554. }
  30555. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  30556. reqHeaders := make(http.Header)
  30557. for k, v := range c.header_ {
  30558. reqHeaders[k] = v
  30559. }
  30560. reqHeaders.Set("User-Agent", c.s.userAgent())
  30561. var body io.Reader = nil
  30562. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30563. if err != nil {
  30564. return nil, err
  30565. }
  30566. reqHeaders.Set("Content-Type", "application/json")
  30567. c.urlParams_.Set("alt", alt)
  30568. c.urlParams_.Set("prettyPrint", "false")
  30569. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30570. urls += "?" + c.urlParams_.Encode()
  30571. req, err := http.NewRequest("PATCH", urls, body)
  30572. if err != nil {
  30573. return nil, err
  30574. }
  30575. req.Header = reqHeaders
  30576. googleapi.Expand(req.URL, map[string]string{
  30577. "profileId": strconv.FormatInt(c.profileId, 10),
  30578. })
  30579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30580. }
  30581. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  30582. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30583. // non-2xx status code is an error. Response headers are in either
  30584. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30585. // returned at all) in error.(*googleapi.Error).Header. Use
  30586. // googleapi.IsNotModified to check whether the returned error was
  30587. // because http.StatusNotModified was returned.
  30588. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30589. gensupport.SetOptions(c.urlParams_, opts...)
  30590. res, err := c.doRequest("json")
  30591. if res != nil && res.StatusCode == http.StatusNotModified {
  30592. if res.Body != nil {
  30593. res.Body.Close()
  30594. }
  30595. return nil, &googleapi.Error{
  30596. Code: res.StatusCode,
  30597. Header: res.Header,
  30598. }
  30599. }
  30600. if err != nil {
  30601. return nil, err
  30602. }
  30603. defer googleapi.CloseBody(res)
  30604. if err := googleapi.CheckResponse(res); err != nil {
  30605. return nil, err
  30606. }
  30607. ret := &FloodlightActivityGroup{
  30608. ServerResponse: googleapi.ServerResponse{
  30609. Header: res.Header,
  30610. HTTPStatusCode: res.StatusCode,
  30611. },
  30612. }
  30613. target := &ret
  30614. if err := gensupport.DecodeResponse(target, res); err != nil {
  30615. return nil, err
  30616. }
  30617. return ret, nil
  30618. // {
  30619. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  30620. // "httpMethod": "PATCH",
  30621. // "id": "dfareporting.floodlightActivityGroups.patch",
  30622. // "parameterOrder": [
  30623. // "profileId",
  30624. // "id"
  30625. // ],
  30626. // "parameters": {
  30627. // "id": {
  30628. // "description": "Floodlight activity Group ID.",
  30629. // "format": "int64",
  30630. // "location": "query",
  30631. // "required": true,
  30632. // "type": "string"
  30633. // },
  30634. // "profileId": {
  30635. // "description": "User profile ID associated with this request.",
  30636. // "format": "int64",
  30637. // "location": "path",
  30638. // "required": true,
  30639. // "type": "string"
  30640. // }
  30641. // },
  30642. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30643. // "request": {
  30644. // "$ref": "FloodlightActivityGroup"
  30645. // },
  30646. // "response": {
  30647. // "$ref": "FloodlightActivityGroup"
  30648. // },
  30649. // "scopes": [
  30650. // "https://www.googleapis.com/auth/dfatrafficking"
  30651. // ]
  30652. // }
  30653. }
  30654. // method id "dfareporting.floodlightActivityGroups.update":
  30655. type FloodlightActivityGroupsUpdateCall struct {
  30656. s *Service
  30657. profileId int64
  30658. floodlightactivitygroup *FloodlightActivityGroup
  30659. urlParams_ gensupport.URLParams
  30660. ctx_ context.Context
  30661. header_ http.Header
  30662. }
  30663. // Update: Updates an existing floodlight activity group.
  30664. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  30665. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30666. c.profileId = profileId
  30667. c.floodlightactivitygroup = floodlightactivitygroup
  30668. return c
  30669. }
  30670. // Fields allows partial responses to be retrieved. See
  30671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30672. // for more information.
  30673. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  30674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30675. return c
  30676. }
  30677. // Context sets the context to be used in this call's Do method. Any
  30678. // pending HTTP request will be aborted if the provided context is
  30679. // canceled.
  30680. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  30681. c.ctx_ = ctx
  30682. return c
  30683. }
  30684. // Header returns an http.Header that can be modified by the caller to
  30685. // add HTTP headers to the request.
  30686. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  30687. if c.header_ == nil {
  30688. c.header_ = make(http.Header)
  30689. }
  30690. return c.header_
  30691. }
  30692. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30693. reqHeaders := make(http.Header)
  30694. for k, v := range c.header_ {
  30695. reqHeaders[k] = v
  30696. }
  30697. reqHeaders.Set("User-Agent", c.s.userAgent())
  30698. var body io.Reader = nil
  30699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30700. if err != nil {
  30701. return nil, err
  30702. }
  30703. reqHeaders.Set("Content-Type", "application/json")
  30704. c.urlParams_.Set("alt", alt)
  30705. c.urlParams_.Set("prettyPrint", "false")
  30706. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30707. urls += "?" + c.urlParams_.Encode()
  30708. req, err := http.NewRequest("PUT", urls, body)
  30709. if err != nil {
  30710. return nil, err
  30711. }
  30712. req.Header = reqHeaders
  30713. googleapi.Expand(req.URL, map[string]string{
  30714. "profileId": strconv.FormatInt(c.profileId, 10),
  30715. })
  30716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30717. }
  30718. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  30719. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30720. // non-2xx status code is an error. Response headers are in either
  30721. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30722. // returned at all) in error.(*googleapi.Error).Header. Use
  30723. // googleapi.IsNotModified to check whether the returned error was
  30724. // because http.StatusNotModified was returned.
  30725. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30726. gensupport.SetOptions(c.urlParams_, opts...)
  30727. res, err := c.doRequest("json")
  30728. if res != nil && res.StatusCode == http.StatusNotModified {
  30729. if res.Body != nil {
  30730. res.Body.Close()
  30731. }
  30732. return nil, &googleapi.Error{
  30733. Code: res.StatusCode,
  30734. Header: res.Header,
  30735. }
  30736. }
  30737. if err != nil {
  30738. return nil, err
  30739. }
  30740. defer googleapi.CloseBody(res)
  30741. if err := googleapi.CheckResponse(res); err != nil {
  30742. return nil, err
  30743. }
  30744. ret := &FloodlightActivityGroup{
  30745. ServerResponse: googleapi.ServerResponse{
  30746. Header: res.Header,
  30747. HTTPStatusCode: res.StatusCode,
  30748. },
  30749. }
  30750. target := &ret
  30751. if err := gensupport.DecodeResponse(target, res); err != nil {
  30752. return nil, err
  30753. }
  30754. return ret, nil
  30755. // {
  30756. // "description": "Updates an existing floodlight activity group.",
  30757. // "httpMethod": "PUT",
  30758. // "id": "dfareporting.floodlightActivityGroups.update",
  30759. // "parameterOrder": [
  30760. // "profileId"
  30761. // ],
  30762. // "parameters": {
  30763. // "profileId": {
  30764. // "description": "User profile ID associated with this request.",
  30765. // "format": "int64",
  30766. // "location": "path",
  30767. // "required": true,
  30768. // "type": "string"
  30769. // }
  30770. // },
  30771. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30772. // "request": {
  30773. // "$ref": "FloodlightActivityGroup"
  30774. // },
  30775. // "response": {
  30776. // "$ref": "FloodlightActivityGroup"
  30777. // },
  30778. // "scopes": [
  30779. // "https://www.googleapis.com/auth/dfatrafficking"
  30780. // ]
  30781. // }
  30782. }
  30783. // method id "dfareporting.floodlightConfigurations.get":
  30784. type FloodlightConfigurationsGetCall struct {
  30785. s *Service
  30786. profileId int64
  30787. id int64
  30788. urlParams_ gensupport.URLParams
  30789. ifNoneMatch_ string
  30790. ctx_ context.Context
  30791. header_ http.Header
  30792. }
  30793. // Get: Gets one floodlight configuration by ID.
  30794. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  30795. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30796. c.profileId = profileId
  30797. c.id = id
  30798. return c
  30799. }
  30800. // Fields allows partial responses to be retrieved. See
  30801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30802. // for more information.
  30803. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  30804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30805. return c
  30806. }
  30807. // IfNoneMatch sets the optional parameter which makes the operation
  30808. // fail if the object's ETag matches the given value. This is useful for
  30809. // getting updates only after the object has changed since the last
  30810. // request. Use googleapi.IsNotModified to check whether the response
  30811. // error from Do is the result of In-None-Match.
  30812. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  30813. c.ifNoneMatch_ = entityTag
  30814. return c
  30815. }
  30816. // Context sets the context to be used in this call's Do method. Any
  30817. // pending HTTP request will be aborted if the provided context is
  30818. // canceled.
  30819. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  30820. c.ctx_ = ctx
  30821. return c
  30822. }
  30823. // Header returns an http.Header that can be modified by the caller to
  30824. // add HTTP headers to the request.
  30825. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  30826. if c.header_ == nil {
  30827. c.header_ = make(http.Header)
  30828. }
  30829. return c.header_
  30830. }
  30831. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  30832. reqHeaders := make(http.Header)
  30833. for k, v := range c.header_ {
  30834. reqHeaders[k] = v
  30835. }
  30836. reqHeaders.Set("User-Agent", c.s.userAgent())
  30837. if c.ifNoneMatch_ != "" {
  30838. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30839. }
  30840. var body io.Reader = nil
  30841. c.urlParams_.Set("alt", alt)
  30842. c.urlParams_.Set("prettyPrint", "false")
  30843. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  30844. urls += "?" + c.urlParams_.Encode()
  30845. req, err := http.NewRequest("GET", urls, body)
  30846. if err != nil {
  30847. return nil, err
  30848. }
  30849. req.Header = reqHeaders
  30850. googleapi.Expand(req.URL, map[string]string{
  30851. "profileId": strconv.FormatInt(c.profileId, 10),
  30852. "id": strconv.FormatInt(c.id, 10),
  30853. })
  30854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30855. }
  30856. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  30857. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30858. // non-2xx status code is an error. Response headers are in either
  30859. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30860. // returned at all) in error.(*googleapi.Error).Header. Use
  30861. // googleapi.IsNotModified to check whether the returned error was
  30862. // because http.StatusNotModified was returned.
  30863. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30864. gensupport.SetOptions(c.urlParams_, opts...)
  30865. res, err := c.doRequest("json")
  30866. if res != nil && res.StatusCode == http.StatusNotModified {
  30867. if res.Body != nil {
  30868. res.Body.Close()
  30869. }
  30870. return nil, &googleapi.Error{
  30871. Code: res.StatusCode,
  30872. Header: res.Header,
  30873. }
  30874. }
  30875. if err != nil {
  30876. return nil, err
  30877. }
  30878. defer googleapi.CloseBody(res)
  30879. if err := googleapi.CheckResponse(res); err != nil {
  30880. return nil, err
  30881. }
  30882. ret := &FloodlightConfiguration{
  30883. ServerResponse: googleapi.ServerResponse{
  30884. Header: res.Header,
  30885. HTTPStatusCode: res.StatusCode,
  30886. },
  30887. }
  30888. target := &ret
  30889. if err := gensupport.DecodeResponse(target, res); err != nil {
  30890. return nil, err
  30891. }
  30892. return ret, nil
  30893. // {
  30894. // "description": "Gets one floodlight configuration by ID.",
  30895. // "httpMethod": "GET",
  30896. // "id": "dfareporting.floodlightConfigurations.get",
  30897. // "parameterOrder": [
  30898. // "profileId",
  30899. // "id"
  30900. // ],
  30901. // "parameters": {
  30902. // "id": {
  30903. // "description": "Floodlight configuration ID.",
  30904. // "format": "int64",
  30905. // "location": "path",
  30906. // "required": true,
  30907. // "type": "string"
  30908. // },
  30909. // "profileId": {
  30910. // "description": "User profile ID associated with this request.",
  30911. // "format": "int64",
  30912. // "location": "path",
  30913. // "required": true,
  30914. // "type": "string"
  30915. // }
  30916. // },
  30917. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  30918. // "response": {
  30919. // "$ref": "FloodlightConfiguration"
  30920. // },
  30921. // "scopes": [
  30922. // "https://www.googleapis.com/auth/dfatrafficking"
  30923. // ]
  30924. // }
  30925. }
  30926. // method id "dfareporting.floodlightConfigurations.list":
  30927. type FloodlightConfigurationsListCall struct {
  30928. s *Service
  30929. profileId int64
  30930. urlParams_ gensupport.URLParams
  30931. ifNoneMatch_ string
  30932. ctx_ context.Context
  30933. header_ http.Header
  30934. }
  30935. // List: Retrieves a list of floodlight configurations, possibly
  30936. // filtered.
  30937. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  30938. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30939. c.profileId = profileId
  30940. return c
  30941. }
  30942. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  30943. // configurations to retrieve. Required field; otherwise an empty list
  30944. // will be returned.
  30945. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  30946. var ids_ []string
  30947. for _, v := range ids {
  30948. ids_ = append(ids_, fmt.Sprint(v))
  30949. }
  30950. c.urlParams_.SetMulti("ids", ids_)
  30951. return c
  30952. }
  30953. // Fields allows partial responses to be retrieved. See
  30954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30955. // for more information.
  30956. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  30957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30958. return c
  30959. }
  30960. // IfNoneMatch sets the optional parameter which makes the operation
  30961. // fail if the object's ETag matches the given value. This is useful for
  30962. // getting updates only after the object has changed since the last
  30963. // request. Use googleapi.IsNotModified to check whether the response
  30964. // error from Do is the result of In-None-Match.
  30965. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  30966. c.ifNoneMatch_ = entityTag
  30967. return c
  30968. }
  30969. // Context sets the context to be used in this call's Do method. Any
  30970. // pending HTTP request will be aborted if the provided context is
  30971. // canceled.
  30972. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  30973. c.ctx_ = ctx
  30974. return c
  30975. }
  30976. // Header returns an http.Header that can be modified by the caller to
  30977. // add HTTP headers to the request.
  30978. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  30979. if c.header_ == nil {
  30980. c.header_ = make(http.Header)
  30981. }
  30982. return c.header_
  30983. }
  30984. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  30985. reqHeaders := make(http.Header)
  30986. for k, v := range c.header_ {
  30987. reqHeaders[k] = v
  30988. }
  30989. reqHeaders.Set("User-Agent", c.s.userAgent())
  30990. if c.ifNoneMatch_ != "" {
  30991. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30992. }
  30993. var body io.Reader = nil
  30994. c.urlParams_.Set("alt", alt)
  30995. c.urlParams_.Set("prettyPrint", "false")
  30996. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30997. urls += "?" + c.urlParams_.Encode()
  30998. req, err := http.NewRequest("GET", urls, body)
  30999. if err != nil {
  31000. return nil, err
  31001. }
  31002. req.Header = reqHeaders
  31003. googleapi.Expand(req.URL, map[string]string{
  31004. "profileId": strconv.FormatInt(c.profileId, 10),
  31005. })
  31006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31007. }
  31008. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  31009. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  31010. // non-nil. Any non-2xx status code is an error. Response headers are in
  31011. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  31012. // (if a response was returned at all) in
  31013. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  31014. // whether the returned error was because http.StatusNotModified was
  31015. // returned.
  31016. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  31017. gensupport.SetOptions(c.urlParams_, opts...)
  31018. res, err := c.doRequest("json")
  31019. if res != nil && res.StatusCode == http.StatusNotModified {
  31020. if res.Body != nil {
  31021. res.Body.Close()
  31022. }
  31023. return nil, &googleapi.Error{
  31024. Code: res.StatusCode,
  31025. Header: res.Header,
  31026. }
  31027. }
  31028. if err != nil {
  31029. return nil, err
  31030. }
  31031. defer googleapi.CloseBody(res)
  31032. if err := googleapi.CheckResponse(res); err != nil {
  31033. return nil, err
  31034. }
  31035. ret := &FloodlightConfigurationsListResponse{
  31036. ServerResponse: googleapi.ServerResponse{
  31037. Header: res.Header,
  31038. HTTPStatusCode: res.StatusCode,
  31039. },
  31040. }
  31041. target := &ret
  31042. if err := gensupport.DecodeResponse(target, res); err != nil {
  31043. return nil, err
  31044. }
  31045. return ret, nil
  31046. // {
  31047. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  31048. // "httpMethod": "GET",
  31049. // "id": "dfareporting.floodlightConfigurations.list",
  31050. // "parameterOrder": [
  31051. // "profileId"
  31052. // ],
  31053. // "parameters": {
  31054. // "ids": {
  31055. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  31056. // "format": "int64",
  31057. // "location": "query",
  31058. // "repeated": true,
  31059. // "type": "string"
  31060. // },
  31061. // "profileId": {
  31062. // "description": "User profile ID associated with this request.",
  31063. // "format": "int64",
  31064. // "location": "path",
  31065. // "required": true,
  31066. // "type": "string"
  31067. // }
  31068. // },
  31069. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31070. // "response": {
  31071. // "$ref": "FloodlightConfigurationsListResponse"
  31072. // },
  31073. // "scopes": [
  31074. // "https://www.googleapis.com/auth/dfatrafficking"
  31075. // ]
  31076. // }
  31077. }
  31078. // method id "dfareporting.floodlightConfigurations.patch":
  31079. type FloodlightConfigurationsPatchCall struct {
  31080. s *Service
  31081. profileId int64
  31082. floodlightconfiguration *FloodlightConfiguration
  31083. urlParams_ gensupport.URLParams
  31084. ctx_ context.Context
  31085. header_ http.Header
  31086. }
  31087. // Patch: Updates an existing floodlight configuration. This method
  31088. // supports patch semantics.
  31089. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  31090. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31091. c.profileId = profileId
  31092. c.urlParams_.Set("id", fmt.Sprint(id))
  31093. c.floodlightconfiguration = floodlightconfiguration
  31094. return c
  31095. }
  31096. // Fields allows partial responses to be retrieved. See
  31097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31098. // for more information.
  31099. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  31100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31101. return c
  31102. }
  31103. // Context sets the context to be used in this call's Do method. Any
  31104. // pending HTTP request will be aborted if the provided context is
  31105. // canceled.
  31106. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  31107. c.ctx_ = ctx
  31108. return c
  31109. }
  31110. // Header returns an http.Header that can be modified by the caller to
  31111. // add HTTP headers to the request.
  31112. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  31113. if c.header_ == nil {
  31114. c.header_ = make(http.Header)
  31115. }
  31116. return c.header_
  31117. }
  31118. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  31119. reqHeaders := make(http.Header)
  31120. for k, v := range c.header_ {
  31121. reqHeaders[k] = v
  31122. }
  31123. reqHeaders.Set("User-Agent", c.s.userAgent())
  31124. var body io.Reader = nil
  31125. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  31126. if err != nil {
  31127. return nil, err
  31128. }
  31129. reqHeaders.Set("Content-Type", "application/json")
  31130. c.urlParams_.Set("alt", alt)
  31131. c.urlParams_.Set("prettyPrint", "false")
  31132. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  31133. urls += "?" + c.urlParams_.Encode()
  31134. req, err := http.NewRequest("PATCH", urls, body)
  31135. if err != nil {
  31136. return nil, err
  31137. }
  31138. req.Header = reqHeaders
  31139. googleapi.Expand(req.URL, map[string]string{
  31140. "profileId": strconv.FormatInt(c.profileId, 10),
  31141. })
  31142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31143. }
  31144. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  31145. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  31146. // non-2xx status code is an error. Response headers are in either
  31147. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  31148. // returned at all) in error.(*googleapi.Error).Header. Use
  31149. // googleapi.IsNotModified to check whether the returned error was
  31150. // because http.StatusNotModified was returned.
  31151. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  31152. gensupport.SetOptions(c.urlParams_, opts...)
  31153. res, err := c.doRequest("json")
  31154. if res != nil && res.StatusCode == http.StatusNotModified {
  31155. if res.Body != nil {
  31156. res.Body.Close()
  31157. }
  31158. return nil, &googleapi.Error{
  31159. Code: res.StatusCode,
  31160. Header: res.Header,
  31161. }
  31162. }
  31163. if err != nil {
  31164. return nil, err
  31165. }
  31166. defer googleapi.CloseBody(res)
  31167. if err := googleapi.CheckResponse(res); err != nil {
  31168. return nil, err
  31169. }
  31170. ret := &FloodlightConfiguration{
  31171. ServerResponse: googleapi.ServerResponse{
  31172. Header: res.Header,
  31173. HTTPStatusCode: res.StatusCode,
  31174. },
  31175. }
  31176. target := &ret
  31177. if err := gensupport.DecodeResponse(target, res); err != nil {
  31178. return nil, err
  31179. }
  31180. return ret, nil
  31181. // {
  31182. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  31183. // "httpMethod": "PATCH",
  31184. // "id": "dfareporting.floodlightConfigurations.patch",
  31185. // "parameterOrder": [
  31186. // "profileId",
  31187. // "id"
  31188. // ],
  31189. // "parameters": {
  31190. // "id": {
  31191. // "description": "Floodlight configuration ID.",
  31192. // "format": "int64",
  31193. // "location": "query",
  31194. // "required": true,
  31195. // "type": "string"
  31196. // },
  31197. // "profileId": {
  31198. // "description": "User profile ID associated with this request.",
  31199. // "format": "int64",
  31200. // "location": "path",
  31201. // "required": true,
  31202. // "type": "string"
  31203. // }
  31204. // },
  31205. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31206. // "request": {
  31207. // "$ref": "FloodlightConfiguration"
  31208. // },
  31209. // "response": {
  31210. // "$ref": "FloodlightConfiguration"
  31211. // },
  31212. // "scopes": [
  31213. // "https://www.googleapis.com/auth/dfatrafficking"
  31214. // ]
  31215. // }
  31216. }
  31217. // method id "dfareporting.floodlightConfigurations.update":
  31218. type FloodlightConfigurationsUpdateCall struct {
  31219. s *Service
  31220. profileId int64
  31221. floodlightconfiguration *FloodlightConfiguration
  31222. urlParams_ gensupport.URLParams
  31223. ctx_ context.Context
  31224. header_ http.Header
  31225. }
  31226. // Update: Updates an existing floodlight configuration.
  31227. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  31228. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31229. c.profileId = profileId
  31230. c.floodlightconfiguration = floodlightconfiguration
  31231. return c
  31232. }
  31233. // Fields allows partial responses to be retrieved. See
  31234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31235. // for more information.
  31236. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  31237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31238. return c
  31239. }
  31240. // Context sets the context to be used in this call's Do method. Any
  31241. // pending HTTP request will be aborted if the provided context is
  31242. // canceled.
  31243. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  31244. c.ctx_ = ctx
  31245. return c
  31246. }
  31247. // Header returns an http.Header that can be modified by the caller to
  31248. // add HTTP headers to the request.
  31249. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  31250. if c.header_ == nil {
  31251. c.header_ = make(http.Header)
  31252. }
  31253. return c.header_
  31254. }
  31255. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  31256. reqHeaders := make(http.Header)
  31257. for k, v := range c.header_ {
  31258. reqHeaders[k] = v
  31259. }
  31260. reqHeaders.Set("User-Agent", c.s.userAgent())
  31261. var body io.Reader = nil
  31262. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  31263. if err != nil {
  31264. return nil, err
  31265. }
  31266. reqHeaders.Set("Content-Type", "application/json")
  31267. c.urlParams_.Set("alt", alt)
  31268. c.urlParams_.Set("prettyPrint", "false")
  31269. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  31270. urls += "?" + c.urlParams_.Encode()
  31271. req, err := http.NewRequest("PUT", urls, body)
  31272. if err != nil {
  31273. return nil, err
  31274. }
  31275. req.Header = reqHeaders
  31276. googleapi.Expand(req.URL, map[string]string{
  31277. "profileId": strconv.FormatInt(c.profileId, 10),
  31278. })
  31279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31280. }
  31281. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  31282. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  31283. // non-2xx status code is an error. Response headers are in either
  31284. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  31285. // returned at all) in error.(*googleapi.Error).Header. Use
  31286. // googleapi.IsNotModified to check whether the returned error was
  31287. // because http.StatusNotModified was returned.
  31288. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  31289. gensupport.SetOptions(c.urlParams_, opts...)
  31290. res, err := c.doRequest("json")
  31291. if res != nil && res.StatusCode == http.StatusNotModified {
  31292. if res.Body != nil {
  31293. res.Body.Close()
  31294. }
  31295. return nil, &googleapi.Error{
  31296. Code: res.StatusCode,
  31297. Header: res.Header,
  31298. }
  31299. }
  31300. if err != nil {
  31301. return nil, err
  31302. }
  31303. defer googleapi.CloseBody(res)
  31304. if err := googleapi.CheckResponse(res); err != nil {
  31305. return nil, err
  31306. }
  31307. ret := &FloodlightConfiguration{
  31308. ServerResponse: googleapi.ServerResponse{
  31309. Header: res.Header,
  31310. HTTPStatusCode: res.StatusCode,
  31311. },
  31312. }
  31313. target := &ret
  31314. if err := gensupport.DecodeResponse(target, res); err != nil {
  31315. return nil, err
  31316. }
  31317. return ret, nil
  31318. // {
  31319. // "description": "Updates an existing floodlight configuration.",
  31320. // "httpMethod": "PUT",
  31321. // "id": "dfareporting.floodlightConfigurations.update",
  31322. // "parameterOrder": [
  31323. // "profileId"
  31324. // ],
  31325. // "parameters": {
  31326. // "profileId": {
  31327. // "description": "User profile ID associated with this request.",
  31328. // "format": "int64",
  31329. // "location": "path",
  31330. // "required": true,
  31331. // "type": "string"
  31332. // }
  31333. // },
  31334. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31335. // "request": {
  31336. // "$ref": "FloodlightConfiguration"
  31337. // },
  31338. // "response": {
  31339. // "$ref": "FloodlightConfiguration"
  31340. // },
  31341. // "scopes": [
  31342. // "https://www.googleapis.com/auth/dfatrafficking"
  31343. // ]
  31344. // }
  31345. }
  31346. // method id "dfareporting.inventoryItems.get":
  31347. type InventoryItemsGetCall struct {
  31348. s *Service
  31349. profileId int64
  31350. projectId int64
  31351. id int64
  31352. urlParams_ gensupport.URLParams
  31353. ifNoneMatch_ string
  31354. ctx_ context.Context
  31355. header_ http.Header
  31356. }
  31357. // Get: Gets one inventory item by ID.
  31358. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  31359. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31360. c.profileId = profileId
  31361. c.projectId = projectId
  31362. c.id = id
  31363. return c
  31364. }
  31365. // Fields allows partial responses to be retrieved. See
  31366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31367. // for more information.
  31368. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  31369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31370. return c
  31371. }
  31372. // IfNoneMatch sets the optional parameter which makes the operation
  31373. // fail if the object's ETag matches the given value. This is useful for
  31374. // getting updates only after the object has changed since the last
  31375. // request. Use googleapi.IsNotModified to check whether the response
  31376. // error from Do is the result of In-None-Match.
  31377. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  31378. c.ifNoneMatch_ = entityTag
  31379. return c
  31380. }
  31381. // Context sets the context to be used in this call's Do method. Any
  31382. // pending HTTP request will be aborted if the provided context is
  31383. // canceled.
  31384. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  31385. c.ctx_ = ctx
  31386. return c
  31387. }
  31388. // Header returns an http.Header that can be modified by the caller to
  31389. // add HTTP headers to the request.
  31390. func (c *InventoryItemsGetCall) Header() http.Header {
  31391. if c.header_ == nil {
  31392. c.header_ = make(http.Header)
  31393. }
  31394. return c.header_
  31395. }
  31396. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  31397. reqHeaders := make(http.Header)
  31398. for k, v := range c.header_ {
  31399. reqHeaders[k] = v
  31400. }
  31401. reqHeaders.Set("User-Agent", c.s.userAgent())
  31402. if c.ifNoneMatch_ != "" {
  31403. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31404. }
  31405. var body io.Reader = nil
  31406. c.urlParams_.Set("alt", alt)
  31407. c.urlParams_.Set("prettyPrint", "false")
  31408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  31409. urls += "?" + c.urlParams_.Encode()
  31410. req, err := http.NewRequest("GET", urls, body)
  31411. if err != nil {
  31412. return nil, err
  31413. }
  31414. req.Header = reqHeaders
  31415. googleapi.Expand(req.URL, map[string]string{
  31416. "profileId": strconv.FormatInt(c.profileId, 10),
  31417. "projectId": strconv.FormatInt(c.projectId, 10),
  31418. "id": strconv.FormatInt(c.id, 10),
  31419. })
  31420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31421. }
  31422. // Do executes the "dfareporting.inventoryItems.get" call.
  31423. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  31424. // status code is an error. Response headers are in either
  31425. // *InventoryItem.ServerResponse.Header or (if a response was returned
  31426. // at all) in error.(*googleapi.Error).Header. Use
  31427. // googleapi.IsNotModified to check whether the returned error was
  31428. // because http.StatusNotModified was returned.
  31429. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  31430. gensupport.SetOptions(c.urlParams_, opts...)
  31431. res, err := c.doRequest("json")
  31432. if res != nil && res.StatusCode == http.StatusNotModified {
  31433. if res.Body != nil {
  31434. res.Body.Close()
  31435. }
  31436. return nil, &googleapi.Error{
  31437. Code: res.StatusCode,
  31438. Header: res.Header,
  31439. }
  31440. }
  31441. if err != nil {
  31442. return nil, err
  31443. }
  31444. defer googleapi.CloseBody(res)
  31445. if err := googleapi.CheckResponse(res); err != nil {
  31446. return nil, err
  31447. }
  31448. ret := &InventoryItem{
  31449. ServerResponse: googleapi.ServerResponse{
  31450. Header: res.Header,
  31451. HTTPStatusCode: res.StatusCode,
  31452. },
  31453. }
  31454. target := &ret
  31455. if err := gensupport.DecodeResponse(target, res); err != nil {
  31456. return nil, err
  31457. }
  31458. return ret, nil
  31459. // {
  31460. // "description": "Gets one inventory item by ID.",
  31461. // "httpMethod": "GET",
  31462. // "id": "dfareporting.inventoryItems.get",
  31463. // "parameterOrder": [
  31464. // "profileId",
  31465. // "projectId",
  31466. // "id"
  31467. // ],
  31468. // "parameters": {
  31469. // "id": {
  31470. // "description": "Inventory item ID.",
  31471. // "format": "int64",
  31472. // "location": "path",
  31473. // "required": true,
  31474. // "type": "string"
  31475. // },
  31476. // "profileId": {
  31477. // "description": "User profile ID associated with this request.",
  31478. // "format": "int64",
  31479. // "location": "path",
  31480. // "required": true,
  31481. // "type": "string"
  31482. // },
  31483. // "projectId": {
  31484. // "description": "Project ID for order documents.",
  31485. // "format": "int64",
  31486. // "location": "path",
  31487. // "required": true,
  31488. // "type": "string"
  31489. // }
  31490. // },
  31491. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  31492. // "response": {
  31493. // "$ref": "InventoryItem"
  31494. // },
  31495. // "scopes": [
  31496. // "https://www.googleapis.com/auth/dfatrafficking"
  31497. // ]
  31498. // }
  31499. }
  31500. // method id "dfareporting.inventoryItems.list":
  31501. type InventoryItemsListCall struct {
  31502. s *Service
  31503. profileId int64
  31504. projectId int64
  31505. urlParams_ gensupport.URLParams
  31506. ifNoneMatch_ string
  31507. ctx_ context.Context
  31508. header_ http.Header
  31509. }
  31510. // List: Retrieves a list of inventory items, possibly filtered. This
  31511. // method supports paging.
  31512. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  31513. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31514. c.profileId = profileId
  31515. c.projectId = projectId
  31516. return c
  31517. }
  31518. // Ids sets the optional parameter "ids": Select only inventory items
  31519. // with these IDs.
  31520. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  31521. var ids_ []string
  31522. for _, v := range ids {
  31523. ids_ = append(ids_, fmt.Sprint(v))
  31524. }
  31525. c.urlParams_.SetMulti("ids", ids_)
  31526. return c
  31527. }
  31528. // InPlan sets the optional parameter "inPlan": Select only inventory
  31529. // items that are in plan.
  31530. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  31531. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  31532. return c
  31533. }
  31534. // MaxResults sets the optional parameter "maxResults": Maximum number
  31535. // of results to return.
  31536. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  31537. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31538. return c
  31539. }
  31540. // OrderId sets the optional parameter "orderId": Select only inventory
  31541. // items that belong to specified orders.
  31542. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  31543. var orderId_ []string
  31544. for _, v := range orderId {
  31545. orderId_ = append(orderId_, fmt.Sprint(v))
  31546. }
  31547. c.urlParams_.SetMulti("orderId", orderId_)
  31548. return c
  31549. }
  31550. // PageToken sets the optional parameter "pageToken": Value of the
  31551. // nextPageToken from the previous result page.
  31552. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  31553. c.urlParams_.Set("pageToken", pageToken)
  31554. return c
  31555. }
  31556. // SiteId sets the optional parameter "siteId": Select only inventory
  31557. // items that are associated with these sites.
  31558. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  31559. var siteId_ []string
  31560. for _, v := range siteId {
  31561. siteId_ = append(siteId_, fmt.Sprint(v))
  31562. }
  31563. c.urlParams_.SetMulti("siteId", siteId_)
  31564. return c
  31565. }
  31566. // SortField sets the optional parameter "sortField": Field by which to
  31567. // sort the list.
  31568. //
  31569. // Possible values:
  31570. // "ID" (default)
  31571. // "NAME"
  31572. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  31573. c.urlParams_.Set("sortField", sortField)
  31574. return c
  31575. }
  31576. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  31577. // results.
  31578. //
  31579. // Possible values:
  31580. // "ASCENDING" (default)
  31581. // "DESCENDING"
  31582. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  31583. c.urlParams_.Set("sortOrder", sortOrder)
  31584. return c
  31585. }
  31586. // Type sets the optional parameter "type": Select only inventory items
  31587. // with this type.
  31588. //
  31589. // Possible values:
  31590. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  31591. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31592. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  31593. c.urlParams_.Set("type", type_)
  31594. return c
  31595. }
  31596. // Fields allows partial responses to be retrieved. See
  31597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31598. // for more information.
  31599. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  31600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31601. return c
  31602. }
  31603. // IfNoneMatch sets the optional parameter which makes the operation
  31604. // fail if the object's ETag matches the given value. This is useful for
  31605. // getting updates only after the object has changed since the last
  31606. // request. Use googleapi.IsNotModified to check whether the response
  31607. // error from Do is the result of In-None-Match.
  31608. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  31609. c.ifNoneMatch_ = entityTag
  31610. return c
  31611. }
  31612. // Context sets the context to be used in this call's Do method. Any
  31613. // pending HTTP request will be aborted if the provided context is
  31614. // canceled.
  31615. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  31616. c.ctx_ = ctx
  31617. return c
  31618. }
  31619. // Header returns an http.Header that can be modified by the caller to
  31620. // add HTTP headers to the request.
  31621. func (c *InventoryItemsListCall) Header() http.Header {
  31622. if c.header_ == nil {
  31623. c.header_ = make(http.Header)
  31624. }
  31625. return c.header_
  31626. }
  31627. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  31628. reqHeaders := make(http.Header)
  31629. for k, v := range c.header_ {
  31630. reqHeaders[k] = v
  31631. }
  31632. reqHeaders.Set("User-Agent", c.s.userAgent())
  31633. if c.ifNoneMatch_ != "" {
  31634. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31635. }
  31636. var body io.Reader = nil
  31637. c.urlParams_.Set("alt", alt)
  31638. c.urlParams_.Set("prettyPrint", "false")
  31639. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  31640. urls += "?" + c.urlParams_.Encode()
  31641. req, err := http.NewRequest("GET", urls, body)
  31642. if err != nil {
  31643. return nil, err
  31644. }
  31645. req.Header = reqHeaders
  31646. googleapi.Expand(req.URL, map[string]string{
  31647. "profileId": strconv.FormatInt(c.profileId, 10),
  31648. "projectId": strconv.FormatInt(c.projectId, 10),
  31649. })
  31650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31651. }
  31652. // Do executes the "dfareporting.inventoryItems.list" call.
  31653. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  31654. // Any non-2xx status code is an error. Response headers are in either
  31655. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  31656. // was returned at all) in error.(*googleapi.Error).Header. Use
  31657. // googleapi.IsNotModified to check whether the returned error was
  31658. // because http.StatusNotModified was returned.
  31659. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  31660. gensupport.SetOptions(c.urlParams_, opts...)
  31661. res, err := c.doRequest("json")
  31662. if res != nil && res.StatusCode == http.StatusNotModified {
  31663. if res.Body != nil {
  31664. res.Body.Close()
  31665. }
  31666. return nil, &googleapi.Error{
  31667. Code: res.StatusCode,
  31668. Header: res.Header,
  31669. }
  31670. }
  31671. if err != nil {
  31672. return nil, err
  31673. }
  31674. defer googleapi.CloseBody(res)
  31675. if err := googleapi.CheckResponse(res); err != nil {
  31676. return nil, err
  31677. }
  31678. ret := &InventoryItemsListResponse{
  31679. ServerResponse: googleapi.ServerResponse{
  31680. Header: res.Header,
  31681. HTTPStatusCode: res.StatusCode,
  31682. },
  31683. }
  31684. target := &ret
  31685. if err := gensupport.DecodeResponse(target, res); err != nil {
  31686. return nil, err
  31687. }
  31688. return ret, nil
  31689. // {
  31690. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  31691. // "httpMethod": "GET",
  31692. // "id": "dfareporting.inventoryItems.list",
  31693. // "parameterOrder": [
  31694. // "profileId",
  31695. // "projectId"
  31696. // ],
  31697. // "parameters": {
  31698. // "ids": {
  31699. // "description": "Select only inventory items with these IDs.",
  31700. // "format": "int64",
  31701. // "location": "query",
  31702. // "repeated": true,
  31703. // "type": "string"
  31704. // },
  31705. // "inPlan": {
  31706. // "description": "Select only inventory items that are in plan.",
  31707. // "location": "query",
  31708. // "type": "boolean"
  31709. // },
  31710. // "maxResults": {
  31711. // "default": "1000",
  31712. // "description": "Maximum number of results to return.",
  31713. // "format": "int32",
  31714. // "location": "query",
  31715. // "maximum": "1000",
  31716. // "minimum": "0",
  31717. // "type": "integer"
  31718. // },
  31719. // "orderId": {
  31720. // "description": "Select only inventory items that belong to specified orders.",
  31721. // "format": "int64",
  31722. // "location": "query",
  31723. // "repeated": true,
  31724. // "type": "string"
  31725. // },
  31726. // "pageToken": {
  31727. // "description": "Value of the nextPageToken from the previous result page.",
  31728. // "location": "query",
  31729. // "type": "string"
  31730. // },
  31731. // "profileId": {
  31732. // "description": "User profile ID associated with this request.",
  31733. // "format": "int64",
  31734. // "location": "path",
  31735. // "required": true,
  31736. // "type": "string"
  31737. // },
  31738. // "projectId": {
  31739. // "description": "Project ID for order documents.",
  31740. // "format": "int64",
  31741. // "location": "path",
  31742. // "required": true,
  31743. // "type": "string"
  31744. // },
  31745. // "siteId": {
  31746. // "description": "Select only inventory items that are associated with these sites.",
  31747. // "format": "int64",
  31748. // "location": "query",
  31749. // "repeated": true,
  31750. // "type": "string"
  31751. // },
  31752. // "sortField": {
  31753. // "default": "ID",
  31754. // "description": "Field by which to sort the list.",
  31755. // "enum": [
  31756. // "ID",
  31757. // "NAME"
  31758. // ],
  31759. // "enumDescriptions": [
  31760. // "",
  31761. // ""
  31762. // ],
  31763. // "location": "query",
  31764. // "type": "string"
  31765. // },
  31766. // "sortOrder": {
  31767. // "default": "ASCENDING",
  31768. // "description": "Order of sorted results.",
  31769. // "enum": [
  31770. // "ASCENDING",
  31771. // "DESCENDING"
  31772. // ],
  31773. // "enumDescriptions": [
  31774. // "",
  31775. // ""
  31776. // ],
  31777. // "location": "query",
  31778. // "type": "string"
  31779. // },
  31780. // "type": {
  31781. // "description": "Select only inventory items with this type.",
  31782. // "enum": [
  31783. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  31784. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31785. // ],
  31786. // "enumDescriptions": [
  31787. // "",
  31788. // ""
  31789. // ],
  31790. // "location": "query",
  31791. // "type": "string"
  31792. // }
  31793. // },
  31794. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  31795. // "response": {
  31796. // "$ref": "InventoryItemsListResponse"
  31797. // },
  31798. // "scopes": [
  31799. // "https://www.googleapis.com/auth/dfatrafficking"
  31800. // ]
  31801. // }
  31802. }
  31803. // Pages invokes f for each page of results.
  31804. // A non-nil error returned from f will halt the iteration.
  31805. // The provided context supersedes any context provided to the Context method.
  31806. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  31807. c.ctx_ = ctx
  31808. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31809. for {
  31810. x, err := c.Do()
  31811. if err != nil {
  31812. return err
  31813. }
  31814. if err := f(x); err != nil {
  31815. return err
  31816. }
  31817. if x.NextPageToken == "" {
  31818. return nil
  31819. }
  31820. c.PageToken(x.NextPageToken)
  31821. }
  31822. }
  31823. // method id "dfareporting.languages.list":
  31824. type LanguagesListCall struct {
  31825. s *Service
  31826. profileId int64
  31827. urlParams_ gensupport.URLParams
  31828. ifNoneMatch_ string
  31829. ctx_ context.Context
  31830. header_ http.Header
  31831. }
  31832. // List: Retrieves a list of languages.
  31833. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  31834. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31835. c.profileId = profileId
  31836. return c
  31837. }
  31838. // Fields allows partial responses to be retrieved. See
  31839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31840. // for more information.
  31841. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  31842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31843. return c
  31844. }
  31845. // IfNoneMatch sets the optional parameter which makes the operation
  31846. // fail if the object's ETag matches the given value. This is useful for
  31847. // getting updates only after the object has changed since the last
  31848. // request. Use googleapi.IsNotModified to check whether the response
  31849. // error from Do is the result of In-None-Match.
  31850. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  31851. c.ifNoneMatch_ = entityTag
  31852. return c
  31853. }
  31854. // Context sets the context to be used in this call's Do method. Any
  31855. // pending HTTP request will be aborted if the provided context is
  31856. // canceled.
  31857. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  31858. c.ctx_ = ctx
  31859. return c
  31860. }
  31861. // Header returns an http.Header that can be modified by the caller to
  31862. // add HTTP headers to the request.
  31863. func (c *LanguagesListCall) Header() http.Header {
  31864. if c.header_ == nil {
  31865. c.header_ = make(http.Header)
  31866. }
  31867. return c.header_
  31868. }
  31869. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  31870. reqHeaders := make(http.Header)
  31871. for k, v := range c.header_ {
  31872. reqHeaders[k] = v
  31873. }
  31874. reqHeaders.Set("User-Agent", c.s.userAgent())
  31875. if c.ifNoneMatch_ != "" {
  31876. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31877. }
  31878. var body io.Reader = nil
  31879. c.urlParams_.Set("alt", alt)
  31880. c.urlParams_.Set("prettyPrint", "false")
  31881. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  31882. urls += "?" + c.urlParams_.Encode()
  31883. req, err := http.NewRequest("GET", urls, body)
  31884. if err != nil {
  31885. return nil, err
  31886. }
  31887. req.Header = reqHeaders
  31888. googleapi.Expand(req.URL, map[string]string{
  31889. "profileId": strconv.FormatInt(c.profileId, 10),
  31890. })
  31891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31892. }
  31893. // Do executes the "dfareporting.languages.list" call.
  31894. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  31895. // non-2xx status code is an error. Response headers are in either
  31896. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  31897. // returned at all) in error.(*googleapi.Error).Header. Use
  31898. // googleapi.IsNotModified to check whether the returned error was
  31899. // because http.StatusNotModified was returned.
  31900. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  31901. gensupport.SetOptions(c.urlParams_, opts...)
  31902. res, err := c.doRequest("json")
  31903. if res != nil && res.StatusCode == http.StatusNotModified {
  31904. if res.Body != nil {
  31905. res.Body.Close()
  31906. }
  31907. return nil, &googleapi.Error{
  31908. Code: res.StatusCode,
  31909. Header: res.Header,
  31910. }
  31911. }
  31912. if err != nil {
  31913. return nil, err
  31914. }
  31915. defer googleapi.CloseBody(res)
  31916. if err := googleapi.CheckResponse(res); err != nil {
  31917. return nil, err
  31918. }
  31919. ret := &LanguagesListResponse{
  31920. ServerResponse: googleapi.ServerResponse{
  31921. Header: res.Header,
  31922. HTTPStatusCode: res.StatusCode,
  31923. },
  31924. }
  31925. target := &ret
  31926. if err := gensupport.DecodeResponse(target, res); err != nil {
  31927. return nil, err
  31928. }
  31929. return ret, nil
  31930. // {
  31931. // "description": "Retrieves a list of languages.",
  31932. // "httpMethod": "GET",
  31933. // "id": "dfareporting.languages.list",
  31934. // "parameterOrder": [
  31935. // "profileId"
  31936. // ],
  31937. // "parameters": {
  31938. // "profileId": {
  31939. // "description": "User profile ID associated with this request.",
  31940. // "format": "int64",
  31941. // "location": "path",
  31942. // "required": true,
  31943. // "type": "string"
  31944. // }
  31945. // },
  31946. // "path": "userprofiles/{profileId}/languages",
  31947. // "response": {
  31948. // "$ref": "LanguagesListResponse"
  31949. // },
  31950. // "scopes": [
  31951. // "https://www.googleapis.com/auth/dfatrafficking"
  31952. // ]
  31953. // }
  31954. }
  31955. // method id "dfareporting.metros.list":
  31956. type MetrosListCall struct {
  31957. s *Service
  31958. profileId int64
  31959. urlParams_ gensupport.URLParams
  31960. ifNoneMatch_ string
  31961. ctx_ context.Context
  31962. header_ http.Header
  31963. }
  31964. // List: Retrieves a list of metros.
  31965. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  31966. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31967. c.profileId = profileId
  31968. return c
  31969. }
  31970. // Fields allows partial responses to be retrieved. See
  31971. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31972. // for more information.
  31973. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  31974. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31975. return c
  31976. }
  31977. // IfNoneMatch sets the optional parameter which makes the operation
  31978. // fail if the object's ETag matches the given value. This is useful for
  31979. // getting updates only after the object has changed since the last
  31980. // request. Use googleapi.IsNotModified to check whether the response
  31981. // error from Do is the result of In-None-Match.
  31982. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  31983. c.ifNoneMatch_ = entityTag
  31984. return c
  31985. }
  31986. // Context sets the context to be used in this call's Do method. Any
  31987. // pending HTTP request will be aborted if the provided context is
  31988. // canceled.
  31989. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  31990. c.ctx_ = ctx
  31991. return c
  31992. }
  31993. // Header returns an http.Header that can be modified by the caller to
  31994. // add HTTP headers to the request.
  31995. func (c *MetrosListCall) Header() http.Header {
  31996. if c.header_ == nil {
  31997. c.header_ = make(http.Header)
  31998. }
  31999. return c.header_
  32000. }
  32001. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  32002. reqHeaders := make(http.Header)
  32003. for k, v := range c.header_ {
  32004. reqHeaders[k] = v
  32005. }
  32006. reqHeaders.Set("User-Agent", c.s.userAgent())
  32007. if c.ifNoneMatch_ != "" {
  32008. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32009. }
  32010. var body io.Reader = nil
  32011. c.urlParams_.Set("alt", alt)
  32012. c.urlParams_.Set("prettyPrint", "false")
  32013. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  32014. urls += "?" + c.urlParams_.Encode()
  32015. req, err := http.NewRequest("GET", urls, body)
  32016. if err != nil {
  32017. return nil, err
  32018. }
  32019. req.Header = reqHeaders
  32020. googleapi.Expand(req.URL, map[string]string{
  32021. "profileId": strconv.FormatInt(c.profileId, 10),
  32022. })
  32023. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32024. }
  32025. // Do executes the "dfareporting.metros.list" call.
  32026. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  32027. // non-2xx status code is an error. Response headers are in either
  32028. // *MetrosListResponse.ServerResponse.Header or (if a response was
  32029. // returned at all) in error.(*googleapi.Error).Header. Use
  32030. // googleapi.IsNotModified to check whether the returned error was
  32031. // because http.StatusNotModified was returned.
  32032. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  32033. gensupport.SetOptions(c.urlParams_, opts...)
  32034. res, err := c.doRequest("json")
  32035. if res != nil && res.StatusCode == http.StatusNotModified {
  32036. if res.Body != nil {
  32037. res.Body.Close()
  32038. }
  32039. return nil, &googleapi.Error{
  32040. Code: res.StatusCode,
  32041. Header: res.Header,
  32042. }
  32043. }
  32044. if err != nil {
  32045. return nil, err
  32046. }
  32047. defer googleapi.CloseBody(res)
  32048. if err := googleapi.CheckResponse(res); err != nil {
  32049. return nil, err
  32050. }
  32051. ret := &MetrosListResponse{
  32052. ServerResponse: googleapi.ServerResponse{
  32053. Header: res.Header,
  32054. HTTPStatusCode: res.StatusCode,
  32055. },
  32056. }
  32057. target := &ret
  32058. if err := gensupport.DecodeResponse(target, res); err != nil {
  32059. return nil, err
  32060. }
  32061. return ret, nil
  32062. // {
  32063. // "description": "Retrieves a list of metros.",
  32064. // "httpMethod": "GET",
  32065. // "id": "dfareporting.metros.list",
  32066. // "parameterOrder": [
  32067. // "profileId"
  32068. // ],
  32069. // "parameters": {
  32070. // "profileId": {
  32071. // "description": "User profile ID associated with this request.",
  32072. // "format": "int64",
  32073. // "location": "path",
  32074. // "required": true,
  32075. // "type": "string"
  32076. // }
  32077. // },
  32078. // "path": "userprofiles/{profileId}/metros",
  32079. // "response": {
  32080. // "$ref": "MetrosListResponse"
  32081. // },
  32082. // "scopes": [
  32083. // "https://www.googleapis.com/auth/dfatrafficking"
  32084. // ]
  32085. // }
  32086. }
  32087. // method id "dfareporting.mobileApps.get":
  32088. type MobileAppsGetCall struct {
  32089. s *Service
  32090. profileId int64
  32091. id string
  32092. urlParams_ gensupport.URLParams
  32093. ifNoneMatch_ string
  32094. ctx_ context.Context
  32095. header_ http.Header
  32096. }
  32097. // Get: Gets one mobile app by ID.
  32098. func (r *MobileAppsService) Get(profileId int64, id string) *MobileAppsGetCall {
  32099. c := &MobileAppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32100. c.profileId = profileId
  32101. c.id = id
  32102. return c
  32103. }
  32104. // Fields allows partial responses to be retrieved. See
  32105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32106. // for more information.
  32107. func (c *MobileAppsGetCall) Fields(s ...googleapi.Field) *MobileAppsGetCall {
  32108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32109. return c
  32110. }
  32111. // IfNoneMatch sets the optional parameter which makes the operation
  32112. // fail if the object's ETag matches the given value. This is useful for
  32113. // getting updates only after the object has changed since the last
  32114. // request. Use googleapi.IsNotModified to check whether the response
  32115. // error from Do is the result of In-None-Match.
  32116. func (c *MobileAppsGetCall) IfNoneMatch(entityTag string) *MobileAppsGetCall {
  32117. c.ifNoneMatch_ = entityTag
  32118. return c
  32119. }
  32120. // Context sets the context to be used in this call's Do method. Any
  32121. // pending HTTP request will be aborted if the provided context is
  32122. // canceled.
  32123. func (c *MobileAppsGetCall) Context(ctx context.Context) *MobileAppsGetCall {
  32124. c.ctx_ = ctx
  32125. return c
  32126. }
  32127. // Header returns an http.Header that can be modified by the caller to
  32128. // add HTTP headers to the request.
  32129. func (c *MobileAppsGetCall) Header() http.Header {
  32130. if c.header_ == nil {
  32131. c.header_ = make(http.Header)
  32132. }
  32133. return c.header_
  32134. }
  32135. func (c *MobileAppsGetCall) doRequest(alt string) (*http.Response, error) {
  32136. reqHeaders := make(http.Header)
  32137. for k, v := range c.header_ {
  32138. reqHeaders[k] = v
  32139. }
  32140. reqHeaders.Set("User-Agent", c.s.userAgent())
  32141. if c.ifNoneMatch_ != "" {
  32142. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32143. }
  32144. var body io.Reader = nil
  32145. c.urlParams_.Set("alt", alt)
  32146. c.urlParams_.Set("prettyPrint", "false")
  32147. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps/{id}")
  32148. urls += "?" + c.urlParams_.Encode()
  32149. req, err := http.NewRequest("GET", urls, body)
  32150. if err != nil {
  32151. return nil, err
  32152. }
  32153. req.Header = reqHeaders
  32154. googleapi.Expand(req.URL, map[string]string{
  32155. "profileId": strconv.FormatInt(c.profileId, 10),
  32156. "id": c.id,
  32157. })
  32158. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32159. }
  32160. // Do executes the "dfareporting.mobileApps.get" call.
  32161. // Exactly one of *MobileApp or error will be non-nil. Any non-2xx
  32162. // status code is an error. Response headers are in either
  32163. // *MobileApp.ServerResponse.Header or (if a response was returned at
  32164. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32165. // to check whether the returned error was because
  32166. // http.StatusNotModified was returned.
  32167. func (c *MobileAppsGetCall) Do(opts ...googleapi.CallOption) (*MobileApp, error) {
  32168. gensupport.SetOptions(c.urlParams_, opts...)
  32169. res, err := c.doRequest("json")
  32170. if res != nil && res.StatusCode == http.StatusNotModified {
  32171. if res.Body != nil {
  32172. res.Body.Close()
  32173. }
  32174. return nil, &googleapi.Error{
  32175. Code: res.StatusCode,
  32176. Header: res.Header,
  32177. }
  32178. }
  32179. if err != nil {
  32180. return nil, err
  32181. }
  32182. defer googleapi.CloseBody(res)
  32183. if err := googleapi.CheckResponse(res); err != nil {
  32184. return nil, err
  32185. }
  32186. ret := &MobileApp{
  32187. ServerResponse: googleapi.ServerResponse{
  32188. Header: res.Header,
  32189. HTTPStatusCode: res.StatusCode,
  32190. },
  32191. }
  32192. target := &ret
  32193. if err := gensupport.DecodeResponse(target, res); err != nil {
  32194. return nil, err
  32195. }
  32196. return ret, nil
  32197. // {
  32198. // "description": "Gets one mobile app by ID.",
  32199. // "httpMethod": "GET",
  32200. // "id": "dfareporting.mobileApps.get",
  32201. // "parameterOrder": [
  32202. // "profileId",
  32203. // "id"
  32204. // ],
  32205. // "parameters": {
  32206. // "id": {
  32207. // "description": "Mobile app ID.",
  32208. // "location": "path",
  32209. // "required": true,
  32210. // "type": "string"
  32211. // },
  32212. // "profileId": {
  32213. // "description": "User profile ID associated with this request.",
  32214. // "format": "int64",
  32215. // "location": "path",
  32216. // "required": true,
  32217. // "type": "string"
  32218. // }
  32219. // },
  32220. // "path": "userprofiles/{profileId}/mobileApps/{id}",
  32221. // "response": {
  32222. // "$ref": "MobileApp"
  32223. // },
  32224. // "scopes": [
  32225. // "https://www.googleapis.com/auth/dfatrafficking"
  32226. // ]
  32227. // }
  32228. }
  32229. // method id "dfareporting.mobileApps.list":
  32230. type MobileAppsListCall struct {
  32231. s *Service
  32232. profileId int64
  32233. urlParams_ gensupport.URLParams
  32234. ifNoneMatch_ string
  32235. ctx_ context.Context
  32236. header_ http.Header
  32237. }
  32238. // List: Retrieves list of available mobile apps.
  32239. func (r *MobileAppsService) List(profileId int64) *MobileAppsListCall {
  32240. c := &MobileAppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32241. c.profileId = profileId
  32242. return c
  32243. }
  32244. // Directories sets the optional parameter "directories": Select only
  32245. // apps from these directories.
  32246. //
  32247. // Possible values:
  32248. // "APPLE_APP_STORE"
  32249. // "GOOGLE_PLAY_STORE"
  32250. // "UNKNOWN"
  32251. func (c *MobileAppsListCall) Directories(directories ...string) *MobileAppsListCall {
  32252. c.urlParams_.SetMulti("directories", append([]string{}, directories...))
  32253. return c
  32254. }
  32255. // Ids sets the optional parameter "ids": Select only apps with these
  32256. // IDs.
  32257. func (c *MobileAppsListCall) Ids(ids ...string) *MobileAppsListCall {
  32258. c.urlParams_.SetMulti("ids", append([]string{}, ids...))
  32259. return c
  32260. }
  32261. // MaxResults sets the optional parameter "maxResults": Maximum number
  32262. // of results to return.
  32263. func (c *MobileAppsListCall) MaxResults(maxResults int64) *MobileAppsListCall {
  32264. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32265. return c
  32266. }
  32267. // PageToken sets the optional parameter "pageToken": Value of the
  32268. // nextPageToken from the previous result page.
  32269. func (c *MobileAppsListCall) PageToken(pageToken string) *MobileAppsListCall {
  32270. c.urlParams_.Set("pageToken", pageToken)
  32271. return c
  32272. }
  32273. // SearchString sets the optional parameter "searchString": Allows
  32274. // searching for objects by name or ID. Wildcards (*) are allowed. For
  32275. // example, "app*2015" will return objects with names like "app Jan
  32276. // 2018", "app Jan 2018", or simply "app 2018". Most of the searches
  32277. // also add wildcards implicitly at the start and the end of the search
  32278. // string. For example, a search string of "app" will match objects with
  32279. // name "my app", "app 2018", or simply "app".
  32280. func (c *MobileAppsListCall) SearchString(searchString string) *MobileAppsListCall {
  32281. c.urlParams_.Set("searchString", searchString)
  32282. return c
  32283. }
  32284. // Fields allows partial responses to be retrieved. See
  32285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32286. // for more information.
  32287. func (c *MobileAppsListCall) Fields(s ...googleapi.Field) *MobileAppsListCall {
  32288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32289. return c
  32290. }
  32291. // IfNoneMatch sets the optional parameter which makes the operation
  32292. // fail if the object's ETag matches the given value. This is useful for
  32293. // getting updates only after the object has changed since the last
  32294. // request. Use googleapi.IsNotModified to check whether the response
  32295. // error from Do is the result of In-None-Match.
  32296. func (c *MobileAppsListCall) IfNoneMatch(entityTag string) *MobileAppsListCall {
  32297. c.ifNoneMatch_ = entityTag
  32298. return c
  32299. }
  32300. // Context sets the context to be used in this call's Do method. Any
  32301. // pending HTTP request will be aborted if the provided context is
  32302. // canceled.
  32303. func (c *MobileAppsListCall) Context(ctx context.Context) *MobileAppsListCall {
  32304. c.ctx_ = ctx
  32305. return c
  32306. }
  32307. // Header returns an http.Header that can be modified by the caller to
  32308. // add HTTP headers to the request.
  32309. func (c *MobileAppsListCall) Header() http.Header {
  32310. if c.header_ == nil {
  32311. c.header_ = make(http.Header)
  32312. }
  32313. return c.header_
  32314. }
  32315. func (c *MobileAppsListCall) doRequest(alt string) (*http.Response, error) {
  32316. reqHeaders := make(http.Header)
  32317. for k, v := range c.header_ {
  32318. reqHeaders[k] = v
  32319. }
  32320. reqHeaders.Set("User-Agent", c.s.userAgent())
  32321. if c.ifNoneMatch_ != "" {
  32322. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32323. }
  32324. var body io.Reader = nil
  32325. c.urlParams_.Set("alt", alt)
  32326. c.urlParams_.Set("prettyPrint", "false")
  32327. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps")
  32328. urls += "?" + c.urlParams_.Encode()
  32329. req, err := http.NewRequest("GET", urls, body)
  32330. if err != nil {
  32331. return nil, err
  32332. }
  32333. req.Header = reqHeaders
  32334. googleapi.Expand(req.URL, map[string]string{
  32335. "profileId": strconv.FormatInt(c.profileId, 10),
  32336. })
  32337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32338. }
  32339. // Do executes the "dfareporting.mobileApps.list" call.
  32340. // Exactly one of *MobileAppsListResponse or error will be non-nil. Any
  32341. // non-2xx status code is an error. Response headers are in either
  32342. // *MobileAppsListResponse.ServerResponse.Header or (if a response was
  32343. // returned at all) in error.(*googleapi.Error).Header. Use
  32344. // googleapi.IsNotModified to check whether the returned error was
  32345. // because http.StatusNotModified was returned.
  32346. func (c *MobileAppsListCall) Do(opts ...googleapi.CallOption) (*MobileAppsListResponse, error) {
  32347. gensupport.SetOptions(c.urlParams_, opts...)
  32348. res, err := c.doRequest("json")
  32349. if res != nil && res.StatusCode == http.StatusNotModified {
  32350. if res.Body != nil {
  32351. res.Body.Close()
  32352. }
  32353. return nil, &googleapi.Error{
  32354. Code: res.StatusCode,
  32355. Header: res.Header,
  32356. }
  32357. }
  32358. if err != nil {
  32359. return nil, err
  32360. }
  32361. defer googleapi.CloseBody(res)
  32362. if err := googleapi.CheckResponse(res); err != nil {
  32363. return nil, err
  32364. }
  32365. ret := &MobileAppsListResponse{
  32366. ServerResponse: googleapi.ServerResponse{
  32367. Header: res.Header,
  32368. HTTPStatusCode: res.StatusCode,
  32369. },
  32370. }
  32371. target := &ret
  32372. if err := gensupport.DecodeResponse(target, res); err != nil {
  32373. return nil, err
  32374. }
  32375. return ret, nil
  32376. // {
  32377. // "description": "Retrieves list of available mobile apps.",
  32378. // "httpMethod": "GET",
  32379. // "id": "dfareporting.mobileApps.list",
  32380. // "parameterOrder": [
  32381. // "profileId"
  32382. // ],
  32383. // "parameters": {
  32384. // "directories": {
  32385. // "description": "Select only apps from these directories.",
  32386. // "enum": [
  32387. // "APPLE_APP_STORE",
  32388. // "GOOGLE_PLAY_STORE",
  32389. // "UNKNOWN"
  32390. // ],
  32391. // "enumDescriptions": [
  32392. // "",
  32393. // "",
  32394. // ""
  32395. // ],
  32396. // "location": "query",
  32397. // "repeated": true,
  32398. // "type": "string"
  32399. // },
  32400. // "ids": {
  32401. // "description": "Select only apps with these IDs.",
  32402. // "location": "query",
  32403. // "repeated": true,
  32404. // "type": "string"
  32405. // },
  32406. // "maxResults": {
  32407. // "default": "1000",
  32408. // "description": "Maximum number of results to return.",
  32409. // "format": "int32",
  32410. // "location": "query",
  32411. // "maximum": "1000",
  32412. // "minimum": "0",
  32413. // "type": "integer"
  32414. // },
  32415. // "pageToken": {
  32416. // "description": "Value of the nextPageToken from the previous result page.",
  32417. // "location": "query",
  32418. // "type": "string"
  32419. // },
  32420. // "profileId": {
  32421. // "description": "User profile ID associated with this request.",
  32422. // "format": "int64",
  32423. // "location": "path",
  32424. // "required": true,
  32425. // "type": "string"
  32426. // },
  32427. // "searchString": {
  32428. // "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\".",
  32429. // "location": "query",
  32430. // "type": "string"
  32431. // }
  32432. // },
  32433. // "path": "userprofiles/{profileId}/mobileApps",
  32434. // "response": {
  32435. // "$ref": "MobileAppsListResponse"
  32436. // },
  32437. // "scopes": [
  32438. // "https://www.googleapis.com/auth/dfatrafficking"
  32439. // ]
  32440. // }
  32441. }
  32442. // Pages invokes f for each page of results.
  32443. // A non-nil error returned from f will halt the iteration.
  32444. // The provided context supersedes any context provided to the Context method.
  32445. func (c *MobileAppsListCall) Pages(ctx context.Context, f func(*MobileAppsListResponse) error) error {
  32446. c.ctx_ = ctx
  32447. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32448. for {
  32449. x, err := c.Do()
  32450. if err != nil {
  32451. return err
  32452. }
  32453. if err := f(x); err != nil {
  32454. return err
  32455. }
  32456. if x.NextPageToken == "" {
  32457. return nil
  32458. }
  32459. c.PageToken(x.NextPageToken)
  32460. }
  32461. }
  32462. // method id "dfareporting.mobileCarriers.get":
  32463. type MobileCarriersGetCall struct {
  32464. s *Service
  32465. profileId int64
  32466. id int64
  32467. urlParams_ gensupport.URLParams
  32468. ifNoneMatch_ string
  32469. ctx_ context.Context
  32470. header_ http.Header
  32471. }
  32472. // Get: Gets one mobile carrier by ID.
  32473. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  32474. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32475. c.profileId = profileId
  32476. c.id = id
  32477. return c
  32478. }
  32479. // Fields allows partial responses to be retrieved. See
  32480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32481. // for more information.
  32482. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  32483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32484. return c
  32485. }
  32486. // IfNoneMatch sets the optional parameter which makes the operation
  32487. // fail if the object's ETag matches the given value. This is useful for
  32488. // getting updates only after the object has changed since the last
  32489. // request. Use googleapi.IsNotModified to check whether the response
  32490. // error from Do is the result of In-None-Match.
  32491. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  32492. c.ifNoneMatch_ = entityTag
  32493. return c
  32494. }
  32495. // Context sets the context to be used in this call's Do method. Any
  32496. // pending HTTP request will be aborted if the provided context is
  32497. // canceled.
  32498. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  32499. c.ctx_ = ctx
  32500. return c
  32501. }
  32502. // Header returns an http.Header that can be modified by the caller to
  32503. // add HTTP headers to the request.
  32504. func (c *MobileCarriersGetCall) Header() http.Header {
  32505. if c.header_ == nil {
  32506. c.header_ = make(http.Header)
  32507. }
  32508. return c.header_
  32509. }
  32510. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  32511. reqHeaders := make(http.Header)
  32512. for k, v := range c.header_ {
  32513. reqHeaders[k] = v
  32514. }
  32515. reqHeaders.Set("User-Agent", c.s.userAgent())
  32516. if c.ifNoneMatch_ != "" {
  32517. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32518. }
  32519. var body io.Reader = nil
  32520. c.urlParams_.Set("alt", alt)
  32521. c.urlParams_.Set("prettyPrint", "false")
  32522. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  32523. urls += "?" + c.urlParams_.Encode()
  32524. req, err := http.NewRequest("GET", urls, body)
  32525. if err != nil {
  32526. return nil, err
  32527. }
  32528. req.Header = reqHeaders
  32529. googleapi.Expand(req.URL, map[string]string{
  32530. "profileId": strconv.FormatInt(c.profileId, 10),
  32531. "id": strconv.FormatInt(c.id, 10),
  32532. })
  32533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32534. }
  32535. // Do executes the "dfareporting.mobileCarriers.get" call.
  32536. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  32537. // status code is an error. Response headers are in either
  32538. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  32539. // at all) in error.(*googleapi.Error).Header. Use
  32540. // googleapi.IsNotModified to check whether the returned error was
  32541. // because http.StatusNotModified was returned.
  32542. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  32543. gensupport.SetOptions(c.urlParams_, opts...)
  32544. res, err := c.doRequest("json")
  32545. if res != nil && res.StatusCode == http.StatusNotModified {
  32546. if res.Body != nil {
  32547. res.Body.Close()
  32548. }
  32549. return nil, &googleapi.Error{
  32550. Code: res.StatusCode,
  32551. Header: res.Header,
  32552. }
  32553. }
  32554. if err != nil {
  32555. return nil, err
  32556. }
  32557. defer googleapi.CloseBody(res)
  32558. if err := googleapi.CheckResponse(res); err != nil {
  32559. return nil, err
  32560. }
  32561. ret := &MobileCarrier{
  32562. ServerResponse: googleapi.ServerResponse{
  32563. Header: res.Header,
  32564. HTTPStatusCode: res.StatusCode,
  32565. },
  32566. }
  32567. target := &ret
  32568. if err := gensupport.DecodeResponse(target, res); err != nil {
  32569. return nil, err
  32570. }
  32571. return ret, nil
  32572. // {
  32573. // "description": "Gets one mobile carrier by ID.",
  32574. // "httpMethod": "GET",
  32575. // "id": "dfareporting.mobileCarriers.get",
  32576. // "parameterOrder": [
  32577. // "profileId",
  32578. // "id"
  32579. // ],
  32580. // "parameters": {
  32581. // "id": {
  32582. // "description": "Mobile carrier ID.",
  32583. // "format": "int64",
  32584. // "location": "path",
  32585. // "required": true,
  32586. // "type": "string"
  32587. // },
  32588. // "profileId": {
  32589. // "description": "User profile ID associated with this request.",
  32590. // "format": "int64",
  32591. // "location": "path",
  32592. // "required": true,
  32593. // "type": "string"
  32594. // }
  32595. // },
  32596. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  32597. // "response": {
  32598. // "$ref": "MobileCarrier"
  32599. // },
  32600. // "scopes": [
  32601. // "https://www.googleapis.com/auth/dfatrafficking"
  32602. // ]
  32603. // }
  32604. }
  32605. // method id "dfareporting.mobileCarriers.list":
  32606. type MobileCarriersListCall struct {
  32607. s *Service
  32608. profileId int64
  32609. urlParams_ gensupport.URLParams
  32610. ifNoneMatch_ string
  32611. ctx_ context.Context
  32612. header_ http.Header
  32613. }
  32614. // List: Retrieves a list of mobile carriers.
  32615. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  32616. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32617. c.profileId = profileId
  32618. return c
  32619. }
  32620. // Fields allows partial responses to be retrieved. See
  32621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32622. // for more information.
  32623. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  32624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32625. return c
  32626. }
  32627. // IfNoneMatch sets the optional parameter which makes the operation
  32628. // fail if the object's ETag matches the given value. This is useful for
  32629. // getting updates only after the object has changed since the last
  32630. // request. Use googleapi.IsNotModified to check whether the response
  32631. // error from Do is the result of In-None-Match.
  32632. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  32633. c.ifNoneMatch_ = entityTag
  32634. return c
  32635. }
  32636. // Context sets the context to be used in this call's Do method. Any
  32637. // pending HTTP request will be aborted if the provided context is
  32638. // canceled.
  32639. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  32640. c.ctx_ = ctx
  32641. return c
  32642. }
  32643. // Header returns an http.Header that can be modified by the caller to
  32644. // add HTTP headers to the request.
  32645. func (c *MobileCarriersListCall) Header() http.Header {
  32646. if c.header_ == nil {
  32647. c.header_ = make(http.Header)
  32648. }
  32649. return c.header_
  32650. }
  32651. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  32652. reqHeaders := make(http.Header)
  32653. for k, v := range c.header_ {
  32654. reqHeaders[k] = v
  32655. }
  32656. reqHeaders.Set("User-Agent", c.s.userAgent())
  32657. if c.ifNoneMatch_ != "" {
  32658. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32659. }
  32660. var body io.Reader = nil
  32661. c.urlParams_.Set("alt", alt)
  32662. c.urlParams_.Set("prettyPrint", "false")
  32663. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  32664. urls += "?" + c.urlParams_.Encode()
  32665. req, err := http.NewRequest("GET", urls, body)
  32666. if err != nil {
  32667. return nil, err
  32668. }
  32669. req.Header = reqHeaders
  32670. googleapi.Expand(req.URL, map[string]string{
  32671. "profileId": strconv.FormatInt(c.profileId, 10),
  32672. })
  32673. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32674. }
  32675. // Do executes the "dfareporting.mobileCarriers.list" call.
  32676. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  32677. // Any non-2xx status code is an error. Response headers are in either
  32678. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  32679. // was returned at all) in error.(*googleapi.Error).Header. Use
  32680. // googleapi.IsNotModified to check whether the returned error was
  32681. // because http.StatusNotModified was returned.
  32682. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  32683. gensupport.SetOptions(c.urlParams_, opts...)
  32684. res, err := c.doRequest("json")
  32685. if res != nil && res.StatusCode == http.StatusNotModified {
  32686. if res.Body != nil {
  32687. res.Body.Close()
  32688. }
  32689. return nil, &googleapi.Error{
  32690. Code: res.StatusCode,
  32691. Header: res.Header,
  32692. }
  32693. }
  32694. if err != nil {
  32695. return nil, err
  32696. }
  32697. defer googleapi.CloseBody(res)
  32698. if err := googleapi.CheckResponse(res); err != nil {
  32699. return nil, err
  32700. }
  32701. ret := &MobileCarriersListResponse{
  32702. ServerResponse: googleapi.ServerResponse{
  32703. Header: res.Header,
  32704. HTTPStatusCode: res.StatusCode,
  32705. },
  32706. }
  32707. target := &ret
  32708. if err := gensupport.DecodeResponse(target, res); err != nil {
  32709. return nil, err
  32710. }
  32711. return ret, nil
  32712. // {
  32713. // "description": "Retrieves a list of mobile carriers.",
  32714. // "httpMethod": "GET",
  32715. // "id": "dfareporting.mobileCarriers.list",
  32716. // "parameterOrder": [
  32717. // "profileId"
  32718. // ],
  32719. // "parameters": {
  32720. // "profileId": {
  32721. // "description": "User profile ID associated with this request.",
  32722. // "format": "int64",
  32723. // "location": "path",
  32724. // "required": true,
  32725. // "type": "string"
  32726. // }
  32727. // },
  32728. // "path": "userprofiles/{profileId}/mobileCarriers",
  32729. // "response": {
  32730. // "$ref": "MobileCarriersListResponse"
  32731. // },
  32732. // "scopes": [
  32733. // "https://www.googleapis.com/auth/dfatrafficking"
  32734. // ]
  32735. // }
  32736. }
  32737. // method id "dfareporting.operatingSystemVersions.get":
  32738. type OperatingSystemVersionsGetCall struct {
  32739. s *Service
  32740. profileId int64
  32741. id int64
  32742. urlParams_ gensupport.URLParams
  32743. ifNoneMatch_ string
  32744. ctx_ context.Context
  32745. header_ http.Header
  32746. }
  32747. // Get: Gets one operating system version by ID.
  32748. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  32749. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32750. c.profileId = profileId
  32751. c.id = id
  32752. return c
  32753. }
  32754. // Fields allows partial responses to be retrieved. See
  32755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32756. // for more information.
  32757. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  32758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32759. return c
  32760. }
  32761. // IfNoneMatch sets the optional parameter which makes the operation
  32762. // fail if the object's ETag matches the given value. This is useful for
  32763. // getting updates only after the object has changed since the last
  32764. // request. Use googleapi.IsNotModified to check whether the response
  32765. // error from Do is the result of In-None-Match.
  32766. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  32767. c.ifNoneMatch_ = entityTag
  32768. return c
  32769. }
  32770. // Context sets the context to be used in this call's Do method. Any
  32771. // pending HTTP request will be aborted if the provided context is
  32772. // canceled.
  32773. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  32774. c.ctx_ = ctx
  32775. return c
  32776. }
  32777. // Header returns an http.Header that can be modified by the caller to
  32778. // add HTTP headers to the request.
  32779. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  32780. if c.header_ == nil {
  32781. c.header_ = make(http.Header)
  32782. }
  32783. return c.header_
  32784. }
  32785. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  32786. reqHeaders := make(http.Header)
  32787. for k, v := range c.header_ {
  32788. reqHeaders[k] = v
  32789. }
  32790. reqHeaders.Set("User-Agent", c.s.userAgent())
  32791. if c.ifNoneMatch_ != "" {
  32792. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32793. }
  32794. var body io.Reader = nil
  32795. c.urlParams_.Set("alt", alt)
  32796. c.urlParams_.Set("prettyPrint", "false")
  32797. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  32798. urls += "?" + c.urlParams_.Encode()
  32799. req, err := http.NewRequest("GET", urls, body)
  32800. if err != nil {
  32801. return nil, err
  32802. }
  32803. req.Header = reqHeaders
  32804. googleapi.Expand(req.URL, map[string]string{
  32805. "profileId": strconv.FormatInt(c.profileId, 10),
  32806. "id": strconv.FormatInt(c.id, 10),
  32807. })
  32808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32809. }
  32810. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  32811. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  32812. // non-2xx status code is an error. Response headers are in either
  32813. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  32814. // returned at all) in error.(*googleapi.Error).Header. Use
  32815. // googleapi.IsNotModified to check whether the returned error was
  32816. // because http.StatusNotModified was returned.
  32817. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  32818. gensupport.SetOptions(c.urlParams_, opts...)
  32819. res, err := c.doRequest("json")
  32820. if res != nil && res.StatusCode == http.StatusNotModified {
  32821. if res.Body != nil {
  32822. res.Body.Close()
  32823. }
  32824. return nil, &googleapi.Error{
  32825. Code: res.StatusCode,
  32826. Header: res.Header,
  32827. }
  32828. }
  32829. if err != nil {
  32830. return nil, err
  32831. }
  32832. defer googleapi.CloseBody(res)
  32833. if err := googleapi.CheckResponse(res); err != nil {
  32834. return nil, err
  32835. }
  32836. ret := &OperatingSystemVersion{
  32837. ServerResponse: googleapi.ServerResponse{
  32838. Header: res.Header,
  32839. HTTPStatusCode: res.StatusCode,
  32840. },
  32841. }
  32842. target := &ret
  32843. if err := gensupport.DecodeResponse(target, res); err != nil {
  32844. return nil, err
  32845. }
  32846. return ret, nil
  32847. // {
  32848. // "description": "Gets one operating system version by ID.",
  32849. // "httpMethod": "GET",
  32850. // "id": "dfareporting.operatingSystemVersions.get",
  32851. // "parameterOrder": [
  32852. // "profileId",
  32853. // "id"
  32854. // ],
  32855. // "parameters": {
  32856. // "id": {
  32857. // "description": "Operating system version ID.",
  32858. // "format": "int64",
  32859. // "location": "path",
  32860. // "required": true,
  32861. // "type": "string"
  32862. // },
  32863. // "profileId": {
  32864. // "description": "User profile ID associated with this request.",
  32865. // "format": "int64",
  32866. // "location": "path",
  32867. // "required": true,
  32868. // "type": "string"
  32869. // }
  32870. // },
  32871. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  32872. // "response": {
  32873. // "$ref": "OperatingSystemVersion"
  32874. // },
  32875. // "scopes": [
  32876. // "https://www.googleapis.com/auth/dfatrafficking"
  32877. // ]
  32878. // }
  32879. }
  32880. // method id "dfareporting.operatingSystemVersions.list":
  32881. type OperatingSystemVersionsListCall struct {
  32882. s *Service
  32883. profileId int64
  32884. urlParams_ gensupport.URLParams
  32885. ifNoneMatch_ string
  32886. ctx_ context.Context
  32887. header_ http.Header
  32888. }
  32889. // List: Retrieves a list of operating system versions.
  32890. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  32891. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32892. c.profileId = profileId
  32893. return c
  32894. }
  32895. // Fields allows partial responses to be retrieved. See
  32896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32897. // for more information.
  32898. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  32899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32900. return c
  32901. }
  32902. // IfNoneMatch sets the optional parameter which makes the operation
  32903. // fail if the object's ETag matches the given value. This is useful for
  32904. // getting updates only after the object has changed since the last
  32905. // request. Use googleapi.IsNotModified to check whether the response
  32906. // error from Do is the result of In-None-Match.
  32907. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  32908. c.ifNoneMatch_ = entityTag
  32909. return c
  32910. }
  32911. // Context sets the context to be used in this call's Do method. Any
  32912. // pending HTTP request will be aborted if the provided context is
  32913. // canceled.
  32914. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  32915. c.ctx_ = ctx
  32916. return c
  32917. }
  32918. // Header returns an http.Header that can be modified by the caller to
  32919. // add HTTP headers to the request.
  32920. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  32921. if c.header_ == nil {
  32922. c.header_ = make(http.Header)
  32923. }
  32924. return c.header_
  32925. }
  32926. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  32927. reqHeaders := make(http.Header)
  32928. for k, v := range c.header_ {
  32929. reqHeaders[k] = v
  32930. }
  32931. reqHeaders.Set("User-Agent", c.s.userAgent())
  32932. if c.ifNoneMatch_ != "" {
  32933. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32934. }
  32935. var body io.Reader = nil
  32936. c.urlParams_.Set("alt", alt)
  32937. c.urlParams_.Set("prettyPrint", "false")
  32938. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  32939. urls += "?" + c.urlParams_.Encode()
  32940. req, err := http.NewRequest("GET", urls, body)
  32941. if err != nil {
  32942. return nil, err
  32943. }
  32944. req.Header = reqHeaders
  32945. googleapi.Expand(req.URL, map[string]string{
  32946. "profileId": strconv.FormatInt(c.profileId, 10),
  32947. })
  32948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32949. }
  32950. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  32951. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  32952. // non-nil. Any non-2xx status code is an error. Response headers are in
  32953. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  32954. // (if a response was returned at all) in
  32955. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  32956. // whether the returned error was because http.StatusNotModified was
  32957. // returned.
  32958. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  32959. gensupport.SetOptions(c.urlParams_, opts...)
  32960. res, err := c.doRequest("json")
  32961. if res != nil && res.StatusCode == http.StatusNotModified {
  32962. if res.Body != nil {
  32963. res.Body.Close()
  32964. }
  32965. return nil, &googleapi.Error{
  32966. Code: res.StatusCode,
  32967. Header: res.Header,
  32968. }
  32969. }
  32970. if err != nil {
  32971. return nil, err
  32972. }
  32973. defer googleapi.CloseBody(res)
  32974. if err := googleapi.CheckResponse(res); err != nil {
  32975. return nil, err
  32976. }
  32977. ret := &OperatingSystemVersionsListResponse{
  32978. ServerResponse: googleapi.ServerResponse{
  32979. Header: res.Header,
  32980. HTTPStatusCode: res.StatusCode,
  32981. },
  32982. }
  32983. target := &ret
  32984. if err := gensupport.DecodeResponse(target, res); err != nil {
  32985. return nil, err
  32986. }
  32987. return ret, nil
  32988. // {
  32989. // "description": "Retrieves a list of operating system versions.",
  32990. // "httpMethod": "GET",
  32991. // "id": "dfareporting.operatingSystemVersions.list",
  32992. // "parameterOrder": [
  32993. // "profileId"
  32994. // ],
  32995. // "parameters": {
  32996. // "profileId": {
  32997. // "description": "User profile ID associated with this request.",
  32998. // "format": "int64",
  32999. // "location": "path",
  33000. // "required": true,
  33001. // "type": "string"
  33002. // }
  33003. // },
  33004. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  33005. // "response": {
  33006. // "$ref": "OperatingSystemVersionsListResponse"
  33007. // },
  33008. // "scopes": [
  33009. // "https://www.googleapis.com/auth/dfatrafficking"
  33010. // ]
  33011. // }
  33012. }
  33013. // method id "dfareporting.operatingSystems.get":
  33014. type OperatingSystemsGetCall struct {
  33015. s *Service
  33016. profileId int64
  33017. dartId int64
  33018. urlParams_ gensupport.URLParams
  33019. ifNoneMatch_ string
  33020. ctx_ context.Context
  33021. header_ http.Header
  33022. }
  33023. // Get: Gets one operating system by DART ID.
  33024. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  33025. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33026. c.profileId = profileId
  33027. c.dartId = dartId
  33028. return c
  33029. }
  33030. // Fields allows partial responses to be retrieved. See
  33031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33032. // for more information.
  33033. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  33034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33035. return c
  33036. }
  33037. // IfNoneMatch sets the optional parameter which makes the operation
  33038. // fail if the object's ETag matches the given value. This is useful for
  33039. // getting updates only after the object has changed since the last
  33040. // request. Use googleapi.IsNotModified to check whether the response
  33041. // error from Do is the result of In-None-Match.
  33042. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  33043. c.ifNoneMatch_ = entityTag
  33044. return c
  33045. }
  33046. // Context sets the context to be used in this call's Do method. Any
  33047. // pending HTTP request will be aborted if the provided context is
  33048. // canceled.
  33049. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  33050. c.ctx_ = ctx
  33051. return c
  33052. }
  33053. // Header returns an http.Header that can be modified by the caller to
  33054. // add HTTP headers to the request.
  33055. func (c *OperatingSystemsGetCall) Header() http.Header {
  33056. if c.header_ == nil {
  33057. c.header_ = make(http.Header)
  33058. }
  33059. return c.header_
  33060. }
  33061. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  33062. reqHeaders := make(http.Header)
  33063. for k, v := range c.header_ {
  33064. reqHeaders[k] = v
  33065. }
  33066. reqHeaders.Set("User-Agent", c.s.userAgent())
  33067. if c.ifNoneMatch_ != "" {
  33068. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33069. }
  33070. var body io.Reader = nil
  33071. c.urlParams_.Set("alt", alt)
  33072. c.urlParams_.Set("prettyPrint", "false")
  33073. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  33074. urls += "?" + c.urlParams_.Encode()
  33075. req, err := http.NewRequest("GET", urls, body)
  33076. if err != nil {
  33077. return nil, err
  33078. }
  33079. req.Header = reqHeaders
  33080. googleapi.Expand(req.URL, map[string]string{
  33081. "profileId": strconv.FormatInt(c.profileId, 10),
  33082. "dartId": strconv.FormatInt(c.dartId, 10),
  33083. })
  33084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33085. }
  33086. // Do executes the "dfareporting.operatingSystems.get" call.
  33087. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  33088. // status code is an error. Response headers are in either
  33089. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  33090. // at all) in error.(*googleapi.Error).Header. Use
  33091. // googleapi.IsNotModified to check whether the returned error was
  33092. // because http.StatusNotModified was returned.
  33093. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  33094. gensupport.SetOptions(c.urlParams_, opts...)
  33095. res, err := c.doRequest("json")
  33096. if res != nil && res.StatusCode == http.StatusNotModified {
  33097. if res.Body != nil {
  33098. res.Body.Close()
  33099. }
  33100. return nil, &googleapi.Error{
  33101. Code: res.StatusCode,
  33102. Header: res.Header,
  33103. }
  33104. }
  33105. if err != nil {
  33106. return nil, err
  33107. }
  33108. defer googleapi.CloseBody(res)
  33109. if err := googleapi.CheckResponse(res); err != nil {
  33110. return nil, err
  33111. }
  33112. ret := &OperatingSystem{
  33113. ServerResponse: googleapi.ServerResponse{
  33114. Header: res.Header,
  33115. HTTPStatusCode: res.StatusCode,
  33116. },
  33117. }
  33118. target := &ret
  33119. if err := gensupport.DecodeResponse(target, res); err != nil {
  33120. return nil, err
  33121. }
  33122. return ret, nil
  33123. // {
  33124. // "description": "Gets one operating system by DART ID.",
  33125. // "httpMethod": "GET",
  33126. // "id": "dfareporting.operatingSystems.get",
  33127. // "parameterOrder": [
  33128. // "profileId",
  33129. // "dartId"
  33130. // ],
  33131. // "parameters": {
  33132. // "dartId": {
  33133. // "description": "Operating system DART ID.",
  33134. // "format": "int64",
  33135. // "location": "path",
  33136. // "required": true,
  33137. // "type": "string"
  33138. // },
  33139. // "profileId": {
  33140. // "description": "User profile ID associated with this request.",
  33141. // "format": "int64",
  33142. // "location": "path",
  33143. // "required": true,
  33144. // "type": "string"
  33145. // }
  33146. // },
  33147. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  33148. // "response": {
  33149. // "$ref": "OperatingSystem"
  33150. // },
  33151. // "scopes": [
  33152. // "https://www.googleapis.com/auth/dfatrafficking"
  33153. // ]
  33154. // }
  33155. }
  33156. // method id "dfareporting.operatingSystems.list":
  33157. type OperatingSystemsListCall struct {
  33158. s *Service
  33159. profileId int64
  33160. urlParams_ gensupport.URLParams
  33161. ifNoneMatch_ string
  33162. ctx_ context.Context
  33163. header_ http.Header
  33164. }
  33165. // List: Retrieves a list of operating systems.
  33166. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  33167. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33168. c.profileId = profileId
  33169. return c
  33170. }
  33171. // Fields allows partial responses to be retrieved. See
  33172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33173. // for more information.
  33174. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  33175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33176. return c
  33177. }
  33178. // IfNoneMatch sets the optional parameter which makes the operation
  33179. // fail if the object's ETag matches the given value. This is useful for
  33180. // getting updates only after the object has changed since the last
  33181. // request. Use googleapi.IsNotModified to check whether the response
  33182. // error from Do is the result of In-None-Match.
  33183. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  33184. c.ifNoneMatch_ = entityTag
  33185. return c
  33186. }
  33187. // Context sets the context to be used in this call's Do method. Any
  33188. // pending HTTP request will be aborted if the provided context is
  33189. // canceled.
  33190. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  33191. c.ctx_ = ctx
  33192. return c
  33193. }
  33194. // Header returns an http.Header that can be modified by the caller to
  33195. // add HTTP headers to the request.
  33196. func (c *OperatingSystemsListCall) Header() http.Header {
  33197. if c.header_ == nil {
  33198. c.header_ = make(http.Header)
  33199. }
  33200. return c.header_
  33201. }
  33202. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  33203. reqHeaders := make(http.Header)
  33204. for k, v := range c.header_ {
  33205. reqHeaders[k] = v
  33206. }
  33207. reqHeaders.Set("User-Agent", c.s.userAgent())
  33208. if c.ifNoneMatch_ != "" {
  33209. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33210. }
  33211. var body io.Reader = nil
  33212. c.urlParams_.Set("alt", alt)
  33213. c.urlParams_.Set("prettyPrint", "false")
  33214. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  33215. urls += "?" + c.urlParams_.Encode()
  33216. req, err := http.NewRequest("GET", urls, body)
  33217. if err != nil {
  33218. return nil, err
  33219. }
  33220. req.Header = reqHeaders
  33221. googleapi.Expand(req.URL, map[string]string{
  33222. "profileId": strconv.FormatInt(c.profileId, 10),
  33223. })
  33224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33225. }
  33226. // Do executes the "dfareporting.operatingSystems.list" call.
  33227. // Exactly one of *OperatingSystemsListResponse or error will be
  33228. // non-nil. Any non-2xx status code is an error. Response headers are in
  33229. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  33230. // response was returned at all) in error.(*googleapi.Error).Header. Use
  33231. // googleapi.IsNotModified to check whether the returned error was
  33232. // because http.StatusNotModified was returned.
  33233. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  33234. gensupport.SetOptions(c.urlParams_, opts...)
  33235. res, err := c.doRequest("json")
  33236. if res != nil && res.StatusCode == http.StatusNotModified {
  33237. if res.Body != nil {
  33238. res.Body.Close()
  33239. }
  33240. return nil, &googleapi.Error{
  33241. Code: res.StatusCode,
  33242. Header: res.Header,
  33243. }
  33244. }
  33245. if err != nil {
  33246. return nil, err
  33247. }
  33248. defer googleapi.CloseBody(res)
  33249. if err := googleapi.CheckResponse(res); err != nil {
  33250. return nil, err
  33251. }
  33252. ret := &OperatingSystemsListResponse{
  33253. ServerResponse: googleapi.ServerResponse{
  33254. Header: res.Header,
  33255. HTTPStatusCode: res.StatusCode,
  33256. },
  33257. }
  33258. target := &ret
  33259. if err := gensupport.DecodeResponse(target, res); err != nil {
  33260. return nil, err
  33261. }
  33262. return ret, nil
  33263. // {
  33264. // "description": "Retrieves a list of operating systems.",
  33265. // "httpMethod": "GET",
  33266. // "id": "dfareporting.operatingSystems.list",
  33267. // "parameterOrder": [
  33268. // "profileId"
  33269. // ],
  33270. // "parameters": {
  33271. // "profileId": {
  33272. // "description": "User profile ID associated with this request.",
  33273. // "format": "int64",
  33274. // "location": "path",
  33275. // "required": true,
  33276. // "type": "string"
  33277. // }
  33278. // },
  33279. // "path": "userprofiles/{profileId}/operatingSystems",
  33280. // "response": {
  33281. // "$ref": "OperatingSystemsListResponse"
  33282. // },
  33283. // "scopes": [
  33284. // "https://www.googleapis.com/auth/dfatrafficking"
  33285. // ]
  33286. // }
  33287. }
  33288. // method id "dfareporting.orderDocuments.get":
  33289. type OrderDocumentsGetCall struct {
  33290. s *Service
  33291. profileId int64
  33292. projectId int64
  33293. id int64
  33294. urlParams_ gensupport.URLParams
  33295. ifNoneMatch_ string
  33296. ctx_ context.Context
  33297. header_ http.Header
  33298. }
  33299. // Get: Gets one order document by ID.
  33300. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  33301. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33302. c.profileId = profileId
  33303. c.projectId = projectId
  33304. c.id = id
  33305. return c
  33306. }
  33307. // Fields allows partial responses to be retrieved. See
  33308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33309. // for more information.
  33310. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  33311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33312. return c
  33313. }
  33314. // IfNoneMatch sets the optional parameter which makes the operation
  33315. // fail if the object's ETag matches the given value. This is useful for
  33316. // getting updates only after the object has changed since the last
  33317. // request. Use googleapi.IsNotModified to check whether the response
  33318. // error from Do is the result of In-None-Match.
  33319. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  33320. c.ifNoneMatch_ = entityTag
  33321. return c
  33322. }
  33323. // Context sets the context to be used in this call's Do method. Any
  33324. // pending HTTP request will be aborted if the provided context is
  33325. // canceled.
  33326. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  33327. c.ctx_ = ctx
  33328. return c
  33329. }
  33330. // Header returns an http.Header that can be modified by the caller to
  33331. // add HTTP headers to the request.
  33332. func (c *OrderDocumentsGetCall) Header() http.Header {
  33333. if c.header_ == nil {
  33334. c.header_ = make(http.Header)
  33335. }
  33336. return c.header_
  33337. }
  33338. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  33339. reqHeaders := make(http.Header)
  33340. for k, v := range c.header_ {
  33341. reqHeaders[k] = v
  33342. }
  33343. reqHeaders.Set("User-Agent", c.s.userAgent())
  33344. if c.ifNoneMatch_ != "" {
  33345. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33346. }
  33347. var body io.Reader = nil
  33348. c.urlParams_.Set("alt", alt)
  33349. c.urlParams_.Set("prettyPrint", "false")
  33350. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  33351. urls += "?" + c.urlParams_.Encode()
  33352. req, err := http.NewRequest("GET", urls, body)
  33353. if err != nil {
  33354. return nil, err
  33355. }
  33356. req.Header = reqHeaders
  33357. googleapi.Expand(req.URL, map[string]string{
  33358. "profileId": strconv.FormatInt(c.profileId, 10),
  33359. "projectId": strconv.FormatInt(c.projectId, 10),
  33360. "id": strconv.FormatInt(c.id, 10),
  33361. })
  33362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33363. }
  33364. // Do executes the "dfareporting.orderDocuments.get" call.
  33365. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  33366. // status code is an error. Response headers are in either
  33367. // *OrderDocument.ServerResponse.Header or (if a response was returned
  33368. // at all) in error.(*googleapi.Error).Header. Use
  33369. // googleapi.IsNotModified to check whether the returned error was
  33370. // because http.StatusNotModified was returned.
  33371. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  33372. gensupport.SetOptions(c.urlParams_, opts...)
  33373. res, err := c.doRequest("json")
  33374. if res != nil && res.StatusCode == http.StatusNotModified {
  33375. if res.Body != nil {
  33376. res.Body.Close()
  33377. }
  33378. return nil, &googleapi.Error{
  33379. Code: res.StatusCode,
  33380. Header: res.Header,
  33381. }
  33382. }
  33383. if err != nil {
  33384. return nil, err
  33385. }
  33386. defer googleapi.CloseBody(res)
  33387. if err := googleapi.CheckResponse(res); err != nil {
  33388. return nil, err
  33389. }
  33390. ret := &OrderDocument{
  33391. ServerResponse: googleapi.ServerResponse{
  33392. Header: res.Header,
  33393. HTTPStatusCode: res.StatusCode,
  33394. },
  33395. }
  33396. target := &ret
  33397. if err := gensupport.DecodeResponse(target, res); err != nil {
  33398. return nil, err
  33399. }
  33400. return ret, nil
  33401. // {
  33402. // "description": "Gets one order document by ID.",
  33403. // "httpMethod": "GET",
  33404. // "id": "dfareporting.orderDocuments.get",
  33405. // "parameterOrder": [
  33406. // "profileId",
  33407. // "projectId",
  33408. // "id"
  33409. // ],
  33410. // "parameters": {
  33411. // "id": {
  33412. // "description": "Order document ID.",
  33413. // "format": "int64",
  33414. // "location": "path",
  33415. // "required": true,
  33416. // "type": "string"
  33417. // },
  33418. // "profileId": {
  33419. // "description": "User profile ID associated with this request.",
  33420. // "format": "int64",
  33421. // "location": "path",
  33422. // "required": true,
  33423. // "type": "string"
  33424. // },
  33425. // "projectId": {
  33426. // "description": "Project ID for order documents.",
  33427. // "format": "int64",
  33428. // "location": "path",
  33429. // "required": true,
  33430. // "type": "string"
  33431. // }
  33432. // },
  33433. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  33434. // "response": {
  33435. // "$ref": "OrderDocument"
  33436. // },
  33437. // "scopes": [
  33438. // "https://www.googleapis.com/auth/dfatrafficking"
  33439. // ]
  33440. // }
  33441. }
  33442. // method id "dfareporting.orderDocuments.list":
  33443. type OrderDocumentsListCall struct {
  33444. s *Service
  33445. profileId int64
  33446. projectId int64
  33447. urlParams_ gensupport.URLParams
  33448. ifNoneMatch_ string
  33449. ctx_ context.Context
  33450. header_ http.Header
  33451. }
  33452. // List: Retrieves a list of order documents, possibly filtered. This
  33453. // method supports paging.
  33454. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  33455. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33456. c.profileId = profileId
  33457. c.projectId = projectId
  33458. return c
  33459. }
  33460. // Approved sets the optional parameter "approved": Select only order
  33461. // documents that have been approved by at least one user.
  33462. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  33463. c.urlParams_.Set("approved", fmt.Sprint(approved))
  33464. return c
  33465. }
  33466. // Ids sets the optional parameter "ids": Select only order documents
  33467. // with these IDs.
  33468. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  33469. var ids_ []string
  33470. for _, v := range ids {
  33471. ids_ = append(ids_, fmt.Sprint(v))
  33472. }
  33473. c.urlParams_.SetMulti("ids", ids_)
  33474. return c
  33475. }
  33476. // MaxResults sets the optional parameter "maxResults": Maximum number
  33477. // of results to return.
  33478. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  33479. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33480. return c
  33481. }
  33482. // OrderId sets the optional parameter "orderId": Select only order
  33483. // documents for specified orders.
  33484. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  33485. var orderId_ []string
  33486. for _, v := range orderId {
  33487. orderId_ = append(orderId_, fmt.Sprint(v))
  33488. }
  33489. c.urlParams_.SetMulti("orderId", orderId_)
  33490. return c
  33491. }
  33492. // PageToken sets the optional parameter "pageToken": Value of the
  33493. // nextPageToken from the previous result page.
  33494. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  33495. c.urlParams_.Set("pageToken", pageToken)
  33496. return c
  33497. }
  33498. // SearchString sets the optional parameter "searchString": Allows
  33499. // searching for order documents by name or ID. Wildcards (*) are
  33500. // allowed. For example, "orderdocument*2015" will return order
  33501. // documents with names like "orderdocument June 2015", "orderdocument
  33502. // April 2015", or simply "orderdocument 2015". Most of the searches
  33503. // also add wildcards implicitly at the start and the end of the search
  33504. // string. For example, a search string of "orderdocument" will match
  33505. // order documents with name "my orderdocument", "orderdocument 2015",
  33506. // or simply "orderdocument".
  33507. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  33508. c.urlParams_.Set("searchString", searchString)
  33509. return c
  33510. }
  33511. // SiteId sets the optional parameter "siteId": Select only order
  33512. // documents that are associated with these sites.
  33513. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  33514. var siteId_ []string
  33515. for _, v := range siteId {
  33516. siteId_ = append(siteId_, fmt.Sprint(v))
  33517. }
  33518. c.urlParams_.SetMulti("siteId", siteId_)
  33519. return c
  33520. }
  33521. // SortField sets the optional parameter "sortField": Field by which to
  33522. // sort the list.
  33523. //
  33524. // Possible values:
  33525. // "ID" (default)
  33526. // "NAME"
  33527. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  33528. c.urlParams_.Set("sortField", sortField)
  33529. return c
  33530. }
  33531. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33532. // results.
  33533. //
  33534. // Possible values:
  33535. // "ASCENDING" (default)
  33536. // "DESCENDING"
  33537. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  33538. c.urlParams_.Set("sortOrder", sortOrder)
  33539. return c
  33540. }
  33541. // Fields allows partial responses to be retrieved. See
  33542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33543. // for more information.
  33544. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  33545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33546. return c
  33547. }
  33548. // IfNoneMatch sets the optional parameter which makes the operation
  33549. // fail if the object's ETag matches the given value. This is useful for
  33550. // getting updates only after the object has changed since the last
  33551. // request. Use googleapi.IsNotModified to check whether the response
  33552. // error from Do is the result of In-None-Match.
  33553. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  33554. c.ifNoneMatch_ = entityTag
  33555. return c
  33556. }
  33557. // Context sets the context to be used in this call's Do method. Any
  33558. // pending HTTP request will be aborted if the provided context is
  33559. // canceled.
  33560. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  33561. c.ctx_ = ctx
  33562. return c
  33563. }
  33564. // Header returns an http.Header that can be modified by the caller to
  33565. // add HTTP headers to the request.
  33566. func (c *OrderDocumentsListCall) Header() http.Header {
  33567. if c.header_ == nil {
  33568. c.header_ = make(http.Header)
  33569. }
  33570. return c.header_
  33571. }
  33572. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  33573. reqHeaders := make(http.Header)
  33574. for k, v := range c.header_ {
  33575. reqHeaders[k] = v
  33576. }
  33577. reqHeaders.Set("User-Agent", c.s.userAgent())
  33578. if c.ifNoneMatch_ != "" {
  33579. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33580. }
  33581. var body io.Reader = nil
  33582. c.urlParams_.Set("alt", alt)
  33583. c.urlParams_.Set("prettyPrint", "false")
  33584. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  33585. urls += "?" + c.urlParams_.Encode()
  33586. req, err := http.NewRequest("GET", urls, body)
  33587. if err != nil {
  33588. return nil, err
  33589. }
  33590. req.Header = reqHeaders
  33591. googleapi.Expand(req.URL, map[string]string{
  33592. "profileId": strconv.FormatInt(c.profileId, 10),
  33593. "projectId": strconv.FormatInt(c.projectId, 10),
  33594. })
  33595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33596. }
  33597. // Do executes the "dfareporting.orderDocuments.list" call.
  33598. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  33599. // Any non-2xx status code is an error. Response headers are in either
  33600. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  33601. // was returned at all) in error.(*googleapi.Error).Header. Use
  33602. // googleapi.IsNotModified to check whether the returned error was
  33603. // because http.StatusNotModified was returned.
  33604. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  33605. gensupport.SetOptions(c.urlParams_, opts...)
  33606. res, err := c.doRequest("json")
  33607. if res != nil && res.StatusCode == http.StatusNotModified {
  33608. if res.Body != nil {
  33609. res.Body.Close()
  33610. }
  33611. return nil, &googleapi.Error{
  33612. Code: res.StatusCode,
  33613. Header: res.Header,
  33614. }
  33615. }
  33616. if err != nil {
  33617. return nil, err
  33618. }
  33619. defer googleapi.CloseBody(res)
  33620. if err := googleapi.CheckResponse(res); err != nil {
  33621. return nil, err
  33622. }
  33623. ret := &OrderDocumentsListResponse{
  33624. ServerResponse: googleapi.ServerResponse{
  33625. Header: res.Header,
  33626. HTTPStatusCode: res.StatusCode,
  33627. },
  33628. }
  33629. target := &ret
  33630. if err := gensupport.DecodeResponse(target, res); err != nil {
  33631. return nil, err
  33632. }
  33633. return ret, nil
  33634. // {
  33635. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  33636. // "httpMethod": "GET",
  33637. // "id": "dfareporting.orderDocuments.list",
  33638. // "parameterOrder": [
  33639. // "profileId",
  33640. // "projectId"
  33641. // ],
  33642. // "parameters": {
  33643. // "approved": {
  33644. // "description": "Select only order documents that have been approved by at least one user.",
  33645. // "location": "query",
  33646. // "type": "boolean"
  33647. // },
  33648. // "ids": {
  33649. // "description": "Select only order documents with these IDs.",
  33650. // "format": "int64",
  33651. // "location": "query",
  33652. // "repeated": true,
  33653. // "type": "string"
  33654. // },
  33655. // "maxResults": {
  33656. // "default": "1000",
  33657. // "description": "Maximum number of results to return.",
  33658. // "format": "int32",
  33659. // "location": "query",
  33660. // "maximum": "1000",
  33661. // "minimum": "0",
  33662. // "type": "integer"
  33663. // },
  33664. // "orderId": {
  33665. // "description": "Select only order documents for specified orders.",
  33666. // "format": "int64",
  33667. // "location": "query",
  33668. // "repeated": true,
  33669. // "type": "string"
  33670. // },
  33671. // "pageToken": {
  33672. // "description": "Value of the nextPageToken from the previous result page.",
  33673. // "location": "query",
  33674. // "type": "string"
  33675. // },
  33676. // "profileId": {
  33677. // "description": "User profile ID associated with this request.",
  33678. // "format": "int64",
  33679. // "location": "path",
  33680. // "required": true,
  33681. // "type": "string"
  33682. // },
  33683. // "projectId": {
  33684. // "description": "Project ID for order documents.",
  33685. // "format": "int64",
  33686. // "location": "path",
  33687. // "required": true,
  33688. // "type": "string"
  33689. // },
  33690. // "searchString": {
  33691. // "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\".",
  33692. // "location": "query",
  33693. // "type": "string"
  33694. // },
  33695. // "siteId": {
  33696. // "description": "Select only order documents that are associated with these sites.",
  33697. // "format": "int64",
  33698. // "location": "query",
  33699. // "repeated": true,
  33700. // "type": "string"
  33701. // },
  33702. // "sortField": {
  33703. // "default": "ID",
  33704. // "description": "Field by which to sort the list.",
  33705. // "enum": [
  33706. // "ID",
  33707. // "NAME"
  33708. // ],
  33709. // "enumDescriptions": [
  33710. // "",
  33711. // ""
  33712. // ],
  33713. // "location": "query",
  33714. // "type": "string"
  33715. // },
  33716. // "sortOrder": {
  33717. // "default": "ASCENDING",
  33718. // "description": "Order of sorted results.",
  33719. // "enum": [
  33720. // "ASCENDING",
  33721. // "DESCENDING"
  33722. // ],
  33723. // "enumDescriptions": [
  33724. // "",
  33725. // ""
  33726. // ],
  33727. // "location": "query",
  33728. // "type": "string"
  33729. // }
  33730. // },
  33731. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  33732. // "response": {
  33733. // "$ref": "OrderDocumentsListResponse"
  33734. // },
  33735. // "scopes": [
  33736. // "https://www.googleapis.com/auth/dfatrafficking"
  33737. // ]
  33738. // }
  33739. }
  33740. // Pages invokes f for each page of results.
  33741. // A non-nil error returned from f will halt the iteration.
  33742. // The provided context supersedes any context provided to the Context method.
  33743. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  33744. c.ctx_ = ctx
  33745. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33746. for {
  33747. x, err := c.Do()
  33748. if err != nil {
  33749. return err
  33750. }
  33751. if err := f(x); err != nil {
  33752. return err
  33753. }
  33754. if x.NextPageToken == "" {
  33755. return nil
  33756. }
  33757. c.PageToken(x.NextPageToken)
  33758. }
  33759. }
  33760. // method id "dfareporting.orders.get":
  33761. type OrdersGetCall struct {
  33762. s *Service
  33763. profileId int64
  33764. projectId int64
  33765. id int64
  33766. urlParams_ gensupport.URLParams
  33767. ifNoneMatch_ string
  33768. ctx_ context.Context
  33769. header_ http.Header
  33770. }
  33771. // Get: Gets one order by ID.
  33772. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  33773. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33774. c.profileId = profileId
  33775. c.projectId = projectId
  33776. c.id = id
  33777. return c
  33778. }
  33779. // Fields allows partial responses to be retrieved. See
  33780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33781. // for more information.
  33782. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  33783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33784. return c
  33785. }
  33786. // IfNoneMatch sets the optional parameter which makes the operation
  33787. // fail if the object's ETag matches the given value. This is useful for
  33788. // getting updates only after the object has changed since the last
  33789. // request. Use googleapi.IsNotModified to check whether the response
  33790. // error from Do is the result of In-None-Match.
  33791. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  33792. c.ifNoneMatch_ = entityTag
  33793. return c
  33794. }
  33795. // Context sets the context to be used in this call's Do method. Any
  33796. // pending HTTP request will be aborted if the provided context is
  33797. // canceled.
  33798. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  33799. c.ctx_ = ctx
  33800. return c
  33801. }
  33802. // Header returns an http.Header that can be modified by the caller to
  33803. // add HTTP headers to the request.
  33804. func (c *OrdersGetCall) Header() http.Header {
  33805. if c.header_ == nil {
  33806. c.header_ = make(http.Header)
  33807. }
  33808. return c.header_
  33809. }
  33810. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  33811. reqHeaders := make(http.Header)
  33812. for k, v := range c.header_ {
  33813. reqHeaders[k] = v
  33814. }
  33815. reqHeaders.Set("User-Agent", c.s.userAgent())
  33816. if c.ifNoneMatch_ != "" {
  33817. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33818. }
  33819. var body io.Reader = nil
  33820. c.urlParams_.Set("alt", alt)
  33821. c.urlParams_.Set("prettyPrint", "false")
  33822. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  33823. urls += "?" + c.urlParams_.Encode()
  33824. req, err := http.NewRequest("GET", urls, body)
  33825. if err != nil {
  33826. return nil, err
  33827. }
  33828. req.Header = reqHeaders
  33829. googleapi.Expand(req.URL, map[string]string{
  33830. "profileId": strconv.FormatInt(c.profileId, 10),
  33831. "projectId": strconv.FormatInt(c.projectId, 10),
  33832. "id": strconv.FormatInt(c.id, 10),
  33833. })
  33834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33835. }
  33836. // Do executes the "dfareporting.orders.get" call.
  33837. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  33838. // code is an error. Response headers are in either
  33839. // *Order.ServerResponse.Header or (if a response was returned at all)
  33840. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33841. // check whether the returned error was because http.StatusNotModified
  33842. // was returned.
  33843. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  33844. gensupport.SetOptions(c.urlParams_, opts...)
  33845. res, err := c.doRequest("json")
  33846. if res != nil && res.StatusCode == http.StatusNotModified {
  33847. if res.Body != nil {
  33848. res.Body.Close()
  33849. }
  33850. return nil, &googleapi.Error{
  33851. Code: res.StatusCode,
  33852. Header: res.Header,
  33853. }
  33854. }
  33855. if err != nil {
  33856. return nil, err
  33857. }
  33858. defer googleapi.CloseBody(res)
  33859. if err := googleapi.CheckResponse(res); err != nil {
  33860. return nil, err
  33861. }
  33862. ret := &Order{
  33863. ServerResponse: googleapi.ServerResponse{
  33864. Header: res.Header,
  33865. HTTPStatusCode: res.StatusCode,
  33866. },
  33867. }
  33868. target := &ret
  33869. if err := gensupport.DecodeResponse(target, res); err != nil {
  33870. return nil, err
  33871. }
  33872. return ret, nil
  33873. // {
  33874. // "description": "Gets one order by ID.",
  33875. // "httpMethod": "GET",
  33876. // "id": "dfareporting.orders.get",
  33877. // "parameterOrder": [
  33878. // "profileId",
  33879. // "projectId",
  33880. // "id"
  33881. // ],
  33882. // "parameters": {
  33883. // "id": {
  33884. // "description": "Order ID.",
  33885. // "format": "int64",
  33886. // "location": "path",
  33887. // "required": true,
  33888. // "type": "string"
  33889. // },
  33890. // "profileId": {
  33891. // "description": "User profile ID associated with this request.",
  33892. // "format": "int64",
  33893. // "location": "path",
  33894. // "required": true,
  33895. // "type": "string"
  33896. // },
  33897. // "projectId": {
  33898. // "description": "Project ID for orders.",
  33899. // "format": "int64",
  33900. // "location": "path",
  33901. // "required": true,
  33902. // "type": "string"
  33903. // }
  33904. // },
  33905. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  33906. // "response": {
  33907. // "$ref": "Order"
  33908. // },
  33909. // "scopes": [
  33910. // "https://www.googleapis.com/auth/dfatrafficking"
  33911. // ]
  33912. // }
  33913. }
  33914. // method id "dfareporting.orders.list":
  33915. type OrdersListCall struct {
  33916. s *Service
  33917. profileId int64
  33918. projectId int64
  33919. urlParams_ gensupport.URLParams
  33920. ifNoneMatch_ string
  33921. ctx_ context.Context
  33922. header_ http.Header
  33923. }
  33924. // List: Retrieves a list of orders, possibly filtered. This method
  33925. // supports paging.
  33926. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  33927. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33928. c.profileId = profileId
  33929. c.projectId = projectId
  33930. return c
  33931. }
  33932. // Ids sets the optional parameter "ids": Select only orders with these
  33933. // IDs.
  33934. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  33935. var ids_ []string
  33936. for _, v := range ids {
  33937. ids_ = append(ids_, fmt.Sprint(v))
  33938. }
  33939. c.urlParams_.SetMulti("ids", ids_)
  33940. return c
  33941. }
  33942. // MaxResults sets the optional parameter "maxResults": Maximum number
  33943. // of results to return.
  33944. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  33945. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33946. return c
  33947. }
  33948. // PageToken sets the optional parameter "pageToken": Value of the
  33949. // nextPageToken from the previous result page.
  33950. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  33951. c.urlParams_.Set("pageToken", pageToken)
  33952. return c
  33953. }
  33954. // SearchString sets the optional parameter "searchString": Allows
  33955. // searching for orders by name or ID. Wildcards (*) are allowed. For
  33956. // example, "order*2015" will return orders with names like "order June
  33957. // 2015", "order April 2015", or simply "order 2015". Most of the
  33958. // searches also add wildcards implicitly at the start and the end of
  33959. // the search string. For example, a search string of "order" will match
  33960. // orders with name "my order", "order 2015", or simply "order".
  33961. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  33962. c.urlParams_.Set("searchString", searchString)
  33963. return c
  33964. }
  33965. // SiteId sets the optional parameter "siteId": Select only orders that
  33966. // are associated with these site IDs.
  33967. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  33968. var siteId_ []string
  33969. for _, v := range siteId {
  33970. siteId_ = append(siteId_, fmt.Sprint(v))
  33971. }
  33972. c.urlParams_.SetMulti("siteId", siteId_)
  33973. return c
  33974. }
  33975. // SortField sets the optional parameter "sortField": Field by which to
  33976. // sort the list.
  33977. //
  33978. // Possible values:
  33979. // "ID" (default)
  33980. // "NAME"
  33981. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  33982. c.urlParams_.Set("sortField", sortField)
  33983. return c
  33984. }
  33985. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33986. // results.
  33987. //
  33988. // Possible values:
  33989. // "ASCENDING" (default)
  33990. // "DESCENDING"
  33991. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  33992. c.urlParams_.Set("sortOrder", sortOrder)
  33993. return c
  33994. }
  33995. // Fields allows partial responses to be retrieved. See
  33996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33997. // for more information.
  33998. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  33999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34000. return c
  34001. }
  34002. // IfNoneMatch sets the optional parameter which makes the operation
  34003. // fail if the object's ETag matches the given value. This is useful for
  34004. // getting updates only after the object has changed since the last
  34005. // request. Use googleapi.IsNotModified to check whether the response
  34006. // error from Do is the result of In-None-Match.
  34007. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  34008. c.ifNoneMatch_ = entityTag
  34009. return c
  34010. }
  34011. // Context sets the context to be used in this call's Do method. Any
  34012. // pending HTTP request will be aborted if the provided context is
  34013. // canceled.
  34014. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  34015. c.ctx_ = ctx
  34016. return c
  34017. }
  34018. // Header returns an http.Header that can be modified by the caller to
  34019. // add HTTP headers to the request.
  34020. func (c *OrdersListCall) Header() http.Header {
  34021. if c.header_ == nil {
  34022. c.header_ = make(http.Header)
  34023. }
  34024. return c.header_
  34025. }
  34026. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  34027. reqHeaders := make(http.Header)
  34028. for k, v := range c.header_ {
  34029. reqHeaders[k] = v
  34030. }
  34031. reqHeaders.Set("User-Agent", c.s.userAgent())
  34032. if c.ifNoneMatch_ != "" {
  34033. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34034. }
  34035. var body io.Reader = nil
  34036. c.urlParams_.Set("alt", alt)
  34037. c.urlParams_.Set("prettyPrint", "false")
  34038. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  34039. urls += "?" + c.urlParams_.Encode()
  34040. req, err := http.NewRequest("GET", urls, body)
  34041. if err != nil {
  34042. return nil, err
  34043. }
  34044. req.Header = reqHeaders
  34045. googleapi.Expand(req.URL, map[string]string{
  34046. "profileId": strconv.FormatInt(c.profileId, 10),
  34047. "projectId": strconv.FormatInt(c.projectId, 10),
  34048. })
  34049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34050. }
  34051. // Do executes the "dfareporting.orders.list" call.
  34052. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  34053. // non-2xx status code is an error. Response headers are in either
  34054. // *OrdersListResponse.ServerResponse.Header or (if a response was
  34055. // returned at all) in error.(*googleapi.Error).Header. Use
  34056. // googleapi.IsNotModified to check whether the returned error was
  34057. // because http.StatusNotModified was returned.
  34058. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  34059. gensupport.SetOptions(c.urlParams_, opts...)
  34060. res, err := c.doRequest("json")
  34061. if res != nil && res.StatusCode == http.StatusNotModified {
  34062. if res.Body != nil {
  34063. res.Body.Close()
  34064. }
  34065. return nil, &googleapi.Error{
  34066. Code: res.StatusCode,
  34067. Header: res.Header,
  34068. }
  34069. }
  34070. if err != nil {
  34071. return nil, err
  34072. }
  34073. defer googleapi.CloseBody(res)
  34074. if err := googleapi.CheckResponse(res); err != nil {
  34075. return nil, err
  34076. }
  34077. ret := &OrdersListResponse{
  34078. ServerResponse: googleapi.ServerResponse{
  34079. Header: res.Header,
  34080. HTTPStatusCode: res.StatusCode,
  34081. },
  34082. }
  34083. target := &ret
  34084. if err := gensupport.DecodeResponse(target, res); err != nil {
  34085. return nil, err
  34086. }
  34087. return ret, nil
  34088. // {
  34089. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  34090. // "httpMethod": "GET",
  34091. // "id": "dfareporting.orders.list",
  34092. // "parameterOrder": [
  34093. // "profileId",
  34094. // "projectId"
  34095. // ],
  34096. // "parameters": {
  34097. // "ids": {
  34098. // "description": "Select only orders with these IDs.",
  34099. // "format": "int64",
  34100. // "location": "query",
  34101. // "repeated": true,
  34102. // "type": "string"
  34103. // },
  34104. // "maxResults": {
  34105. // "default": "1000",
  34106. // "description": "Maximum number of results to return.",
  34107. // "format": "int32",
  34108. // "location": "query",
  34109. // "maximum": "1000",
  34110. // "minimum": "0",
  34111. // "type": "integer"
  34112. // },
  34113. // "pageToken": {
  34114. // "description": "Value of the nextPageToken from the previous result page.",
  34115. // "location": "query",
  34116. // "type": "string"
  34117. // },
  34118. // "profileId": {
  34119. // "description": "User profile ID associated with this request.",
  34120. // "format": "int64",
  34121. // "location": "path",
  34122. // "required": true,
  34123. // "type": "string"
  34124. // },
  34125. // "projectId": {
  34126. // "description": "Project ID for orders.",
  34127. // "format": "int64",
  34128. // "location": "path",
  34129. // "required": true,
  34130. // "type": "string"
  34131. // },
  34132. // "searchString": {
  34133. // "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\".",
  34134. // "location": "query",
  34135. // "type": "string"
  34136. // },
  34137. // "siteId": {
  34138. // "description": "Select only orders that are associated with these site IDs.",
  34139. // "format": "int64",
  34140. // "location": "query",
  34141. // "repeated": true,
  34142. // "type": "string"
  34143. // },
  34144. // "sortField": {
  34145. // "default": "ID",
  34146. // "description": "Field by which to sort the list.",
  34147. // "enum": [
  34148. // "ID",
  34149. // "NAME"
  34150. // ],
  34151. // "enumDescriptions": [
  34152. // "",
  34153. // ""
  34154. // ],
  34155. // "location": "query",
  34156. // "type": "string"
  34157. // },
  34158. // "sortOrder": {
  34159. // "default": "ASCENDING",
  34160. // "description": "Order of sorted results.",
  34161. // "enum": [
  34162. // "ASCENDING",
  34163. // "DESCENDING"
  34164. // ],
  34165. // "enumDescriptions": [
  34166. // "",
  34167. // ""
  34168. // ],
  34169. // "location": "query",
  34170. // "type": "string"
  34171. // }
  34172. // },
  34173. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  34174. // "response": {
  34175. // "$ref": "OrdersListResponse"
  34176. // },
  34177. // "scopes": [
  34178. // "https://www.googleapis.com/auth/dfatrafficking"
  34179. // ]
  34180. // }
  34181. }
  34182. // Pages invokes f for each page of results.
  34183. // A non-nil error returned from f will halt the iteration.
  34184. // The provided context supersedes any context provided to the Context method.
  34185. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  34186. c.ctx_ = ctx
  34187. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34188. for {
  34189. x, err := c.Do()
  34190. if err != nil {
  34191. return err
  34192. }
  34193. if err := f(x); err != nil {
  34194. return err
  34195. }
  34196. if x.NextPageToken == "" {
  34197. return nil
  34198. }
  34199. c.PageToken(x.NextPageToken)
  34200. }
  34201. }
  34202. // method id "dfareporting.placementGroups.get":
  34203. type PlacementGroupsGetCall struct {
  34204. s *Service
  34205. profileId int64
  34206. id int64
  34207. urlParams_ gensupport.URLParams
  34208. ifNoneMatch_ string
  34209. ctx_ context.Context
  34210. header_ http.Header
  34211. }
  34212. // Get: Gets one placement group by ID.
  34213. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  34214. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34215. c.profileId = profileId
  34216. c.id = id
  34217. return c
  34218. }
  34219. // Fields allows partial responses to be retrieved. See
  34220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34221. // for more information.
  34222. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  34223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34224. return c
  34225. }
  34226. // IfNoneMatch sets the optional parameter which makes the operation
  34227. // fail if the object's ETag matches the given value. This is useful for
  34228. // getting updates only after the object has changed since the last
  34229. // request. Use googleapi.IsNotModified to check whether the response
  34230. // error from Do is the result of In-None-Match.
  34231. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  34232. c.ifNoneMatch_ = entityTag
  34233. return c
  34234. }
  34235. // Context sets the context to be used in this call's Do method. Any
  34236. // pending HTTP request will be aborted if the provided context is
  34237. // canceled.
  34238. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  34239. c.ctx_ = ctx
  34240. return c
  34241. }
  34242. // Header returns an http.Header that can be modified by the caller to
  34243. // add HTTP headers to the request.
  34244. func (c *PlacementGroupsGetCall) Header() http.Header {
  34245. if c.header_ == nil {
  34246. c.header_ = make(http.Header)
  34247. }
  34248. return c.header_
  34249. }
  34250. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  34251. reqHeaders := make(http.Header)
  34252. for k, v := range c.header_ {
  34253. reqHeaders[k] = v
  34254. }
  34255. reqHeaders.Set("User-Agent", c.s.userAgent())
  34256. if c.ifNoneMatch_ != "" {
  34257. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34258. }
  34259. var body io.Reader = nil
  34260. c.urlParams_.Set("alt", alt)
  34261. c.urlParams_.Set("prettyPrint", "false")
  34262. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  34263. urls += "?" + c.urlParams_.Encode()
  34264. req, err := http.NewRequest("GET", urls, body)
  34265. if err != nil {
  34266. return nil, err
  34267. }
  34268. req.Header = reqHeaders
  34269. googleapi.Expand(req.URL, map[string]string{
  34270. "profileId": strconv.FormatInt(c.profileId, 10),
  34271. "id": strconv.FormatInt(c.id, 10),
  34272. })
  34273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34274. }
  34275. // Do executes the "dfareporting.placementGroups.get" call.
  34276. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34277. // status code is an error. Response headers are in either
  34278. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34279. // at all) in error.(*googleapi.Error).Header. Use
  34280. // googleapi.IsNotModified to check whether the returned error was
  34281. // because http.StatusNotModified was returned.
  34282. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34283. gensupport.SetOptions(c.urlParams_, opts...)
  34284. res, err := c.doRequest("json")
  34285. if res != nil && res.StatusCode == http.StatusNotModified {
  34286. if res.Body != nil {
  34287. res.Body.Close()
  34288. }
  34289. return nil, &googleapi.Error{
  34290. Code: res.StatusCode,
  34291. Header: res.Header,
  34292. }
  34293. }
  34294. if err != nil {
  34295. return nil, err
  34296. }
  34297. defer googleapi.CloseBody(res)
  34298. if err := googleapi.CheckResponse(res); err != nil {
  34299. return nil, err
  34300. }
  34301. ret := &PlacementGroup{
  34302. ServerResponse: googleapi.ServerResponse{
  34303. Header: res.Header,
  34304. HTTPStatusCode: res.StatusCode,
  34305. },
  34306. }
  34307. target := &ret
  34308. if err := gensupport.DecodeResponse(target, res); err != nil {
  34309. return nil, err
  34310. }
  34311. return ret, nil
  34312. // {
  34313. // "description": "Gets one placement group by ID.",
  34314. // "httpMethod": "GET",
  34315. // "id": "dfareporting.placementGroups.get",
  34316. // "parameterOrder": [
  34317. // "profileId",
  34318. // "id"
  34319. // ],
  34320. // "parameters": {
  34321. // "id": {
  34322. // "description": "Placement group ID.",
  34323. // "format": "int64",
  34324. // "location": "path",
  34325. // "required": true,
  34326. // "type": "string"
  34327. // },
  34328. // "profileId": {
  34329. // "description": "User profile ID associated with this request.",
  34330. // "format": "int64",
  34331. // "location": "path",
  34332. // "required": true,
  34333. // "type": "string"
  34334. // }
  34335. // },
  34336. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  34337. // "response": {
  34338. // "$ref": "PlacementGroup"
  34339. // },
  34340. // "scopes": [
  34341. // "https://www.googleapis.com/auth/dfatrafficking"
  34342. // ]
  34343. // }
  34344. }
  34345. // method id "dfareporting.placementGroups.insert":
  34346. type PlacementGroupsInsertCall struct {
  34347. s *Service
  34348. profileId int64
  34349. placementgroup *PlacementGroup
  34350. urlParams_ gensupport.URLParams
  34351. ctx_ context.Context
  34352. header_ http.Header
  34353. }
  34354. // Insert: Inserts a new placement group.
  34355. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  34356. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34357. c.profileId = profileId
  34358. c.placementgroup = placementgroup
  34359. return c
  34360. }
  34361. // Fields allows partial responses to be retrieved. See
  34362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34363. // for more information.
  34364. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  34365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34366. return c
  34367. }
  34368. // Context sets the context to be used in this call's Do method. Any
  34369. // pending HTTP request will be aborted if the provided context is
  34370. // canceled.
  34371. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  34372. c.ctx_ = ctx
  34373. return c
  34374. }
  34375. // Header returns an http.Header that can be modified by the caller to
  34376. // add HTTP headers to the request.
  34377. func (c *PlacementGroupsInsertCall) Header() http.Header {
  34378. if c.header_ == nil {
  34379. c.header_ = make(http.Header)
  34380. }
  34381. return c.header_
  34382. }
  34383. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  34384. reqHeaders := make(http.Header)
  34385. for k, v := range c.header_ {
  34386. reqHeaders[k] = v
  34387. }
  34388. reqHeaders.Set("User-Agent", c.s.userAgent())
  34389. var body io.Reader = nil
  34390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34391. if err != nil {
  34392. return nil, err
  34393. }
  34394. reqHeaders.Set("Content-Type", "application/json")
  34395. c.urlParams_.Set("alt", alt)
  34396. c.urlParams_.Set("prettyPrint", "false")
  34397. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34398. urls += "?" + c.urlParams_.Encode()
  34399. req, err := http.NewRequest("POST", urls, body)
  34400. if err != nil {
  34401. return nil, err
  34402. }
  34403. req.Header = reqHeaders
  34404. googleapi.Expand(req.URL, map[string]string{
  34405. "profileId": strconv.FormatInt(c.profileId, 10),
  34406. })
  34407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34408. }
  34409. // Do executes the "dfareporting.placementGroups.insert" call.
  34410. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34411. // status code is an error. Response headers are in either
  34412. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34413. // at all) in error.(*googleapi.Error).Header. Use
  34414. // googleapi.IsNotModified to check whether the returned error was
  34415. // because http.StatusNotModified was returned.
  34416. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34417. gensupport.SetOptions(c.urlParams_, opts...)
  34418. res, err := c.doRequest("json")
  34419. if res != nil && res.StatusCode == http.StatusNotModified {
  34420. if res.Body != nil {
  34421. res.Body.Close()
  34422. }
  34423. return nil, &googleapi.Error{
  34424. Code: res.StatusCode,
  34425. Header: res.Header,
  34426. }
  34427. }
  34428. if err != nil {
  34429. return nil, err
  34430. }
  34431. defer googleapi.CloseBody(res)
  34432. if err := googleapi.CheckResponse(res); err != nil {
  34433. return nil, err
  34434. }
  34435. ret := &PlacementGroup{
  34436. ServerResponse: googleapi.ServerResponse{
  34437. Header: res.Header,
  34438. HTTPStatusCode: res.StatusCode,
  34439. },
  34440. }
  34441. target := &ret
  34442. if err := gensupport.DecodeResponse(target, res); err != nil {
  34443. return nil, err
  34444. }
  34445. return ret, nil
  34446. // {
  34447. // "description": "Inserts a new placement group.",
  34448. // "httpMethod": "POST",
  34449. // "id": "dfareporting.placementGroups.insert",
  34450. // "parameterOrder": [
  34451. // "profileId"
  34452. // ],
  34453. // "parameters": {
  34454. // "profileId": {
  34455. // "description": "User profile ID associated with this request.",
  34456. // "format": "int64",
  34457. // "location": "path",
  34458. // "required": true,
  34459. // "type": "string"
  34460. // }
  34461. // },
  34462. // "path": "userprofiles/{profileId}/placementGroups",
  34463. // "request": {
  34464. // "$ref": "PlacementGroup"
  34465. // },
  34466. // "response": {
  34467. // "$ref": "PlacementGroup"
  34468. // },
  34469. // "scopes": [
  34470. // "https://www.googleapis.com/auth/dfatrafficking"
  34471. // ]
  34472. // }
  34473. }
  34474. // method id "dfareporting.placementGroups.list":
  34475. type PlacementGroupsListCall struct {
  34476. s *Service
  34477. profileId int64
  34478. urlParams_ gensupport.URLParams
  34479. ifNoneMatch_ string
  34480. ctx_ context.Context
  34481. header_ http.Header
  34482. }
  34483. // List: Retrieves a list of placement groups, possibly filtered. This
  34484. // method supports paging.
  34485. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  34486. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34487. c.profileId = profileId
  34488. return c
  34489. }
  34490. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  34491. // only placement groups that belong to these advertisers.
  34492. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  34493. var advertiserIds_ []string
  34494. for _, v := range advertiserIds {
  34495. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  34496. }
  34497. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  34498. return c
  34499. }
  34500. // Archived sets the optional parameter "archived": Select only archived
  34501. // placements. Don't set this field to select both archived and
  34502. // non-archived placements.
  34503. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  34504. c.urlParams_.Set("archived", fmt.Sprint(archived))
  34505. return c
  34506. }
  34507. // CampaignIds sets the optional parameter "campaignIds": Select only
  34508. // placement groups that belong to these campaigns.
  34509. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  34510. var campaignIds_ []string
  34511. for _, v := range campaignIds {
  34512. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  34513. }
  34514. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  34515. return c
  34516. }
  34517. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  34518. // Select only placement groups that are associated with these content
  34519. // categories.
  34520. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  34521. var contentCategoryIds_ []string
  34522. for _, v := range contentCategoryIds {
  34523. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  34524. }
  34525. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  34526. return c
  34527. }
  34528. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  34529. // Select only placement groups that are associated with these directory
  34530. // sites.
  34531. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  34532. var directorySiteIds_ []string
  34533. for _, v := range directorySiteIds {
  34534. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  34535. }
  34536. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  34537. return c
  34538. }
  34539. // Ids sets the optional parameter "ids": Select only placement groups
  34540. // with these IDs.
  34541. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  34542. var ids_ []string
  34543. for _, v := range ids {
  34544. ids_ = append(ids_, fmt.Sprint(v))
  34545. }
  34546. c.urlParams_.SetMulti("ids", ids_)
  34547. return c
  34548. }
  34549. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  34550. // placements or placement groups whose end date is on or before the
  34551. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  34552. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  34553. c.urlParams_.Set("maxEndDate", maxEndDate)
  34554. return c
  34555. }
  34556. // MaxResults sets the optional parameter "maxResults": Maximum number
  34557. // of results to return.
  34558. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  34559. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34560. return c
  34561. }
  34562. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  34563. // placements or placement groups whose start date is on or before the
  34564. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  34565. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  34566. c.urlParams_.Set("maxStartDate", maxStartDate)
  34567. return c
  34568. }
  34569. // MinEndDate sets the optional parameter "minEndDate": Select only
  34570. // placements or placement groups whose end date is on or after the
  34571. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  34572. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  34573. c.urlParams_.Set("minEndDate", minEndDate)
  34574. return c
  34575. }
  34576. // MinStartDate sets the optional parameter "minStartDate": Select only
  34577. // placements or placement groups whose start date is on or after the
  34578. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  34579. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  34580. c.urlParams_.Set("minStartDate", minStartDate)
  34581. return c
  34582. }
  34583. // PageToken sets the optional parameter "pageToken": Value of the
  34584. // nextPageToken from the previous result page.
  34585. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  34586. c.urlParams_.Set("pageToken", pageToken)
  34587. return c
  34588. }
  34589. // PlacementGroupType sets the optional parameter "placementGroupType":
  34590. // Select only placement groups belonging with this group type. A
  34591. // package is a simple group of placements that acts as a single pricing
  34592. // point for a group of tags. A roadblock is a group of placements that
  34593. // not only acts as a single pricing point but also assumes that all the
  34594. // tags in it will be served at the same time. A roadblock requires one
  34595. // of its assigned placements to be marked as primary for reporting.
  34596. //
  34597. // Possible values:
  34598. // "PLACEMENT_PACKAGE"
  34599. // "PLACEMENT_ROADBLOCK"
  34600. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  34601. c.urlParams_.Set("placementGroupType", placementGroupType)
  34602. return c
  34603. }
  34604. // PlacementStrategyIds sets the optional parameter
  34605. // "placementStrategyIds": Select only placement groups that are
  34606. // associated with these placement strategies.
  34607. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  34608. var placementStrategyIds_ []string
  34609. for _, v := range placementStrategyIds {
  34610. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  34611. }
  34612. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  34613. return c
  34614. }
  34615. // PricingTypes sets the optional parameter "pricingTypes": Select only
  34616. // placement groups with these pricing types.
  34617. //
  34618. // Possible values:
  34619. // "PRICING_TYPE_CPA"
  34620. // "PRICING_TYPE_CPC"
  34621. // "PRICING_TYPE_CPM"
  34622. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  34623. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  34624. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34625. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  34626. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  34627. return c
  34628. }
  34629. // SearchString sets the optional parameter "searchString": Allows
  34630. // searching for placement groups by name or ID. Wildcards (*) are
  34631. // allowed. For example, "placement*2015" will return placement groups
  34632. // with names like "placement group June 2015", "placement group May
  34633. // 2015", or simply "placements 2015". Most of the searches also add
  34634. // wildcards implicitly at the start and the end of the search string.
  34635. // For example, a search string of "placementgroup" will match placement
  34636. // groups with name "my placementgroup", "placementgroup 2015", or
  34637. // simply "placementgroup".
  34638. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  34639. c.urlParams_.Set("searchString", searchString)
  34640. return c
  34641. }
  34642. // SiteIds sets the optional parameter "siteIds": Select only placement
  34643. // groups that are associated with these sites.
  34644. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  34645. var siteIds_ []string
  34646. for _, v := range siteIds {
  34647. siteIds_ = append(siteIds_, fmt.Sprint(v))
  34648. }
  34649. c.urlParams_.SetMulti("siteIds", siteIds_)
  34650. return c
  34651. }
  34652. // SortField sets the optional parameter "sortField": Field by which to
  34653. // sort the list.
  34654. //
  34655. // Possible values:
  34656. // "ID" (default)
  34657. // "NAME"
  34658. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  34659. c.urlParams_.Set("sortField", sortField)
  34660. return c
  34661. }
  34662. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34663. // results.
  34664. //
  34665. // Possible values:
  34666. // "ASCENDING" (default)
  34667. // "DESCENDING"
  34668. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  34669. c.urlParams_.Set("sortOrder", sortOrder)
  34670. return c
  34671. }
  34672. // Fields allows partial responses to be retrieved. See
  34673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34674. // for more information.
  34675. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  34676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34677. return c
  34678. }
  34679. // IfNoneMatch sets the optional parameter which makes the operation
  34680. // fail if the object's ETag matches the given value. This is useful for
  34681. // getting updates only after the object has changed since the last
  34682. // request. Use googleapi.IsNotModified to check whether the response
  34683. // error from Do is the result of In-None-Match.
  34684. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  34685. c.ifNoneMatch_ = entityTag
  34686. return c
  34687. }
  34688. // Context sets the context to be used in this call's Do method. Any
  34689. // pending HTTP request will be aborted if the provided context is
  34690. // canceled.
  34691. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  34692. c.ctx_ = ctx
  34693. return c
  34694. }
  34695. // Header returns an http.Header that can be modified by the caller to
  34696. // add HTTP headers to the request.
  34697. func (c *PlacementGroupsListCall) Header() http.Header {
  34698. if c.header_ == nil {
  34699. c.header_ = make(http.Header)
  34700. }
  34701. return c.header_
  34702. }
  34703. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  34704. reqHeaders := make(http.Header)
  34705. for k, v := range c.header_ {
  34706. reqHeaders[k] = v
  34707. }
  34708. reqHeaders.Set("User-Agent", c.s.userAgent())
  34709. if c.ifNoneMatch_ != "" {
  34710. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34711. }
  34712. var body io.Reader = nil
  34713. c.urlParams_.Set("alt", alt)
  34714. c.urlParams_.Set("prettyPrint", "false")
  34715. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34716. urls += "?" + c.urlParams_.Encode()
  34717. req, err := http.NewRequest("GET", urls, body)
  34718. if err != nil {
  34719. return nil, err
  34720. }
  34721. req.Header = reqHeaders
  34722. googleapi.Expand(req.URL, map[string]string{
  34723. "profileId": strconv.FormatInt(c.profileId, 10),
  34724. })
  34725. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34726. }
  34727. // Do executes the "dfareporting.placementGroups.list" call.
  34728. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  34729. // Any non-2xx status code is an error. Response headers are in either
  34730. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  34731. // was returned at all) in error.(*googleapi.Error).Header. Use
  34732. // googleapi.IsNotModified to check whether the returned error was
  34733. // because http.StatusNotModified was returned.
  34734. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  34735. gensupport.SetOptions(c.urlParams_, opts...)
  34736. res, err := c.doRequest("json")
  34737. if res != nil && res.StatusCode == http.StatusNotModified {
  34738. if res.Body != nil {
  34739. res.Body.Close()
  34740. }
  34741. return nil, &googleapi.Error{
  34742. Code: res.StatusCode,
  34743. Header: res.Header,
  34744. }
  34745. }
  34746. if err != nil {
  34747. return nil, err
  34748. }
  34749. defer googleapi.CloseBody(res)
  34750. if err := googleapi.CheckResponse(res); err != nil {
  34751. return nil, err
  34752. }
  34753. ret := &PlacementGroupsListResponse{
  34754. ServerResponse: googleapi.ServerResponse{
  34755. Header: res.Header,
  34756. HTTPStatusCode: res.StatusCode,
  34757. },
  34758. }
  34759. target := &ret
  34760. if err := gensupport.DecodeResponse(target, res); err != nil {
  34761. return nil, err
  34762. }
  34763. return ret, nil
  34764. // {
  34765. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  34766. // "httpMethod": "GET",
  34767. // "id": "dfareporting.placementGroups.list",
  34768. // "parameterOrder": [
  34769. // "profileId"
  34770. // ],
  34771. // "parameters": {
  34772. // "advertiserIds": {
  34773. // "description": "Select only placement groups that belong to these advertisers.",
  34774. // "format": "int64",
  34775. // "location": "query",
  34776. // "repeated": true,
  34777. // "type": "string"
  34778. // },
  34779. // "archived": {
  34780. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  34781. // "location": "query",
  34782. // "type": "boolean"
  34783. // },
  34784. // "campaignIds": {
  34785. // "description": "Select only placement groups that belong to these campaigns.",
  34786. // "format": "int64",
  34787. // "location": "query",
  34788. // "repeated": true,
  34789. // "type": "string"
  34790. // },
  34791. // "contentCategoryIds": {
  34792. // "description": "Select only placement groups that are associated with these content categories.",
  34793. // "format": "int64",
  34794. // "location": "query",
  34795. // "repeated": true,
  34796. // "type": "string"
  34797. // },
  34798. // "directorySiteIds": {
  34799. // "description": "Select only placement groups that are associated with these directory sites.",
  34800. // "format": "int64",
  34801. // "location": "query",
  34802. // "repeated": true,
  34803. // "type": "string"
  34804. // },
  34805. // "ids": {
  34806. // "description": "Select only placement groups with these IDs.",
  34807. // "format": "int64",
  34808. // "location": "query",
  34809. // "repeated": true,
  34810. // "type": "string"
  34811. // },
  34812. // "maxEndDate": {
  34813. // "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\".",
  34814. // "location": "query",
  34815. // "type": "string"
  34816. // },
  34817. // "maxResults": {
  34818. // "default": "800",
  34819. // "description": "Maximum number of results to return.",
  34820. // "format": "int32",
  34821. // "location": "query",
  34822. // "maximum": "800",
  34823. // "minimum": "0",
  34824. // "type": "integer"
  34825. // },
  34826. // "maxStartDate": {
  34827. // "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\".",
  34828. // "location": "query",
  34829. // "type": "string"
  34830. // },
  34831. // "minEndDate": {
  34832. // "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\".",
  34833. // "location": "query",
  34834. // "type": "string"
  34835. // },
  34836. // "minStartDate": {
  34837. // "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\".",
  34838. // "location": "query",
  34839. // "type": "string"
  34840. // },
  34841. // "pageToken": {
  34842. // "description": "Value of the nextPageToken from the previous result page.",
  34843. // "location": "query",
  34844. // "type": "string"
  34845. // },
  34846. // "placementGroupType": {
  34847. // "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.",
  34848. // "enum": [
  34849. // "PLACEMENT_PACKAGE",
  34850. // "PLACEMENT_ROADBLOCK"
  34851. // ],
  34852. // "enumDescriptions": [
  34853. // "",
  34854. // ""
  34855. // ],
  34856. // "location": "query",
  34857. // "type": "string"
  34858. // },
  34859. // "placementStrategyIds": {
  34860. // "description": "Select only placement groups that are associated with these placement strategies.",
  34861. // "format": "int64",
  34862. // "location": "query",
  34863. // "repeated": true,
  34864. // "type": "string"
  34865. // },
  34866. // "pricingTypes": {
  34867. // "description": "Select only placement groups with these pricing types.",
  34868. // "enum": [
  34869. // "PRICING_TYPE_CPA",
  34870. // "PRICING_TYPE_CPC",
  34871. // "PRICING_TYPE_CPM",
  34872. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  34873. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  34874. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34875. // ],
  34876. // "enumDescriptions": [
  34877. // "",
  34878. // "",
  34879. // "",
  34880. // "",
  34881. // "",
  34882. // ""
  34883. // ],
  34884. // "location": "query",
  34885. // "repeated": true,
  34886. // "type": "string"
  34887. // },
  34888. // "profileId": {
  34889. // "description": "User profile ID associated with this request.",
  34890. // "format": "int64",
  34891. // "location": "path",
  34892. // "required": true,
  34893. // "type": "string"
  34894. // },
  34895. // "searchString": {
  34896. // "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\".",
  34897. // "location": "query",
  34898. // "type": "string"
  34899. // },
  34900. // "siteIds": {
  34901. // "description": "Select only placement groups that are associated with these sites.",
  34902. // "format": "int64",
  34903. // "location": "query",
  34904. // "repeated": true,
  34905. // "type": "string"
  34906. // },
  34907. // "sortField": {
  34908. // "default": "ID",
  34909. // "description": "Field by which to sort the list.",
  34910. // "enum": [
  34911. // "ID",
  34912. // "NAME"
  34913. // ],
  34914. // "enumDescriptions": [
  34915. // "",
  34916. // ""
  34917. // ],
  34918. // "location": "query",
  34919. // "type": "string"
  34920. // },
  34921. // "sortOrder": {
  34922. // "default": "ASCENDING",
  34923. // "description": "Order of sorted results.",
  34924. // "enum": [
  34925. // "ASCENDING",
  34926. // "DESCENDING"
  34927. // ],
  34928. // "enumDescriptions": [
  34929. // "",
  34930. // ""
  34931. // ],
  34932. // "location": "query",
  34933. // "type": "string"
  34934. // }
  34935. // },
  34936. // "path": "userprofiles/{profileId}/placementGroups",
  34937. // "response": {
  34938. // "$ref": "PlacementGroupsListResponse"
  34939. // },
  34940. // "scopes": [
  34941. // "https://www.googleapis.com/auth/dfatrafficking"
  34942. // ]
  34943. // }
  34944. }
  34945. // Pages invokes f for each page of results.
  34946. // A non-nil error returned from f will halt the iteration.
  34947. // The provided context supersedes any context provided to the Context method.
  34948. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  34949. c.ctx_ = ctx
  34950. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34951. for {
  34952. x, err := c.Do()
  34953. if err != nil {
  34954. return err
  34955. }
  34956. if err := f(x); err != nil {
  34957. return err
  34958. }
  34959. if x.NextPageToken == "" {
  34960. return nil
  34961. }
  34962. c.PageToken(x.NextPageToken)
  34963. }
  34964. }
  34965. // method id "dfareporting.placementGroups.patch":
  34966. type PlacementGroupsPatchCall struct {
  34967. s *Service
  34968. profileId int64
  34969. placementgroup *PlacementGroup
  34970. urlParams_ gensupport.URLParams
  34971. ctx_ context.Context
  34972. header_ http.Header
  34973. }
  34974. // Patch: Updates an existing placement group. This method supports
  34975. // patch semantics.
  34976. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  34977. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34978. c.profileId = profileId
  34979. c.urlParams_.Set("id", fmt.Sprint(id))
  34980. c.placementgroup = placementgroup
  34981. return c
  34982. }
  34983. // Fields allows partial responses to be retrieved. See
  34984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34985. // for more information.
  34986. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  34987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34988. return c
  34989. }
  34990. // Context sets the context to be used in this call's Do method. Any
  34991. // pending HTTP request will be aborted if the provided context is
  34992. // canceled.
  34993. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  34994. c.ctx_ = ctx
  34995. return c
  34996. }
  34997. // Header returns an http.Header that can be modified by the caller to
  34998. // add HTTP headers to the request.
  34999. func (c *PlacementGroupsPatchCall) Header() http.Header {
  35000. if c.header_ == nil {
  35001. c.header_ = make(http.Header)
  35002. }
  35003. return c.header_
  35004. }
  35005. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  35006. reqHeaders := make(http.Header)
  35007. for k, v := range c.header_ {
  35008. reqHeaders[k] = v
  35009. }
  35010. reqHeaders.Set("User-Agent", c.s.userAgent())
  35011. var body io.Reader = nil
  35012. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  35013. if err != nil {
  35014. return nil, err
  35015. }
  35016. reqHeaders.Set("Content-Type", "application/json")
  35017. c.urlParams_.Set("alt", alt)
  35018. c.urlParams_.Set("prettyPrint", "false")
  35019. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  35020. urls += "?" + c.urlParams_.Encode()
  35021. req, err := http.NewRequest("PATCH", urls, body)
  35022. if err != nil {
  35023. return nil, err
  35024. }
  35025. req.Header = reqHeaders
  35026. googleapi.Expand(req.URL, map[string]string{
  35027. "profileId": strconv.FormatInt(c.profileId, 10),
  35028. })
  35029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35030. }
  35031. // Do executes the "dfareporting.placementGroups.patch" call.
  35032. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  35033. // status code is an error. Response headers are in either
  35034. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  35035. // at all) in error.(*googleapi.Error).Header. Use
  35036. // googleapi.IsNotModified to check whether the returned error was
  35037. // because http.StatusNotModified was returned.
  35038. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  35039. gensupport.SetOptions(c.urlParams_, opts...)
  35040. res, err := c.doRequest("json")
  35041. if res != nil && res.StatusCode == http.StatusNotModified {
  35042. if res.Body != nil {
  35043. res.Body.Close()
  35044. }
  35045. return nil, &googleapi.Error{
  35046. Code: res.StatusCode,
  35047. Header: res.Header,
  35048. }
  35049. }
  35050. if err != nil {
  35051. return nil, err
  35052. }
  35053. defer googleapi.CloseBody(res)
  35054. if err := googleapi.CheckResponse(res); err != nil {
  35055. return nil, err
  35056. }
  35057. ret := &PlacementGroup{
  35058. ServerResponse: googleapi.ServerResponse{
  35059. Header: res.Header,
  35060. HTTPStatusCode: res.StatusCode,
  35061. },
  35062. }
  35063. target := &ret
  35064. if err := gensupport.DecodeResponse(target, res); err != nil {
  35065. return nil, err
  35066. }
  35067. return ret, nil
  35068. // {
  35069. // "description": "Updates an existing placement group. This method supports patch semantics.",
  35070. // "httpMethod": "PATCH",
  35071. // "id": "dfareporting.placementGroups.patch",
  35072. // "parameterOrder": [
  35073. // "profileId",
  35074. // "id"
  35075. // ],
  35076. // "parameters": {
  35077. // "id": {
  35078. // "description": "Placement group ID.",
  35079. // "format": "int64",
  35080. // "location": "query",
  35081. // "required": true,
  35082. // "type": "string"
  35083. // },
  35084. // "profileId": {
  35085. // "description": "User profile ID associated with this request.",
  35086. // "format": "int64",
  35087. // "location": "path",
  35088. // "required": true,
  35089. // "type": "string"
  35090. // }
  35091. // },
  35092. // "path": "userprofiles/{profileId}/placementGroups",
  35093. // "request": {
  35094. // "$ref": "PlacementGroup"
  35095. // },
  35096. // "response": {
  35097. // "$ref": "PlacementGroup"
  35098. // },
  35099. // "scopes": [
  35100. // "https://www.googleapis.com/auth/dfatrafficking"
  35101. // ]
  35102. // }
  35103. }
  35104. // method id "dfareporting.placementGroups.update":
  35105. type PlacementGroupsUpdateCall struct {
  35106. s *Service
  35107. profileId int64
  35108. placementgroup *PlacementGroup
  35109. urlParams_ gensupport.URLParams
  35110. ctx_ context.Context
  35111. header_ http.Header
  35112. }
  35113. // Update: Updates an existing placement group.
  35114. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  35115. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35116. c.profileId = profileId
  35117. c.placementgroup = placementgroup
  35118. return c
  35119. }
  35120. // Fields allows partial responses to be retrieved. See
  35121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35122. // for more information.
  35123. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  35124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35125. return c
  35126. }
  35127. // Context sets the context to be used in this call's Do method. Any
  35128. // pending HTTP request will be aborted if the provided context is
  35129. // canceled.
  35130. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  35131. c.ctx_ = ctx
  35132. return c
  35133. }
  35134. // Header returns an http.Header that can be modified by the caller to
  35135. // add HTTP headers to the request.
  35136. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  35137. if c.header_ == nil {
  35138. c.header_ = make(http.Header)
  35139. }
  35140. return c.header_
  35141. }
  35142. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35143. reqHeaders := make(http.Header)
  35144. for k, v := range c.header_ {
  35145. reqHeaders[k] = v
  35146. }
  35147. reqHeaders.Set("User-Agent", c.s.userAgent())
  35148. var body io.Reader = nil
  35149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  35150. if err != nil {
  35151. return nil, err
  35152. }
  35153. reqHeaders.Set("Content-Type", "application/json")
  35154. c.urlParams_.Set("alt", alt)
  35155. c.urlParams_.Set("prettyPrint", "false")
  35156. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  35157. urls += "?" + c.urlParams_.Encode()
  35158. req, err := http.NewRequest("PUT", urls, body)
  35159. if err != nil {
  35160. return nil, err
  35161. }
  35162. req.Header = reqHeaders
  35163. googleapi.Expand(req.URL, map[string]string{
  35164. "profileId": strconv.FormatInt(c.profileId, 10),
  35165. })
  35166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35167. }
  35168. // Do executes the "dfareporting.placementGroups.update" call.
  35169. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  35170. // status code is an error. Response headers are in either
  35171. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  35172. // at all) in error.(*googleapi.Error).Header. Use
  35173. // googleapi.IsNotModified to check whether the returned error was
  35174. // because http.StatusNotModified was returned.
  35175. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  35176. gensupport.SetOptions(c.urlParams_, opts...)
  35177. res, err := c.doRequest("json")
  35178. if res != nil && res.StatusCode == http.StatusNotModified {
  35179. if res.Body != nil {
  35180. res.Body.Close()
  35181. }
  35182. return nil, &googleapi.Error{
  35183. Code: res.StatusCode,
  35184. Header: res.Header,
  35185. }
  35186. }
  35187. if err != nil {
  35188. return nil, err
  35189. }
  35190. defer googleapi.CloseBody(res)
  35191. if err := googleapi.CheckResponse(res); err != nil {
  35192. return nil, err
  35193. }
  35194. ret := &PlacementGroup{
  35195. ServerResponse: googleapi.ServerResponse{
  35196. Header: res.Header,
  35197. HTTPStatusCode: res.StatusCode,
  35198. },
  35199. }
  35200. target := &ret
  35201. if err := gensupport.DecodeResponse(target, res); err != nil {
  35202. return nil, err
  35203. }
  35204. return ret, nil
  35205. // {
  35206. // "description": "Updates an existing placement group.",
  35207. // "httpMethod": "PUT",
  35208. // "id": "dfareporting.placementGroups.update",
  35209. // "parameterOrder": [
  35210. // "profileId"
  35211. // ],
  35212. // "parameters": {
  35213. // "profileId": {
  35214. // "description": "User profile ID associated with this request.",
  35215. // "format": "int64",
  35216. // "location": "path",
  35217. // "required": true,
  35218. // "type": "string"
  35219. // }
  35220. // },
  35221. // "path": "userprofiles/{profileId}/placementGroups",
  35222. // "request": {
  35223. // "$ref": "PlacementGroup"
  35224. // },
  35225. // "response": {
  35226. // "$ref": "PlacementGroup"
  35227. // },
  35228. // "scopes": [
  35229. // "https://www.googleapis.com/auth/dfatrafficking"
  35230. // ]
  35231. // }
  35232. }
  35233. // method id "dfareporting.placementStrategies.delete":
  35234. type PlacementStrategiesDeleteCall struct {
  35235. s *Service
  35236. profileId int64
  35237. id int64
  35238. urlParams_ gensupport.URLParams
  35239. ctx_ context.Context
  35240. header_ http.Header
  35241. }
  35242. // Delete: Deletes an existing placement strategy.
  35243. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  35244. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35245. c.profileId = profileId
  35246. c.id = id
  35247. return c
  35248. }
  35249. // Fields allows partial responses to be retrieved. See
  35250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35251. // for more information.
  35252. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  35253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35254. return c
  35255. }
  35256. // Context sets the context to be used in this call's Do method. Any
  35257. // pending HTTP request will be aborted if the provided context is
  35258. // canceled.
  35259. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  35260. c.ctx_ = ctx
  35261. return c
  35262. }
  35263. // Header returns an http.Header that can be modified by the caller to
  35264. // add HTTP headers to the request.
  35265. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  35266. if c.header_ == nil {
  35267. c.header_ = make(http.Header)
  35268. }
  35269. return c.header_
  35270. }
  35271. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  35272. reqHeaders := make(http.Header)
  35273. for k, v := range c.header_ {
  35274. reqHeaders[k] = v
  35275. }
  35276. reqHeaders.Set("User-Agent", c.s.userAgent())
  35277. var body io.Reader = nil
  35278. c.urlParams_.Set("alt", alt)
  35279. c.urlParams_.Set("prettyPrint", "false")
  35280. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  35281. urls += "?" + c.urlParams_.Encode()
  35282. req, err := http.NewRequest("DELETE", urls, body)
  35283. if err != nil {
  35284. return nil, err
  35285. }
  35286. req.Header = reqHeaders
  35287. googleapi.Expand(req.URL, map[string]string{
  35288. "profileId": strconv.FormatInt(c.profileId, 10),
  35289. "id": strconv.FormatInt(c.id, 10),
  35290. })
  35291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35292. }
  35293. // Do executes the "dfareporting.placementStrategies.delete" call.
  35294. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  35295. gensupport.SetOptions(c.urlParams_, opts...)
  35296. res, err := c.doRequest("json")
  35297. if err != nil {
  35298. return err
  35299. }
  35300. defer googleapi.CloseBody(res)
  35301. if err := googleapi.CheckResponse(res); err != nil {
  35302. return err
  35303. }
  35304. return nil
  35305. // {
  35306. // "description": "Deletes an existing placement strategy.",
  35307. // "httpMethod": "DELETE",
  35308. // "id": "dfareporting.placementStrategies.delete",
  35309. // "parameterOrder": [
  35310. // "profileId",
  35311. // "id"
  35312. // ],
  35313. // "parameters": {
  35314. // "id": {
  35315. // "description": "Placement strategy ID.",
  35316. // "format": "int64",
  35317. // "location": "path",
  35318. // "required": true,
  35319. // "type": "string"
  35320. // },
  35321. // "profileId": {
  35322. // "description": "User profile ID associated with this request.",
  35323. // "format": "int64",
  35324. // "location": "path",
  35325. // "required": true,
  35326. // "type": "string"
  35327. // }
  35328. // },
  35329. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  35330. // "scopes": [
  35331. // "https://www.googleapis.com/auth/dfatrafficking"
  35332. // ]
  35333. // }
  35334. }
  35335. // method id "dfareporting.placementStrategies.get":
  35336. type PlacementStrategiesGetCall struct {
  35337. s *Service
  35338. profileId int64
  35339. id int64
  35340. urlParams_ gensupport.URLParams
  35341. ifNoneMatch_ string
  35342. ctx_ context.Context
  35343. header_ http.Header
  35344. }
  35345. // Get: Gets one placement strategy by ID.
  35346. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  35347. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35348. c.profileId = profileId
  35349. c.id = id
  35350. return c
  35351. }
  35352. // Fields allows partial responses to be retrieved. See
  35353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35354. // for more information.
  35355. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  35356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35357. return c
  35358. }
  35359. // IfNoneMatch sets the optional parameter which makes the operation
  35360. // fail if the object's ETag matches the given value. This is useful for
  35361. // getting updates only after the object has changed since the last
  35362. // request. Use googleapi.IsNotModified to check whether the response
  35363. // error from Do is the result of In-None-Match.
  35364. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  35365. c.ifNoneMatch_ = entityTag
  35366. return c
  35367. }
  35368. // Context sets the context to be used in this call's Do method. Any
  35369. // pending HTTP request will be aborted if the provided context is
  35370. // canceled.
  35371. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  35372. c.ctx_ = ctx
  35373. return c
  35374. }
  35375. // Header returns an http.Header that can be modified by the caller to
  35376. // add HTTP headers to the request.
  35377. func (c *PlacementStrategiesGetCall) Header() http.Header {
  35378. if c.header_ == nil {
  35379. c.header_ = make(http.Header)
  35380. }
  35381. return c.header_
  35382. }
  35383. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  35384. reqHeaders := make(http.Header)
  35385. for k, v := range c.header_ {
  35386. reqHeaders[k] = v
  35387. }
  35388. reqHeaders.Set("User-Agent", c.s.userAgent())
  35389. if c.ifNoneMatch_ != "" {
  35390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35391. }
  35392. var body io.Reader = nil
  35393. c.urlParams_.Set("alt", alt)
  35394. c.urlParams_.Set("prettyPrint", "false")
  35395. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  35396. urls += "?" + c.urlParams_.Encode()
  35397. req, err := http.NewRequest("GET", urls, body)
  35398. if err != nil {
  35399. return nil, err
  35400. }
  35401. req.Header = reqHeaders
  35402. googleapi.Expand(req.URL, map[string]string{
  35403. "profileId": strconv.FormatInt(c.profileId, 10),
  35404. "id": strconv.FormatInt(c.id, 10),
  35405. })
  35406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35407. }
  35408. // Do executes the "dfareporting.placementStrategies.get" call.
  35409. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35410. // non-2xx status code is an error. Response headers are in either
  35411. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35412. // returned at all) in error.(*googleapi.Error).Header. Use
  35413. // googleapi.IsNotModified to check whether the returned error was
  35414. // because http.StatusNotModified was returned.
  35415. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35416. gensupport.SetOptions(c.urlParams_, opts...)
  35417. res, err := c.doRequest("json")
  35418. if res != nil && res.StatusCode == http.StatusNotModified {
  35419. if res.Body != nil {
  35420. res.Body.Close()
  35421. }
  35422. return nil, &googleapi.Error{
  35423. Code: res.StatusCode,
  35424. Header: res.Header,
  35425. }
  35426. }
  35427. if err != nil {
  35428. return nil, err
  35429. }
  35430. defer googleapi.CloseBody(res)
  35431. if err := googleapi.CheckResponse(res); err != nil {
  35432. return nil, err
  35433. }
  35434. ret := &PlacementStrategy{
  35435. ServerResponse: googleapi.ServerResponse{
  35436. Header: res.Header,
  35437. HTTPStatusCode: res.StatusCode,
  35438. },
  35439. }
  35440. target := &ret
  35441. if err := gensupport.DecodeResponse(target, res); err != nil {
  35442. return nil, err
  35443. }
  35444. return ret, nil
  35445. // {
  35446. // "description": "Gets one placement strategy by ID.",
  35447. // "httpMethod": "GET",
  35448. // "id": "dfareporting.placementStrategies.get",
  35449. // "parameterOrder": [
  35450. // "profileId",
  35451. // "id"
  35452. // ],
  35453. // "parameters": {
  35454. // "id": {
  35455. // "description": "Placement strategy ID.",
  35456. // "format": "int64",
  35457. // "location": "path",
  35458. // "required": true,
  35459. // "type": "string"
  35460. // },
  35461. // "profileId": {
  35462. // "description": "User profile ID associated with this request.",
  35463. // "format": "int64",
  35464. // "location": "path",
  35465. // "required": true,
  35466. // "type": "string"
  35467. // }
  35468. // },
  35469. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  35470. // "response": {
  35471. // "$ref": "PlacementStrategy"
  35472. // },
  35473. // "scopes": [
  35474. // "https://www.googleapis.com/auth/dfatrafficking"
  35475. // ]
  35476. // }
  35477. }
  35478. // method id "dfareporting.placementStrategies.insert":
  35479. type PlacementStrategiesInsertCall struct {
  35480. s *Service
  35481. profileId int64
  35482. placementstrategy *PlacementStrategy
  35483. urlParams_ gensupport.URLParams
  35484. ctx_ context.Context
  35485. header_ http.Header
  35486. }
  35487. // Insert: Inserts a new placement strategy.
  35488. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  35489. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35490. c.profileId = profileId
  35491. c.placementstrategy = placementstrategy
  35492. return c
  35493. }
  35494. // Fields allows partial responses to be retrieved. See
  35495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35496. // for more information.
  35497. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  35498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35499. return c
  35500. }
  35501. // Context sets the context to be used in this call's Do method. Any
  35502. // pending HTTP request will be aborted if the provided context is
  35503. // canceled.
  35504. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  35505. c.ctx_ = ctx
  35506. return c
  35507. }
  35508. // Header returns an http.Header that can be modified by the caller to
  35509. // add HTTP headers to the request.
  35510. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  35511. if c.header_ == nil {
  35512. c.header_ = make(http.Header)
  35513. }
  35514. return c.header_
  35515. }
  35516. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  35517. reqHeaders := make(http.Header)
  35518. for k, v := range c.header_ {
  35519. reqHeaders[k] = v
  35520. }
  35521. reqHeaders.Set("User-Agent", c.s.userAgent())
  35522. var body io.Reader = nil
  35523. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35524. if err != nil {
  35525. return nil, err
  35526. }
  35527. reqHeaders.Set("Content-Type", "application/json")
  35528. c.urlParams_.Set("alt", alt)
  35529. c.urlParams_.Set("prettyPrint", "false")
  35530. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35531. urls += "?" + c.urlParams_.Encode()
  35532. req, err := http.NewRequest("POST", urls, body)
  35533. if err != nil {
  35534. return nil, err
  35535. }
  35536. req.Header = reqHeaders
  35537. googleapi.Expand(req.URL, map[string]string{
  35538. "profileId": strconv.FormatInt(c.profileId, 10),
  35539. })
  35540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35541. }
  35542. // Do executes the "dfareporting.placementStrategies.insert" call.
  35543. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35544. // non-2xx status code is an error. Response headers are in either
  35545. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35546. // returned at all) in error.(*googleapi.Error).Header. Use
  35547. // googleapi.IsNotModified to check whether the returned error was
  35548. // because http.StatusNotModified was returned.
  35549. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35550. gensupport.SetOptions(c.urlParams_, opts...)
  35551. res, err := c.doRequest("json")
  35552. if res != nil && res.StatusCode == http.StatusNotModified {
  35553. if res.Body != nil {
  35554. res.Body.Close()
  35555. }
  35556. return nil, &googleapi.Error{
  35557. Code: res.StatusCode,
  35558. Header: res.Header,
  35559. }
  35560. }
  35561. if err != nil {
  35562. return nil, err
  35563. }
  35564. defer googleapi.CloseBody(res)
  35565. if err := googleapi.CheckResponse(res); err != nil {
  35566. return nil, err
  35567. }
  35568. ret := &PlacementStrategy{
  35569. ServerResponse: googleapi.ServerResponse{
  35570. Header: res.Header,
  35571. HTTPStatusCode: res.StatusCode,
  35572. },
  35573. }
  35574. target := &ret
  35575. if err := gensupport.DecodeResponse(target, res); err != nil {
  35576. return nil, err
  35577. }
  35578. return ret, nil
  35579. // {
  35580. // "description": "Inserts a new placement strategy.",
  35581. // "httpMethod": "POST",
  35582. // "id": "dfareporting.placementStrategies.insert",
  35583. // "parameterOrder": [
  35584. // "profileId"
  35585. // ],
  35586. // "parameters": {
  35587. // "profileId": {
  35588. // "description": "User profile ID associated with this request.",
  35589. // "format": "int64",
  35590. // "location": "path",
  35591. // "required": true,
  35592. // "type": "string"
  35593. // }
  35594. // },
  35595. // "path": "userprofiles/{profileId}/placementStrategies",
  35596. // "request": {
  35597. // "$ref": "PlacementStrategy"
  35598. // },
  35599. // "response": {
  35600. // "$ref": "PlacementStrategy"
  35601. // },
  35602. // "scopes": [
  35603. // "https://www.googleapis.com/auth/dfatrafficking"
  35604. // ]
  35605. // }
  35606. }
  35607. // method id "dfareporting.placementStrategies.list":
  35608. type PlacementStrategiesListCall struct {
  35609. s *Service
  35610. profileId int64
  35611. urlParams_ gensupport.URLParams
  35612. ifNoneMatch_ string
  35613. ctx_ context.Context
  35614. header_ http.Header
  35615. }
  35616. // List: Retrieves a list of placement strategies, possibly filtered.
  35617. // This method supports paging.
  35618. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  35619. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35620. c.profileId = profileId
  35621. return c
  35622. }
  35623. // Ids sets the optional parameter "ids": Select only placement
  35624. // strategies with these IDs.
  35625. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  35626. var ids_ []string
  35627. for _, v := range ids {
  35628. ids_ = append(ids_, fmt.Sprint(v))
  35629. }
  35630. c.urlParams_.SetMulti("ids", ids_)
  35631. return c
  35632. }
  35633. // MaxResults sets the optional parameter "maxResults": Maximum number
  35634. // of results to return.
  35635. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  35636. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35637. return c
  35638. }
  35639. // PageToken sets the optional parameter "pageToken": Value of the
  35640. // nextPageToken from the previous result page.
  35641. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  35642. c.urlParams_.Set("pageToken", pageToken)
  35643. return c
  35644. }
  35645. // SearchString sets the optional parameter "searchString": Allows
  35646. // searching for objects by name or ID. Wildcards (*) are allowed. For
  35647. // example, "placementstrategy*2015" will return objects with names like
  35648. // "placementstrategy June 2015", "placementstrategy April 2015", or
  35649. // simply "placementstrategy 2015". Most of the searches also add
  35650. // wildcards implicitly at the start and the end of the search string.
  35651. // For example, a search string of "placementstrategy" will match
  35652. // objects with name "my placementstrategy", "placementstrategy 2015",
  35653. // or simply "placementstrategy".
  35654. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  35655. c.urlParams_.Set("searchString", searchString)
  35656. return c
  35657. }
  35658. // SortField sets the optional parameter "sortField": Field by which to
  35659. // sort the list.
  35660. //
  35661. // Possible values:
  35662. // "ID" (default)
  35663. // "NAME"
  35664. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  35665. c.urlParams_.Set("sortField", sortField)
  35666. return c
  35667. }
  35668. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35669. // results.
  35670. //
  35671. // Possible values:
  35672. // "ASCENDING" (default)
  35673. // "DESCENDING"
  35674. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  35675. c.urlParams_.Set("sortOrder", sortOrder)
  35676. return c
  35677. }
  35678. // Fields allows partial responses to be retrieved. See
  35679. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35680. // for more information.
  35681. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  35682. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35683. return c
  35684. }
  35685. // IfNoneMatch sets the optional parameter which makes the operation
  35686. // fail if the object's ETag matches the given value. This is useful for
  35687. // getting updates only after the object has changed since the last
  35688. // request. Use googleapi.IsNotModified to check whether the response
  35689. // error from Do is the result of In-None-Match.
  35690. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  35691. c.ifNoneMatch_ = entityTag
  35692. return c
  35693. }
  35694. // Context sets the context to be used in this call's Do method. Any
  35695. // pending HTTP request will be aborted if the provided context is
  35696. // canceled.
  35697. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  35698. c.ctx_ = ctx
  35699. return c
  35700. }
  35701. // Header returns an http.Header that can be modified by the caller to
  35702. // add HTTP headers to the request.
  35703. func (c *PlacementStrategiesListCall) Header() http.Header {
  35704. if c.header_ == nil {
  35705. c.header_ = make(http.Header)
  35706. }
  35707. return c.header_
  35708. }
  35709. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  35710. reqHeaders := make(http.Header)
  35711. for k, v := range c.header_ {
  35712. reqHeaders[k] = v
  35713. }
  35714. reqHeaders.Set("User-Agent", c.s.userAgent())
  35715. if c.ifNoneMatch_ != "" {
  35716. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35717. }
  35718. var body io.Reader = nil
  35719. c.urlParams_.Set("alt", alt)
  35720. c.urlParams_.Set("prettyPrint", "false")
  35721. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35722. urls += "?" + c.urlParams_.Encode()
  35723. req, err := http.NewRequest("GET", urls, body)
  35724. if err != nil {
  35725. return nil, err
  35726. }
  35727. req.Header = reqHeaders
  35728. googleapi.Expand(req.URL, map[string]string{
  35729. "profileId": strconv.FormatInt(c.profileId, 10),
  35730. })
  35731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35732. }
  35733. // Do executes the "dfareporting.placementStrategies.list" call.
  35734. // Exactly one of *PlacementStrategiesListResponse or error will be
  35735. // non-nil. Any non-2xx status code is an error. Response headers are in
  35736. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  35737. // a response was returned at all) in error.(*googleapi.Error).Header.
  35738. // Use googleapi.IsNotModified to check whether the returned error was
  35739. // because http.StatusNotModified was returned.
  35740. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  35741. gensupport.SetOptions(c.urlParams_, opts...)
  35742. res, err := c.doRequest("json")
  35743. if res != nil && res.StatusCode == http.StatusNotModified {
  35744. if res.Body != nil {
  35745. res.Body.Close()
  35746. }
  35747. return nil, &googleapi.Error{
  35748. Code: res.StatusCode,
  35749. Header: res.Header,
  35750. }
  35751. }
  35752. if err != nil {
  35753. return nil, err
  35754. }
  35755. defer googleapi.CloseBody(res)
  35756. if err := googleapi.CheckResponse(res); err != nil {
  35757. return nil, err
  35758. }
  35759. ret := &PlacementStrategiesListResponse{
  35760. ServerResponse: googleapi.ServerResponse{
  35761. Header: res.Header,
  35762. HTTPStatusCode: res.StatusCode,
  35763. },
  35764. }
  35765. target := &ret
  35766. if err := gensupport.DecodeResponse(target, res); err != nil {
  35767. return nil, err
  35768. }
  35769. return ret, nil
  35770. // {
  35771. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  35772. // "httpMethod": "GET",
  35773. // "id": "dfareporting.placementStrategies.list",
  35774. // "parameterOrder": [
  35775. // "profileId"
  35776. // ],
  35777. // "parameters": {
  35778. // "ids": {
  35779. // "description": "Select only placement strategies with these IDs.",
  35780. // "format": "int64",
  35781. // "location": "query",
  35782. // "repeated": true,
  35783. // "type": "string"
  35784. // },
  35785. // "maxResults": {
  35786. // "default": "1000",
  35787. // "description": "Maximum number of results to return.",
  35788. // "format": "int32",
  35789. // "location": "query",
  35790. // "maximum": "1000",
  35791. // "minimum": "0",
  35792. // "type": "integer"
  35793. // },
  35794. // "pageToken": {
  35795. // "description": "Value of the nextPageToken from the previous result page.",
  35796. // "location": "query",
  35797. // "type": "string"
  35798. // },
  35799. // "profileId": {
  35800. // "description": "User profile ID associated with this request.",
  35801. // "format": "int64",
  35802. // "location": "path",
  35803. // "required": true,
  35804. // "type": "string"
  35805. // },
  35806. // "searchString": {
  35807. // "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\".",
  35808. // "location": "query",
  35809. // "type": "string"
  35810. // },
  35811. // "sortField": {
  35812. // "default": "ID",
  35813. // "description": "Field by which to sort the list.",
  35814. // "enum": [
  35815. // "ID",
  35816. // "NAME"
  35817. // ],
  35818. // "enumDescriptions": [
  35819. // "",
  35820. // ""
  35821. // ],
  35822. // "location": "query",
  35823. // "type": "string"
  35824. // },
  35825. // "sortOrder": {
  35826. // "default": "ASCENDING",
  35827. // "description": "Order of sorted results.",
  35828. // "enum": [
  35829. // "ASCENDING",
  35830. // "DESCENDING"
  35831. // ],
  35832. // "enumDescriptions": [
  35833. // "",
  35834. // ""
  35835. // ],
  35836. // "location": "query",
  35837. // "type": "string"
  35838. // }
  35839. // },
  35840. // "path": "userprofiles/{profileId}/placementStrategies",
  35841. // "response": {
  35842. // "$ref": "PlacementStrategiesListResponse"
  35843. // },
  35844. // "scopes": [
  35845. // "https://www.googleapis.com/auth/dfatrafficking"
  35846. // ]
  35847. // }
  35848. }
  35849. // Pages invokes f for each page of results.
  35850. // A non-nil error returned from f will halt the iteration.
  35851. // The provided context supersedes any context provided to the Context method.
  35852. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  35853. c.ctx_ = ctx
  35854. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35855. for {
  35856. x, err := c.Do()
  35857. if err != nil {
  35858. return err
  35859. }
  35860. if err := f(x); err != nil {
  35861. return err
  35862. }
  35863. if x.NextPageToken == "" {
  35864. return nil
  35865. }
  35866. c.PageToken(x.NextPageToken)
  35867. }
  35868. }
  35869. // method id "dfareporting.placementStrategies.patch":
  35870. type PlacementStrategiesPatchCall struct {
  35871. s *Service
  35872. profileId int64
  35873. placementstrategy *PlacementStrategy
  35874. urlParams_ gensupport.URLParams
  35875. ctx_ context.Context
  35876. header_ http.Header
  35877. }
  35878. // Patch: Updates an existing placement strategy. This method supports
  35879. // patch semantics.
  35880. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  35881. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35882. c.profileId = profileId
  35883. c.urlParams_.Set("id", fmt.Sprint(id))
  35884. c.placementstrategy = placementstrategy
  35885. return c
  35886. }
  35887. // Fields allows partial responses to be retrieved. See
  35888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35889. // for more information.
  35890. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  35891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35892. return c
  35893. }
  35894. // Context sets the context to be used in this call's Do method. Any
  35895. // pending HTTP request will be aborted if the provided context is
  35896. // canceled.
  35897. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  35898. c.ctx_ = ctx
  35899. return c
  35900. }
  35901. // Header returns an http.Header that can be modified by the caller to
  35902. // add HTTP headers to the request.
  35903. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  35904. if c.header_ == nil {
  35905. c.header_ = make(http.Header)
  35906. }
  35907. return c.header_
  35908. }
  35909. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  35910. reqHeaders := make(http.Header)
  35911. for k, v := range c.header_ {
  35912. reqHeaders[k] = v
  35913. }
  35914. reqHeaders.Set("User-Agent", c.s.userAgent())
  35915. var body io.Reader = nil
  35916. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35917. if err != nil {
  35918. return nil, err
  35919. }
  35920. reqHeaders.Set("Content-Type", "application/json")
  35921. c.urlParams_.Set("alt", alt)
  35922. c.urlParams_.Set("prettyPrint", "false")
  35923. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35924. urls += "?" + c.urlParams_.Encode()
  35925. req, err := http.NewRequest("PATCH", urls, body)
  35926. if err != nil {
  35927. return nil, err
  35928. }
  35929. req.Header = reqHeaders
  35930. googleapi.Expand(req.URL, map[string]string{
  35931. "profileId": strconv.FormatInt(c.profileId, 10),
  35932. })
  35933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35934. }
  35935. // Do executes the "dfareporting.placementStrategies.patch" call.
  35936. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35937. // non-2xx status code is an error. Response headers are in either
  35938. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35939. // returned at all) in error.(*googleapi.Error).Header. Use
  35940. // googleapi.IsNotModified to check whether the returned error was
  35941. // because http.StatusNotModified was returned.
  35942. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35943. gensupport.SetOptions(c.urlParams_, opts...)
  35944. res, err := c.doRequest("json")
  35945. if res != nil && res.StatusCode == http.StatusNotModified {
  35946. if res.Body != nil {
  35947. res.Body.Close()
  35948. }
  35949. return nil, &googleapi.Error{
  35950. Code: res.StatusCode,
  35951. Header: res.Header,
  35952. }
  35953. }
  35954. if err != nil {
  35955. return nil, err
  35956. }
  35957. defer googleapi.CloseBody(res)
  35958. if err := googleapi.CheckResponse(res); err != nil {
  35959. return nil, err
  35960. }
  35961. ret := &PlacementStrategy{
  35962. ServerResponse: googleapi.ServerResponse{
  35963. Header: res.Header,
  35964. HTTPStatusCode: res.StatusCode,
  35965. },
  35966. }
  35967. target := &ret
  35968. if err := gensupport.DecodeResponse(target, res); err != nil {
  35969. return nil, err
  35970. }
  35971. return ret, nil
  35972. // {
  35973. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  35974. // "httpMethod": "PATCH",
  35975. // "id": "dfareporting.placementStrategies.patch",
  35976. // "parameterOrder": [
  35977. // "profileId",
  35978. // "id"
  35979. // ],
  35980. // "parameters": {
  35981. // "id": {
  35982. // "description": "Placement strategy ID.",
  35983. // "format": "int64",
  35984. // "location": "query",
  35985. // "required": true,
  35986. // "type": "string"
  35987. // },
  35988. // "profileId": {
  35989. // "description": "User profile ID associated with this request.",
  35990. // "format": "int64",
  35991. // "location": "path",
  35992. // "required": true,
  35993. // "type": "string"
  35994. // }
  35995. // },
  35996. // "path": "userprofiles/{profileId}/placementStrategies",
  35997. // "request": {
  35998. // "$ref": "PlacementStrategy"
  35999. // },
  36000. // "response": {
  36001. // "$ref": "PlacementStrategy"
  36002. // },
  36003. // "scopes": [
  36004. // "https://www.googleapis.com/auth/dfatrafficking"
  36005. // ]
  36006. // }
  36007. }
  36008. // method id "dfareporting.placementStrategies.update":
  36009. type PlacementStrategiesUpdateCall struct {
  36010. s *Service
  36011. profileId int64
  36012. placementstrategy *PlacementStrategy
  36013. urlParams_ gensupport.URLParams
  36014. ctx_ context.Context
  36015. header_ http.Header
  36016. }
  36017. // Update: Updates an existing placement strategy.
  36018. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  36019. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36020. c.profileId = profileId
  36021. c.placementstrategy = placementstrategy
  36022. return c
  36023. }
  36024. // Fields allows partial responses to be retrieved. See
  36025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36026. // for more information.
  36027. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  36028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36029. return c
  36030. }
  36031. // Context sets the context to be used in this call's Do method. Any
  36032. // pending HTTP request will be aborted if the provided context is
  36033. // canceled.
  36034. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  36035. c.ctx_ = ctx
  36036. return c
  36037. }
  36038. // Header returns an http.Header that can be modified by the caller to
  36039. // add HTTP headers to the request.
  36040. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  36041. if c.header_ == nil {
  36042. c.header_ = make(http.Header)
  36043. }
  36044. return c.header_
  36045. }
  36046. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  36047. reqHeaders := make(http.Header)
  36048. for k, v := range c.header_ {
  36049. reqHeaders[k] = v
  36050. }
  36051. reqHeaders.Set("User-Agent", c.s.userAgent())
  36052. var body io.Reader = nil
  36053. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  36054. if err != nil {
  36055. return nil, err
  36056. }
  36057. reqHeaders.Set("Content-Type", "application/json")
  36058. c.urlParams_.Set("alt", alt)
  36059. c.urlParams_.Set("prettyPrint", "false")
  36060. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  36061. urls += "?" + c.urlParams_.Encode()
  36062. req, err := http.NewRequest("PUT", urls, body)
  36063. if err != nil {
  36064. return nil, err
  36065. }
  36066. req.Header = reqHeaders
  36067. googleapi.Expand(req.URL, map[string]string{
  36068. "profileId": strconv.FormatInt(c.profileId, 10),
  36069. })
  36070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36071. }
  36072. // Do executes the "dfareporting.placementStrategies.update" call.
  36073. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  36074. // non-2xx status code is an error. Response headers are in either
  36075. // *PlacementStrategy.ServerResponse.Header or (if a response was
  36076. // returned at all) in error.(*googleapi.Error).Header. Use
  36077. // googleapi.IsNotModified to check whether the returned error was
  36078. // because http.StatusNotModified was returned.
  36079. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  36080. gensupport.SetOptions(c.urlParams_, opts...)
  36081. res, err := c.doRequest("json")
  36082. if res != nil && res.StatusCode == http.StatusNotModified {
  36083. if res.Body != nil {
  36084. res.Body.Close()
  36085. }
  36086. return nil, &googleapi.Error{
  36087. Code: res.StatusCode,
  36088. Header: res.Header,
  36089. }
  36090. }
  36091. if err != nil {
  36092. return nil, err
  36093. }
  36094. defer googleapi.CloseBody(res)
  36095. if err := googleapi.CheckResponse(res); err != nil {
  36096. return nil, err
  36097. }
  36098. ret := &PlacementStrategy{
  36099. ServerResponse: googleapi.ServerResponse{
  36100. Header: res.Header,
  36101. HTTPStatusCode: res.StatusCode,
  36102. },
  36103. }
  36104. target := &ret
  36105. if err := gensupport.DecodeResponse(target, res); err != nil {
  36106. return nil, err
  36107. }
  36108. return ret, nil
  36109. // {
  36110. // "description": "Updates an existing placement strategy.",
  36111. // "httpMethod": "PUT",
  36112. // "id": "dfareporting.placementStrategies.update",
  36113. // "parameterOrder": [
  36114. // "profileId"
  36115. // ],
  36116. // "parameters": {
  36117. // "profileId": {
  36118. // "description": "User profile ID associated with this request.",
  36119. // "format": "int64",
  36120. // "location": "path",
  36121. // "required": true,
  36122. // "type": "string"
  36123. // }
  36124. // },
  36125. // "path": "userprofiles/{profileId}/placementStrategies",
  36126. // "request": {
  36127. // "$ref": "PlacementStrategy"
  36128. // },
  36129. // "response": {
  36130. // "$ref": "PlacementStrategy"
  36131. // },
  36132. // "scopes": [
  36133. // "https://www.googleapis.com/auth/dfatrafficking"
  36134. // ]
  36135. // }
  36136. }
  36137. // method id "dfareporting.placements.generatetags":
  36138. type PlacementsGeneratetagsCall struct {
  36139. s *Service
  36140. profileId int64
  36141. urlParams_ gensupport.URLParams
  36142. ctx_ context.Context
  36143. header_ http.Header
  36144. }
  36145. // Generatetags: Generates tags for a placement.
  36146. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  36147. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36148. c.profileId = profileId
  36149. return c
  36150. }
  36151. // CampaignId sets the optional parameter "campaignId": Generate
  36152. // placements belonging to this campaign. This is a required field.
  36153. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  36154. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  36155. return c
  36156. }
  36157. // PlacementIds sets the optional parameter "placementIds": Generate
  36158. // tags for these placements.
  36159. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  36160. var placementIds_ []string
  36161. for _, v := range placementIds {
  36162. placementIds_ = append(placementIds_, fmt.Sprint(v))
  36163. }
  36164. c.urlParams_.SetMulti("placementIds", placementIds_)
  36165. return c
  36166. }
  36167. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  36168. // generate for these placements.
  36169. //
  36170. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  36171. // placements.
  36172. //
  36173. // Possible values:
  36174. // "PLACEMENT_TAG_CLICK_COMMANDS"
  36175. // "PLACEMENT_TAG_IFRAME_ILAYER"
  36176. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  36177. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  36178. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  36179. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  36180. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  36181. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  36182. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  36183. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  36184. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  36185. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  36186. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  36187. // "PLACEMENT_TAG_JAVASCRIPT"
  36188. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  36189. // "PLACEMENT_TAG_STANDARD"
  36190. // "PLACEMENT_TAG_TRACKING"
  36191. // "PLACEMENT_TAG_TRACKING_IFRAME"
  36192. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  36193. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  36194. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  36195. return c
  36196. }
  36197. // Fields allows partial responses to be retrieved. See
  36198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36199. // for more information.
  36200. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  36201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36202. return c
  36203. }
  36204. // Context sets the context to be used in this call's Do method. Any
  36205. // pending HTTP request will be aborted if the provided context is
  36206. // canceled.
  36207. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  36208. c.ctx_ = ctx
  36209. return c
  36210. }
  36211. // Header returns an http.Header that can be modified by the caller to
  36212. // add HTTP headers to the request.
  36213. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  36214. if c.header_ == nil {
  36215. c.header_ = make(http.Header)
  36216. }
  36217. return c.header_
  36218. }
  36219. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  36220. reqHeaders := make(http.Header)
  36221. for k, v := range c.header_ {
  36222. reqHeaders[k] = v
  36223. }
  36224. reqHeaders.Set("User-Agent", c.s.userAgent())
  36225. var body io.Reader = nil
  36226. c.urlParams_.Set("alt", alt)
  36227. c.urlParams_.Set("prettyPrint", "false")
  36228. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  36229. urls += "?" + c.urlParams_.Encode()
  36230. req, err := http.NewRequest("POST", urls, body)
  36231. if err != nil {
  36232. return nil, err
  36233. }
  36234. req.Header = reqHeaders
  36235. googleapi.Expand(req.URL, map[string]string{
  36236. "profileId": strconv.FormatInt(c.profileId, 10),
  36237. })
  36238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36239. }
  36240. // Do executes the "dfareporting.placements.generatetags" call.
  36241. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  36242. // non-nil. Any non-2xx status code is an error. Response headers are in
  36243. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  36244. // response was returned at all) in error.(*googleapi.Error).Header. Use
  36245. // googleapi.IsNotModified to check whether the returned error was
  36246. // because http.StatusNotModified was returned.
  36247. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  36248. gensupport.SetOptions(c.urlParams_, opts...)
  36249. res, err := c.doRequest("json")
  36250. if res != nil && res.StatusCode == http.StatusNotModified {
  36251. if res.Body != nil {
  36252. res.Body.Close()
  36253. }
  36254. return nil, &googleapi.Error{
  36255. Code: res.StatusCode,
  36256. Header: res.Header,
  36257. }
  36258. }
  36259. if err != nil {
  36260. return nil, err
  36261. }
  36262. defer googleapi.CloseBody(res)
  36263. if err := googleapi.CheckResponse(res); err != nil {
  36264. return nil, err
  36265. }
  36266. ret := &PlacementsGenerateTagsResponse{
  36267. ServerResponse: googleapi.ServerResponse{
  36268. Header: res.Header,
  36269. HTTPStatusCode: res.StatusCode,
  36270. },
  36271. }
  36272. target := &ret
  36273. if err := gensupport.DecodeResponse(target, res); err != nil {
  36274. return nil, err
  36275. }
  36276. return ret, nil
  36277. // {
  36278. // "description": "Generates tags for a placement.",
  36279. // "httpMethod": "POST",
  36280. // "id": "dfareporting.placements.generatetags",
  36281. // "parameterOrder": [
  36282. // "profileId"
  36283. // ],
  36284. // "parameters": {
  36285. // "campaignId": {
  36286. // "description": "Generate placements belonging to this campaign. This is a required field.",
  36287. // "format": "int64",
  36288. // "location": "query",
  36289. // "type": "string"
  36290. // },
  36291. // "placementIds": {
  36292. // "description": "Generate tags for these placements.",
  36293. // "format": "int64",
  36294. // "location": "query",
  36295. // "repeated": true,
  36296. // "type": "string"
  36297. // },
  36298. // "profileId": {
  36299. // "description": "User profile ID associated with this request.",
  36300. // "format": "int64",
  36301. // "location": "path",
  36302. // "required": true,
  36303. // "type": "string"
  36304. // },
  36305. // "tagFormats": {
  36306. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  36307. // "enum": [
  36308. // "PLACEMENT_TAG_CLICK_COMMANDS",
  36309. // "PLACEMENT_TAG_IFRAME_ILAYER",
  36310. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  36311. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  36312. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  36313. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  36314. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  36315. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  36316. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  36317. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  36318. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  36319. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  36320. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  36321. // "PLACEMENT_TAG_JAVASCRIPT",
  36322. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  36323. // "PLACEMENT_TAG_STANDARD",
  36324. // "PLACEMENT_TAG_TRACKING",
  36325. // "PLACEMENT_TAG_TRACKING_IFRAME",
  36326. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  36327. // ],
  36328. // "enumDescriptions": [
  36329. // "",
  36330. // "",
  36331. // "",
  36332. // "",
  36333. // "",
  36334. // "",
  36335. // "",
  36336. // "",
  36337. // "",
  36338. // "",
  36339. // "",
  36340. // "",
  36341. // "",
  36342. // "",
  36343. // "",
  36344. // "",
  36345. // "",
  36346. // "",
  36347. // ""
  36348. // ],
  36349. // "location": "query",
  36350. // "repeated": true,
  36351. // "type": "string"
  36352. // }
  36353. // },
  36354. // "path": "userprofiles/{profileId}/placements/generatetags",
  36355. // "response": {
  36356. // "$ref": "PlacementsGenerateTagsResponse"
  36357. // },
  36358. // "scopes": [
  36359. // "https://www.googleapis.com/auth/dfatrafficking"
  36360. // ]
  36361. // }
  36362. }
  36363. // method id "dfareporting.placements.get":
  36364. type PlacementsGetCall struct {
  36365. s *Service
  36366. profileId int64
  36367. id int64
  36368. urlParams_ gensupport.URLParams
  36369. ifNoneMatch_ string
  36370. ctx_ context.Context
  36371. header_ http.Header
  36372. }
  36373. // Get: Gets one placement by ID.
  36374. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  36375. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36376. c.profileId = profileId
  36377. c.id = id
  36378. return c
  36379. }
  36380. // Fields allows partial responses to be retrieved. See
  36381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36382. // for more information.
  36383. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  36384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36385. return c
  36386. }
  36387. // IfNoneMatch sets the optional parameter which makes the operation
  36388. // fail if the object's ETag matches the given value. This is useful for
  36389. // getting updates only after the object has changed since the last
  36390. // request. Use googleapi.IsNotModified to check whether the response
  36391. // error from Do is the result of In-None-Match.
  36392. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  36393. c.ifNoneMatch_ = entityTag
  36394. return c
  36395. }
  36396. // Context sets the context to be used in this call's Do method. Any
  36397. // pending HTTP request will be aborted if the provided context is
  36398. // canceled.
  36399. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  36400. c.ctx_ = ctx
  36401. return c
  36402. }
  36403. // Header returns an http.Header that can be modified by the caller to
  36404. // add HTTP headers to the request.
  36405. func (c *PlacementsGetCall) Header() http.Header {
  36406. if c.header_ == nil {
  36407. c.header_ = make(http.Header)
  36408. }
  36409. return c.header_
  36410. }
  36411. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  36412. reqHeaders := make(http.Header)
  36413. for k, v := range c.header_ {
  36414. reqHeaders[k] = v
  36415. }
  36416. reqHeaders.Set("User-Agent", c.s.userAgent())
  36417. if c.ifNoneMatch_ != "" {
  36418. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36419. }
  36420. var body io.Reader = nil
  36421. c.urlParams_.Set("alt", alt)
  36422. c.urlParams_.Set("prettyPrint", "false")
  36423. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  36424. urls += "?" + c.urlParams_.Encode()
  36425. req, err := http.NewRequest("GET", urls, body)
  36426. if err != nil {
  36427. return nil, err
  36428. }
  36429. req.Header = reqHeaders
  36430. googleapi.Expand(req.URL, map[string]string{
  36431. "profileId": strconv.FormatInt(c.profileId, 10),
  36432. "id": strconv.FormatInt(c.id, 10),
  36433. })
  36434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36435. }
  36436. // Do executes the "dfareporting.placements.get" call.
  36437. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36438. // status code is an error. Response headers are in either
  36439. // *Placement.ServerResponse.Header or (if a response was returned at
  36440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36441. // to check whether the returned error was because
  36442. // http.StatusNotModified was returned.
  36443. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36444. gensupport.SetOptions(c.urlParams_, opts...)
  36445. res, err := c.doRequest("json")
  36446. if res != nil && res.StatusCode == http.StatusNotModified {
  36447. if res.Body != nil {
  36448. res.Body.Close()
  36449. }
  36450. return nil, &googleapi.Error{
  36451. Code: res.StatusCode,
  36452. Header: res.Header,
  36453. }
  36454. }
  36455. if err != nil {
  36456. return nil, err
  36457. }
  36458. defer googleapi.CloseBody(res)
  36459. if err := googleapi.CheckResponse(res); err != nil {
  36460. return nil, err
  36461. }
  36462. ret := &Placement{
  36463. ServerResponse: googleapi.ServerResponse{
  36464. Header: res.Header,
  36465. HTTPStatusCode: res.StatusCode,
  36466. },
  36467. }
  36468. target := &ret
  36469. if err := gensupport.DecodeResponse(target, res); err != nil {
  36470. return nil, err
  36471. }
  36472. return ret, nil
  36473. // {
  36474. // "description": "Gets one placement by ID.",
  36475. // "httpMethod": "GET",
  36476. // "id": "dfareporting.placements.get",
  36477. // "parameterOrder": [
  36478. // "profileId",
  36479. // "id"
  36480. // ],
  36481. // "parameters": {
  36482. // "id": {
  36483. // "description": "Placement ID.",
  36484. // "format": "int64",
  36485. // "location": "path",
  36486. // "required": true,
  36487. // "type": "string"
  36488. // },
  36489. // "profileId": {
  36490. // "description": "User profile ID associated with this request.",
  36491. // "format": "int64",
  36492. // "location": "path",
  36493. // "required": true,
  36494. // "type": "string"
  36495. // }
  36496. // },
  36497. // "path": "userprofiles/{profileId}/placements/{id}",
  36498. // "response": {
  36499. // "$ref": "Placement"
  36500. // },
  36501. // "scopes": [
  36502. // "https://www.googleapis.com/auth/dfatrafficking"
  36503. // ]
  36504. // }
  36505. }
  36506. // method id "dfareporting.placements.insert":
  36507. type PlacementsInsertCall struct {
  36508. s *Service
  36509. profileId int64
  36510. placement *Placement
  36511. urlParams_ gensupport.URLParams
  36512. ctx_ context.Context
  36513. header_ http.Header
  36514. }
  36515. // Insert: Inserts a new placement.
  36516. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  36517. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36518. c.profileId = profileId
  36519. c.placement = placement
  36520. return c
  36521. }
  36522. // Fields allows partial responses to be retrieved. See
  36523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36524. // for more information.
  36525. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  36526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36527. return c
  36528. }
  36529. // Context sets the context to be used in this call's Do method. Any
  36530. // pending HTTP request will be aborted if the provided context is
  36531. // canceled.
  36532. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  36533. c.ctx_ = ctx
  36534. return c
  36535. }
  36536. // Header returns an http.Header that can be modified by the caller to
  36537. // add HTTP headers to the request.
  36538. func (c *PlacementsInsertCall) Header() http.Header {
  36539. if c.header_ == nil {
  36540. c.header_ = make(http.Header)
  36541. }
  36542. return c.header_
  36543. }
  36544. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  36545. reqHeaders := make(http.Header)
  36546. for k, v := range c.header_ {
  36547. reqHeaders[k] = v
  36548. }
  36549. reqHeaders.Set("User-Agent", c.s.userAgent())
  36550. var body io.Reader = nil
  36551. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36552. if err != nil {
  36553. return nil, err
  36554. }
  36555. reqHeaders.Set("Content-Type", "application/json")
  36556. c.urlParams_.Set("alt", alt)
  36557. c.urlParams_.Set("prettyPrint", "false")
  36558. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36559. urls += "?" + c.urlParams_.Encode()
  36560. req, err := http.NewRequest("POST", urls, body)
  36561. if err != nil {
  36562. return nil, err
  36563. }
  36564. req.Header = reqHeaders
  36565. googleapi.Expand(req.URL, map[string]string{
  36566. "profileId": strconv.FormatInt(c.profileId, 10),
  36567. })
  36568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36569. }
  36570. // Do executes the "dfareporting.placements.insert" call.
  36571. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36572. // status code is an error. Response headers are in either
  36573. // *Placement.ServerResponse.Header or (if a response was returned at
  36574. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36575. // to check whether the returned error was because
  36576. // http.StatusNotModified was returned.
  36577. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36578. gensupport.SetOptions(c.urlParams_, opts...)
  36579. res, err := c.doRequest("json")
  36580. if res != nil && res.StatusCode == http.StatusNotModified {
  36581. if res.Body != nil {
  36582. res.Body.Close()
  36583. }
  36584. return nil, &googleapi.Error{
  36585. Code: res.StatusCode,
  36586. Header: res.Header,
  36587. }
  36588. }
  36589. if err != nil {
  36590. return nil, err
  36591. }
  36592. defer googleapi.CloseBody(res)
  36593. if err := googleapi.CheckResponse(res); err != nil {
  36594. return nil, err
  36595. }
  36596. ret := &Placement{
  36597. ServerResponse: googleapi.ServerResponse{
  36598. Header: res.Header,
  36599. HTTPStatusCode: res.StatusCode,
  36600. },
  36601. }
  36602. target := &ret
  36603. if err := gensupport.DecodeResponse(target, res); err != nil {
  36604. return nil, err
  36605. }
  36606. return ret, nil
  36607. // {
  36608. // "description": "Inserts a new placement.",
  36609. // "httpMethod": "POST",
  36610. // "id": "dfareporting.placements.insert",
  36611. // "parameterOrder": [
  36612. // "profileId"
  36613. // ],
  36614. // "parameters": {
  36615. // "profileId": {
  36616. // "description": "User profile ID associated with this request.",
  36617. // "format": "int64",
  36618. // "location": "path",
  36619. // "required": true,
  36620. // "type": "string"
  36621. // }
  36622. // },
  36623. // "path": "userprofiles/{profileId}/placements",
  36624. // "request": {
  36625. // "$ref": "Placement"
  36626. // },
  36627. // "response": {
  36628. // "$ref": "Placement"
  36629. // },
  36630. // "scopes": [
  36631. // "https://www.googleapis.com/auth/dfatrafficking"
  36632. // ]
  36633. // }
  36634. }
  36635. // method id "dfareporting.placements.list":
  36636. type PlacementsListCall struct {
  36637. s *Service
  36638. profileId int64
  36639. urlParams_ gensupport.URLParams
  36640. ifNoneMatch_ string
  36641. ctx_ context.Context
  36642. header_ http.Header
  36643. }
  36644. // List: Retrieves a list of placements, possibly filtered. This method
  36645. // supports paging.
  36646. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  36647. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36648. c.profileId = profileId
  36649. return c
  36650. }
  36651. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36652. // only placements that belong to these advertisers.
  36653. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  36654. var advertiserIds_ []string
  36655. for _, v := range advertiserIds {
  36656. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36657. }
  36658. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36659. return c
  36660. }
  36661. // Archived sets the optional parameter "archived": Select only archived
  36662. // placements. Don't set this field to select both archived and
  36663. // non-archived placements.
  36664. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  36665. c.urlParams_.Set("archived", fmt.Sprint(archived))
  36666. return c
  36667. }
  36668. // CampaignIds sets the optional parameter "campaignIds": Select only
  36669. // placements that belong to these campaigns.
  36670. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  36671. var campaignIds_ []string
  36672. for _, v := range campaignIds {
  36673. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  36674. }
  36675. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  36676. return c
  36677. }
  36678. // Compatibilities sets the optional parameter "compatibilities": Select
  36679. // only placements that are associated with these compatibilities.
  36680. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  36681. // or on mobile devices for regular or interstitial ads respectively.
  36682. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  36683. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  36684. // with the VAST standard.
  36685. //
  36686. // Possible values:
  36687. // "APP"
  36688. // "APP_INTERSTITIAL"
  36689. // "DISPLAY"
  36690. // "DISPLAY_INTERSTITIAL"
  36691. // "IN_STREAM_AUDIO"
  36692. // "IN_STREAM_VIDEO"
  36693. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  36694. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  36695. return c
  36696. }
  36697. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  36698. // Select only placements that are associated with these content
  36699. // categories.
  36700. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  36701. var contentCategoryIds_ []string
  36702. for _, v := range contentCategoryIds {
  36703. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  36704. }
  36705. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  36706. return c
  36707. }
  36708. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  36709. // Select only placements that are associated with these directory
  36710. // sites.
  36711. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  36712. var directorySiteIds_ []string
  36713. for _, v := range directorySiteIds {
  36714. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  36715. }
  36716. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  36717. return c
  36718. }
  36719. // GroupIds sets the optional parameter "groupIds": Select only
  36720. // placements that belong to these placement groups.
  36721. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  36722. var groupIds_ []string
  36723. for _, v := range groupIds {
  36724. groupIds_ = append(groupIds_, fmt.Sprint(v))
  36725. }
  36726. c.urlParams_.SetMulti("groupIds", groupIds_)
  36727. return c
  36728. }
  36729. // Ids sets the optional parameter "ids": Select only placements with
  36730. // these IDs.
  36731. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  36732. var ids_ []string
  36733. for _, v := range ids {
  36734. ids_ = append(ids_, fmt.Sprint(v))
  36735. }
  36736. c.urlParams_.SetMulti("ids", ids_)
  36737. return c
  36738. }
  36739. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  36740. // placements or placement groups whose end date is on or before the
  36741. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  36742. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  36743. c.urlParams_.Set("maxEndDate", maxEndDate)
  36744. return c
  36745. }
  36746. // MaxResults sets the optional parameter "maxResults": Maximum number
  36747. // of results to return.
  36748. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  36749. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36750. return c
  36751. }
  36752. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  36753. // placements or placement groups whose start date is on or before the
  36754. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  36755. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  36756. c.urlParams_.Set("maxStartDate", maxStartDate)
  36757. return c
  36758. }
  36759. // MinEndDate sets the optional parameter "minEndDate": Select only
  36760. // placements or placement groups whose end date is on or after the
  36761. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  36762. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  36763. c.urlParams_.Set("minEndDate", minEndDate)
  36764. return c
  36765. }
  36766. // MinStartDate sets the optional parameter "minStartDate": Select only
  36767. // placements or placement groups whose start date is on or after the
  36768. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  36769. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  36770. c.urlParams_.Set("minStartDate", minStartDate)
  36771. return c
  36772. }
  36773. // PageToken sets the optional parameter "pageToken": Value of the
  36774. // nextPageToken from the previous result page.
  36775. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  36776. c.urlParams_.Set("pageToken", pageToken)
  36777. return c
  36778. }
  36779. // PaymentSource sets the optional parameter "paymentSource": Select
  36780. // only placements with this payment source.
  36781. //
  36782. // Possible values:
  36783. // "PLACEMENT_AGENCY_PAID"
  36784. // "PLACEMENT_PUBLISHER_PAID"
  36785. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  36786. c.urlParams_.Set("paymentSource", paymentSource)
  36787. return c
  36788. }
  36789. // PlacementStrategyIds sets the optional parameter
  36790. // "placementStrategyIds": Select only placements that are associated
  36791. // with these placement strategies.
  36792. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  36793. var placementStrategyIds_ []string
  36794. for _, v := range placementStrategyIds {
  36795. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  36796. }
  36797. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  36798. return c
  36799. }
  36800. // PricingTypes sets the optional parameter "pricingTypes": Select only
  36801. // placements with these pricing types.
  36802. //
  36803. // Possible values:
  36804. // "PRICING_TYPE_CPA"
  36805. // "PRICING_TYPE_CPC"
  36806. // "PRICING_TYPE_CPM"
  36807. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  36808. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  36809. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36810. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  36811. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  36812. return c
  36813. }
  36814. // SearchString sets the optional parameter "searchString": Allows
  36815. // searching for placements by name or ID. Wildcards (*) are allowed.
  36816. // For example, "placement*2015" will return placements with names like
  36817. // "placement June 2015", "placement May 2015", or simply "placements
  36818. // 2015". Most of the searches also add wildcards implicitly at the
  36819. // start and the end of the search string. For example, a search string
  36820. // of "placement" will match placements with name "my placement",
  36821. // "placement 2015", or simply "placement".
  36822. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  36823. c.urlParams_.Set("searchString", searchString)
  36824. return c
  36825. }
  36826. // SiteIds sets the optional parameter "siteIds": Select only placements
  36827. // that are associated with these sites.
  36828. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  36829. var siteIds_ []string
  36830. for _, v := range siteIds {
  36831. siteIds_ = append(siteIds_, fmt.Sprint(v))
  36832. }
  36833. c.urlParams_.SetMulti("siteIds", siteIds_)
  36834. return c
  36835. }
  36836. // SizeIds sets the optional parameter "sizeIds": Select only placements
  36837. // that are associated with these sizes.
  36838. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  36839. var sizeIds_ []string
  36840. for _, v := range sizeIds {
  36841. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  36842. }
  36843. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  36844. return c
  36845. }
  36846. // SortField sets the optional parameter "sortField": Field by which to
  36847. // sort the list.
  36848. //
  36849. // Possible values:
  36850. // "ID" (default)
  36851. // "NAME"
  36852. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  36853. c.urlParams_.Set("sortField", sortField)
  36854. return c
  36855. }
  36856. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36857. // results.
  36858. //
  36859. // Possible values:
  36860. // "ASCENDING" (default)
  36861. // "DESCENDING"
  36862. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  36863. c.urlParams_.Set("sortOrder", sortOrder)
  36864. return c
  36865. }
  36866. // Fields allows partial responses to be retrieved. See
  36867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36868. // for more information.
  36869. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  36870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36871. return c
  36872. }
  36873. // IfNoneMatch sets the optional parameter which makes the operation
  36874. // fail if the object's ETag matches the given value. This is useful for
  36875. // getting updates only after the object has changed since the last
  36876. // request. Use googleapi.IsNotModified to check whether the response
  36877. // error from Do is the result of In-None-Match.
  36878. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  36879. c.ifNoneMatch_ = entityTag
  36880. return c
  36881. }
  36882. // Context sets the context to be used in this call's Do method. Any
  36883. // pending HTTP request will be aborted if the provided context is
  36884. // canceled.
  36885. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  36886. c.ctx_ = ctx
  36887. return c
  36888. }
  36889. // Header returns an http.Header that can be modified by the caller to
  36890. // add HTTP headers to the request.
  36891. func (c *PlacementsListCall) Header() http.Header {
  36892. if c.header_ == nil {
  36893. c.header_ = make(http.Header)
  36894. }
  36895. return c.header_
  36896. }
  36897. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  36898. reqHeaders := make(http.Header)
  36899. for k, v := range c.header_ {
  36900. reqHeaders[k] = v
  36901. }
  36902. reqHeaders.Set("User-Agent", c.s.userAgent())
  36903. if c.ifNoneMatch_ != "" {
  36904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36905. }
  36906. var body io.Reader = nil
  36907. c.urlParams_.Set("alt", alt)
  36908. c.urlParams_.Set("prettyPrint", "false")
  36909. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36910. urls += "?" + c.urlParams_.Encode()
  36911. req, err := http.NewRequest("GET", urls, body)
  36912. if err != nil {
  36913. return nil, err
  36914. }
  36915. req.Header = reqHeaders
  36916. googleapi.Expand(req.URL, map[string]string{
  36917. "profileId": strconv.FormatInt(c.profileId, 10),
  36918. })
  36919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36920. }
  36921. // Do executes the "dfareporting.placements.list" call.
  36922. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  36923. // non-2xx status code is an error. Response headers are in either
  36924. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  36925. // returned at all) in error.(*googleapi.Error).Header. Use
  36926. // googleapi.IsNotModified to check whether the returned error was
  36927. // because http.StatusNotModified was returned.
  36928. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  36929. gensupport.SetOptions(c.urlParams_, opts...)
  36930. res, err := c.doRequest("json")
  36931. if res != nil && res.StatusCode == http.StatusNotModified {
  36932. if res.Body != nil {
  36933. res.Body.Close()
  36934. }
  36935. return nil, &googleapi.Error{
  36936. Code: res.StatusCode,
  36937. Header: res.Header,
  36938. }
  36939. }
  36940. if err != nil {
  36941. return nil, err
  36942. }
  36943. defer googleapi.CloseBody(res)
  36944. if err := googleapi.CheckResponse(res); err != nil {
  36945. return nil, err
  36946. }
  36947. ret := &PlacementsListResponse{
  36948. ServerResponse: googleapi.ServerResponse{
  36949. Header: res.Header,
  36950. HTTPStatusCode: res.StatusCode,
  36951. },
  36952. }
  36953. target := &ret
  36954. if err := gensupport.DecodeResponse(target, res); err != nil {
  36955. return nil, err
  36956. }
  36957. return ret, nil
  36958. // {
  36959. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  36960. // "httpMethod": "GET",
  36961. // "id": "dfareporting.placements.list",
  36962. // "parameterOrder": [
  36963. // "profileId"
  36964. // ],
  36965. // "parameters": {
  36966. // "advertiserIds": {
  36967. // "description": "Select only placements that belong to these advertisers.",
  36968. // "format": "int64",
  36969. // "location": "query",
  36970. // "repeated": true,
  36971. // "type": "string"
  36972. // },
  36973. // "archived": {
  36974. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  36975. // "location": "query",
  36976. // "type": "boolean"
  36977. // },
  36978. // "campaignIds": {
  36979. // "description": "Select only placements that belong to these campaigns.",
  36980. // "format": "int64",
  36981. // "location": "query",
  36982. // "repeated": true,
  36983. // "type": "string"
  36984. // },
  36985. // "compatibilities": {
  36986. // "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.",
  36987. // "enum": [
  36988. // "APP",
  36989. // "APP_INTERSTITIAL",
  36990. // "DISPLAY",
  36991. // "DISPLAY_INTERSTITIAL",
  36992. // "IN_STREAM_AUDIO",
  36993. // "IN_STREAM_VIDEO"
  36994. // ],
  36995. // "enumDescriptions": [
  36996. // "",
  36997. // "",
  36998. // "",
  36999. // "",
  37000. // "",
  37001. // ""
  37002. // ],
  37003. // "location": "query",
  37004. // "repeated": true,
  37005. // "type": "string"
  37006. // },
  37007. // "contentCategoryIds": {
  37008. // "description": "Select only placements that are associated with these content categories.",
  37009. // "format": "int64",
  37010. // "location": "query",
  37011. // "repeated": true,
  37012. // "type": "string"
  37013. // },
  37014. // "directorySiteIds": {
  37015. // "description": "Select only placements that are associated with these directory sites.",
  37016. // "format": "int64",
  37017. // "location": "query",
  37018. // "repeated": true,
  37019. // "type": "string"
  37020. // },
  37021. // "groupIds": {
  37022. // "description": "Select only placements that belong to these placement groups.",
  37023. // "format": "int64",
  37024. // "location": "query",
  37025. // "repeated": true,
  37026. // "type": "string"
  37027. // },
  37028. // "ids": {
  37029. // "description": "Select only placements with these IDs.",
  37030. // "format": "int64",
  37031. // "location": "query",
  37032. // "repeated": true,
  37033. // "type": "string"
  37034. // },
  37035. // "maxEndDate": {
  37036. // "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\".",
  37037. // "location": "query",
  37038. // "type": "string"
  37039. // },
  37040. // "maxResults": {
  37041. // "default": "1000",
  37042. // "description": "Maximum number of results to return.",
  37043. // "format": "int32",
  37044. // "location": "query",
  37045. // "maximum": "1000",
  37046. // "minimum": "0",
  37047. // "type": "integer"
  37048. // },
  37049. // "maxStartDate": {
  37050. // "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\".",
  37051. // "location": "query",
  37052. // "type": "string"
  37053. // },
  37054. // "minEndDate": {
  37055. // "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\".",
  37056. // "location": "query",
  37057. // "type": "string"
  37058. // },
  37059. // "minStartDate": {
  37060. // "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\".",
  37061. // "location": "query",
  37062. // "type": "string"
  37063. // },
  37064. // "pageToken": {
  37065. // "description": "Value of the nextPageToken from the previous result page.",
  37066. // "location": "query",
  37067. // "type": "string"
  37068. // },
  37069. // "paymentSource": {
  37070. // "description": "Select only placements with this payment source.",
  37071. // "enum": [
  37072. // "PLACEMENT_AGENCY_PAID",
  37073. // "PLACEMENT_PUBLISHER_PAID"
  37074. // ],
  37075. // "enumDescriptions": [
  37076. // "",
  37077. // ""
  37078. // ],
  37079. // "location": "query",
  37080. // "type": "string"
  37081. // },
  37082. // "placementStrategyIds": {
  37083. // "description": "Select only placements that are associated with these placement strategies.",
  37084. // "format": "int64",
  37085. // "location": "query",
  37086. // "repeated": true,
  37087. // "type": "string"
  37088. // },
  37089. // "pricingTypes": {
  37090. // "description": "Select only placements with these pricing types.",
  37091. // "enum": [
  37092. // "PRICING_TYPE_CPA",
  37093. // "PRICING_TYPE_CPC",
  37094. // "PRICING_TYPE_CPM",
  37095. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  37096. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  37097. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  37098. // ],
  37099. // "enumDescriptions": [
  37100. // "",
  37101. // "",
  37102. // "",
  37103. // "",
  37104. // "",
  37105. // ""
  37106. // ],
  37107. // "location": "query",
  37108. // "repeated": true,
  37109. // "type": "string"
  37110. // },
  37111. // "profileId": {
  37112. // "description": "User profile ID associated with this request.",
  37113. // "format": "int64",
  37114. // "location": "path",
  37115. // "required": true,
  37116. // "type": "string"
  37117. // },
  37118. // "searchString": {
  37119. // "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\".",
  37120. // "location": "query",
  37121. // "type": "string"
  37122. // },
  37123. // "siteIds": {
  37124. // "description": "Select only placements that are associated with these sites.",
  37125. // "format": "int64",
  37126. // "location": "query",
  37127. // "repeated": true,
  37128. // "type": "string"
  37129. // },
  37130. // "sizeIds": {
  37131. // "description": "Select only placements that are associated with these sizes.",
  37132. // "format": "int64",
  37133. // "location": "query",
  37134. // "repeated": true,
  37135. // "type": "string"
  37136. // },
  37137. // "sortField": {
  37138. // "default": "ID",
  37139. // "description": "Field by which to sort the list.",
  37140. // "enum": [
  37141. // "ID",
  37142. // "NAME"
  37143. // ],
  37144. // "enumDescriptions": [
  37145. // "",
  37146. // ""
  37147. // ],
  37148. // "location": "query",
  37149. // "type": "string"
  37150. // },
  37151. // "sortOrder": {
  37152. // "default": "ASCENDING",
  37153. // "description": "Order of sorted results.",
  37154. // "enum": [
  37155. // "ASCENDING",
  37156. // "DESCENDING"
  37157. // ],
  37158. // "enumDescriptions": [
  37159. // "",
  37160. // ""
  37161. // ],
  37162. // "location": "query",
  37163. // "type": "string"
  37164. // }
  37165. // },
  37166. // "path": "userprofiles/{profileId}/placements",
  37167. // "response": {
  37168. // "$ref": "PlacementsListResponse"
  37169. // },
  37170. // "scopes": [
  37171. // "https://www.googleapis.com/auth/dfatrafficking"
  37172. // ]
  37173. // }
  37174. }
  37175. // Pages invokes f for each page of results.
  37176. // A non-nil error returned from f will halt the iteration.
  37177. // The provided context supersedes any context provided to the Context method.
  37178. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  37179. c.ctx_ = ctx
  37180. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37181. for {
  37182. x, err := c.Do()
  37183. if err != nil {
  37184. return err
  37185. }
  37186. if err := f(x); err != nil {
  37187. return err
  37188. }
  37189. if x.NextPageToken == "" {
  37190. return nil
  37191. }
  37192. c.PageToken(x.NextPageToken)
  37193. }
  37194. }
  37195. // method id "dfareporting.placements.patch":
  37196. type PlacementsPatchCall struct {
  37197. s *Service
  37198. profileId int64
  37199. placement *Placement
  37200. urlParams_ gensupport.URLParams
  37201. ctx_ context.Context
  37202. header_ http.Header
  37203. }
  37204. // Patch: Updates an existing placement. This method supports patch
  37205. // semantics.
  37206. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  37207. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37208. c.profileId = profileId
  37209. c.urlParams_.Set("id", fmt.Sprint(id))
  37210. c.placement = placement
  37211. return c
  37212. }
  37213. // Fields allows partial responses to be retrieved. See
  37214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37215. // for more information.
  37216. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  37217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37218. return c
  37219. }
  37220. // Context sets the context to be used in this call's Do method. Any
  37221. // pending HTTP request will be aborted if the provided context is
  37222. // canceled.
  37223. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  37224. c.ctx_ = ctx
  37225. return c
  37226. }
  37227. // Header returns an http.Header that can be modified by the caller to
  37228. // add HTTP headers to the request.
  37229. func (c *PlacementsPatchCall) Header() http.Header {
  37230. if c.header_ == nil {
  37231. c.header_ = make(http.Header)
  37232. }
  37233. return c.header_
  37234. }
  37235. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  37236. reqHeaders := make(http.Header)
  37237. for k, v := range c.header_ {
  37238. reqHeaders[k] = v
  37239. }
  37240. reqHeaders.Set("User-Agent", c.s.userAgent())
  37241. var body io.Reader = nil
  37242. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  37243. if err != nil {
  37244. return nil, err
  37245. }
  37246. reqHeaders.Set("Content-Type", "application/json")
  37247. c.urlParams_.Set("alt", alt)
  37248. c.urlParams_.Set("prettyPrint", "false")
  37249. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  37250. urls += "?" + c.urlParams_.Encode()
  37251. req, err := http.NewRequest("PATCH", urls, body)
  37252. if err != nil {
  37253. return nil, err
  37254. }
  37255. req.Header = reqHeaders
  37256. googleapi.Expand(req.URL, map[string]string{
  37257. "profileId": strconv.FormatInt(c.profileId, 10),
  37258. })
  37259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37260. }
  37261. // Do executes the "dfareporting.placements.patch" call.
  37262. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  37263. // status code is an error. Response headers are in either
  37264. // *Placement.ServerResponse.Header or (if a response was returned at
  37265. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37266. // to check whether the returned error was because
  37267. // http.StatusNotModified was returned.
  37268. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  37269. gensupport.SetOptions(c.urlParams_, opts...)
  37270. res, err := c.doRequest("json")
  37271. if res != nil && res.StatusCode == http.StatusNotModified {
  37272. if res.Body != nil {
  37273. res.Body.Close()
  37274. }
  37275. return nil, &googleapi.Error{
  37276. Code: res.StatusCode,
  37277. Header: res.Header,
  37278. }
  37279. }
  37280. if err != nil {
  37281. return nil, err
  37282. }
  37283. defer googleapi.CloseBody(res)
  37284. if err := googleapi.CheckResponse(res); err != nil {
  37285. return nil, err
  37286. }
  37287. ret := &Placement{
  37288. ServerResponse: googleapi.ServerResponse{
  37289. Header: res.Header,
  37290. HTTPStatusCode: res.StatusCode,
  37291. },
  37292. }
  37293. target := &ret
  37294. if err := gensupport.DecodeResponse(target, res); err != nil {
  37295. return nil, err
  37296. }
  37297. return ret, nil
  37298. // {
  37299. // "description": "Updates an existing placement. This method supports patch semantics.",
  37300. // "httpMethod": "PATCH",
  37301. // "id": "dfareporting.placements.patch",
  37302. // "parameterOrder": [
  37303. // "profileId",
  37304. // "id"
  37305. // ],
  37306. // "parameters": {
  37307. // "id": {
  37308. // "description": "Placement ID.",
  37309. // "format": "int64",
  37310. // "location": "query",
  37311. // "required": true,
  37312. // "type": "string"
  37313. // },
  37314. // "profileId": {
  37315. // "description": "User profile ID associated with this request.",
  37316. // "format": "int64",
  37317. // "location": "path",
  37318. // "required": true,
  37319. // "type": "string"
  37320. // }
  37321. // },
  37322. // "path": "userprofiles/{profileId}/placements",
  37323. // "request": {
  37324. // "$ref": "Placement"
  37325. // },
  37326. // "response": {
  37327. // "$ref": "Placement"
  37328. // },
  37329. // "scopes": [
  37330. // "https://www.googleapis.com/auth/dfatrafficking"
  37331. // ]
  37332. // }
  37333. }
  37334. // method id "dfareporting.placements.update":
  37335. type PlacementsUpdateCall struct {
  37336. s *Service
  37337. profileId int64
  37338. placement *Placement
  37339. urlParams_ gensupport.URLParams
  37340. ctx_ context.Context
  37341. header_ http.Header
  37342. }
  37343. // Update: Updates an existing placement.
  37344. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  37345. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37346. c.profileId = profileId
  37347. c.placement = placement
  37348. return c
  37349. }
  37350. // Fields allows partial responses to be retrieved. See
  37351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37352. // for more information.
  37353. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  37354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37355. return c
  37356. }
  37357. // Context sets the context to be used in this call's Do method. Any
  37358. // pending HTTP request will be aborted if the provided context is
  37359. // canceled.
  37360. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  37361. c.ctx_ = ctx
  37362. return c
  37363. }
  37364. // Header returns an http.Header that can be modified by the caller to
  37365. // add HTTP headers to the request.
  37366. func (c *PlacementsUpdateCall) Header() http.Header {
  37367. if c.header_ == nil {
  37368. c.header_ = make(http.Header)
  37369. }
  37370. return c.header_
  37371. }
  37372. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  37373. reqHeaders := make(http.Header)
  37374. for k, v := range c.header_ {
  37375. reqHeaders[k] = v
  37376. }
  37377. reqHeaders.Set("User-Agent", c.s.userAgent())
  37378. var body io.Reader = nil
  37379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  37380. if err != nil {
  37381. return nil, err
  37382. }
  37383. reqHeaders.Set("Content-Type", "application/json")
  37384. c.urlParams_.Set("alt", alt)
  37385. c.urlParams_.Set("prettyPrint", "false")
  37386. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  37387. urls += "?" + c.urlParams_.Encode()
  37388. req, err := http.NewRequest("PUT", urls, body)
  37389. if err != nil {
  37390. return nil, err
  37391. }
  37392. req.Header = reqHeaders
  37393. googleapi.Expand(req.URL, map[string]string{
  37394. "profileId": strconv.FormatInt(c.profileId, 10),
  37395. })
  37396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37397. }
  37398. // Do executes the "dfareporting.placements.update" call.
  37399. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  37400. // status code is an error. Response headers are in either
  37401. // *Placement.ServerResponse.Header or (if a response was returned at
  37402. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37403. // to check whether the returned error was because
  37404. // http.StatusNotModified was returned.
  37405. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  37406. gensupport.SetOptions(c.urlParams_, opts...)
  37407. res, err := c.doRequest("json")
  37408. if res != nil && res.StatusCode == http.StatusNotModified {
  37409. if res.Body != nil {
  37410. res.Body.Close()
  37411. }
  37412. return nil, &googleapi.Error{
  37413. Code: res.StatusCode,
  37414. Header: res.Header,
  37415. }
  37416. }
  37417. if err != nil {
  37418. return nil, err
  37419. }
  37420. defer googleapi.CloseBody(res)
  37421. if err := googleapi.CheckResponse(res); err != nil {
  37422. return nil, err
  37423. }
  37424. ret := &Placement{
  37425. ServerResponse: googleapi.ServerResponse{
  37426. Header: res.Header,
  37427. HTTPStatusCode: res.StatusCode,
  37428. },
  37429. }
  37430. target := &ret
  37431. if err := gensupport.DecodeResponse(target, res); err != nil {
  37432. return nil, err
  37433. }
  37434. return ret, nil
  37435. // {
  37436. // "description": "Updates an existing placement.",
  37437. // "httpMethod": "PUT",
  37438. // "id": "dfareporting.placements.update",
  37439. // "parameterOrder": [
  37440. // "profileId"
  37441. // ],
  37442. // "parameters": {
  37443. // "profileId": {
  37444. // "description": "User profile ID associated with this request.",
  37445. // "format": "int64",
  37446. // "location": "path",
  37447. // "required": true,
  37448. // "type": "string"
  37449. // }
  37450. // },
  37451. // "path": "userprofiles/{profileId}/placements",
  37452. // "request": {
  37453. // "$ref": "Placement"
  37454. // },
  37455. // "response": {
  37456. // "$ref": "Placement"
  37457. // },
  37458. // "scopes": [
  37459. // "https://www.googleapis.com/auth/dfatrafficking"
  37460. // ]
  37461. // }
  37462. }
  37463. // method id "dfareporting.platformTypes.get":
  37464. type PlatformTypesGetCall struct {
  37465. s *Service
  37466. profileId int64
  37467. id int64
  37468. urlParams_ gensupport.URLParams
  37469. ifNoneMatch_ string
  37470. ctx_ context.Context
  37471. header_ http.Header
  37472. }
  37473. // Get: Gets one platform type by ID.
  37474. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  37475. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37476. c.profileId = profileId
  37477. c.id = id
  37478. return c
  37479. }
  37480. // Fields allows partial responses to be retrieved. See
  37481. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37482. // for more information.
  37483. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  37484. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37485. return c
  37486. }
  37487. // IfNoneMatch sets the optional parameter which makes the operation
  37488. // fail if the object's ETag matches the given value. This is useful for
  37489. // getting updates only after the object has changed since the last
  37490. // request. Use googleapi.IsNotModified to check whether the response
  37491. // error from Do is the result of In-None-Match.
  37492. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  37493. c.ifNoneMatch_ = entityTag
  37494. return c
  37495. }
  37496. // Context sets the context to be used in this call's Do method. Any
  37497. // pending HTTP request will be aborted if the provided context is
  37498. // canceled.
  37499. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  37500. c.ctx_ = ctx
  37501. return c
  37502. }
  37503. // Header returns an http.Header that can be modified by the caller to
  37504. // add HTTP headers to the request.
  37505. func (c *PlatformTypesGetCall) Header() http.Header {
  37506. if c.header_ == nil {
  37507. c.header_ = make(http.Header)
  37508. }
  37509. return c.header_
  37510. }
  37511. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  37512. reqHeaders := make(http.Header)
  37513. for k, v := range c.header_ {
  37514. reqHeaders[k] = v
  37515. }
  37516. reqHeaders.Set("User-Agent", c.s.userAgent())
  37517. if c.ifNoneMatch_ != "" {
  37518. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37519. }
  37520. var body io.Reader = nil
  37521. c.urlParams_.Set("alt", alt)
  37522. c.urlParams_.Set("prettyPrint", "false")
  37523. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  37524. urls += "?" + c.urlParams_.Encode()
  37525. req, err := http.NewRequest("GET", urls, body)
  37526. if err != nil {
  37527. return nil, err
  37528. }
  37529. req.Header = reqHeaders
  37530. googleapi.Expand(req.URL, map[string]string{
  37531. "profileId": strconv.FormatInt(c.profileId, 10),
  37532. "id": strconv.FormatInt(c.id, 10),
  37533. })
  37534. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37535. }
  37536. // Do executes the "dfareporting.platformTypes.get" call.
  37537. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  37538. // status code is an error. Response headers are in either
  37539. // *PlatformType.ServerResponse.Header or (if a response was returned at
  37540. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37541. // to check whether the returned error was because
  37542. // http.StatusNotModified was returned.
  37543. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  37544. gensupport.SetOptions(c.urlParams_, opts...)
  37545. res, err := c.doRequest("json")
  37546. if res != nil && res.StatusCode == http.StatusNotModified {
  37547. if res.Body != nil {
  37548. res.Body.Close()
  37549. }
  37550. return nil, &googleapi.Error{
  37551. Code: res.StatusCode,
  37552. Header: res.Header,
  37553. }
  37554. }
  37555. if err != nil {
  37556. return nil, err
  37557. }
  37558. defer googleapi.CloseBody(res)
  37559. if err := googleapi.CheckResponse(res); err != nil {
  37560. return nil, err
  37561. }
  37562. ret := &PlatformType{
  37563. ServerResponse: googleapi.ServerResponse{
  37564. Header: res.Header,
  37565. HTTPStatusCode: res.StatusCode,
  37566. },
  37567. }
  37568. target := &ret
  37569. if err := gensupport.DecodeResponse(target, res); err != nil {
  37570. return nil, err
  37571. }
  37572. return ret, nil
  37573. // {
  37574. // "description": "Gets one platform type by ID.",
  37575. // "httpMethod": "GET",
  37576. // "id": "dfareporting.platformTypes.get",
  37577. // "parameterOrder": [
  37578. // "profileId",
  37579. // "id"
  37580. // ],
  37581. // "parameters": {
  37582. // "id": {
  37583. // "description": "Platform type ID.",
  37584. // "format": "int64",
  37585. // "location": "path",
  37586. // "required": true,
  37587. // "type": "string"
  37588. // },
  37589. // "profileId": {
  37590. // "description": "User profile ID associated with this request.",
  37591. // "format": "int64",
  37592. // "location": "path",
  37593. // "required": true,
  37594. // "type": "string"
  37595. // }
  37596. // },
  37597. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  37598. // "response": {
  37599. // "$ref": "PlatformType"
  37600. // },
  37601. // "scopes": [
  37602. // "https://www.googleapis.com/auth/dfatrafficking"
  37603. // ]
  37604. // }
  37605. }
  37606. // method id "dfareporting.platformTypes.list":
  37607. type PlatformTypesListCall struct {
  37608. s *Service
  37609. profileId int64
  37610. urlParams_ gensupport.URLParams
  37611. ifNoneMatch_ string
  37612. ctx_ context.Context
  37613. header_ http.Header
  37614. }
  37615. // List: Retrieves a list of platform types.
  37616. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  37617. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37618. c.profileId = profileId
  37619. return c
  37620. }
  37621. // Fields allows partial responses to be retrieved. See
  37622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37623. // for more information.
  37624. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  37625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37626. return c
  37627. }
  37628. // IfNoneMatch sets the optional parameter which makes the operation
  37629. // fail if the object's ETag matches the given value. This is useful for
  37630. // getting updates only after the object has changed since the last
  37631. // request. Use googleapi.IsNotModified to check whether the response
  37632. // error from Do is the result of In-None-Match.
  37633. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  37634. c.ifNoneMatch_ = entityTag
  37635. return c
  37636. }
  37637. // Context sets the context to be used in this call's Do method. Any
  37638. // pending HTTP request will be aborted if the provided context is
  37639. // canceled.
  37640. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  37641. c.ctx_ = ctx
  37642. return c
  37643. }
  37644. // Header returns an http.Header that can be modified by the caller to
  37645. // add HTTP headers to the request.
  37646. func (c *PlatformTypesListCall) Header() http.Header {
  37647. if c.header_ == nil {
  37648. c.header_ = make(http.Header)
  37649. }
  37650. return c.header_
  37651. }
  37652. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  37653. reqHeaders := make(http.Header)
  37654. for k, v := range c.header_ {
  37655. reqHeaders[k] = v
  37656. }
  37657. reqHeaders.Set("User-Agent", c.s.userAgent())
  37658. if c.ifNoneMatch_ != "" {
  37659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37660. }
  37661. var body io.Reader = nil
  37662. c.urlParams_.Set("alt", alt)
  37663. c.urlParams_.Set("prettyPrint", "false")
  37664. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  37665. urls += "?" + c.urlParams_.Encode()
  37666. req, err := http.NewRequest("GET", urls, body)
  37667. if err != nil {
  37668. return nil, err
  37669. }
  37670. req.Header = reqHeaders
  37671. googleapi.Expand(req.URL, map[string]string{
  37672. "profileId": strconv.FormatInt(c.profileId, 10),
  37673. })
  37674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37675. }
  37676. // Do executes the "dfareporting.platformTypes.list" call.
  37677. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  37678. // Any non-2xx status code is an error. Response headers are in either
  37679. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  37680. // was returned at all) in error.(*googleapi.Error).Header. Use
  37681. // googleapi.IsNotModified to check whether the returned error was
  37682. // because http.StatusNotModified was returned.
  37683. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  37684. gensupport.SetOptions(c.urlParams_, opts...)
  37685. res, err := c.doRequest("json")
  37686. if res != nil && res.StatusCode == http.StatusNotModified {
  37687. if res.Body != nil {
  37688. res.Body.Close()
  37689. }
  37690. return nil, &googleapi.Error{
  37691. Code: res.StatusCode,
  37692. Header: res.Header,
  37693. }
  37694. }
  37695. if err != nil {
  37696. return nil, err
  37697. }
  37698. defer googleapi.CloseBody(res)
  37699. if err := googleapi.CheckResponse(res); err != nil {
  37700. return nil, err
  37701. }
  37702. ret := &PlatformTypesListResponse{
  37703. ServerResponse: googleapi.ServerResponse{
  37704. Header: res.Header,
  37705. HTTPStatusCode: res.StatusCode,
  37706. },
  37707. }
  37708. target := &ret
  37709. if err := gensupport.DecodeResponse(target, res); err != nil {
  37710. return nil, err
  37711. }
  37712. return ret, nil
  37713. // {
  37714. // "description": "Retrieves a list of platform types.",
  37715. // "httpMethod": "GET",
  37716. // "id": "dfareporting.platformTypes.list",
  37717. // "parameterOrder": [
  37718. // "profileId"
  37719. // ],
  37720. // "parameters": {
  37721. // "profileId": {
  37722. // "description": "User profile ID associated with this request.",
  37723. // "format": "int64",
  37724. // "location": "path",
  37725. // "required": true,
  37726. // "type": "string"
  37727. // }
  37728. // },
  37729. // "path": "userprofiles/{profileId}/platformTypes",
  37730. // "response": {
  37731. // "$ref": "PlatformTypesListResponse"
  37732. // },
  37733. // "scopes": [
  37734. // "https://www.googleapis.com/auth/dfatrafficking"
  37735. // ]
  37736. // }
  37737. }
  37738. // method id "dfareporting.postalCodes.get":
  37739. type PostalCodesGetCall struct {
  37740. s *Service
  37741. profileId int64
  37742. code string
  37743. urlParams_ gensupport.URLParams
  37744. ifNoneMatch_ string
  37745. ctx_ context.Context
  37746. header_ http.Header
  37747. }
  37748. // Get: Gets one postal code by ID.
  37749. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  37750. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37751. c.profileId = profileId
  37752. c.code = code
  37753. return c
  37754. }
  37755. // Fields allows partial responses to be retrieved. See
  37756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37757. // for more information.
  37758. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  37759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37760. return c
  37761. }
  37762. // IfNoneMatch sets the optional parameter which makes the operation
  37763. // fail if the object's ETag matches the given value. This is useful for
  37764. // getting updates only after the object has changed since the last
  37765. // request. Use googleapi.IsNotModified to check whether the response
  37766. // error from Do is the result of In-None-Match.
  37767. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  37768. c.ifNoneMatch_ = entityTag
  37769. return c
  37770. }
  37771. // Context sets the context to be used in this call's Do method. Any
  37772. // pending HTTP request will be aborted if the provided context is
  37773. // canceled.
  37774. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  37775. c.ctx_ = ctx
  37776. return c
  37777. }
  37778. // Header returns an http.Header that can be modified by the caller to
  37779. // add HTTP headers to the request.
  37780. func (c *PostalCodesGetCall) Header() http.Header {
  37781. if c.header_ == nil {
  37782. c.header_ = make(http.Header)
  37783. }
  37784. return c.header_
  37785. }
  37786. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  37787. reqHeaders := make(http.Header)
  37788. for k, v := range c.header_ {
  37789. reqHeaders[k] = v
  37790. }
  37791. reqHeaders.Set("User-Agent", c.s.userAgent())
  37792. if c.ifNoneMatch_ != "" {
  37793. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37794. }
  37795. var body io.Reader = nil
  37796. c.urlParams_.Set("alt", alt)
  37797. c.urlParams_.Set("prettyPrint", "false")
  37798. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  37799. urls += "?" + c.urlParams_.Encode()
  37800. req, err := http.NewRequest("GET", urls, body)
  37801. if err != nil {
  37802. return nil, err
  37803. }
  37804. req.Header = reqHeaders
  37805. googleapi.Expand(req.URL, map[string]string{
  37806. "profileId": strconv.FormatInt(c.profileId, 10),
  37807. "code": c.code,
  37808. })
  37809. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37810. }
  37811. // Do executes the "dfareporting.postalCodes.get" call.
  37812. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  37813. // status code is an error. Response headers are in either
  37814. // *PostalCode.ServerResponse.Header or (if a response was returned at
  37815. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37816. // to check whether the returned error was because
  37817. // http.StatusNotModified was returned.
  37818. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  37819. gensupport.SetOptions(c.urlParams_, opts...)
  37820. res, err := c.doRequest("json")
  37821. if res != nil && res.StatusCode == http.StatusNotModified {
  37822. if res.Body != nil {
  37823. res.Body.Close()
  37824. }
  37825. return nil, &googleapi.Error{
  37826. Code: res.StatusCode,
  37827. Header: res.Header,
  37828. }
  37829. }
  37830. if err != nil {
  37831. return nil, err
  37832. }
  37833. defer googleapi.CloseBody(res)
  37834. if err := googleapi.CheckResponse(res); err != nil {
  37835. return nil, err
  37836. }
  37837. ret := &PostalCode{
  37838. ServerResponse: googleapi.ServerResponse{
  37839. Header: res.Header,
  37840. HTTPStatusCode: res.StatusCode,
  37841. },
  37842. }
  37843. target := &ret
  37844. if err := gensupport.DecodeResponse(target, res); err != nil {
  37845. return nil, err
  37846. }
  37847. return ret, nil
  37848. // {
  37849. // "description": "Gets one postal code by ID.",
  37850. // "httpMethod": "GET",
  37851. // "id": "dfareporting.postalCodes.get",
  37852. // "parameterOrder": [
  37853. // "profileId",
  37854. // "code"
  37855. // ],
  37856. // "parameters": {
  37857. // "code": {
  37858. // "description": "Postal code ID.",
  37859. // "location": "path",
  37860. // "required": true,
  37861. // "type": "string"
  37862. // },
  37863. // "profileId": {
  37864. // "description": "User profile ID associated with this request.",
  37865. // "format": "int64",
  37866. // "location": "path",
  37867. // "required": true,
  37868. // "type": "string"
  37869. // }
  37870. // },
  37871. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  37872. // "response": {
  37873. // "$ref": "PostalCode"
  37874. // },
  37875. // "scopes": [
  37876. // "https://www.googleapis.com/auth/dfatrafficking"
  37877. // ]
  37878. // }
  37879. }
  37880. // method id "dfareporting.postalCodes.list":
  37881. type PostalCodesListCall struct {
  37882. s *Service
  37883. profileId int64
  37884. urlParams_ gensupport.URLParams
  37885. ifNoneMatch_ string
  37886. ctx_ context.Context
  37887. header_ http.Header
  37888. }
  37889. // List: Retrieves a list of postal codes.
  37890. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  37891. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37892. c.profileId = profileId
  37893. return c
  37894. }
  37895. // Fields allows partial responses to be retrieved. See
  37896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37897. // for more information.
  37898. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  37899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37900. return c
  37901. }
  37902. // IfNoneMatch sets the optional parameter which makes the operation
  37903. // fail if the object's ETag matches the given value. This is useful for
  37904. // getting updates only after the object has changed since the last
  37905. // request. Use googleapi.IsNotModified to check whether the response
  37906. // error from Do is the result of In-None-Match.
  37907. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  37908. c.ifNoneMatch_ = entityTag
  37909. return c
  37910. }
  37911. // Context sets the context to be used in this call's Do method. Any
  37912. // pending HTTP request will be aborted if the provided context is
  37913. // canceled.
  37914. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  37915. c.ctx_ = ctx
  37916. return c
  37917. }
  37918. // Header returns an http.Header that can be modified by the caller to
  37919. // add HTTP headers to the request.
  37920. func (c *PostalCodesListCall) Header() http.Header {
  37921. if c.header_ == nil {
  37922. c.header_ = make(http.Header)
  37923. }
  37924. return c.header_
  37925. }
  37926. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  37927. reqHeaders := make(http.Header)
  37928. for k, v := range c.header_ {
  37929. reqHeaders[k] = v
  37930. }
  37931. reqHeaders.Set("User-Agent", c.s.userAgent())
  37932. if c.ifNoneMatch_ != "" {
  37933. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37934. }
  37935. var body io.Reader = nil
  37936. c.urlParams_.Set("alt", alt)
  37937. c.urlParams_.Set("prettyPrint", "false")
  37938. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  37939. urls += "?" + c.urlParams_.Encode()
  37940. req, err := http.NewRequest("GET", urls, body)
  37941. if err != nil {
  37942. return nil, err
  37943. }
  37944. req.Header = reqHeaders
  37945. googleapi.Expand(req.URL, map[string]string{
  37946. "profileId": strconv.FormatInt(c.profileId, 10),
  37947. })
  37948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37949. }
  37950. // Do executes the "dfareporting.postalCodes.list" call.
  37951. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  37952. // non-2xx status code is an error. Response headers are in either
  37953. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  37954. // returned at all) in error.(*googleapi.Error).Header. Use
  37955. // googleapi.IsNotModified to check whether the returned error was
  37956. // because http.StatusNotModified was returned.
  37957. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  37958. gensupport.SetOptions(c.urlParams_, opts...)
  37959. res, err := c.doRequest("json")
  37960. if res != nil && res.StatusCode == http.StatusNotModified {
  37961. if res.Body != nil {
  37962. res.Body.Close()
  37963. }
  37964. return nil, &googleapi.Error{
  37965. Code: res.StatusCode,
  37966. Header: res.Header,
  37967. }
  37968. }
  37969. if err != nil {
  37970. return nil, err
  37971. }
  37972. defer googleapi.CloseBody(res)
  37973. if err := googleapi.CheckResponse(res); err != nil {
  37974. return nil, err
  37975. }
  37976. ret := &PostalCodesListResponse{
  37977. ServerResponse: googleapi.ServerResponse{
  37978. Header: res.Header,
  37979. HTTPStatusCode: res.StatusCode,
  37980. },
  37981. }
  37982. target := &ret
  37983. if err := gensupport.DecodeResponse(target, res); err != nil {
  37984. return nil, err
  37985. }
  37986. return ret, nil
  37987. // {
  37988. // "description": "Retrieves a list of postal codes.",
  37989. // "httpMethod": "GET",
  37990. // "id": "dfareporting.postalCodes.list",
  37991. // "parameterOrder": [
  37992. // "profileId"
  37993. // ],
  37994. // "parameters": {
  37995. // "profileId": {
  37996. // "description": "User profile ID associated with this request.",
  37997. // "format": "int64",
  37998. // "location": "path",
  37999. // "required": true,
  38000. // "type": "string"
  38001. // }
  38002. // },
  38003. // "path": "userprofiles/{profileId}/postalCodes",
  38004. // "response": {
  38005. // "$ref": "PostalCodesListResponse"
  38006. // },
  38007. // "scopes": [
  38008. // "https://www.googleapis.com/auth/dfatrafficking"
  38009. // ]
  38010. // }
  38011. }
  38012. // method id "dfareporting.projects.get":
  38013. type ProjectsGetCall struct {
  38014. s *Service
  38015. profileId int64
  38016. id int64
  38017. urlParams_ gensupport.URLParams
  38018. ifNoneMatch_ string
  38019. ctx_ context.Context
  38020. header_ http.Header
  38021. }
  38022. // Get: Gets one project by ID.
  38023. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  38024. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38025. c.profileId = profileId
  38026. c.id = id
  38027. return c
  38028. }
  38029. // Fields allows partial responses to be retrieved. See
  38030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38031. // for more information.
  38032. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  38033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38034. return c
  38035. }
  38036. // IfNoneMatch sets the optional parameter which makes the operation
  38037. // fail if the object's ETag matches the given value. This is useful for
  38038. // getting updates only after the object has changed since the last
  38039. // request. Use googleapi.IsNotModified to check whether the response
  38040. // error from Do is the result of In-None-Match.
  38041. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  38042. c.ifNoneMatch_ = entityTag
  38043. return c
  38044. }
  38045. // Context sets the context to be used in this call's Do method. Any
  38046. // pending HTTP request will be aborted if the provided context is
  38047. // canceled.
  38048. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  38049. c.ctx_ = ctx
  38050. return c
  38051. }
  38052. // Header returns an http.Header that can be modified by the caller to
  38053. // add HTTP headers to the request.
  38054. func (c *ProjectsGetCall) Header() http.Header {
  38055. if c.header_ == nil {
  38056. c.header_ = make(http.Header)
  38057. }
  38058. return c.header_
  38059. }
  38060. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  38061. reqHeaders := make(http.Header)
  38062. for k, v := range c.header_ {
  38063. reqHeaders[k] = v
  38064. }
  38065. reqHeaders.Set("User-Agent", c.s.userAgent())
  38066. if c.ifNoneMatch_ != "" {
  38067. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38068. }
  38069. var body io.Reader = nil
  38070. c.urlParams_.Set("alt", alt)
  38071. c.urlParams_.Set("prettyPrint", "false")
  38072. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  38073. urls += "?" + c.urlParams_.Encode()
  38074. req, err := http.NewRequest("GET", urls, body)
  38075. if err != nil {
  38076. return nil, err
  38077. }
  38078. req.Header = reqHeaders
  38079. googleapi.Expand(req.URL, map[string]string{
  38080. "profileId": strconv.FormatInt(c.profileId, 10),
  38081. "id": strconv.FormatInt(c.id, 10),
  38082. })
  38083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38084. }
  38085. // Do executes the "dfareporting.projects.get" call.
  38086. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  38087. // code is an error. Response headers are in either
  38088. // *Project.ServerResponse.Header or (if a response was returned at all)
  38089. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38090. // check whether the returned error was because http.StatusNotModified
  38091. // was returned.
  38092. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  38093. gensupport.SetOptions(c.urlParams_, opts...)
  38094. res, err := c.doRequest("json")
  38095. if res != nil && res.StatusCode == http.StatusNotModified {
  38096. if res.Body != nil {
  38097. res.Body.Close()
  38098. }
  38099. return nil, &googleapi.Error{
  38100. Code: res.StatusCode,
  38101. Header: res.Header,
  38102. }
  38103. }
  38104. if err != nil {
  38105. return nil, err
  38106. }
  38107. defer googleapi.CloseBody(res)
  38108. if err := googleapi.CheckResponse(res); err != nil {
  38109. return nil, err
  38110. }
  38111. ret := &Project{
  38112. ServerResponse: googleapi.ServerResponse{
  38113. Header: res.Header,
  38114. HTTPStatusCode: res.StatusCode,
  38115. },
  38116. }
  38117. target := &ret
  38118. if err := gensupport.DecodeResponse(target, res); err != nil {
  38119. return nil, err
  38120. }
  38121. return ret, nil
  38122. // {
  38123. // "description": "Gets one project by ID.",
  38124. // "httpMethod": "GET",
  38125. // "id": "dfareporting.projects.get",
  38126. // "parameterOrder": [
  38127. // "profileId",
  38128. // "id"
  38129. // ],
  38130. // "parameters": {
  38131. // "id": {
  38132. // "description": "Project ID.",
  38133. // "format": "int64",
  38134. // "location": "path",
  38135. // "required": true,
  38136. // "type": "string"
  38137. // },
  38138. // "profileId": {
  38139. // "description": "User profile ID associated with this request.",
  38140. // "format": "int64",
  38141. // "location": "path",
  38142. // "required": true,
  38143. // "type": "string"
  38144. // }
  38145. // },
  38146. // "path": "userprofiles/{profileId}/projects/{id}",
  38147. // "response": {
  38148. // "$ref": "Project"
  38149. // },
  38150. // "scopes": [
  38151. // "https://www.googleapis.com/auth/dfatrafficking"
  38152. // ]
  38153. // }
  38154. }
  38155. // method id "dfareporting.projects.list":
  38156. type ProjectsListCall struct {
  38157. s *Service
  38158. profileId int64
  38159. urlParams_ gensupport.URLParams
  38160. ifNoneMatch_ string
  38161. ctx_ context.Context
  38162. header_ http.Header
  38163. }
  38164. // List: Retrieves a list of projects, possibly filtered. This method
  38165. // supports paging.
  38166. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  38167. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38168. c.profileId = profileId
  38169. return c
  38170. }
  38171. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  38172. // only projects with these advertiser IDs.
  38173. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  38174. var advertiserIds_ []string
  38175. for _, v := range advertiserIds {
  38176. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  38177. }
  38178. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  38179. return c
  38180. }
  38181. // Ids sets the optional parameter "ids": Select only projects with
  38182. // these IDs.
  38183. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  38184. var ids_ []string
  38185. for _, v := range ids {
  38186. ids_ = append(ids_, fmt.Sprint(v))
  38187. }
  38188. c.urlParams_.SetMulti("ids", ids_)
  38189. return c
  38190. }
  38191. // MaxResults sets the optional parameter "maxResults": Maximum number
  38192. // of results to return.
  38193. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  38194. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38195. return c
  38196. }
  38197. // PageToken sets the optional parameter "pageToken": Value of the
  38198. // nextPageToken from the previous result page.
  38199. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  38200. c.urlParams_.Set("pageToken", pageToken)
  38201. return c
  38202. }
  38203. // SearchString sets the optional parameter "searchString": Allows
  38204. // searching for projects by name or ID. Wildcards (*) are allowed. For
  38205. // example, "project*2015" will return projects with names like "project
  38206. // June 2015", "project April 2015", or simply "project 2015". Most of
  38207. // the searches also add wildcards implicitly at the start and the end
  38208. // of the search string. For example, a search string of "project" will
  38209. // match projects with name "my project", "project 2015", or simply
  38210. // "project".
  38211. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  38212. c.urlParams_.Set("searchString", searchString)
  38213. return c
  38214. }
  38215. // SortField sets the optional parameter "sortField": Field by which to
  38216. // sort the list.
  38217. //
  38218. // Possible values:
  38219. // "ID" (default)
  38220. // "NAME"
  38221. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  38222. c.urlParams_.Set("sortField", sortField)
  38223. return c
  38224. }
  38225. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38226. // results.
  38227. //
  38228. // Possible values:
  38229. // "ASCENDING" (default)
  38230. // "DESCENDING"
  38231. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  38232. c.urlParams_.Set("sortOrder", sortOrder)
  38233. return c
  38234. }
  38235. // Fields allows partial responses to be retrieved. See
  38236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38237. // for more information.
  38238. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  38239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38240. return c
  38241. }
  38242. // IfNoneMatch sets the optional parameter which makes the operation
  38243. // fail if the object's ETag matches the given value. This is useful for
  38244. // getting updates only after the object has changed since the last
  38245. // request. Use googleapi.IsNotModified to check whether the response
  38246. // error from Do is the result of In-None-Match.
  38247. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  38248. c.ifNoneMatch_ = entityTag
  38249. return c
  38250. }
  38251. // Context sets the context to be used in this call's Do method. Any
  38252. // pending HTTP request will be aborted if the provided context is
  38253. // canceled.
  38254. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  38255. c.ctx_ = ctx
  38256. return c
  38257. }
  38258. // Header returns an http.Header that can be modified by the caller to
  38259. // add HTTP headers to the request.
  38260. func (c *ProjectsListCall) Header() http.Header {
  38261. if c.header_ == nil {
  38262. c.header_ = make(http.Header)
  38263. }
  38264. return c.header_
  38265. }
  38266. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  38267. reqHeaders := make(http.Header)
  38268. for k, v := range c.header_ {
  38269. reqHeaders[k] = v
  38270. }
  38271. reqHeaders.Set("User-Agent", c.s.userAgent())
  38272. if c.ifNoneMatch_ != "" {
  38273. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38274. }
  38275. var body io.Reader = nil
  38276. c.urlParams_.Set("alt", alt)
  38277. c.urlParams_.Set("prettyPrint", "false")
  38278. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  38279. urls += "?" + c.urlParams_.Encode()
  38280. req, err := http.NewRequest("GET", urls, body)
  38281. if err != nil {
  38282. return nil, err
  38283. }
  38284. req.Header = reqHeaders
  38285. googleapi.Expand(req.URL, map[string]string{
  38286. "profileId": strconv.FormatInt(c.profileId, 10),
  38287. })
  38288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38289. }
  38290. // Do executes the "dfareporting.projects.list" call.
  38291. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  38292. // non-2xx status code is an error. Response headers are in either
  38293. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  38294. // returned at all) in error.(*googleapi.Error).Header. Use
  38295. // googleapi.IsNotModified to check whether the returned error was
  38296. // because http.StatusNotModified was returned.
  38297. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  38298. gensupport.SetOptions(c.urlParams_, opts...)
  38299. res, err := c.doRequest("json")
  38300. if res != nil && res.StatusCode == http.StatusNotModified {
  38301. if res.Body != nil {
  38302. res.Body.Close()
  38303. }
  38304. return nil, &googleapi.Error{
  38305. Code: res.StatusCode,
  38306. Header: res.Header,
  38307. }
  38308. }
  38309. if err != nil {
  38310. return nil, err
  38311. }
  38312. defer googleapi.CloseBody(res)
  38313. if err := googleapi.CheckResponse(res); err != nil {
  38314. return nil, err
  38315. }
  38316. ret := &ProjectsListResponse{
  38317. ServerResponse: googleapi.ServerResponse{
  38318. Header: res.Header,
  38319. HTTPStatusCode: res.StatusCode,
  38320. },
  38321. }
  38322. target := &ret
  38323. if err := gensupport.DecodeResponse(target, res); err != nil {
  38324. return nil, err
  38325. }
  38326. return ret, nil
  38327. // {
  38328. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  38329. // "httpMethod": "GET",
  38330. // "id": "dfareporting.projects.list",
  38331. // "parameterOrder": [
  38332. // "profileId"
  38333. // ],
  38334. // "parameters": {
  38335. // "advertiserIds": {
  38336. // "description": "Select only projects with these advertiser IDs.",
  38337. // "format": "int64",
  38338. // "location": "query",
  38339. // "repeated": true,
  38340. // "type": "string"
  38341. // },
  38342. // "ids": {
  38343. // "description": "Select only projects with these IDs.",
  38344. // "format": "int64",
  38345. // "location": "query",
  38346. // "repeated": true,
  38347. // "type": "string"
  38348. // },
  38349. // "maxResults": {
  38350. // "default": "1000",
  38351. // "description": "Maximum number of results to return.",
  38352. // "format": "int32",
  38353. // "location": "query",
  38354. // "maximum": "1000",
  38355. // "minimum": "0",
  38356. // "type": "integer"
  38357. // },
  38358. // "pageToken": {
  38359. // "description": "Value of the nextPageToken from the previous result page.",
  38360. // "location": "query",
  38361. // "type": "string"
  38362. // },
  38363. // "profileId": {
  38364. // "description": "User profile ID associated with this request.",
  38365. // "format": "int64",
  38366. // "location": "path",
  38367. // "required": true,
  38368. // "type": "string"
  38369. // },
  38370. // "searchString": {
  38371. // "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\".",
  38372. // "location": "query",
  38373. // "type": "string"
  38374. // },
  38375. // "sortField": {
  38376. // "default": "ID",
  38377. // "description": "Field by which to sort the list.",
  38378. // "enum": [
  38379. // "ID",
  38380. // "NAME"
  38381. // ],
  38382. // "enumDescriptions": [
  38383. // "",
  38384. // ""
  38385. // ],
  38386. // "location": "query",
  38387. // "type": "string"
  38388. // },
  38389. // "sortOrder": {
  38390. // "default": "ASCENDING",
  38391. // "description": "Order of sorted results.",
  38392. // "enum": [
  38393. // "ASCENDING",
  38394. // "DESCENDING"
  38395. // ],
  38396. // "enumDescriptions": [
  38397. // "",
  38398. // ""
  38399. // ],
  38400. // "location": "query",
  38401. // "type": "string"
  38402. // }
  38403. // },
  38404. // "path": "userprofiles/{profileId}/projects",
  38405. // "response": {
  38406. // "$ref": "ProjectsListResponse"
  38407. // },
  38408. // "scopes": [
  38409. // "https://www.googleapis.com/auth/dfatrafficking"
  38410. // ]
  38411. // }
  38412. }
  38413. // Pages invokes f for each page of results.
  38414. // A non-nil error returned from f will halt the iteration.
  38415. // The provided context supersedes any context provided to the Context method.
  38416. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  38417. c.ctx_ = ctx
  38418. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38419. for {
  38420. x, err := c.Do()
  38421. if err != nil {
  38422. return err
  38423. }
  38424. if err := f(x); err != nil {
  38425. return err
  38426. }
  38427. if x.NextPageToken == "" {
  38428. return nil
  38429. }
  38430. c.PageToken(x.NextPageToken)
  38431. }
  38432. }
  38433. // method id "dfareporting.regions.list":
  38434. type RegionsListCall struct {
  38435. s *Service
  38436. profileId int64
  38437. urlParams_ gensupport.URLParams
  38438. ifNoneMatch_ string
  38439. ctx_ context.Context
  38440. header_ http.Header
  38441. }
  38442. // List: Retrieves a list of regions.
  38443. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  38444. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38445. c.profileId = profileId
  38446. return c
  38447. }
  38448. // Fields allows partial responses to be retrieved. See
  38449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38450. // for more information.
  38451. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  38452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38453. return c
  38454. }
  38455. // IfNoneMatch sets the optional parameter which makes the operation
  38456. // fail if the object's ETag matches the given value. This is useful for
  38457. // getting updates only after the object has changed since the last
  38458. // request. Use googleapi.IsNotModified to check whether the response
  38459. // error from Do is the result of In-None-Match.
  38460. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  38461. c.ifNoneMatch_ = entityTag
  38462. return c
  38463. }
  38464. // Context sets the context to be used in this call's Do method. Any
  38465. // pending HTTP request will be aborted if the provided context is
  38466. // canceled.
  38467. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  38468. c.ctx_ = ctx
  38469. return c
  38470. }
  38471. // Header returns an http.Header that can be modified by the caller to
  38472. // add HTTP headers to the request.
  38473. func (c *RegionsListCall) Header() http.Header {
  38474. if c.header_ == nil {
  38475. c.header_ = make(http.Header)
  38476. }
  38477. return c.header_
  38478. }
  38479. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  38480. reqHeaders := make(http.Header)
  38481. for k, v := range c.header_ {
  38482. reqHeaders[k] = v
  38483. }
  38484. reqHeaders.Set("User-Agent", c.s.userAgent())
  38485. if c.ifNoneMatch_ != "" {
  38486. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38487. }
  38488. var body io.Reader = nil
  38489. c.urlParams_.Set("alt", alt)
  38490. c.urlParams_.Set("prettyPrint", "false")
  38491. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  38492. urls += "?" + c.urlParams_.Encode()
  38493. req, err := http.NewRequest("GET", urls, body)
  38494. if err != nil {
  38495. return nil, err
  38496. }
  38497. req.Header = reqHeaders
  38498. googleapi.Expand(req.URL, map[string]string{
  38499. "profileId": strconv.FormatInt(c.profileId, 10),
  38500. })
  38501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38502. }
  38503. // Do executes the "dfareporting.regions.list" call.
  38504. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  38505. // non-2xx status code is an error. Response headers are in either
  38506. // *RegionsListResponse.ServerResponse.Header or (if a response was
  38507. // returned at all) in error.(*googleapi.Error).Header. Use
  38508. // googleapi.IsNotModified to check whether the returned error was
  38509. // because http.StatusNotModified was returned.
  38510. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  38511. gensupport.SetOptions(c.urlParams_, opts...)
  38512. res, err := c.doRequest("json")
  38513. if res != nil && res.StatusCode == http.StatusNotModified {
  38514. if res.Body != nil {
  38515. res.Body.Close()
  38516. }
  38517. return nil, &googleapi.Error{
  38518. Code: res.StatusCode,
  38519. Header: res.Header,
  38520. }
  38521. }
  38522. if err != nil {
  38523. return nil, err
  38524. }
  38525. defer googleapi.CloseBody(res)
  38526. if err := googleapi.CheckResponse(res); err != nil {
  38527. return nil, err
  38528. }
  38529. ret := &RegionsListResponse{
  38530. ServerResponse: googleapi.ServerResponse{
  38531. Header: res.Header,
  38532. HTTPStatusCode: res.StatusCode,
  38533. },
  38534. }
  38535. target := &ret
  38536. if err := gensupport.DecodeResponse(target, res); err != nil {
  38537. return nil, err
  38538. }
  38539. return ret, nil
  38540. // {
  38541. // "description": "Retrieves a list of regions.",
  38542. // "httpMethod": "GET",
  38543. // "id": "dfareporting.regions.list",
  38544. // "parameterOrder": [
  38545. // "profileId"
  38546. // ],
  38547. // "parameters": {
  38548. // "profileId": {
  38549. // "description": "User profile ID associated with this request.",
  38550. // "format": "int64",
  38551. // "location": "path",
  38552. // "required": true,
  38553. // "type": "string"
  38554. // }
  38555. // },
  38556. // "path": "userprofiles/{profileId}/regions",
  38557. // "response": {
  38558. // "$ref": "RegionsListResponse"
  38559. // },
  38560. // "scopes": [
  38561. // "https://www.googleapis.com/auth/dfatrafficking"
  38562. // ]
  38563. // }
  38564. }
  38565. // method id "dfareporting.remarketingListShares.get":
  38566. type RemarketingListSharesGetCall struct {
  38567. s *Service
  38568. profileId int64
  38569. remarketingListId int64
  38570. urlParams_ gensupport.URLParams
  38571. ifNoneMatch_ string
  38572. ctx_ context.Context
  38573. header_ http.Header
  38574. }
  38575. // Get: Gets one remarketing list share by remarketing list ID.
  38576. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  38577. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38578. c.profileId = profileId
  38579. c.remarketingListId = remarketingListId
  38580. return c
  38581. }
  38582. // Fields allows partial responses to be retrieved. See
  38583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38584. // for more information.
  38585. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  38586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38587. return c
  38588. }
  38589. // IfNoneMatch sets the optional parameter which makes the operation
  38590. // fail if the object's ETag matches the given value. This is useful for
  38591. // getting updates only after the object has changed since the last
  38592. // request. Use googleapi.IsNotModified to check whether the response
  38593. // error from Do is the result of In-None-Match.
  38594. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  38595. c.ifNoneMatch_ = entityTag
  38596. return c
  38597. }
  38598. // Context sets the context to be used in this call's Do method. Any
  38599. // pending HTTP request will be aborted if the provided context is
  38600. // canceled.
  38601. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  38602. c.ctx_ = ctx
  38603. return c
  38604. }
  38605. // Header returns an http.Header that can be modified by the caller to
  38606. // add HTTP headers to the request.
  38607. func (c *RemarketingListSharesGetCall) Header() http.Header {
  38608. if c.header_ == nil {
  38609. c.header_ = make(http.Header)
  38610. }
  38611. return c.header_
  38612. }
  38613. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  38614. reqHeaders := make(http.Header)
  38615. for k, v := range c.header_ {
  38616. reqHeaders[k] = v
  38617. }
  38618. reqHeaders.Set("User-Agent", c.s.userAgent())
  38619. if c.ifNoneMatch_ != "" {
  38620. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38621. }
  38622. var body io.Reader = nil
  38623. c.urlParams_.Set("alt", alt)
  38624. c.urlParams_.Set("prettyPrint", "false")
  38625. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  38626. urls += "?" + c.urlParams_.Encode()
  38627. req, err := http.NewRequest("GET", urls, body)
  38628. if err != nil {
  38629. return nil, err
  38630. }
  38631. req.Header = reqHeaders
  38632. googleapi.Expand(req.URL, map[string]string{
  38633. "profileId": strconv.FormatInt(c.profileId, 10),
  38634. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  38635. })
  38636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38637. }
  38638. // Do executes the "dfareporting.remarketingListShares.get" call.
  38639. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38640. // non-2xx status code is an error. Response headers are in either
  38641. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38642. // returned at all) in error.(*googleapi.Error).Header. Use
  38643. // googleapi.IsNotModified to check whether the returned error was
  38644. // because http.StatusNotModified was returned.
  38645. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38646. gensupport.SetOptions(c.urlParams_, opts...)
  38647. res, err := c.doRequest("json")
  38648. if res != nil && res.StatusCode == http.StatusNotModified {
  38649. if res.Body != nil {
  38650. res.Body.Close()
  38651. }
  38652. return nil, &googleapi.Error{
  38653. Code: res.StatusCode,
  38654. Header: res.Header,
  38655. }
  38656. }
  38657. if err != nil {
  38658. return nil, err
  38659. }
  38660. defer googleapi.CloseBody(res)
  38661. if err := googleapi.CheckResponse(res); err != nil {
  38662. return nil, err
  38663. }
  38664. ret := &RemarketingListShare{
  38665. ServerResponse: googleapi.ServerResponse{
  38666. Header: res.Header,
  38667. HTTPStatusCode: res.StatusCode,
  38668. },
  38669. }
  38670. target := &ret
  38671. if err := gensupport.DecodeResponse(target, res); err != nil {
  38672. return nil, err
  38673. }
  38674. return ret, nil
  38675. // {
  38676. // "description": "Gets one remarketing list share by remarketing list ID.",
  38677. // "httpMethod": "GET",
  38678. // "id": "dfareporting.remarketingListShares.get",
  38679. // "parameterOrder": [
  38680. // "profileId",
  38681. // "remarketingListId"
  38682. // ],
  38683. // "parameters": {
  38684. // "profileId": {
  38685. // "description": "User profile ID associated with this request.",
  38686. // "format": "int64",
  38687. // "location": "path",
  38688. // "required": true,
  38689. // "type": "string"
  38690. // },
  38691. // "remarketingListId": {
  38692. // "description": "Remarketing list ID.",
  38693. // "format": "int64",
  38694. // "location": "path",
  38695. // "required": true,
  38696. // "type": "string"
  38697. // }
  38698. // },
  38699. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  38700. // "response": {
  38701. // "$ref": "RemarketingListShare"
  38702. // },
  38703. // "scopes": [
  38704. // "https://www.googleapis.com/auth/dfatrafficking"
  38705. // ]
  38706. // }
  38707. }
  38708. // method id "dfareporting.remarketingListShares.patch":
  38709. type RemarketingListSharesPatchCall struct {
  38710. s *Service
  38711. profileId int64
  38712. remarketinglistshare *RemarketingListShare
  38713. urlParams_ gensupport.URLParams
  38714. ctx_ context.Context
  38715. header_ http.Header
  38716. }
  38717. // Patch: Updates an existing remarketing list share. This method
  38718. // supports patch semantics.
  38719. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  38720. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38721. c.profileId = profileId
  38722. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  38723. c.remarketinglistshare = remarketinglistshare
  38724. return c
  38725. }
  38726. // Fields allows partial responses to be retrieved. See
  38727. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38728. // for more information.
  38729. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  38730. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38731. return c
  38732. }
  38733. // Context sets the context to be used in this call's Do method. Any
  38734. // pending HTTP request will be aborted if the provided context is
  38735. // canceled.
  38736. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  38737. c.ctx_ = ctx
  38738. return c
  38739. }
  38740. // Header returns an http.Header that can be modified by the caller to
  38741. // add HTTP headers to the request.
  38742. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  38743. if c.header_ == nil {
  38744. c.header_ = make(http.Header)
  38745. }
  38746. return c.header_
  38747. }
  38748. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  38749. reqHeaders := make(http.Header)
  38750. for k, v := range c.header_ {
  38751. reqHeaders[k] = v
  38752. }
  38753. reqHeaders.Set("User-Agent", c.s.userAgent())
  38754. var body io.Reader = nil
  38755. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38756. if err != nil {
  38757. return nil, err
  38758. }
  38759. reqHeaders.Set("Content-Type", "application/json")
  38760. c.urlParams_.Set("alt", alt)
  38761. c.urlParams_.Set("prettyPrint", "false")
  38762. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38763. urls += "?" + c.urlParams_.Encode()
  38764. req, err := http.NewRequest("PATCH", urls, body)
  38765. if err != nil {
  38766. return nil, err
  38767. }
  38768. req.Header = reqHeaders
  38769. googleapi.Expand(req.URL, map[string]string{
  38770. "profileId": strconv.FormatInt(c.profileId, 10),
  38771. })
  38772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38773. }
  38774. // Do executes the "dfareporting.remarketingListShares.patch" call.
  38775. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38776. // non-2xx status code is an error. Response headers are in either
  38777. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38778. // returned at all) in error.(*googleapi.Error).Header. Use
  38779. // googleapi.IsNotModified to check whether the returned error was
  38780. // because http.StatusNotModified was returned.
  38781. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38782. gensupport.SetOptions(c.urlParams_, opts...)
  38783. res, err := c.doRequest("json")
  38784. if res != nil && res.StatusCode == http.StatusNotModified {
  38785. if res.Body != nil {
  38786. res.Body.Close()
  38787. }
  38788. return nil, &googleapi.Error{
  38789. Code: res.StatusCode,
  38790. Header: res.Header,
  38791. }
  38792. }
  38793. if err != nil {
  38794. return nil, err
  38795. }
  38796. defer googleapi.CloseBody(res)
  38797. if err := googleapi.CheckResponse(res); err != nil {
  38798. return nil, err
  38799. }
  38800. ret := &RemarketingListShare{
  38801. ServerResponse: googleapi.ServerResponse{
  38802. Header: res.Header,
  38803. HTTPStatusCode: res.StatusCode,
  38804. },
  38805. }
  38806. target := &ret
  38807. if err := gensupport.DecodeResponse(target, res); err != nil {
  38808. return nil, err
  38809. }
  38810. return ret, nil
  38811. // {
  38812. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  38813. // "httpMethod": "PATCH",
  38814. // "id": "dfareporting.remarketingListShares.patch",
  38815. // "parameterOrder": [
  38816. // "profileId",
  38817. // "remarketingListId"
  38818. // ],
  38819. // "parameters": {
  38820. // "profileId": {
  38821. // "description": "User profile ID associated with this request.",
  38822. // "format": "int64",
  38823. // "location": "path",
  38824. // "required": true,
  38825. // "type": "string"
  38826. // },
  38827. // "remarketingListId": {
  38828. // "description": "Remarketing list ID.",
  38829. // "format": "int64",
  38830. // "location": "query",
  38831. // "required": true,
  38832. // "type": "string"
  38833. // }
  38834. // },
  38835. // "path": "userprofiles/{profileId}/remarketingListShares",
  38836. // "request": {
  38837. // "$ref": "RemarketingListShare"
  38838. // },
  38839. // "response": {
  38840. // "$ref": "RemarketingListShare"
  38841. // },
  38842. // "scopes": [
  38843. // "https://www.googleapis.com/auth/dfatrafficking"
  38844. // ]
  38845. // }
  38846. }
  38847. // method id "dfareporting.remarketingListShares.update":
  38848. type RemarketingListSharesUpdateCall struct {
  38849. s *Service
  38850. profileId int64
  38851. remarketinglistshare *RemarketingListShare
  38852. urlParams_ gensupport.URLParams
  38853. ctx_ context.Context
  38854. header_ http.Header
  38855. }
  38856. // Update: Updates an existing remarketing list share.
  38857. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  38858. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38859. c.profileId = profileId
  38860. c.remarketinglistshare = remarketinglistshare
  38861. return c
  38862. }
  38863. // Fields allows partial responses to be retrieved. See
  38864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38865. // for more information.
  38866. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  38867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38868. return c
  38869. }
  38870. // Context sets the context to be used in this call's Do method. Any
  38871. // pending HTTP request will be aborted if the provided context is
  38872. // canceled.
  38873. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  38874. c.ctx_ = ctx
  38875. return c
  38876. }
  38877. // Header returns an http.Header that can be modified by the caller to
  38878. // add HTTP headers to the request.
  38879. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  38880. if c.header_ == nil {
  38881. c.header_ = make(http.Header)
  38882. }
  38883. return c.header_
  38884. }
  38885. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  38886. reqHeaders := make(http.Header)
  38887. for k, v := range c.header_ {
  38888. reqHeaders[k] = v
  38889. }
  38890. reqHeaders.Set("User-Agent", c.s.userAgent())
  38891. var body io.Reader = nil
  38892. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38893. if err != nil {
  38894. return nil, err
  38895. }
  38896. reqHeaders.Set("Content-Type", "application/json")
  38897. c.urlParams_.Set("alt", alt)
  38898. c.urlParams_.Set("prettyPrint", "false")
  38899. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38900. urls += "?" + c.urlParams_.Encode()
  38901. req, err := http.NewRequest("PUT", urls, body)
  38902. if err != nil {
  38903. return nil, err
  38904. }
  38905. req.Header = reqHeaders
  38906. googleapi.Expand(req.URL, map[string]string{
  38907. "profileId": strconv.FormatInt(c.profileId, 10),
  38908. })
  38909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38910. }
  38911. // Do executes the "dfareporting.remarketingListShares.update" call.
  38912. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38913. // non-2xx status code is an error. Response headers are in either
  38914. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38915. // returned at all) in error.(*googleapi.Error).Header. Use
  38916. // googleapi.IsNotModified to check whether the returned error was
  38917. // because http.StatusNotModified was returned.
  38918. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38919. gensupport.SetOptions(c.urlParams_, opts...)
  38920. res, err := c.doRequest("json")
  38921. if res != nil && res.StatusCode == http.StatusNotModified {
  38922. if res.Body != nil {
  38923. res.Body.Close()
  38924. }
  38925. return nil, &googleapi.Error{
  38926. Code: res.StatusCode,
  38927. Header: res.Header,
  38928. }
  38929. }
  38930. if err != nil {
  38931. return nil, err
  38932. }
  38933. defer googleapi.CloseBody(res)
  38934. if err := googleapi.CheckResponse(res); err != nil {
  38935. return nil, err
  38936. }
  38937. ret := &RemarketingListShare{
  38938. ServerResponse: googleapi.ServerResponse{
  38939. Header: res.Header,
  38940. HTTPStatusCode: res.StatusCode,
  38941. },
  38942. }
  38943. target := &ret
  38944. if err := gensupport.DecodeResponse(target, res); err != nil {
  38945. return nil, err
  38946. }
  38947. return ret, nil
  38948. // {
  38949. // "description": "Updates an existing remarketing list share.",
  38950. // "httpMethod": "PUT",
  38951. // "id": "dfareporting.remarketingListShares.update",
  38952. // "parameterOrder": [
  38953. // "profileId"
  38954. // ],
  38955. // "parameters": {
  38956. // "profileId": {
  38957. // "description": "User profile ID associated with this request.",
  38958. // "format": "int64",
  38959. // "location": "path",
  38960. // "required": true,
  38961. // "type": "string"
  38962. // }
  38963. // },
  38964. // "path": "userprofiles/{profileId}/remarketingListShares",
  38965. // "request": {
  38966. // "$ref": "RemarketingListShare"
  38967. // },
  38968. // "response": {
  38969. // "$ref": "RemarketingListShare"
  38970. // },
  38971. // "scopes": [
  38972. // "https://www.googleapis.com/auth/dfatrafficking"
  38973. // ]
  38974. // }
  38975. }
  38976. // method id "dfareporting.remarketingLists.get":
  38977. type RemarketingListsGetCall struct {
  38978. s *Service
  38979. profileId int64
  38980. id int64
  38981. urlParams_ gensupport.URLParams
  38982. ifNoneMatch_ string
  38983. ctx_ context.Context
  38984. header_ http.Header
  38985. }
  38986. // Get: Gets one remarketing list by ID.
  38987. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  38988. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38989. c.profileId = profileId
  38990. c.id = id
  38991. return c
  38992. }
  38993. // Fields allows partial responses to be retrieved. See
  38994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38995. // for more information.
  38996. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  38997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38998. return c
  38999. }
  39000. // IfNoneMatch sets the optional parameter which makes the operation
  39001. // fail if the object's ETag matches the given value. This is useful for
  39002. // getting updates only after the object has changed since the last
  39003. // request. Use googleapi.IsNotModified to check whether the response
  39004. // error from Do is the result of In-None-Match.
  39005. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  39006. c.ifNoneMatch_ = entityTag
  39007. return c
  39008. }
  39009. // Context sets the context to be used in this call's Do method. Any
  39010. // pending HTTP request will be aborted if the provided context is
  39011. // canceled.
  39012. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  39013. c.ctx_ = ctx
  39014. return c
  39015. }
  39016. // Header returns an http.Header that can be modified by the caller to
  39017. // add HTTP headers to the request.
  39018. func (c *RemarketingListsGetCall) Header() http.Header {
  39019. if c.header_ == nil {
  39020. c.header_ = make(http.Header)
  39021. }
  39022. return c.header_
  39023. }
  39024. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  39025. reqHeaders := make(http.Header)
  39026. for k, v := range c.header_ {
  39027. reqHeaders[k] = v
  39028. }
  39029. reqHeaders.Set("User-Agent", c.s.userAgent())
  39030. if c.ifNoneMatch_ != "" {
  39031. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39032. }
  39033. var body io.Reader = nil
  39034. c.urlParams_.Set("alt", alt)
  39035. c.urlParams_.Set("prettyPrint", "false")
  39036. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  39037. urls += "?" + c.urlParams_.Encode()
  39038. req, err := http.NewRequest("GET", urls, body)
  39039. if err != nil {
  39040. return nil, err
  39041. }
  39042. req.Header = reqHeaders
  39043. googleapi.Expand(req.URL, map[string]string{
  39044. "profileId": strconv.FormatInt(c.profileId, 10),
  39045. "id": strconv.FormatInt(c.id, 10),
  39046. })
  39047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39048. }
  39049. // Do executes the "dfareporting.remarketingLists.get" call.
  39050. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39051. // status code is an error. Response headers are in either
  39052. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39053. // at all) in error.(*googleapi.Error).Header. Use
  39054. // googleapi.IsNotModified to check whether the returned error was
  39055. // because http.StatusNotModified was returned.
  39056. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39057. gensupport.SetOptions(c.urlParams_, opts...)
  39058. res, err := c.doRequest("json")
  39059. if res != nil && res.StatusCode == http.StatusNotModified {
  39060. if res.Body != nil {
  39061. res.Body.Close()
  39062. }
  39063. return nil, &googleapi.Error{
  39064. Code: res.StatusCode,
  39065. Header: res.Header,
  39066. }
  39067. }
  39068. if err != nil {
  39069. return nil, err
  39070. }
  39071. defer googleapi.CloseBody(res)
  39072. if err := googleapi.CheckResponse(res); err != nil {
  39073. return nil, err
  39074. }
  39075. ret := &RemarketingList{
  39076. ServerResponse: googleapi.ServerResponse{
  39077. Header: res.Header,
  39078. HTTPStatusCode: res.StatusCode,
  39079. },
  39080. }
  39081. target := &ret
  39082. if err := gensupport.DecodeResponse(target, res); err != nil {
  39083. return nil, err
  39084. }
  39085. return ret, nil
  39086. // {
  39087. // "description": "Gets one remarketing list by ID.",
  39088. // "httpMethod": "GET",
  39089. // "id": "dfareporting.remarketingLists.get",
  39090. // "parameterOrder": [
  39091. // "profileId",
  39092. // "id"
  39093. // ],
  39094. // "parameters": {
  39095. // "id": {
  39096. // "description": "Remarketing list ID.",
  39097. // "format": "int64",
  39098. // "location": "path",
  39099. // "required": true,
  39100. // "type": "string"
  39101. // },
  39102. // "profileId": {
  39103. // "description": "User profile ID associated with this request.",
  39104. // "format": "int64",
  39105. // "location": "path",
  39106. // "required": true,
  39107. // "type": "string"
  39108. // }
  39109. // },
  39110. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  39111. // "response": {
  39112. // "$ref": "RemarketingList"
  39113. // },
  39114. // "scopes": [
  39115. // "https://www.googleapis.com/auth/dfatrafficking"
  39116. // ]
  39117. // }
  39118. }
  39119. // method id "dfareporting.remarketingLists.insert":
  39120. type RemarketingListsInsertCall struct {
  39121. s *Service
  39122. profileId int64
  39123. remarketinglist *RemarketingList
  39124. urlParams_ gensupport.URLParams
  39125. ctx_ context.Context
  39126. header_ http.Header
  39127. }
  39128. // Insert: Inserts a new remarketing list.
  39129. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  39130. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39131. c.profileId = profileId
  39132. c.remarketinglist = remarketinglist
  39133. return c
  39134. }
  39135. // Fields allows partial responses to be retrieved. See
  39136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39137. // for more information.
  39138. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  39139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39140. return c
  39141. }
  39142. // Context sets the context to be used in this call's Do method. Any
  39143. // pending HTTP request will be aborted if the provided context is
  39144. // canceled.
  39145. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  39146. c.ctx_ = ctx
  39147. return c
  39148. }
  39149. // Header returns an http.Header that can be modified by the caller to
  39150. // add HTTP headers to the request.
  39151. func (c *RemarketingListsInsertCall) Header() http.Header {
  39152. if c.header_ == nil {
  39153. c.header_ = make(http.Header)
  39154. }
  39155. return c.header_
  39156. }
  39157. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  39158. reqHeaders := make(http.Header)
  39159. for k, v := range c.header_ {
  39160. reqHeaders[k] = v
  39161. }
  39162. reqHeaders.Set("User-Agent", c.s.userAgent())
  39163. var body io.Reader = nil
  39164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39165. if err != nil {
  39166. return nil, err
  39167. }
  39168. reqHeaders.Set("Content-Type", "application/json")
  39169. c.urlParams_.Set("alt", alt)
  39170. c.urlParams_.Set("prettyPrint", "false")
  39171. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39172. urls += "?" + c.urlParams_.Encode()
  39173. req, err := http.NewRequest("POST", urls, body)
  39174. if err != nil {
  39175. return nil, err
  39176. }
  39177. req.Header = reqHeaders
  39178. googleapi.Expand(req.URL, map[string]string{
  39179. "profileId": strconv.FormatInt(c.profileId, 10),
  39180. })
  39181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39182. }
  39183. // Do executes the "dfareporting.remarketingLists.insert" call.
  39184. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39185. // status code is an error. Response headers are in either
  39186. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39187. // at all) in error.(*googleapi.Error).Header. Use
  39188. // googleapi.IsNotModified to check whether the returned error was
  39189. // because http.StatusNotModified was returned.
  39190. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39191. gensupport.SetOptions(c.urlParams_, opts...)
  39192. res, err := c.doRequest("json")
  39193. if res != nil && res.StatusCode == http.StatusNotModified {
  39194. if res.Body != nil {
  39195. res.Body.Close()
  39196. }
  39197. return nil, &googleapi.Error{
  39198. Code: res.StatusCode,
  39199. Header: res.Header,
  39200. }
  39201. }
  39202. if err != nil {
  39203. return nil, err
  39204. }
  39205. defer googleapi.CloseBody(res)
  39206. if err := googleapi.CheckResponse(res); err != nil {
  39207. return nil, err
  39208. }
  39209. ret := &RemarketingList{
  39210. ServerResponse: googleapi.ServerResponse{
  39211. Header: res.Header,
  39212. HTTPStatusCode: res.StatusCode,
  39213. },
  39214. }
  39215. target := &ret
  39216. if err := gensupport.DecodeResponse(target, res); err != nil {
  39217. return nil, err
  39218. }
  39219. return ret, nil
  39220. // {
  39221. // "description": "Inserts a new remarketing list.",
  39222. // "httpMethod": "POST",
  39223. // "id": "dfareporting.remarketingLists.insert",
  39224. // "parameterOrder": [
  39225. // "profileId"
  39226. // ],
  39227. // "parameters": {
  39228. // "profileId": {
  39229. // "description": "User profile ID associated with this request.",
  39230. // "format": "int64",
  39231. // "location": "path",
  39232. // "required": true,
  39233. // "type": "string"
  39234. // }
  39235. // },
  39236. // "path": "userprofiles/{profileId}/remarketingLists",
  39237. // "request": {
  39238. // "$ref": "RemarketingList"
  39239. // },
  39240. // "response": {
  39241. // "$ref": "RemarketingList"
  39242. // },
  39243. // "scopes": [
  39244. // "https://www.googleapis.com/auth/dfatrafficking"
  39245. // ]
  39246. // }
  39247. }
  39248. // method id "dfareporting.remarketingLists.list":
  39249. type RemarketingListsListCall struct {
  39250. s *Service
  39251. profileId int64
  39252. urlParams_ gensupport.URLParams
  39253. ifNoneMatch_ string
  39254. ctx_ context.Context
  39255. header_ http.Header
  39256. }
  39257. // List: Retrieves a list of remarketing lists, possibly filtered. This
  39258. // method supports paging.
  39259. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  39260. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39261. c.profileId = profileId
  39262. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  39263. return c
  39264. }
  39265. // Active sets the optional parameter "active": Select only active or
  39266. // only inactive remarketing lists.
  39267. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  39268. c.urlParams_.Set("active", fmt.Sprint(active))
  39269. return c
  39270. }
  39271. // FloodlightActivityId sets the optional parameter
  39272. // "floodlightActivityId": Select only remarketing lists that have this
  39273. // floodlight activity ID.
  39274. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  39275. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  39276. return c
  39277. }
  39278. // MaxResults sets the optional parameter "maxResults": Maximum number
  39279. // of results to return.
  39280. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  39281. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39282. return c
  39283. }
  39284. // Name sets the optional parameter "name": Allows searching for objects
  39285. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  39286. // list*2015" will return objects with names like "remarketing list June
  39287. // 2015", "remarketing list April 2015", or simply "remarketing list
  39288. // 2015". Most of the searches also add wildcards implicitly at the
  39289. // start and the end of the search string. For example, a search string
  39290. // of "remarketing list" will match objects with name "my remarketing
  39291. // list", "remarketing list 2015", or simply "remarketing list".
  39292. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  39293. c.urlParams_.Set("name", name)
  39294. return c
  39295. }
  39296. // PageToken sets the optional parameter "pageToken": Value of the
  39297. // nextPageToken from the previous result page.
  39298. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  39299. c.urlParams_.Set("pageToken", pageToken)
  39300. return c
  39301. }
  39302. // SortField sets the optional parameter "sortField": Field by which to
  39303. // sort the list.
  39304. //
  39305. // Possible values:
  39306. // "ID" (default)
  39307. // "NAME"
  39308. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  39309. c.urlParams_.Set("sortField", sortField)
  39310. return c
  39311. }
  39312. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39313. // results.
  39314. //
  39315. // Possible values:
  39316. // "ASCENDING" (default)
  39317. // "DESCENDING"
  39318. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  39319. c.urlParams_.Set("sortOrder", sortOrder)
  39320. return c
  39321. }
  39322. // Fields allows partial responses to be retrieved. See
  39323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39324. // for more information.
  39325. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  39326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39327. return c
  39328. }
  39329. // IfNoneMatch sets the optional parameter which makes the operation
  39330. // fail if the object's ETag matches the given value. This is useful for
  39331. // getting updates only after the object has changed since the last
  39332. // request. Use googleapi.IsNotModified to check whether the response
  39333. // error from Do is the result of In-None-Match.
  39334. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  39335. c.ifNoneMatch_ = entityTag
  39336. return c
  39337. }
  39338. // Context sets the context to be used in this call's Do method. Any
  39339. // pending HTTP request will be aborted if the provided context is
  39340. // canceled.
  39341. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  39342. c.ctx_ = ctx
  39343. return c
  39344. }
  39345. // Header returns an http.Header that can be modified by the caller to
  39346. // add HTTP headers to the request.
  39347. func (c *RemarketingListsListCall) Header() http.Header {
  39348. if c.header_ == nil {
  39349. c.header_ = make(http.Header)
  39350. }
  39351. return c.header_
  39352. }
  39353. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  39354. reqHeaders := make(http.Header)
  39355. for k, v := range c.header_ {
  39356. reqHeaders[k] = v
  39357. }
  39358. reqHeaders.Set("User-Agent", c.s.userAgent())
  39359. if c.ifNoneMatch_ != "" {
  39360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39361. }
  39362. var body io.Reader = nil
  39363. c.urlParams_.Set("alt", alt)
  39364. c.urlParams_.Set("prettyPrint", "false")
  39365. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39366. urls += "?" + c.urlParams_.Encode()
  39367. req, err := http.NewRequest("GET", urls, body)
  39368. if err != nil {
  39369. return nil, err
  39370. }
  39371. req.Header = reqHeaders
  39372. googleapi.Expand(req.URL, map[string]string{
  39373. "profileId": strconv.FormatInt(c.profileId, 10),
  39374. })
  39375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39376. }
  39377. // Do executes the "dfareporting.remarketingLists.list" call.
  39378. // Exactly one of *RemarketingListsListResponse or error will be
  39379. // non-nil. Any non-2xx status code is an error. Response headers are in
  39380. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  39381. // response was returned at all) in error.(*googleapi.Error).Header. Use
  39382. // googleapi.IsNotModified to check whether the returned error was
  39383. // because http.StatusNotModified was returned.
  39384. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  39385. gensupport.SetOptions(c.urlParams_, opts...)
  39386. res, err := c.doRequest("json")
  39387. if res != nil && res.StatusCode == http.StatusNotModified {
  39388. if res.Body != nil {
  39389. res.Body.Close()
  39390. }
  39391. return nil, &googleapi.Error{
  39392. Code: res.StatusCode,
  39393. Header: res.Header,
  39394. }
  39395. }
  39396. if err != nil {
  39397. return nil, err
  39398. }
  39399. defer googleapi.CloseBody(res)
  39400. if err := googleapi.CheckResponse(res); err != nil {
  39401. return nil, err
  39402. }
  39403. ret := &RemarketingListsListResponse{
  39404. ServerResponse: googleapi.ServerResponse{
  39405. Header: res.Header,
  39406. HTTPStatusCode: res.StatusCode,
  39407. },
  39408. }
  39409. target := &ret
  39410. if err := gensupport.DecodeResponse(target, res); err != nil {
  39411. return nil, err
  39412. }
  39413. return ret, nil
  39414. // {
  39415. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  39416. // "httpMethod": "GET",
  39417. // "id": "dfareporting.remarketingLists.list",
  39418. // "parameterOrder": [
  39419. // "profileId",
  39420. // "advertiserId"
  39421. // ],
  39422. // "parameters": {
  39423. // "active": {
  39424. // "description": "Select only active or only inactive remarketing lists.",
  39425. // "location": "query",
  39426. // "type": "boolean"
  39427. // },
  39428. // "advertiserId": {
  39429. // "description": "Select only remarketing lists owned by this advertiser.",
  39430. // "format": "int64",
  39431. // "location": "query",
  39432. // "required": true,
  39433. // "type": "string"
  39434. // },
  39435. // "floodlightActivityId": {
  39436. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  39437. // "format": "int64",
  39438. // "location": "query",
  39439. // "type": "string"
  39440. // },
  39441. // "maxResults": {
  39442. // "default": "1000",
  39443. // "description": "Maximum number of results to return.",
  39444. // "format": "int32",
  39445. // "location": "query",
  39446. // "maximum": "1000",
  39447. // "minimum": "0",
  39448. // "type": "integer"
  39449. // },
  39450. // "name": {
  39451. // "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\".",
  39452. // "location": "query",
  39453. // "type": "string"
  39454. // },
  39455. // "pageToken": {
  39456. // "description": "Value of the nextPageToken from the previous result page.",
  39457. // "location": "query",
  39458. // "type": "string"
  39459. // },
  39460. // "profileId": {
  39461. // "description": "User profile ID associated with this request.",
  39462. // "format": "int64",
  39463. // "location": "path",
  39464. // "required": true,
  39465. // "type": "string"
  39466. // },
  39467. // "sortField": {
  39468. // "default": "ID",
  39469. // "description": "Field by which to sort the list.",
  39470. // "enum": [
  39471. // "ID",
  39472. // "NAME"
  39473. // ],
  39474. // "enumDescriptions": [
  39475. // "",
  39476. // ""
  39477. // ],
  39478. // "location": "query",
  39479. // "type": "string"
  39480. // },
  39481. // "sortOrder": {
  39482. // "default": "ASCENDING",
  39483. // "description": "Order of sorted results.",
  39484. // "enum": [
  39485. // "ASCENDING",
  39486. // "DESCENDING"
  39487. // ],
  39488. // "enumDescriptions": [
  39489. // "",
  39490. // ""
  39491. // ],
  39492. // "location": "query",
  39493. // "type": "string"
  39494. // }
  39495. // },
  39496. // "path": "userprofiles/{profileId}/remarketingLists",
  39497. // "response": {
  39498. // "$ref": "RemarketingListsListResponse"
  39499. // },
  39500. // "scopes": [
  39501. // "https://www.googleapis.com/auth/dfatrafficking"
  39502. // ]
  39503. // }
  39504. }
  39505. // Pages invokes f for each page of results.
  39506. // A non-nil error returned from f will halt the iteration.
  39507. // The provided context supersedes any context provided to the Context method.
  39508. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  39509. c.ctx_ = ctx
  39510. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39511. for {
  39512. x, err := c.Do()
  39513. if err != nil {
  39514. return err
  39515. }
  39516. if err := f(x); err != nil {
  39517. return err
  39518. }
  39519. if x.NextPageToken == "" {
  39520. return nil
  39521. }
  39522. c.PageToken(x.NextPageToken)
  39523. }
  39524. }
  39525. // method id "dfareporting.remarketingLists.patch":
  39526. type RemarketingListsPatchCall struct {
  39527. s *Service
  39528. profileId int64
  39529. remarketinglist *RemarketingList
  39530. urlParams_ gensupport.URLParams
  39531. ctx_ context.Context
  39532. header_ http.Header
  39533. }
  39534. // Patch: Updates an existing remarketing list. This method supports
  39535. // patch semantics.
  39536. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  39537. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39538. c.profileId = profileId
  39539. c.urlParams_.Set("id", fmt.Sprint(id))
  39540. c.remarketinglist = remarketinglist
  39541. return c
  39542. }
  39543. // Fields allows partial responses to be retrieved. See
  39544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39545. // for more information.
  39546. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  39547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39548. return c
  39549. }
  39550. // Context sets the context to be used in this call's Do method. Any
  39551. // pending HTTP request will be aborted if the provided context is
  39552. // canceled.
  39553. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  39554. c.ctx_ = ctx
  39555. return c
  39556. }
  39557. // Header returns an http.Header that can be modified by the caller to
  39558. // add HTTP headers to the request.
  39559. func (c *RemarketingListsPatchCall) Header() http.Header {
  39560. if c.header_ == nil {
  39561. c.header_ = make(http.Header)
  39562. }
  39563. return c.header_
  39564. }
  39565. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  39566. reqHeaders := make(http.Header)
  39567. for k, v := range c.header_ {
  39568. reqHeaders[k] = v
  39569. }
  39570. reqHeaders.Set("User-Agent", c.s.userAgent())
  39571. var body io.Reader = nil
  39572. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39573. if err != nil {
  39574. return nil, err
  39575. }
  39576. reqHeaders.Set("Content-Type", "application/json")
  39577. c.urlParams_.Set("alt", alt)
  39578. c.urlParams_.Set("prettyPrint", "false")
  39579. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39580. urls += "?" + c.urlParams_.Encode()
  39581. req, err := http.NewRequest("PATCH", urls, body)
  39582. if err != nil {
  39583. return nil, err
  39584. }
  39585. req.Header = reqHeaders
  39586. googleapi.Expand(req.URL, map[string]string{
  39587. "profileId": strconv.FormatInt(c.profileId, 10),
  39588. })
  39589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39590. }
  39591. // Do executes the "dfareporting.remarketingLists.patch" call.
  39592. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39593. // status code is an error. Response headers are in either
  39594. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39595. // at all) in error.(*googleapi.Error).Header. Use
  39596. // googleapi.IsNotModified to check whether the returned error was
  39597. // because http.StatusNotModified was returned.
  39598. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39599. gensupport.SetOptions(c.urlParams_, opts...)
  39600. res, err := c.doRequest("json")
  39601. if res != nil && res.StatusCode == http.StatusNotModified {
  39602. if res.Body != nil {
  39603. res.Body.Close()
  39604. }
  39605. return nil, &googleapi.Error{
  39606. Code: res.StatusCode,
  39607. Header: res.Header,
  39608. }
  39609. }
  39610. if err != nil {
  39611. return nil, err
  39612. }
  39613. defer googleapi.CloseBody(res)
  39614. if err := googleapi.CheckResponse(res); err != nil {
  39615. return nil, err
  39616. }
  39617. ret := &RemarketingList{
  39618. ServerResponse: googleapi.ServerResponse{
  39619. Header: res.Header,
  39620. HTTPStatusCode: res.StatusCode,
  39621. },
  39622. }
  39623. target := &ret
  39624. if err := gensupport.DecodeResponse(target, res); err != nil {
  39625. return nil, err
  39626. }
  39627. return ret, nil
  39628. // {
  39629. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  39630. // "httpMethod": "PATCH",
  39631. // "id": "dfareporting.remarketingLists.patch",
  39632. // "parameterOrder": [
  39633. // "profileId",
  39634. // "id"
  39635. // ],
  39636. // "parameters": {
  39637. // "id": {
  39638. // "description": "Remarketing list ID.",
  39639. // "format": "int64",
  39640. // "location": "query",
  39641. // "required": true,
  39642. // "type": "string"
  39643. // },
  39644. // "profileId": {
  39645. // "description": "User profile ID associated with this request.",
  39646. // "format": "int64",
  39647. // "location": "path",
  39648. // "required": true,
  39649. // "type": "string"
  39650. // }
  39651. // },
  39652. // "path": "userprofiles/{profileId}/remarketingLists",
  39653. // "request": {
  39654. // "$ref": "RemarketingList"
  39655. // },
  39656. // "response": {
  39657. // "$ref": "RemarketingList"
  39658. // },
  39659. // "scopes": [
  39660. // "https://www.googleapis.com/auth/dfatrafficking"
  39661. // ]
  39662. // }
  39663. }
  39664. // method id "dfareporting.remarketingLists.update":
  39665. type RemarketingListsUpdateCall struct {
  39666. s *Service
  39667. profileId int64
  39668. remarketinglist *RemarketingList
  39669. urlParams_ gensupport.URLParams
  39670. ctx_ context.Context
  39671. header_ http.Header
  39672. }
  39673. // Update: Updates an existing remarketing list.
  39674. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  39675. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39676. c.profileId = profileId
  39677. c.remarketinglist = remarketinglist
  39678. return c
  39679. }
  39680. // Fields allows partial responses to be retrieved. See
  39681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39682. // for more information.
  39683. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  39684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39685. return c
  39686. }
  39687. // Context sets the context to be used in this call's Do method. Any
  39688. // pending HTTP request will be aborted if the provided context is
  39689. // canceled.
  39690. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  39691. c.ctx_ = ctx
  39692. return c
  39693. }
  39694. // Header returns an http.Header that can be modified by the caller to
  39695. // add HTTP headers to the request.
  39696. func (c *RemarketingListsUpdateCall) Header() http.Header {
  39697. if c.header_ == nil {
  39698. c.header_ = make(http.Header)
  39699. }
  39700. return c.header_
  39701. }
  39702. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39703. reqHeaders := make(http.Header)
  39704. for k, v := range c.header_ {
  39705. reqHeaders[k] = v
  39706. }
  39707. reqHeaders.Set("User-Agent", c.s.userAgent())
  39708. var body io.Reader = nil
  39709. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39710. if err != nil {
  39711. return nil, err
  39712. }
  39713. reqHeaders.Set("Content-Type", "application/json")
  39714. c.urlParams_.Set("alt", alt)
  39715. c.urlParams_.Set("prettyPrint", "false")
  39716. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39717. urls += "?" + c.urlParams_.Encode()
  39718. req, err := http.NewRequest("PUT", urls, body)
  39719. if err != nil {
  39720. return nil, err
  39721. }
  39722. req.Header = reqHeaders
  39723. googleapi.Expand(req.URL, map[string]string{
  39724. "profileId": strconv.FormatInt(c.profileId, 10),
  39725. })
  39726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39727. }
  39728. // Do executes the "dfareporting.remarketingLists.update" call.
  39729. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39730. // status code is an error. Response headers are in either
  39731. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39732. // at all) in error.(*googleapi.Error).Header. Use
  39733. // googleapi.IsNotModified to check whether the returned error was
  39734. // because http.StatusNotModified was returned.
  39735. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39736. gensupport.SetOptions(c.urlParams_, opts...)
  39737. res, err := c.doRequest("json")
  39738. if res != nil && res.StatusCode == http.StatusNotModified {
  39739. if res.Body != nil {
  39740. res.Body.Close()
  39741. }
  39742. return nil, &googleapi.Error{
  39743. Code: res.StatusCode,
  39744. Header: res.Header,
  39745. }
  39746. }
  39747. if err != nil {
  39748. return nil, err
  39749. }
  39750. defer googleapi.CloseBody(res)
  39751. if err := googleapi.CheckResponse(res); err != nil {
  39752. return nil, err
  39753. }
  39754. ret := &RemarketingList{
  39755. ServerResponse: googleapi.ServerResponse{
  39756. Header: res.Header,
  39757. HTTPStatusCode: res.StatusCode,
  39758. },
  39759. }
  39760. target := &ret
  39761. if err := gensupport.DecodeResponse(target, res); err != nil {
  39762. return nil, err
  39763. }
  39764. return ret, nil
  39765. // {
  39766. // "description": "Updates an existing remarketing list.",
  39767. // "httpMethod": "PUT",
  39768. // "id": "dfareporting.remarketingLists.update",
  39769. // "parameterOrder": [
  39770. // "profileId"
  39771. // ],
  39772. // "parameters": {
  39773. // "profileId": {
  39774. // "description": "User profile ID associated with this request.",
  39775. // "format": "int64",
  39776. // "location": "path",
  39777. // "required": true,
  39778. // "type": "string"
  39779. // }
  39780. // },
  39781. // "path": "userprofiles/{profileId}/remarketingLists",
  39782. // "request": {
  39783. // "$ref": "RemarketingList"
  39784. // },
  39785. // "response": {
  39786. // "$ref": "RemarketingList"
  39787. // },
  39788. // "scopes": [
  39789. // "https://www.googleapis.com/auth/dfatrafficking"
  39790. // ]
  39791. // }
  39792. }
  39793. // method id "dfareporting.reports.delete":
  39794. type ReportsDeleteCall struct {
  39795. s *Service
  39796. profileId int64
  39797. reportId int64
  39798. urlParams_ gensupport.URLParams
  39799. ctx_ context.Context
  39800. header_ http.Header
  39801. }
  39802. // Delete: Deletes a report by its ID.
  39803. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  39804. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39805. c.profileId = profileId
  39806. c.reportId = reportId
  39807. return c
  39808. }
  39809. // Fields allows partial responses to be retrieved. See
  39810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39811. // for more information.
  39812. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  39813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39814. return c
  39815. }
  39816. // Context sets the context to be used in this call's Do method. Any
  39817. // pending HTTP request will be aborted if the provided context is
  39818. // canceled.
  39819. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  39820. c.ctx_ = ctx
  39821. return c
  39822. }
  39823. // Header returns an http.Header that can be modified by the caller to
  39824. // add HTTP headers to the request.
  39825. func (c *ReportsDeleteCall) Header() http.Header {
  39826. if c.header_ == nil {
  39827. c.header_ = make(http.Header)
  39828. }
  39829. return c.header_
  39830. }
  39831. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39832. reqHeaders := make(http.Header)
  39833. for k, v := range c.header_ {
  39834. reqHeaders[k] = v
  39835. }
  39836. reqHeaders.Set("User-Agent", c.s.userAgent())
  39837. var body io.Reader = nil
  39838. c.urlParams_.Set("alt", alt)
  39839. c.urlParams_.Set("prettyPrint", "false")
  39840. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39841. urls += "?" + c.urlParams_.Encode()
  39842. req, err := http.NewRequest("DELETE", urls, body)
  39843. if err != nil {
  39844. return nil, err
  39845. }
  39846. req.Header = reqHeaders
  39847. googleapi.Expand(req.URL, map[string]string{
  39848. "profileId": strconv.FormatInt(c.profileId, 10),
  39849. "reportId": strconv.FormatInt(c.reportId, 10),
  39850. })
  39851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39852. }
  39853. // Do executes the "dfareporting.reports.delete" call.
  39854. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  39855. gensupport.SetOptions(c.urlParams_, opts...)
  39856. res, err := c.doRequest("json")
  39857. if err != nil {
  39858. return err
  39859. }
  39860. defer googleapi.CloseBody(res)
  39861. if err := googleapi.CheckResponse(res); err != nil {
  39862. return err
  39863. }
  39864. return nil
  39865. // {
  39866. // "description": "Deletes a report by its ID.",
  39867. // "httpMethod": "DELETE",
  39868. // "id": "dfareporting.reports.delete",
  39869. // "parameterOrder": [
  39870. // "profileId",
  39871. // "reportId"
  39872. // ],
  39873. // "parameters": {
  39874. // "profileId": {
  39875. // "description": "The DFA user profile ID.",
  39876. // "format": "int64",
  39877. // "location": "path",
  39878. // "required": true,
  39879. // "type": "string"
  39880. // },
  39881. // "reportId": {
  39882. // "description": "The ID of the report.",
  39883. // "format": "int64",
  39884. // "location": "path",
  39885. // "required": true,
  39886. // "type": "string"
  39887. // }
  39888. // },
  39889. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39890. // "scopes": [
  39891. // "https://www.googleapis.com/auth/dfareporting"
  39892. // ]
  39893. // }
  39894. }
  39895. // method id "dfareporting.reports.get":
  39896. type ReportsGetCall struct {
  39897. s *Service
  39898. profileId int64
  39899. reportId int64
  39900. urlParams_ gensupport.URLParams
  39901. ifNoneMatch_ string
  39902. ctx_ context.Context
  39903. header_ http.Header
  39904. }
  39905. // Get: Retrieves a report by its ID.
  39906. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  39907. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39908. c.profileId = profileId
  39909. c.reportId = reportId
  39910. return c
  39911. }
  39912. // Fields allows partial responses to be retrieved. See
  39913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39914. // for more information.
  39915. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  39916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39917. return c
  39918. }
  39919. // IfNoneMatch sets the optional parameter which makes the operation
  39920. // fail if the object's ETag matches the given value. This is useful for
  39921. // getting updates only after the object has changed since the last
  39922. // request. Use googleapi.IsNotModified to check whether the response
  39923. // error from Do is the result of In-None-Match.
  39924. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  39925. c.ifNoneMatch_ = entityTag
  39926. return c
  39927. }
  39928. // Context sets the context to be used in this call's Do method. Any
  39929. // pending HTTP request will be aborted if the provided context is
  39930. // canceled.
  39931. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  39932. c.ctx_ = ctx
  39933. return c
  39934. }
  39935. // Header returns an http.Header that can be modified by the caller to
  39936. // add HTTP headers to the request.
  39937. func (c *ReportsGetCall) Header() http.Header {
  39938. if c.header_ == nil {
  39939. c.header_ = make(http.Header)
  39940. }
  39941. return c.header_
  39942. }
  39943. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  39944. reqHeaders := make(http.Header)
  39945. for k, v := range c.header_ {
  39946. reqHeaders[k] = v
  39947. }
  39948. reqHeaders.Set("User-Agent", c.s.userAgent())
  39949. if c.ifNoneMatch_ != "" {
  39950. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39951. }
  39952. var body io.Reader = nil
  39953. c.urlParams_.Set("alt", alt)
  39954. c.urlParams_.Set("prettyPrint", "false")
  39955. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39956. urls += "?" + c.urlParams_.Encode()
  39957. req, err := http.NewRequest("GET", urls, body)
  39958. if err != nil {
  39959. return nil, err
  39960. }
  39961. req.Header = reqHeaders
  39962. googleapi.Expand(req.URL, map[string]string{
  39963. "profileId": strconv.FormatInt(c.profileId, 10),
  39964. "reportId": strconv.FormatInt(c.reportId, 10),
  39965. })
  39966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39967. }
  39968. // Do executes the "dfareporting.reports.get" call.
  39969. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39970. // code is an error. Response headers are in either
  39971. // *Report.ServerResponse.Header or (if a response was returned at all)
  39972. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39973. // check whether the returned error was because http.StatusNotModified
  39974. // was returned.
  39975. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39976. gensupport.SetOptions(c.urlParams_, opts...)
  39977. res, err := c.doRequest("json")
  39978. if res != nil && res.StatusCode == http.StatusNotModified {
  39979. if res.Body != nil {
  39980. res.Body.Close()
  39981. }
  39982. return nil, &googleapi.Error{
  39983. Code: res.StatusCode,
  39984. Header: res.Header,
  39985. }
  39986. }
  39987. if err != nil {
  39988. return nil, err
  39989. }
  39990. defer googleapi.CloseBody(res)
  39991. if err := googleapi.CheckResponse(res); err != nil {
  39992. return nil, err
  39993. }
  39994. ret := &Report{
  39995. ServerResponse: googleapi.ServerResponse{
  39996. Header: res.Header,
  39997. HTTPStatusCode: res.StatusCode,
  39998. },
  39999. }
  40000. target := &ret
  40001. if err := gensupport.DecodeResponse(target, res); err != nil {
  40002. return nil, err
  40003. }
  40004. return ret, nil
  40005. // {
  40006. // "description": "Retrieves a report by its ID.",
  40007. // "httpMethod": "GET",
  40008. // "id": "dfareporting.reports.get",
  40009. // "parameterOrder": [
  40010. // "profileId",
  40011. // "reportId"
  40012. // ],
  40013. // "parameters": {
  40014. // "profileId": {
  40015. // "description": "The DFA user profile ID.",
  40016. // "format": "int64",
  40017. // "location": "path",
  40018. // "required": true,
  40019. // "type": "string"
  40020. // },
  40021. // "reportId": {
  40022. // "description": "The ID of the report.",
  40023. // "format": "int64",
  40024. // "location": "path",
  40025. // "required": true,
  40026. // "type": "string"
  40027. // }
  40028. // },
  40029. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40030. // "response": {
  40031. // "$ref": "Report"
  40032. // },
  40033. // "scopes": [
  40034. // "https://www.googleapis.com/auth/dfareporting"
  40035. // ]
  40036. // }
  40037. }
  40038. // method id "dfareporting.reports.insert":
  40039. type ReportsInsertCall struct {
  40040. s *Service
  40041. profileId int64
  40042. report *Report
  40043. urlParams_ gensupport.URLParams
  40044. ctx_ context.Context
  40045. header_ http.Header
  40046. }
  40047. // Insert: Creates a report.
  40048. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  40049. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40050. c.profileId = profileId
  40051. c.report = report
  40052. return c
  40053. }
  40054. // Fields allows partial responses to be retrieved. See
  40055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40056. // for more information.
  40057. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  40058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40059. return c
  40060. }
  40061. // Context sets the context to be used in this call's Do method. Any
  40062. // pending HTTP request will be aborted if the provided context is
  40063. // canceled.
  40064. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  40065. c.ctx_ = ctx
  40066. return c
  40067. }
  40068. // Header returns an http.Header that can be modified by the caller to
  40069. // add HTTP headers to the request.
  40070. func (c *ReportsInsertCall) Header() http.Header {
  40071. if c.header_ == nil {
  40072. c.header_ = make(http.Header)
  40073. }
  40074. return c.header_
  40075. }
  40076. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  40077. reqHeaders := make(http.Header)
  40078. for k, v := range c.header_ {
  40079. reqHeaders[k] = v
  40080. }
  40081. reqHeaders.Set("User-Agent", c.s.userAgent())
  40082. var body io.Reader = nil
  40083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40084. if err != nil {
  40085. return nil, err
  40086. }
  40087. reqHeaders.Set("Content-Type", "application/json")
  40088. c.urlParams_.Set("alt", alt)
  40089. c.urlParams_.Set("prettyPrint", "false")
  40090. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  40091. urls += "?" + c.urlParams_.Encode()
  40092. req, err := http.NewRequest("POST", urls, body)
  40093. if err != nil {
  40094. return nil, err
  40095. }
  40096. req.Header = reqHeaders
  40097. googleapi.Expand(req.URL, map[string]string{
  40098. "profileId": strconv.FormatInt(c.profileId, 10),
  40099. })
  40100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40101. }
  40102. // Do executes the "dfareporting.reports.insert" call.
  40103. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40104. // code is an error. Response headers are in either
  40105. // *Report.ServerResponse.Header or (if a response was returned at all)
  40106. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40107. // check whether the returned error was because http.StatusNotModified
  40108. // was returned.
  40109. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40110. gensupport.SetOptions(c.urlParams_, opts...)
  40111. res, err := c.doRequest("json")
  40112. if res != nil && res.StatusCode == http.StatusNotModified {
  40113. if res.Body != nil {
  40114. res.Body.Close()
  40115. }
  40116. return nil, &googleapi.Error{
  40117. Code: res.StatusCode,
  40118. Header: res.Header,
  40119. }
  40120. }
  40121. if err != nil {
  40122. return nil, err
  40123. }
  40124. defer googleapi.CloseBody(res)
  40125. if err := googleapi.CheckResponse(res); err != nil {
  40126. return nil, err
  40127. }
  40128. ret := &Report{
  40129. ServerResponse: googleapi.ServerResponse{
  40130. Header: res.Header,
  40131. HTTPStatusCode: res.StatusCode,
  40132. },
  40133. }
  40134. target := &ret
  40135. if err := gensupport.DecodeResponse(target, res); err != nil {
  40136. return nil, err
  40137. }
  40138. return ret, nil
  40139. // {
  40140. // "description": "Creates a report.",
  40141. // "httpMethod": "POST",
  40142. // "id": "dfareporting.reports.insert",
  40143. // "parameterOrder": [
  40144. // "profileId"
  40145. // ],
  40146. // "parameters": {
  40147. // "profileId": {
  40148. // "description": "The DFA user profile ID.",
  40149. // "format": "int64",
  40150. // "location": "path",
  40151. // "required": true,
  40152. // "type": "string"
  40153. // }
  40154. // },
  40155. // "path": "userprofiles/{profileId}/reports",
  40156. // "request": {
  40157. // "$ref": "Report"
  40158. // },
  40159. // "response": {
  40160. // "$ref": "Report"
  40161. // },
  40162. // "scopes": [
  40163. // "https://www.googleapis.com/auth/dfareporting"
  40164. // ]
  40165. // }
  40166. }
  40167. // method id "dfareporting.reports.list":
  40168. type ReportsListCall struct {
  40169. s *Service
  40170. profileId int64
  40171. urlParams_ gensupport.URLParams
  40172. ifNoneMatch_ string
  40173. ctx_ context.Context
  40174. header_ http.Header
  40175. }
  40176. // List: Retrieves list of reports.
  40177. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  40178. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40179. c.profileId = profileId
  40180. return c
  40181. }
  40182. // MaxResults sets the optional parameter "maxResults": Maximum number
  40183. // of results to return.
  40184. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  40185. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40186. return c
  40187. }
  40188. // PageToken sets the optional parameter "pageToken": The value of the
  40189. // nextToken from the previous result page.
  40190. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  40191. c.urlParams_.Set("pageToken", pageToken)
  40192. return c
  40193. }
  40194. // Scope sets the optional parameter "scope": The scope that defines
  40195. // which results are returned.
  40196. //
  40197. // Possible values:
  40198. // "ALL" - All reports in account.
  40199. // "MINE" (default) - My reports.
  40200. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  40201. c.urlParams_.Set("scope", scope)
  40202. return c
  40203. }
  40204. // SortField sets the optional parameter "sortField": The field by which
  40205. // to sort the list.
  40206. //
  40207. // Possible values:
  40208. // "ID" - Sort by report ID.
  40209. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  40210. // "NAME" - Sort by name of reports.
  40211. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  40212. c.urlParams_.Set("sortField", sortField)
  40213. return c
  40214. }
  40215. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40216. // results.
  40217. //
  40218. // Possible values:
  40219. // "ASCENDING" - Ascending order.
  40220. // "DESCENDING" (default) - Descending order.
  40221. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  40222. c.urlParams_.Set("sortOrder", sortOrder)
  40223. return c
  40224. }
  40225. // Fields allows partial responses to be retrieved. See
  40226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40227. // for more information.
  40228. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  40229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40230. return c
  40231. }
  40232. // IfNoneMatch sets the optional parameter which makes the operation
  40233. // fail if the object's ETag matches the given value. This is useful for
  40234. // getting updates only after the object has changed since the last
  40235. // request. Use googleapi.IsNotModified to check whether the response
  40236. // error from Do is the result of In-None-Match.
  40237. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  40238. c.ifNoneMatch_ = entityTag
  40239. return c
  40240. }
  40241. // Context sets the context to be used in this call's Do method. Any
  40242. // pending HTTP request will be aborted if the provided context is
  40243. // canceled.
  40244. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  40245. c.ctx_ = ctx
  40246. return c
  40247. }
  40248. // Header returns an http.Header that can be modified by the caller to
  40249. // add HTTP headers to the request.
  40250. func (c *ReportsListCall) Header() http.Header {
  40251. if c.header_ == nil {
  40252. c.header_ = make(http.Header)
  40253. }
  40254. return c.header_
  40255. }
  40256. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  40257. reqHeaders := make(http.Header)
  40258. for k, v := range c.header_ {
  40259. reqHeaders[k] = v
  40260. }
  40261. reqHeaders.Set("User-Agent", c.s.userAgent())
  40262. if c.ifNoneMatch_ != "" {
  40263. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40264. }
  40265. var body io.Reader = nil
  40266. c.urlParams_.Set("alt", alt)
  40267. c.urlParams_.Set("prettyPrint", "false")
  40268. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  40269. urls += "?" + c.urlParams_.Encode()
  40270. req, err := http.NewRequest("GET", urls, body)
  40271. if err != nil {
  40272. return nil, err
  40273. }
  40274. req.Header = reqHeaders
  40275. googleapi.Expand(req.URL, map[string]string{
  40276. "profileId": strconv.FormatInt(c.profileId, 10),
  40277. })
  40278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40279. }
  40280. // Do executes the "dfareporting.reports.list" call.
  40281. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  40282. // status code is an error. Response headers are in either
  40283. // *ReportList.ServerResponse.Header or (if a response was returned at
  40284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40285. // to check whether the returned error was because
  40286. // http.StatusNotModified was returned.
  40287. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  40288. gensupport.SetOptions(c.urlParams_, opts...)
  40289. res, err := c.doRequest("json")
  40290. if res != nil && res.StatusCode == http.StatusNotModified {
  40291. if res.Body != nil {
  40292. res.Body.Close()
  40293. }
  40294. return nil, &googleapi.Error{
  40295. Code: res.StatusCode,
  40296. Header: res.Header,
  40297. }
  40298. }
  40299. if err != nil {
  40300. return nil, err
  40301. }
  40302. defer googleapi.CloseBody(res)
  40303. if err := googleapi.CheckResponse(res); err != nil {
  40304. return nil, err
  40305. }
  40306. ret := &ReportList{
  40307. ServerResponse: googleapi.ServerResponse{
  40308. Header: res.Header,
  40309. HTTPStatusCode: res.StatusCode,
  40310. },
  40311. }
  40312. target := &ret
  40313. if err := gensupport.DecodeResponse(target, res); err != nil {
  40314. return nil, err
  40315. }
  40316. return ret, nil
  40317. // {
  40318. // "description": "Retrieves list of reports.",
  40319. // "httpMethod": "GET",
  40320. // "id": "dfareporting.reports.list",
  40321. // "parameterOrder": [
  40322. // "profileId"
  40323. // ],
  40324. // "parameters": {
  40325. // "maxResults": {
  40326. // "default": "10",
  40327. // "description": "Maximum number of results to return.",
  40328. // "format": "int32",
  40329. // "location": "query",
  40330. // "maximum": "10",
  40331. // "minimum": "0",
  40332. // "type": "integer"
  40333. // },
  40334. // "pageToken": {
  40335. // "description": "The value of the nextToken from the previous result page.",
  40336. // "location": "query",
  40337. // "type": "string"
  40338. // },
  40339. // "profileId": {
  40340. // "description": "The DFA user profile ID.",
  40341. // "format": "int64",
  40342. // "location": "path",
  40343. // "required": true,
  40344. // "type": "string"
  40345. // },
  40346. // "scope": {
  40347. // "default": "MINE",
  40348. // "description": "The scope that defines which results are returned.",
  40349. // "enum": [
  40350. // "ALL",
  40351. // "MINE"
  40352. // ],
  40353. // "enumDescriptions": [
  40354. // "All reports in account.",
  40355. // "My reports."
  40356. // ],
  40357. // "location": "query",
  40358. // "type": "string"
  40359. // },
  40360. // "sortField": {
  40361. // "default": "LAST_MODIFIED_TIME",
  40362. // "description": "The field by which to sort the list.",
  40363. // "enum": [
  40364. // "ID",
  40365. // "LAST_MODIFIED_TIME",
  40366. // "NAME"
  40367. // ],
  40368. // "enumDescriptions": [
  40369. // "Sort by report ID.",
  40370. // "Sort by 'lastModifiedTime' field.",
  40371. // "Sort by name of reports."
  40372. // ],
  40373. // "location": "query",
  40374. // "type": "string"
  40375. // },
  40376. // "sortOrder": {
  40377. // "default": "DESCENDING",
  40378. // "description": "Order of sorted results.",
  40379. // "enum": [
  40380. // "ASCENDING",
  40381. // "DESCENDING"
  40382. // ],
  40383. // "enumDescriptions": [
  40384. // "Ascending order.",
  40385. // "Descending order."
  40386. // ],
  40387. // "location": "query",
  40388. // "type": "string"
  40389. // }
  40390. // },
  40391. // "path": "userprofiles/{profileId}/reports",
  40392. // "response": {
  40393. // "$ref": "ReportList"
  40394. // },
  40395. // "scopes": [
  40396. // "https://www.googleapis.com/auth/dfareporting"
  40397. // ]
  40398. // }
  40399. }
  40400. // Pages invokes f for each page of results.
  40401. // A non-nil error returned from f will halt the iteration.
  40402. // The provided context supersedes any context provided to the Context method.
  40403. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  40404. c.ctx_ = ctx
  40405. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40406. for {
  40407. x, err := c.Do()
  40408. if err != nil {
  40409. return err
  40410. }
  40411. if err := f(x); err != nil {
  40412. return err
  40413. }
  40414. if x.NextPageToken == "" {
  40415. return nil
  40416. }
  40417. c.PageToken(x.NextPageToken)
  40418. }
  40419. }
  40420. // method id "dfareporting.reports.patch":
  40421. type ReportsPatchCall struct {
  40422. s *Service
  40423. profileId int64
  40424. reportId int64
  40425. report *Report
  40426. urlParams_ gensupport.URLParams
  40427. ctx_ context.Context
  40428. header_ http.Header
  40429. }
  40430. // Patch: Updates a report. This method supports patch semantics.
  40431. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  40432. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40433. c.profileId = profileId
  40434. c.reportId = reportId
  40435. c.report = report
  40436. return c
  40437. }
  40438. // Fields allows partial responses to be retrieved. See
  40439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40440. // for more information.
  40441. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  40442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40443. return c
  40444. }
  40445. // Context sets the context to be used in this call's Do method. Any
  40446. // pending HTTP request will be aborted if the provided context is
  40447. // canceled.
  40448. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  40449. c.ctx_ = ctx
  40450. return c
  40451. }
  40452. // Header returns an http.Header that can be modified by the caller to
  40453. // add HTTP headers to the request.
  40454. func (c *ReportsPatchCall) Header() http.Header {
  40455. if c.header_ == nil {
  40456. c.header_ = make(http.Header)
  40457. }
  40458. return c.header_
  40459. }
  40460. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  40461. reqHeaders := make(http.Header)
  40462. for k, v := range c.header_ {
  40463. reqHeaders[k] = v
  40464. }
  40465. reqHeaders.Set("User-Agent", c.s.userAgent())
  40466. var body io.Reader = nil
  40467. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40468. if err != nil {
  40469. return nil, err
  40470. }
  40471. reqHeaders.Set("Content-Type", "application/json")
  40472. c.urlParams_.Set("alt", alt)
  40473. c.urlParams_.Set("prettyPrint", "false")
  40474. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40475. urls += "?" + c.urlParams_.Encode()
  40476. req, err := http.NewRequest("PATCH", urls, body)
  40477. if err != nil {
  40478. return nil, err
  40479. }
  40480. req.Header = reqHeaders
  40481. googleapi.Expand(req.URL, map[string]string{
  40482. "profileId": strconv.FormatInt(c.profileId, 10),
  40483. "reportId": strconv.FormatInt(c.reportId, 10),
  40484. })
  40485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40486. }
  40487. // Do executes the "dfareporting.reports.patch" call.
  40488. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40489. // code is an error. Response headers are in either
  40490. // *Report.ServerResponse.Header or (if a response was returned at all)
  40491. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40492. // check whether the returned error was because http.StatusNotModified
  40493. // was returned.
  40494. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40495. gensupport.SetOptions(c.urlParams_, opts...)
  40496. res, err := c.doRequest("json")
  40497. if res != nil && res.StatusCode == http.StatusNotModified {
  40498. if res.Body != nil {
  40499. res.Body.Close()
  40500. }
  40501. return nil, &googleapi.Error{
  40502. Code: res.StatusCode,
  40503. Header: res.Header,
  40504. }
  40505. }
  40506. if err != nil {
  40507. return nil, err
  40508. }
  40509. defer googleapi.CloseBody(res)
  40510. if err := googleapi.CheckResponse(res); err != nil {
  40511. return nil, err
  40512. }
  40513. ret := &Report{
  40514. ServerResponse: googleapi.ServerResponse{
  40515. Header: res.Header,
  40516. HTTPStatusCode: res.StatusCode,
  40517. },
  40518. }
  40519. target := &ret
  40520. if err := gensupport.DecodeResponse(target, res); err != nil {
  40521. return nil, err
  40522. }
  40523. return ret, nil
  40524. // {
  40525. // "description": "Updates a report. This method supports patch semantics.",
  40526. // "httpMethod": "PATCH",
  40527. // "id": "dfareporting.reports.patch",
  40528. // "parameterOrder": [
  40529. // "profileId",
  40530. // "reportId"
  40531. // ],
  40532. // "parameters": {
  40533. // "profileId": {
  40534. // "description": "The DFA user profile ID.",
  40535. // "format": "int64",
  40536. // "location": "path",
  40537. // "required": true,
  40538. // "type": "string"
  40539. // },
  40540. // "reportId": {
  40541. // "description": "The ID of the report.",
  40542. // "format": "int64",
  40543. // "location": "path",
  40544. // "required": true,
  40545. // "type": "string"
  40546. // }
  40547. // },
  40548. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40549. // "request": {
  40550. // "$ref": "Report"
  40551. // },
  40552. // "response": {
  40553. // "$ref": "Report"
  40554. // },
  40555. // "scopes": [
  40556. // "https://www.googleapis.com/auth/dfareporting"
  40557. // ]
  40558. // }
  40559. }
  40560. // method id "dfareporting.reports.run":
  40561. type ReportsRunCall struct {
  40562. s *Service
  40563. profileId int64
  40564. reportId int64
  40565. urlParams_ gensupport.URLParams
  40566. ctx_ context.Context
  40567. header_ http.Header
  40568. }
  40569. // Run: Runs a report.
  40570. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  40571. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40572. c.profileId = profileId
  40573. c.reportId = reportId
  40574. return c
  40575. }
  40576. // Synchronous sets the optional parameter "synchronous": If set and
  40577. // true, tries to run the report synchronously.
  40578. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  40579. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  40580. return c
  40581. }
  40582. // Fields allows partial responses to be retrieved. See
  40583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40584. // for more information.
  40585. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  40586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40587. return c
  40588. }
  40589. // Context sets the context to be used in this call's Do method. Any
  40590. // pending HTTP request will be aborted if the provided context is
  40591. // canceled.
  40592. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  40593. c.ctx_ = ctx
  40594. return c
  40595. }
  40596. // Header returns an http.Header that can be modified by the caller to
  40597. // add HTTP headers to the request.
  40598. func (c *ReportsRunCall) Header() http.Header {
  40599. if c.header_ == nil {
  40600. c.header_ = make(http.Header)
  40601. }
  40602. return c.header_
  40603. }
  40604. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  40605. reqHeaders := make(http.Header)
  40606. for k, v := range c.header_ {
  40607. reqHeaders[k] = v
  40608. }
  40609. reqHeaders.Set("User-Agent", c.s.userAgent())
  40610. var body io.Reader = nil
  40611. c.urlParams_.Set("alt", alt)
  40612. c.urlParams_.Set("prettyPrint", "false")
  40613. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  40614. urls += "?" + c.urlParams_.Encode()
  40615. req, err := http.NewRequest("POST", urls, body)
  40616. if err != nil {
  40617. return nil, err
  40618. }
  40619. req.Header = reqHeaders
  40620. googleapi.Expand(req.URL, map[string]string{
  40621. "profileId": strconv.FormatInt(c.profileId, 10),
  40622. "reportId": strconv.FormatInt(c.reportId, 10),
  40623. })
  40624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40625. }
  40626. // Do executes the "dfareporting.reports.run" call.
  40627. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40628. // code is an error. Response headers are in either
  40629. // *File.ServerResponse.Header or (if a response was returned at all) in
  40630. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40631. // whether the returned error was because http.StatusNotModified was
  40632. // returned.
  40633. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40634. gensupport.SetOptions(c.urlParams_, opts...)
  40635. res, err := c.doRequest("json")
  40636. if res != nil && res.StatusCode == http.StatusNotModified {
  40637. if res.Body != nil {
  40638. res.Body.Close()
  40639. }
  40640. return nil, &googleapi.Error{
  40641. Code: res.StatusCode,
  40642. Header: res.Header,
  40643. }
  40644. }
  40645. if err != nil {
  40646. return nil, err
  40647. }
  40648. defer googleapi.CloseBody(res)
  40649. if err := googleapi.CheckResponse(res); err != nil {
  40650. return nil, err
  40651. }
  40652. ret := &File{
  40653. ServerResponse: googleapi.ServerResponse{
  40654. Header: res.Header,
  40655. HTTPStatusCode: res.StatusCode,
  40656. },
  40657. }
  40658. target := &ret
  40659. if err := gensupport.DecodeResponse(target, res); err != nil {
  40660. return nil, err
  40661. }
  40662. return ret, nil
  40663. // {
  40664. // "description": "Runs a report.",
  40665. // "httpMethod": "POST",
  40666. // "id": "dfareporting.reports.run",
  40667. // "parameterOrder": [
  40668. // "profileId",
  40669. // "reportId"
  40670. // ],
  40671. // "parameters": {
  40672. // "profileId": {
  40673. // "description": "The DFA profile ID.",
  40674. // "format": "int64",
  40675. // "location": "path",
  40676. // "required": true,
  40677. // "type": "string"
  40678. // },
  40679. // "reportId": {
  40680. // "description": "The ID of the report.",
  40681. // "format": "int64",
  40682. // "location": "path",
  40683. // "required": true,
  40684. // "type": "string"
  40685. // },
  40686. // "synchronous": {
  40687. // "default": "false",
  40688. // "description": "If set and true, tries to run the report synchronously.",
  40689. // "location": "query",
  40690. // "type": "boolean"
  40691. // }
  40692. // },
  40693. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  40694. // "response": {
  40695. // "$ref": "File"
  40696. // },
  40697. // "scopes": [
  40698. // "https://www.googleapis.com/auth/dfareporting"
  40699. // ]
  40700. // }
  40701. }
  40702. // method id "dfareporting.reports.update":
  40703. type ReportsUpdateCall struct {
  40704. s *Service
  40705. profileId int64
  40706. reportId int64
  40707. report *Report
  40708. urlParams_ gensupport.URLParams
  40709. ctx_ context.Context
  40710. header_ http.Header
  40711. }
  40712. // Update: Updates a report.
  40713. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  40714. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40715. c.profileId = profileId
  40716. c.reportId = reportId
  40717. c.report = report
  40718. return c
  40719. }
  40720. // Fields allows partial responses to be retrieved. See
  40721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40722. // for more information.
  40723. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  40724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40725. return c
  40726. }
  40727. // Context sets the context to be used in this call's Do method. Any
  40728. // pending HTTP request will be aborted if the provided context is
  40729. // canceled.
  40730. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  40731. c.ctx_ = ctx
  40732. return c
  40733. }
  40734. // Header returns an http.Header that can be modified by the caller to
  40735. // add HTTP headers to the request.
  40736. func (c *ReportsUpdateCall) Header() http.Header {
  40737. if c.header_ == nil {
  40738. c.header_ = make(http.Header)
  40739. }
  40740. return c.header_
  40741. }
  40742. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  40743. reqHeaders := make(http.Header)
  40744. for k, v := range c.header_ {
  40745. reqHeaders[k] = v
  40746. }
  40747. reqHeaders.Set("User-Agent", c.s.userAgent())
  40748. var body io.Reader = nil
  40749. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40750. if err != nil {
  40751. return nil, err
  40752. }
  40753. reqHeaders.Set("Content-Type", "application/json")
  40754. c.urlParams_.Set("alt", alt)
  40755. c.urlParams_.Set("prettyPrint", "false")
  40756. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40757. urls += "?" + c.urlParams_.Encode()
  40758. req, err := http.NewRequest("PUT", urls, body)
  40759. if err != nil {
  40760. return nil, err
  40761. }
  40762. req.Header = reqHeaders
  40763. googleapi.Expand(req.URL, map[string]string{
  40764. "profileId": strconv.FormatInt(c.profileId, 10),
  40765. "reportId": strconv.FormatInt(c.reportId, 10),
  40766. })
  40767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40768. }
  40769. // Do executes the "dfareporting.reports.update" call.
  40770. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40771. // code is an error. Response headers are in either
  40772. // *Report.ServerResponse.Header or (if a response was returned at all)
  40773. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40774. // check whether the returned error was because http.StatusNotModified
  40775. // was returned.
  40776. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40777. gensupport.SetOptions(c.urlParams_, opts...)
  40778. res, err := c.doRequest("json")
  40779. if res != nil && res.StatusCode == http.StatusNotModified {
  40780. if res.Body != nil {
  40781. res.Body.Close()
  40782. }
  40783. return nil, &googleapi.Error{
  40784. Code: res.StatusCode,
  40785. Header: res.Header,
  40786. }
  40787. }
  40788. if err != nil {
  40789. return nil, err
  40790. }
  40791. defer googleapi.CloseBody(res)
  40792. if err := googleapi.CheckResponse(res); err != nil {
  40793. return nil, err
  40794. }
  40795. ret := &Report{
  40796. ServerResponse: googleapi.ServerResponse{
  40797. Header: res.Header,
  40798. HTTPStatusCode: res.StatusCode,
  40799. },
  40800. }
  40801. target := &ret
  40802. if err := gensupport.DecodeResponse(target, res); err != nil {
  40803. return nil, err
  40804. }
  40805. return ret, nil
  40806. // {
  40807. // "description": "Updates a report.",
  40808. // "httpMethod": "PUT",
  40809. // "id": "dfareporting.reports.update",
  40810. // "parameterOrder": [
  40811. // "profileId",
  40812. // "reportId"
  40813. // ],
  40814. // "parameters": {
  40815. // "profileId": {
  40816. // "description": "The DFA user profile ID.",
  40817. // "format": "int64",
  40818. // "location": "path",
  40819. // "required": true,
  40820. // "type": "string"
  40821. // },
  40822. // "reportId": {
  40823. // "description": "The ID of the report.",
  40824. // "format": "int64",
  40825. // "location": "path",
  40826. // "required": true,
  40827. // "type": "string"
  40828. // }
  40829. // },
  40830. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40831. // "request": {
  40832. // "$ref": "Report"
  40833. // },
  40834. // "response": {
  40835. // "$ref": "Report"
  40836. // },
  40837. // "scopes": [
  40838. // "https://www.googleapis.com/auth/dfareporting"
  40839. // ]
  40840. // }
  40841. }
  40842. // method id "dfareporting.reports.compatibleFields.query":
  40843. type ReportsCompatibleFieldsQueryCall struct {
  40844. s *Service
  40845. profileId int64
  40846. report *Report
  40847. urlParams_ gensupport.URLParams
  40848. ctx_ context.Context
  40849. header_ http.Header
  40850. }
  40851. // Query: Returns the fields that are compatible to be selected in the
  40852. // respective sections of a report criteria, given the fields already
  40853. // selected in the input report and user permissions.
  40854. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  40855. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40856. c.profileId = profileId
  40857. c.report = report
  40858. return c
  40859. }
  40860. // Fields allows partial responses to be retrieved. See
  40861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40862. // for more information.
  40863. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  40864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40865. return c
  40866. }
  40867. // Context sets the context to be used in this call's Do method. Any
  40868. // pending HTTP request will be aborted if the provided context is
  40869. // canceled.
  40870. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  40871. c.ctx_ = ctx
  40872. return c
  40873. }
  40874. // Header returns an http.Header that can be modified by the caller to
  40875. // add HTTP headers to the request.
  40876. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  40877. if c.header_ == nil {
  40878. c.header_ = make(http.Header)
  40879. }
  40880. return c.header_
  40881. }
  40882. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  40883. reqHeaders := make(http.Header)
  40884. for k, v := range c.header_ {
  40885. reqHeaders[k] = v
  40886. }
  40887. reqHeaders.Set("User-Agent", c.s.userAgent())
  40888. var body io.Reader = nil
  40889. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40890. if err != nil {
  40891. return nil, err
  40892. }
  40893. reqHeaders.Set("Content-Type", "application/json")
  40894. c.urlParams_.Set("alt", alt)
  40895. c.urlParams_.Set("prettyPrint", "false")
  40896. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  40897. urls += "?" + c.urlParams_.Encode()
  40898. req, err := http.NewRequest("POST", urls, body)
  40899. if err != nil {
  40900. return nil, err
  40901. }
  40902. req.Header = reqHeaders
  40903. googleapi.Expand(req.URL, map[string]string{
  40904. "profileId": strconv.FormatInt(c.profileId, 10),
  40905. })
  40906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40907. }
  40908. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  40909. // Exactly one of *CompatibleFields or error will be non-nil. Any
  40910. // non-2xx status code is an error. Response headers are in either
  40911. // *CompatibleFields.ServerResponse.Header or (if a response was
  40912. // returned at all) in error.(*googleapi.Error).Header. Use
  40913. // googleapi.IsNotModified to check whether the returned error was
  40914. // because http.StatusNotModified was returned.
  40915. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  40916. gensupport.SetOptions(c.urlParams_, opts...)
  40917. res, err := c.doRequest("json")
  40918. if res != nil && res.StatusCode == http.StatusNotModified {
  40919. if res.Body != nil {
  40920. res.Body.Close()
  40921. }
  40922. return nil, &googleapi.Error{
  40923. Code: res.StatusCode,
  40924. Header: res.Header,
  40925. }
  40926. }
  40927. if err != nil {
  40928. return nil, err
  40929. }
  40930. defer googleapi.CloseBody(res)
  40931. if err := googleapi.CheckResponse(res); err != nil {
  40932. return nil, err
  40933. }
  40934. ret := &CompatibleFields{
  40935. ServerResponse: googleapi.ServerResponse{
  40936. Header: res.Header,
  40937. HTTPStatusCode: res.StatusCode,
  40938. },
  40939. }
  40940. target := &ret
  40941. if err := gensupport.DecodeResponse(target, res); err != nil {
  40942. return nil, err
  40943. }
  40944. return ret, nil
  40945. // {
  40946. // "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.",
  40947. // "httpMethod": "POST",
  40948. // "id": "dfareporting.reports.compatibleFields.query",
  40949. // "parameterOrder": [
  40950. // "profileId"
  40951. // ],
  40952. // "parameters": {
  40953. // "profileId": {
  40954. // "description": "The DFA user profile ID.",
  40955. // "format": "int64",
  40956. // "location": "path",
  40957. // "required": true,
  40958. // "type": "string"
  40959. // }
  40960. // },
  40961. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  40962. // "request": {
  40963. // "$ref": "Report"
  40964. // },
  40965. // "response": {
  40966. // "$ref": "CompatibleFields"
  40967. // },
  40968. // "scopes": [
  40969. // "https://www.googleapis.com/auth/dfareporting"
  40970. // ]
  40971. // }
  40972. }
  40973. // method id "dfareporting.reports.files.get":
  40974. type ReportsFilesGetCall struct {
  40975. s *Service
  40976. profileId int64
  40977. reportId int64
  40978. fileId int64
  40979. urlParams_ gensupport.URLParams
  40980. ifNoneMatch_ string
  40981. ctx_ context.Context
  40982. header_ http.Header
  40983. }
  40984. // Get: Retrieves a report file. This method supports media download.
  40985. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  40986. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40987. c.profileId = profileId
  40988. c.reportId = reportId
  40989. c.fileId = fileId
  40990. return c
  40991. }
  40992. // Fields allows partial responses to be retrieved. See
  40993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40994. // for more information.
  40995. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  40996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40997. return c
  40998. }
  40999. // IfNoneMatch sets the optional parameter which makes the operation
  41000. // fail if the object's ETag matches the given value. This is useful for
  41001. // getting updates only after the object has changed since the last
  41002. // request. Use googleapi.IsNotModified to check whether the response
  41003. // error from Do is the result of In-None-Match.
  41004. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  41005. c.ifNoneMatch_ = entityTag
  41006. return c
  41007. }
  41008. // Context sets the context to be used in this call's Do and Download
  41009. // methods. Any pending HTTP request will be aborted if the provided
  41010. // context is canceled.
  41011. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  41012. c.ctx_ = ctx
  41013. return c
  41014. }
  41015. // Header returns an http.Header that can be modified by the caller to
  41016. // add HTTP headers to the request.
  41017. func (c *ReportsFilesGetCall) Header() http.Header {
  41018. if c.header_ == nil {
  41019. c.header_ = make(http.Header)
  41020. }
  41021. return c.header_
  41022. }
  41023. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  41024. reqHeaders := make(http.Header)
  41025. for k, v := range c.header_ {
  41026. reqHeaders[k] = v
  41027. }
  41028. reqHeaders.Set("User-Agent", c.s.userAgent())
  41029. if c.ifNoneMatch_ != "" {
  41030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41031. }
  41032. var body io.Reader = nil
  41033. c.urlParams_.Set("alt", alt)
  41034. c.urlParams_.Set("prettyPrint", "false")
  41035. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  41036. urls += "?" + c.urlParams_.Encode()
  41037. req, err := http.NewRequest("GET", urls, body)
  41038. if err != nil {
  41039. return nil, err
  41040. }
  41041. req.Header = reqHeaders
  41042. googleapi.Expand(req.URL, map[string]string{
  41043. "profileId": strconv.FormatInt(c.profileId, 10),
  41044. "reportId": strconv.FormatInt(c.reportId, 10),
  41045. "fileId": strconv.FormatInt(c.fileId, 10),
  41046. })
  41047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41048. }
  41049. // Download fetches the API endpoint's "media" value, instead of the normal
  41050. // API response value. If the returned error is nil, the Response is guaranteed to
  41051. // have a 2xx status code. Callers must close the Response.Body as usual.
  41052. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  41053. gensupport.SetOptions(c.urlParams_, opts...)
  41054. res, err := c.doRequest("media")
  41055. if err != nil {
  41056. return nil, err
  41057. }
  41058. if err := googleapi.CheckMediaResponse(res); err != nil {
  41059. res.Body.Close()
  41060. return nil, err
  41061. }
  41062. return res, nil
  41063. }
  41064. // Do executes the "dfareporting.reports.files.get" call.
  41065. // Exactly one of *File or error will be non-nil. Any non-2xx status
  41066. // code is an error. Response headers are in either
  41067. // *File.ServerResponse.Header or (if a response was returned at all) in
  41068. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41069. // whether the returned error was because http.StatusNotModified was
  41070. // returned.
  41071. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  41072. gensupport.SetOptions(c.urlParams_, opts...)
  41073. res, err := c.doRequest("json")
  41074. if res != nil && res.StatusCode == http.StatusNotModified {
  41075. if res.Body != nil {
  41076. res.Body.Close()
  41077. }
  41078. return nil, &googleapi.Error{
  41079. Code: res.StatusCode,
  41080. Header: res.Header,
  41081. }
  41082. }
  41083. if err != nil {
  41084. return nil, err
  41085. }
  41086. defer googleapi.CloseBody(res)
  41087. if err := googleapi.CheckResponse(res); err != nil {
  41088. return nil, err
  41089. }
  41090. ret := &File{
  41091. ServerResponse: googleapi.ServerResponse{
  41092. Header: res.Header,
  41093. HTTPStatusCode: res.StatusCode,
  41094. },
  41095. }
  41096. target := &ret
  41097. if err := gensupport.DecodeResponse(target, res); err != nil {
  41098. return nil, err
  41099. }
  41100. return ret, nil
  41101. // {
  41102. // "description": "Retrieves a report file. This method supports media download.",
  41103. // "httpMethod": "GET",
  41104. // "id": "dfareporting.reports.files.get",
  41105. // "parameterOrder": [
  41106. // "profileId",
  41107. // "reportId",
  41108. // "fileId"
  41109. // ],
  41110. // "parameters": {
  41111. // "fileId": {
  41112. // "description": "The ID of the report file.",
  41113. // "format": "int64",
  41114. // "location": "path",
  41115. // "required": true,
  41116. // "type": "string"
  41117. // },
  41118. // "profileId": {
  41119. // "description": "The DFA profile ID.",
  41120. // "format": "int64",
  41121. // "location": "path",
  41122. // "required": true,
  41123. // "type": "string"
  41124. // },
  41125. // "reportId": {
  41126. // "description": "The ID of the report.",
  41127. // "format": "int64",
  41128. // "location": "path",
  41129. // "required": true,
  41130. // "type": "string"
  41131. // }
  41132. // },
  41133. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  41134. // "response": {
  41135. // "$ref": "File"
  41136. // },
  41137. // "scopes": [
  41138. // "https://www.googleapis.com/auth/dfareporting"
  41139. // ],
  41140. // "supportsMediaDownload": true
  41141. // }
  41142. }
  41143. // method id "dfareporting.reports.files.list":
  41144. type ReportsFilesListCall struct {
  41145. s *Service
  41146. profileId int64
  41147. reportId int64
  41148. urlParams_ gensupport.URLParams
  41149. ifNoneMatch_ string
  41150. ctx_ context.Context
  41151. header_ http.Header
  41152. }
  41153. // List: Lists files for a report.
  41154. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  41155. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41156. c.profileId = profileId
  41157. c.reportId = reportId
  41158. return c
  41159. }
  41160. // MaxResults sets the optional parameter "maxResults": Maximum number
  41161. // of results to return.
  41162. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  41163. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41164. return c
  41165. }
  41166. // PageToken sets the optional parameter "pageToken": The value of the
  41167. // nextToken from the previous result page.
  41168. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  41169. c.urlParams_.Set("pageToken", pageToken)
  41170. return c
  41171. }
  41172. // SortField sets the optional parameter "sortField": The field by which
  41173. // to sort the list.
  41174. //
  41175. // Possible values:
  41176. // "ID" - Sort by file ID.
  41177. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  41178. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  41179. c.urlParams_.Set("sortField", sortField)
  41180. return c
  41181. }
  41182. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41183. // results.
  41184. //
  41185. // Possible values:
  41186. // "ASCENDING" - Ascending order.
  41187. // "DESCENDING" (default) - Descending order.
  41188. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  41189. c.urlParams_.Set("sortOrder", sortOrder)
  41190. return c
  41191. }
  41192. // Fields allows partial responses to be retrieved. See
  41193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41194. // for more information.
  41195. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  41196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41197. return c
  41198. }
  41199. // IfNoneMatch sets the optional parameter which makes the operation
  41200. // fail if the object's ETag matches the given value. This is useful for
  41201. // getting updates only after the object has changed since the last
  41202. // request. Use googleapi.IsNotModified to check whether the response
  41203. // error from Do is the result of In-None-Match.
  41204. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  41205. c.ifNoneMatch_ = entityTag
  41206. return c
  41207. }
  41208. // Context sets the context to be used in this call's Do method. Any
  41209. // pending HTTP request will be aborted if the provided context is
  41210. // canceled.
  41211. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  41212. c.ctx_ = ctx
  41213. return c
  41214. }
  41215. // Header returns an http.Header that can be modified by the caller to
  41216. // add HTTP headers to the request.
  41217. func (c *ReportsFilesListCall) Header() http.Header {
  41218. if c.header_ == nil {
  41219. c.header_ = make(http.Header)
  41220. }
  41221. return c.header_
  41222. }
  41223. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  41224. reqHeaders := make(http.Header)
  41225. for k, v := range c.header_ {
  41226. reqHeaders[k] = v
  41227. }
  41228. reqHeaders.Set("User-Agent", c.s.userAgent())
  41229. if c.ifNoneMatch_ != "" {
  41230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41231. }
  41232. var body io.Reader = nil
  41233. c.urlParams_.Set("alt", alt)
  41234. c.urlParams_.Set("prettyPrint", "false")
  41235. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  41236. urls += "?" + c.urlParams_.Encode()
  41237. req, err := http.NewRequest("GET", urls, body)
  41238. if err != nil {
  41239. return nil, err
  41240. }
  41241. req.Header = reqHeaders
  41242. googleapi.Expand(req.URL, map[string]string{
  41243. "profileId": strconv.FormatInt(c.profileId, 10),
  41244. "reportId": strconv.FormatInt(c.reportId, 10),
  41245. })
  41246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41247. }
  41248. // Do executes the "dfareporting.reports.files.list" call.
  41249. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  41250. // code is an error. Response headers are in either
  41251. // *FileList.ServerResponse.Header or (if a response was returned at
  41252. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41253. // to check whether the returned error was because
  41254. // http.StatusNotModified was returned.
  41255. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  41256. gensupport.SetOptions(c.urlParams_, opts...)
  41257. res, err := c.doRequest("json")
  41258. if res != nil && res.StatusCode == http.StatusNotModified {
  41259. if res.Body != nil {
  41260. res.Body.Close()
  41261. }
  41262. return nil, &googleapi.Error{
  41263. Code: res.StatusCode,
  41264. Header: res.Header,
  41265. }
  41266. }
  41267. if err != nil {
  41268. return nil, err
  41269. }
  41270. defer googleapi.CloseBody(res)
  41271. if err := googleapi.CheckResponse(res); err != nil {
  41272. return nil, err
  41273. }
  41274. ret := &FileList{
  41275. ServerResponse: googleapi.ServerResponse{
  41276. Header: res.Header,
  41277. HTTPStatusCode: res.StatusCode,
  41278. },
  41279. }
  41280. target := &ret
  41281. if err := gensupport.DecodeResponse(target, res); err != nil {
  41282. return nil, err
  41283. }
  41284. return ret, nil
  41285. // {
  41286. // "description": "Lists files for a report.",
  41287. // "httpMethod": "GET",
  41288. // "id": "dfareporting.reports.files.list",
  41289. // "parameterOrder": [
  41290. // "profileId",
  41291. // "reportId"
  41292. // ],
  41293. // "parameters": {
  41294. // "maxResults": {
  41295. // "default": "10",
  41296. // "description": "Maximum number of results to return.",
  41297. // "format": "int32",
  41298. // "location": "query",
  41299. // "maximum": "10",
  41300. // "minimum": "0",
  41301. // "type": "integer"
  41302. // },
  41303. // "pageToken": {
  41304. // "description": "The value of the nextToken from the previous result page.",
  41305. // "location": "query",
  41306. // "type": "string"
  41307. // },
  41308. // "profileId": {
  41309. // "description": "The DFA profile ID.",
  41310. // "format": "int64",
  41311. // "location": "path",
  41312. // "required": true,
  41313. // "type": "string"
  41314. // },
  41315. // "reportId": {
  41316. // "description": "The ID of the parent report.",
  41317. // "format": "int64",
  41318. // "location": "path",
  41319. // "required": true,
  41320. // "type": "string"
  41321. // },
  41322. // "sortField": {
  41323. // "default": "LAST_MODIFIED_TIME",
  41324. // "description": "The field by which to sort the list.",
  41325. // "enum": [
  41326. // "ID",
  41327. // "LAST_MODIFIED_TIME"
  41328. // ],
  41329. // "enumDescriptions": [
  41330. // "Sort by file ID.",
  41331. // "Sort by 'lastmodifiedAt' field."
  41332. // ],
  41333. // "location": "query",
  41334. // "type": "string"
  41335. // },
  41336. // "sortOrder": {
  41337. // "default": "DESCENDING",
  41338. // "description": "Order of sorted results.",
  41339. // "enum": [
  41340. // "ASCENDING",
  41341. // "DESCENDING"
  41342. // ],
  41343. // "enumDescriptions": [
  41344. // "Ascending order.",
  41345. // "Descending order."
  41346. // ],
  41347. // "location": "query",
  41348. // "type": "string"
  41349. // }
  41350. // },
  41351. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  41352. // "response": {
  41353. // "$ref": "FileList"
  41354. // },
  41355. // "scopes": [
  41356. // "https://www.googleapis.com/auth/dfareporting"
  41357. // ]
  41358. // }
  41359. }
  41360. // Pages invokes f for each page of results.
  41361. // A non-nil error returned from f will halt the iteration.
  41362. // The provided context supersedes any context provided to the Context method.
  41363. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  41364. c.ctx_ = ctx
  41365. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41366. for {
  41367. x, err := c.Do()
  41368. if err != nil {
  41369. return err
  41370. }
  41371. if err := f(x); err != nil {
  41372. return err
  41373. }
  41374. if x.NextPageToken == "" {
  41375. return nil
  41376. }
  41377. c.PageToken(x.NextPageToken)
  41378. }
  41379. }
  41380. // method id "dfareporting.sites.get":
  41381. type SitesGetCall struct {
  41382. s *Service
  41383. profileId int64
  41384. id int64
  41385. urlParams_ gensupport.URLParams
  41386. ifNoneMatch_ string
  41387. ctx_ context.Context
  41388. header_ http.Header
  41389. }
  41390. // Get: Gets one site by ID.
  41391. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  41392. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41393. c.profileId = profileId
  41394. c.id = id
  41395. return c
  41396. }
  41397. // Fields allows partial responses to be retrieved. See
  41398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41399. // for more information.
  41400. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  41401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41402. return c
  41403. }
  41404. // IfNoneMatch sets the optional parameter which makes the operation
  41405. // fail if the object's ETag matches the given value. This is useful for
  41406. // getting updates only after the object has changed since the last
  41407. // request. Use googleapi.IsNotModified to check whether the response
  41408. // error from Do is the result of In-None-Match.
  41409. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  41410. c.ifNoneMatch_ = entityTag
  41411. return c
  41412. }
  41413. // Context sets the context to be used in this call's Do method. Any
  41414. // pending HTTP request will be aborted if the provided context is
  41415. // canceled.
  41416. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  41417. c.ctx_ = ctx
  41418. return c
  41419. }
  41420. // Header returns an http.Header that can be modified by the caller to
  41421. // add HTTP headers to the request.
  41422. func (c *SitesGetCall) Header() http.Header {
  41423. if c.header_ == nil {
  41424. c.header_ = make(http.Header)
  41425. }
  41426. return c.header_
  41427. }
  41428. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  41429. reqHeaders := make(http.Header)
  41430. for k, v := range c.header_ {
  41431. reqHeaders[k] = v
  41432. }
  41433. reqHeaders.Set("User-Agent", c.s.userAgent())
  41434. if c.ifNoneMatch_ != "" {
  41435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41436. }
  41437. var body io.Reader = nil
  41438. c.urlParams_.Set("alt", alt)
  41439. c.urlParams_.Set("prettyPrint", "false")
  41440. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  41441. urls += "?" + c.urlParams_.Encode()
  41442. req, err := http.NewRequest("GET", urls, body)
  41443. if err != nil {
  41444. return nil, err
  41445. }
  41446. req.Header = reqHeaders
  41447. googleapi.Expand(req.URL, map[string]string{
  41448. "profileId": strconv.FormatInt(c.profileId, 10),
  41449. "id": strconv.FormatInt(c.id, 10),
  41450. })
  41451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41452. }
  41453. // Do executes the "dfareporting.sites.get" call.
  41454. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41455. // code is an error. Response headers are in either
  41456. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41457. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41458. // whether the returned error was because http.StatusNotModified was
  41459. // returned.
  41460. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41461. gensupport.SetOptions(c.urlParams_, opts...)
  41462. res, err := c.doRequest("json")
  41463. if res != nil && res.StatusCode == http.StatusNotModified {
  41464. if res.Body != nil {
  41465. res.Body.Close()
  41466. }
  41467. return nil, &googleapi.Error{
  41468. Code: res.StatusCode,
  41469. Header: res.Header,
  41470. }
  41471. }
  41472. if err != nil {
  41473. return nil, err
  41474. }
  41475. defer googleapi.CloseBody(res)
  41476. if err := googleapi.CheckResponse(res); err != nil {
  41477. return nil, err
  41478. }
  41479. ret := &Site{
  41480. ServerResponse: googleapi.ServerResponse{
  41481. Header: res.Header,
  41482. HTTPStatusCode: res.StatusCode,
  41483. },
  41484. }
  41485. target := &ret
  41486. if err := gensupport.DecodeResponse(target, res); err != nil {
  41487. return nil, err
  41488. }
  41489. return ret, nil
  41490. // {
  41491. // "description": "Gets one site by ID.",
  41492. // "httpMethod": "GET",
  41493. // "id": "dfareporting.sites.get",
  41494. // "parameterOrder": [
  41495. // "profileId",
  41496. // "id"
  41497. // ],
  41498. // "parameters": {
  41499. // "id": {
  41500. // "description": "Site ID.",
  41501. // "format": "int64",
  41502. // "location": "path",
  41503. // "required": true,
  41504. // "type": "string"
  41505. // },
  41506. // "profileId": {
  41507. // "description": "User profile ID associated with this request.",
  41508. // "format": "int64",
  41509. // "location": "path",
  41510. // "required": true,
  41511. // "type": "string"
  41512. // }
  41513. // },
  41514. // "path": "userprofiles/{profileId}/sites/{id}",
  41515. // "response": {
  41516. // "$ref": "Site"
  41517. // },
  41518. // "scopes": [
  41519. // "https://www.googleapis.com/auth/dfatrafficking"
  41520. // ]
  41521. // }
  41522. }
  41523. // method id "dfareporting.sites.insert":
  41524. type SitesInsertCall struct {
  41525. s *Service
  41526. profileId int64
  41527. site *Site
  41528. urlParams_ gensupport.URLParams
  41529. ctx_ context.Context
  41530. header_ http.Header
  41531. }
  41532. // Insert: Inserts a new site.
  41533. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  41534. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41535. c.profileId = profileId
  41536. c.site = site
  41537. return c
  41538. }
  41539. // Fields allows partial responses to be retrieved. See
  41540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41541. // for more information.
  41542. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  41543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41544. return c
  41545. }
  41546. // Context sets the context to be used in this call's Do method. Any
  41547. // pending HTTP request will be aborted if the provided context is
  41548. // canceled.
  41549. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  41550. c.ctx_ = ctx
  41551. return c
  41552. }
  41553. // Header returns an http.Header that can be modified by the caller to
  41554. // add HTTP headers to the request.
  41555. func (c *SitesInsertCall) Header() http.Header {
  41556. if c.header_ == nil {
  41557. c.header_ = make(http.Header)
  41558. }
  41559. return c.header_
  41560. }
  41561. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  41562. reqHeaders := make(http.Header)
  41563. for k, v := range c.header_ {
  41564. reqHeaders[k] = v
  41565. }
  41566. reqHeaders.Set("User-Agent", c.s.userAgent())
  41567. var body io.Reader = nil
  41568. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41569. if err != nil {
  41570. return nil, err
  41571. }
  41572. reqHeaders.Set("Content-Type", "application/json")
  41573. c.urlParams_.Set("alt", alt)
  41574. c.urlParams_.Set("prettyPrint", "false")
  41575. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41576. urls += "?" + c.urlParams_.Encode()
  41577. req, err := http.NewRequest("POST", urls, body)
  41578. if err != nil {
  41579. return nil, err
  41580. }
  41581. req.Header = reqHeaders
  41582. googleapi.Expand(req.URL, map[string]string{
  41583. "profileId": strconv.FormatInt(c.profileId, 10),
  41584. })
  41585. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41586. }
  41587. // Do executes the "dfareporting.sites.insert" call.
  41588. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41589. // code is an error. Response headers are in either
  41590. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41591. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41592. // whether the returned error was because http.StatusNotModified was
  41593. // returned.
  41594. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41595. gensupport.SetOptions(c.urlParams_, opts...)
  41596. res, err := c.doRequest("json")
  41597. if res != nil && res.StatusCode == http.StatusNotModified {
  41598. if res.Body != nil {
  41599. res.Body.Close()
  41600. }
  41601. return nil, &googleapi.Error{
  41602. Code: res.StatusCode,
  41603. Header: res.Header,
  41604. }
  41605. }
  41606. if err != nil {
  41607. return nil, err
  41608. }
  41609. defer googleapi.CloseBody(res)
  41610. if err := googleapi.CheckResponse(res); err != nil {
  41611. return nil, err
  41612. }
  41613. ret := &Site{
  41614. ServerResponse: googleapi.ServerResponse{
  41615. Header: res.Header,
  41616. HTTPStatusCode: res.StatusCode,
  41617. },
  41618. }
  41619. target := &ret
  41620. if err := gensupport.DecodeResponse(target, res); err != nil {
  41621. return nil, err
  41622. }
  41623. return ret, nil
  41624. // {
  41625. // "description": "Inserts a new site.",
  41626. // "httpMethod": "POST",
  41627. // "id": "dfareporting.sites.insert",
  41628. // "parameterOrder": [
  41629. // "profileId"
  41630. // ],
  41631. // "parameters": {
  41632. // "profileId": {
  41633. // "description": "User profile ID associated with this request.",
  41634. // "format": "int64",
  41635. // "location": "path",
  41636. // "required": true,
  41637. // "type": "string"
  41638. // }
  41639. // },
  41640. // "path": "userprofiles/{profileId}/sites",
  41641. // "request": {
  41642. // "$ref": "Site"
  41643. // },
  41644. // "response": {
  41645. // "$ref": "Site"
  41646. // },
  41647. // "scopes": [
  41648. // "https://www.googleapis.com/auth/dfatrafficking"
  41649. // ]
  41650. // }
  41651. }
  41652. // method id "dfareporting.sites.list":
  41653. type SitesListCall struct {
  41654. s *Service
  41655. profileId int64
  41656. urlParams_ gensupport.URLParams
  41657. ifNoneMatch_ string
  41658. ctx_ context.Context
  41659. header_ http.Header
  41660. }
  41661. // List: Retrieves a list of sites, possibly filtered. This method
  41662. // supports paging.
  41663. func (r *SitesService) List(profileId int64) *SitesListCall {
  41664. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41665. c.profileId = profileId
  41666. return c
  41667. }
  41668. // AcceptsInStreamVideoPlacements sets the optional parameter
  41669. // "acceptsInStreamVideoPlacements": This search filter is no longer
  41670. // supported and will have no effect on the results returned.
  41671. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  41672. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  41673. return c
  41674. }
  41675. // AcceptsInterstitialPlacements sets the optional parameter
  41676. // "acceptsInterstitialPlacements": This search filter is no longer
  41677. // supported and will have no effect on the results returned.
  41678. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  41679. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  41680. return c
  41681. }
  41682. // AcceptsPublisherPaidPlacements sets the optional parameter
  41683. // "acceptsPublisherPaidPlacements": Select only sites that accept
  41684. // publisher paid placements.
  41685. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  41686. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  41687. return c
  41688. }
  41689. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  41690. // AdWords sites.
  41691. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  41692. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  41693. return c
  41694. }
  41695. // Approved sets the optional parameter "approved": Select only approved
  41696. // sites.
  41697. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  41698. c.urlParams_.Set("approved", fmt.Sprint(approved))
  41699. return c
  41700. }
  41701. // CampaignIds sets the optional parameter "campaignIds": Select only
  41702. // sites with these campaign IDs.
  41703. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  41704. var campaignIds_ []string
  41705. for _, v := range campaignIds {
  41706. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  41707. }
  41708. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  41709. return c
  41710. }
  41711. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  41712. // Select only sites with these directory site IDs.
  41713. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  41714. var directorySiteIds_ []string
  41715. for _, v := range directorySiteIds {
  41716. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  41717. }
  41718. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  41719. return c
  41720. }
  41721. // Ids sets the optional parameter "ids": Select only sites with these
  41722. // IDs.
  41723. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  41724. var ids_ []string
  41725. for _, v := range ids {
  41726. ids_ = append(ids_, fmt.Sprint(v))
  41727. }
  41728. c.urlParams_.SetMulti("ids", ids_)
  41729. return c
  41730. }
  41731. // MaxResults sets the optional parameter "maxResults": Maximum number
  41732. // of results to return.
  41733. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  41734. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41735. return c
  41736. }
  41737. // PageToken sets the optional parameter "pageToken": Value of the
  41738. // nextPageToken from the previous result page.
  41739. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  41740. c.urlParams_.Set("pageToken", pageToken)
  41741. return c
  41742. }
  41743. // SearchString sets the optional parameter "searchString": Allows
  41744. // searching for objects by name, ID or keyName. Wildcards (*) are
  41745. // allowed. For example, "site*2015" will return objects with names like
  41746. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  41747. // the searches also add wildcards implicitly at the start and the end
  41748. // of the search string. For example, a search string of "site" will
  41749. // match objects with name "my site", "site 2015", or simply "site".
  41750. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  41751. c.urlParams_.Set("searchString", searchString)
  41752. return c
  41753. }
  41754. // SortField sets the optional parameter "sortField": Field by which to
  41755. // sort the list.
  41756. //
  41757. // Possible values:
  41758. // "ID" (default)
  41759. // "NAME"
  41760. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  41761. c.urlParams_.Set("sortField", sortField)
  41762. return c
  41763. }
  41764. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41765. // results.
  41766. //
  41767. // Possible values:
  41768. // "ASCENDING" (default)
  41769. // "DESCENDING"
  41770. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  41771. c.urlParams_.Set("sortOrder", sortOrder)
  41772. return c
  41773. }
  41774. // SubaccountId sets the optional parameter "subaccountId": Select only
  41775. // sites with this subaccount ID.
  41776. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  41777. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  41778. return c
  41779. }
  41780. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  41781. // sites that have not been mapped to a directory site.
  41782. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  41783. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  41784. return c
  41785. }
  41786. // Fields allows partial responses to be retrieved. See
  41787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41788. // for more information.
  41789. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  41790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41791. return c
  41792. }
  41793. // IfNoneMatch sets the optional parameter which makes the operation
  41794. // fail if the object's ETag matches the given value. This is useful for
  41795. // getting updates only after the object has changed since the last
  41796. // request. Use googleapi.IsNotModified to check whether the response
  41797. // error from Do is the result of In-None-Match.
  41798. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  41799. c.ifNoneMatch_ = entityTag
  41800. return c
  41801. }
  41802. // Context sets the context to be used in this call's Do method. Any
  41803. // pending HTTP request will be aborted if the provided context is
  41804. // canceled.
  41805. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  41806. c.ctx_ = ctx
  41807. return c
  41808. }
  41809. // Header returns an http.Header that can be modified by the caller to
  41810. // add HTTP headers to the request.
  41811. func (c *SitesListCall) Header() http.Header {
  41812. if c.header_ == nil {
  41813. c.header_ = make(http.Header)
  41814. }
  41815. return c.header_
  41816. }
  41817. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  41818. reqHeaders := make(http.Header)
  41819. for k, v := range c.header_ {
  41820. reqHeaders[k] = v
  41821. }
  41822. reqHeaders.Set("User-Agent", c.s.userAgent())
  41823. if c.ifNoneMatch_ != "" {
  41824. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41825. }
  41826. var body io.Reader = nil
  41827. c.urlParams_.Set("alt", alt)
  41828. c.urlParams_.Set("prettyPrint", "false")
  41829. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41830. urls += "?" + c.urlParams_.Encode()
  41831. req, err := http.NewRequest("GET", urls, body)
  41832. if err != nil {
  41833. return nil, err
  41834. }
  41835. req.Header = reqHeaders
  41836. googleapi.Expand(req.URL, map[string]string{
  41837. "profileId": strconv.FormatInt(c.profileId, 10),
  41838. })
  41839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41840. }
  41841. // Do executes the "dfareporting.sites.list" call.
  41842. // Exactly one of *SitesListResponse or error will be non-nil. Any
  41843. // non-2xx status code is an error. Response headers are in either
  41844. // *SitesListResponse.ServerResponse.Header or (if a response was
  41845. // returned at all) in error.(*googleapi.Error).Header. Use
  41846. // googleapi.IsNotModified to check whether the returned error was
  41847. // because http.StatusNotModified was returned.
  41848. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  41849. gensupport.SetOptions(c.urlParams_, opts...)
  41850. res, err := c.doRequest("json")
  41851. if res != nil && res.StatusCode == http.StatusNotModified {
  41852. if res.Body != nil {
  41853. res.Body.Close()
  41854. }
  41855. return nil, &googleapi.Error{
  41856. Code: res.StatusCode,
  41857. Header: res.Header,
  41858. }
  41859. }
  41860. if err != nil {
  41861. return nil, err
  41862. }
  41863. defer googleapi.CloseBody(res)
  41864. if err := googleapi.CheckResponse(res); err != nil {
  41865. return nil, err
  41866. }
  41867. ret := &SitesListResponse{
  41868. ServerResponse: googleapi.ServerResponse{
  41869. Header: res.Header,
  41870. HTTPStatusCode: res.StatusCode,
  41871. },
  41872. }
  41873. target := &ret
  41874. if err := gensupport.DecodeResponse(target, res); err != nil {
  41875. return nil, err
  41876. }
  41877. return ret, nil
  41878. // {
  41879. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  41880. // "httpMethod": "GET",
  41881. // "id": "dfareporting.sites.list",
  41882. // "parameterOrder": [
  41883. // "profileId"
  41884. // ],
  41885. // "parameters": {
  41886. // "acceptsInStreamVideoPlacements": {
  41887. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41888. // "location": "query",
  41889. // "type": "boolean"
  41890. // },
  41891. // "acceptsInterstitialPlacements": {
  41892. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41893. // "location": "query",
  41894. // "type": "boolean"
  41895. // },
  41896. // "acceptsPublisherPaidPlacements": {
  41897. // "description": "Select only sites that accept publisher paid placements.",
  41898. // "location": "query",
  41899. // "type": "boolean"
  41900. // },
  41901. // "adWordsSite": {
  41902. // "description": "Select only AdWords sites.",
  41903. // "location": "query",
  41904. // "type": "boolean"
  41905. // },
  41906. // "approved": {
  41907. // "description": "Select only approved sites.",
  41908. // "location": "query",
  41909. // "type": "boolean"
  41910. // },
  41911. // "campaignIds": {
  41912. // "description": "Select only sites with these campaign IDs.",
  41913. // "format": "int64",
  41914. // "location": "query",
  41915. // "repeated": true,
  41916. // "type": "string"
  41917. // },
  41918. // "directorySiteIds": {
  41919. // "description": "Select only sites with these directory site IDs.",
  41920. // "format": "int64",
  41921. // "location": "query",
  41922. // "repeated": true,
  41923. // "type": "string"
  41924. // },
  41925. // "ids": {
  41926. // "description": "Select only sites with these IDs.",
  41927. // "format": "int64",
  41928. // "location": "query",
  41929. // "repeated": true,
  41930. // "type": "string"
  41931. // },
  41932. // "maxResults": {
  41933. // "default": "1000",
  41934. // "description": "Maximum number of results to return.",
  41935. // "format": "int32",
  41936. // "location": "query",
  41937. // "maximum": "1000",
  41938. // "minimum": "0",
  41939. // "type": "integer"
  41940. // },
  41941. // "pageToken": {
  41942. // "description": "Value of the nextPageToken from the previous result page.",
  41943. // "location": "query",
  41944. // "type": "string"
  41945. // },
  41946. // "profileId": {
  41947. // "description": "User profile ID associated with this request.",
  41948. // "format": "int64",
  41949. // "location": "path",
  41950. // "required": true,
  41951. // "type": "string"
  41952. // },
  41953. // "searchString": {
  41954. // "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\".",
  41955. // "location": "query",
  41956. // "type": "string"
  41957. // },
  41958. // "sortField": {
  41959. // "default": "ID",
  41960. // "description": "Field by which to sort the list.",
  41961. // "enum": [
  41962. // "ID",
  41963. // "NAME"
  41964. // ],
  41965. // "enumDescriptions": [
  41966. // "",
  41967. // ""
  41968. // ],
  41969. // "location": "query",
  41970. // "type": "string"
  41971. // },
  41972. // "sortOrder": {
  41973. // "default": "ASCENDING",
  41974. // "description": "Order of sorted results.",
  41975. // "enum": [
  41976. // "ASCENDING",
  41977. // "DESCENDING"
  41978. // ],
  41979. // "enumDescriptions": [
  41980. // "",
  41981. // ""
  41982. // ],
  41983. // "location": "query",
  41984. // "type": "string"
  41985. // },
  41986. // "subaccountId": {
  41987. // "description": "Select only sites with this subaccount ID.",
  41988. // "format": "int64",
  41989. // "location": "query",
  41990. // "type": "string"
  41991. // },
  41992. // "unmappedSite": {
  41993. // "description": "Select only sites that have not been mapped to a directory site.",
  41994. // "location": "query",
  41995. // "type": "boolean"
  41996. // }
  41997. // },
  41998. // "path": "userprofiles/{profileId}/sites",
  41999. // "response": {
  42000. // "$ref": "SitesListResponse"
  42001. // },
  42002. // "scopes": [
  42003. // "https://www.googleapis.com/auth/dfatrafficking"
  42004. // ]
  42005. // }
  42006. }
  42007. // Pages invokes f for each page of results.
  42008. // A non-nil error returned from f will halt the iteration.
  42009. // The provided context supersedes any context provided to the Context method.
  42010. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  42011. c.ctx_ = ctx
  42012. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42013. for {
  42014. x, err := c.Do()
  42015. if err != nil {
  42016. return err
  42017. }
  42018. if err := f(x); err != nil {
  42019. return err
  42020. }
  42021. if x.NextPageToken == "" {
  42022. return nil
  42023. }
  42024. c.PageToken(x.NextPageToken)
  42025. }
  42026. }
  42027. // method id "dfareporting.sites.patch":
  42028. type SitesPatchCall struct {
  42029. s *Service
  42030. profileId int64
  42031. site *Site
  42032. urlParams_ gensupport.URLParams
  42033. ctx_ context.Context
  42034. header_ http.Header
  42035. }
  42036. // Patch: Updates an existing site. This method supports patch
  42037. // semantics.
  42038. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  42039. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42040. c.profileId = profileId
  42041. c.urlParams_.Set("id", fmt.Sprint(id))
  42042. c.site = site
  42043. return c
  42044. }
  42045. // Fields allows partial responses to be retrieved. See
  42046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42047. // for more information.
  42048. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  42049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42050. return c
  42051. }
  42052. // Context sets the context to be used in this call's Do method. Any
  42053. // pending HTTP request will be aborted if the provided context is
  42054. // canceled.
  42055. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  42056. c.ctx_ = ctx
  42057. return c
  42058. }
  42059. // Header returns an http.Header that can be modified by the caller to
  42060. // add HTTP headers to the request.
  42061. func (c *SitesPatchCall) Header() http.Header {
  42062. if c.header_ == nil {
  42063. c.header_ = make(http.Header)
  42064. }
  42065. return c.header_
  42066. }
  42067. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  42068. reqHeaders := make(http.Header)
  42069. for k, v := range c.header_ {
  42070. reqHeaders[k] = v
  42071. }
  42072. reqHeaders.Set("User-Agent", c.s.userAgent())
  42073. var body io.Reader = nil
  42074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  42075. if err != nil {
  42076. return nil, err
  42077. }
  42078. reqHeaders.Set("Content-Type", "application/json")
  42079. c.urlParams_.Set("alt", alt)
  42080. c.urlParams_.Set("prettyPrint", "false")
  42081. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  42082. urls += "?" + c.urlParams_.Encode()
  42083. req, err := http.NewRequest("PATCH", urls, body)
  42084. if err != nil {
  42085. return nil, err
  42086. }
  42087. req.Header = reqHeaders
  42088. googleapi.Expand(req.URL, map[string]string{
  42089. "profileId": strconv.FormatInt(c.profileId, 10),
  42090. })
  42091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42092. }
  42093. // Do executes the "dfareporting.sites.patch" call.
  42094. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  42095. // code is an error. Response headers are in either
  42096. // *Site.ServerResponse.Header or (if a response was returned at all) in
  42097. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42098. // whether the returned error was because http.StatusNotModified was
  42099. // returned.
  42100. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  42101. gensupport.SetOptions(c.urlParams_, opts...)
  42102. res, err := c.doRequest("json")
  42103. if res != nil && res.StatusCode == http.StatusNotModified {
  42104. if res.Body != nil {
  42105. res.Body.Close()
  42106. }
  42107. return nil, &googleapi.Error{
  42108. Code: res.StatusCode,
  42109. Header: res.Header,
  42110. }
  42111. }
  42112. if err != nil {
  42113. return nil, err
  42114. }
  42115. defer googleapi.CloseBody(res)
  42116. if err := googleapi.CheckResponse(res); err != nil {
  42117. return nil, err
  42118. }
  42119. ret := &Site{
  42120. ServerResponse: googleapi.ServerResponse{
  42121. Header: res.Header,
  42122. HTTPStatusCode: res.StatusCode,
  42123. },
  42124. }
  42125. target := &ret
  42126. if err := gensupport.DecodeResponse(target, res); err != nil {
  42127. return nil, err
  42128. }
  42129. return ret, nil
  42130. // {
  42131. // "description": "Updates an existing site. This method supports patch semantics.",
  42132. // "httpMethod": "PATCH",
  42133. // "id": "dfareporting.sites.patch",
  42134. // "parameterOrder": [
  42135. // "profileId",
  42136. // "id"
  42137. // ],
  42138. // "parameters": {
  42139. // "id": {
  42140. // "description": "Site ID.",
  42141. // "format": "int64",
  42142. // "location": "query",
  42143. // "required": true,
  42144. // "type": "string"
  42145. // },
  42146. // "profileId": {
  42147. // "description": "User profile ID associated with this request.",
  42148. // "format": "int64",
  42149. // "location": "path",
  42150. // "required": true,
  42151. // "type": "string"
  42152. // }
  42153. // },
  42154. // "path": "userprofiles/{profileId}/sites",
  42155. // "request": {
  42156. // "$ref": "Site"
  42157. // },
  42158. // "response": {
  42159. // "$ref": "Site"
  42160. // },
  42161. // "scopes": [
  42162. // "https://www.googleapis.com/auth/dfatrafficking"
  42163. // ]
  42164. // }
  42165. }
  42166. // method id "dfareporting.sites.update":
  42167. type SitesUpdateCall struct {
  42168. s *Service
  42169. profileId int64
  42170. site *Site
  42171. urlParams_ gensupport.URLParams
  42172. ctx_ context.Context
  42173. header_ http.Header
  42174. }
  42175. // Update: Updates an existing site.
  42176. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  42177. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42178. c.profileId = profileId
  42179. c.site = site
  42180. return c
  42181. }
  42182. // Fields allows partial responses to be retrieved. See
  42183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42184. // for more information.
  42185. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  42186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42187. return c
  42188. }
  42189. // Context sets the context to be used in this call's Do method. Any
  42190. // pending HTTP request will be aborted if the provided context is
  42191. // canceled.
  42192. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  42193. c.ctx_ = ctx
  42194. return c
  42195. }
  42196. // Header returns an http.Header that can be modified by the caller to
  42197. // add HTTP headers to the request.
  42198. func (c *SitesUpdateCall) Header() http.Header {
  42199. if c.header_ == nil {
  42200. c.header_ = make(http.Header)
  42201. }
  42202. return c.header_
  42203. }
  42204. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  42205. reqHeaders := make(http.Header)
  42206. for k, v := range c.header_ {
  42207. reqHeaders[k] = v
  42208. }
  42209. reqHeaders.Set("User-Agent", c.s.userAgent())
  42210. var body io.Reader = nil
  42211. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  42212. if err != nil {
  42213. return nil, err
  42214. }
  42215. reqHeaders.Set("Content-Type", "application/json")
  42216. c.urlParams_.Set("alt", alt)
  42217. c.urlParams_.Set("prettyPrint", "false")
  42218. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  42219. urls += "?" + c.urlParams_.Encode()
  42220. req, err := http.NewRequest("PUT", urls, body)
  42221. if err != nil {
  42222. return nil, err
  42223. }
  42224. req.Header = reqHeaders
  42225. googleapi.Expand(req.URL, map[string]string{
  42226. "profileId": strconv.FormatInt(c.profileId, 10),
  42227. })
  42228. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42229. }
  42230. // Do executes the "dfareporting.sites.update" call.
  42231. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  42232. // code is an error. Response headers are in either
  42233. // *Site.ServerResponse.Header or (if a response was returned at all) in
  42234. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42235. // whether the returned error was because http.StatusNotModified was
  42236. // returned.
  42237. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  42238. gensupport.SetOptions(c.urlParams_, opts...)
  42239. res, err := c.doRequest("json")
  42240. if res != nil && res.StatusCode == http.StatusNotModified {
  42241. if res.Body != nil {
  42242. res.Body.Close()
  42243. }
  42244. return nil, &googleapi.Error{
  42245. Code: res.StatusCode,
  42246. Header: res.Header,
  42247. }
  42248. }
  42249. if err != nil {
  42250. return nil, err
  42251. }
  42252. defer googleapi.CloseBody(res)
  42253. if err := googleapi.CheckResponse(res); err != nil {
  42254. return nil, err
  42255. }
  42256. ret := &Site{
  42257. ServerResponse: googleapi.ServerResponse{
  42258. Header: res.Header,
  42259. HTTPStatusCode: res.StatusCode,
  42260. },
  42261. }
  42262. target := &ret
  42263. if err := gensupport.DecodeResponse(target, res); err != nil {
  42264. return nil, err
  42265. }
  42266. return ret, nil
  42267. // {
  42268. // "description": "Updates an existing site.",
  42269. // "httpMethod": "PUT",
  42270. // "id": "dfareporting.sites.update",
  42271. // "parameterOrder": [
  42272. // "profileId"
  42273. // ],
  42274. // "parameters": {
  42275. // "profileId": {
  42276. // "description": "User profile ID associated with this request.",
  42277. // "format": "int64",
  42278. // "location": "path",
  42279. // "required": true,
  42280. // "type": "string"
  42281. // }
  42282. // },
  42283. // "path": "userprofiles/{profileId}/sites",
  42284. // "request": {
  42285. // "$ref": "Site"
  42286. // },
  42287. // "response": {
  42288. // "$ref": "Site"
  42289. // },
  42290. // "scopes": [
  42291. // "https://www.googleapis.com/auth/dfatrafficking"
  42292. // ]
  42293. // }
  42294. }
  42295. // method id "dfareporting.sizes.get":
  42296. type SizesGetCall 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 size by ID.
  42306. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  42307. c := &SizesGetCall{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 *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  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 *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  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 *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  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 *SizesGetCall) Header() http.Header {
  42338. if c.header_ == nil {
  42339. c.header_ = make(http.Header)
  42340. }
  42341. return c.header_
  42342. }
  42343. func (c *SizesGetCall) 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}/sizes/{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.sizes.get" call.
  42369. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  42370. // code is an error. Response headers are in either
  42371. // *Size.ServerResponse.Header or (if a response was returned at all) in
  42372. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42373. // whether the returned error was because http.StatusNotModified was
  42374. // returned.
  42375. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, 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 := &Size{
  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 size by ID.",
  42407. // "httpMethod": "GET",
  42408. // "id": "dfareporting.sizes.get",
  42409. // "parameterOrder": [
  42410. // "profileId",
  42411. // "id"
  42412. // ],
  42413. // "parameters": {
  42414. // "id": {
  42415. // "description": "Size 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}/sizes/{id}",
  42430. // "response": {
  42431. // "$ref": "Size"
  42432. // },
  42433. // "scopes": [
  42434. // "https://www.googleapis.com/auth/dfatrafficking"
  42435. // ]
  42436. // }
  42437. }
  42438. // method id "dfareporting.sizes.insert":
  42439. type SizesInsertCall struct {
  42440. s *Service
  42441. profileId int64
  42442. size *Size
  42443. urlParams_ gensupport.URLParams
  42444. ctx_ context.Context
  42445. header_ http.Header
  42446. }
  42447. // Insert: Inserts a new size.
  42448. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  42449. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42450. c.profileId = profileId
  42451. c.size = size
  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 *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  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 *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  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 *SizesInsertCall) Header() http.Header {
  42471. if c.header_ == nil {
  42472. c.header_ = make(http.Header)
  42473. }
  42474. return c.header_
  42475. }
  42476. func (c *SizesInsertCall) 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.size)
  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}/sizes")
  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.sizes.insert" call.
  42503. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  42504. // code is an error. Response headers are in either
  42505. // *Size.ServerResponse.Header or (if a response was returned at all) in
  42506. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42507. // whether the returned error was because http.StatusNotModified was
  42508. // returned.
  42509. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, 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 := &Size{
  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 size.",
  42541. // "httpMethod": "POST",
  42542. // "id": "dfareporting.sizes.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}/sizes",
  42556. // "request": {
  42557. // "$ref": "Size"
  42558. // },
  42559. // "response": {
  42560. // "$ref": "Size"
  42561. // },
  42562. // "scopes": [
  42563. // "https://www.googleapis.com/auth/dfatrafficking"
  42564. // ]
  42565. // }
  42566. }
  42567. // method id "dfareporting.sizes.list":
  42568. type SizesListCall 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: Retrieves a list of sizes, possibly filtered. Retrieved sizes
  42577. // are globally unique and may include values not currently in use by
  42578. // your account. Due to this, the list of sizes returned by this method
  42579. // may differ from the list seen in the Trafficking UI.
  42580. func (r *SizesService) List(profileId int64) *SizesListCall {
  42581. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42582. c.profileId = profileId
  42583. return c
  42584. }
  42585. // Height sets the optional parameter "height": Select only sizes with
  42586. // this height.
  42587. func (c *SizesListCall) Height(height int64) *SizesListCall {
  42588. c.urlParams_.Set("height", fmt.Sprint(height))
  42589. return c
  42590. }
  42591. // IabStandard sets the optional parameter "iabStandard": Select only
  42592. // IAB standard sizes.
  42593. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  42594. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  42595. return c
  42596. }
  42597. // Ids sets the optional parameter "ids": Select only sizes with these
  42598. // IDs.
  42599. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  42600. var ids_ []string
  42601. for _, v := range ids {
  42602. ids_ = append(ids_, fmt.Sprint(v))
  42603. }
  42604. c.urlParams_.SetMulti("ids", ids_)
  42605. return c
  42606. }
  42607. // Width sets the optional parameter "width": Select only sizes with
  42608. // this width.
  42609. func (c *SizesListCall) Width(width int64) *SizesListCall {
  42610. c.urlParams_.Set("width", fmt.Sprint(width))
  42611. return c
  42612. }
  42613. // Fields allows partial responses to be retrieved. See
  42614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42615. // for more information.
  42616. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  42617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42618. return c
  42619. }
  42620. // IfNoneMatch sets the optional parameter which makes the operation
  42621. // fail if the object's ETag matches the given value. This is useful for
  42622. // getting updates only after the object has changed since the last
  42623. // request. Use googleapi.IsNotModified to check whether the response
  42624. // error from Do is the result of In-None-Match.
  42625. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  42626. c.ifNoneMatch_ = entityTag
  42627. return c
  42628. }
  42629. // Context sets the context to be used in this call's Do method. Any
  42630. // pending HTTP request will be aborted if the provided context is
  42631. // canceled.
  42632. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  42633. c.ctx_ = ctx
  42634. return c
  42635. }
  42636. // Header returns an http.Header that can be modified by the caller to
  42637. // add HTTP headers to the request.
  42638. func (c *SizesListCall) Header() http.Header {
  42639. if c.header_ == nil {
  42640. c.header_ = make(http.Header)
  42641. }
  42642. return c.header_
  42643. }
  42644. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  42645. reqHeaders := make(http.Header)
  42646. for k, v := range c.header_ {
  42647. reqHeaders[k] = v
  42648. }
  42649. reqHeaders.Set("User-Agent", c.s.userAgent())
  42650. if c.ifNoneMatch_ != "" {
  42651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42652. }
  42653. var body io.Reader = nil
  42654. c.urlParams_.Set("alt", alt)
  42655. c.urlParams_.Set("prettyPrint", "false")
  42656. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  42657. urls += "?" + c.urlParams_.Encode()
  42658. req, err := http.NewRequest("GET", urls, body)
  42659. if err != nil {
  42660. return nil, err
  42661. }
  42662. req.Header = reqHeaders
  42663. googleapi.Expand(req.URL, map[string]string{
  42664. "profileId": strconv.FormatInt(c.profileId, 10),
  42665. })
  42666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42667. }
  42668. // Do executes the "dfareporting.sizes.list" call.
  42669. // Exactly one of *SizesListResponse or error will be non-nil. Any
  42670. // non-2xx status code is an error. Response headers are in either
  42671. // *SizesListResponse.ServerResponse.Header or (if a response was
  42672. // returned at all) in error.(*googleapi.Error).Header. Use
  42673. // googleapi.IsNotModified to check whether the returned error was
  42674. // because http.StatusNotModified was returned.
  42675. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  42676. gensupport.SetOptions(c.urlParams_, opts...)
  42677. res, err := c.doRequest("json")
  42678. if res != nil && res.StatusCode == http.StatusNotModified {
  42679. if res.Body != nil {
  42680. res.Body.Close()
  42681. }
  42682. return nil, &googleapi.Error{
  42683. Code: res.StatusCode,
  42684. Header: res.Header,
  42685. }
  42686. }
  42687. if err != nil {
  42688. return nil, err
  42689. }
  42690. defer googleapi.CloseBody(res)
  42691. if err := googleapi.CheckResponse(res); err != nil {
  42692. return nil, err
  42693. }
  42694. ret := &SizesListResponse{
  42695. ServerResponse: googleapi.ServerResponse{
  42696. Header: res.Header,
  42697. HTTPStatusCode: res.StatusCode,
  42698. },
  42699. }
  42700. target := &ret
  42701. if err := gensupport.DecodeResponse(target, res); err != nil {
  42702. return nil, err
  42703. }
  42704. return ret, nil
  42705. // {
  42706. // "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.",
  42707. // "httpMethod": "GET",
  42708. // "id": "dfareporting.sizes.list",
  42709. // "parameterOrder": [
  42710. // "profileId"
  42711. // ],
  42712. // "parameters": {
  42713. // "height": {
  42714. // "description": "Select only sizes with this height.",
  42715. // "format": "int32",
  42716. // "location": "query",
  42717. // "maximum": "32767",
  42718. // "minimum": "0",
  42719. // "type": "integer"
  42720. // },
  42721. // "iabStandard": {
  42722. // "description": "Select only IAB standard sizes.",
  42723. // "location": "query",
  42724. // "type": "boolean"
  42725. // },
  42726. // "ids": {
  42727. // "description": "Select only sizes with these IDs.",
  42728. // "format": "int64",
  42729. // "location": "query",
  42730. // "repeated": true,
  42731. // "type": "string"
  42732. // },
  42733. // "profileId": {
  42734. // "description": "User profile ID associated with this request.",
  42735. // "format": "int64",
  42736. // "location": "path",
  42737. // "required": true,
  42738. // "type": "string"
  42739. // },
  42740. // "width": {
  42741. // "description": "Select only sizes with this width.",
  42742. // "format": "int32",
  42743. // "location": "query",
  42744. // "maximum": "32767",
  42745. // "minimum": "0",
  42746. // "type": "integer"
  42747. // }
  42748. // },
  42749. // "path": "userprofiles/{profileId}/sizes",
  42750. // "response": {
  42751. // "$ref": "SizesListResponse"
  42752. // },
  42753. // "scopes": [
  42754. // "https://www.googleapis.com/auth/dfatrafficking"
  42755. // ]
  42756. // }
  42757. }
  42758. // method id "dfareporting.subaccounts.get":
  42759. type SubaccountsGetCall struct {
  42760. s *Service
  42761. profileId int64
  42762. id int64
  42763. urlParams_ gensupport.URLParams
  42764. ifNoneMatch_ string
  42765. ctx_ context.Context
  42766. header_ http.Header
  42767. }
  42768. // Get: Gets one subaccount by ID.
  42769. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  42770. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42771. c.profileId = profileId
  42772. c.id = id
  42773. return c
  42774. }
  42775. // Fields allows partial responses to be retrieved. See
  42776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42777. // for more information.
  42778. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  42779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42780. return c
  42781. }
  42782. // IfNoneMatch sets the optional parameter which makes the operation
  42783. // fail if the object's ETag matches the given value. This is useful for
  42784. // getting updates only after the object has changed since the last
  42785. // request. Use googleapi.IsNotModified to check whether the response
  42786. // error from Do is the result of In-None-Match.
  42787. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  42788. c.ifNoneMatch_ = entityTag
  42789. return c
  42790. }
  42791. // Context sets the context to be used in this call's Do method. Any
  42792. // pending HTTP request will be aborted if the provided context is
  42793. // canceled.
  42794. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  42795. c.ctx_ = ctx
  42796. return c
  42797. }
  42798. // Header returns an http.Header that can be modified by the caller to
  42799. // add HTTP headers to the request.
  42800. func (c *SubaccountsGetCall) Header() http.Header {
  42801. if c.header_ == nil {
  42802. c.header_ = make(http.Header)
  42803. }
  42804. return c.header_
  42805. }
  42806. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  42807. reqHeaders := make(http.Header)
  42808. for k, v := range c.header_ {
  42809. reqHeaders[k] = v
  42810. }
  42811. reqHeaders.Set("User-Agent", c.s.userAgent())
  42812. if c.ifNoneMatch_ != "" {
  42813. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42814. }
  42815. var body io.Reader = nil
  42816. c.urlParams_.Set("alt", alt)
  42817. c.urlParams_.Set("prettyPrint", "false")
  42818. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  42819. urls += "?" + c.urlParams_.Encode()
  42820. req, err := http.NewRequest("GET", urls, body)
  42821. if err != nil {
  42822. return nil, err
  42823. }
  42824. req.Header = reqHeaders
  42825. googleapi.Expand(req.URL, map[string]string{
  42826. "profileId": strconv.FormatInt(c.profileId, 10),
  42827. "id": strconv.FormatInt(c.id, 10),
  42828. })
  42829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42830. }
  42831. // Do executes the "dfareporting.subaccounts.get" call.
  42832. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42833. // status code is an error. Response headers are in either
  42834. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42835. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42836. // to check whether the returned error was because
  42837. // http.StatusNotModified was returned.
  42838. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42839. gensupport.SetOptions(c.urlParams_, opts...)
  42840. res, err := c.doRequest("json")
  42841. if res != nil && res.StatusCode == http.StatusNotModified {
  42842. if res.Body != nil {
  42843. res.Body.Close()
  42844. }
  42845. return nil, &googleapi.Error{
  42846. Code: res.StatusCode,
  42847. Header: res.Header,
  42848. }
  42849. }
  42850. if err != nil {
  42851. return nil, err
  42852. }
  42853. defer googleapi.CloseBody(res)
  42854. if err := googleapi.CheckResponse(res); err != nil {
  42855. return nil, err
  42856. }
  42857. ret := &Subaccount{
  42858. ServerResponse: googleapi.ServerResponse{
  42859. Header: res.Header,
  42860. HTTPStatusCode: res.StatusCode,
  42861. },
  42862. }
  42863. target := &ret
  42864. if err := gensupport.DecodeResponse(target, res); err != nil {
  42865. return nil, err
  42866. }
  42867. return ret, nil
  42868. // {
  42869. // "description": "Gets one subaccount by ID.",
  42870. // "httpMethod": "GET",
  42871. // "id": "dfareporting.subaccounts.get",
  42872. // "parameterOrder": [
  42873. // "profileId",
  42874. // "id"
  42875. // ],
  42876. // "parameters": {
  42877. // "id": {
  42878. // "description": "Subaccount ID.",
  42879. // "format": "int64",
  42880. // "location": "path",
  42881. // "required": true,
  42882. // "type": "string"
  42883. // },
  42884. // "profileId": {
  42885. // "description": "User profile ID associated with this request.",
  42886. // "format": "int64",
  42887. // "location": "path",
  42888. // "required": true,
  42889. // "type": "string"
  42890. // }
  42891. // },
  42892. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  42893. // "response": {
  42894. // "$ref": "Subaccount"
  42895. // },
  42896. // "scopes": [
  42897. // "https://www.googleapis.com/auth/dfatrafficking"
  42898. // ]
  42899. // }
  42900. }
  42901. // method id "dfareporting.subaccounts.insert":
  42902. type SubaccountsInsertCall struct {
  42903. s *Service
  42904. profileId int64
  42905. subaccount *Subaccount
  42906. urlParams_ gensupport.URLParams
  42907. ctx_ context.Context
  42908. header_ http.Header
  42909. }
  42910. // Insert: Inserts a new subaccount.
  42911. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  42912. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42913. c.profileId = profileId
  42914. c.subaccount = subaccount
  42915. return c
  42916. }
  42917. // Fields allows partial responses to be retrieved. See
  42918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42919. // for more information.
  42920. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  42921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42922. return c
  42923. }
  42924. // Context sets the context to be used in this call's Do method. Any
  42925. // pending HTTP request will be aborted if the provided context is
  42926. // canceled.
  42927. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  42928. c.ctx_ = ctx
  42929. return c
  42930. }
  42931. // Header returns an http.Header that can be modified by the caller to
  42932. // add HTTP headers to the request.
  42933. func (c *SubaccountsInsertCall) Header() http.Header {
  42934. if c.header_ == nil {
  42935. c.header_ = make(http.Header)
  42936. }
  42937. return c.header_
  42938. }
  42939. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  42940. reqHeaders := make(http.Header)
  42941. for k, v := range c.header_ {
  42942. reqHeaders[k] = v
  42943. }
  42944. reqHeaders.Set("User-Agent", c.s.userAgent())
  42945. var body io.Reader = nil
  42946. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42947. if err != nil {
  42948. return nil, err
  42949. }
  42950. reqHeaders.Set("Content-Type", "application/json")
  42951. c.urlParams_.Set("alt", alt)
  42952. c.urlParams_.Set("prettyPrint", "false")
  42953. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42954. urls += "?" + c.urlParams_.Encode()
  42955. req, err := http.NewRequest("POST", urls, body)
  42956. if err != nil {
  42957. return nil, err
  42958. }
  42959. req.Header = reqHeaders
  42960. googleapi.Expand(req.URL, map[string]string{
  42961. "profileId": strconv.FormatInt(c.profileId, 10),
  42962. })
  42963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42964. }
  42965. // Do executes the "dfareporting.subaccounts.insert" call.
  42966. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42967. // status code is an error. Response headers are in either
  42968. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42969. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42970. // to check whether the returned error was because
  42971. // http.StatusNotModified was returned.
  42972. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42973. gensupport.SetOptions(c.urlParams_, opts...)
  42974. res, err := c.doRequest("json")
  42975. if res != nil && res.StatusCode == http.StatusNotModified {
  42976. if res.Body != nil {
  42977. res.Body.Close()
  42978. }
  42979. return nil, &googleapi.Error{
  42980. Code: res.StatusCode,
  42981. Header: res.Header,
  42982. }
  42983. }
  42984. if err != nil {
  42985. return nil, err
  42986. }
  42987. defer googleapi.CloseBody(res)
  42988. if err := googleapi.CheckResponse(res); err != nil {
  42989. return nil, err
  42990. }
  42991. ret := &Subaccount{
  42992. ServerResponse: googleapi.ServerResponse{
  42993. Header: res.Header,
  42994. HTTPStatusCode: res.StatusCode,
  42995. },
  42996. }
  42997. target := &ret
  42998. if err := gensupport.DecodeResponse(target, res); err != nil {
  42999. return nil, err
  43000. }
  43001. return ret, nil
  43002. // {
  43003. // "description": "Inserts a new subaccount.",
  43004. // "httpMethod": "POST",
  43005. // "id": "dfareporting.subaccounts.insert",
  43006. // "parameterOrder": [
  43007. // "profileId"
  43008. // ],
  43009. // "parameters": {
  43010. // "profileId": {
  43011. // "description": "User profile ID associated with this request.",
  43012. // "format": "int64",
  43013. // "location": "path",
  43014. // "required": true,
  43015. // "type": "string"
  43016. // }
  43017. // },
  43018. // "path": "userprofiles/{profileId}/subaccounts",
  43019. // "request": {
  43020. // "$ref": "Subaccount"
  43021. // },
  43022. // "response": {
  43023. // "$ref": "Subaccount"
  43024. // },
  43025. // "scopes": [
  43026. // "https://www.googleapis.com/auth/dfatrafficking"
  43027. // ]
  43028. // }
  43029. }
  43030. // method id "dfareporting.subaccounts.list":
  43031. type SubaccountsListCall struct {
  43032. s *Service
  43033. profileId int64
  43034. urlParams_ gensupport.URLParams
  43035. ifNoneMatch_ string
  43036. ctx_ context.Context
  43037. header_ http.Header
  43038. }
  43039. // List: Gets a list of subaccounts, possibly filtered. This method
  43040. // supports paging.
  43041. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  43042. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43043. c.profileId = profileId
  43044. return c
  43045. }
  43046. // Ids sets the optional parameter "ids": Select only subaccounts with
  43047. // these IDs.
  43048. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  43049. var ids_ []string
  43050. for _, v := range ids {
  43051. ids_ = append(ids_, fmt.Sprint(v))
  43052. }
  43053. c.urlParams_.SetMulti("ids", ids_)
  43054. return c
  43055. }
  43056. // MaxResults sets the optional parameter "maxResults": Maximum number
  43057. // of results to return.
  43058. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  43059. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43060. return c
  43061. }
  43062. // PageToken sets the optional parameter "pageToken": Value of the
  43063. // nextPageToken from the previous result page.
  43064. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  43065. c.urlParams_.Set("pageToken", pageToken)
  43066. return c
  43067. }
  43068. // SearchString sets the optional parameter "searchString": Allows
  43069. // searching for objects by name or ID. Wildcards (*) are allowed. For
  43070. // example, "subaccount*2015" will return objects with names like
  43071. // "subaccount June 2015", "subaccount April 2015", or simply
  43072. // "subaccount 2015". Most of the searches also add wildcards implicitly
  43073. // at the start and the end of the search string. For example, a search
  43074. // string of "subaccount" will match objects with name "my subaccount",
  43075. // "subaccount 2015", or simply "subaccount".
  43076. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  43077. c.urlParams_.Set("searchString", searchString)
  43078. return c
  43079. }
  43080. // SortField sets the optional parameter "sortField": Field by which to
  43081. // sort the list.
  43082. //
  43083. // Possible values:
  43084. // "ID" (default)
  43085. // "NAME"
  43086. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  43087. c.urlParams_.Set("sortField", sortField)
  43088. return c
  43089. }
  43090. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43091. // results.
  43092. //
  43093. // Possible values:
  43094. // "ASCENDING" (default)
  43095. // "DESCENDING"
  43096. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  43097. c.urlParams_.Set("sortOrder", sortOrder)
  43098. return c
  43099. }
  43100. // Fields allows partial responses to be retrieved. See
  43101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43102. // for more information.
  43103. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  43104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43105. return c
  43106. }
  43107. // IfNoneMatch sets the optional parameter which makes the operation
  43108. // fail if the object's ETag matches the given value. This is useful for
  43109. // getting updates only after the object has changed since the last
  43110. // request. Use googleapi.IsNotModified to check whether the response
  43111. // error from Do is the result of In-None-Match.
  43112. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  43113. c.ifNoneMatch_ = entityTag
  43114. return c
  43115. }
  43116. // Context sets the context to be used in this call's Do method. Any
  43117. // pending HTTP request will be aborted if the provided context is
  43118. // canceled.
  43119. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  43120. c.ctx_ = ctx
  43121. return c
  43122. }
  43123. // Header returns an http.Header that can be modified by the caller to
  43124. // add HTTP headers to the request.
  43125. func (c *SubaccountsListCall) Header() http.Header {
  43126. if c.header_ == nil {
  43127. c.header_ = make(http.Header)
  43128. }
  43129. return c.header_
  43130. }
  43131. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  43132. reqHeaders := make(http.Header)
  43133. for k, v := range c.header_ {
  43134. reqHeaders[k] = v
  43135. }
  43136. reqHeaders.Set("User-Agent", c.s.userAgent())
  43137. if c.ifNoneMatch_ != "" {
  43138. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43139. }
  43140. var body io.Reader = nil
  43141. c.urlParams_.Set("alt", alt)
  43142. c.urlParams_.Set("prettyPrint", "false")
  43143. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43144. urls += "?" + c.urlParams_.Encode()
  43145. req, err := http.NewRequest("GET", urls, body)
  43146. if err != nil {
  43147. return nil, err
  43148. }
  43149. req.Header = reqHeaders
  43150. googleapi.Expand(req.URL, map[string]string{
  43151. "profileId": strconv.FormatInt(c.profileId, 10),
  43152. })
  43153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43154. }
  43155. // Do executes the "dfareporting.subaccounts.list" call.
  43156. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  43157. // non-2xx status code is an error. Response headers are in either
  43158. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  43159. // returned at all) in error.(*googleapi.Error).Header. Use
  43160. // googleapi.IsNotModified to check whether the returned error was
  43161. // because http.StatusNotModified was returned.
  43162. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  43163. gensupport.SetOptions(c.urlParams_, opts...)
  43164. res, err := c.doRequest("json")
  43165. if res != nil && res.StatusCode == http.StatusNotModified {
  43166. if res.Body != nil {
  43167. res.Body.Close()
  43168. }
  43169. return nil, &googleapi.Error{
  43170. Code: res.StatusCode,
  43171. Header: res.Header,
  43172. }
  43173. }
  43174. if err != nil {
  43175. return nil, err
  43176. }
  43177. defer googleapi.CloseBody(res)
  43178. if err := googleapi.CheckResponse(res); err != nil {
  43179. return nil, err
  43180. }
  43181. ret := &SubaccountsListResponse{
  43182. ServerResponse: googleapi.ServerResponse{
  43183. Header: res.Header,
  43184. HTTPStatusCode: res.StatusCode,
  43185. },
  43186. }
  43187. target := &ret
  43188. if err := gensupport.DecodeResponse(target, res); err != nil {
  43189. return nil, err
  43190. }
  43191. return ret, nil
  43192. // {
  43193. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  43194. // "httpMethod": "GET",
  43195. // "id": "dfareporting.subaccounts.list",
  43196. // "parameterOrder": [
  43197. // "profileId"
  43198. // ],
  43199. // "parameters": {
  43200. // "ids": {
  43201. // "description": "Select only subaccounts with these IDs.",
  43202. // "format": "int64",
  43203. // "location": "query",
  43204. // "repeated": true,
  43205. // "type": "string"
  43206. // },
  43207. // "maxResults": {
  43208. // "default": "1000",
  43209. // "description": "Maximum number of results to return.",
  43210. // "format": "int32",
  43211. // "location": "query",
  43212. // "maximum": "1000",
  43213. // "minimum": "0",
  43214. // "type": "integer"
  43215. // },
  43216. // "pageToken": {
  43217. // "description": "Value of the nextPageToken from the previous result page.",
  43218. // "location": "query",
  43219. // "type": "string"
  43220. // },
  43221. // "profileId": {
  43222. // "description": "User profile ID associated with this request.",
  43223. // "format": "int64",
  43224. // "location": "path",
  43225. // "required": true,
  43226. // "type": "string"
  43227. // },
  43228. // "searchString": {
  43229. // "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\".",
  43230. // "location": "query",
  43231. // "type": "string"
  43232. // },
  43233. // "sortField": {
  43234. // "default": "ID",
  43235. // "description": "Field by which to sort the list.",
  43236. // "enum": [
  43237. // "ID",
  43238. // "NAME"
  43239. // ],
  43240. // "enumDescriptions": [
  43241. // "",
  43242. // ""
  43243. // ],
  43244. // "location": "query",
  43245. // "type": "string"
  43246. // },
  43247. // "sortOrder": {
  43248. // "default": "ASCENDING",
  43249. // "description": "Order of sorted results.",
  43250. // "enum": [
  43251. // "ASCENDING",
  43252. // "DESCENDING"
  43253. // ],
  43254. // "enumDescriptions": [
  43255. // "",
  43256. // ""
  43257. // ],
  43258. // "location": "query",
  43259. // "type": "string"
  43260. // }
  43261. // },
  43262. // "path": "userprofiles/{profileId}/subaccounts",
  43263. // "response": {
  43264. // "$ref": "SubaccountsListResponse"
  43265. // },
  43266. // "scopes": [
  43267. // "https://www.googleapis.com/auth/dfatrafficking"
  43268. // ]
  43269. // }
  43270. }
  43271. // Pages invokes f for each page of results.
  43272. // A non-nil error returned from f will halt the iteration.
  43273. // The provided context supersedes any context provided to the Context method.
  43274. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  43275. c.ctx_ = ctx
  43276. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43277. for {
  43278. x, err := c.Do()
  43279. if err != nil {
  43280. return err
  43281. }
  43282. if err := f(x); err != nil {
  43283. return err
  43284. }
  43285. if x.NextPageToken == "" {
  43286. return nil
  43287. }
  43288. c.PageToken(x.NextPageToken)
  43289. }
  43290. }
  43291. // method id "dfareporting.subaccounts.patch":
  43292. type SubaccountsPatchCall struct {
  43293. s *Service
  43294. profileId int64
  43295. subaccount *Subaccount
  43296. urlParams_ gensupport.URLParams
  43297. ctx_ context.Context
  43298. header_ http.Header
  43299. }
  43300. // Patch: Updates an existing subaccount. This method supports patch
  43301. // semantics.
  43302. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  43303. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43304. c.profileId = profileId
  43305. c.urlParams_.Set("id", fmt.Sprint(id))
  43306. c.subaccount = subaccount
  43307. return c
  43308. }
  43309. // Fields allows partial responses to be retrieved. See
  43310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43311. // for more information.
  43312. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  43313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43314. return c
  43315. }
  43316. // Context sets the context to be used in this call's Do method. Any
  43317. // pending HTTP request will be aborted if the provided context is
  43318. // canceled.
  43319. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  43320. c.ctx_ = ctx
  43321. return c
  43322. }
  43323. // Header returns an http.Header that can be modified by the caller to
  43324. // add HTTP headers to the request.
  43325. func (c *SubaccountsPatchCall) Header() http.Header {
  43326. if c.header_ == nil {
  43327. c.header_ = make(http.Header)
  43328. }
  43329. return c.header_
  43330. }
  43331. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  43332. reqHeaders := make(http.Header)
  43333. for k, v := range c.header_ {
  43334. reqHeaders[k] = v
  43335. }
  43336. reqHeaders.Set("User-Agent", c.s.userAgent())
  43337. var body io.Reader = nil
  43338. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  43339. if err != nil {
  43340. return nil, err
  43341. }
  43342. reqHeaders.Set("Content-Type", "application/json")
  43343. c.urlParams_.Set("alt", alt)
  43344. c.urlParams_.Set("prettyPrint", "false")
  43345. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43346. urls += "?" + c.urlParams_.Encode()
  43347. req, err := http.NewRequest("PATCH", urls, body)
  43348. if err != nil {
  43349. return nil, err
  43350. }
  43351. req.Header = reqHeaders
  43352. googleapi.Expand(req.URL, map[string]string{
  43353. "profileId": strconv.FormatInt(c.profileId, 10),
  43354. })
  43355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43356. }
  43357. // Do executes the "dfareporting.subaccounts.patch" call.
  43358. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  43359. // status code is an error. Response headers are in either
  43360. // *Subaccount.ServerResponse.Header or (if a response was returned at
  43361. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43362. // to check whether the returned error was because
  43363. // http.StatusNotModified was returned.
  43364. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  43365. gensupport.SetOptions(c.urlParams_, opts...)
  43366. res, err := c.doRequest("json")
  43367. if res != nil && res.StatusCode == http.StatusNotModified {
  43368. if res.Body != nil {
  43369. res.Body.Close()
  43370. }
  43371. return nil, &googleapi.Error{
  43372. Code: res.StatusCode,
  43373. Header: res.Header,
  43374. }
  43375. }
  43376. if err != nil {
  43377. return nil, err
  43378. }
  43379. defer googleapi.CloseBody(res)
  43380. if err := googleapi.CheckResponse(res); err != nil {
  43381. return nil, err
  43382. }
  43383. ret := &Subaccount{
  43384. ServerResponse: googleapi.ServerResponse{
  43385. Header: res.Header,
  43386. HTTPStatusCode: res.StatusCode,
  43387. },
  43388. }
  43389. target := &ret
  43390. if err := gensupport.DecodeResponse(target, res); err != nil {
  43391. return nil, err
  43392. }
  43393. return ret, nil
  43394. // {
  43395. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  43396. // "httpMethod": "PATCH",
  43397. // "id": "dfareporting.subaccounts.patch",
  43398. // "parameterOrder": [
  43399. // "profileId",
  43400. // "id"
  43401. // ],
  43402. // "parameters": {
  43403. // "id": {
  43404. // "description": "Subaccount ID.",
  43405. // "format": "int64",
  43406. // "location": "query",
  43407. // "required": true,
  43408. // "type": "string"
  43409. // },
  43410. // "profileId": {
  43411. // "description": "User profile ID associated with this request.",
  43412. // "format": "int64",
  43413. // "location": "path",
  43414. // "required": true,
  43415. // "type": "string"
  43416. // }
  43417. // },
  43418. // "path": "userprofiles/{profileId}/subaccounts",
  43419. // "request": {
  43420. // "$ref": "Subaccount"
  43421. // },
  43422. // "response": {
  43423. // "$ref": "Subaccount"
  43424. // },
  43425. // "scopes": [
  43426. // "https://www.googleapis.com/auth/dfatrafficking"
  43427. // ]
  43428. // }
  43429. }
  43430. // method id "dfareporting.subaccounts.update":
  43431. type SubaccountsUpdateCall struct {
  43432. s *Service
  43433. profileId int64
  43434. subaccount *Subaccount
  43435. urlParams_ gensupport.URLParams
  43436. ctx_ context.Context
  43437. header_ http.Header
  43438. }
  43439. // Update: Updates an existing subaccount.
  43440. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  43441. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43442. c.profileId = profileId
  43443. c.subaccount = subaccount
  43444. return c
  43445. }
  43446. // Fields allows partial responses to be retrieved. See
  43447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43448. // for more information.
  43449. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  43450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43451. return c
  43452. }
  43453. // Context sets the context to be used in this call's Do method. Any
  43454. // pending HTTP request will be aborted if the provided context is
  43455. // canceled.
  43456. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  43457. c.ctx_ = ctx
  43458. return c
  43459. }
  43460. // Header returns an http.Header that can be modified by the caller to
  43461. // add HTTP headers to the request.
  43462. func (c *SubaccountsUpdateCall) Header() http.Header {
  43463. if c.header_ == nil {
  43464. c.header_ = make(http.Header)
  43465. }
  43466. return c.header_
  43467. }
  43468. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  43469. reqHeaders := make(http.Header)
  43470. for k, v := range c.header_ {
  43471. reqHeaders[k] = v
  43472. }
  43473. reqHeaders.Set("User-Agent", c.s.userAgent())
  43474. var body io.Reader = nil
  43475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  43476. if err != nil {
  43477. return nil, err
  43478. }
  43479. reqHeaders.Set("Content-Type", "application/json")
  43480. c.urlParams_.Set("alt", alt)
  43481. c.urlParams_.Set("prettyPrint", "false")
  43482. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43483. urls += "?" + c.urlParams_.Encode()
  43484. req, err := http.NewRequest("PUT", urls, body)
  43485. if err != nil {
  43486. return nil, err
  43487. }
  43488. req.Header = reqHeaders
  43489. googleapi.Expand(req.URL, map[string]string{
  43490. "profileId": strconv.FormatInt(c.profileId, 10),
  43491. })
  43492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43493. }
  43494. // Do executes the "dfareporting.subaccounts.update" call.
  43495. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  43496. // status code is an error. Response headers are in either
  43497. // *Subaccount.ServerResponse.Header or (if a response was returned at
  43498. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43499. // to check whether the returned error was because
  43500. // http.StatusNotModified was returned.
  43501. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  43502. gensupport.SetOptions(c.urlParams_, opts...)
  43503. res, err := c.doRequest("json")
  43504. if res != nil && res.StatusCode == http.StatusNotModified {
  43505. if res.Body != nil {
  43506. res.Body.Close()
  43507. }
  43508. return nil, &googleapi.Error{
  43509. Code: res.StatusCode,
  43510. Header: res.Header,
  43511. }
  43512. }
  43513. if err != nil {
  43514. return nil, err
  43515. }
  43516. defer googleapi.CloseBody(res)
  43517. if err := googleapi.CheckResponse(res); err != nil {
  43518. return nil, err
  43519. }
  43520. ret := &Subaccount{
  43521. ServerResponse: googleapi.ServerResponse{
  43522. Header: res.Header,
  43523. HTTPStatusCode: res.StatusCode,
  43524. },
  43525. }
  43526. target := &ret
  43527. if err := gensupport.DecodeResponse(target, res); err != nil {
  43528. return nil, err
  43529. }
  43530. return ret, nil
  43531. // {
  43532. // "description": "Updates an existing subaccount.",
  43533. // "httpMethod": "PUT",
  43534. // "id": "dfareporting.subaccounts.update",
  43535. // "parameterOrder": [
  43536. // "profileId"
  43537. // ],
  43538. // "parameters": {
  43539. // "profileId": {
  43540. // "description": "User profile ID associated with this request.",
  43541. // "format": "int64",
  43542. // "location": "path",
  43543. // "required": true,
  43544. // "type": "string"
  43545. // }
  43546. // },
  43547. // "path": "userprofiles/{profileId}/subaccounts",
  43548. // "request": {
  43549. // "$ref": "Subaccount"
  43550. // },
  43551. // "response": {
  43552. // "$ref": "Subaccount"
  43553. // },
  43554. // "scopes": [
  43555. // "https://www.googleapis.com/auth/dfatrafficking"
  43556. // ]
  43557. // }
  43558. }
  43559. // method id "dfareporting.targetableRemarketingLists.get":
  43560. type TargetableRemarketingListsGetCall struct {
  43561. s *Service
  43562. profileId int64
  43563. id int64
  43564. urlParams_ gensupport.URLParams
  43565. ifNoneMatch_ string
  43566. ctx_ context.Context
  43567. header_ http.Header
  43568. }
  43569. // Get: Gets one remarketing list by ID.
  43570. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  43571. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43572. c.profileId = profileId
  43573. c.id = id
  43574. return c
  43575. }
  43576. // Fields allows partial responses to be retrieved. See
  43577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43578. // for more information.
  43579. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  43580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43581. return c
  43582. }
  43583. // IfNoneMatch sets the optional parameter which makes the operation
  43584. // fail if the object's ETag matches the given value. This is useful for
  43585. // getting updates only after the object has changed since the last
  43586. // request. Use googleapi.IsNotModified to check whether the response
  43587. // error from Do is the result of In-None-Match.
  43588. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  43589. c.ifNoneMatch_ = entityTag
  43590. return c
  43591. }
  43592. // Context sets the context to be used in this call's Do method. Any
  43593. // pending HTTP request will be aborted if the provided context is
  43594. // canceled.
  43595. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  43596. c.ctx_ = ctx
  43597. return c
  43598. }
  43599. // Header returns an http.Header that can be modified by the caller to
  43600. // add HTTP headers to the request.
  43601. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  43602. if c.header_ == nil {
  43603. c.header_ = make(http.Header)
  43604. }
  43605. return c.header_
  43606. }
  43607. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  43608. reqHeaders := make(http.Header)
  43609. for k, v := range c.header_ {
  43610. reqHeaders[k] = v
  43611. }
  43612. reqHeaders.Set("User-Agent", c.s.userAgent())
  43613. if c.ifNoneMatch_ != "" {
  43614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43615. }
  43616. var body io.Reader = nil
  43617. c.urlParams_.Set("alt", alt)
  43618. c.urlParams_.Set("prettyPrint", "false")
  43619. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  43620. urls += "?" + c.urlParams_.Encode()
  43621. req, err := http.NewRequest("GET", urls, body)
  43622. if err != nil {
  43623. return nil, err
  43624. }
  43625. req.Header = reqHeaders
  43626. googleapi.Expand(req.URL, map[string]string{
  43627. "profileId": strconv.FormatInt(c.profileId, 10),
  43628. "id": strconv.FormatInt(c.id, 10),
  43629. })
  43630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43631. }
  43632. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  43633. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  43634. // Any non-2xx status code is an error. Response headers are in either
  43635. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  43636. // was returned at all) in error.(*googleapi.Error).Header. Use
  43637. // googleapi.IsNotModified to check whether the returned error was
  43638. // because http.StatusNotModified was returned.
  43639. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  43640. gensupport.SetOptions(c.urlParams_, opts...)
  43641. res, err := c.doRequest("json")
  43642. if res != nil && res.StatusCode == http.StatusNotModified {
  43643. if res.Body != nil {
  43644. res.Body.Close()
  43645. }
  43646. return nil, &googleapi.Error{
  43647. Code: res.StatusCode,
  43648. Header: res.Header,
  43649. }
  43650. }
  43651. if err != nil {
  43652. return nil, err
  43653. }
  43654. defer googleapi.CloseBody(res)
  43655. if err := googleapi.CheckResponse(res); err != nil {
  43656. return nil, err
  43657. }
  43658. ret := &TargetableRemarketingList{
  43659. ServerResponse: googleapi.ServerResponse{
  43660. Header: res.Header,
  43661. HTTPStatusCode: res.StatusCode,
  43662. },
  43663. }
  43664. target := &ret
  43665. if err := gensupport.DecodeResponse(target, res); err != nil {
  43666. return nil, err
  43667. }
  43668. return ret, nil
  43669. // {
  43670. // "description": "Gets one remarketing list by ID.",
  43671. // "httpMethod": "GET",
  43672. // "id": "dfareporting.targetableRemarketingLists.get",
  43673. // "parameterOrder": [
  43674. // "profileId",
  43675. // "id"
  43676. // ],
  43677. // "parameters": {
  43678. // "id": {
  43679. // "description": "Remarketing list ID.",
  43680. // "format": "int64",
  43681. // "location": "path",
  43682. // "required": true,
  43683. // "type": "string"
  43684. // },
  43685. // "profileId": {
  43686. // "description": "User profile ID associated with this request.",
  43687. // "format": "int64",
  43688. // "location": "path",
  43689. // "required": true,
  43690. // "type": "string"
  43691. // }
  43692. // },
  43693. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  43694. // "response": {
  43695. // "$ref": "TargetableRemarketingList"
  43696. // },
  43697. // "scopes": [
  43698. // "https://www.googleapis.com/auth/dfatrafficking"
  43699. // ]
  43700. // }
  43701. }
  43702. // method id "dfareporting.targetableRemarketingLists.list":
  43703. type TargetableRemarketingListsListCall struct {
  43704. s *Service
  43705. profileId int64
  43706. urlParams_ gensupport.URLParams
  43707. ifNoneMatch_ string
  43708. ctx_ context.Context
  43709. header_ http.Header
  43710. }
  43711. // List: Retrieves a list of targetable remarketing lists, possibly
  43712. // filtered. This method supports paging.
  43713. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  43714. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43715. c.profileId = profileId
  43716. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43717. return c
  43718. }
  43719. // Active sets the optional parameter "active": Select only active or
  43720. // only inactive targetable remarketing lists.
  43721. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  43722. c.urlParams_.Set("active", fmt.Sprint(active))
  43723. return c
  43724. }
  43725. // MaxResults sets the optional parameter "maxResults": Maximum number
  43726. // of results to return.
  43727. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  43728. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43729. return c
  43730. }
  43731. // Name sets the optional parameter "name": Allows searching for objects
  43732. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  43733. // list*2015" will return objects with names like "remarketing list June
  43734. // 2015", "remarketing list April 2015", or simply "remarketing list
  43735. // 2015". Most of the searches also add wildcards implicitly at the
  43736. // start and the end of the search string. For example, a search string
  43737. // of "remarketing list" will match objects with name "my remarketing
  43738. // list", "remarketing list 2015", or simply "remarketing list".
  43739. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  43740. c.urlParams_.Set("name", name)
  43741. return c
  43742. }
  43743. // PageToken sets the optional parameter "pageToken": Value of the
  43744. // nextPageToken from the previous result page.
  43745. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  43746. c.urlParams_.Set("pageToken", pageToken)
  43747. return c
  43748. }
  43749. // SortField sets the optional parameter "sortField": Field by which to
  43750. // sort the list.
  43751. //
  43752. // Possible values:
  43753. // "ID" (default)
  43754. // "NAME"
  43755. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  43756. c.urlParams_.Set("sortField", sortField)
  43757. return c
  43758. }
  43759. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43760. // results.
  43761. //
  43762. // Possible values:
  43763. // "ASCENDING" (default)
  43764. // "DESCENDING"
  43765. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  43766. c.urlParams_.Set("sortOrder", sortOrder)
  43767. return c
  43768. }
  43769. // Fields allows partial responses to be retrieved. See
  43770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43771. // for more information.
  43772. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  43773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43774. return c
  43775. }
  43776. // IfNoneMatch sets the optional parameter which makes the operation
  43777. // fail if the object's ETag matches the given value. This is useful for
  43778. // getting updates only after the object has changed since the last
  43779. // request. Use googleapi.IsNotModified to check whether the response
  43780. // error from Do is the result of In-None-Match.
  43781. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  43782. c.ifNoneMatch_ = entityTag
  43783. return c
  43784. }
  43785. // Context sets the context to be used in this call's Do method. Any
  43786. // pending HTTP request will be aborted if the provided context is
  43787. // canceled.
  43788. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  43789. c.ctx_ = ctx
  43790. return c
  43791. }
  43792. // Header returns an http.Header that can be modified by the caller to
  43793. // add HTTP headers to the request.
  43794. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  43795. if c.header_ == nil {
  43796. c.header_ = make(http.Header)
  43797. }
  43798. return c.header_
  43799. }
  43800. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  43801. reqHeaders := make(http.Header)
  43802. for k, v := range c.header_ {
  43803. reqHeaders[k] = v
  43804. }
  43805. reqHeaders.Set("User-Agent", c.s.userAgent())
  43806. if c.ifNoneMatch_ != "" {
  43807. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43808. }
  43809. var body io.Reader = nil
  43810. c.urlParams_.Set("alt", alt)
  43811. c.urlParams_.Set("prettyPrint", "false")
  43812. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  43813. urls += "?" + c.urlParams_.Encode()
  43814. req, err := http.NewRequest("GET", urls, body)
  43815. if err != nil {
  43816. return nil, err
  43817. }
  43818. req.Header = reqHeaders
  43819. googleapi.Expand(req.URL, map[string]string{
  43820. "profileId": strconv.FormatInt(c.profileId, 10),
  43821. })
  43822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43823. }
  43824. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  43825. // Exactly one of *TargetableRemarketingListsListResponse or error will
  43826. // be non-nil. Any non-2xx status code is an error. Response headers are
  43827. // in either
  43828. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  43829. // a response was returned at all) in error.(*googleapi.Error).Header.
  43830. // Use googleapi.IsNotModified to check whether the returned error was
  43831. // because http.StatusNotModified was returned.
  43832. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  43833. gensupport.SetOptions(c.urlParams_, opts...)
  43834. res, err := c.doRequest("json")
  43835. if res != nil && res.StatusCode == http.StatusNotModified {
  43836. if res.Body != nil {
  43837. res.Body.Close()
  43838. }
  43839. return nil, &googleapi.Error{
  43840. Code: res.StatusCode,
  43841. Header: res.Header,
  43842. }
  43843. }
  43844. if err != nil {
  43845. return nil, err
  43846. }
  43847. defer googleapi.CloseBody(res)
  43848. if err := googleapi.CheckResponse(res); err != nil {
  43849. return nil, err
  43850. }
  43851. ret := &TargetableRemarketingListsListResponse{
  43852. ServerResponse: googleapi.ServerResponse{
  43853. Header: res.Header,
  43854. HTTPStatusCode: res.StatusCode,
  43855. },
  43856. }
  43857. target := &ret
  43858. if err := gensupport.DecodeResponse(target, res); err != nil {
  43859. return nil, err
  43860. }
  43861. return ret, nil
  43862. // {
  43863. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  43864. // "httpMethod": "GET",
  43865. // "id": "dfareporting.targetableRemarketingLists.list",
  43866. // "parameterOrder": [
  43867. // "profileId",
  43868. // "advertiserId"
  43869. // ],
  43870. // "parameters": {
  43871. // "active": {
  43872. // "description": "Select only active or only inactive targetable remarketing lists.",
  43873. // "location": "query",
  43874. // "type": "boolean"
  43875. // },
  43876. // "advertiserId": {
  43877. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  43878. // "format": "int64",
  43879. // "location": "query",
  43880. // "required": true,
  43881. // "type": "string"
  43882. // },
  43883. // "maxResults": {
  43884. // "default": "1000",
  43885. // "description": "Maximum number of results to return.",
  43886. // "format": "int32",
  43887. // "location": "query",
  43888. // "maximum": "1000",
  43889. // "minimum": "0",
  43890. // "type": "integer"
  43891. // },
  43892. // "name": {
  43893. // "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\".",
  43894. // "location": "query",
  43895. // "type": "string"
  43896. // },
  43897. // "pageToken": {
  43898. // "description": "Value of the nextPageToken from the previous result page.",
  43899. // "location": "query",
  43900. // "type": "string"
  43901. // },
  43902. // "profileId": {
  43903. // "description": "User profile ID associated with this request.",
  43904. // "format": "int64",
  43905. // "location": "path",
  43906. // "required": true,
  43907. // "type": "string"
  43908. // },
  43909. // "sortField": {
  43910. // "default": "ID",
  43911. // "description": "Field by which to sort the list.",
  43912. // "enum": [
  43913. // "ID",
  43914. // "NAME"
  43915. // ],
  43916. // "enumDescriptions": [
  43917. // "",
  43918. // ""
  43919. // ],
  43920. // "location": "query",
  43921. // "type": "string"
  43922. // },
  43923. // "sortOrder": {
  43924. // "default": "ASCENDING",
  43925. // "description": "Order of sorted results.",
  43926. // "enum": [
  43927. // "ASCENDING",
  43928. // "DESCENDING"
  43929. // ],
  43930. // "enumDescriptions": [
  43931. // "",
  43932. // ""
  43933. // ],
  43934. // "location": "query",
  43935. // "type": "string"
  43936. // }
  43937. // },
  43938. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  43939. // "response": {
  43940. // "$ref": "TargetableRemarketingListsListResponse"
  43941. // },
  43942. // "scopes": [
  43943. // "https://www.googleapis.com/auth/dfatrafficking"
  43944. // ]
  43945. // }
  43946. }
  43947. // Pages invokes f for each page of results.
  43948. // A non-nil error returned from f will halt the iteration.
  43949. // The provided context supersedes any context provided to the Context method.
  43950. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  43951. c.ctx_ = ctx
  43952. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43953. for {
  43954. x, err := c.Do()
  43955. if err != nil {
  43956. return err
  43957. }
  43958. if err := f(x); err != nil {
  43959. return err
  43960. }
  43961. if x.NextPageToken == "" {
  43962. return nil
  43963. }
  43964. c.PageToken(x.NextPageToken)
  43965. }
  43966. }
  43967. // method id "dfareporting.targetingTemplates.get":
  43968. type TargetingTemplatesGetCall struct {
  43969. s *Service
  43970. profileId int64
  43971. id int64
  43972. urlParams_ gensupport.URLParams
  43973. ifNoneMatch_ string
  43974. ctx_ context.Context
  43975. header_ http.Header
  43976. }
  43977. // Get: Gets one targeting template by ID.
  43978. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  43979. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43980. c.profileId = profileId
  43981. c.id = id
  43982. return c
  43983. }
  43984. // Fields allows partial responses to be retrieved. See
  43985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43986. // for more information.
  43987. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  43988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43989. return c
  43990. }
  43991. // IfNoneMatch sets the optional parameter which makes the operation
  43992. // fail if the object's ETag matches the given value. This is useful for
  43993. // getting updates only after the object has changed since the last
  43994. // request. Use googleapi.IsNotModified to check whether the response
  43995. // error from Do is the result of In-None-Match.
  43996. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  43997. c.ifNoneMatch_ = entityTag
  43998. return c
  43999. }
  44000. // Context sets the context to be used in this call's Do method. Any
  44001. // pending HTTP request will be aborted if the provided context is
  44002. // canceled.
  44003. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  44004. c.ctx_ = ctx
  44005. return c
  44006. }
  44007. // Header returns an http.Header that can be modified by the caller to
  44008. // add HTTP headers to the request.
  44009. func (c *TargetingTemplatesGetCall) Header() http.Header {
  44010. if c.header_ == nil {
  44011. c.header_ = make(http.Header)
  44012. }
  44013. return c.header_
  44014. }
  44015. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  44016. reqHeaders := make(http.Header)
  44017. for k, v := range c.header_ {
  44018. reqHeaders[k] = v
  44019. }
  44020. reqHeaders.Set("User-Agent", c.s.userAgent())
  44021. if c.ifNoneMatch_ != "" {
  44022. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44023. }
  44024. var body io.Reader = nil
  44025. c.urlParams_.Set("alt", alt)
  44026. c.urlParams_.Set("prettyPrint", "false")
  44027. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  44028. urls += "?" + c.urlParams_.Encode()
  44029. req, err := http.NewRequest("GET", urls, body)
  44030. if err != nil {
  44031. return nil, err
  44032. }
  44033. req.Header = reqHeaders
  44034. googleapi.Expand(req.URL, map[string]string{
  44035. "profileId": strconv.FormatInt(c.profileId, 10),
  44036. "id": strconv.FormatInt(c.id, 10),
  44037. })
  44038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44039. }
  44040. // Do executes the "dfareporting.targetingTemplates.get" call.
  44041. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44042. // non-2xx status code is an error. Response headers are in either
  44043. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44044. // returned at all) in error.(*googleapi.Error).Header. Use
  44045. // googleapi.IsNotModified to check whether the returned error was
  44046. // because http.StatusNotModified was returned.
  44047. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44048. gensupport.SetOptions(c.urlParams_, opts...)
  44049. res, err := c.doRequest("json")
  44050. if res != nil && res.StatusCode == http.StatusNotModified {
  44051. if res.Body != nil {
  44052. res.Body.Close()
  44053. }
  44054. return nil, &googleapi.Error{
  44055. Code: res.StatusCode,
  44056. Header: res.Header,
  44057. }
  44058. }
  44059. if err != nil {
  44060. return nil, err
  44061. }
  44062. defer googleapi.CloseBody(res)
  44063. if err := googleapi.CheckResponse(res); err != nil {
  44064. return nil, err
  44065. }
  44066. ret := &TargetingTemplate{
  44067. ServerResponse: googleapi.ServerResponse{
  44068. Header: res.Header,
  44069. HTTPStatusCode: res.StatusCode,
  44070. },
  44071. }
  44072. target := &ret
  44073. if err := gensupport.DecodeResponse(target, res); err != nil {
  44074. return nil, err
  44075. }
  44076. return ret, nil
  44077. // {
  44078. // "description": "Gets one targeting template by ID.",
  44079. // "httpMethod": "GET",
  44080. // "id": "dfareporting.targetingTemplates.get",
  44081. // "parameterOrder": [
  44082. // "profileId",
  44083. // "id"
  44084. // ],
  44085. // "parameters": {
  44086. // "id": {
  44087. // "description": "Targeting template ID.",
  44088. // "format": "int64",
  44089. // "location": "path",
  44090. // "required": true,
  44091. // "type": "string"
  44092. // },
  44093. // "profileId": {
  44094. // "description": "User profile ID associated with this request.",
  44095. // "format": "int64",
  44096. // "location": "path",
  44097. // "required": true,
  44098. // "type": "string"
  44099. // }
  44100. // },
  44101. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  44102. // "response": {
  44103. // "$ref": "TargetingTemplate"
  44104. // },
  44105. // "scopes": [
  44106. // "https://www.googleapis.com/auth/dfatrafficking"
  44107. // ]
  44108. // }
  44109. }
  44110. // method id "dfareporting.targetingTemplates.insert":
  44111. type TargetingTemplatesInsertCall struct {
  44112. s *Service
  44113. profileId int64
  44114. targetingtemplate *TargetingTemplate
  44115. urlParams_ gensupport.URLParams
  44116. ctx_ context.Context
  44117. header_ http.Header
  44118. }
  44119. // Insert: Inserts a new targeting template.
  44120. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  44121. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44122. c.profileId = profileId
  44123. c.targetingtemplate = targetingtemplate
  44124. return c
  44125. }
  44126. // Fields allows partial responses to be retrieved. See
  44127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44128. // for more information.
  44129. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  44130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44131. return c
  44132. }
  44133. // Context sets the context to be used in this call's Do method. Any
  44134. // pending HTTP request will be aborted if the provided context is
  44135. // canceled.
  44136. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  44137. c.ctx_ = ctx
  44138. return c
  44139. }
  44140. // Header returns an http.Header that can be modified by the caller to
  44141. // add HTTP headers to the request.
  44142. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  44143. if c.header_ == nil {
  44144. c.header_ = make(http.Header)
  44145. }
  44146. return c.header_
  44147. }
  44148. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  44149. reqHeaders := make(http.Header)
  44150. for k, v := range c.header_ {
  44151. reqHeaders[k] = v
  44152. }
  44153. reqHeaders.Set("User-Agent", c.s.userAgent())
  44154. var body io.Reader = nil
  44155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44156. if err != nil {
  44157. return nil, err
  44158. }
  44159. reqHeaders.Set("Content-Type", "application/json")
  44160. c.urlParams_.Set("alt", alt)
  44161. c.urlParams_.Set("prettyPrint", "false")
  44162. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44163. urls += "?" + c.urlParams_.Encode()
  44164. req, err := http.NewRequest("POST", urls, body)
  44165. if err != nil {
  44166. return nil, err
  44167. }
  44168. req.Header = reqHeaders
  44169. googleapi.Expand(req.URL, map[string]string{
  44170. "profileId": strconv.FormatInt(c.profileId, 10),
  44171. })
  44172. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44173. }
  44174. // Do executes the "dfareporting.targetingTemplates.insert" call.
  44175. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44176. // non-2xx status code is an error. Response headers are in either
  44177. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44178. // returned at all) in error.(*googleapi.Error).Header. Use
  44179. // googleapi.IsNotModified to check whether the returned error was
  44180. // because http.StatusNotModified was returned.
  44181. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44182. gensupport.SetOptions(c.urlParams_, opts...)
  44183. res, err := c.doRequest("json")
  44184. if res != nil && res.StatusCode == http.StatusNotModified {
  44185. if res.Body != nil {
  44186. res.Body.Close()
  44187. }
  44188. return nil, &googleapi.Error{
  44189. Code: res.StatusCode,
  44190. Header: res.Header,
  44191. }
  44192. }
  44193. if err != nil {
  44194. return nil, err
  44195. }
  44196. defer googleapi.CloseBody(res)
  44197. if err := googleapi.CheckResponse(res); err != nil {
  44198. return nil, err
  44199. }
  44200. ret := &TargetingTemplate{
  44201. ServerResponse: googleapi.ServerResponse{
  44202. Header: res.Header,
  44203. HTTPStatusCode: res.StatusCode,
  44204. },
  44205. }
  44206. target := &ret
  44207. if err := gensupport.DecodeResponse(target, res); err != nil {
  44208. return nil, err
  44209. }
  44210. return ret, nil
  44211. // {
  44212. // "description": "Inserts a new targeting template.",
  44213. // "httpMethod": "POST",
  44214. // "id": "dfareporting.targetingTemplates.insert",
  44215. // "parameterOrder": [
  44216. // "profileId"
  44217. // ],
  44218. // "parameters": {
  44219. // "profileId": {
  44220. // "description": "User profile ID associated with this request.",
  44221. // "format": "int64",
  44222. // "location": "path",
  44223. // "required": true,
  44224. // "type": "string"
  44225. // }
  44226. // },
  44227. // "path": "userprofiles/{profileId}/targetingTemplates",
  44228. // "request": {
  44229. // "$ref": "TargetingTemplate"
  44230. // },
  44231. // "response": {
  44232. // "$ref": "TargetingTemplate"
  44233. // },
  44234. // "scopes": [
  44235. // "https://www.googleapis.com/auth/dfatrafficking"
  44236. // ]
  44237. // }
  44238. }
  44239. // method id "dfareporting.targetingTemplates.list":
  44240. type TargetingTemplatesListCall struct {
  44241. s *Service
  44242. profileId int64
  44243. urlParams_ gensupport.URLParams
  44244. ifNoneMatch_ string
  44245. ctx_ context.Context
  44246. header_ http.Header
  44247. }
  44248. // List: Retrieves a list of targeting templates, optionally filtered.
  44249. // This method supports paging.
  44250. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  44251. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44252. c.profileId = profileId
  44253. return c
  44254. }
  44255. // AdvertiserId sets the optional parameter "advertiserId": Select only
  44256. // targeting templates with this advertiser ID.
  44257. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  44258. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  44259. return c
  44260. }
  44261. // Ids sets the optional parameter "ids": Select only targeting
  44262. // templates with these IDs.
  44263. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  44264. var ids_ []string
  44265. for _, v := range ids {
  44266. ids_ = append(ids_, fmt.Sprint(v))
  44267. }
  44268. c.urlParams_.SetMulti("ids", ids_)
  44269. return c
  44270. }
  44271. // MaxResults sets the optional parameter "maxResults": Maximum number
  44272. // of results to return.
  44273. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  44274. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44275. return c
  44276. }
  44277. // PageToken sets the optional parameter "pageToken": Value of the
  44278. // nextPageToken from the previous result page.
  44279. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  44280. c.urlParams_.Set("pageToken", pageToken)
  44281. return c
  44282. }
  44283. // SearchString sets the optional parameter "searchString": Allows
  44284. // searching for objects by name or ID. Wildcards (*) are allowed. For
  44285. // example, "template*2015" will return objects with names like
  44286. // "template June 2015", "template April 2015", or simply "template
  44287. // 2015". Most of the searches also add wildcards implicitly at the
  44288. // start and the end of the search string. For example, a search string
  44289. // of "template" will match objects with name "my template", "template
  44290. // 2015", or simply "template".
  44291. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  44292. c.urlParams_.Set("searchString", searchString)
  44293. return c
  44294. }
  44295. // SortField sets the optional parameter "sortField": Field by which to
  44296. // sort the list.
  44297. //
  44298. // Possible values:
  44299. // "ID" (default)
  44300. // "NAME"
  44301. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  44302. c.urlParams_.Set("sortField", sortField)
  44303. return c
  44304. }
  44305. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  44306. // results.
  44307. //
  44308. // Possible values:
  44309. // "ASCENDING" (default)
  44310. // "DESCENDING"
  44311. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  44312. c.urlParams_.Set("sortOrder", sortOrder)
  44313. return c
  44314. }
  44315. // Fields allows partial responses to be retrieved. See
  44316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44317. // for more information.
  44318. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  44319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44320. return c
  44321. }
  44322. // IfNoneMatch sets the optional parameter which makes the operation
  44323. // fail if the object's ETag matches the given value. This is useful for
  44324. // getting updates only after the object has changed since the last
  44325. // request. Use googleapi.IsNotModified to check whether the response
  44326. // error from Do is the result of In-None-Match.
  44327. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  44328. c.ifNoneMatch_ = entityTag
  44329. return c
  44330. }
  44331. // Context sets the context to be used in this call's Do method. Any
  44332. // pending HTTP request will be aborted if the provided context is
  44333. // canceled.
  44334. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  44335. c.ctx_ = ctx
  44336. return c
  44337. }
  44338. // Header returns an http.Header that can be modified by the caller to
  44339. // add HTTP headers to the request.
  44340. func (c *TargetingTemplatesListCall) Header() http.Header {
  44341. if c.header_ == nil {
  44342. c.header_ = make(http.Header)
  44343. }
  44344. return c.header_
  44345. }
  44346. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  44347. reqHeaders := make(http.Header)
  44348. for k, v := range c.header_ {
  44349. reqHeaders[k] = v
  44350. }
  44351. reqHeaders.Set("User-Agent", c.s.userAgent())
  44352. if c.ifNoneMatch_ != "" {
  44353. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44354. }
  44355. var body io.Reader = nil
  44356. c.urlParams_.Set("alt", alt)
  44357. c.urlParams_.Set("prettyPrint", "false")
  44358. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44359. urls += "?" + c.urlParams_.Encode()
  44360. req, err := http.NewRequest("GET", urls, body)
  44361. if err != nil {
  44362. return nil, err
  44363. }
  44364. req.Header = reqHeaders
  44365. googleapi.Expand(req.URL, map[string]string{
  44366. "profileId": strconv.FormatInt(c.profileId, 10),
  44367. })
  44368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44369. }
  44370. // Do executes the "dfareporting.targetingTemplates.list" call.
  44371. // Exactly one of *TargetingTemplatesListResponse or error will be
  44372. // non-nil. Any non-2xx status code is an error. Response headers are in
  44373. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  44374. // response was returned at all) in error.(*googleapi.Error).Header. Use
  44375. // googleapi.IsNotModified to check whether the returned error was
  44376. // because http.StatusNotModified was returned.
  44377. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  44378. gensupport.SetOptions(c.urlParams_, opts...)
  44379. res, err := c.doRequest("json")
  44380. if res != nil && res.StatusCode == http.StatusNotModified {
  44381. if res.Body != nil {
  44382. res.Body.Close()
  44383. }
  44384. return nil, &googleapi.Error{
  44385. Code: res.StatusCode,
  44386. Header: res.Header,
  44387. }
  44388. }
  44389. if err != nil {
  44390. return nil, err
  44391. }
  44392. defer googleapi.CloseBody(res)
  44393. if err := googleapi.CheckResponse(res); err != nil {
  44394. return nil, err
  44395. }
  44396. ret := &TargetingTemplatesListResponse{
  44397. ServerResponse: googleapi.ServerResponse{
  44398. Header: res.Header,
  44399. HTTPStatusCode: res.StatusCode,
  44400. },
  44401. }
  44402. target := &ret
  44403. if err := gensupport.DecodeResponse(target, res); err != nil {
  44404. return nil, err
  44405. }
  44406. return ret, nil
  44407. // {
  44408. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  44409. // "httpMethod": "GET",
  44410. // "id": "dfareporting.targetingTemplates.list",
  44411. // "parameterOrder": [
  44412. // "profileId"
  44413. // ],
  44414. // "parameters": {
  44415. // "advertiserId": {
  44416. // "description": "Select only targeting templates with this advertiser ID.",
  44417. // "format": "int64",
  44418. // "location": "query",
  44419. // "type": "string"
  44420. // },
  44421. // "ids": {
  44422. // "description": "Select only targeting templates with these IDs.",
  44423. // "format": "int64",
  44424. // "location": "query",
  44425. // "repeated": true,
  44426. // "type": "string"
  44427. // },
  44428. // "maxResults": {
  44429. // "default": "1000",
  44430. // "description": "Maximum number of results to return.",
  44431. // "format": "int32",
  44432. // "location": "query",
  44433. // "maximum": "1000",
  44434. // "minimum": "0",
  44435. // "type": "integer"
  44436. // },
  44437. // "pageToken": {
  44438. // "description": "Value of the nextPageToken from the previous result page.",
  44439. // "location": "query",
  44440. // "type": "string"
  44441. // },
  44442. // "profileId": {
  44443. // "description": "User profile ID associated with this request.",
  44444. // "format": "int64",
  44445. // "location": "path",
  44446. // "required": true,
  44447. // "type": "string"
  44448. // },
  44449. // "searchString": {
  44450. // "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\".",
  44451. // "location": "query",
  44452. // "type": "string"
  44453. // },
  44454. // "sortField": {
  44455. // "default": "ID",
  44456. // "description": "Field by which to sort the list.",
  44457. // "enum": [
  44458. // "ID",
  44459. // "NAME"
  44460. // ],
  44461. // "enumDescriptions": [
  44462. // "",
  44463. // ""
  44464. // ],
  44465. // "location": "query",
  44466. // "type": "string"
  44467. // },
  44468. // "sortOrder": {
  44469. // "default": "ASCENDING",
  44470. // "description": "Order of sorted results.",
  44471. // "enum": [
  44472. // "ASCENDING",
  44473. // "DESCENDING"
  44474. // ],
  44475. // "enumDescriptions": [
  44476. // "",
  44477. // ""
  44478. // ],
  44479. // "location": "query",
  44480. // "type": "string"
  44481. // }
  44482. // },
  44483. // "path": "userprofiles/{profileId}/targetingTemplates",
  44484. // "response": {
  44485. // "$ref": "TargetingTemplatesListResponse"
  44486. // },
  44487. // "scopes": [
  44488. // "https://www.googleapis.com/auth/dfatrafficking"
  44489. // ]
  44490. // }
  44491. }
  44492. // Pages invokes f for each page of results.
  44493. // A non-nil error returned from f will halt the iteration.
  44494. // The provided context supersedes any context provided to the Context method.
  44495. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  44496. c.ctx_ = ctx
  44497. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44498. for {
  44499. x, err := c.Do()
  44500. if err != nil {
  44501. return err
  44502. }
  44503. if err := f(x); err != nil {
  44504. return err
  44505. }
  44506. if x.NextPageToken == "" {
  44507. return nil
  44508. }
  44509. c.PageToken(x.NextPageToken)
  44510. }
  44511. }
  44512. // method id "dfareporting.targetingTemplates.patch":
  44513. type TargetingTemplatesPatchCall struct {
  44514. s *Service
  44515. profileId int64
  44516. targetingtemplate *TargetingTemplate
  44517. urlParams_ gensupport.URLParams
  44518. ctx_ context.Context
  44519. header_ http.Header
  44520. }
  44521. // Patch: Updates an existing targeting template. This method supports
  44522. // patch semantics.
  44523. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  44524. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44525. c.profileId = profileId
  44526. c.urlParams_.Set("id", fmt.Sprint(id))
  44527. c.targetingtemplate = targetingtemplate
  44528. return c
  44529. }
  44530. // Fields allows partial responses to be retrieved. See
  44531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44532. // for more information.
  44533. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  44534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44535. return c
  44536. }
  44537. // Context sets the context to be used in this call's Do method. Any
  44538. // pending HTTP request will be aborted if the provided context is
  44539. // canceled.
  44540. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  44541. c.ctx_ = ctx
  44542. return c
  44543. }
  44544. // Header returns an http.Header that can be modified by the caller to
  44545. // add HTTP headers to the request.
  44546. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  44547. if c.header_ == nil {
  44548. c.header_ = make(http.Header)
  44549. }
  44550. return c.header_
  44551. }
  44552. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  44553. reqHeaders := make(http.Header)
  44554. for k, v := range c.header_ {
  44555. reqHeaders[k] = v
  44556. }
  44557. reqHeaders.Set("User-Agent", c.s.userAgent())
  44558. var body io.Reader = nil
  44559. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44560. if err != nil {
  44561. return nil, err
  44562. }
  44563. reqHeaders.Set("Content-Type", "application/json")
  44564. c.urlParams_.Set("alt", alt)
  44565. c.urlParams_.Set("prettyPrint", "false")
  44566. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44567. urls += "?" + c.urlParams_.Encode()
  44568. req, err := http.NewRequest("PATCH", urls, body)
  44569. if err != nil {
  44570. return nil, err
  44571. }
  44572. req.Header = reqHeaders
  44573. googleapi.Expand(req.URL, map[string]string{
  44574. "profileId": strconv.FormatInt(c.profileId, 10),
  44575. })
  44576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44577. }
  44578. // Do executes the "dfareporting.targetingTemplates.patch" call.
  44579. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44580. // non-2xx status code is an error. Response headers are in either
  44581. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44582. // returned at all) in error.(*googleapi.Error).Header. Use
  44583. // googleapi.IsNotModified to check whether the returned error was
  44584. // because http.StatusNotModified was returned.
  44585. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44586. gensupport.SetOptions(c.urlParams_, opts...)
  44587. res, err := c.doRequest("json")
  44588. if res != nil && res.StatusCode == http.StatusNotModified {
  44589. if res.Body != nil {
  44590. res.Body.Close()
  44591. }
  44592. return nil, &googleapi.Error{
  44593. Code: res.StatusCode,
  44594. Header: res.Header,
  44595. }
  44596. }
  44597. if err != nil {
  44598. return nil, err
  44599. }
  44600. defer googleapi.CloseBody(res)
  44601. if err := googleapi.CheckResponse(res); err != nil {
  44602. return nil, err
  44603. }
  44604. ret := &TargetingTemplate{
  44605. ServerResponse: googleapi.ServerResponse{
  44606. Header: res.Header,
  44607. HTTPStatusCode: res.StatusCode,
  44608. },
  44609. }
  44610. target := &ret
  44611. if err := gensupport.DecodeResponse(target, res); err != nil {
  44612. return nil, err
  44613. }
  44614. return ret, nil
  44615. // {
  44616. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  44617. // "httpMethod": "PATCH",
  44618. // "id": "dfareporting.targetingTemplates.patch",
  44619. // "parameterOrder": [
  44620. // "profileId",
  44621. // "id"
  44622. // ],
  44623. // "parameters": {
  44624. // "id": {
  44625. // "description": "Targeting template ID.",
  44626. // "format": "int64",
  44627. // "location": "query",
  44628. // "required": true,
  44629. // "type": "string"
  44630. // },
  44631. // "profileId": {
  44632. // "description": "User profile ID associated with this request.",
  44633. // "format": "int64",
  44634. // "location": "path",
  44635. // "required": true,
  44636. // "type": "string"
  44637. // }
  44638. // },
  44639. // "path": "userprofiles/{profileId}/targetingTemplates",
  44640. // "request": {
  44641. // "$ref": "TargetingTemplate"
  44642. // },
  44643. // "response": {
  44644. // "$ref": "TargetingTemplate"
  44645. // },
  44646. // "scopes": [
  44647. // "https://www.googleapis.com/auth/dfatrafficking"
  44648. // ]
  44649. // }
  44650. }
  44651. // method id "dfareporting.targetingTemplates.update":
  44652. type TargetingTemplatesUpdateCall struct {
  44653. s *Service
  44654. profileId int64
  44655. targetingtemplate *TargetingTemplate
  44656. urlParams_ gensupport.URLParams
  44657. ctx_ context.Context
  44658. header_ http.Header
  44659. }
  44660. // Update: Updates an existing targeting template.
  44661. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  44662. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44663. c.profileId = profileId
  44664. c.targetingtemplate = targetingtemplate
  44665. return c
  44666. }
  44667. // Fields allows partial responses to be retrieved. See
  44668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44669. // for more information.
  44670. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  44671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44672. return c
  44673. }
  44674. // Context sets the context to be used in this call's Do method. Any
  44675. // pending HTTP request will be aborted if the provided context is
  44676. // canceled.
  44677. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  44678. c.ctx_ = ctx
  44679. return c
  44680. }
  44681. // Header returns an http.Header that can be modified by the caller to
  44682. // add HTTP headers to the request.
  44683. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  44684. if c.header_ == nil {
  44685. c.header_ = make(http.Header)
  44686. }
  44687. return c.header_
  44688. }
  44689. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  44690. reqHeaders := make(http.Header)
  44691. for k, v := range c.header_ {
  44692. reqHeaders[k] = v
  44693. }
  44694. reqHeaders.Set("User-Agent", c.s.userAgent())
  44695. var body io.Reader = nil
  44696. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44697. if err != nil {
  44698. return nil, err
  44699. }
  44700. reqHeaders.Set("Content-Type", "application/json")
  44701. c.urlParams_.Set("alt", alt)
  44702. c.urlParams_.Set("prettyPrint", "false")
  44703. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44704. urls += "?" + c.urlParams_.Encode()
  44705. req, err := http.NewRequest("PUT", urls, body)
  44706. if err != nil {
  44707. return nil, err
  44708. }
  44709. req.Header = reqHeaders
  44710. googleapi.Expand(req.URL, map[string]string{
  44711. "profileId": strconv.FormatInt(c.profileId, 10),
  44712. })
  44713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44714. }
  44715. // Do executes the "dfareporting.targetingTemplates.update" call.
  44716. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44717. // non-2xx status code is an error. Response headers are in either
  44718. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44719. // returned at all) in error.(*googleapi.Error).Header. Use
  44720. // googleapi.IsNotModified to check whether the returned error was
  44721. // because http.StatusNotModified was returned.
  44722. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44723. gensupport.SetOptions(c.urlParams_, opts...)
  44724. res, err := c.doRequest("json")
  44725. if res != nil && res.StatusCode == http.StatusNotModified {
  44726. if res.Body != nil {
  44727. res.Body.Close()
  44728. }
  44729. return nil, &googleapi.Error{
  44730. Code: res.StatusCode,
  44731. Header: res.Header,
  44732. }
  44733. }
  44734. if err != nil {
  44735. return nil, err
  44736. }
  44737. defer googleapi.CloseBody(res)
  44738. if err := googleapi.CheckResponse(res); err != nil {
  44739. return nil, err
  44740. }
  44741. ret := &TargetingTemplate{
  44742. ServerResponse: googleapi.ServerResponse{
  44743. Header: res.Header,
  44744. HTTPStatusCode: res.StatusCode,
  44745. },
  44746. }
  44747. target := &ret
  44748. if err := gensupport.DecodeResponse(target, res); err != nil {
  44749. return nil, err
  44750. }
  44751. return ret, nil
  44752. // {
  44753. // "description": "Updates an existing targeting template.",
  44754. // "httpMethod": "PUT",
  44755. // "id": "dfareporting.targetingTemplates.update",
  44756. // "parameterOrder": [
  44757. // "profileId"
  44758. // ],
  44759. // "parameters": {
  44760. // "profileId": {
  44761. // "description": "User profile ID associated with this request.",
  44762. // "format": "int64",
  44763. // "location": "path",
  44764. // "required": true,
  44765. // "type": "string"
  44766. // }
  44767. // },
  44768. // "path": "userprofiles/{profileId}/targetingTemplates",
  44769. // "request": {
  44770. // "$ref": "TargetingTemplate"
  44771. // },
  44772. // "response": {
  44773. // "$ref": "TargetingTemplate"
  44774. // },
  44775. // "scopes": [
  44776. // "https://www.googleapis.com/auth/dfatrafficking"
  44777. // ]
  44778. // }
  44779. }
  44780. // method id "dfareporting.userProfiles.get":
  44781. type UserProfilesGetCall struct {
  44782. s *Service
  44783. profileId int64
  44784. urlParams_ gensupport.URLParams
  44785. ifNoneMatch_ string
  44786. ctx_ context.Context
  44787. header_ http.Header
  44788. }
  44789. // Get: Gets one user profile by ID.
  44790. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  44791. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44792. c.profileId = profileId
  44793. return c
  44794. }
  44795. // Fields allows partial responses to be retrieved. See
  44796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44797. // for more information.
  44798. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  44799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44800. return c
  44801. }
  44802. // IfNoneMatch sets the optional parameter which makes the operation
  44803. // fail if the object's ETag matches the given value. This is useful for
  44804. // getting updates only after the object has changed since the last
  44805. // request. Use googleapi.IsNotModified to check whether the response
  44806. // error from Do is the result of In-None-Match.
  44807. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  44808. c.ifNoneMatch_ = entityTag
  44809. return c
  44810. }
  44811. // Context sets the context to be used in this call's Do method. Any
  44812. // pending HTTP request will be aborted if the provided context is
  44813. // canceled.
  44814. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  44815. c.ctx_ = ctx
  44816. return c
  44817. }
  44818. // Header returns an http.Header that can be modified by the caller to
  44819. // add HTTP headers to the request.
  44820. func (c *UserProfilesGetCall) Header() http.Header {
  44821. if c.header_ == nil {
  44822. c.header_ = make(http.Header)
  44823. }
  44824. return c.header_
  44825. }
  44826. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  44827. reqHeaders := make(http.Header)
  44828. for k, v := range c.header_ {
  44829. reqHeaders[k] = v
  44830. }
  44831. reqHeaders.Set("User-Agent", c.s.userAgent())
  44832. if c.ifNoneMatch_ != "" {
  44833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44834. }
  44835. var body io.Reader = nil
  44836. c.urlParams_.Set("alt", alt)
  44837. c.urlParams_.Set("prettyPrint", "false")
  44838. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  44839. urls += "?" + c.urlParams_.Encode()
  44840. req, err := http.NewRequest("GET", urls, body)
  44841. if err != nil {
  44842. return nil, err
  44843. }
  44844. req.Header = reqHeaders
  44845. googleapi.Expand(req.URL, map[string]string{
  44846. "profileId": strconv.FormatInt(c.profileId, 10),
  44847. })
  44848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44849. }
  44850. // Do executes the "dfareporting.userProfiles.get" call.
  44851. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  44852. // status code is an error. Response headers are in either
  44853. // *UserProfile.ServerResponse.Header or (if a response was returned at
  44854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44855. // to check whether the returned error was because
  44856. // http.StatusNotModified was returned.
  44857. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  44858. gensupport.SetOptions(c.urlParams_, opts...)
  44859. res, err := c.doRequest("json")
  44860. if res != nil && res.StatusCode == http.StatusNotModified {
  44861. if res.Body != nil {
  44862. res.Body.Close()
  44863. }
  44864. return nil, &googleapi.Error{
  44865. Code: res.StatusCode,
  44866. Header: res.Header,
  44867. }
  44868. }
  44869. if err != nil {
  44870. return nil, err
  44871. }
  44872. defer googleapi.CloseBody(res)
  44873. if err := googleapi.CheckResponse(res); err != nil {
  44874. return nil, err
  44875. }
  44876. ret := &UserProfile{
  44877. ServerResponse: googleapi.ServerResponse{
  44878. Header: res.Header,
  44879. HTTPStatusCode: res.StatusCode,
  44880. },
  44881. }
  44882. target := &ret
  44883. if err := gensupport.DecodeResponse(target, res); err != nil {
  44884. return nil, err
  44885. }
  44886. return ret, nil
  44887. // {
  44888. // "description": "Gets one user profile by ID.",
  44889. // "httpMethod": "GET",
  44890. // "id": "dfareporting.userProfiles.get",
  44891. // "parameterOrder": [
  44892. // "profileId"
  44893. // ],
  44894. // "parameters": {
  44895. // "profileId": {
  44896. // "description": "The user profile ID.",
  44897. // "format": "int64",
  44898. // "location": "path",
  44899. // "required": true,
  44900. // "type": "string"
  44901. // }
  44902. // },
  44903. // "path": "userprofiles/{profileId}",
  44904. // "response": {
  44905. // "$ref": "UserProfile"
  44906. // },
  44907. // "scopes": [
  44908. // "https://www.googleapis.com/auth/dfareporting",
  44909. // "https://www.googleapis.com/auth/dfatrafficking"
  44910. // ]
  44911. // }
  44912. }
  44913. // method id "dfareporting.userProfiles.list":
  44914. type UserProfilesListCall struct {
  44915. s *Service
  44916. urlParams_ gensupport.URLParams
  44917. ifNoneMatch_ string
  44918. ctx_ context.Context
  44919. header_ http.Header
  44920. }
  44921. // List: Retrieves list of user profiles for a user.
  44922. func (r *UserProfilesService) List() *UserProfilesListCall {
  44923. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44924. return c
  44925. }
  44926. // Fields allows partial responses to be retrieved. See
  44927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44928. // for more information.
  44929. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  44930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44931. return c
  44932. }
  44933. // IfNoneMatch sets the optional parameter which makes the operation
  44934. // fail if the object's ETag matches the given value. This is useful for
  44935. // getting updates only after the object has changed since the last
  44936. // request. Use googleapi.IsNotModified to check whether the response
  44937. // error from Do is the result of In-None-Match.
  44938. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  44939. c.ifNoneMatch_ = entityTag
  44940. return c
  44941. }
  44942. // Context sets the context to be used in this call's Do method. Any
  44943. // pending HTTP request will be aborted if the provided context is
  44944. // canceled.
  44945. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  44946. c.ctx_ = ctx
  44947. return c
  44948. }
  44949. // Header returns an http.Header that can be modified by the caller to
  44950. // add HTTP headers to the request.
  44951. func (c *UserProfilesListCall) Header() http.Header {
  44952. if c.header_ == nil {
  44953. c.header_ = make(http.Header)
  44954. }
  44955. return c.header_
  44956. }
  44957. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  44958. reqHeaders := make(http.Header)
  44959. for k, v := range c.header_ {
  44960. reqHeaders[k] = v
  44961. }
  44962. reqHeaders.Set("User-Agent", c.s.userAgent())
  44963. if c.ifNoneMatch_ != "" {
  44964. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44965. }
  44966. var body io.Reader = nil
  44967. c.urlParams_.Set("alt", alt)
  44968. c.urlParams_.Set("prettyPrint", "false")
  44969. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  44970. urls += "?" + c.urlParams_.Encode()
  44971. req, err := http.NewRequest("GET", urls, body)
  44972. if err != nil {
  44973. return nil, err
  44974. }
  44975. req.Header = reqHeaders
  44976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44977. }
  44978. // Do executes the "dfareporting.userProfiles.list" call.
  44979. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  44980. // status code is an error. Response headers are in either
  44981. // *UserProfileList.ServerResponse.Header or (if a response was returned
  44982. // at all) in error.(*googleapi.Error).Header. Use
  44983. // googleapi.IsNotModified to check whether the returned error was
  44984. // because http.StatusNotModified was returned.
  44985. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  44986. gensupport.SetOptions(c.urlParams_, opts...)
  44987. res, err := c.doRequest("json")
  44988. if res != nil && res.StatusCode == http.StatusNotModified {
  44989. if res.Body != nil {
  44990. res.Body.Close()
  44991. }
  44992. return nil, &googleapi.Error{
  44993. Code: res.StatusCode,
  44994. Header: res.Header,
  44995. }
  44996. }
  44997. if err != nil {
  44998. return nil, err
  44999. }
  45000. defer googleapi.CloseBody(res)
  45001. if err := googleapi.CheckResponse(res); err != nil {
  45002. return nil, err
  45003. }
  45004. ret := &UserProfileList{
  45005. ServerResponse: googleapi.ServerResponse{
  45006. Header: res.Header,
  45007. HTTPStatusCode: res.StatusCode,
  45008. },
  45009. }
  45010. target := &ret
  45011. if err := gensupport.DecodeResponse(target, res); err != nil {
  45012. return nil, err
  45013. }
  45014. return ret, nil
  45015. // {
  45016. // "description": "Retrieves list of user profiles for a user.",
  45017. // "httpMethod": "GET",
  45018. // "id": "dfareporting.userProfiles.list",
  45019. // "path": "userprofiles",
  45020. // "response": {
  45021. // "$ref": "UserProfileList"
  45022. // },
  45023. // "scopes": [
  45024. // "https://www.googleapis.com/auth/dfareporting",
  45025. // "https://www.googleapis.com/auth/dfatrafficking"
  45026. // ]
  45027. // }
  45028. }
  45029. // method id "dfareporting.userRolePermissionGroups.get":
  45030. type UserRolePermissionGroupsGetCall struct {
  45031. s *Service
  45032. profileId int64
  45033. id int64
  45034. urlParams_ gensupport.URLParams
  45035. ifNoneMatch_ string
  45036. ctx_ context.Context
  45037. header_ http.Header
  45038. }
  45039. // Get: Gets one user role permission group by ID.
  45040. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  45041. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45042. c.profileId = profileId
  45043. c.id = id
  45044. return c
  45045. }
  45046. // Fields allows partial responses to be retrieved. See
  45047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45048. // for more information.
  45049. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  45050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45051. return c
  45052. }
  45053. // IfNoneMatch sets the optional parameter which makes the operation
  45054. // fail if the object's ETag matches the given value. This is useful for
  45055. // getting updates only after the object has changed since the last
  45056. // request. Use googleapi.IsNotModified to check whether the response
  45057. // error from Do is the result of In-None-Match.
  45058. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  45059. c.ifNoneMatch_ = entityTag
  45060. return c
  45061. }
  45062. // Context sets the context to be used in this call's Do method. Any
  45063. // pending HTTP request will be aborted if the provided context is
  45064. // canceled.
  45065. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  45066. c.ctx_ = ctx
  45067. return c
  45068. }
  45069. // Header returns an http.Header that can be modified by the caller to
  45070. // add HTTP headers to the request.
  45071. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  45072. if c.header_ == nil {
  45073. c.header_ = make(http.Header)
  45074. }
  45075. return c.header_
  45076. }
  45077. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  45078. reqHeaders := make(http.Header)
  45079. for k, v := range c.header_ {
  45080. reqHeaders[k] = v
  45081. }
  45082. reqHeaders.Set("User-Agent", c.s.userAgent())
  45083. if c.ifNoneMatch_ != "" {
  45084. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45085. }
  45086. var body io.Reader = nil
  45087. c.urlParams_.Set("alt", alt)
  45088. c.urlParams_.Set("prettyPrint", "false")
  45089. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  45090. urls += "?" + c.urlParams_.Encode()
  45091. req, err := http.NewRequest("GET", urls, body)
  45092. if err != nil {
  45093. return nil, err
  45094. }
  45095. req.Header = reqHeaders
  45096. googleapi.Expand(req.URL, map[string]string{
  45097. "profileId": strconv.FormatInt(c.profileId, 10),
  45098. "id": strconv.FormatInt(c.id, 10),
  45099. })
  45100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45101. }
  45102. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  45103. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  45104. // non-2xx status code is an error. Response headers are in either
  45105. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  45106. // returned at all) in error.(*googleapi.Error).Header. Use
  45107. // googleapi.IsNotModified to check whether the returned error was
  45108. // because http.StatusNotModified was returned.
  45109. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  45110. gensupport.SetOptions(c.urlParams_, opts...)
  45111. res, err := c.doRequest("json")
  45112. if res != nil && res.StatusCode == http.StatusNotModified {
  45113. if res.Body != nil {
  45114. res.Body.Close()
  45115. }
  45116. return nil, &googleapi.Error{
  45117. Code: res.StatusCode,
  45118. Header: res.Header,
  45119. }
  45120. }
  45121. if err != nil {
  45122. return nil, err
  45123. }
  45124. defer googleapi.CloseBody(res)
  45125. if err := googleapi.CheckResponse(res); err != nil {
  45126. return nil, err
  45127. }
  45128. ret := &UserRolePermissionGroup{
  45129. ServerResponse: googleapi.ServerResponse{
  45130. Header: res.Header,
  45131. HTTPStatusCode: res.StatusCode,
  45132. },
  45133. }
  45134. target := &ret
  45135. if err := gensupport.DecodeResponse(target, res); err != nil {
  45136. return nil, err
  45137. }
  45138. return ret, nil
  45139. // {
  45140. // "description": "Gets one user role permission group by ID.",
  45141. // "httpMethod": "GET",
  45142. // "id": "dfareporting.userRolePermissionGroups.get",
  45143. // "parameterOrder": [
  45144. // "profileId",
  45145. // "id"
  45146. // ],
  45147. // "parameters": {
  45148. // "id": {
  45149. // "description": "User role permission group ID.",
  45150. // "format": "int64",
  45151. // "location": "path",
  45152. // "required": true,
  45153. // "type": "string"
  45154. // },
  45155. // "profileId": {
  45156. // "description": "User profile ID associated with this request.",
  45157. // "format": "int64",
  45158. // "location": "path",
  45159. // "required": true,
  45160. // "type": "string"
  45161. // }
  45162. // },
  45163. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  45164. // "response": {
  45165. // "$ref": "UserRolePermissionGroup"
  45166. // },
  45167. // "scopes": [
  45168. // "https://www.googleapis.com/auth/dfatrafficking"
  45169. // ]
  45170. // }
  45171. }
  45172. // method id "dfareporting.userRolePermissionGroups.list":
  45173. type UserRolePermissionGroupsListCall struct {
  45174. s *Service
  45175. profileId int64
  45176. urlParams_ gensupport.URLParams
  45177. ifNoneMatch_ string
  45178. ctx_ context.Context
  45179. header_ http.Header
  45180. }
  45181. // List: Gets a list of all supported user role permission groups.
  45182. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  45183. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45184. c.profileId = profileId
  45185. return c
  45186. }
  45187. // Fields allows partial responses to be retrieved. See
  45188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45189. // for more information.
  45190. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  45191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45192. return c
  45193. }
  45194. // IfNoneMatch sets the optional parameter which makes the operation
  45195. // fail if the object's ETag matches the given value. This is useful for
  45196. // getting updates only after the object has changed since the last
  45197. // request. Use googleapi.IsNotModified to check whether the response
  45198. // error from Do is the result of In-None-Match.
  45199. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  45200. c.ifNoneMatch_ = entityTag
  45201. return c
  45202. }
  45203. // Context sets the context to be used in this call's Do method. Any
  45204. // pending HTTP request will be aborted if the provided context is
  45205. // canceled.
  45206. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  45207. c.ctx_ = ctx
  45208. return c
  45209. }
  45210. // Header returns an http.Header that can be modified by the caller to
  45211. // add HTTP headers to the request.
  45212. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  45213. if c.header_ == nil {
  45214. c.header_ = make(http.Header)
  45215. }
  45216. return c.header_
  45217. }
  45218. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  45219. reqHeaders := make(http.Header)
  45220. for k, v := range c.header_ {
  45221. reqHeaders[k] = v
  45222. }
  45223. reqHeaders.Set("User-Agent", c.s.userAgent())
  45224. if c.ifNoneMatch_ != "" {
  45225. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45226. }
  45227. var body io.Reader = nil
  45228. c.urlParams_.Set("alt", alt)
  45229. c.urlParams_.Set("prettyPrint", "false")
  45230. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  45231. urls += "?" + c.urlParams_.Encode()
  45232. req, err := http.NewRequest("GET", urls, body)
  45233. if err != nil {
  45234. return nil, err
  45235. }
  45236. req.Header = reqHeaders
  45237. googleapi.Expand(req.URL, map[string]string{
  45238. "profileId": strconv.FormatInt(c.profileId, 10),
  45239. })
  45240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45241. }
  45242. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  45243. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  45244. // non-nil. Any non-2xx status code is an error. Response headers are in
  45245. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  45246. // (if a response was returned at all) in
  45247. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  45248. // whether the returned error was because http.StatusNotModified was
  45249. // returned.
  45250. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  45251. gensupport.SetOptions(c.urlParams_, opts...)
  45252. res, err := c.doRequest("json")
  45253. if res != nil && res.StatusCode == http.StatusNotModified {
  45254. if res.Body != nil {
  45255. res.Body.Close()
  45256. }
  45257. return nil, &googleapi.Error{
  45258. Code: res.StatusCode,
  45259. Header: res.Header,
  45260. }
  45261. }
  45262. if err != nil {
  45263. return nil, err
  45264. }
  45265. defer googleapi.CloseBody(res)
  45266. if err := googleapi.CheckResponse(res); err != nil {
  45267. return nil, err
  45268. }
  45269. ret := &UserRolePermissionGroupsListResponse{
  45270. ServerResponse: googleapi.ServerResponse{
  45271. Header: res.Header,
  45272. HTTPStatusCode: res.StatusCode,
  45273. },
  45274. }
  45275. target := &ret
  45276. if err := gensupport.DecodeResponse(target, res); err != nil {
  45277. return nil, err
  45278. }
  45279. return ret, nil
  45280. // {
  45281. // "description": "Gets a list of all supported user role permission groups.",
  45282. // "httpMethod": "GET",
  45283. // "id": "dfareporting.userRolePermissionGroups.list",
  45284. // "parameterOrder": [
  45285. // "profileId"
  45286. // ],
  45287. // "parameters": {
  45288. // "profileId": {
  45289. // "description": "User profile ID associated with this request.",
  45290. // "format": "int64",
  45291. // "location": "path",
  45292. // "required": true,
  45293. // "type": "string"
  45294. // }
  45295. // },
  45296. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  45297. // "response": {
  45298. // "$ref": "UserRolePermissionGroupsListResponse"
  45299. // },
  45300. // "scopes": [
  45301. // "https://www.googleapis.com/auth/dfatrafficking"
  45302. // ]
  45303. // }
  45304. }
  45305. // method id "dfareporting.userRolePermissions.get":
  45306. type UserRolePermissionsGetCall struct {
  45307. s *Service
  45308. profileId int64
  45309. id int64
  45310. urlParams_ gensupport.URLParams
  45311. ifNoneMatch_ string
  45312. ctx_ context.Context
  45313. header_ http.Header
  45314. }
  45315. // Get: Gets one user role permission by ID.
  45316. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  45317. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45318. c.profileId = profileId
  45319. c.id = id
  45320. return c
  45321. }
  45322. // Fields allows partial responses to be retrieved. See
  45323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45324. // for more information.
  45325. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  45326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45327. return c
  45328. }
  45329. // IfNoneMatch sets the optional parameter which makes the operation
  45330. // fail if the object's ETag matches the given value. This is useful for
  45331. // getting updates only after the object has changed since the last
  45332. // request. Use googleapi.IsNotModified to check whether the response
  45333. // error from Do is the result of In-None-Match.
  45334. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  45335. c.ifNoneMatch_ = entityTag
  45336. return c
  45337. }
  45338. // Context sets the context to be used in this call's Do method. Any
  45339. // pending HTTP request will be aborted if the provided context is
  45340. // canceled.
  45341. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  45342. c.ctx_ = ctx
  45343. return c
  45344. }
  45345. // Header returns an http.Header that can be modified by the caller to
  45346. // add HTTP headers to the request.
  45347. func (c *UserRolePermissionsGetCall) Header() http.Header {
  45348. if c.header_ == nil {
  45349. c.header_ = make(http.Header)
  45350. }
  45351. return c.header_
  45352. }
  45353. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  45354. reqHeaders := make(http.Header)
  45355. for k, v := range c.header_ {
  45356. reqHeaders[k] = v
  45357. }
  45358. reqHeaders.Set("User-Agent", c.s.userAgent())
  45359. if c.ifNoneMatch_ != "" {
  45360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45361. }
  45362. var body io.Reader = nil
  45363. c.urlParams_.Set("alt", alt)
  45364. c.urlParams_.Set("prettyPrint", "false")
  45365. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  45366. urls += "?" + c.urlParams_.Encode()
  45367. req, err := http.NewRequest("GET", urls, body)
  45368. if err != nil {
  45369. return nil, err
  45370. }
  45371. req.Header = reqHeaders
  45372. googleapi.Expand(req.URL, map[string]string{
  45373. "profileId": strconv.FormatInt(c.profileId, 10),
  45374. "id": strconv.FormatInt(c.id, 10),
  45375. })
  45376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45377. }
  45378. // Do executes the "dfareporting.userRolePermissions.get" call.
  45379. // Exactly one of *UserRolePermission or error will be non-nil. Any
  45380. // non-2xx status code is an error. Response headers are in either
  45381. // *UserRolePermission.ServerResponse.Header or (if a response was
  45382. // returned at all) in error.(*googleapi.Error).Header. Use
  45383. // googleapi.IsNotModified to check whether the returned error was
  45384. // because http.StatusNotModified was returned.
  45385. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  45386. gensupport.SetOptions(c.urlParams_, opts...)
  45387. res, err := c.doRequest("json")
  45388. if res != nil && res.StatusCode == http.StatusNotModified {
  45389. if res.Body != nil {
  45390. res.Body.Close()
  45391. }
  45392. return nil, &googleapi.Error{
  45393. Code: res.StatusCode,
  45394. Header: res.Header,
  45395. }
  45396. }
  45397. if err != nil {
  45398. return nil, err
  45399. }
  45400. defer googleapi.CloseBody(res)
  45401. if err := googleapi.CheckResponse(res); err != nil {
  45402. return nil, err
  45403. }
  45404. ret := &UserRolePermission{
  45405. ServerResponse: googleapi.ServerResponse{
  45406. Header: res.Header,
  45407. HTTPStatusCode: res.StatusCode,
  45408. },
  45409. }
  45410. target := &ret
  45411. if err := gensupport.DecodeResponse(target, res); err != nil {
  45412. return nil, err
  45413. }
  45414. return ret, nil
  45415. // {
  45416. // "description": "Gets one user role permission by ID.",
  45417. // "httpMethod": "GET",
  45418. // "id": "dfareporting.userRolePermissions.get",
  45419. // "parameterOrder": [
  45420. // "profileId",
  45421. // "id"
  45422. // ],
  45423. // "parameters": {
  45424. // "id": {
  45425. // "description": "User role permission ID.",
  45426. // "format": "int64",
  45427. // "location": "path",
  45428. // "required": true,
  45429. // "type": "string"
  45430. // },
  45431. // "profileId": {
  45432. // "description": "User profile ID associated with this request.",
  45433. // "format": "int64",
  45434. // "location": "path",
  45435. // "required": true,
  45436. // "type": "string"
  45437. // }
  45438. // },
  45439. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  45440. // "response": {
  45441. // "$ref": "UserRolePermission"
  45442. // },
  45443. // "scopes": [
  45444. // "https://www.googleapis.com/auth/dfatrafficking"
  45445. // ]
  45446. // }
  45447. }
  45448. // method id "dfareporting.userRolePermissions.list":
  45449. type UserRolePermissionsListCall struct {
  45450. s *Service
  45451. profileId int64
  45452. urlParams_ gensupport.URLParams
  45453. ifNoneMatch_ string
  45454. ctx_ context.Context
  45455. header_ http.Header
  45456. }
  45457. // List: Gets a list of user role permissions, possibly filtered.
  45458. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  45459. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45460. c.profileId = profileId
  45461. return c
  45462. }
  45463. // Ids sets the optional parameter "ids": Select only user role
  45464. // permissions with these IDs.
  45465. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  45466. var ids_ []string
  45467. for _, v := range ids {
  45468. ids_ = append(ids_, fmt.Sprint(v))
  45469. }
  45470. c.urlParams_.SetMulti("ids", ids_)
  45471. return c
  45472. }
  45473. // Fields allows partial responses to be retrieved. See
  45474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45475. // for more information.
  45476. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  45477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45478. return c
  45479. }
  45480. // IfNoneMatch sets the optional parameter which makes the operation
  45481. // fail if the object's ETag matches the given value. This is useful for
  45482. // getting updates only after the object has changed since the last
  45483. // request. Use googleapi.IsNotModified to check whether the response
  45484. // error from Do is the result of In-None-Match.
  45485. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  45486. c.ifNoneMatch_ = entityTag
  45487. return c
  45488. }
  45489. // Context sets the context to be used in this call's Do method. Any
  45490. // pending HTTP request will be aborted if the provided context is
  45491. // canceled.
  45492. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  45493. c.ctx_ = ctx
  45494. return c
  45495. }
  45496. // Header returns an http.Header that can be modified by the caller to
  45497. // add HTTP headers to the request.
  45498. func (c *UserRolePermissionsListCall) Header() http.Header {
  45499. if c.header_ == nil {
  45500. c.header_ = make(http.Header)
  45501. }
  45502. return c.header_
  45503. }
  45504. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  45505. reqHeaders := make(http.Header)
  45506. for k, v := range c.header_ {
  45507. reqHeaders[k] = v
  45508. }
  45509. reqHeaders.Set("User-Agent", c.s.userAgent())
  45510. if c.ifNoneMatch_ != "" {
  45511. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45512. }
  45513. var body io.Reader = nil
  45514. c.urlParams_.Set("alt", alt)
  45515. c.urlParams_.Set("prettyPrint", "false")
  45516. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  45517. urls += "?" + c.urlParams_.Encode()
  45518. req, err := http.NewRequest("GET", urls, body)
  45519. if err != nil {
  45520. return nil, err
  45521. }
  45522. req.Header = reqHeaders
  45523. googleapi.Expand(req.URL, map[string]string{
  45524. "profileId": strconv.FormatInt(c.profileId, 10),
  45525. })
  45526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45527. }
  45528. // Do executes the "dfareporting.userRolePermissions.list" call.
  45529. // Exactly one of *UserRolePermissionsListResponse or error will be
  45530. // non-nil. Any non-2xx status code is an error. Response headers are in
  45531. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  45532. // a response was returned at all) in error.(*googleapi.Error).Header.
  45533. // Use googleapi.IsNotModified to check whether the returned error was
  45534. // because http.StatusNotModified was returned.
  45535. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  45536. gensupport.SetOptions(c.urlParams_, opts...)
  45537. res, err := c.doRequest("json")
  45538. if res != nil && res.StatusCode == http.StatusNotModified {
  45539. if res.Body != nil {
  45540. res.Body.Close()
  45541. }
  45542. return nil, &googleapi.Error{
  45543. Code: res.StatusCode,
  45544. Header: res.Header,
  45545. }
  45546. }
  45547. if err != nil {
  45548. return nil, err
  45549. }
  45550. defer googleapi.CloseBody(res)
  45551. if err := googleapi.CheckResponse(res); err != nil {
  45552. return nil, err
  45553. }
  45554. ret := &UserRolePermissionsListResponse{
  45555. ServerResponse: googleapi.ServerResponse{
  45556. Header: res.Header,
  45557. HTTPStatusCode: res.StatusCode,
  45558. },
  45559. }
  45560. target := &ret
  45561. if err := gensupport.DecodeResponse(target, res); err != nil {
  45562. return nil, err
  45563. }
  45564. return ret, nil
  45565. // {
  45566. // "description": "Gets a list of user role permissions, possibly filtered.",
  45567. // "httpMethod": "GET",
  45568. // "id": "dfareporting.userRolePermissions.list",
  45569. // "parameterOrder": [
  45570. // "profileId"
  45571. // ],
  45572. // "parameters": {
  45573. // "ids": {
  45574. // "description": "Select only user role permissions with these IDs.",
  45575. // "format": "int64",
  45576. // "location": "query",
  45577. // "repeated": true,
  45578. // "type": "string"
  45579. // },
  45580. // "profileId": {
  45581. // "description": "User profile ID associated with this request.",
  45582. // "format": "int64",
  45583. // "location": "path",
  45584. // "required": true,
  45585. // "type": "string"
  45586. // }
  45587. // },
  45588. // "path": "userprofiles/{profileId}/userRolePermissions",
  45589. // "response": {
  45590. // "$ref": "UserRolePermissionsListResponse"
  45591. // },
  45592. // "scopes": [
  45593. // "https://www.googleapis.com/auth/dfatrafficking"
  45594. // ]
  45595. // }
  45596. }
  45597. // method id "dfareporting.userRoles.delete":
  45598. type UserRolesDeleteCall struct {
  45599. s *Service
  45600. profileId int64
  45601. id int64
  45602. urlParams_ gensupport.URLParams
  45603. ctx_ context.Context
  45604. header_ http.Header
  45605. }
  45606. // Delete: Deletes an existing user role.
  45607. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  45608. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45609. c.profileId = profileId
  45610. c.id = id
  45611. return c
  45612. }
  45613. // Fields allows partial responses to be retrieved. See
  45614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45615. // for more information.
  45616. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  45617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45618. return c
  45619. }
  45620. // Context sets the context to be used in this call's Do method. Any
  45621. // pending HTTP request will be aborted if the provided context is
  45622. // canceled.
  45623. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  45624. c.ctx_ = ctx
  45625. return c
  45626. }
  45627. // Header returns an http.Header that can be modified by the caller to
  45628. // add HTTP headers to the request.
  45629. func (c *UserRolesDeleteCall) Header() http.Header {
  45630. if c.header_ == nil {
  45631. c.header_ = make(http.Header)
  45632. }
  45633. return c.header_
  45634. }
  45635. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  45636. reqHeaders := make(http.Header)
  45637. for k, v := range c.header_ {
  45638. reqHeaders[k] = v
  45639. }
  45640. reqHeaders.Set("User-Agent", c.s.userAgent())
  45641. var body io.Reader = nil
  45642. c.urlParams_.Set("alt", alt)
  45643. c.urlParams_.Set("prettyPrint", "false")
  45644. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45645. urls += "?" + c.urlParams_.Encode()
  45646. req, err := http.NewRequest("DELETE", urls, body)
  45647. if err != nil {
  45648. return nil, err
  45649. }
  45650. req.Header = reqHeaders
  45651. googleapi.Expand(req.URL, map[string]string{
  45652. "profileId": strconv.FormatInt(c.profileId, 10),
  45653. "id": strconv.FormatInt(c.id, 10),
  45654. })
  45655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45656. }
  45657. // Do executes the "dfareporting.userRoles.delete" call.
  45658. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  45659. gensupport.SetOptions(c.urlParams_, opts...)
  45660. res, err := c.doRequest("json")
  45661. if err != nil {
  45662. return err
  45663. }
  45664. defer googleapi.CloseBody(res)
  45665. if err := googleapi.CheckResponse(res); err != nil {
  45666. return err
  45667. }
  45668. return nil
  45669. // {
  45670. // "description": "Deletes an existing user role.",
  45671. // "httpMethod": "DELETE",
  45672. // "id": "dfareporting.userRoles.delete",
  45673. // "parameterOrder": [
  45674. // "profileId",
  45675. // "id"
  45676. // ],
  45677. // "parameters": {
  45678. // "id": {
  45679. // "description": "User role ID.",
  45680. // "format": "int64",
  45681. // "location": "path",
  45682. // "required": true,
  45683. // "type": "string"
  45684. // },
  45685. // "profileId": {
  45686. // "description": "User profile ID associated with this request.",
  45687. // "format": "int64",
  45688. // "location": "path",
  45689. // "required": true,
  45690. // "type": "string"
  45691. // }
  45692. // },
  45693. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45694. // "scopes": [
  45695. // "https://www.googleapis.com/auth/dfatrafficking"
  45696. // ]
  45697. // }
  45698. }
  45699. // method id "dfareporting.userRoles.get":
  45700. type UserRolesGetCall struct {
  45701. s *Service
  45702. profileId int64
  45703. id int64
  45704. urlParams_ gensupport.URLParams
  45705. ifNoneMatch_ string
  45706. ctx_ context.Context
  45707. header_ http.Header
  45708. }
  45709. // Get: Gets one user role by ID.
  45710. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  45711. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45712. c.profileId = profileId
  45713. c.id = id
  45714. return c
  45715. }
  45716. // Fields allows partial responses to be retrieved. See
  45717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45718. // for more information.
  45719. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  45720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45721. return c
  45722. }
  45723. // IfNoneMatch sets the optional parameter which makes the operation
  45724. // fail if the object's ETag matches the given value. This is useful for
  45725. // getting updates only after the object has changed since the last
  45726. // request. Use googleapi.IsNotModified to check whether the response
  45727. // error from Do is the result of In-None-Match.
  45728. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  45729. c.ifNoneMatch_ = entityTag
  45730. return c
  45731. }
  45732. // Context sets the context to be used in this call's Do method. Any
  45733. // pending HTTP request will be aborted if the provided context is
  45734. // canceled.
  45735. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  45736. c.ctx_ = ctx
  45737. return c
  45738. }
  45739. // Header returns an http.Header that can be modified by the caller to
  45740. // add HTTP headers to the request.
  45741. func (c *UserRolesGetCall) Header() http.Header {
  45742. if c.header_ == nil {
  45743. c.header_ = make(http.Header)
  45744. }
  45745. return c.header_
  45746. }
  45747. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  45748. reqHeaders := make(http.Header)
  45749. for k, v := range c.header_ {
  45750. reqHeaders[k] = v
  45751. }
  45752. reqHeaders.Set("User-Agent", c.s.userAgent())
  45753. if c.ifNoneMatch_ != "" {
  45754. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45755. }
  45756. var body io.Reader = nil
  45757. c.urlParams_.Set("alt", alt)
  45758. c.urlParams_.Set("prettyPrint", "false")
  45759. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45760. urls += "?" + c.urlParams_.Encode()
  45761. req, err := http.NewRequest("GET", urls, body)
  45762. if err != nil {
  45763. return nil, err
  45764. }
  45765. req.Header = reqHeaders
  45766. googleapi.Expand(req.URL, map[string]string{
  45767. "profileId": strconv.FormatInt(c.profileId, 10),
  45768. "id": strconv.FormatInt(c.id, 10),
  45769. })
  45770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45771. }
  45772. // Do executes the "dfareporting.userRoles.get" call.
  45773. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45774. // code is an error. Response headers are in either
  45775. // *UserRole.ServerResponse.Header or (if a response was returned at
  45776. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45777. // to check whether the returned error was because
  45778. // http.StatusNotModified was returned.
  45779. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45780. gensupport.SetOptions(c.urlParams_, opts...)
  45781. res, err := c.doRequest("json")
  45782. if res != nil && res.StatusCode == http.StatusNotModified {
  45783. if res.Body != nil {
  45784. res.Body.Close()
  45785. }
  45786. return nil, &googleapi.Error{
  45787. Code: res.StatusCode,
  45788. Header: res.Header,
  45789. }
  45790. }
  45791. if err != nil {
  45792. return nil, err
  45793. }
  45794. defer googleapi.CloseBody(res)
  45795. if err := googleapi.CheckResponse(res); err != nil {
  45796. return nil, err
  45797. }
  45798. ret := &UserRole{
  45799. ServerResponse: googleapi.ServerResponse{
  45800. Header: res.Header,
  45801. HTTPStatusCode: res.StatusCode,
  45802. },
  45803. }
  45804. target := &ret
  45805. if err := gensupport.DecodeResponse(target, res); err != nil {
  45806. return nil, err
  45807. }
  45808. return ret, nil
  45809. // {
  45810. // "description": "Gets one user role by ID.",
  45811. // "httpMethod": "GET",
  45812. // "id": "dfareporting.userRoles.get",
  45813. // "parameterOrder": [
  45814. // "profileId",
  45815. // "id"
  45816. // ],
  45817. // "parameters": {
  45818. // "id": {
  45819. // "description": "User role ID.",
  45820. // "format": "int64",
  45821. // "location": "path",
  45822. // "required": true,
  45823. // "type": "string"
  45824. // },
  45825. // "profileId": {
  45826. // "description": "User profile ID associated with this request.",
  45827. // "format": "int64",
  45828. // "location": "path",
  45829. // "required": true,
  45830. // "type": "string"
  45831. // }
  45832. // },
  45833. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45834. // "response": {
  45835. // "$ref": "UserRole"
  45836. // },
  45837. // "scopes": [
  45838. // "https://www.googleapis.com/auth/dfatrafficking"
  45839. // ]
  45840. // }
  45841. }
  45842. // method id "dfareporting.userRoles.insert":
  45843. type UserRolesInsertCall struct {
  45844. s *Service
  45845. profileId int64
  45846. userrole *UserRole
  45847. urlParams_ gensupport.URLParams
  45848. ctx_ context.Context
  45849. header_ http.Header
  45850. }
  45851. // Insert: Inserts a new user role.
  45852. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  45853. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45854. c.profileId = profileId
  45855. c.userrole = userrole
  45856. return c
  45857. }
  45858. // Fields allows partial responses to be retrieved. See
  45859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45860. // for more information.
  45861. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  45862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45863. return c
  45864. }
  45865. // Context sets the context to be used in this call's Do method. Any
  45866. // pending HTTP request will be aborted if the provided context is
  45867. // canceled.
  45868. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  45869. c.ctx_ = ctx
  45870. return c
  45871. }
  45872. // Header returns an http.Header that can be modified by the caller to
  45873. // add HTTP headers to the request.
  45874. func (c *UserRolesInsertCall) Header() http.Header {
  45875. if c.header_ == nil {
  45876. c.header_ = make(http.Header)
  45877. }
  45878. return c.header_
  45879. }
  45880. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  45881. reqHeaders := make(http.Header)
  45882. for k, v := range c.header_ {
  45883. reqHeaders[k] = v
  45884. }
  45885. reqHeaders.Set("User-Agent", c.s.userAgent())
  45886. var body io.Reader = nil
  45887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45888. if err != nil {
  45889. return nil, err
  45890. }
  45891. reqHeaders.Set("Content-Type", "application/json")
  45892. c.urlParams_.Set("alt", alt)
  45893. c.urlParams_.Set("prettyPrint", "false")
  45894. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45895. urls += "?" + c.urlParams_.Encode()
  45896. req, err := http.NewRequest("POST", urls, body)
  45897. if err != nil {
  45898. return nil, err
  45899. }
  45900. req.Header = reqHeaders
  45901. googleapi.Expand(req.URL, map[string]string{
  45902. "profileId": strconv.FormatInt(c.profileId, 10),
  45903. })
  45904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45905. }
  45906. // Do executes the "dfareporting.userRoles.insert" call.
  45907. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45908. // code is an error. Response headers are in either
  45909. // *UserRole.ServerResponse.Header or (if a response was returned at
  45910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45911. // to check whether the returned error was because
  45912. // http.StatusNotModified was returned.
  45913. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45914. gensupport.SetOptions(c.urlParams_, opts...)
  45915. res, err := c.doRequest("json")
  45916. if res != nil && res.StatusCode == http.StatusNotModified {
  45917. if res.Body != nil {
  45918. res.Body.Close()
  45919. }
  45920. return nil, &googleapi.Error{
  45921. Code: res.StatusCode,
  45922. Header: res.Header,
  45923. }
  45924. }
  45925. if err != nil {
  45926. return nil, err
  45927. }
  45928. defer googleapi.CloseBody(res)
  45929. if err := googleapi.CheckResponse(res); err != nil {
  45930. return nil, err
  45931. }
  45932. ret := &UserRole{
  45933. ServerResponse: googleapi.ServerResponse{
  45934. Header: res.Header,
  45935. HTTPStatusCode: res.StatusCode,
  45936. },
  45937. }
  45938. target := &ret
  45939. if err := gensupport.DecodeResponse(target, res); err != nil {
  45940. return nil, err
  45941. }
  45942. return ret, nil
  45943. // {
  45944. // "description": "Inserts a new user role.",
  45945. // "httpMethod": "POST",
  45946. // "id": "dfareporting.userRoles.insert",
  45947. // "parameterOrder": [
  45948. // "profileId"
  45949. // ],
  45950. // "parameters": {
  45951. // "profileId": {
  45952. // "description": "User profile ID associated with this request.",
  45953. // "format": "int64",
  45954. // "location": "path",
  45955. // "required": true,
  45956. // "type": "string"
  45957. // }
  45958. // },
  45959. // "path": "userprofiles/{profileId}/userRoles",
  45960. // "request": {
  45961. // "$ref": "UserRole"
  45962. // },
  45963. // "response": {
  45964. // "$ref": "UserRole"
  45965. // },
  45966. // "scopes": [
  45967. // "https://www.googleapis.com/auth/dfatrafficking"
  45968. // ]
  45969. // }
  45970. }
  45971. // method id "dfareporting.userRoles.list":
  45972. type UserRolesListCall struct {
  45973. s *Service
  45974. profileId int64
  45975. urlParams_ gensupport.URLParams
  45976. ifNoneMatch_ string
  45977. ctx_ context.Context
  45978. header_ http.Header
  45979. }
  45980. // List: Retrieves a list of user roles, possibly filtered. This method
  45981. // supports paging.
  45982. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  45983. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45984. c.profileId = profileId
  45985. return c
  45986. }
  45987. // AccountUserRoleOnly sets the optional parameter
  45988. // "accountUserRoleOnly": Select only account level user roles not
  45989. // associated with any specific subaccount.
  45990. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  45991. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  45992. return c
  45993. }
  45994. // Ids sets the optional parameter "ids": Select only user roles with
  45995. // the specified IDs.
  45996. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  45997. var ids_ []string
  45998. for _, v := range ids {
  45999. ids_ = append(ids_, fmt.Sprint(v))
  46000. }
  46001. c.urlParams_.SetMulti("ids", ids_)
  46002. return c
  46003. }
  46004. // MaxResults sets the optional parameter "maxResults": Maximum number
  46005. // of results to return.
  46006. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  46007. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46008. return c
  46009. }
  46010. // PageToken sets the optional parameter "pageToken": Value of the
  46011. // nextPageToken from the previous result page.
  46012. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  46013. c.urlParams_.Set("pageToken", pageToken)
  46014. return c
  46015. }
  46016. // SearchString sets the optional parameter "searchString": Allows
  46017. // searching for objects by name or ID. Wildcards (*) are allowed. For
  46018. // example, "userrole*2015" will return objects with names like
  46019. // "userrole June 2015", "userrole April 2015", or simply "userrole
  46020. // 2015". Most of the searches also add wildcards implicitly at the
  46021. // start and the end of the search string. For example, a search string
  46022. // of "userrole" will match objects with name "my userrole", "userrole
  46023. // 2015", or simply "userrole".
  46024. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  46025. c.urlParams_.Set("searchString", searchString)
  46026. return c
  46027. }
  46028. // SortField sets the optional parameter "sortField": Field by which to
  46029. // sort the list.
  46030. //
  46031. // Possible values:
  46032. // "ID" (default)
  46033. // "NAME"
  46034. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  46035. c.urlParams_.Set("sortField", sortField)
  46036. return c
  46037. }
  46038. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  46039. // results.
  46040. //
  46041. // Possible values:
  46042. // "ASCENDING" (default)
  46043. // "DESCENDING"
  46044. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  46045. c.urlParams_.Set("sortOrder", sortOrder)
  46046. return c
  46047. }
  46048. // SubaccountId sets the optional parameter "subaccountId": Select only
  46049. // user roles that belong to this subaccount.
  46050. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  46051. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  46052. return c
  46053. }
  46054. // Fields allows partial responses to be retrieved. See
  46055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46056. // for more information.
  46057. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  46058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46059. return c
  46060. }
  46061. // IfNoneMatch sets the optional parameter which makes the operation
  46062. // fail if the object's ETag matches the given value. This is useful for
  46063. // getting updates only after the object has changed since the last
  46064. // request. Use googleapi.IsNotModified to check whether the response
  46065. // error from Do is the result of In-None-Match.
  46066. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  46067. c.ifNoneMatch_ = entityTag
  46068. return c
  46069. }
  46070. // Context sets the context to be used in this call's Do method. Any
  46071. // pending HTTP request will be aborted if the provided context is
  46072. // canceled.
  46073. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  46074. c.ctx_ = ctx
  46075. return c
  46076. }
  46077. // Header returns an http.Header that can be modified by the caller to
  46078. // add HTTP headers to the request.
  46079. func (c *UserRolesListCall) Header() http.Header {
  46080. if c.header_ == nil {
  46081. c.header_ = make(http.Header)
  46082. }
  46083. return c.header_
  46084. }
  46085. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  46086. reqHeaders := make(http.Header)
  46087. for k, v := range c.header_ {
  46088. reqHeaders[k] = v
  46089. }
  46090. reqHeaders.Set("User-Agent", c.s.userAgent())
  46091. if c.ifNoneMatch_ != "" {
  46092. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46093. }
  46094. var body io.Reader = nil
  46095. c.urlParams_.Set("alt", alt)
  46096. c.urlParams_.Set("prettyPrint", "false")
  46097. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  46098. urls += "?" + c.urlParams_.Encode()
  46099. req, err := http.NewRequest("GET", urls, body)
  46100. if err != nil {
  46101. return nil, err
  46102. }
  46103. req.Header = reqHeaders
  46104. googleapi.Expand(req.URL, map[string]string{
  46105. "profileId": strconv.FormatInt(c.profileId, 10),
  46106. })
  46107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46108. }
  46109. // Do executes the "dfareporting.userRoles.list" call.
  46110. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  46111. // non-2xx status code is an error. Response headers are in either
  46112. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  46113. // returned at all) in error.(*googleapi.Error).Header. Use
  46114. // googleapi.IsNotModified to check whether the returned error was
  46115. // because http.StatusNotModified was returned.
  46116. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  46117. gensupport.SetOptions(c.urlParams_, opts...)
  46118. res, err := c.doRequest("json")
  46119. if res != nil && res.StatusCode == http.StatusNotModified {
  46120. if res.Body != nil {
  46121. res.Body.Close()
  46122. }
  46123. return nil, &googleapi.Error{
  46124. Code: res.StatusCode,
  46125. Header: res.Header,
  46126. }
  46127. }
  46128. if err != nil {
  46129. return nil, err
  46130. }
  46131. defer googleapi.CloseBody(res)
  46132. if err := googleapi.CheckResponse(res); err != nil {
  46133. return nil, err
  46134. }
  46135. ret := &UserRolesListResponse{
  46136. ServerResponse: googleapi.ServerResponse{
  46137. Header: res.Header,
  46138. HTTPStatusCode: res.StatusCode,
  46139. },
  46140. }
  46141. target := &ret
  46142. if err := gensupport.DecodeResponse(target, res); err != nil {
  46143. return nil, err
  46144. }
  46145. return ret, nil
  46146. // {
  46147. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  46148. // "httpMethod": "GET",
  46149. // "id": "dfareporting.userRoles.list",
  46150. // "parameterOrder": [
  46151. // "profileId"
  46152. // ],
  46153. // "parameters": {
  46154. // "accountUserRoleOnly": {
  46155. // "description": "Select only account level user roles not associated with any specific subaccount.",
  46156. // "location": "query",
  46157. // "type": "boolean"
  46158. // },
  46159. // "ids": {
  46160. // "description": "Select only user roles with the specified IDs.",
  46161. // "format": "int64",
  46162. // "location": "query",
  46163. // "repeated": true,
  46164. // "type": "string"
  46165. // },
  46166. // "maxResults": {
  46167. // "default": "1000",
  46168. // "description": "Maximum number of results to return.",
  46169. // "format": "int32",
  46170. // "location": "query",
  46171. // "maximum": "1000",
  46172. // "minimum": "0",
  46173. // "type": "integer"
  46174. // },
  46175. // "pageToken": {
  46176. // "description": "Value of the nextPageToken from the previous result page.",
  46177. // "location": "query",
  46178. // "type": "string"
  46179. // },
  46180. // "profileId": {
  46181. // "description": "User profile ID associated with this request.",
  46182. // "format": "int64",
  46183. // "location": "path",
  46184. // "required": true,
  46185. // "type": "string"
  46186. // },
  46187. // "searchString": {
  46188. // "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\".",
  46189. // "location": "query",
  46190. // "type": "string"
  46191. // },
  46192. // "sortField": {
  46193. // "default": "ID",
  46194. // "description": "Field by which to sort the list.",
  46195. // "enum": [
  46196. // "ID",
  46197. // "NAME"
  46198. // ],
  46199. // "enumDescriptions": [
  46200. // "",
  46201. // ""
  46202. // ],
  46203. // "location": "query",
  46204. // "type": "string"
  46205. // },
  46206. // "sortOrder": {
  46207. // "default": "ASCENDING",
  46208. // "description": "Order of sorted results.",
  46209. // "enum": [
  46210. // "ASCENDING",
  46211. // "DESCENDING"
  46212. // ],
  46213. // "enumDescriptions": [
  46214. // "",
  46215. // ""
  46216. // ],
  46217. // "location": "query",
  46218. // "type": "string"
  46219. // },
  46220. // "subaccountId": {
  46221. // "description": "Select only user roles that belong to this subaccount.",
  46222. // "format": "int64",
  46223. // "location": "query",
  46224. // "type": "string"
  46225. // }
  46226. // },
  46227. // "path": "userprofiles/{profileId}/userRoles",
  46228. // "response": {
  46229. // "$ref": "UserRolesListResponse"
  46230. // },
  46231. // "scopes": [
  46232. // "https://www.googleapis.com/auth/dfatrafficking"
  46233. // ]
  46234. // }
  46235. }
  46236. // Pages invokes f for each page of results.
  46237. // A non-nil error returned from f will halt the iteration.
  46238. // The provided context supersedes any context provided to the Context method.
  46239. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  46240. c.ctx_ = ctx
  46241. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46242. for {
  46243. x, err := c.Do()
  46244. if err != nil {
  46245. return err
  46246. }
  46247. if err := f(x); err != nil {
  46248. return err
  46249. }
  46250. if x.NextPageToken == "" {
  46251. return nil
  46252. }
  46253. c.PageToken(x.NextPageToken)
  46254. }
  46255. }
  46256. // method id "dfareporting.userRoles.patch":
  46257. type UserRolesPatchCall struct {
  46258. s *Service
  46259. profileId int64
  46260. userrole *UserRole
  46261. urlParams_ gensupport.URLParams
  46262. ctx_ context.Context
  46263. header_ http.Header
  46264. }
  46265. // Patch: Updates an existing user role. This method supports patch
  46266. // semantics.
  46267. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  46268. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46269. c.profileId = profileId
  46270. c.urlParams_.Set("id", fmt.Sprint(id))
  46271. c.userrole = userrole
  46272. return c
  46273. }
  46274. // Fields allows partial responses to be retrieved. See
  46275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46276. // for more information.
  46277. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  46278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46279. return c
  46280. }
  46281. // Context sets the context to be used in this call's Do method. Any
  46282. // pending HTTP request will be aborted if the provided context is
  46283. // canceled.
  46284. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  46285. c.ctx_ = ctx
  46286. return c
  46287. }
  46288. // Header returns an http.Header that can be modified by the caller to
  46289. // add HTTP headers to the request.
  46290. func (c *UserRolesPatchCall) Header() http.Header {
  46291. if c.header_ == nil {
  46292. c.header_ = make(http.Header)
  46293. }
  46294. return c.header_
  46295. }
  46296. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  46297. reqHeaders := make(http.Header)
  46298. for k, v := range c.header_ {
  46299. reqHeaders[k] = v
  46300. }
  46301. reqHeaders.Set("User-Agent", c.s.userAgent())
  46302. var body io.Reader = nil
  46303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  46304. if err != nil {
  46305. return nil, err
  46306. }
  46307. reqHeaders.Set("Content-Type", "application/json")
  46308. c.urlParams_.Set("alt", alt)
  46309. c.urlParams_.Set("prettyPrint", "false")
  46310. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  46311. urls += "?" + c.urlParams_.Encode()
  46312. req, err := http.NewRequest("PATCH", urls, body)
  46313. if err != nil {
  46314. return nil, err
  46315. }
  46316. req.Header = reqHeaders
  46317. googleapi.Expand(req.URL, map[string]string{
  46318. "profileId": strconv.FormatInt(c.profileId, 10),
  46319. })
  46320. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46321. }
  46322. // Do executes the "dfareporting.userRoles.patch" call.
  46323. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  46324. // code is an error. Response headers are in either
  46325. // *UserRole.ServerResponse.Header or (if a response was returned at
  46326. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46327. // to check whether the returned error was because
  46328. // http.StatusNotModified was returned.
  46329. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  46330. gensupport.SetOptions(c.urlParams_, opts...)
  46331. res, err := c.doRequest("json")
  46332. if res != nil && res.StatusCode == http.StatusNotModified {
  46333. if res.Body != nil {
  46334. res.Body.Close()
  46335. }
  46336. return nil, &googleapi.Error{
  46337. Code: res.StatusCode,
  46338. Header: res.Header,
  46339. }
  46340. }
  46341. if err != nil {
  46342. return nil, err
  46343. }
  46344. defer googleapi.CloseBody(res)
  46345. if err := googleapi.CheckResponse(res); err != nil {
  46346. return nil, err
  46347. }
  46348. ret := &UserRole{
  46349. ServerResponse: googleapi.ServerResponse{
  46350. Header: res.Header,
  46351. HTTPStatusCode: res.StatusCode,
  46352. },
  46353. }
  46354. target := &ret
  46355. if err := gensupport.DecodeResponse(target, res); err != nil {
  46356. return nil, err
  46357. }
  46358. return ret, nil
  46359. // {
  46360. // "description": "Updates an existing user role. This method supports patch semantics.",
  46361. // "httpMethod": "PATCH",
  46362. // "id": "dfareporting.userRoles.patch",
  46363. // "parameterOrder": [
  46364. // "profileId",
  46365. // "id"
  46366. // ],
  46367. // "parameters": {
  46368. // "id": {
  46369. // "description": "User role ID.",
  46370. // "format": "int64",
  46371. // "location": "query",
  46372. // "required": true,
  46373. // "type": "string"
  46374. // },
  46375. // "profileId": {
  46376. // "description": "User profile ID associated with this request.",
  46377. // "format": "int64",
  46378. // "location": "path",
  46379. // "required": true,
  46380. // "type": "string"
  46381. // }
  46382. // },
  46383. // "path": "userprofiles/{profileId}/userRoles",
  46384. // "request": {
  46385. // "$ref": "UserRole"
  46386. // },
  46387. // "response": {
  46388. // "$ref": "UserRole"
  46389. // },
  46390. // "scopes": [
  46391. // "https://www.googleapis.com/auth/dfatrafficking"
  46392. // ]
  46393. // }
  46394. }
  46395. // method id "dfareporting.userRoles.update":
  46396. type UserRolesUpdateCall struct {
  46397. s *Service
  46398. profileId int64
  46399. userrole *UserRole
  46400. urlParams_ gensupport.URLParams
  46401. ctx_ context.Context
  46402. header_ http.Header
  46403. }
  46404. // Update: Updates an existing user role.
  46405. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  46406. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46407. c.profileId = profileId
  46408. c.userrole = userrole
  46409. return c
  46410. }
  46411. // Fields allows partial responses to be retrieved. See
  46412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46413. // for more information.
  46414. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  46415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46416. return c
  46417. }
  46418. // Context sets the context to be used in this call's Do method. Any
  46419. // pending HTTP request will be aborted if the provided context is
  46420. // canceled.
  46421. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  46422. c.ctx_ = ctx
  46423. return c
  46424. }
  46425. // Header returns an http.Header that can be modified by the caller to
  46426. // add HTTP headers to the request.
  46427. func (c *UserRolesUpdateCall) Header() http.Header {
  46428. if c.header_ == nil {
  46429. c.header_ = make(http.Header)
  46430. }
  46431. return c.header_
  46432. }
  46433. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  46434. reqHeaders := make(http.Header)
  46435. for k, v := range c.header_ {
  46436. reqHeaders[k] = v
  46437. }
  46438. reqHeaders.Set("User-Agent", c.s.userAgent())
  46439. var body io.Reader = nil
  46440. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  46441. if err != nil {
  46442. return nil, err
  46443. }
  46444. reqHeaders.Set("Content-Type", "application/json")
  46445. c.urlParams_.Set("alt", alt)
  46446. c.urlParams_.Set("prettyPrint", "false")
  46447. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  46448. urls += "?" + c.urlParams_.Encode()
  46449. req, err := http.NewRequest("PUT", urls, body)
  46450. if err != nil {
  46451. return nil, err
  46452. }
  46453. req.Header = reqHeaders
  46454. googleapi.Expand(req.URL, map[string]string{
  46455. "profileId": strconv.FormatInt(c.profileId, 10),
  46456. })
  46457. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46458. }
  46459. // Do executes the "dfareporting.userRoles.update" call.
  46460. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  46461. // code is an error. Response headers are in either
  46462. // *UserRole.ServerResponse.Header or (if a response was returned at
  46463. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46464. // to check whether the returned error was because
  46465. // http.StatusNotModified was returned.
  46466. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  46467. gensupport.SetOptions(c.urlParams_, opts...)
  46468. res, err := c.doRequest("json")
  46469. if res != nil && res.StatusCode == http.StatusNotModified {
  46470. if res.Body != nil {
  46471. res.Body.Close()
  46472. }
  46473. return nil, &googleapi.Error{
  46474. Code: res.StatusCode,
  46475. Header: res.Header,
  46476. }
  46477. }
  46478. if err != nil {
  46479. return nil, err
  46480. }
  46481. defer googleapi.CloseBody(res)
  46482. if err := googleapi.CheckResponse(res); err != nil {
  46483. return nil, err
  46484. }
  46485. ret := &UserRole{
  46486. ServerResponse: googleapi.ServerResponse{
  46487. Header: res.Header,
  46488. HTTPStatusCode: res.StatusCode,
  46489. },
  46490. }
  46491. target := &ret
  46492. if err := gensupport.DecodeResponse(target, res); err != nil {
  46493. return nil, err
  46494. }
  46495. return ret, nil
  46496. // {
  46497. // "description": "Updates an existing user role.",
  46498. // "httpMethod": "PUT",
  46499. // "id": "dfareporting.userRoles.update",
  46500. // "parameterOrder": [
  46501. // "profileId"
  46502. // ],
  46503. // "parameters": {
  46504. // "profileId": {
  46505. // "description": "User profile ID associated with this request.",
  46506. // "format": "int64",
  46507. // "location": "path",
  46508. // "required": true,
  46509. // "type": "string"
  46510. // }
  46511. // },
  46512. // "path": "userprofiles/{profileId}/userRoles",
  46513. // "request": {
  46514. // "$ref": "UserRole"
  46515. // },
  46516. // "response": {
  46517. // "$ref": "UserRole"
  46518. // },
  46519. // "scopes": [
  46520. // "https://www.googleapis.com/auth/dfatrafficking"
  46521. // ]
  46522. // }
  46523. }
  46524. // method id "dfareporting.videoFormats.get":
  46525. type VideoFormatsGetCall struct {
  46526. s *Service
  46527. profileId int64
  46528. id int64
  46529. urlParams_ gensupport.URLParams
  46530. ifNoneMatch_ string
  46531. ctx_ context.Context
  46532. header_ http.Header
  46533. }
  46534. // Get: Gets one video format by ID.
  46535. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  46536. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46537. c.profileId = profileId
  46538. c.id = id
  46539. return c
  46540. }
  46541. // Fields allows partial responses to be retrieved. See
  46542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46543. // for more information.
  46544. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  46545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46546. return c
  46547. }
  46548. // IfNoneMatch sets the optional parameter which makes the operation
  46549. // fail if the object's ETag matches the given value. This is useful for
  46550. // getting updates only after the object has changed since the last
  46551. // request. Use googleapi.IsNotModified to check whether the response
  46552. // error from Do is the result of In-None-Match.
  46553. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  46554. c.ifNoneMatch_ = entityTag
  46555. return c
  46556. }
  46557. // Context sets the context to be used in this call's Do method. Any
  46558. // pending HTTP request will be aborted if the provided context is
  46559. // canceled.
  46560. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  46561. c.ctx_ = ctx
  46562. return c
  46563. }
  46564. // Header returns an http.Header that can be modified by the caller to
  46565. // add HTTP headers to the request.
  46566. func (c *VideoFormatsGetCall) Header() http.Header {
  46567. if c.header_ == nil {
  46568. c.header_ = make(http.Header)
  46569. }
  46570. return c.header_
  46571. }
  46572. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  46573. reqHeaders := make(http.Header)
  46574. for k, v := range c.header_ {
  46575. reqHeaders[k] = v
  46576. }
  46577. reqHeaders.Set("User-Agent", c.s.userAgent())
  46578. if c.ifNoneMatch_ != "" {
  46579. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46580. }
  46581. var body io.Reader = nil
  46582. c.urlParams_.Set("alt", alt)
  46583. c.urlParams_.Set("prettyPrint", "false")
  46584. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  46585. urls += "?" + c.urlParams_.Encode()
  46586. req, err := http.NewRequest("GET", urls, body)
  46587. if err != nil {
  46588. return nil, err
  46589. }
  46590. req.Header = reqHeaders
  46591. googleapi.Expand(req.URL, map[string]string{
  46592. "profileId": strconv.FormatInt(c.profileId, 10),
  46593. "id": strconv.FormatInt(c.id, 10),
  46594. })
  46595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46596. }
  46597. // Do executes the "dfareporting.videoFormats.get" call.
  46598. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  46599. // status code is an error. Response headers are in either
  46600. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  46601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46602. // to check whether the returned error was because
  46603. // http.StatusNotModified was returned.
  46604. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  46605. gensupport.SetOptions(c.urlParams_, opts...)
  46606. res, err := c.doRequest("json")
  46607. if res != nil && res.StatusCode == http.StatusNotModified {
  46608. if res.Body != nil {
  46609. res.Body.Close()
  46610. }
  46611. return nil, &googleapi.Error{
  46612. Code: res.StatusCode,
  46613. Header: res.Header,
  46614. }
  46615. }
  46616. if err != nil {
  46617. return nil, err
  46618. }
  46619. defer googleapi.CloseBody(res)
  46620. if err := googleapi.CheckResponse(res); err != nil {
  46621. return nil, err
  46622. }
  46623. ret := &VideoFormat{
  46624. ServerResponse: googleapi.ServerResponse{
  46625. Header: res.Header,
  46626. HTTPStatusCode: res.StatusCode,
  46627. },
  46628. }
  46629. target := &ret
  46630. if err := gensupport.DecodeResponse(target, res); err != nil {
  46631. return nil, err
  46632. }
  46633. return ret, nil
  46634. // {
  46635. // "description": "Gets one video format by ID.",
  46636. // "httpMethod": "GET",
  46637. // "id": "dfareporting.videoFormats.get",
  46638. // "parameterOrder": [
  46639. // "profileId",
  46640. // "id"
  46641. // ],
  46642. // "parameters": {
  46643. // "id": {
  46644. // "description": "Video format ID.",
  46645. // "format": "int32",
  46646. // "location": "path",
  46647. // "required": true,
  46648. // "type": "integer"
  46649. // },
  46650. // "profileId": {
  46651. // "description": "User profile ID associated with this request.",
  46652. // "format": "int64",
  46653. // "location": "path",
  46654. // "required": true,
  46655. // "type": "string"
  46656. // }
  46657. // },
  46658. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  46659. // "response": {
  46660. // "$ref": "VideoFormat"
  46661. // },
  46662. // "scopes": [
  46663. // "https://www.googleapis.com/auth/dfatrafficking"
  46664. // ]
  46665. // }
  46666. }
  46667. // method id "dfareporting.videoFormats.list":
  46668. type VideoFormatsListCall struct {
  46669. s *Service
  46670. profileId int64
  46671. urlParams_ gensupport.URLParams
  46672. ifNoneMatch_ string
  46673. ctx_ context.Context
  46674. header_ http.Header
  46675. }
  46676. // List: Lists available video formats.
  46677. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  46678. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46679. c.profileId = profileId
  46680. return c
  46681. }
  46682. // Fields allows partial responses to be retrieved. See
  46683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46684. // for more information.
  46685. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  46686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46687. return c
  46688. }
  46689. // IfNoneMatch sets the optional parameter which makes the operation
  46690. // fail if the object's ETag matches the given value. This is useful for
  46691. // getting updates only after the object has changed since the last
  46692. // request. Use googleapi.IsNotModified to check whether the response
  46693. // error from Do is the result of In-None-Match.
  46694. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  46695. c.ifNoneMatch_ = entityTag
  46696. return c
  46697. }
  46698. // Context sets the context to be used in this call's Do method. Any
  46699. // pending HTTP request will be aborted if the provided context is
  46700. // canceled.
  46701. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  46702. c.ctx_ = ctx
  46703. return c
  46704. }
  46705. // Header returns an http.Header that can be modified by the caller to
  46706. // add HTTP headers to the request.
  46707. func (c *VideoFormatsListCall) Header() http.Header {
  46708. if c.header_ == nil {
  46709. c.header_ = make(http.Header)
  46710. }
  46711. return c.header_
  46712. }
  46713. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  46714. reqHeaders := make(http.Header)
  46715. for k, v := range c.header_ {
  46716. reqHeaders[k] = v
  46717. }
  46718. reqHeaders.Set("User-Agent", c.s.userAgent())
  46719. if c.ifNoneMatch_ != "" {
  46720. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46721. }
  46722. var body io.Reader = nil
  46723. c.urlParams_.Set("alt", alt)
  46724. c.urlParams_.Set("prettyPrint", "false")
  46725. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  46726. urls += "?" + c.urlParams_.Encode()
  46727. req, err := http.NewRequest("GET", urls, body)
  46728. if err != nil {
  46729. return nil, err
  46730. }
  46731. req.Header = reqHeaders
  46732. googleapi.Expand(req.URL, map[string]string{
  46733. "profileId": strconv.FormatInt(c.profileId, 10),
  46734. })
  46735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46736. }
  46737. // Do executes the "dfareporting.videoFormats.list" call.
  46738. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  46739. // Any non-2xx status code is an error. Response headers are in either
  46740. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  46741. // returned at all) in error.(*googleapi.Error).Header. Use
  46742. // googleapi.IsNotModified to check whether the returned error was
  46743. // because http.StatusNotModified was returned.
  46744. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  46745. gensupport.SetOptions(c.urlParams_, opts...)
  46746. res, err := c.doRequest("json")
  46747. if res != nil && res.StatusCode == http.StatusNotModified {
  46748. if res.Body != nil {
  46749. res.Body.Close()
  46750. }
  46751. return nil, &googleapi.Error{
  46752. Code: res.StatusCode,
  46753. Header: res.Header,
  46754. }
  46755. }
  46756. if err != nil {
  46757. return nil, err
  46758. }
  46759. defer googleapi.CloseBody(res)
  46760. if err := googleapi.CheckResponse(res); err != nil {
  46761. return nil, err
  46762. }
  46763. ret := &VideoFormatsListResponse{
  46764. ServerResponse: googleapi.ServerResponse{
  46765. Header: res.Header,
  46766. HTTPStatusCode: res.StatusCode,
  46767. },
  46768. }
  46769. target := &ret
  46770. if err := gensupport.DecodeResponse(target, res); err != nil {
  46771. return nil, err
  46772. }
  46773. return ret, nil
  46774. // {
  46775. // "description": "Lists available video formats.",
  46776. // "httpMethod": "GET",
  46777. // "id": "dfareporting.videoFormats.list",
  46778. // "parameterOrder": [
  46779. // "profileId"
  46780. // ],
  46781. // "parameters": {
  46782. // "profileId": {
  46783. // "description": "User profile ID associated with this request.",
  46784. // "format": "int64",
  46785. // "location": "path",
  46786. // "required": true,
  46787. // "type": "string"
  46788. // }
  46789. // },
  46790. // "path": "userprofiles/{profileId}/videoFormats",
  46791. // "response": {
  46792. // "$ref": "VideoFormatsListResponse"
  46793. // },
  46794. // "scopes": [
  46795. // "https://www.googleapis.com/auth/dfatrafficking"
  46796. // ]
  46797. // }
  46798. }