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

51443 lines
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.1"
  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.1"
  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.1"
  71. const apiName = "dfareporting"
  72. const apiVersion = "v3.1"
  73. const basePath = "https://www.googleapis.com/dfareporting/v3.1/"
  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 the conversion was directed toward
  2681. // children.
  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. // Ordinal: The ordinal of the conversion. Use this field to control how
  2725. // conversions of the same user and day are de-duplicated. This is a
  2726. // required field.
  2727. Ordinal string `json:"ordinal,omitempty"`
  2728. // Quantity: The quantity of the conversion.
  2729. Quantity int64 `json:"quantity,omitempty,string"`
  2730. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2731. // This is a required field.
  2732. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2733. // Value: The value of the conversion.
  2734. Value float64 `json:"value,omitempty"`
  2735. // ForceSendFields is a list of field names (e.g.
  2736. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2737. // By default, fields with empty values are omitted from API requests.
  2738. // However, any non-pointer, non-interface field appearing in
  2739. // ForceSendFields will be sent to the server regardless of whether the
  2740. // field is empty or not. This may be used to include empty fields in
  2741. // Patch requests.
  2742. ForceSendFields []string `json:"-"`
  2743. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2744. // to include in API requests with the JSON null value. By default,
  2745. // fields with empty values are omitted from API requests. However, any
  2746. // field with an empty value appearing in NullFields will be sent to the
  2747. // server as null. It is an error if a field in this list has a
  2748. // non-empty value. This may be used to include null fields in Patch
  2749. // requests.
  2750. NullFields []string `json:"-"`
  2751. }
  2752. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2753. type NoMethod Conversion
  2754. raw := NoMethod(*s)
  2755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2756. }
  2757. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2758. type NoMethod Conversion
  2759. var s1 struct {
  2760. Value gensupport.JSONFloat64 `json:"value"`
  2761. *NoMethod
  2762. }
  2763. s1.NoMethod = (*NoMethod)(s)
  2764. if err := json.Unmarshal(data, &s1); err != nil {
  2765. return err
  2766. }
  2767. s.Value = float64(s1.Value)
  2768. return nil
  2769. }
  2770. // ConversionError: The error code and description for a conversion that
  2771. // failed to insert or update.
  2772. type ConversionError struct {
  2773. // Code: The error code.
  2774. //
  2775. // Possible values:
  2776. // "INTERNAL"
  2777. // "INVALID_ARGUMENT"
  2778. // "NOT_FOUND"
  2779. // "PERMISSION_DENIED"
  2780. Code string `json:"code,omitempty"`
  2781. // Kind: Identifies what kind of resource this is. Value: the fixed
  2782. // string "dfareporting#conversionError".
  2783. Kind string `json:"kind,omitempty"`
  2784. // Message: A description of the error.
  2785. Message string `json:"message,omitempty"`
  2786. // ForceSendFields is a list of field names (e.g. "Code") to
  2787. // unconditionally include in API requests. By default, fields with
  2788. // empty values are omitted from API requests. However, any non-pointer,
  2789. // non-interface field appearing in ForceSendFields will be sent to the
  2790. // server regardless of whether the field is empty or not. This may be
  2791. // used to include empty fields in Patch requests.
  2792. ForceSendFields []string `json:"-"`
  2793. // NullFields is a list of field names (e.g. "Code") to include in API
  2794. // requests with the JSON null value. By default, fields with empty
  2795. // values are omitted from API requests. However, any field with an
  2796. // empty value appearing in NullFields will be sent to the server as
  2797. // null. It is an error if a field in this list has a non-empty value.
  2798. // This may be used to include null fields in Patch requests.
  2799. NullFields []string `json:"-"`
  2800. }
  2801. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2802. type NoMethod ConversionError
  2803. raw := NoMethod(*s)
  2804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2805. }
  2806. // ConversionStatus: The original conversion that was inserted or
  2807. // updated and whether there were any errors.
  2808. type ConversionStatus struct {
  2809. // Conversion: The original conversion that was inserted or updated.
  2810. Conversion *Conversion `json:"conversion,omitempty"`
  2811. // Errors: A list of errors related to this conversion.
  2812. Errors []*ConversionError `json:"errors,omitempty"`
  2813. // Kind: Identifies what kind of resource this is. Value: the fixed
  2814. // string "dfareporting#conversionStatus".
  2815. Kind string `json:"kind,omitempty"`
  2816. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2817. // unconditionally include in API requests. By default, fields with
  2818. // empty values are omitted from API requests. However, any non-pointer,
  2819. // non-interface field appearing in ForceSendFields will be sent to the
  2820. // server regardless of whether the field is empty or not. This may be
  2821. // used to include empty fields in Patch requests.
  2822. ForceSendFields []string `json:"-"`
  2823. // NullFields is a list of field names (e.g. "Conversion") to include in
  2824. // API requests with the JSON null value. By default, fields with empty
  2825. // values are omitted from API requests. However, any field with an
  2826. // empty value appearing in NullFields will be sent to the server as
  2827. // null. It is an error if a field in this list has a non-empty value.
  2828. // This may be used to include null fields in Patch requests.
  2829. NullFields []string `json:"-"`
  2830. }
  2831. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2832. type NoMethod ConversionStatus
  2833. raw := NoMethod(*s)
  2834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2835. }
  2836. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2837. type ConversionsBatchInsertRequest struct {
  2838. // Conversions: The set of conversions to insert.
  2839. Conversions []*Conversion `json:"conversions,omitempty"`
  2840. // EncryptionInfo: Describes how encryptedUserId or
  2841. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2842. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2843. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2844. // Kind: Identifies what kind of resource this is. Value: the fixed
  2845. // string "dfareporting#conversionsBatchInsertRequest".
  2846. Kind string `json:"kind,omitempty"`
  2847. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2848. // unconditionally include in API requests. By default, fields with
  2849. // empty values are omitted from API requests. However, any non-pointer,
  2850. // non-interface field appearing in ForceSendFields will be sent to the
  2851. // server regardless of whether the field is empty or not. This may be
  2852. // used to include empty fields in Patch requests.
  2853. ForceSendFields []string `json:"-"`
  2854. // NullFields is a list of field names (e.g. "Conversions") to include
  2855. // in API requests with the JSON null value. By default, fields with
  2856. // empty values are omitted from API requests. However, any field with
  2857. // an empty value appearing in NullFields will be sent to the server as
  2858. // null. It is an error if a field in this list has a non-empty value.
  2859. // This may be used to include null fields in Patch requests.
  2860. NullFields []string `json:"-"`
  2861. }
  2862. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2863. type NoMethod ConversionsBatchInsertRequest
  2864. raw := NoMethod(*s)
  2865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2866. }
  2867. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2868. type ConversionsBatchInsertResponse struct {
  2869. // HasFailures: Indicates that some or all conversions failed to insert.
  2870. HasFailures bool `json:"hasFailures,omitempty"`
  2871. // Kind: Identifies what kind of resource this is. Value: the fixed
  2872. // string "dfareporting#conversionsBatchInsertResponse".
  2873. Kind string `json:"kind,omitempty"`
  2874. // Status: The insert status of each conversion. Statuses are returned
  2875. // in the same order that conversions are inserted.
  2876. Status []*ConversionStatus `json:"status,omitempty"`
  2877. // ServerResponse contains the HTTP response code and headers from the
  2878. // server.
  2879. googleapi.ServerResponse `json:"-"`
  2880. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2881. // unconditionally include in API requests. By default, fields with
  2882. // empty values are omitted from API requests. However, any non-pointer,
  2883. // non-interface field appearing in ForceSendFields will be sent to the
  2884. // server regardless of whether the field is empty or not. This may be
  2885. // used to include empty fields in Patch requests.
  2886. ForceSendFields []string `json:"-"`
  2887. // NullFields is a list of field names (e.g. "HasFailures") to include
  2888. // in API requests with the JSON null value. By default, fields with
  2889. // empty values are omitted from API requests. However, any field with
  2890. // an empty value appearing in NullFields will be sent to the server as
  2891. // null. It is an error if a field in this list has a non-empty value.
  2892. // This may be used to include null fields in Patch requests.
  2893. NullFields []string `json:"-"`
  2894. }
  2895. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2896. type NoMethod ConversionsBatchInsertResponse
  2897. raw := NoMethod(*s)
  2898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2899. }
  2900. // ConversionsBatchUpdateRequest: Update Conversions Request.
  2901. type ConversionsBatchUpdateRequest struct {
  2902. // Conversions: The set of conversions to update.
  2903. Conversions []*Conversion `json:"conversions,omitempty"`
  2904. // EncryptionInfo: Describes how encryptedUserId is encrypted. This is a
  2905. // required field if encryptedUserId is used.
  2906. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2907. // Kind: Identifies what kind of resource this is. Value: the fixed
  2908. // string "dfareporting#conversionsBatchUpdateRequest".
  2909. Kind string `json:"kind,omitempty"`
  2910. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2911. // unconditionally include in API requests. By default, fields with
  2912. // empty values are omitted from API requests. However, any non-pointer,
  2913. // non-interface field appearing in ForceSendFields will be sent to the
  2914. // server regardless of whether the field is empty or not. This may be
  2915. // used to include empty fields in Patch requests.
  2916. ForceSendFields []string `json:"-"`
  2917. // NullFields is a list of field names (e.g. "Conversions") to include
  2918. // in API requests with the JSON null value. By default, fields with
  2919. // empty values are omitted from API requests. However, any field with
  2920. // an empty value appearing in NullFields will be sent to the server as
  2921. // null. It is an error if a field in this list has a non-empty value.
  2922. // This may be used to include null fields in Patch requests.
  2923. NullFields []string `json:"-"`
  2924. }
  2925. func (s *ConversionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  2926. type NoMethod ConversionsBatchUpdateRequest
  2927. raw := NoMethod(*s)
  2928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2929. }
  2930. // ConversionsBatchUpdateResponse: Update Conversions Response.
  2931. type ConversionsBatchUpdateResponse struct {
  2932. // HasFailures: Indicates that some or all conversions failed to update.
  2933. HasFailures bool `json:"hasFailures,omitempty"`
  2934. // Kind: Identifies what kind of resource this is. Value: the fixed
  2935. // string "dfareporting#conversionsBatchUpdateResponse".
  2936. Kind string `json:"kind,omitempty"`
  2937. // Status: The update status of each conversion. Statuses are returned
  2938. // in the same order that conversions are updated.
  2939. Status []*ConversionStatus `json:"status,omitempty"`
  2940. // ServerResponse contains the HTTP response code and headers from the
  2941. // server.
  2942. googleapi.ServerResponse `json:"-"`
  2943. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2944. // unconditionally include in API requests. By default, fields with
  2945. // empty values are omitted from API requests. However, any non-pointer,
  2946. // non-interface field appearing in ForceSendFields will be sent to the
  2947. // server regardless of whether the field is empty or not. This may be
  2948. // used to include empty fields in Patch requests.
  2949. ForceSendFields []string `json:"-"`
  2950. // NullFields is a list of field names (e.g. "HasFailures") to include
  2951. // in API requests with the JSON null value. By default, fields with
  2952. // empty values are omitted from API requests. However, any field with
  2953. // an empty value appearing in NullFields will be sent to the server as
  2954. // null. It is an error if a field in this list has a non-empty value.
  2955. // This may be used to include null fields in Patch requests.
  2956. NullFields []string `json:"-"`
  2957. }
  2958. func (s *ConversionsBatchUpdateResponse) MarshalJSON() ([]byte, error) {
  2959. type NoMethod ConversionsBatchUpdateResponse
  2960. raw := NoMethod(*s)
  2961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2962. }
  2963. // CountriesListResponse: Country List Response
  2964. type CountriesListResponse struct {
  2965. // Countries: Country collection.
  2966. Countries []*Country `json:"countries,omitempty"`
  2967. // Kind: Identifies what kind of resource this is. Value: the fixed
  2968. // string "dfareporting#countriesListResponse".
  2969. Kind string `json:"kind,omitempty"`
  2970. // ServerResponse contains the HTTP response code and headers from the
  2971. // server.
  2972. googleapi.ServerResponse `json:"-"`
  2973. // ForceSendFields is a list of field names (e.g. "Countries") to
  2974. // unconditionally include in API requests. By default, fields with
  2975. // empty values are omitted from API requests. However, any non-pointer,
  2976. // non-interface field appearing in ForceSendFields will be sent to the
  2977. // server regardless of whether the field is empty or not. This may be
  2978. // used to include empty fields in Patch requests.
  2979. ForceSendFields []string `json:"-"`
  2980. // NullFields is a list of field names (e.g. "Countries") to include in
  2981. // API requests with the JSON null value. By default, fields with empty
  2982. // values are omitted from API requests. However, any field with an
  2983. // empty value appearing in NullFields will be sent to the server as
  2984. // null. It is an error if a field in this list has a non-empty value.
  2985. // This may be used to include null fields in Patch requests.
  2986. NullFields []string `json:"-"`
  2987. }
  2988. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2989. type NoMethod CountriesListResponse
  2990. raw := NoMethod(*s)
  2991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2992. }
  2993. // Country: Contains information about a country that can be targeted by
  2994. // ads.
  2995. type Country struct {
  2996. // CountryCode: Country code.
  2997. CountryCode string `json:"countryCode,omitempty"`
  2998. // DartId: DART ID of this country. This is the ID used for targeting
  2999. // and generating reports.
  3000. DartId int64 `json:"dartId,omitempty,string"`
  3001. // Kind: Identifies what kind of resource this is. Value: the fixed
  3002. // string "dfareporting#country".
  3003. Kind string `json:"kind,omitempty"`
  3004. // Name: Name of this country.
  3005. Name string `json:"name,omitempty"`
  3006. // SslEnabled: Whether ad serving supports secure servers in this
  3007. // country.
  3008. SslEnabled bool `json:"sslEnabled,omitempty"`
  3009. // ServerResponse contains the HTTP response code and headers from the
  3010. // server.
  3011. googleapi.ServerResponse `json:"-"`
  3012. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  3013. // unconditionally include in API requests. By default, fields with
  3014. // empty values are omitted from API requests. However, any non-pointer,
  3015. // non-interface field appearing in ForceSendFields will be sent to the
  3016. // server regardless of whether the field is empty or not. This may be
  3017. // used to include empty fields in Patch requests.
  3018. ForceSendFields []string `json:"-"`
  3019. // NullFields is a list of field names (e.g. "CountryCode") to include
  3020. // in API requests with the JSON null value. By default, fields with
  3021. // empty values are omitted from API requests. However, any field with
  3022. // an empty value appearing in NullFields will be sent to the server as
  3023. // null. It is an error if a field in this list has a non-empty value.
  3024. // This may be used to include null fields in Patch requests.
  3025. NullFields []string `json:"-"`
  3026. }
  3027. func (s *Country) MarshalJSON() ([]byte, error) {
  3028. type NoMethod Country
  3029. raw := NoMethod(*s)
  3030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3031. }
  3032. // Creative: Contains properties of a Creative.
  3033. type Creative struct {
  3034. // AccountId: Account ID of this creative. This field, if left unset,
  3035. // will be auto-generated for both insert and update operations.
  3036. // Applicable to all creative types.
  3037. AccountId int64 `json:"accountId,omitempty,string"`
  3038. // Active: Whether the creative is active. Applicable to all creative
  3039. // types.
  3040. Active bool `json:"active,omitempty"`
  3041. // AdParameters: Ad parameters user for VPAID creative. This is a
  3042. // read-only field. Applicable to the following creative types: all
  3043. // VPAID.
  3044. AdParameters string `json:"adParameters,omitempty"`
  3045. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  3046. // customize the creative settings of a Rich Media ad running on your
  3047. // site without having to contact the advertiser. You can use keywords
  3048. // to dynamically change the look or functionality of a creative.
  3049. // Applicable to the following creative types: all RICH_MEDIA, and all
  3050. // VPAID.
  3051. AdTagKeys []string `json:"adTagKeys,omitempty"`
  3052. // AdvertiserId: Advertiser ID of this creative. This is a required
  3053. // field. Applicable to all creative types.
  3054. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  3055. // AllowScriptAccess: Whether script access is allowed for this
  3056. // creative. This is a read-only and deprecated field which will
  3057. // automatically be set to true on update. Applicable to the following
  3058. // creative types: FLASH_INPAGE.
  3059. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  3060. // Archived: Whether the creative is archived. Applicable to all
  3061. // creative types.
  3062. Archived bool `json:"archived,omitempty"`
  3063. // ArtworkType: Type of artwork used for the creative. This is a
  3064. // read-only field. Applicable to the following creative types: all
  3065. // RICH_MEDIA, and all VPAID.
  3066. //
  3067. // Possible values:
  3068. // "ARTWORK_TYPE_FLASH"
  3069. // "ARTWORK_TYPE_HTML5"
  3070. // "ARTWORK_TYPE_IMAGE"
  3071. // "ARTWORK_TYPE_MIXED"
  3072. ArtworkType string `json:"artworkType,omitempty"`
  3073. // AuthoringSource: Source application where creative was authored.
  3074. // Presently, only DBM authored creatives will have this field set.
  3075. // Applicable to all creative types.
  3076. //
  3077. // Possible values:
  3078. // "CREATIVE_AUTHORING_SOURCE_DBM"
  3079. // "CREATIVE_AUTHORING_SOURCE_DCM"
  3080. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  3081. AuthoringSource string `json:"authoringSource,omitempty"`
  3082. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  3083. // read-only field. Applicable to the following creative types:
  3084. // HTML5_BANNER.
  3085. //
  3086. // Possible values:
  3087. // "NINJA"
  3088. // "SWIFFY"
  3089. AuthoringTool string `json:"authoringTool,omitempty"`
  3090. // AutoAdvanceImages: Whether images are automatically advanced for
  3091. // image gallery creatives. Applicable to the following creative types:
  3092. // DISPLAY_IMAGE_GALLERY.
  3093. AutoAdvanceImages bool `json:"autoAdvanceImages,omitempty"`
  3094. // BackgroundColor: The 6-character HTML color code, beginning with #,
  3095. // for the background of the window area where the Flash file is
  3096. // displayed. Default is white. Applicable to the following creative
  3097. // types: FLASH_INPAGE.
  3098. BackgroundColor string `json:"backgroundColor,omitempty"`
  3099. // BackupImageClickThroughUrl: Click-through URL for backup image.
  3100. // Applicable to ENHANCED_BANNER when the primary asset type is not
  3101. // HTML_IMAGE.
  3102. BackupImageClickThroughUrl *CreativeClickThroughUrl `json:"backupImageClickThroughUrl,omitempty"`
  3103. // BackupImageFeatures: List of feature dependencies that will cause a
  3104. // backup image to be served if the browser that serves the ad does not
  3105. // support them. Feature dependencies are features that a browser must
  3106. // be able to support in order to render your HTML5 creative asset
  3107. // correctly. This field is initially auto-generated to contain all
  3108. // features detected by Campaign Manager for all the assets of this
  3109. // creative and can then be modified by the client. To reset this field,
  3110. // copy over all the creativeAssets' detected features. Applicable to
  3111. // the following creative types: HTML5_BANNER. Applicable to DISPLAY
  3112. // when the primary asset type is not HTML_IMAGE.
  3113. //
  3114. // Possible values:
  3115. // "APPLICATION_CACHE"
  3116. // "AUDIO"
  3117. // "CANVAS"
  3118. // "CANVAS_TEXT"
  3119. // "CSS_ANIMATIONS"
  3120. // "CSS_BACKGROUND_SIZE"
  3121. // "CSS_BORDER_IMAGE"
  3122. // "CSS_BORDER_RADIUS"
  3123. // "CSS_BOX_SHADOW"
  3124. // "CSS_COLUMNS"
  3125. // "CSS_FLEX_BOX"
  3126. // "CSS_FONT_FACE"
  3127. // "CSS_GENERATED_CONTENT"
  3128. // "CSS_GRADIENTS"
  3129. // "CSS_HSLA"
  3130. // "CSS_MULTIPLE_BGS"
  3131. // "CSS_OPACITY"
  3132. // "CSS_REFLECTIONS"
  3133. // "CSS_RGBA"
  3134. // "CSS_TEXT_SHADOW"
  3135. // "CSS_TRANSFORMS"
  3136. // "CSS_TRANSFORMS3D"
  3137. // "CSS_TRANSITIONS"
  3138. // "DRAG_AND_DROP"
  3139. // "GEO_LOCATION"
  3140. // "HASH_CHANGE"
  3141. // "HISTORY"
  3142. // "INDEXED_DB"
  3143. // "INLINE_SVG"
  3144. // "INPUT_ATTR_AUTOCOMPLETE"
  3145. // "INPUT_ATTR_AUTOFOCUS"
  3146. // "INPUT_ATTR_LIST"
  3147. // "INPUT_ATTR_MAX"
  3148. // "INPUT_ATTR_MIN"
  3149. // "INPUT_ATTR_MULTIPLE"
  3150. // "INPUT_ATTR_PATTERN"
  3151. // "INPUT_ATTR_PLACEHOLDER"
  3152. // "INPUT_ATTR_REQUIRED"
  3153. // "INPUT_ATTR_STEP"
  3154. // "INPUT_TYPE_COLOR"
  3155. // "INPUT_TYPE_DATE"
  3156. // "INPUT_TYPE_DATETIME"
  3157. // "INPUT_TYPE_DATETIME_LOCAL"
  3158. // "INPUT_TYPE_EMAIL"
  3159. // "INPUT_TYPE_MONTH"
  3160. // "INPUT_TYPE_NUMBER"
  3161. // "INPUT_TYPE_RANGE"
  3162. // "INPUT_TYPE_SEARCH"
  3163. // "INPUT_TYPE_TEL"
  3164. // "INPUT_TYPE_TIME"
  3165. // "INPUT_TYPE_URL"
  3166. // "INPUT_TYPE_WEEK"
  3167. // "LOCAL_STORAGE"
  3168. // "POST_MESSAGE"
  3169. // "SESSION_STORAGE"
  3170. // "SMIL"
  3171. // "SVG_CLIP_PATHS"
  3172. // "SVG_FE_IMAGE"
  3173. // "SVG_FILTERS"
  3174. // "SVG_HREF"
  3175. // "TOUCH"
  3176. // "VIDEO"
  3177. // "WEBGL"
  3178. // "WEB_SOCKETS"
  3179. // "WEB_SQL_DATABASE"
  3180. // "WEB_WORKERS"
  3181. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  3182. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  3183. // backup image. Applicable to the following creative types: DISPLAY
  3184. // when the primary asset type is not HTML_IMAGE.
  3185. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  3186. // BackupImageTargetWindow: Target window for backup image. Applicable
  3187. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  3188. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3189. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  3190. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  3191. // HTML5_BANNER creatives, this is a subset of detected click tags for
  3192. // the assets associated with this creative. After creating a flash
  3193. // asset, detected click tags will be returned in the
  3194. // creativeAssetMetadata. When inserting the creative, populate the
  3195. // creative clickTags field using the creativeAssetMetadata.clickTags
  3196. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  3197. // one entry in this list for each image creative asset. A click tag is
  3198. // matched with a corresponding creative asset by matching the
  3199. // clickTag.name field with the creativeAsset.assetIdentifier.name
  3200. // field. Applicable to the following creative types:
  3201. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  3202. // DISPLAY when the primary asset type is not HTML_IMAGE.
  3203. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3204. // CommercialId: Industry standard ID assigned to creative for reach and
  3205. // frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives.
  3206. CommercialId string `json:"commercialId,omitempty"`
  3207. // CompanionCreatives: List of companion creatives assigned to an
  3208. // in-Stream video creative. Acceptable values include IDs of existing
  3209. // flash and image creatives. Applicable to the following creative
  3210. // types: all VPAID, all INSTREAM_AUDIO and all INSTREAM_VIDEO with
  3211. // dynamicAssetSelection set to false.
  3212. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  3213. // Compatibility: Compatibilities associated with this creative. This is
  3214. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3215. // rendering either on desktop or on mobile devices or in mobile apps
  3216. // for regular or interstitial ads, respectively. APP and
  3217. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3218. // creatives may have these compatibilities since new creatives will
  3219. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3220. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3221. // with the VAST standard. IN_STREAM_AUDIO refers to rendering in
  3222. // in-stream audio ads developed with the VAST standard. Applicable to
  3223. // all creative types.
  3224. //
  3225. // Acceptable values are:
  3226. // - "APP"
  3227. // - "APP_INTERSTITIAL"
  3228. // - "IN_STREAM_VIDEO"
  3229. // - "IN_STREAM_AUDIO"
  3230. // - "DISPLAY"
  3231. // - "DISPLAY_INTERSTITIAL"
  3232. //
  3233. // Possible values:
  3234. // "APP"
  3235. // "APP_INTERSTITIAL"
  3236. // "DISPLAY"
  3237. // "DISPLAY_INTERSTITIAL"
  3238. // "IN_STREAM_AUDIO"
  3239. // "IN_STREAM_VIDEO"
  3240. Compatibility []string `json:"compatibility,omitempty"`
  3241. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3242. // creative need to be automatically converted to HTML5. This flag is
  3243. // enabled by default and users can choose to disable it if they don't
  3244. // want the system to generate and use HTML5 asset for this creative.
  3245. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3246. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3247. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3248. // CounterCustomEvents: List of counter events configured for the
  3249. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3250. // and auto-generated from clickTags. Applicable to the following
  3251. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3252. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3253. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3254. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3255. // CreativeAssets: Assets associated with a creative. Applicable to all
  3256. // but the following creative types: INTERNAL_REDIRECT,
  3257. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3258. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3259. // CreativeFieldAssignments: Creative field assignments for this
  3260. // creative. Applicable to all creative types.
  3261. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3262. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3263. // Key-values let you customize the creative settings of a Rich Media ad
  3264. // running on your site without having to contact the advertiser. You
  3265. // can use key-values to dynamically change the look or functionality of
  3266. // a creative. Applicable to the following creative types: all
  3267. // RICH_MEDIA, and all VPAID.
  3268. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3269. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3270. // target individual assets in this creative. When set to true
  3271. // creativeAssetSelection must be set. This also controls asset-level
  3272. // companions. When this is true, companion creatives should be assigned
  3273. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3274. // creatives.
  3275. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3276. // ExitCustomEvents: List of exit events configured for the creative.
  3277. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3278. // and auto-generated from clickTags, For DISPLAY, an event is also
  3279. // created from the backupImageReportingLabel. Applicable to the
  3280. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3281. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3282. // HTML_IMAGE.
  3283. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3284. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3285. // file communicate with either Flash Player or the program hosting
  3286. // Flash Player, such as a web browser. This is only triggered if
  3287. // allowScriptAccess field is true. Applicable to the following creative
  3288. // types: FLASH_INPAGE.
  3289. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3290. // HtmlCode: HTML code for the creative. This is a required field when
  3291. // applicable. This field is ignored if htmlCodeLocked is true.
  3292. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3293. // and HTML5_BANNER, and all RICH_MEDIA.
  3294. HtmlCode string `json:"htmlCode,omitempty"`
  3295. // HtmlCodeLocked: Whether HTML code is generated by Campaign Manager or
  3296. // manually entered. Set to true to ignore changes to htmlCode.
  3297. // Applicable to the following creative types: FLASH_INPAGE and
  3298. // HTML5_BANNER.
  3299. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3300. // Id: ID of this creative. This is a read-only, auto-generated field.
  3301. // Applicable to all creative types.
  3302. Id int64 `json:"id,omitempty,string"`
  3303. // IdDimensionValue: Dimension value for the ID of this creative. This
  3304. // is a read-only field. Applicable to all creative types.
  3305. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3306. // Kind: Identifies what kind of resource this is. Value: the fixed
  3307. // string "dfareporting#creative".
  3308. Kind string `json:"kind,omitempty"`
  3309. // LastModifiedInfo: Creative last modification information. This is a
  3310. // read-only field. Applicable to all creative types.
  3311. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3312. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3313. // associated with rich media and VPAID creatives. This is a read-only
  3314. // field. Applicable to the following creative types: all RICH_MEDIA,
  3315. // and all VPAID.
  3316. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3317. // MediaDescription: Description of the audio or video ad. Applicable to
  3318. // the following creative types: all INSTREAM_VIDEO, INSTREAM_AUDIO, and
  3319. // all VPAID.
  3320. MediaDescription string `json:"mediaDescription,omitempty"`
  3321. // MediaDuration: Creative audio or video duration in seconds. This is a
  3322. // read-only field. Applicable to the following creative types:
  3323. // INSTREAM_VIDEO, INSTREAM_AUDIO, all RICH_MEDIA, and all VPAID.
  3324. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3325. // Name: Name of the creative. This is a required field and must be less
  3326. // than 256 characters long. Applicable to all creative types.
  3327. Name string `json:"name,omitempty"`
  3328. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3329. // to the following creative types: all RICH_MEDIA.
  3330. OverrideCss string `json:"overrideCss,omitempty"`
  3331. // PoliteLoadAssetId: The asset ID of the polite load image asset.
  3332. // Applicable to the creative type: DISPLAY.
  3333. PoliteLoadAssetId int64 `json:"politeLoadAssetId,omitempty,string"`
  3334. // ProgressOffset: Amount of time to play the video before counting a
  3335. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3336. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3337. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3338. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3339. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3340. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3341. // This is a required field when applicable. Applicable to the following
  3342. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3343. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3344. RedirectUrl string `json:"redirectUrl,omitempty"`
  3345. // RenderingId: ID of current rendering version. This is a read-only
  3346. // field. Applicable to all creative types.
  3347. RenderingId int64 `json:"renderingId,omitempty,string"`
  3348. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3349. // this creative. This is a read-only field. Applicable to all creative
  3350. // types.
  3351. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3352. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3353. // for this creative. For example, 11.2.202.235. This is a read-only
  3354. // field. Applicable to the following creative types: all RICH_MEDIA,
  3355. // and all VPAID.
  3356. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3357. // RequiredFlashVersion: The internal Flash version for this creative as
  3358. // calculated by Studio. This is a read-only field. Applicable to the
  3359. // following creative types: FLASH_INPAGE all RICH_MEDIA, and all VPAID.
  3360. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3361. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3362. // Size: Size associated with this creative. When inserting or updating
  3363. // a creative either the size ID field or size width and height fields
  3364. // can be used. This is a required field when applicable; however for
  3365. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3366. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3367. // automatically set using the actual size of the associated image
  3368. // assets. Applicable to the following creative types: DISPLAY,
  3369. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3370. // RICH_MEDIA.
  3371. Size *Size `json:"size,omitempty"`
  3372. // SkipOffset: Amount of time to play the video before the skip button
  3373. // appears. Applicable to the following creative types: all
  3374. // INSTREAM_VIDEO.
  3375. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3376. // Skippable: Whether the user can choose to skip the creative.
  3377. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3378. // all VPAID.
  3379. Skippable bool `json:"skippable,omitempty"`
  3380. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3381. // read-only field. Applicable to all creative types.
  3382. SslCompliant bool `json:"sslCompliant,omitempty"`
  3383. // SslOverride: Whether creative should be treated as SSL compliant even
  3384. // if the system scan shows it's not. Applicable to all creative types.
  3385. SslOverride bool `json:"sslOverride,omitempty"`
  3386. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3387. // and VPAID creatives. This is a read-only field. Applicable to the
  3388. // following creative types: all RICH_MEDIA, and all VPAID.
  3389. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3390. // StudioCreativeId: Studio creative ID associated with rich media and
  3391. // VPAID creatives. This is a read-only field. Applicable to the
  3392. // following creative types: all RICH_MEDIA, and all VPAID.
  3393. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3394. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3395. // with rich media and VPAID creatives. This is a read-only field.
  3396. // Applicable to the following creative types: all RICH_MEDIA, and all
  3397. // VPAID.
  3398. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3399. // SubaccountId: Subaccount ID of this creative. This field, if left
  3400. // unset, will be auto-generated for both insert and update operations.
  3401. // Applicable to all creative types.
  3402. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3403. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3404. // backup image impressions. Applicable to the following creative types:
  3405. // all RICH_MEDIA.
  3406. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3407. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3408. // rich media impressions. Applicable to the following creative types:
  3409. // all RICH_MEDIA.
  3410. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3411. // ThirdPartyUrls: Third-party URLs for tracking in-stream creative
  3412. // events. Applicable to the following creative types: all
  3413. // INSTREAM_VIDEO, all INSTREAM_AUDIO, and all VPAID.
  3414. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3415. // TimerCustomEvents: List of timer events configured for the creative.
  3416. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3417. // auto-generated from clickTags. Applicable to the following creative
  3418. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3419. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3420. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3421. // TotalFileSize: Combined size of all creative assets. This is a
  3422. // read-only field. Applicable to the following creative types: all
  3423. // RICH_MEDIA, and all VPAID.
  3424. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3425. // Type: Type of this creative. This is a required field. Applicable to
  3426. // all creative types.
  3427. //
  3428. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3429. // existing creatives. New creatives should use DISPLAY as a replacement
  3430. // for these types.
  3431. //
  3432. // Possible values:
  3433. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3434. // "CUSTOM_DISPLAY"
  3435. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3436. // "DISPLAY"
  3437. // "DISPLAY_IMAGE_GALLERY"
  3438. // "DISPLAY_REDIRECT"
  3439. // "FLASH_INPAGE"
  3440. // "HTML5_BANNER"
  3441. // "IMAGE"
  3442. // "INSTREAM_AUDIO"
  3443. // "INSTREAM_VIDEO"
  3444. // "INSTREAM_VIDEO_REDIRECT"
  3445. // "INTERNAL_REDIRECT"
  3446. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3447. // "RICH_MEDIA_DISPLAY_BANNER"
  3448. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3449. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3450. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3451. // "RICH_MEDIA_IM_EXPAND"
  3452. // "RICH_MEDIA_INPAGE_FLOATING"
  3453. // "RICH_MEDIA_MOBILE_IN_APP"
  3454. // "RICH_MEDIA_PEEL_DOWN"
  3455. // "TRACKING_TEXT"
  3456. // "VPAID_LINEAR_VIDEO"
  3457. // "VPAID_NON_LINEAR_VIDEO"
  3458. Type string `json:"type,omitempty"`
  3459. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  3460. // to the following creative types: INSTREAM_AUDIO and INSTREAM_VIDEO
  3461. // and VPAID.
  3462. UniversalAdId *UniversalAdId `json:"universalAdId,omitempty"`
  3463. // Version: The version number helps you keep track of multiple versions
  3464. // of your creative in your reports. The version number will always be
  3465. // auto-generated during insert operations to start at 1. For tracking
  3466. // creatives the version cannot be incremented and will always remain at
  3467. // 1. For all other creative types the version can be incremented only
  3468. // by 1 during update operations. In addition, the version will be
  3469. // automatically incremented by 1 when undergoing Rich Media creative
  3470. // merging. Applicable to all creative types.
  3471. Version int64 `json:"version,omitempty"`
  3472. // ServerResponse contains the HTTP response code and headers from the
  3473. // server.
  3474. googleapi.ServerResponse `json:"-"`
  3475. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3476. // unconditionally include in API requests. By default, fields with
  3477. // empty values are omitted from API requests. However, any non-pointer,
  3478. // non-interface field appearing in ForceSendFields will be sent to the
  3479. // server regardless of whether the field is empty or not. This may be
  3480. // used to include empty fields in Patch requests.
  3481. ForceSendFields []string `json:"-"`
  3482. // NullFields is a list of field names (e.g. "AccountId") to include in
  3483. // API requests with the JSON null value. By default, fields with empty
  3484. // values are omitted from API requests. However, any field with an
  3485. // empty value appearing in NullFields will be sent to the server as
  3486. // null. It is an error if a field in this list has a non-empty value.
  3487. // This may be used to include null fields in Patch requests.
  3488. NullFields []string `json:"-"`
  3489. }
  3490. func (s *Creative) MarshalJSON() ([]byte, error) {
  3491. type NoMethod Creative
  3492. raw := NoMethod(*s)
  3493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3494. }
  3495. func (s *Creative) UnmarshalJSON(data []byte) error {
  3496. type NoMethod Creative
  3497. var s1 struct {
  3498. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3499. *NoMethod
  3500. }
  3501. s1.NoMethod = (*NoMethod)(s)
  3502. if err := json.Unmarshal(data, &s1); err != nil {
  3503. return err
  3504. }
  3505. s.MediaDuration = float64(s1.MediaDuration)
  3506. return nil
  3507. }
  3508. // CreativeAsset: Creative Asset.
  3509. type CreativeAsset struct {
  3510. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3511. // This is a read-only field. Applicable to the following creative type:
  3512. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3513. // not HTML_IMAGE.
  3514. ActionScript3 bool `json:"actionScript3,omitempty"`
  3515. // Active: Whether the video or audio asset is active. This is a
  3516. // read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the
  3517. // following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and all
  3518. // VPAID.
  3519. Active bool `json:"active,omitempty"`
  3520. // Alignment: Possible alignments for an asset. This is a read-only
  3521. // field. Applicable to the following creative types:
  3522. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3523. //
  3524. // Possible values:
  3525. // "ALIGNMENT_BOTTOM"
  3526. // "ALIGNMENT_LEFT"
  3527. // "ALIGNMENT_RIGHT"
  3528. // "ALIGNMENT_TOP"
  3529. Alignment string `json:"alignment,omitempty"`
  3530. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3531. // field. Applicable to the following creative types: all RICH_MEDIA.
  3532. //
  3533. // Possible values:
  3534. // "ARTWORK_TYPE_FLASH"
  3535. // "ARTWORK_TYPE_HTML5"
  3536. // "ARTWORK_TYPE_IMAGE"
  3537. // "ARTWORK_TYPE_MIXED"
  3538. ArtworkType string `json:"artworkType,omitempty"`
  3539. // AssetIdentifier: Identifier of this asset. This is the same
  3540. // identifier returned during creative asset insert operation. This is a
  3541. // required field. Applicable to all but the following creative types:
  3542. // all REDIRECT and TRACKING_TEXT.
  3543. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3544. // BackupImageExit: Exit event configured for the backup image.
  3545. // Applicable to the following creative types: all RICH_MEDIA.
  3546. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3547. // BitRate: Detected bit-rate for audio or video asset. This is a
  3548. // read-only field. Applicable to the following creative types:
  3549. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3550. BitRate int64 `json:"bitRate,omitempty"`
  3551. // ChildAssetType: Rich media child asset type. This is a read-only
  3552. // field. Applicable to the following creative types: all VPAID.
  3553. //
  3554. // Possible values:
  3555. // "CHILD_ASSET_TYPE_DATA"
  3556. // "CHILD_ASSET_TYPE_FLASH"
  3557. // "CHILD_ASSET_TYPE_IMAGE"
  3558. // "CHILD_ASSET_TYPE_VIDEO"
  3559. ChildAssetType string `json:"childAssetType,omitempty"`
  3560. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3561. // field. Applicable to the following creative types: all RICH_MEDIA and
  3562. // all VPAID. Additionally, applicable to assets whose displayType is
  3563. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3564. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3565. // CompanionCreativeIds: List of companion creatives assigned to an
  3566. // in-stream video creative asset. Acceptable values include IDs of
  3567. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3568. // creative type with dynamicAssetSelection set to true.
  3569. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3570. // CustomStartTimeValue: Custom start time in seconds for making the
  3571. // asset visible. Applicable to the following creative types: all
  3572. // RICH_MEDIA. Value must be greater than or equal to 0.
  3573. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3574. // DetectedFeatures: List of feature dependencies for the creative asset
  3575. // that are detected by Campaign Manager. Feature dependencies are
  3576. // features that a browser must be able to support in order to render
  3577. // your HTML5 creative correctly. This is a read-only, auto-generated
  3578. // field. Applicable to the following creative types: HTML5_BANNER.
  3579. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3580. //
  3581. // Possible values:
  3582. // "APPLICATION_CACHE"
  3583. // "AUDIO"
  3584. // "CANVAS"
  3585. // "CANVAS_TEXT"
  3586. // "CSS_ANIMATIONS"
  3587. // "CSS_BACKGROUND_SIZE"
  3588. // "CSS_BORDER_IMAGE"
  3589. // "CSS_BORDER_RADIUS"
  3590. // "CSS_BOX_SHADOW"
  3591. // "CSS_COLUMNS"
  3592. // "CSS_FLEX_BOX"
  3593. // "CSS_FONT_FACE"
  3594. // "CSS_GENERATED_CONTENT"
  3595. // "CSS_GRADIENTS"
  3596. // "CSS_HSLA"
  3597. // "CSS_MULTIPLE_BGS"
  3598. // "CSS_OPACITY"
  3599. // "CSS_REFLECTIONS"
  3600. // "CSS_RGBA"
  3601. // "CSS_TEXT_SHADOW"
  3602. // "CSS_TRANSFORMS"
  3603. // "CSS_TRANSFORMS3D"
  3604. // "CSS_TRANSITIONS"
  3605. // "DRAG_AND_DROP"
  3606. // "GEO_LOCATION"
  3607. // "HASH_CHANGE"
  3608. // "HISTORY"
  3609. // "INDEXED_DB"
  3610. // "INLINE_SVG"
  3611. // "INPUT_ATTR_AUTOCOMPLETE"
  3612. // "INPUT_ATTR_AUTOFOCUS"
  3613. // "INPUT_ATTR_LIST"
  3614. // "INPUT_ATTR_MAX"
  3615. // "INPUT_ATTR_MIN"
  3616. // "INPUT_ATTR_MULTIPLE"
  3617. // "INPUT_ATTR_PATTERN"
  3618. // "INPUT_ATTR_PLACEHOLDER"
  3619. // "INPUT_ATTR_REQUIRED"
  3620. // "INPUT_ATTR_STEP"
  3621. // "INPUT_TYPE_COLOR"
  3622. // "INPUT_TYPE_DATE"
  3623. // "INPUT_TYPE_DATETIME"
  3624. // "INPUT_TYPE_DATETIME_LOCAL"
  3625. // "INPUT_TYPE_EMAIL"
  3626. // "INPUT_TYPE_MONTH"
  3627. // "INPUT_TYPE_NUMBER"
  3628. // "INPUT_TYPE_RANGE"
  3629. // "INPUT_TYPE_SEARCH"
  3630. // "INPUT_TYPE_TEL"
  3631. // "INPUT_TYPE_TIME"
  3632. // "INPUT_TYPE_URL"
  3633. // "INPUT_TYPE_WEEK"
  3634. // "LOCAL_STORAGE"
  3635. // "POST_MESSAGE"
  3636. // "SESSION_STORAGE"
  3637. // "SMIL"
  3638. // "SVG_CLIP_PATHS"
  3639. // "SVG_FE_IMAGE"
  3640. // "SVG_FILTERS"
  3641. // "SVG_HREF"
  3642. // "TOUCH"
  3643. // "VIDEO"
  3644. // "WEBGL"
  3645. // "WEB_SOCKETS"
  3646. // "WEB_SQL_DATABASE"
  3647. // "WEB_WORKERS"
  3648. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3649. // DisplayType: Type of rich media asset. This is a read-only field.
  3650. // Applicable to the following creative types: all RICH_MEDIA.
  3651. //
  3652. // Possible values:
  3653. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3654. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3655. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3656. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3657. // "ASSET_DISPLAY_TYPE_FLOATING"
  3658. // "ASSET_DISPLAY_TYPE_INPAGE"
  3659. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3660. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3661. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3662. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3663. DisplayType string `json:"displayType,omitempty"`
  3664. // Duration: Duration in seconds for which an asset will be displayed.
  3665. // Applicable to the following creative types: INSTREAM_AUDIO,
  3666. // INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must be greater than or
  3667. // equal to 1.
  3668. Duration int64 `json:"duration,omitempty"`
  3669. // DurationType: Duration type for which an asset will be displayed.
  3670. // Applicable to the following creative types: all RICH_MEDIA.
  3671. //
  3672. // Possible values:
  3673. // "ASSET_DURATION_TYPE_AUTO"
  3674. // "ASSET_DURATION_TYPE_CUSTOM"
  3675. // "ASSET_DURATION_TYPE_NONE"
  3676. DurationType string `json:"durationType,omitempty"`
  3677. // ExpandedDimension: Detected expanded dimension for video asset. This
  3678. // is a read-only field. Applicable to the following creative types:
  3679. // INSTREAM_VIDEO and all VPAID.
  3680. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3681. // FileSize: File size associated with this creative asset. This is a
  3682. // read-only field. Applicable to all but the following creative types:
  3683. // all REDIRECT and TRACKING_TEXT.
  3684. FileSize int64 `json:"fileSize,omitempty,string"`
  3685. // FlashVersion: Flash version of the asset. This is a read-only field.
  3686. // Applicable to the following creative types: FLASH_INPAGE, all
  3687. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3688. // asset type is not HTML_IMAGE.
  3689. FlashVersion int64 `json:"flashVersion,omitempty"`
  3690. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3691. // Applicable to the following creative types: all RICH_MEDIA.
  3692. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3693. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3694. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3695. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3696. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3697. // a read-only field. Applicable to the following creative types: all
  3698. // RICH_MEDIA.
  3699. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3700. // Id: Numeric ID of this creative asset. This is a required field and
  3701. // should not be modified. Applicable to all but the following creative
  3702. // types: all REDIRECT and TRACKING_TEXT.
  3703. Id int64 `json:"id,omitempty,string"`
  3704. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3705. // read-only, auto-generated field.
  3706. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3707. // MediaDuration: Detected duration for audio or video asset. This is a
  3708. // read-only field. Applicable to the following creative types:
  3709. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3710. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3711. // MimeType: Detected MIME type for audio or video asset. This is a
  3712. // read-only field. Applicable to the following creative types:
  3713. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3714. MimeType string `json:"mimeType,omitempty"`
  3715. // Offset: Offset position for an asset in collapsed mode. This is a
  3716. // read-only field. Applicable to the following creative types: all
  3717. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3718. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3719. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3720. Offset *OffsetPosition `json:"offset,omitempty"`
  3721. // Orientation: Orientation of video asset. This is a read-only,
  3722. // auto-generated field.
  3723. //
  3724. // Possible values:
  3725. // "LANDSCAPE"
  3726. // "PORTRAIT"
  3727. // "SQUARE"
  3728. Orientation string `json:"orientation,omitempty"`
  3729. // OriginalBackup: Whether the backup asset is original or changed by
  3730. // the user in Campaign Manager. Applicable to the following creative
  3731. // types: all RICH_MEDIA.
  3732. OriginalBackup bool `json:"originalBackup,omitempty"`
  3733. // Position: Offset position for an asset. Applicable to the following
  3734. // creative types: all RICH_MEDIA.
  3735. Position *OffsetPosition `json:"position,omitempty"`
  3736. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3737. // field. Applicable to the following creative types: all RICH_MEDIA.
  3738. //
  3739. // Possible values:
  3740. // "OFFSET_UNIT_PERCENT"
  3741. // "OFFSET_UNIT_PIXEL"
  3742. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3743. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3744. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3745. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3746. // Applicable to the following creative types: all RICH_MEDIA.
  3747. //
  3748. // Possible values:
  3749. // "OFFSET_UNIT_PERCENT"
  3750. // "OFFSET_UNIT_PIXEL"
  3751. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3752. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3753. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3754. // read-only field. Applicable to the following creative types:
  3755. // INSTREAM_VIDEO and all VPAID.
  3756. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3757. // Pushdown: Whether the asset pushes down other content. Applicable to
  3758. // the following creative types: all RICH_MEDIA. Additionally, only
  3759. // applicable when the asset offsets are 0, the collapsedSize.width
  3760. // matches size.width, and the collapsedSize.height is less than
  3761. // size.height.
  3762. Pushdown bool `json:"pushdown,omitempty"`
  3763. // PushdownDuration: Pushdown duration in seconds for an asset.
  3764. // Applicable to the following creative types: all
  3765. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3766. // field is true, the offsets are 0, the collapsedSize.width matches
  3767. // size.width, and the collapsedSize.height is less than size.height.
  3768. // Acceptable values are 0 to 9.99, inclusive.
  3769. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3770. // Role: Role of the asset in relation to creative. Applicable to all
  3771. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3772. // This is a required field.
  3773. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3774. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3775. // primary assets), and all VPAID creatives.
  3776. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3777. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3778. // type is not HTML_IMAGE.
  3779. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3780. // creatives.
  3781. // OTHER refers to assets from sources other than Campaign Manager, such
  3782. // as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3783. // creatives.
  3784. // PARENT_VIDEO refers to videos uploaded by the user in Campaign
  3785. // Manager and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3786. // creatives.
  3787. // TRANSCODED_VIDEO refers to videos transcoded by Campaign Manager from
  3788. // PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and
  3789. // VPAID_LINEAR_VIDEO creatives.
  3790. // ALTERNATE_VIDEO refers to the Campaign Manager representation of
  3791. // child asset videos from Studio, and is applicable to
  3792. // VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within
  3793. // Campaign Manager.
  3794. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3795. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3796. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3797. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3798. // creative.
  3799. // PARENT_AUDIO refers to audios uploaded by the user in Campaign
  3800. // Manager and is applicable to INSTREAM_AUDIO
  3801. // creatives.
  3802. // TRANSCODED_AUDIO refers to audios transcoded by Campaign Manager from
  3803. // PARENT_AUDIO assets and is applicable to INSTREAM_AUDIO creatives.
  3804. //
  3805. // Possible values:
  3806. // "ADDITIONAL_FLASH"
  3807. // "ADDITIONAL_IMAGE"
  3808. // "ALTERNATE_VIDEO"
  3809. // "BACKUP_IMAGE"
  3810. // "OTHER"
  3811. // "PARENT_AUDIO"
  3812. // "PARENT_VIDEO"
  3813. // "PRIMARY"
  3814. // "TRANSCODED_AUDIO"
  3815. // "TRANSCODED_VIDEO"
  3816. Role string `json:"role,omitempty"`
  3817. // Size: Size associated with this creative asset. This is a required
  3818. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3819. // if left blank, this field will be automatically set using the actual
  3820. // size of the associated image asset. Applicable to the following
  3821. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3822. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3823. // asset type is not HTML_IMAGE.
  3824. Size *Size `json:"size,omitempty"`
  3825. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3826. // field. Applicable to all but the following creative types: all
  3827. // REDIRECT and TRACKING_TEXT.
  3828. SslCompliant bool `json:"sslCompliant,omitempty"`
  3829. // StartTimeType: Initial wait time type before making the asset
  3830. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3831. //
  3832. // Possible values:
  3833. // "ASSET_START_TIME_TYPE_CUSTOM"
  3834. // "ASSET_START_TIME_TYPE_NONE"
  3835. StartTimeType string `json:"startTimeType,omitempty"`
  3836. // StreamingServingUrl: Streaming URL for video asset. This is a
  3837. // read-only field. Applicable to the following creative types:
  3838. // INSTREAM_VIDEO and all VPAID.
  3839. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3840. // Transparency: Whether the asset is transparent. Applicable to the
  3841. // following creative types: all RICH_MEDIA. Additionally, only
  3842. // applicable to HTML5 assets.
  3843. Transparency bool `json:"transparency,omitempty"`
  3844. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3845. // read-only field. Applicable to the following creative types: all
  3846. // RICH_MEDIA.
  3847. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3848. // WindowMode: Window mode options for flash assets. Applicable to the
  3849. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3850. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3851. // RICH_MEDIA_INPAGE_FLOATING.
  3852. //
  3853. // Possible values:
  3854. // "OPAQUE"
  3855. // "TRANSPARENT"
  3856. // "WINDOW"
  3857. WindowMode string `json:"windowMode,omitempty"`
  3858. // ZIndex: zIndex value of an asset. Applicable to the following
  3859. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3860. // assets whose displayType is NOT one of the following types:
  3861. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3862. // values are -999999999 to 999999999, inclusive.
  3863. ZIndex int64 `json:"zIndex,omitempty"`
  3864. // ZipFilename: File name of zip file. This is a read-only field.
  3865. // Applicable to the following creative types: HTML5_BANNER.
  3866. ZipFilename string `json:"zipFilename,omitempty"`
  3867. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3868. // to the following creative types: HTML5_BANNER.
  3869. ZipFilesize string `json:"zipFilesize,omitempty"`
  3870. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3871. // unconditionally include in API requests. By default, fields with
  3872. // empty values are omitted from API requests. However, any non-pointer,
  3873. // non-interface field appearing in ForceSendFields will be sent to the
  3874. // server regardless of whether the field is empty or not. This may be
  3875. // used to include empty fields in Patch requests.
  3876. ForceSendFields []string `json:"-"`
  3877. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3878. // in API requests with the JSON null value. By default, fields with
  3879. // empty values are omitted from API requests. However, any field with
  3880. // an empty value appearing in NullFields will be sent to the server as
  3881. // null. It is an error if a field in this list has a non-empty value.
  3882. // This may be used to include null fields in Patch requests.
  3883. NullFields []string `json:"-"`
  3884. }
  3885. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3886. type NoMethod CreativeAsset
  3887. raw := NoMethod(*s)
  3888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3889. }
  3890. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3891. type NoMethod CreativeAsset
  3892. var s1 struct {
  3893. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3894. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3895. *NoMethod
  3896. }
  3897. s1.NoMethod = (*NoMethod)(s)
  3898. if err := json.Unmarshal(data, &s1); err != nil {
  3899. return err
  3900. }
  3901. s.MediaDuration = float64(s1.MediaDuration)
  3902. s.PushdownDuration = float64(s1.PushdownDuration)
  3903. return nil
  3904. }
  3905. // CreativeAssetId: Creative Asset ID.
  3906. type CreativeAssetId struct {
  3907. // Name: Name of the creative asset. This is a required field while
  3908. // inserting an asset. After insertion, this assetIdentifier is used to
  3909. // identify the uploaded asset. Characters in the name must be
  3910. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3911. Name string `json:"name,omitempty"`
  3912. // Type: Type of asset to upload. This is a required field. FLASH and
  3913. // IMAGE are no longer supported for new uploads. All image assets
  3914. // should use HTML_IMAGE.
  3915. //
  3916. // Possible values:
  3917. // "AUDIO"
  3918. // "FLASH"
  3919. // "HTML"
  3920. // "HTML_IMAGE"
  3921. // "IMAGE"
  3922. // "VIDEO"
  3923. Type string `json:"type,omitempty"`
  3924. // ForceSendFields is a list of field names (e.g. "Name") to
  3925. // unconditionally include in API requests. By default, fields with
  3926. // empty values are omitted from API requests. However, any non-pointer,
  3927. // non-interface field appearing in ForceSendFields will be sent to the
  3928. // server regardless of whether the field is empty or not. This may be
  3929. // used to include empty fields in Patch requests.
  3930. ForceSendFields []string `json:"-"`
  3931. // NullFields is a list of field names (e.g. "Name") to include in API
  3932. // requests with the JSON null value. By default, fields with empty
  3933. // values are omitted from API requests. However, any field with an
  3934. // empty value appearing in NullFields will be sent to the server as
  3935. // null. It is an error if a field in this list has a non-empty value.
  3936. // This may be used to include null fields in Patch requests.
  3937. NullFields []string `json:"-"`
  3938. }
  3939. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3940. type NoMethod CreativeAssetId
  3941. raw := NoMethod(*s)
  3942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3943. }
  3944. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3945. // creative asset file which will be uploaded or has already been
  3946. // uploaded. Refer to the creative sample code for how to upload assets
  3947. // and insert a creative.
  3948. type CreativeAssetMetadata struct {
  3949. // AssetIdentifier: ID of the creative asset. This is a required field.
  3950. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3951. // ClickTags: List of detected click tags for assets. This is a
  3952. // read-only auto-generated field.
  3953. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3954. // DetectedFeatures: List of feature dependencies for the creative asset
  3955. // that are detected by Campaign Manager. Feature dependencies are
  3956. // features that a browser must be able to support in order to render
  3957. // your HTML5 creative correctly. This is a read-only, auto-generated
  3958. // field.
  3959. //
  3960. // Possible values:
  3961. // "APPLICATION_CACHE"
  3962. // "AUDIO"
  3963. // "CANVAS"
  3964. // "CANVAS_TEXT"
  3965. // "CSS_ANIMATIONS"
  3966. // "CSS_BACKGROUND_SIZE"
  3967. // "CSS_BORDER_IMAGE"
  3968. // "CSS_BORDER_RADIUS"
  3969. // "CSS_BOX_SHADOW"
  3970. // "CSS_COLUMNS"
  3971. // "CSS_FLEX_BOX"
  3972. // "CSS_FONT_FACE"
  3973. // "CSS_GENERATED_CONTENT"
  3974. // "CSS_GRADIENTS"
  3975. // "CSS_HSLA"
  3976. // "CSS_MULTIPLE_BGS"
  3977. // "CSS_OPACITY"
  3978. // "CSS_REFLECTIONS"
  3979. // "CSS_RGBA"
  3980. // "CSS_TEXT_SHADOW"
  3981. // "CSS_TRANSFORMS"
  3982. // "CSS_TRANSFORMS3D"
  3983. // "CSS_TRANSITIONS"
  3984. // "DRAG_AND_DROP"
  3985. // "GEO_LOCATION"
  3986. // "HASH_CHANGE"
  3987. // "HISTORY"
  3988. // "INDEXED_DB"
  3989. // "INLINE_SVG"
  3990. // "INPUT_ATTR_AUTOCOMPLETE"
  3991. // "INPUT_ATTR_AUTOFOCUS"
  3992. // "INPUT_ATTR_LIST"
  3993. // "INPUT_ATTR_MAX"
  3994. // "INPUT_ATTR_MIN"
  3995. // "INPUT_ATTR_MULTIPLE"
  3996. // "INPUT_ATTR_PATTERN"
  3997. // "INPUT_ATTR_PLACEHOLDER"
  3998. // "INPUT_ATTR_REQUIRED"
  3999. // "INPUT_ATTR_STEP"
  4000. // "INPUT_TYPE_COLOR"
  4001. // "INPUT_TYPE_DATE"
  4002. // "INPUT_TYPE_DATETIME"
  4003. // "INPUT_TYPE_DATETIME_LOCAL"
  4004. // "INPUT_TYPE_EMAIL"
  4005. // "INPUT_TYPE_MONTH"
  4006. // "INPUT_TYPE_NUMBER"
  4007. // "INPUT_TYPE_RANGE"
  4008. // "INPUT_TYPE_SEARCH"
  4009. // "INPUT_TYPE_TEL"
  4010. // "INPUT_TYPE_TIME"
  4011. // "INPUT_TYPE_URL"
  4012. // "INPUT_TYPE_WEEK"
  4013. // "LOCAL_STORAGE"
  4014. // "POST_MESSAGE"
  4015. // "SESSION_STORAGE"
  4016. // "SMIL"
  4017. // "SVG_CLIP_PATHS"
  4018. // "SVG_FE_IMAGE"
  4019. // "SVG_FILTERS"
  4020. // "SVG_HREF"
  4021. // "TOUCH"
  4022. // "VIDEO"
  4023. // "WEBGL"
  4024. // "WEB_SOCKETS"
  4025. // "WEB_SQL_DATABASE"
  4026. // "WEB_WORKERS"
  4027. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  4028. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  4029. // field.
  4030. Id int64 `json:"id,omitempty,string"`
  4031. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  4032. // This is a read-only, auto-generated field.
  4033. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  4034. // Kind: Identifies what kind of resource this is. Value: the fixed
  4035. // string "dfareporting#creativeAssetMetadata".
  4036. Kind string `json:"kind,omitempty"`
  4037. // WarnedValidationRules: Rules validated during code generation that
  4038. // generated a warning. This is a read-only, auto-generated
  4039. // field.
  4040. //
  4041. // Possible values are:
  4042. // - "ADMOB_REFERENCED"
  4043. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  4044. // - "ASSET_INVALID"
  4045. // - "CLICK_TAG_HARD_CODED"
  4046. // - "CLICK_TAG_INVALID"
  4047. // - "CLICK_TAG_IN_GWD"
  4048. // - "CLICK_TAG_MISSING"
  4049. // - "CLICK_TAG_MORE_THAN_ONE"
  4050. // - "CLICK_TAG_NON_TOP_LEVEL"
  4051. // - "COMPONENT_UNSUPPORTED_DCM"
  4052. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  4053. // - "EXTERNAL_FILE_REFERENCED"
  4054. // - "FILE_DETAIL_EMPTY"
  4055. // - "FILE_TYPE_INVALID"
  4056. // - "GWD_PROPERTIES_INVALID"
  4057. // - "HTML5_FEATURE_UNSUPPORTED"
  4058. // - "LINKED_FILE_NOT_FOUND"
  4059. // - "MAX_FLASH_VERSION_11"
  4060. // - "MRAID_REFERENCED"
  4061. // - "NOT_SSL_COMPLIANT"
  4062. // - "ORPHANED_ASSET"
  4063. // - "PRIMARY_HTML_MISSING"
  4064. // - "SVG_INVALID"
  4065. // - "ZIP_INVALID"
  4066. //
  4067. // Possible values:
  4068. // "ADMOB_REFERENCED"
  4069. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  4070. // "ASSET_INVALID"
  4071. // "CLICK_TAG_HARD_CODED"
  4072. // "CLICK_TAG_INVALID"
  4073. // "CLICK_TAG_IN_GWD"
  4074. // "CLICK_TAG_MISSING"
  4075. // "CLICK_TAG_MORE_THAN_ONE"
  4076. // "CLICK_TAG_NON_TOP_LEVEL"
  4077. // "COMPONENT_UNSUPPORTED_DCM"
  4078. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  4079. // "EXTERNAL_FILE_REFERENCED"
  4080. // "FILE_DETAIL_EMPTY"
  4081. // "FILE_TYPE_INVALID"
  4082. // "GWD_PROPERTIES_INVALID"
  4083. // "HTML5_FEATURE_UNSUPPORTED"
  4084. // "LINKED_FILE_NOT_FOUND"
  4085. // "MAX_FLASH_VERSION_11"
  4086. // "MRAID_REFERENCED"
  4087. // "NOT_SSL_COMPLIANT"
  4088. // "ORPHANED_ASSET"
  4089. // "PRIMARY_HTML_MISSING"
  4090. // "SVG_INVALID"
  4091. // "ZIP_INVALID"
  4092. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  4093. // ServerResponse contains the HTTP response code and headers from the
  4094. // server.
  4095. googleapi.ServerResponse `json:"-"`
  4096. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  4097. // unconditionally include in API requests. By default, fields with
  4098. // empty values are omitted from API requests. However, any non-pointer,
  4099. // non-interface field appearing in ForceSendFields will be sent to the
  4100. // server regardless of whether the field is empty or not. This may be
  4101. // used to include empty fields in Patch requests.
  4102. ForceSendFields []string `json:"-"`
  4103. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  4104. // include in API requests with the JSON null value. By default, fields
  4105. // with empty values are omitted from API requests. However, any field
  4106. // with an empty value appearing in NullFields will be sent to the
  4107. // server as null. It is an error if a field in this list has a
  4108. // non-empty value. This may be used to include null fields in Patch
  4109. // requests.
  4110. NullFields []string `json:"-"`
  4111. }
  4112. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  4113. type NoMethod CreativeAssetMetadata
  4114. raw := NoMethod(*s)
  4115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4116. }
  4117. // CreativeAssetSelection: Encapsulates the list of rules for asset
  4118. // selection and a default asset in case none of the rules match.
  4119. // Applicable to INSTREAM_VIDEO creatives.
  4120. type CreativeAssetSelection struct {
  4121. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  4122. // the parent assets in this creative, and will be served if none of the
  4123. // rules match. This is a required field.
  4124. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  4125. // Rules: Rules determine which asset will be served to a viewer. Rules
  4126. // will be evaluated in the order in which they are stored in this list.
  4127. // This list must contain at least one rule. Applicable to
  4128. // INSTREAM_VIDEO creatives.
  4129. Rules []*Rule `json:"rules,omitempty"`
  4130. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  4131. // unconditionally include in API requests. By default, fields with
  4132. // empty values are omitted from API requests. However, any non-pointer,
  4133. // non-interface field appearing in ForceSendFields will be sent to the
  4134. // server regardless of whether the field is empty or not. This may be
  4135. // used to include empty fields in Patch requests.
  4136. ForceSendFields []string `json:"-"`
  4137. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  4138. // include in API requests with the JSON null value. By default, fields
  4139. // with empty values are omitted from API requests. However, any field
  4140. // with an empty value appearing in NullFields will be sent to the
  4141. // server as null. It is an error if a field in this list has a
  4142. // non-empty value. This may be used to include null fields in Patch
  4143. // requests.
  4144. NullFields []string `json:"-"`
  4145. }
  4146. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  4147. type NoMethod CreativeAssetSelection
  4148. raw := NoMethod(*s)
  4149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4150. }
  4151. // CreativeAssignment: Creative Assignment.
  4152. type CreativeAssignment struct {
  4153. // Active: Whether this creative assignment is active. When true, the
  4154. // creative will be included in the ad's rotation.
  4155. Active bool `json:"active,omitempty"`
  4156. // ApplyEventTags: Whether applicable event tags should fire when this
  4157. // creative assignment is rendered. If this value is unset when the ad
  4158. // is inserted or updated, it will default to true for all creative
  4159. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  4160. // and INSTREAM_VIDEO.
  4161. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  4162. // ClickThroughUrl: Click-through URL of the creative assignment.
  4163. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  4164. // CompanionCreativeOverrides: Companion creative overrides for this
  4165. // creative assignment. Applicable to video ads.
  4166. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  4167. // CreativeGroupAssignments: Creative group assignments for this
  4168. // creative assignment. Only one assignment per creative group number is
  4169. // allowed for a maximum of two assignments.
  4170. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  4171. // CreativeId: ID of the creative to be assigned. This is a required
  4172. // field.
  4173. CreativeId int64 `json:"creativeId,omitempty,string"`
  4174. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  4175. // This is a read-only, auto-generated field.
  4176. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  4177. // EndTime: Date and time that the assigned creative should stop
  4178. // serving. Must be later than the start time.
  4179. EndTime string `json:"endTime,omitempty"`
  4180. // RichMediaExitOverrides: Rich media exit overrides for this creative
  4181. // assignment.
  4182. // Applicable when the creative type is any of the following:
  4183. // - DISPLAY
  4184. // - RICH_MEDIA_INPAGE
  4185. // - RICH_MEDIA_INPAGE_FLOATING
  4186. // - RICH_MEDIA_IM_EXPAND
  4187. // - RICH_MEDIA_EXPANDING
  4188. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  4189. // - RICH_MEDIA_MOBILE_IN_APP
  4190. // - RICH_MEDIA_MULTI_FLOATING
  4191. // - RICH_MEDIA_PEEL_DOWN
  4192. // - VPAID_LINEAR
  4193. // - VPAID_NON_LINEAR
  4194. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  4195. // Sequence: Sequence number of the creative assignment, applicable when
  4196. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  4197. // values are 1 to 65535, inclusive.
  4198. Sequence int64 `json:"sequence,omitempty"`
  4199. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  4200. // This is a read-only field that is auto-generated when the ad is
  4201. // inserted or updated.
  4202. SslCompliant bool `json:"sslCompliant,omitempty"`
  4203. // StartTime: Date and time that the assigned creative should start
  4204. // serving.
  4205. StartTime string `json:"startTime,omitempty"`
  4206. // Weight: Weight of the creative assignment, applicable when the
  4207. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  4208. // than or equal to 1.
  4209. Weight int64 `json:"weight,omitempty"`
  4210. // ForceSendFields is a list of field names (e.g. "Active") to
  4211. // unconditionally include in API requests. By default, fields with
  4212. // empty values are omitted from API requests. However, any non-pointer,
  4213. // non-interface field appearing in ForceSendFields will be sent to the
  4214. // server regardless of whether the field is empty or not. This may be
  4215. // used to include empty fields in Patch requests.
  4216. ForceSendFields []string `json:"-"`
  4217. // NullFields is a list of field names (e.g. "Active") to include in API
  4218. // requests with the JSON null value. By default, fields with empty
  4219. // values are omitted from API requests. However, any field with an
  4220. // empty value appearing in NullFields will be sent to the server as
  4221. // null. It is an error if a field in this list has a non-empty value.
  4222. // This may be used to include null fields in Patch requests.
  4223. NullFields []string `json:"-"`
  4224. }
  4225. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  4226. type NoMethod CreativeAssignment
  4227. raw := NoMethod(*s)
  4228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4229. }
  4230. // CreativeClickThroughUrl: Click-through URL
  4231. type CreativeClickThroughUrl struct {
  4232. // ComputedClickThroughUrl: Read-only convenience field representing the
  4233. // actual URL that will be used for this click-through. The URL is
  4234. // computed as follows:
  4235. // - If landingPageId is specified then that landing page's URL is
  4236. // assigned to this field.
  4237. // - Otherwise, the customClickThroughUrl is assigned to this field.
  4238. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  4239. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  4240. // landingPageId field is left unset.
  4241. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  4242. // LandingPageId: ID of the landing page for the click-through URL.
  4243. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  4244. // ForceSendFields is a list of field names (e.g.
  4245. // "ComputedClickThroughUrl") to unconditionally include in API
  4246. // requests. By default, fields with empty values are omitted from API
  4247. // requests. However, any non-pointer, non-interface field appearing in
  4248. // ForceSendFields will be sent to the server regardless of whether the
  4249. // field is empty or not. This may be used to include empty fields in
  4250. // Patch requests.
  4251. ForceSendFields []string `json:"-"`
  4252. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  4253. // to include in API requests with the JSON null value. By default,
  4254. // fields with empty values are omitted from API requests. However, any
  4255. // field with an empty value appearing in NullFields will be sent to the
  4256. // server as null. It is an error if a field in this list has a
  4257. // non-empty value. This may be used to include null fields in Patch
  4258. // requests.
  4259. NullFields []string `json:"-"`
  4260. }
  4261. func (s *CreativeClickThroughUrl) MarshalJSON() ([]byte, error) {
  4262. type NoMethod CreativeClickThroughUrl
  4263. raw := NoMethod(*s)
  4264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4265. }
  4266. // CreativeCustomEvent: Creative Custom Event.
  4267. type CreativeCustomEvent struct {
  4268. // AdvertiserCustomEventId: Unique ID of this event used by Reporting
  4269. // and Data Transfer. This is a read-only field.
  4270. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  4271. // AdvertiserCustomEventName: User-entered name for the event.
  4272. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  4273. // AdvertiserCustomEventType: Type of the event. This is a read-only
  4274. // field.
  4275. //
  4276. // Possible values:
  4277. // "ADVERTISER_EVENT_COUNTER"
  4278. // "ADVERTISER_EVENT_EXIT"
  4279. // "ADVERTISER_EVENT_TIMER"
  4280. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  4281. // ArtworkLabel: Artwork label column, used to link events in Campaign
  4282. // Manager back to events in Studio. This is a required field and should
  4283. // not be modified after insertion.
  4284. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4285. // ArtworkType: Artwork type used by the creative.This is a read-only
  4286. // field.
  4287. //
  4288. // Possible values:
  4289. // "ARTWORK_TYPE_FLASH"
  4290. // "ARTWORK_TYPE_HTML5"
  4291. // "ARTWORK_TYPE_IMAGE"
  4292. // "ARTWORK_TYPE_MIXED"
  4293. ArtworkType string `json:"artworkType,omitempty"`
  4294. // ExitClickThroughUrl: Exit click-through URL for the event. This field
  4295. // is used only for exit events.
  4296. ExitClickThroughUrl *CreativeClickThroughUrl `json:"exitClickThroughUrl,omitempty"`
  4297. // Id: ID of this event. This is a required field and should not be
  4298. // modified after insertion.
  4299. Id int64 `json:"id,omitempty,string"`
  4300. // PopupWindowProperties: Properties for rich media popup windows. This
  4301. // field is used only for exit events.
  4302. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4303. // TargetType: Target type used by the event.
  4304. //
  4305. // Possible values:
  4306. // "TARGET_BLANK"
  4307. // "TARGET_PARENT"
  4308. // "TARGET_POPUP"
  4309. // "TARGET_SELF"
  4310. // "TARGET_TOP"
  4311. TargetType string `json:"targetType,omitempty"`
  4312. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4313. // videos in a single creative. This is a read-only field.
  4314. VideoReportingId string `json:"videoReportingId,omitempty"`
  4315. // ForceSendFields is a list of field names (e.g.
  4316. // "AdvertiserCustomEventId") to unconditionally include in API
  4317. // requests. By default, fields with empty values are omitted from API
  4318. // requests. However, any non-pointer, non-interface field appearing in
  4319. // ForceSendFields will be sent to the server regardless of whether the
  4320. // field is empty or not. This may be used to include empty fields in
  4321. // Patch requests.
  4322. ForceSendFields []string `json:"-"`
  4323. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4324. // to include in API requests with the JSON null value. By default,
  4325. // fields with empty values are omitted from API requests. However, any
  4326. // field with an empty value appearing in NullFields will be sent to the
  4327. // server as null. It is an error if a field in this list has a
  4328. // non-empty value. This may be used to include null fields in Patch
  4329. // requests.
  4330. NullFields []string `json:"-"`
  4331. }
  4332. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4333. type NoMethod CreativeCustomEvent
  4334. raw := NoMethod(*s)
  4335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4336. }
  4337. // CreativeField: Contains properties of a creative field.
  4338. type CreativeField struct {
  4339. // AccountId: Account ID of this creative field. This is a read-only
  4340. // field that can be left blank.
  4341. AccountId int64 `json:"accountId,omitempty,string"`
  4342. // AdvertiserId: Advertiser ID of this creative field. This is a
  4343. // required field on insertion.
  4344. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4345. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4346. // advertiser. This is a read-only, auto-generated field.
  4347. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4348. // Id: ID of this creative field. This is a read-only, auto-generated
  4349. // field.
  4350. Id int64 `json:"id,omitempty,string"`
  4351. // Kind: Identifies what kind of resource this is. Value: the fixed
  4352. // string "dfareporting#creativeField".
  4353. Kind string `json:"kind,omitempty"`
  4354. // Name: Name of this creative field. This is a required field and must
  4355. // be less than 256 characters long and unique among creative fields of
  4356. // the same advertiser.
  4357. Name string `json:"name,omitempty"`
  4358. // SubaccountId: Subaccount ID of this creative field. This is a
  4359. // read-only field that can be left blank.
  4360. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4361. // ServerResponse contains the HTTP response code and headers from the
  4362. // server.
  4363. googleapi.ServerResponse `json:"-"`
  4364. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4365. // unconditionally include in API requests. By default, fields with
  4366. // empty values are omitted from API requests. However, any non-pointer,
  4367. // non-interface field appearing in ForceSendFields will be sent to the
  4368. // server regardless of whether the field is empty or not. This may be
  4369. // used to include empty fields in Patch requests.
  4370. ForceSendFields []string `json:"-"`
  4371. // NullFields is a list of field names (e.g. "AccountId") to include in
  4372. // API requests with the JSON null value. By default, fields with empty
  4373. // values are omitted from API requests. However, any field with an
  4374. // empty value appearing in NullFields will be sent to the server as
  4375. // null. It is an error if a field in this list has a non-empty value.
  4376. // This may be used to include null fields in Patch requests.
  4377. NullFields []string `json:"-"`
  4378. }
  4379. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4380. type NoMethod CreativeField
  4381. raw := NoMethod(*s)
  4382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4383. }
  4384. // CreativeFieldAssignment: Creative Field Assignment.
  4385. type CreativeFieldAssignment struct {
  4386. // CreativeFieldId: ID of the creative field.
  4387. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4388. // CreativeFieldValueId: ID of the creative field value.
  4389. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4390. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4391. // unconditionally include in API requests. By default, fields with
  4392. // empty values are omitted from API requests. However, any non-pointer,
  4393. // non-interface field appearing in ForceSendFields will be sent to the
  4394. // server regardless of whether the field is empty or not. This may be
  4395. // used to include empty fields in Patch requests.
  4396. ForceSendFields []string `json:"-"`
  4397. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4398. // include in API requests with the JSON null value. By default, fields
  4399. // with empty values are omitted from API requests. However, any field
  4400. // with an empty value appearing in NullFields will be sent to the
  4401. // server as null. It is an error if a field in this list has a
  4402. // non-empty value. This may be used to include null fields in Patch
  4403. // requests.
  4404. NullFields []string `json:"-"`
  4405. }
  4406. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4407. type NoMethod CreativeFieldAssignment
  4408. raw := NoMethod(*s)
  4409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4410. }
  4411. // CreativeFieldValue: Contains properties of a creative field value.
  4412. type CreativeFieldValue struct {
  4413. // Id: ID of this creative field value. This is a read-only,
  4414. // auto-generated field.
  4415. Id int64 `json:"id,omitempty,string"`
  4416. // Kind: Identifies what kind of resource this is. Value: the fixed
  4417. // string "dfareporting#creativeFieldValue".
  4418. Kind string `json:"kind,omitempty"`
  4419. // Value: Value of this creative field value. It needs to be less than
  4420. // 256 characters in length and unique per creative field.
  4421. Value string `json:"value,omitempty"`
  4422. // ServerResponse contains the HTTP response code and headers from the
  4423. // server.
  4424. googleapi.ServerResponse `json:"-"`
  4425. // ForceSendFields is a list of field names (e.g. "Id") to
  4426. // unconditionally include in API requests. By default, fields with
  4427. // empty values are omitted from API requests. However, any non-pointer,
  4428. // non-interface field appearing in ForceSendFields will be sent to the
  4429. // server regardless of whether the field is empty or not. This may be
  4430. // used to include empty fields in Patch requests.
  4431. ForceSendFields []string `json:"-"`
  4432. // NullFields is a list of field names (e.g. "Id") to include in API
  4433. // requests with the JSON null value. By default, fields with empty
  4434. // values are omitted from API requests. However, any field with an
  4435. // empty value appearing in NullFields will be sent to the server as
  4436. // null. It is an error if a field in this list has a non-empty value.
  4437. // This may be used to include null fields in Patch requests.
  4438. NullFields []string `json:"-"`
  4439. }
  4440. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4441. type NoMethod CreativeFieldValue
  4442. raw := NoMethod(*s)
  4443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4444. }
  4445. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4446. type CreativeFieldValuesListResponse struct {
  4447. // CreativeFieldValues: Creative field value collection.
  4448. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4449. // Kind: Identifies what kind of resource this is. Value: the fixed
  4450. // string "dfareporting#creativeFieldValuesListResponse".
  4451. Kind string `json:"kind,omitempty"`
  4452. // NextPageToken: Pagination token to be used for the next list
  4453. // operation.
  4454. NextPageToken string `json:"nextPageToken,omitempty"`
  4455. // ServerResponse contains the HTTP response code and headers from the
  4456. // server.
  4457. googleapi.ServerResponse `json:"-"`
  4458. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4459. // to unconditionally include in API requests. By default, fields with
  4460. // empty values are omitted from API requests. However, any non-pointer,
  4461. // non-interface field appearing in ForceSendFields will be sent to the
  4462. // server regardless of whether the field is empty or not. This may be
  4463. // used to include empty fields in Patch requests.
  4464. ForceSendFields []string `json:"-"`
  4465. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4466. // include in API requests with the JSON null value. By default, fields
  4467. // with empty values are omitted from API requests. However, any field
  4468. // with an empty value appearing in NullFields will be sent to the
  4469. // server as null. It is an error if a field in this list has a
  4470. // non-empty value. This may be used to include null fields in Patch
  4471. // requests.
  4472. NullFields []string `json:"-"`
  4473. }
  4474. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4475. type NoMethod CreativeFieldValuesListResponse
  4476. raw := NoMethod(*s)
  4477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4478. }
  4479. // CreativeFieldsListResponse: Creative Field List Response
  4480. type CreativeFieldsListResponse struct {
  4481. // CreativeFields: Creative field collection.
  4482. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4483. // Kind: Identifies what kind of resource this is. Value: the fixed
  4484. // string "dfareporting#creativeFieldsListResponse".
  4485. Kind string `json:"kind,omitempty"`
  4486. // NextPageToken: Pagination token to be used for the next list
  4487. // operation.
  4488. NextPageToken string `json:"nextPageToken,omitempty"`
  4489. // ServerResponse contains the HTTP response code and headers from the
  4490. // server.
  4491. googleapi.ServerResponse `json:"-"`
  4492. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4493. // unconditionally include in API requests. By default, fields with
  4494. // empty values are omitted from API requests. However, any non-pointer,
  4495. // non-interface field appearing in ForceSendFields will be sent to the
  4496. // server regardless of whether the field is empty or not. This may be
  4497. // used to include empty fields in Patch requests.
  4498. ForceSendFields []string `json:"-"`
  4499. // NullFields is a list of field names (e.g. "CreativeFields") to
  4500. // include in API requests with the JSON null value. By default, fields
  4501. // with empty values are omitted from API requests. However, any field
  4502. // with an empty value appearing in NullFields will be sent to the
  4503. // server as null. It is an error if a field in this list has a
  4504. // non-empty value. This may be used to include null fields in Patch
  4505. // requests.
  4506. NullFields []string `json:"-"`
  4507. }
  4508. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4509. type NoMethod CreativeFieldsListResponse
  4510. raw := NoMethod(*s)
  4511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4512. }
  4513. // CreativeGroup: Contains properties of a creative group.
  4514. type CreativeGroup struct {
  4515. // AccountId: Account ID of this creative group. This is a read-only
  4516. // field that can be left blank.
  4517. AccountId int64 `json:"accountId,omitempty,string"`
  4518. // AdvertiserId: Advertiser ID of this creative group. This is a
  4519. // required field on insertion.
  4520. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4521. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4522. // advertiser. This is a read-only, auto-generated field.
  4523. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4524. // GroupNumber: Subgroup of the creative group. Assign your creative
  4525. // groups to a subgroup in order to filter or manage them more easily.
  4526. // This field is required on insertion and is read-only after insertion.
  4527. // Acceptable values are 1 to 2, inclusive.
  4528. GroupNumber int64 `json:"groupNumber,omitempty"`
  4529. // Id: ID of this creative group. This is a read-only, auto-generated
  4530. // field.
  4531. Id int64 `json:"id,omitempty,string"`
  4532. // Kind: Identifies what kind of resource this is. Value: the fixed
  4533. // string "dfareporting#creativeGroup".
  4534. Kind string `json:"kind,omitempty"`
  4535. // Name: Name of this creative group. This is a required field and must
  4536. // be less than 256 characters long and unique among creative groups of
  4537. // the same advertiser.
  4538. Name string `json:"name,omitempty"`
  4539. // SubaccountId: Subaccount ID of this creative group. This is a
  4540. // read-only field that can be left blank.
  4541. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4542. // ServerResponse contains the HTTP response code and headers from the
  4543. // server.
  4544. googleapi.ServerResponse `json:"-"`
  4545. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4546. // unconditionally include in API requests. By default, fields with
  4547. // empty values are omitted from API requests. However, any non-pointer,
  4548. // non-interface field appearing in ForceSendFields will be sent to the
  4549. // server regardless of whether the field is empty or not. This may be
  4550. // used to include empty fields in Patch requests.
  4551. ForceSendFields []string `json:"-"`
  4552. // NullFields is a list of field names (e.g. "AccountId") to include in
  4553. // API requests with the JSON null value. By default, fields with empty
  4554. // values are omitted from API requests. However, any field with an
  4555. // empty value appearing in NullFields will be sent to the server as
  4556. // null. It is an error if a field in this list has a non-empty value.
  4557. // This may be used to include null fields in Patch requests.
  4558. NullFields []string `json:"-"`
  4559. }
  4560. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4561. type NoMethod CreativeGroup
  4562. raw := NoMethod(*s)
  4563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4564. }
  4565. // CreativeGroupAssignment: Creative Group Assignment.
  4566. type CreativeGroupAssignment struct {
  4567. // CreativeGroupId: ID of the creative group to be assigned.
  4568. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4569. // CreativeGroupNumber: Creative group number of the creative group
  4570. // assignment.
  4571. //
  4572. // Possible values:
  4573. // "CREATIVE_GROUP_ONE"
  4574. // "CREATIVE_GROUP_TWO"
  4575. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4576. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4577. // unconditionally include in API requests. By default, fields with
  4578. // empty values are omitted from API requests. However, any non-pointer,
  4579. // non-interface field appearing in ForceSendFields will be sent to the
  4580. // server regardless of whether the field is empty or not. This may be
  4581. // used to include empty fields in Patch requests.
  4582. ForceSendFields []string `json:"-"`
  4583. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4584. // include in API requests with the JSON null value. By default, fields
  4585. // with empty values are omitted from API requests. However, any field
  4586. // with an empty value appearing in NullFields will be sent to the
  4587. // server as null. It is an error if a field in this list has a
  4588. // non-empty value. This may be used to include null fields in Patch
  4589. // requests.
  4590. NullFields []string `json:"-"`
  4591. }
  4592. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4593. type NoMethod CreativeGroupAssignment
  4594. raw := NoMethod(*s)
  4595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4596. }
  4597. // CreativeGroupsListResponse: Creative Group List Response
  4598. type CreativeGroupsListResponse struct {
  4599. // CreativeGroups: Creative group collection.
  4600. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4601. // Kind: Identifies what kind of resource this is. Value: the fixed
  4602. // string "dfareporting#creativeGroupsListResponse".
  4603. Kind string `json:"kind,omitempty"`
  4604. // NextPageToken: Pagination token to be used for the next list
  4605. // operation.
  4606. NextPageToken string `json:"nextPageToken,omitempty"`
  4607. // ServerResponse contains the HTTP response code and headers from the
  4608. // server.
  4609. googleapi.ServerResponse `json:"-"`
  4610. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4611. // unconditionally include in API requests. By default, fields with
  4612. // empty values are omitted from API requests. However, any non-pointer,
  4613. // non-interface field appearing in ForceSendFields will be sent to the
  4614. // server regardless of whether the field is empty or not. This may be
  4615. // used to include empty fields in Patch requests.
  4616. ForceSendFields []string `json:"-"`
  4617. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4618. // include in API requests with the JSON null value. By default, fields
  4619. // with empty values are omitted from API requests. However, any field
  4620. // with an empty value appearing in NullFields will be sent to the
  4621. // server as null. It is an error if a field in this list has a
  4622. // non-empty value. This may be used to include null fields in Patch
  4623. // requests.
  4624. NullFields []string `json:"-"`
  4625. }
  4626. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4627. type NoMethod CreativeGroupsListResponse
  4628. raw := NoMethod(*s)
  4629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4630. }
  4631. // CreativeOptimizationConfiguration: Creative optimization settings.
  4632. type CreativeOptimizationConfiguration struct {
  4633. // Id: ID of this creative optimization config. This field is
  4634. // auto-generated when the campaign is inserted or updated. It can be
  4635. // null for existing campaigns.
  4636. Id int64 `json:"id,omitempty,string"`
  4637. // Name: Name of this creative optimization config. This is a required
  4638. // field and must be less than 129 characters long.
  4639. Name string `json:"name,omitempty"`
  4640. // OptimizationActivitys: List of optimization activities associated
  4641. // with this configuration.
  4642. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4643. // OptimizationModel: Optimization model for this configuration.
  4644. //
  4645. // Possible values:
  4646. // "CLICK"
  4647. // "POST_CLICK"
  4648. // "POST_CLICK_AND_IMPRESSION"
  4649. // "POST_IMPRESSION"
  4650. // "VIDEO_COMPLETION"
  4651. OptimizationModel string `json:"optimizationModel,omitempty"`
  4652. // ForceSendFields is a list of field names (e.g. "Id") to
  4653. // unconditionally include in API requests. By default, fields with
  4654. // empty values are omitted from API requests. However, any non-pointer,
  4655. // non-interface field appearing in ForceSendFields will be sent to the
  4656. // server regardless of whether the field is empty or not. This may be
  4657. // used to include empty fields in Patch requests.
  4658. ForceSendFields []string `json:"-"`
  4659. // NullFields is a list of field names (e.g. "Id") to include in API
  4660. // requests with the JSON null value. By default, fields with empty
  4661. // values are omitted from API requests. However, any field with an
  4662. // empty value appearing in NullFields will be sent to the server as
  4663. // null. It is an error if a field in this list has a non-empty value.
  4664. // This may be used to include null fields in Patch requests.
  4665. NullFields []string `json:"-"`
  4666. }
  4667. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4668. type NoMethod CreativeOptimizationConfiguration
  4669. raw := NoMethod(*s)
  4670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4671. }
  4672. // CreativeRotation: Creative Rotation.
  4673. type CreativeRotation struct {
  4674. // CreativeAssignments: Creative assignments in this creative rotation.
  4675. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4676. // CreativeOptimizationConfigurationId: Creative optimization
  4677. // configuration that is used by this ad. It should refer to one of the
  4678. // existing optimization configurations in the ad's campaign. If it is
  4679. // unset or set to 0, then the campaign's default optimization
  4680. // configuration will be used for this ad.
  4681. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4682. // Type: Type of creative rotation. Can be used to specify whether to
  4683. // use sequential or random rotation.
  4684. //
  4685. // Possible values:
  4686. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4687. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4688. Type string `json:"type,omitempty"`
  4689. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4690. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4691. //
  4692. // Possible values:
  4693. // "WEIGHT_STRATEGY_CUSTOM"
  4694. // "WEIGHT_STRATEGY_EQUAL"
  4695. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4696. // "WEIGHT_STRATEGY_OPTIMIZED"
  4697. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4698. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4699. // to unconditionally include in API requests. By default, fields with
  4700. // empty values are omitted from API requests. However, any non-pointer,
  4701. // non-interface field appearing in ForceSendFields will be sent to the
  4702. // server regardless of whether the field is empty or not. This may be
  4703. // used to include empty fields in Patch requests.
  4704. ForceSendFields []string `json:"-"`
  4705. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4706. // include in API requests with the JSON null value. By default, fields
  4707. // with empty values are omitted from API requests. However, any field
  4708. // with an empty value appearing in NullFields will be sent to the
  4709. // server as null. It is an error if a field in this list has a
  4710. // non-empty value. This may be used to include null fields in Patch
  4711. // requests.
  4712. NullFields []string `json:"-"`
  4713. }
  4714. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4715. type NoMethod CreativeRotation
  4716. raw := NoMethod(*s)
  4717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4718. }
  4719. // CreativeSettings: Creative Settings
  4720. type CreativeSettings struct {
  4721. // IFrameFooter: Header text for iFrames for this site. Must be less
  4722. // than or equal to 2000 characters long.
  4723. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4724. // IFrameHeader: Header text for iFrames for this site. Must be less
  4725. // than or equal to 2000 characters long.
  4726. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4727. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4728. // unconditionally include in API requests. By default, fields with
  4729. // empty values are omitted from API requests. However, any non-pointer,
  4730. // non-interface field appearing in ForceSendFields will be sent to the
  4731. // server regardless of whether the field is empty or not. This may be
  4732. // used to include empty fields in Patch requests.
  4733. ForceSendFields []string `json:"-"`
  4734. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4735. // in API requests with the JSON null value. By default, fields with
  4736. // empty values are omitted from API requests. However, any field with
  4737. // an empty value appearing in NullFields will be sent to the server as
  4738. // null. It is an error if a field in this list has a non-empty value.
  4739. // This may be used to include null fields in Patch requests.
  4740. NullFields []string `json:"-"`
  4741. }
  4742. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4743. type NoMethod CreativeSettings
  4744. raw := NoMethod(*s)
  4745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4746. }
  4747. // CreativesListResponse: Creative List Response
  4748. type CreativesListResponse struct {
  4749. // Creatives: Creative collection.
  4750. Creatives []*Creative `json:"creatives,omitempty"`
  4751. // Kind: Identifies what kind of resource this is. Value: the fixed
  4752. // string "dfareporting#creativesListResponse".
  4753. Kind string `json:"kind,omitempty"`
  4754. // NextPageToken: Pagination token to be used for the next list
  4755. // operation.
  4756. NextPageToken string `json:"nextPageToken,omitempty"`
  4757. // ServerResponse contains the HTTP response code and headers from the
  4758. // server.
  4759. googleapi.ServerResponse `json:"-"`
  4760. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4761. // unconditionally include in API requests. By default, fields with
  4762. // empty values are omitted from API requests. However, any non-pointer,
  4763. // non-interface field appearing in ForceSendFields will be sent to the
  4764. // server regardless of whether the field is empty or not. This may be
  4765. // used to include empty fields in Patch requests.
  4766. ForceSendFields []string `json:"-"`
  4767. // NullFields is a list of field names (e.g. "Creatives") to include in
  4768. // API requests with the JSON null value. By default, fields with empty
  4769. // values are omitted from API requests. However, any field with an
  4770. // empty value appearing in NullFields will be sent to the server as
  4771. // null. It is an error if a field in this list has a non-empty value.
  4772. // This may be used to include null fields in Patch requests.
  4773. NullFields []string `json:"-"`
  4774. }
  4775. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4776. type NoMethod CreativesListResponse
  4777. raw := NoMethod(*s)
  4778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4779. }
  4780. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4781. // compatible to be selected for a report of type
  4782. // "CROSS_DIMENSION_REACH".
  4783. type CrossDimensionReachReportCompatibleFields struct {
  4784. // Breakdown: Dimensions which are compatible to be selected in the
  4785. // "breakdown" section of the report.
  4786. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4787. // DimensionFilters: Dimensions which are compatible to be selected in
  4788. // the "dimensionFilters" section of the report.
  4789. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4790. // Kind: The kind of resource this is, in this case
  4791. // dfareporting#crossDimensionReachReportCompatibleFields.
  4792. Kind string `json:"kind,omitempty"`
  4793. // Metrics: Metrics which are compatible to be selected in the
  4794. // "metricNames" section of the report.
  4795. Metrics []*Metric `json:"metrics,omitempty"`
  4796. // OverlapMetrics: Metrics which are compatible to be selected in the
  4797. // "overlapMetricNames" section of the report.
  4798. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4799. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4800. // unconditionally include in API requests. By default, fields with
  4801. // empty values are omitted from API requests. However, any non-pointer,
  4802. // non-interface field appearing in ForceSendFields will be sent to the
  4803. // server regardless of whether the field is empty or not. This may be
  4804. // used to include empty fields in Patch requests.
  4805. ForceSendFields []string `json:"-"`
  4806. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4807. // API requests with the JSON null value. By default, fields with empty
  4808. // values are omitted from API requests. However, any field with an
  4809. // empty value appearing in NullFields will be sent to the server as
  4810. // null. It is an error if a field in this list has a non-empty value.
  4811. // This may be used to include null fields in Patch requests.
  4812. NullFields []string `json:"-"`
  4813. }
  4814. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4815. type NoMethod CrossDimensionReachReportCompatibleFields
  4816. raw := NoMethod(*s)
  4817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4818. }
  4819. // CustomFloodlightVariable: A custom floodlight variable.
  4820. type CustomFloodlightVariable struct {
  4821. // Kind: Identifies what kind of resource this is. Value: the fixed
  4822. // string "dfareporting#customFloodlightVariable".
  4823. Kind string `json:"kind,omitempty"`
  4824. // Type: The type of custom floodlight variable to supply a value for.
  4825. // These map to the "u[1-20]=" in the tags.
  4826. //
  4827. // Possible values:
  4828. // "U1"
  4829. // "U10"
  4830. // "U100"
  4831. // "U11"
  4832. // "U12"
  4833. // "U13"
  4834. // "U14"
  4835. // "U15"
  4836. // "U16"
  4837. // "U17"
  4838. // "U18"
  4839. // "U19"
  4840. // "U2"
  4841. // "U20"
  4842. // "U21"
  4843. // "U22"
  4844. // "U23"
  4845. // "U24"
  4846. // "U25"
  4847. // "U26"
  4848. // "U27"
  4849. // "U28"
  4850. // "U29"
  4851. // "U3"
  4852. // "U30"
  4853. // "U31"
  4854. // "U32"
  4855. // "U33"
  4856. // "U34"
  4857. // "U35"
  4858. // "U36"
  4859. // "U37"
  4860. // "U38"
  4861. // "U39"
  4862. // "U4"
  4863. // "U40"
  4864. // "U41"
  4865. // "U42"
  4866. // "U43"
  4867. // "U44"
  4868. // "U45"
  4869. // "U46"
  4870. // "U47"
  4871. // "U48"
  4872. // "U49"
  4873. // "U5"
  4874. // "U50"
  4875. // "U51"
  4876. // "U52"
  4877. // "U53"
  4878. // "U54"
  4879. // "U55"
  4880. // "U56"
  4881. // "U57"
  4882. // "U58"
  4883. // "U59"
  4884. // "U6"
  4885. // "U60"
  4886. // "U61"
  4887. // "U62"
  4888. // "U63"
  4889. // "U64"
  4890. // "U65"
  4891. // "U66"
  4892. // "U67"
  4893. // "U68"
  4894. // "U69"
  4895. // "U7"
  4896. // "U70"
  4897. // "U71"
  4898. // "U72"
  4899. // "U73"
  4900. // "U74"
  4901. // "U75"
  4902. // "U76"
  4903. // "U77"
  4904. // "U78"
  4905. // "U79"
  4906. // "U8"
  4907. // "U80"
  4908. // "U81"
  4909. // "U82"
  4910. // "U83"
  4911. // "U84"
  4912. // "U85"
  4913. // "U86"
  4914. // "U87"
  4915. // "U88"
  4916. // "U89"
  4917. // "U9"
  4918. // "U90"
  4919. // "U91"
  4920. // "U92"
  4921. // "U93"
  4922. // "U94"
  4923. // "U95"
  4924. // "U96"
  4925. // "U97"
  4926. // "U98"
  4927. // "U99"
  4928. Type string `json:"type,omitempty"`
  4929. // Value: The value of the custom floodlight variable. The length of
  4930. // string must not exceed 50 characters.
  4931. Value string `json:"value,omitempty"`
  4932. // ForceSendFields is a list of field names (e.g. "Kind") to
  4933. // unconditionally include in API requests. By default, fields with
  4934. // empty values are omitted from API requests. However, any non-pointer,
  4935. // non-interface field appearing in ForceSendFields will be sent to the
  4936. // server regardless of whether the field is empty or not. This may be
  4937. // used to include empty fields in Patch requests.
  4938. ForceSendFields []string `json:"-"`
  4939. // NullFields is a list of field names (e.g. "Kind") to include in API
  4940. // requests with the JSON null value. By default, fields with empty
  4941. // values are omitted from API requests. However, any field with an
  4942. // empty value appearing in NullFields will be sent to the server as
  4943. // null. It is an error if a field in this list has a non-empty value.
  4944. // This may be used to include null fields in Patch requests.
  4945. NullFields []string `json:"-"`
  4946. }
  4947. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4948. type NoMethod CustomFloodlightVariable
  4949. raw := NoMethod(*s)
  4950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4951. }
  4952. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4953. type CustomRichMediaEvents struct {
  4954. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4955. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4956. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4957. // Kind: The kind of resource this is, in this case
  4958. // dfareporting#customRichMediaEvents.
  4959. Kind string `json:"kind,omitempty"`
  4960. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4961. // unconditionally include in API requests. By default, fields with
  4962. // empty values are omitted from API requests. However, any non-pointer,
  4963. // non-interface field appearing in ForceSendFields will be sent to the
  4964. // server regardless of whether the field is empty or not. This may be
  4965. // used to include empty fields in Patch requests.
  4966. ForceSendFields []string `json:"-"`
  4967. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4968. // include in API requests with the JSON null value. By default, fields
  4969. // with empty values are omitted from API requests. However, any field
  4970. // with an empty value appearing in NullFields will be sent to the
  4971. // server as null. It is an error if a field in this list has a
  4972. // non-empty value. This may be used to include null fields in Patch
  4973. // requests.
  4974. NullFields []string `json:"-"`
  4975. }
  4976. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4977. type NoMethod CustomRichMediaEvents
  4978. raw := NoMethod(*s)
  4979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4980. }
  4981. // DateRange: Represents a date range.
  4982. type DateRange struct {
  4983. // EndDate: The end date of the date range, inclusive. A string of the
  4984. // format: "yyyy-MM-dd".
  4985. EndDate string `json:"endDate,omitempty"`
  4986. // Kind: The kind of resource this is, in this case
  4987. // dfareporting#dateRange.
  4988. Kind string `json:"kind,omitempty"`
  4989. // RelativeDateRange: The date range relative to the date of when the
  4990. // report is run.
  4991. //
  4992. // Possible values:
  4993. // "LAST_14_DAYS"
  4994. // "LAST_24_MONTHS"
  4995. // "LAST_30_DAYS"
  4996. // "LAST_365_DAYS"
  4997. // "LAST_60_DAYS"
  4998. // "LAST_7_DAYS"
  4999. // "LAST_90_DAYS"
  5000. // "MONTH_TO_DATE"
  5001. // "PREVIOUS_MONTH"
  5002. // "PREVIOUS_QUARTER"
  5003. // "PREVIOUS_WEEK"
  5004. // "PREVIOUS_YEAR"
  5005. // "QUARTER_TO_DATE"
  5006. // "TODAY"
  5007. // "WEEK_TO_DATE"
  5008. // "YEAR_TO_DATE"
  5009. // "YESTERDAY"
  5010. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  5011. // StartDate: The start date of the date range, inclusive. A string of
  5012. // the format: "yyyy-MM-dd".
  5013. StartDate string `json:"startDate,omitempty"`
  5014. // ForceSendFields is a list of field names (e.g. "EndDate") to
  5015. // unconditionally include in API requests. By default, fields with
  5016. // empty values are omitted from API requests. However, any non-pointer,
  5017. // non-interface field appearing in ForceSendFields will be sent to the
  5018. // server regardless of whether the field is empty or not. This may be
  5019. // used to include empty fields in Patch requests.
  5020. ForceSendFields []string `json:"-"`
  5021. // NullFields is a list of field names (e.g. "EndDate") to include in
  5022. // API requests with the JSON null value. By default, fields with empty
  5023. // values are omitted from API requests. However, any field with an
  5024. // empty value appearing in NullFields will be sent to the server as
  5025. // null. It is an error if a field in this list has a non-empty value.
  5026. // This may be used to include null fields in Patch requests.
  5027. NullFields []string `json:"-"`
  5028. }
  5029. func (s *DateRange) MarshalJSON() ([]byte, error) {
  5030. type NoMethod DateRange
  5031. raw := NoMethod(*s)
  5032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5033. }
  5034. // DayPartTargeting: Day Part Targeting.
  5035. type DayPartTargeting struct {
  5036. // DaysOfWeek: Days of the week when the ad will serve.
  5037. //
  5038. // Acceptable values are:
  5039. // - "SUNDAY"
  5040. // - "MONDAY"
  5041. // - "TUESDAY"
  5042. // - "WEDNESDAY"
  5043. // - "THURSDAY"
  5044. // - "FRIDAY"
  5045. // - "SATURDAY"
  5046. //
  5047. // Possible values:
  5048. // "FRIDAY"
  5049. // "MONDAY"
  5050. // "SATURDAY"
  5051. // "SUNDAY"
  5052. // "THURSDAY"
  5053. // "TUESDAY"
  5054. // "WEDNESDAY"
  5055. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  5056. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  5057. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  5058. // days of week, in which case the ad would serve during these hours on
  5059. // the specified days. For example if Monday, Wednesday, Friday are the
  5060. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  5061. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  5062. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  5063. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  5064. // UserLocalTime: Whether or not to use the user's local time. If false,
  5065. // the America/New York time zone applies.
  5066. UserLocalTime bool `json:"userLocalTime,omitempty"`
  5067. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  5068. // unconditionally include in API requests. By default, fields with
  5069. // empty values are omitted from API requests. However, any non-pointer,
  5070. // non-interface field appearing in ForceSendFields will be sent to the
  5071. // server regardless of whether the field is empty or not. This may be
  5072. // used to include empty fields in Patch requests.
  5073. ForceSendFields []string `json:"-"`
  5074. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  5075. // API requests with the JSON null value. By default, fields with empty
  5076. // values are omitted from API requests. However, any field with an
  5077. // empty value appearing in NullFields will be sent to the server as
  5078. // null. It is an error if a field in this list has a non-empty value.
  5079. // This may be used to include null fields in Patch requests.
  5080. NullFields []string `json:"-"`
  5081. }
  5082. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  5083. type NoMethod DayPartTargeting
  5084. raw := NoMethod(*s)
  5085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5086. }
  5087. // DeepLink: Contains information about a landing page deep link.
  5088. type DeepLink struct {
  5089. // AppUrl: The URL of the mobile app being linked to.
  5090. AppUrl string `json:"appUrl,omitempty"`
  5091. // FallbackUrl: The fallback URL. This URL will be served to users who
  5092. // do not have the mobile app installed.
  5093. FallbackUrl string `json:"fallbackUrl,omitempty"`
  5094. // Kind: Identifies what kind of resource this is. Value: the fixed
  5095. // string "dfareporting#deepLink".
  5096. Kind string `json:"kind,omitempty"`
  5097. // MobileApp: The mobile app targeted by this deep link.
  5098. MobileApp *MobileApp `json:"mobileApp,omitempty"`
  5099. // RemarketingListIds: Ads served to users on these remarketing lists
  5100. // will use this deep link. Applicable when mobileApp.directory is
  5101. // APPLE_APP_STORE.
  5102. RemarketingListIds googleapi.Int64s `json:"remarketingListIds,omitempty"`
  5103. // ForceSendFields is a list of field names (e.g. "AppUrl") to
  5104. // unconditionally include in API requests. By default, fields with
  5105. // empty values are omitted from API requests. However, any non-pointer,
  5106. // non-interface field appearing in ForceSendFields will be sent to the
  5107. // server regardless of whether the field is empty or not. This may be
  5108. // used to include empty fields in Patch requests.
  5109. ForceSendFields []string `json:"-"`
  5110. // NullFields is a list of field names (e.g. "AppUrl") to include in API
  5111. // requests with the JSON null value. By default, fields with empty
  5112. // values are omitted from API requests. However, any field with an
  5113. // empty value appearing in NullFields will be sent to the server as
  5114. // null. It is an error if a field in this list has a non-empty value.
  5115. // This may be used to include null fields in Patch requests.
  5116. NullFields []string `json:"-"`
  5117. }
  5118. func (s *DeepLink) MarshalJSON() ([]byte, error) {
  5119. type NoMethod DeepLink
  5120. raw := NoMethod(*s)
  5121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5122. }
  5123. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  5124. // overriding the default click-through event tag. A campaign may
  5125. // override the event tag defined at the advertiser level, and an ad may
  5126. // also override the campaign's setting further.
  5127. type DefaultClickThroughEventTagProperties struct {
  5128. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  5129. // apply to all ads in this entity's scope.
  5130. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  5131. // OverrideInheritedEventTag: Whether this entity should override the
  5132. // inherited default click-through event tag with its own defined value.
  5133. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  5134. // ForceSendFields is a list of field names (e.g.
  5135. // "DefaultClickThroughEventTagId") to unconditionally include in API
  5136. // requests. By default, fields with empty values are omitted from API
  5137. // requests. However, any non-pointer, non-interface field appearing in
  5138. // ForceSendFields will be sent to the server regardless of whether the
  5139. // field is empty or not. This may be used to include empty fields in
  5140. // Patch requests.
  5141. ForceSendFields []string `json:"-"`
  5142. // NullFields is a list of field names (e.g.
  5143. // "DefaultClickThroughEventTagId") to include in API requests with the
  5144. // JSON null value. By default, fields with empty values are omitted
  5145. // from API requests. However, any field with an empty value appearing
  5146. // in NullFields will be sent to the server as null. It is an error if a
  5147. // field in this list has a non-empty value. This may be used to include
  5148. // null fields in Patch requests.
  5149. NullFields []string `json:"-"`
  5150. }
  5151. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  5152. type NoMethod DefaultClickThroughEventTagProperties
  5153. raw := NoMethod(*s)
  5154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5155. }
  5156. // DeliverySchedule: Delivery Schedule.
  5157. type DeliverySchedule struct {
  5158. // FrequencyCap: Limit on the number of times an individual user can be
  5159. // served the ad within a specified period of time.
  5160. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  5161. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  5162. // will not serve after the end date and time. Otherwise the ad will
  5163. // continue to be served until it has reached its delivery goals.
  5164. HardCutoff bool `json:"hardCutoff,omitempty"`
  5165. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  5166. // how often each ad is served relative to the others. For example, if
  5167. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  5168. // 3, then Campaign Manager will serve ad B three times as often as ad
  5169. // A. Acceptable values are 1 to 10, inclusive.
  5170. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  5171. // Priority: Serving priority of an ad, with respect to other ads. The
  5172. // lower the priority number, the greater the priority with which it is
  5173. // served.
  5174. //
  5175. // Possible values:
  5176. // "AD_PRIORITY_01"
  5177. // "AD_PRIORITY_02"
  5178. // "AD_PRIORITY_03"
  5179. // "AD_PRIORITY_04"
  5180. // "AD_PRIORITY_05"
  5181. // "AD_PRIORITY_06"
  5182. // "AD_PRIORITY_07"
  5183. // "AD_PRIORITY_08"
  5184. // "AD_PRIORITY_09"
  5185. // "AD_PRIORITY_10"
  5186. // "AD_PRIORITY_11"
  5187. // "AD_PRIORITY_12"
  5188. // "AD_PRIORITY_13"
  5189. // "AD_PRIORITY_14"
  5190. // "AD_PRIORITY_15"
  5191. // "AD_PRIORITY_16"
  5192. Priority string `json:"priority,omitempty"`
  5193. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  5194. // unconditionally include in API requests. By default, fields with
  5195. // empty values are omitted from API requests. However, any non-pointer,
  5196. // non-interface field appearing in ForceSendFields will be sent to the
  5197. // server regardless of whether the field is empty or not. This may be
  5198. // used to include empty fields in Patch requests.
  5199. ForceSendFields []string `json:"-"`
  5200. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  5201. // in API requests with the JSON null value. By default, fields with
  5202. // empty values are omitted from API requests. However, any field with
  5203. // an empty value appearing in NullFields will be sent to the server as
  5204. // null. It is an error if a field in this list has a non-empty value.
  5205. // This may be used to include null fields in Patch requests.
  5206. NullFields []string `json:"-"`
  5207. }
  5208. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  5209. type NoMethod DeliverySchedule
  5210. raw := NoMethod(*s)
  5211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5212. }
  5213. // DfpSettings: Google Ad Manager Settings
  5214. type DfpSettings struct {
  5215. // DfpNetworkCode: Ad Manager network code for this directory site.
  5216. DfpNetworkCode string `json:"dfpNetworkCode,omitempty"`
  5217. // DfpNetworkName: Ad Manager network name for this directory site.
  5218. DfpNetworkName string `json:"dfpNetworkName,omitempty"`
  5219. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  5220. // programmatic placements.
  5221. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  5222. // PubPaidPlacementAccepted: Whether this directory site accepts
  5223. // publisher-paid tags.
  5224. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  5225. // PublisherPortalOnly: Whether this directory site is available only
  5226. // via Publisher Portal.
  5227. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  5228. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  5229. // unconditionally include in API requests. By default, fields with
  5230. // empty values are omitted from API requests. However, any non-pointer,
  5231. // non-interface field appearing in ForceSendFields will be sent to the
  5232. // server regardless of whether the field is empty or not. This may be
  5233. // used to include empty fields in Patch requests.
  5234. ForceSendFields []string `json:"-"`
  5235. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  5236. // include in API requests with the JSON null value. By default, fields
  5237. // with empty values are omitted from API requests. However, any field
  5238. // with an empty value appearing in NullFields will be sent to the
  5239. // server as null. It is an error if a field in this list has a
  5240. // non-empty value. This may be used to include null fields in Patch
  5241. // requests.
  5242. NullFields []string `json:"-"`
  5243. }
  5244. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  5245. type NoMethod DfpSettings
  5246. raw := NoMethod(*s)
  5247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5248. }
  5249. // Dimension: Represents a dimension.
  5250. type Dimension struct {
  5251. // Kind: The kind of resource this is, in this case
  5252. // dfareporting#dimension.
  5253. Kind string `json:"kind,omitempty"`
  5254. // Name: The dimension name, e.g. dfa:advertiser
  5255. Name string `json:"name,omitempty"`
  5256. // ForceSendFields is a list of field names (e.g. "Kind") to
  5257. // unconditionally include in API requests. By default, fields with
  5258. // empty values are omitted from API requests. However, any non-pointer,
  5259. // non-interface field appearing in ForceSendFields will be sent to the
  5260. // server regardless of whether the field is empty or not. This may be
  5261. // used to include empty fields in Patch requests.
  5262. ForceSendFields []string `json:"-"`
  5263. // NullFields is a list of field names (e.g. "Kind") to include in API
  5264. // requests with the JSON null value. By default, fields with empty
  5265. // values are omitted from API requests. However, any field with an
  5266. // empty value appearing in NullFields will be sent to the server as
  5267. // null. It is an error if a field in this list has a non-empty value.
  5268. // This may be used to include null fields in Patch requests.
  5269. NullFields []string `json:"-"`
  5270. }
  5271. func (s *Dimension) MarshalJSON() ([]byte, error) {
  5272. type NoMethod Dimension
  5273. raw := NoMethod(*s)
  5274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5275. }
  5276. // DimensionFilter: Represents a dimension filter.
  5277. type DimensionFilter struct {
  5278. // DimensionName: The name of the dimension to filter.
  5279. DimensionName string `json:"dimensionName,omitempty"`
  5280. // Kind: The kind of resource this is, in this case
  5281. // dfareporting#dimensionFilter.
  5282. Kind string `json:"kind,omitempty"`
  5283. // Value: The value of the dimension to filter.
  5284. Value string `json:"value,omitempty"`
  5285. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5286. // unconditionally include in API requests. By default, fields with
  5287. // empty values are omitted from API requests. However, any non-pointer,
  5288. // non-interface field appearing in ForceSendFields will be sent to the
  5289. // server regardless of whether the field is empty or not. This may be
  5290. // used to include empty fields in Patch requests.
  5291. ForceSendFields []string `json:"-"`
  5292. // NullFields is a list of field names (e.g. "DimensionName") to include
  5293. // in API requests with the JSON null value. By default, fields with
  5294. // empty values are omitted from API requests. However, any field with
  5295. // an empty value appearing in NullFields will be sent to the server as
  5296. // null. It is an error if a field in this list has a non-empty value.
  5297. // This may be used to include null fields in Patch requests.
  5298. NullFields []string `json:"-"`
  5299. }
  5300. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  5301. type NoMethod DimensionFilter
  5302. raw := NoMethod(*s)
  5303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5304. }
  5305. // DimensionValue: Represents a DimensionValue resource.
  5306. type DimensionValue struct {
  5307. // DimensionName: The name of the dimension.
  5308. DimensionName string `json:"dimensionName,omitempty"`
  5309. // Etag: The eTag of this response for caching purposes.
  5310. Etag string `json:"etag,omitempty"`
  5311. // Id: The ID associated with the value if available.
  5312. Id string `json:"id,omitempty"`
  5313. // Kind: The kind of resource this is, in this case
  5314. // dfareporting#dimensionValue.
  5315. Kind string `json:"kind,omitempty"`
  5316. // MatchType: Determines how the 'value' field is matched when
  5317. // filtering. If not specified, defaults to EXACT. If set to
  5318. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  5319. // length character sequences, and it can be escaped with a backslash.
  5320. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  5321. // matchType other than EXACT.
  5322. //
  5323. // Possible values:
  5324. // "BEGINS_WITH"
  5325. // "CONTAINS"
  5326. // "EXACT"
  5327. // "WILDCARD_EXPRESSION"
  5328. MatchType string `json:"matchType,omitempty"`
  5329. // Value: The value of the dimension.
  5330. Value string `json:"value,omitempty"`
  5331. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5332. // unconditionally include in API requests. By default, fields with
  5333. // empty values are omitted from API requests. However, any non-pointer,
  5334. // non-interface field appearing in ForceSendFields will be sent to the
  5335. // server regardless of whether the field is empty or not. This may be
  5336. // used to include empty fields in Patch requests.
  5337. ForceSendFields []string `json:"-"`
  5338. // NullFields is a list of field names (e.g. "DimensionName") to include
  5339. // in API requests with the JSON null value. By default, fields with
  5340. // empty values are omitted from API requests. However, any field with
  5341. // an empty value appearing in NullFields will be sent to the server as
  5342. // null. It is an error if a field in this list has a non-empty value.
  5343. // This may be used to include null fields in Patch requests.
  5344. NullFields []string `json:"-"`
  5345. }
  5346. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5347. type NoMethod DimensionValue
  5348. raw := NoMethod(*s)
  5349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5350. }
  5351. // DimensionValueList: Represents the list of DimensionValue resources.
  5352. type DimensionValueList struct {
  5353. // Etag: The eTag of this response for caching purposes.
  5354. Etag string `json:"etag,omitempty"`
  5355. // Items: The dimension values returned in this response.
  5356. Items []*DimensionValue `json:"items,omitempty"`
  5357. // Kind: The kind of list this is, in this case
  5358. // dfareporting#dimensionValueList.
  5359. Kind string `json:"kind,omitempty"`
  5360. // NextPageToken: Continuation token used to page through dimension
  5361. // values. To retrieve the next page of results, set the next request's
  5362. // "pageToken" to the value of this field. The page token is only valid
  5363. // for a limited amount of time and should not be persisted.
  5364. NextPageToken string `json:"nextPageToken,omitempty"`
  5365. // ServerResponse contains the HTTP response code and headers from the
  5366. // server.
  5367. googleapi.ServerResponse `json:"-"`
  5368. // ForceSendFields is a list of field names (e.g. "Etag") to
  5369. // unconditionally include in API requests. By default, fields with
  5370. // empty values are omitted from API requests. However, any non-pointer,
  5371. // non-interface field appearing in ForceSendFields will be sent to the
  5372. // server regardless of whether the field is empty or not. This may be
  5373. // used to include empty fields in Patch requests.
  5374. ForceSendFields []string `json:"-"`
  5375. // NullFields is a list of field names (e.g. "Etag") to include in API
  5376. // requests with the JSON null value. By default, fields with empty
  5377. // values are omitted from API requests. However, any field with an
  5378. // empty value appearing in NullFields will be sent to the server as
  5379. // null. It is an error if a field in this list has a non-empty value.
  5380. // This may be used to include null fields in Patch requests.
  5381. NullFields []string `json:"-"`
  5382. }
  5383. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5384. type NoMethod DimensionValueList
  5385. raw := NoMethod(*s)
  5386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5387. }
  5388. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5389. type DimensionValueRequest struct {
  5390. // DimensionName: The name of the dimension for which values should be
  5391. // requested.
  5392. DimensionName string `json:"dimensionName,omitempty"`
  5393. // EndDate: The end date of the date range for which to retrieve
  5394. // dimension values. A string of the format "yyyy-MM-dd".
  5395. EndDate string `json:"endDate,omitempty"`
  5396. // Filters: The list of filters by which to filter values. The filters
  5397. // are ANDed.
  5398. Filters []*DimensionFilter `json:"filters,omitempty"`
  5399. // Kind: The kind of request this is, in this case
  5400. // dfareporting#dimensionValueRequest.
  5401. Kind string `json:"kind,omitempty"`
  5402. // StartDate: The start date of the date range for which to retrieve
  5403. // dimension values. A string of the format "yyyy-MM-dd".
  5404. StartDate string `json:"startDate,omitempty"`
  5405. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5406. // unconditionally include in API requests. By default, fields with
  5407. // empty values are omitted from API requests. However, any non-pointer,
  5408. // non-interface field appearing in ForceSendFields will be sent to the
  5409. // server regardless of whether the field is empty or not. This may be
  5410. // used to include empty fields in Patch requests.
  5411. ForceSendFields []string `json:"-"`
  5412. // NullFields is a list of field names (e.g. "DimensionName") to include
  5413. // in API requests with the JSON null value. By default, fields with
  5414. // empty values are omitted from API requests. However, any field with
  5415. // an empty value appearing in NullFields will be sent to the server as
  5416. // null. It is an error if a field in this list has a non-empty value.
  5417. // This may be used to include null fields in Patch requests.
  5418. NullFields []string `json:"-"`
  5419. }
  5420. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5421. type NoMethod DimensionValueRequest
  5422. raw := NoMethod(*s)
  5423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5424. }
  5425. // DirectorySite: DirectorySites contains properties of a website from
  5426. // the Site Directory. Sites need to be added to an account via the
  5427. // Sites resource before they can be assigned to a placement.
  5428. type DirectorySite struct {
  5429. // Active: Whether this directory site is active.
  5430. Active bool `json:"active,omitempty"`
  5431. // ContactAssignments: Directory site contacts.
  5432. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5433. // CountryId: Country ID of this directory site. This is a read-only
  5434. // field.
  5435. CountryId int64 `json:"countryId,omitempty,string"`
  5436. // CurrencyId: Currency ID of this directory site. This is a read-only
  5437. // field.
  5438. // Possible values are:
  5439. // - "1" for USD
  5440. // - "2" for GBP
  5441. // - "3" for ESP
  5442. // - "4" for SEK
  5443. // - "5" for CAD
  5444. // - "6" for JPY
  5445. // - "7" for DEM
  5446. // - "8" for AUD
  5447. // - "9" for FRF
  5448. // - "10" for ITL
  5449. // - "11" for DKK
  5450. // - "12" for NOK
  5451. // - "13" for FIM
  5452. // - "14" for ZAR
  5453. // - "15" for IEP
  5454. // - "16" for NLG
  5455. // - "17" for EUR
  5456. // - "18" for KRW
  5457. // - "19" for TWD
  5458. // - "20" for SGD
  5459. // - "21" for CNY
  5460. // - "22" for HKD
  5461. // - "23" for NZD
  5462. // - "24" for MYR
  5463. // - "25" for BRL
  5464. // - "26" for PTE
  5465. // - "27" for MXP
  5466. // - "28" for CLP
  5467. // - "29" for TRY
  5468. // - "30" for ARS
  5469. // - "31" for PEN
  5470. // - "32" for ILS
  5471. // - "33" for CHF
  5472. // - "34" for VEF
  5473. // - "35" for COP
  5474. // - "36" for GTQ
  5475. // - "37" for PLN
  5476. // - "39" for INR
  5477. // - "40" for THB
  5478. // - "41" for IDR
  5479. // - "42" for CZK
  5480. // - "43" for RON
  5481. // - "44" for HUF
  5482. // - "45" for RUB
  5483. // - "46" for AED
  5484. // - "47" for BGN
  5485. // - "48" for HRK
  5486. // - "49" for MXN
  5487. // - "50" for NGN
  5488. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5489. // Description: Description of this directory site. This is a read-only
  5490. // field.
  5491. Description string `json:"description,omitempty"`
  5492. // Id: ID of this directory site. This is a read-only, auto-generated
  5493. // field.
  5494. Id int64 `json:"id,omitempty,string"`
  5495. // IdDimensionValue: Dimension value for the ID of this directory site.
  5496. // This is a read-only, auto-generated field.
  5497. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5498. // InpageTagFormats: Tag types for regular placements.
  5499. //
  5500. // Acceptable values are:
  5501. // - "STANDARD"
  5502. // - "IFRAME_JAVASCRIPT_INPAGE"
  5503. // - "INTERNAL_REDIRECT_INPAGE"
  5504. // - "JAVASCRIPT_INPAGE"
  5505. //
  5506. // Possible values:
  5507. // "IFRAME_JAVASCRIPT_INPAGE"
  5508. // "INTERNAL_REDIRECT_INPAGE"
  5509. // "JAVASCRIPT_INPAGE"
  5510. // "STANDARD"
  5511. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5512. // InterstitialTagFormats: Tag types for interstitial
  5513. // placements.
  5514. //
  5515. // Acceptable values are:
  5516. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5517. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5518. // - "JAVASCRIPT_INTERSTITIAL"
  5519. //
  5520. // Possible values:
  5521. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5522. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5523. // "JAVASCRIPT_INTERSTITIAL"
  5524. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5525. // Kind: Identifies what kind of resource this is. Value: the fixed
  5526. // string "dfareporting#directorySite".
  5527. Kind string `json:"kind,omitempty"`
  5528. // Name: Name of this directory site.
  5529. Name string `json:"name,omitempty"`
  5530. // ParentId: Parent directory site ID.
  5531. ParentId int64 `json:"parentId,omitempty,string"`
  5532. // Settings: Directory site settings.
  5533. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5534. // Url: URL of this directory site.
  5535. Url string `json:"url,omitempty"`
  5536. // ServerResponse contains the HTTP response code and headers from the
  5537. // server.
  5538. googleapi.ServerResponse `json:"-"`
  5539. // ForceSendFields is a list of field names (e.g. "Active") to
  5540. // unconditionally include in API requests. By default, fields with
  5541. // empty values are omitted from API requests. However, any non-pointer,
  5542. // non-interface field appearing in ForceSendFields will be sent to the
  5543. // server regardless of whether the field is empty or not. This may be
  5544. // used to include empty fields in Patch requests.
  5545. ForceSendFields []string `json:"-"`
  5546. // NullFields is a list of field names (e.g. "Active") to include in API
  5547. // requests with the JSON null value. By default, fields with empty
  5548. // values are omitted from API requests. However, any field with an
  5549. // empty value appearing in NullFields will be sent to the server as
  5550. // null. It is an error if a field in this list has a non-empty value.
  5551. // This may be used to include null fields in Patch requests.
  5552. NullFields []string `json:"-"`
  5553. }
  5554. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5555. type NoMethod DirectorySite
  5556. raw := NoMethod(*s)
  5557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5558. }
  5559. // DirectorySiteContact: Contains properties of a Site Directory
  5560. // contact.
  5561. type DirectorySiteContact struct {
  5562. // Address: Address of this directory site contact.
  5563. Address string `json:"address,omitempty"`
  5564. // Email: Email address of this directory site contact.
  5565. Email string `json:"email,omitempty"`
  5566. // FirstName: First name of this directory site contact.
  5567. FirstName string `json:"firstName,omitempty"`
  5568. // Id: ID of this directory site contact. This is a read-only,
  5569. // auto-generated field.
  5570. Id int64 `json:"id,omitempty,string"`
  5571. // Kind: Identifies what kind of resource this is. Value: the fixed
  5572. // string "dfareporting#directorySiteContact".
  5573. Kind string `json:"kind,omitempty"`
  5574. // LastName: Last name of this directory site contact.
  5575. LastName string `json:"lastName,omitempty"`
  5576. // Phone: Phone number of this directory site contact.
  5577. Phone string `json:"phone,omitempty"`
  5578. // Role: Directory site contact role.
  5579. //
  5580. // Possible values:
  5581. // "ADMIN"
  5582. // "EDIT"
  5583. // "VIEW"
  5584. Role string `json:"role,omitempty"`
  5585. // Title: Title or designation of this directory site contact.
  5586. Title string `json:"title,omitempty"`
  5587. // Type: Directory site contact type.
  5588. //
  5589. // Possible values:
  5590. // "BILLING"
  5591. // "OTHER"
  5592. // "SALES"
  5593. // "TECHNICAL"
  5594. Type string `json:"type,omitempty"`
  5595. // ServerResponse contains the HTTP response code and headers from the
  5596. // server.
  5597. googleapi.ServerResponse `json:"-"`
  5598. // ForceSendFields is a list of field names (e.g. "Address") to
  5599. // unconditionally include in API requests. By default, fields with
  5600. // empty values are omitted from API requests. However, any non-pointer,
  5601. // non-interface field appearing in ForceSendFields will be sent to the
  5602. // server regardless of whether the field is empty or not. This may be
  5603. // used to include empty fields in Patch requests.
  5604. ForceSendFields []string `json:"-"`
  5605. // NullFields is a list of field names (e.g. "Address") to include in
  5606. // API requests with the JSON null value. By default, fields with empty
  5607. // values are omitted from API requests. However, any field with an
  5608. // empty value appearing in NullFields will be sent to the server as
  5609. // null. It is an error if a field in this list has a non-empty value.
  5610. // This may be used to include null fields in Patch requests.
  5611. NullFields []string `json:"-"`
  5612. }
  5613. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5614. type NoMethod DirectorySiteContact
  5615. raw := NoMethod(*s)
  5616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5617. }
  5618. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5619. type DirectorySiteContactAssignment struct {
  5620. // ContactId: ID of this directory site contact. This is a read-only,
  5621. // auto-generated field.
  5622. ContactId int64 `json:"contactId,omitempty,string"`
  5623. // Visibility: Visibility of this directory site contact assignment.
  5624. // When set to PUBLIC this contact assignment is visible to all account
  5625. // and agency users; when set to PRIVATE it is visible only to the site.
  5626. //
  5627. // Possible values:
  5628. // "PRIVATE"
  5629. // "PUBLIC"
  5630. Visibility string `json:"visibility,omitempty"`
  5631. // ForceSendFields is a list of field names (e.g. "ContactId") to
  5632. // unconditionally include in API requests. By default, fields with
  5633. // empty values are omitted from API requests. However, any non-pointer,
  5634. // non-interface field appearing in ForceSendFields will be sent to the
  5635. // server regardless of whether the field is empty or not. This may be
  5636. // used to include empty fields in Patch requests.
  5637. ForceSendFields []string `json:"-"`
  5638. // NullFields is a list of field names (e.g. "ContactId") to include in
  5639. // API requests with the JSON null value. By default, fields with empty
  5640. // values are omitted from API requests. However, any field with an
  5641. // empty value appearing in NullFields will be sent to the server as
  5642. // null. It is an error if a field in this list has a non-empty value.
  5643. // This may be used to include null fields in Patch requests.
  5644. NullFields []string `json:"-"`
  5645. }
  5646. func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5647. type NoMethod DirectorySiteContactAssignment
  5648. raw := NoMethod(*s)
  5649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5650. }
  5651. // DirectorySiteContactsListResponse: Directory Site Contact List
  5652. // Response
  5653. type DirectorySiteContactsListResponse struct {
  5654. // DirectorySiteContacts: Directory site contact collection
  5655. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5656. // Kind: Identifies what kind of resource this is. Value: the fixed
  5657. // string "dfareporting#directorySiteContactsListResponse".
  5658. Kind string `json:"kind,omitempty"`
  5659. // NextPageToken: Pagination token to be used for the next list
  5660. // operation.
  5661. NextPageToken string `json:"nextPageToken,omitempty"`
  5662. // ServerResponse contains the HTTP response code and headers from the
  5663. // server.
  5664. googleapi.ServerResponse `json:"-"`
  5665. // ForceSendFields is a list of field names (e.g.
  5666. // "DirectorySiteContacts") to unconditionally include in API requests.
  5667. // By default, fields with empty values are omitted from API requests.
  5668. // However, any non-pointer, non-interface field appearing in
  5669. // ForceSendFields will be sent to the server regardless of whether the
  5670. // field is empty or not. This may be used to include empty fields in
  5671. // Patch requests.
  5672. ForceSendFields []string `json:"-"`
  5673. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5674. // include in API requests with the JSON null value. By default, fields
  5675. // with empty values are omitted from API requests. However, any field
  5676. // with an empty value appearing in NullFields will be sent to the
  5677. // server as null. It is an error if a field in this list has a
  5678. // non-empty value. This may be used to include null fields in Patch
  5679. // requests.
  5680. NullFields []string `json:"-"`
  5681. }
  5682. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5683. type NoMethod DirectorySiteContactsListResponse
  5684. raw := NoMethod(*s)
  5685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5686. }
  5687. // DirectorySiteSettings: Directory Site Settings
  5688. type DirectorySiteSettings struct {
  5689. // ActiveViewOptOut: Whether this directory site has disabled active
  5690. // view creatives.
  5691. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5692. // DfpSettings: Directory site Ad Manager settings.
  5693. DfpSettings *DfpSettings `json:"dfpSettings,omitempty"`
  5694. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5695. // video ads.
  5696. InstreamVideoPlacementAccepted bool `json:"instreamVideoPlacementAccepted,omitempty"`
  5697. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5698. // ads.
  5699. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5700. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5701. // OCR reach ratings.
  5702. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5703. // VerificationTagOptOut: Whether this directory site has disabled
  5704. // generation of Verification ins tags.
  5705. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5706. // VideoActiveViewOptOut: Whether this directory site has disabled
  5707. // active view for in-stream video creatives. This is a read-only field.
  5708. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5709. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5710. // unconditionally include in API requests. By default, fields with
  5711. // empty values are omitted from API requests. However, any non-pointer,
  5712. // non-interface field appearing in ForceSendFields will be sent to the
  5713. // server regardless of whether the field is empty or not. This may be
  5714. // used to include empty fields in Patch requests.
  5715. ForceSendFields []string `json:"-"`
  5716. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5717. // include in API requests with the JSON null value. By default, fields
  5718. // with empty values are omitted from API requests. However, any field
  5719. // with an empty value appearing in NullFields will be sent to the
  5720. // server as null. It is an error if a field in this list has a
  5721. // non-empty value. This may be used to include null fields in Patch
  5722. // requests.
  5723. NullFields []string `json:"-"`
  5724. }
  5725. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5726. type NoMethod DirectorySiteSettings
  5727. raw := NoMethod(*s)
  5728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5729. }
  5730. // DirectorySitesListResponse: Directory Site List Response
  5731. type DirectorySitesListResponse struct {
  5732. // DirectorySites: Directory site collection.
  5733. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5734. // Kind: Identifies what kind of resource this is. Value: the fixed
  5735. // string "dfareporting#directorySitesListResponse".
  5736. Kind string `json:"kind,omitempty"`
  5737. // NextPageToken: Pagination token to be used for the next list
  5738. // operation.
  5739. NextPageToken string `json:"nextPageToken,omitempty"`
  5740. // ServerResponse contains the HTTP response code and headers from the
  5741. // server.
  5742. googleapi.ServerResponse `json:"-"`
  5743. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5744. // unconditionally include in API requests. By default, fields with
  5745. // empty values are omitted from API requests. However, any non-pointer,
  5746. // non-interface field appearing in ForceSendFields will be sent to the
  5747. // server regardless of whether the field is empty or not. This may be
  5748. // used to include empty fields in Patch requests.
  5749. ForceSendFields []string `json:"-"`
  5750. // NullFields is a list of field names (e.g. "DirectorySites") to
  5751. // include in API requests with the JSON null value. By default, fields
  5752. // with empty values are omitted from API requests. However, any field
  5753. // with an empty value appearing in NullFields will be sent to the
  5754. // server as null. It is an error if a field in this list has a
  5755. // non-empty value. This may be used to include null fields in Patch
  5756. // requests.
  5757. NullFields []string `json:"-"`
  5758. }
  5759. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5760. type NoMethod DirectorySitesListResponse
  5761. raw := NoMethod(*s)
  5762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5763. }
  5764. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5765. // Dynamic targeting keys are unique, user-friendly labels, created at
  5766. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5767. // and placements and used for targeting with Studio dynamic creatives.
  5768. // Use these labels instead of numeric Campaign Manager IDs (such as
  5769. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5770. type DynamicTargetingKey struct {
  5771. // Kind: Identifies what kind of resource this is. Value: the fixed
  5772. // string "dfareporting#dynamicTargetingKey".
  5773. Kind string `json:"kind,omitempty"`
  5774. // Name: Name of this dynamic targeting key. This is a required field.
  5775. // Must be less than 256 characters long and cannot contain commas. All
  5776. // characters are converted to lowercase.
  5777. Name string `json:"name,omitempty"`
  5778. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5779. // required field.
  5780. ObjectId int64 `json:"objectId,omitempty,string"`
  5781. // ObjectType: Type of the object of this dynamic targeting key. This is
  5782. // a required field.
  5783. //
  5784. // Possible values:
  5785. // "OBJECT_AD"
  5786. // "OBJECT_ADVERTISER"
  5787. // "OBJECT_CREATIVE"
  5788. // "OBJECT_PLACEMENT"
  5789. ObjectType string `json:"objectType,omitempty"`
  5790. // ServerResponse contains the HTTP response code and headers from the
  5791. // server.
  5792. googleapi.ServerResponse `json:"-"`
  5793. // ForceSendFields is a list of field names (e.g. "Kind") to
  5794. // unconditionally include in API requests. By default, fields with
  5795. // empty values are omitted from API requests. However, any non-pointer,
  5796. // non-interface field appearing in ForceSendFields will be sent to the
  5797. // server regardless of whether the field is empty or not. This may be
  5798. // used to include empty fields in Patch requests.
  5799. ForceSendFields []string `json:"-"`
  5800. // NullFields is a list of field names (e.g. "Kind") to include in API
  5801. // requests with the JSON null value. By default, fields with empty
  5802. // values are omitted from API requests. However, any field with an
  5803. // empty value appearing in NullFields will be sent to the server as
  5804. // null. It is an error if a field in this list has a non-empty value.
  5805. // This may be used to include null fields in Patch requests.
  5806. NullFields []string `json:"-"`
  5807. }
  5808. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5809. type NoMethod DynamicTargetingKey
  5810. raw := NoMethod(*s)
  5811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5812. }
  5813. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5814. type DynamicTargetingKeysListResponse struct {
  5815. // DynamicTargetingKeys: Dynamic targeting key collection.
  5816. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5817. // Kind: Identifies what kind of resource this is. Value: the fixed
  5818. // string "dfareporting#dynamicTargetingKeysListResponse".
  5819. Kind string `json:"kind,omitempty"`
  5820. // ServerResponse contains the HTTP response code and headers from the
  5821. // server.
  5822. googleapi.ServerResponse `json:"-"`
  5823. // ForceSendFields is a list of field names (e.g.
  5824. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5825. // By default, fields with empty values are omitted from API requests.
  5826. // However, any non-pointer, non-interface field appearing in
  5827. // ForceSendFields will be sent to the server regardless of whether the
  5828. // field is empty or not. This may be used to include empty fields in
  5829. // Patch requests.
  5830. ForceSendFields []string `json:"-"`
  5831. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5832. // include in API requests with the JSON null value. By default, fields
  5833. // with empty values are omitted from API requests. However, any field
  5834. // with an empty value appearing in NullFields will be sent to the
  5835. // server as null. It is an error if a field in this list has a
  5836. // non-empty value. This may be used to include null fields in Patch
  5837. // requests.
  5838. NullFields []string `json:"-"`
  5839. }
  5840. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5841. type NoMethod DynamicTargetingKeysListResponse
  5842. raw := NoMethod(*s)
  5843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5844. }
  5845. // EncryptionInfo: A description of how user IDs are encrypted.
  5846. type EncryptionInfo struct {
  5847. // EncryptionEntityId: The encryption entity ID. This should match the
  5848. // encryption configuration for ad serving or Data Transfer.
  5849. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5850. // EncryptionEntityType: The encryption entity type. This should match
  5851. // the encryption configuration for ad serving or Data Transfer.
  5852. //
  5853. // Possible values:
  5854. // "ADWORDS_CUSTOMER"
  5855. // "DBM_ADVERTISER"
  5856. // "DBM_PARTNER"
  5857. // "DCM_ACCOUNT"
  5858. // "DCM_ADVERTISER"
  5859. // "DFP_NETWORK_CODE"
  5860. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5861. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5862. // EncryptionSource: Describes whether the encrypted cookie was received
  5863. // from ad serving (the %m macro) or from Data Transfer.
  5864. //
  5865. // Possible values:
  5866. // "AD_SERVING"
  5867. // "DATA_TRANSFER"
  5868. // "ENCRYPTION_SCOPE_UNKNOWN"
  5869. EncryptionSource string `json:"encryptionSource,omitempty"`
  5870. // Kind: Identifies what kind of resource this is. Value: the fixed
  5871. // string "dfareporting#encryptionInfo".
  5872. Kind string `json:"kind,omitempty"`
  5873. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5874. // to unconditionally include in API requests. By default, fields with
  5875. // empty values are omitted from API requests. However, any non-pointer,
  5876. // non-interface field appearing in ForceSendFields will be sent to the
  5877. // server regardless of whether the field is empty or not. This may be
  5878. // used to include empty fields in Patch requests.
  5879. ForceSendFields []string `json:"-"`
  5880. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5881. // include in API requests with the JSON null value. By default, fields
  5882. // with empty values are omitted from API requests. However, any field
  5883. // with an empty value appearing in NullFields will be sent to the
  5884. // server as null. It is an error if a field in this list has a
  5885. // non-empty value. This may be used to include null fields in Patch
  5886. // requests.
  5887. NullFields []string `json:"-"`
  5888. }
  5889. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5890. type NoMethod EncryptionInfo
  5891. raw := NoMethod(*s)
  5892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5893. }
  5894. // EventTag: Contains properties of an event tag.
  5895. type EventTag struct {
  5896. // AccountId: Account ID of this event tag. This is a read-only field
  5897. // that can be left blank.
  5898. AccountId int64 `json:"accountId,omitempty,string"`
  5899. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5900. // campaignId field is required on insertion.
  5901. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5902. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5903. // advertiser. This is a read-only, auto-generated field.
  5904. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5905. // CampaignId: Campaign ID of this event tag. This field or the
  5906. // advertiserId field is required on insertion.
  5907. CampaignId int64 `json:"campaignId,omitempty,string"`
  5908. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5909. // This is a read-only, auto-generated field.
  5910. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5911. // EnabledByDefault: Whether this event tag should be automatically
  5912. // enabled for all of the advertiser's campaigns and ads.
  5913. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5914. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5915. // that are trafficked through Display & Video 360 to Ad Exchange. This
  5916. // may be useful if the event tag uses a pixel that is unapproved for Ad
  5917. // Exchange bids on one or more networks, such as the Google Display
  5918. // Network.
  5919. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5920. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5921. Id int64 `json:"id,omitempty,string"`
  5922. // Kind: Identifies what kind of resource this is. Value: the fixed
  5923. // string "dfareporting#eventTag".
  5924. Kind string `json:"kind,omitempty"`
  5925. // Name: Name of this event tag. This is a required field and must be
  5926. // less than 256 characters long.
  5927. Name string `json:"name,omitempty"`
  5928. // SiteFilterType: Site filter type for this event tag. If no type is
  5929. // specified then the event tag will be applied to all sites.
  5930. //
  5931. // Possible values:
  5932. // "BLACKLIST"
  5933. // "WHITELIST"
  5934. SiteFilterType string `json:"siteFilterType,omitempty"`
  5935. // SiteIds: Filter list of site IDs associated with this event tag. The
  5936. // siteFilterType determines whether this is a whitelist or blacklist
  5937. // filter.
  5938. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5939. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5940. // read-only field.
  5941. SslCompliant bool `json:"sslCompliant,omitempty"`
  5942. // Status: Status of this event tag. Must be ENABLED for this event tag
  5943. // to fire. This is a required field.
  5944. //
  5945. // Possible values:
  5946. // "DISABLED"
  5947. // "ENABLED"
  5948. Status string `json:"status,omitempty"`
  5949. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5950. // field that can be left blank.
  5951. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5952. // Type: Event tag type. Can be used to specify whether to use a
  5953. // third-party pixel, a third-party JavaScript URL, or a third-party
  5954. // click-through URL for either impression or click tracking. This is a
  5955. // required field.
  5956. //
  5957. // Possible values:
  5958. // "CLICK_THROUGH_EVENT_TAG"
  5959. // "IMPRESSION_IMAGE_EVENT_TAG"
  5960. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5961. Type string `json:"type,omitempty"`
  5962. // Url: Payload URL for this event tag. The URL on a click-through event
  5963. // tag should have a landing page URL appended to the end of it. This
  5964. // field is required on insertion.
  5965. Url string `json:"url,omitempty"`
  5966. // UrlEscapeLevels: Number of times the landing page URL should be
  5967. // URL-escaped before being appended to the click-through event tag URL.
  5968. // Only applies to click-through event tags as specified by the event
  5969. // tag type.
  5970. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5971. // ServerResponse contains the HTTP response code and headers from the
  5972. // server.
  5973. googleapi.ServerResponse `json:"-"`
  5974. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5975. // unconditionally include in API requests. By default, fields with
  5976. // empty values are omitted from API requests. However, any non-pointer,
  5977. // non-interface field appearing in ForceSendFields will be sent to the
  5978. // server regardless of whether the field is empty or not. This may be
  5979. // used to include empty fields in Patch requests.
  5980. ForceSendFields []string `json:"-"`
  5981. // NullFields is a list of field names (e.g. "AccountId") to include in
  5982. // API requests with the JSON null value. By default, fields with empty
  5983. // values are omitted from API requests. However, any field with an
  5984. // empty value appearing in NullFields will be sent to the server as
  5985. // null. It is an error if a field in this list has a non-empty value.
  5986. // This may be used to include null fields in Patch requests.
  5987. NullFields []string `json:"-"`
  5988. }
  5989. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5990. type NoMethod EventTag
  5991. raw := NoMethod(*s)
  5992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5993. }
  5994. // EventTagOverride: Event tag override information.
  5995. type EventTagOverride struct {
  5996. // Enabled: Whether this override is enabled.
  5997. Enabled bool `json:"enabled,omitempty"`
  5998. // Id: ID of this event tag override. This is a read-only,
  5999. // auto-generated field.
  6000. Id int64 `json:"id,omitempty,string"`
  6001. // ForceSendFields is a list of field names (e.g. "Enabled") to
  6002. // unconditionally include in API requests. By default, fields with
  6003. // empty values are omitted from API requests. However, any non-pointer,
  6004. // non-interface field appearing in ForceSendFields will be sent to the
  6005. // server regardless of whether the field is empty or not. This may be
  6006. // used to include empty fields in Patch requests.
  6007. ForceSendFields []string `json:"-"`
  6008. // NullFields is a list of field names (e.g. "Enabled") to include in
  6009. // API requests with the JSON null value. By default, fields with empty
  6010. // values are omitted from API requests. However, any field with an
  6011. // empty value appearing in NullFields will be sent to the server as
  6012. // null. It is an error if a field in this list has a non-empty value.
  6013. // This may be used to include null fields in Patch requests.
  6014. NullFields []string `json:"-"`
  6015. }
  6016. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  6017. type NoMethod EventTagOverride
  6018. raw := NoMethod(*s)
  6019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6020. }
  6021. // EventTagsListResponse: Event Tag List Response
  6022. type EventTagsListResponse struct {
  6023. // EventTags: Event tag collection.
  6024. EventTags []*EventTag `json:"eventTags,omitempty"`
  6025. // Kind: Identifies what kind of resource this is. Value: the fixed
  6026. // string "dfareporting#eventTagsListResponse".
  6027. Kind string `json:"kind,omitempty"`
  6028. // ServerResponse contains the HTTP response code and headers from the
  6029. // server.
  6030. googleapi.ServerResponse `json:"-"`
  6031. // ForceSendFields is a list of field names (e.g. "EventTags") to
  6032. // unconditionally include in API requests. By default, fields with
  6033. // empty values are omitted from API requests. However, any non-pointer,
  6034. // non-interface field appearing in ForceSendFields will be sent to the
  6035. // server regardless of whether the field is empty or not. This may be
  6036. // used to include empty fields in Patch requests.
  6037. ForceSendFields []string `json:"-"`
  6038. // NullFields is a list of field names (e.g. "EventTags") to include in
  6039. // API requests with the JSON null value. By default, fields with empty
  6040. // values are omitted from API requests. However, any field with an
  6041. // empty value appearing in NullFields will be sent to the server as
  6042. // null. It is an error if a field in this list has a non-empty value.
  6043. // This may be used to include null fields in Patch requests.
  6044. NullFields []string `json:"-"`
  6045. }
  6046. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  6047. type NoMethod EventTagsListResponse
  6048. raw := NoMethod(*s)
  6049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6050. }
  6051. // File: Represents a File resource. A file contains the metadata for a
  6052. // report run. It shows the status of the run and holds the URLs to the
  6053. // generated report data if the run is finished and the status is
  6054. // "REPORT_AVAILABLE".
  6055. type File struct {
  6056. // DateRange: The date range for which the file has report data. The
  6057. // date range will always be the absolute date range for which the
  6058. // report is run.
  6059. DateRange *DateRange `json:"dateRange,omitempty"`
  6060. // Etag: The eTag of this response for caching purposes.
  6061. Etag string `json:"etag,omitempty"`
  6062. // FileName: The filename of the file.
  6063. FileName string `json:"fileName,omitempty"`
  6064. // Format: The output format of the report. Only available once the file
  6065. // is available.
  6066. //
  6067. // Possible values:
  6068. // "CSV"
  6069. // "EXCEL"
  6070. Format string `json:"format,omitempty"`
  6071. // Id: The unique ID of this report file.
  6072. Id int64 `json:"id,omitempty,string"`
  6073. // Kind: The kind of resource this is, in this case dfareporting#file.
  6074. Kind string `json:"kind,omitempty"`
  6075. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  6076. // file was last modified.
  6077. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  6078. // ReportId: The ID of the report this file was generated from.
  6079. ReportId int64 `json:"reportId,omitempty,string"`
  6080. // Status: The status of the report file.
  6081. //
  6082. // Possible values:
  6083. // "CANCELLED"
  6084. // "FAILED"
  6085. // "PROCESSING"
  6086. // "REPORT_AVAILABLE"
  6087. Status string `json:"status,omitempty"`
  6088. // Urls: The URLs where the completed report file can be downloaded.
  6089. Urls *FileUrls `json:"urls,omitempty"`
  6090. // ServerResponse contains the HTTP response code and headers from the
  6091. // server.
  6092. googleapi.ServerResponse `json:"-"`
  6093. // ForceSendFields is a list of field names (e.g. "DateRange") to
  6094. // unconditionally include in API requests. By default, fields with
  6095. // empty values are omitted from API requests. However, any non-pointer,
  6096. // non-interface field appearing in ForceSendFields will be sent to the
  6097. // server regardless of whether the field is empty or not. This may be
  6098. // used to include empty fields in Patch requests.
  6099. ForceSendFields []string `json:"-"`
  6100. // NullFields is a list of field names (e.g. "DateRange") to include in
  6101. // API requests with the JSON null value. By default, fields with empty
  6102. // values are omitted from API requests. However, any field with an
  6103. // empty value appearing in NullFields will be sent to the server as
  6104. // null. It is an error if a field in this list has a non-empty value.
  6105. // This may be used to include null fields in Patch requests.
  6106. NullFields []string `json:"-"`
  6107. }
  6108. func (s *File) MarshalJSON() ([]byte, error) {
  6109. type NoMethod File
  6110. raw := NoMethod(*s)
  6111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6112. }
  6113. // FileUrls: The URLs where the completed report file can be downloaded.
  6114. type FileUrls struct {
  6115. // ApiUrl: The URL for downloading the report data through the API.
  6116. ApiUrl string `json:"apiUrl,omitempty"`
  6117. // BrowserUrl: The URL for downloading the report data through a
  6118. // browser.
  6119. BrowserUrl string `json:"browserUrl,omitempty"`
  6120. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  6121. // unconditionally include in API requests. By default, fields with
  6122. // empty values are omitted from API requests. However, any non-pointer,
  6123. // non-interface field appearing in ForceSendFields will be sent to the
  6124. // server regardless of whether the field is empty or not. This may be
  6125. // used to include empty fields in Patch requests.
  6126. ForceSendFields []string `json:"-"`
  6127. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  6128. // requests with the JSON null value. By default, fields with empty
  6129. // values are omitted from API requests. However, any field with an
  6130. // empty value appearing in NullFields will be sent to the server as
  6131. // null. It is an error if a field in this list has a non-empty value.
  6132. // This may be used to include null fields in Patch requests.
  6133. NullFields []string `json:"-"`
  6134. }
  6135. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  6136. type NoMethod FileUrls
  6137. raw := NoMethod(*s)
  6138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6139. }
  6140. // FileList: Represents the list of File resources.
  6141. type FileList struct {
  6142. // Etag: The eTag of this response for caching purposes.
  6143. Etag string `json:"etag,omitempty"`
  6144. // Items: The files returned in this response.
  6145. Items []*File `json:"items,omitempty"`
  6146. // Kind: The kind of list this is, in this case dfareporting#fileList.
  6147. Kind string `json:"kind,omitempty"`
  6148. // NextPageToken: Continuation token used to page through files. To
  6149. // retrieve the next page of results, set the next request's "pageToken"
  6150. // to the value of this field. The page token is only valid for a
  6151. // limited amount of time and should not be persisted.
  6152. NextPageToken string `json:"nextPageToken,omitempty"`
  6153. // ServerResponse contains the HTTP response code and headers from the
  6154. // server.
  6155. googleapi.ServerResponse `json:"-"`
  6156. // ForceSendFields is a list of field names (e.g. "Etag") to
  6157. // unconditionally include in API requests. By default, fields with
  6158. // empty values are omitted from API requests. However, any non-pointer,
  6159. // non-interface field appearing in ForceSendFields will be sent to the
  6160. // server regardless of whether the field is empty or not. This may be
  6161. // used to include empty fields in Patch requests.
  6162. ForceSendFields []string `json:"-"`
  6163. // NullFields is a list of field names (e.g. "Etag") to include in API
  6164. // requests with the JSON null value. By default, fields with empty
  6165. // values are omitted from API requests. However, any field with an
  6166. // empty value appearing in NullFields will be sent to the server as
  6167. // null. It is an error if a field in this list has a non-empty value.
  6168. // This may be used to include null fields in Patch requests.
  6169. NullFields []string `json:"-"`
  6170. }
  6171. func (s *FileList) MarshalJSON() ([]byte, error) {
  6172. type NoMethod FileList
  6173. raw := NoMethod(*s)
  6174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6175. }
  6176. // Flight: Flight
  6177. type Flight struct {
  6178. // EndDate: Inventory item flight end date.
  6179. EndDate string `json:"endDate,omitempty"`
  6180. // RateOrCost: Rate or cost of this flight.
  6181. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  6182. // StartDate: Inventory item flight start date.
  6183. StartDate string `json:"startDate,omitempty"`
  6184. // Units: Units of this flight.
  6185. Units int64 `json:"units,omitempty,string"`
  6186. // ForceSendFields is a list of field names (e.g. "EndDate") to
  6187. // unconditionally include in API requests. By default, fields with
  6188. // empty values are omitted from API requests. However, any non-pointer,
  6189. // non-interface field appearing in ForceSendFields will be sent to the
  6190. // server regardless of whether the field is empty or not. This may be
  6191. // used to include empty fields in Patch requests.
  6192. ForceSendFields []string `json:"-"`
  6193. // NullFields is a list of field names (e.g. "EndDate") to include in
  6194. // API requests with the JSON null value. By default, fields with empty
  6195. // values are omitted from API requests. However, any field with an
  6196. // empty value appearing in NullFields will be sent to the server as
  6197. // null. It is an error if a field in this list has a non-empty value.
  6198. // This may be used to include null fields in Patch requests.
  6199. NullFields []string `json:"-"`
  6200. }
  6201. func (s *Flight) MarshalJSON() ([]byte, error) {
  6202. type NoMethod Flight
  6203. raw := NoMethod(*s)
  6204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6205. }
  6206. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  6207. // GenerateTag Response
  6208. type FloodlightActivitiesGenerateTagResponse struct {
  6209. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  6210. // For global site tags, this is the event snippet.
  6211. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  6212. // GlobalSiteTagGlobalSnippet: The global snippet section of a global
  6213. // site tag. The global site tag sets new cookies on your domain, which
  6214. // will store a unique identifier for a user or the ad click that
  6215. // brought the user to your site. Learn more.
  6216. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"`
  6217. // Kind: Identifies what kind of resource this is. Value: the fixed
  6218. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  6219. Kind string `json:"kind,omitempty"`
  6220. // ServerResponse contains the HTTP response code and headers from the
  6221. // server.
  6222. googleapi.ServerResponse `json:"-"`
  6223. // ForceSendFields is a list of field names (e.g.
  6224. // "FloodlightActivityTag") to unconditionally include in API requests.
  6225. // By default, fields with empty values are omitted from API requests.
  6226. // However, any non-pointer, non-interface field appearing in
  6227. // ForceSendFields will be sent to the server regardless of whether the
  6228. // field is empty or not. This may be used to include empty fields in
  6229. // Patch requests.
  6230. ForceSendFields []string `json:"-"`
  6231. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  6232. // include in API requests with the JSON null value. By default, fields
  6233. // with empty values are omitted from API requests. However, any field
  6234. // with an empty value appearing in NullFields will be sent to the
  6235. // server as null. It is an error if a field in this list has a
  6236. // non-empty value. This may be used to include null fields in Patch
  6237. // requests.
  6238. NullFields []string `json:"-"`
  6239. }
  6240. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  6241. type NoMethod FloodlightActivitiesGenerateTagResponse
  6242. raw := NoMethod(*s)
  6243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6244. }
  6245. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  6246. type FloodlightActivitiesListResponse struct {
  6247. // FloodlightActivities: Floodlight activity collection.
  6248. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  6249. // Kind: Identifies what kind of resource this is. Value: the fixed
  6250. // string "dfareporting#floodlightActivitiesListResponse".
  6251. Kind string `json:"kind,omitempty"`
  6252. // NextPageToken: Pagination token to be used for the next list
  6253. // operation.
  6254. NextPageToken string `json:"nextPageToken,omitempty"`
  6255. // ServerResponse contains the HTTP response code and headers from the
  6256. // server.
  6257. googleapi.ServerResponse `json:"-"`
  6258. // ForceSendFields is a list of field names (e.g.
  6259. // "FloodlightActivities") to unconditionally include in API requests.
  6260. // By default, fields with empty values are omitted from API requests.
  6261. // However, any non-pointer, non-interface field appearing in
  6262. // ForceSendFields will be sent to the server regardless of whether the
  6263. // field is empty or not. This may be used to include empty fields in
  6264. // Patch requests.
  6265. ForceSendFields []string `json:"-"`
  6266. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  6267. // include in API requests with the JSON null value. By default, fields
  6268. // with empty values are omitted from API requests. However, any field
  6269. // with an empty value appearing in NullFields will be sent to the
  6270. // server as null. It is an error if a field in this list has a
  6271. // non-empty value. This may be used to include null fields in Patch
  6272. // requests.
  6273. NullFields []string `json:"-"`
  6274. }
  6275. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  6276. type NoMethod FloodlightActivitiesListResponse
  6277. raw := NoMethod(*s)
  6278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6279. }
  6280. // FloodlightActivity: Contains properties of a Floodlight activity.
  6281. type FloodlightActivity struct {
  6282. // AccountId: Account ID of this floodlight activity. This is a
  6283. // read-only field that can be left blank.
  6284. AccountId int64 `json:"accountId,omitempty,string"`
  6285. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  6286. // field is left blank, the value will be copied over either from the
  6287. // activity group's advertiser or the existing activity's advertiser.
  6288. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6289. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6290. // advertiser. This is a read-only, auto-generated field.
  6291. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6292. // CacheBustingType: Code type used for cache busting in the generated
  6293. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  6294. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  6295. //
  6296. // Possible values:
  6297. // "ACTIVE_SERVER_PAGE"
  6298. // "COLD_FUSION"
  6299. // "JAVASCRIPT"
  6300. // "JSP"
  6301. // "PHP"
  6302. CacheBustingType string `json:"cacheBustingType,omitempty"`
  6303. // CountingMethod: Counting method for conversions for this floodlight
  6304. // activity. This is a required field.
  6305. //
  6306. // Possible values:
  6307. // "ITEMS_SOLD_COUNTING"
  6308. // "SESSION_COUNTING"
  6309. // "STANDARD_COUNTING"
  6310. // "TRANSACTIONS_COUNTING"
  6311. // "UNIQUE_COUNTING"
  6312. CountingMethod string `json:"countingMethod,omitempty"`
  6313. // DefaultTags: Dynamic floodlight tags.
  6314. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  6315. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  6316. // be less than 256 characters long.
  6317. ExpectedUrl string `json:"expectedUrl,omitempty"`
  6318. // FloodlightActivityGroupId: Floodlight activity group ID of this
  6319. // floodlight activity. This is a required field.
  6320. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  6321. // FloodlightActivityGroupName: Name of the associated floodlight
  6322. // activity group. This is a read-only field.
  6323. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  6324. // FloodlightActivityGroupTagString: Tag string of the associated
  6325. // floodlight activity group. This is a read-only field.
  6326. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  6327. // FloodlightActivityGroupType: Type of the associated floodlight
  6328. // activity group. This is a read-only field.
  6329. //
  6330. // Possible values:
  6331. // "COUNTER"
  6332. // "SALE"
  6333. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6334. // FloodlightConfigurationId: Floodlight configuration ID of this
  6335. // floodlight activity. If this field is left blank, the value will be
  6336. // copied over either from the activity group's floodlight configuration
  6337. // or from the existing activity's floodlight configuration.
  6338. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6339. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6340. // of the floodlight configuration. This is a read-only, auto-generated
  6341. // field.
  6342. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6343. // FloodlightTagType: The type of Floodlight tag this activity will
  6344. // generate. This is a required field.
  6345. //
  6346. // Possible values:
  6347. // "GLOBAL_SITE_TAG"
  6348. // "IFRAME"
  6349. // "IMAGE"
  6350. FloodlightTagType string `json:"floodlightTagType,omitempty"`
  6351. // Hidden: Whether this activity is archived.
  6352. Hidden bool `json:"hidden,omitempty"`
  6353. // Id: ID of this floodlight activity. This is a read-only,
  6354. // auto-generated field.
  6355. Id int64 `json:"id,omitempty,string"`
  6356. // IdDimensionValue: Dimension value for the ID of this floodlight
  6357. // activity. This is a read-only, auto-generated field.
  6358. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6359. // Kind: Identifies what kind of resource this is. Value: the fixed
  6360. // string "dfareporting#floodlightActivity".
  6361. Kind string `json:"kind,omitempty"`
  6362. // Name: Name of this floodlight activity. This is a required field.
  6363. // Must be less than 129 characters long and cannot contain quotes.
  6364. Name string `json:"name,omitempty"`
  6365. // Notes: General notes or implementation instructions for the tag.
  6366. Notes string `json:"notes,omitempty"`
  6367. // PublisherTags: Publisher dynamic floodlight tags.
  6368. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6369. // Secure: Whether this tag should use SSL.
  6370. Secure bool `json:"secure,omitempty"`
  6371. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6372. // is a read-only field, its value detected by the system from the
  6373. // floodlight tags.
  6374. SslCompliant bool `json:"sslCompliant,omitempty"`
  6375. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6376. SslRequired bool `json:"sslRequired,omitempty"`
  6377. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6378. // read-only field that can be left blank.
  6379. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6380. // TagFormat: Tag format type for the floodlight activity. If left
  6381. // blank, the tag format will default to HTML.
  6382. //
  6383. // Possible values:
  6384. // "HTML"
  6385. // "XHTML"
  6386. TagFormat string `json:"tagFormat,omitempty"`
  6387. // TagString: Value of the cat= parameter in the floodlight tag, which
  6388. // the ad servers use to identify the activity. This is optional: if
  6389. // empty, a new tag string will be generated for you. This string must
  6390. // be 1 to 8 characters long, with valid characters being
  6391. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6392. // activities of the same activity group. This field is read-only after
  6393. // insertion.
  6394. TagString string `json:"tagString,omitempty"`
  6395. // UserDefinedVariableTypes: List of the user-defined variables used by
  6396. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6397. // of these can have a user defined type.
  6398. // Acceptable values are U1 to U100, inclusive.
  6399. //
  6400. // Possible values:
  6401. // "U1"
  6402. // "U10"
  6403. // "U100"
  6404. // "U11"
  6405. // "U12"
  6406. // "U13"
  6407. // "U14"
  6408. // "U15"
  6409. // "U16"
  6410. // "U17"
  6411. // "U18"
  6412. // "U19"
  6413. // "U2"
  6414. // "U20"
  6415. // "U21"
  6416. // "U22"
  6417. // "U23"
  6418. // "U24"
  6419. // "U25"
  6420. // "U26"
  6421. // "U27"
  6422. // "U28"
  6423. // "U29"
  6424. // "U3"
  6425. // "U30"
  6426. // "U31"
  6427. // "U32"
  6428. // "U33"
  6429. // "U34"
  6430. // "U35"
  6431. // "U36"
  6432. // "U37"
  6433. // "U38"
  6434. // "U39"
  6435. // "U4"
  6436. // "U40"
  6437. // "U41"
  6438. // "U42"
  6439. // "U43"
  6440. // "U44"
  6441. // "U45"
  6442. // "U46"
  6443. // "U47"
  6444. // "U48"
  6445. // "U49"
  6446. // "U5"
  6447. // "U50"
  6448. // "U51"
  6449. // "U52"
  6450. // "U53"
  6451. // "U54"
  6452. // "U55"
  6453. // "U56"
  6454. // "U57"
  6455. // "U58"
  6456. // "U59"
  6457. // "U6"
  6458. // "U60"
  6459. // "U61"
  6460. // "U62"
  6461. // "U63"
  6462. // "U64"
  6463. // "U65"
  6464. // "U66"
  6465. // "U67"
  6466. // "U68"
  6467. // "U69"
  6468. // "U7"
  6469. // "U70"
  6470. // "U71"
  6471. // "U72"
  6472. // "U73"
  6473. // "U74"
  6474. // "U75"
  6475. // "U76"
  6476. // "U77"
  6477. // "U78"
  6478. // "U79"
  6479. // "U8"
  6480. // "U80"
  6481. // "U81"
  6482. // "U82"
  6483. // "U83"
  6484. // "U84"
  6485. // "U85"
  6486. // "U86"
  6487. // "U87"
  6488. // "U88"
  6489. // "U89"
  6490. // "U9"
  6491. // "U90"
  6492. // "U91"
  6493. // "U92"
  6494. // "U93"
  6495. // "U94"
  6496. // "U95"
  6497. // "U96"
  6498. // "U97"
  6499. // "U98"
  6500. // "U99"
  6501. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6502. // ServerResponse contains the HTTP response code and headers from the
  6503. // server.
  6504. googleapi.ServerResponse `json:"-"`
  6505. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6506. // unconditionally include in API requests. By default, fields with
  6507. // empty values are omitted from API requests. However, any non-pointer,
  6508. // non-interface field appearing in ForceSendFields will be sent to the
  6509. // server regardless of whether the field is empty or not. This may be
  6510. // used to include empty fields in Patch requests.
  6511. ForceSendFields []string `json:"-"`
  6512. // NullFields is a list of field names (e.g. "AccountId") to include in
  6513. // API requests with the JSON null value. By default, fields with empty
  6514. // values are omitted from API requests. However, any field with an
  6515. // empty value appearing in NullFields will be sent to the server as
  6516. // null. It is an error if a field in this list has a non-empty value.
  6517. // This may be used to include null fields in Patch requests.
  6518. NullFields []string `json:"-"`
  6519. }
  6520. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6521. type NoMethod FloodlightActivity
  6522. raw := NoMethod(*s)
  6523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6524. }
  6525. // FloodlightActivityDynamicTag: Dynamic Tag
  6526. type FloodlightActivityDynamicTag struct {
  6527. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6528. // field.
  6529. Id int64 `json:"id,omitempty,string"`
  6530. // Name: Name of this tag.
  6531. Name string `json:"name,omitempty"`
  6532. // Tag: Tag code.
  6533. Tag string `json:"tag,omitempty"`
  6534. // ForceSendFields is a list of field names (e.g. "Id") to
  6535. // unconditionally include in API requests. By default, fields with
  6536. // empty values are omitted from API requests. However, any non-pointer,
  6537. // non-interface field appearing in ForceSendFields will be sent to the
  6538. // server regardless of whether the field is empty or not. This may be
  6539. // used to include empty fields in Patch requests.
  6540. ForceSendFields []string `json:"-"`
  6541. // NullFields is a list of field names (e.g. "Id") to include in API
  6542. // requests with the JSON null value. By default, fields with empty
  6543. // values are omitted from API requests. However, any field with an
  6544. // empty value appearing in NullFields will be sent to the server as
  6545. // null. It is an error if a field in this list has a non-empty value.
  6546. // This may be used to include null fields in Patch requests.
  6547. NullFields []string `json:"-"`
  6548. }
  6549. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6550. type NoMethod FloodlightActivityDynamicTag
  6551. raw := NoMethod(*s)
  6552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6553. }
  6554. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6555. // group.
  6556. type FloodlightActivityGroup struct {
  6557. // AccountId: Account ID of this floodlight activity group. This is a
  6558. // read-only field that can be left blank.
  6559. AccountId int64 `json:"accountId,omitempty,string"`
  6560. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6561. // this field is left blank, the value will be copied over either from
  6562. // the floodlight configuration's advertiser or from the existing
  6563. // activity group's advertiser.
  6564. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6565. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6566. // advertiser. This is a read-only, auto-generated field.
  6567. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6568. // FloodlightConfigurationId: Floodlight configuration ID of this
  6569. // floodlight activity group. This is a required field.
  6570. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6571. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6572. // of the floodlight configuration. This is a read-only, auto-generated
  6573. // field.
  6574. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6575. // Id: ID of this floodlight activity group. This is a read-only,
  6576. // auto-generated field.
  6577. Id int64 `json:"id,omitempty,string"`
  6578. // IdDimensionValue: Dimension value for the ID of this floodlight
  6579. // activity group. This is a read-only, auto-generated field.
  6580. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6581. // Kind: Identifies what kind of resource this is. Value: the fixed
  6582. // string "dfareporting#floodlightActivityGroup".
  6583. Kind string `json:"kind,omitempty"`
  6584. // Name: Name of this floodlight activity group. This is a required
  6585. // field. Must be less than 65 characters long and cannot contain
  6586. // quotes.
  6587. Name string `json:"name,omitempty"`
  6588. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6589. // is a read-only field that can be left blank.
  6590. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6591. // TagString: Value of the type= parameter in the floodlight tag, which
  6592. // the ad servers use to identify the activity group that the activity
  6593. // belongs to. This is optional: if empty, a new tag string will be
  6594. // generated for you. This string must be 1 to 8 characters long, with
  6595. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6596. // also be unique among activity groups of the same floodlight
  6597. // configuration. This field is read-only after insertion.
  6598. TagString string `json:"tagString,omitempty"`
  6599. // Type: Type of the floodlight activity group. This is a required field
  6600. // that is read-only after insertion.
  6601. //
  6602. // Possible values:
  6603. // "COUNTER"
  6604. // "SALE"
  6605. Type string `json:"type,omitempty"`
  6606. // ServerResponse contains the HTTP response code and headers from the
  6607. // server.
  6608. googleapi.ServerResponse `json:"-"`
  6609. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6610. // unconditionally include in API requests. By default, fields with
  6611. // empty values are omitted from API requests. However, any non-pointer,
  6612. // non-interface field appearing in ForceSendFields will be sent to the
  6613. // server regardless of whether the field is empty or not. This may be
  6614. // used to include empty fields in Patch requests.
  6615. ForceSendFields []string `json:"-"`
  6616. // NullFields is a list of field names (e.g. "AccountId") to include in
  6617. // API requests with the JSON null value. By default, fields with empty
  6618. // values are omitted from API requests. However, any field with an
  6619. // empty value appearing in NullFields will be sent to the server as
  6620. // null. It is an error if a field in this list has a non-empty value.
  6621. // This may be used to include null fields in Patch requests.
  6622. NullFields []string `json:"-"`
  6623. }
  6624. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6625. type NoMethod FloodlightActivityGroup
  6626. raw := NoMethod(*s)
  6627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6628. }
  6629. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6630. // Response
  6631. type FloodlightActivityGroupsListResponse struct {
  6632. // FloodlightActivityGroups: Floodlight activity group collection.
  6633. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6634. // Kind: Identifies what kind of resource this is. Value: the fixed
  6635. // string "dfareporting#floodlightActivityGroupsListResponse".
  6636. Kind string `json:"kind,omitempty"`
  6637. // NextPageToken: Pagination token to be used for the next list
  6638. // operation.
  6639. NextPageToken string `json:"nextPageToken,omitempty"`
  6640. // ServerResponse contains the HTTP response code and headers from the
  6641. // server.
  6642. googleapi.ServerResponse `json:"-"`
  6643. // ForceSendFields is a list of field names (e.g.
  6644. // "FloodlightActivityGroups") to unconditionally include in API
  6645. // requests. By default, fields with empty values are omitted from API
  6646. // requests. However, any non-pointer, non-interface field appearing in
  6647. // ForceSendFields will be sent to the server regardless of whether the
  6648. // field is empty or not. This may be used to include empty fields in
  6649. // Patch requests.
  6650. ForceSendFields []string `json:"-"`
  6651. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6652. // to include in API requests with the JSON null value. By default,
  6653. // fields with empty values are omitted from API requests. However, any
  6654. // field with an empty value appearing in NullFields will be sent to the
  6655. // server as null. It is an error if a field in this list has a
  6656. // non-empty value. This may be used to include null fields in Patch
  6657. // requests.
  6658. NullFields []string `json:"-"`
  6659. }
  6660. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6661. type NoMethod FloodlightActivityGroupsListResponse
  6662. raw := NoMethod(*s)
  6663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6664. }
  6665. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6666. type FloodlightActivityPublisherDynamicTag struct {
  6667. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6668. ClickThrough bool `json:"clickThrough,omitempty"`
  6669. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6670. // write-only field that can be used as an alternative to the siteId
  6671. // field. When this resource is retrieved, only the siteId field will be
  6672. // populated.
  6673. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6674. // DynamicTag: Dynamic floodlight tag.
  6675. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6676. // SiteId: Site ID of this dynamic tag.
  6677. SiteId int64 `json:"siteId,omitempty,string"`
  6678. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6679. // a read-only, auto-generated field.
  6680. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6681. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6682. ViewThrough bool `json:"viewThrough,omitempty"`
  6683. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6684. // unconditionally include in API requests. By default, fields with
  6685. // empty values are omitted from API requests. However, any non-pointer,
  6686. // non-interface field appearing in ForceSendFields will be sent to the
  6687. // server regardless of whether the field is empty or not. This may be
  6688. // used to include empty fields in Patch requests.
  6689. ForceSendFields []string `json:"-"`
  6690. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6691. // in API requests with the JSON null value. By default, fields with
  6692. // empty values are omitted from API requests. However, any field with
  6693. // an empty value appearing in NullFields will be sent to the server as
  6694. // null. It is an error if a field in this list has a non-empty value.
  6695. // This may be used to include null fields in Patch requests.
  6696. NullFields []string `json:"-"`
  6697. }
  6698. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6699. type NoMethod FloodlightActivityPublisherDynamicTag
  6700. raw := NoMethod(*s)
  6701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6702. }
  6703. // FloodlightConfiguration: Contains properties of a Floodlight
  6704. // configuration.
  6705. type FloodlightConfiguration struct {
  6706. // AccountId: Account ID of this floodlight configuration. This is a
  6707. // read-only field that can be left blank.
  6708. AccountId int64 `json:"accountId,omitempty,string"`
  6709. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6710. // floodlight configuration.
  6711. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6712. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6713. // advertiser. This is a read-only, auto-generated field.
  6714. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6715. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6716. // Google Analytics.
  6717. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6718. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6719. // report is enabled. This report shows detailed pathway information on
  6720. // up to 10 of the most recent ad exposures seen by a user before
  6721. // converting.
  6722. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6723. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6724. // in reports. This is a required field.
  6725. //
  6726. // Possible values:
  6727. // "MONDAY"
  6728. // "SUNDAY"
  6729. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6730. // Id: ID of this floodlight configuration. This is a read-only,
  6731. // auto-generated field.
  6732. Id int64 `json:"id,omitempty,string"`
  6733. // IdDimensionValue: Dimension value for the ID of this floodlight
  6734. // configuration. This is a read-only, auto-generated field.
  6735. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6736. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6737. // is enabled.
  6738. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6739. // Kind: Identifies what kind of resource this is. Value: the fixed
  6740. // string "dfareporting#floodlightConfiguration".
  6741. Kind string `json:"kind,omitempty"`
  6742. // LookbackConfiguration: Lookback window settings for this floodlight
  6743. // configuration.
  6744. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6745. // NaturalSearchConversionAttributionOption: Types of attribution
  6746. // options for natural search conversions.
  6747. //
  6748. // Possible values:
  6749. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6750. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6751. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6752. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6753. // OmnitureSettings: Settings for Campaign Manager Omniture integration.
  6754. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6755. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6756. // a read-only field that can be left blank.
  6757. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6758. // TagSettings: Configuration settings for dynamic and image floodlight
  6759. // tags.
  6760. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6761. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6762. // tokens enabled for this configuration.
  6763. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6764. // UserDefinedVariableConfigurations: List of user defined variables
  6765. // enabled for this configuration.
  6766. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6767. // ServerResponse contains the HTTP response code and headers from the
  6768. // server.
  6769. googleapi.ServerResponse `json:"-"`
  6770. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6771. // unconditionally include in API requests. By default, fields with
  6772. // empty values are omitted from API requests. However, any non-pointer,
  6773. // non-interface field appearing in ForceSendFields will be sent to the
  6774. // server regardless of whether the field is empty or not. This may be
  6775. // used to include empty fields in Patch requests.
  6776. ForceSendFields []string `json:"-"`
  6777. // NullFields is a list of field names (e.g. "AccountId") to include in
  6778. // API requests with the JSON null value. By default, fields with empty
  6779. // values are omitted from API requests. However, any field with an
  6780. // empty value appearing in NullFields will be sent to the server as
  6781. // null. It is an error if a field in this list has a non-empty value.
  6782. // This may be used to include null fields in Patch requests.
  6783. NullFields []string `json:"-"`
  6784. }
  6785. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6786. type NoMethod FloodlightConfiguration
  6787. raw := NoMethod(*s)
  6788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6789. }
  6790. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6791. // Response
  6792. type FloodlightConfigurationsListResponse struct {
  6793. // FloodlightConfigurations: Floodlight configuration collection.
  6794. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6795. // Kind: Identifies what kind of resource this is. Value: the fixed
  6796. // string "dfareporting#floodlightConfigurationsListResponse".
  6797. Kind string `json:"kind,omitempty"`
  6798. // ServerResponse contains the HTTP response code and headers from the
  6799. // server.
  6800. googleapi.ServerResponse `json:"-"`
  6801. // ForceSendFields is a list of field names (e.g.
  6802. // "FloodlightConfigurations") to unconditionally include in API
  6803. // requests. By default, fields with empty values are omitted from API
  6804. // requests. However, any non-pointer, non-interface field appearing in
  6805. // ForceSendFields will be sent to the server regardless of whether the
  6806. // field is empty or not. This may be used to include empty fields in
  6807. // Patch requests.
  6808. ForceSendFields []string `json:"-"`
  6809. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6810. // to include in API requests with the JSON null value. By default,
  6811. // fields with empty values are omitted from API requests. However, any
  6812. // field with an empty value appearing in NullFields will be sent to the
  6813. // server as null. It is an error if a field in this list has a
  6814. // non-empty value. This may be used to include null fields in Patch
  6815. // requests.
  6816. NullFields []string `json:"-"`
  6817. }
  6818. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6819. type NoMethod FloodlightConfigurationsListResponse
  6820. raw := NoMethod(*s)
  6821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6822. }
  6823. // FloodlightReportCompatibleFields: Represents fields that are
  6824. // compatible to be selected for a report of type "FlOODLIGHT".
  6825. type FloodlightReportCompatibleFields struct {
  6826. // DimensionFilters: Dimensions which are compatible to be selected in
  6827. // the "dimensionFilters" section of the report.
  6828. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6829. // Dimensions: Dimensions which are compatible to be selected in the
  6830. // "dimensions" section of the report.
  6831. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6832. // Kind: The kind of resource this is, in this case
  6833. // dfareporting#floodlightReportCompatibleFields.
  6834. Kind string `json:"kind,omitempty"`
  6835. // Metrics: Metrics which are compatible to be selected in the
  6836. // "metricNames" section of the report.
  6837. Metrics []*Metric `json:"metrics,omitempty"`
  6838. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6839. // unconditionally include in API requests. By default, fields with
  6840. // empty values are omitted from API requests. However, any non-pointer,
  6841. // non-interface field appearing in ForceSendFields will be sent to the
  6842. // server regardless of whether the field is empty or not. This may be
  6843. // used to include empty fields in Patch requests.
  6844. ForceSendFields []string `json:"-"`
  6845. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6846. // include in API requests with the JSON null value. By default, fields
  6847. // with empty values are omitted from API requests. However, any field
  6848. // with an empty value appearing in NullFields will be sent to the
  6849. // server as null. It is an error if a field in this list has a
  6850. // non-empty value. This may be used to include null fields in Patch
  6851. // requests.
  6852. NullFields []string `json:"-"`
  6853. }
  6854. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6855. type NoMethod FloodlightReportCompatibleFields
  6856. raw := NoMethod(*s)
  6857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6858. }
  6859. // FrequencyCap: Frequency Cap.
  6860. type FrequencyCap struct {
  6861. // Duration: Duration of time, in seconds, for this frequency cap. The
  6862. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6863. // inclusive.
  6864. Duration int64 `json:"duration,omitempty,string"`
  6865. // Impressions: Number of times an individual user can be served the ad
  6866. // within the specified duration. Acceptable values are 1 to 15,
  6867. // inclusive.
  6868. Impressions int64 `json:"impressions,omitempty,string"`
  6869. // ForceSendFields is a list of field names (e.g. "Duration") to
  6870. // unconditionally include in API requests. By default, fields with
  6871. // empty values are omitted from API requests. However, any non-pointer,
  6872. // non-interface field appearing in ForceSendFields will be sent to the
  6873. // server regardless of whether the field is empty or not. This may be
  6874. // used to include empty fields in Patch requests.
  6875. ForceSendFields []string `json:"-"`
  6876. // NullFields is a list of field names (e.g. "Duration") to include in
  6877. // API requests with the JSON null value. By default, fields with empty
  6878. // values are omitted from API requests. However, any field with an
  6879. // empty value appearing in NullFields will be sent to the server as
  6880. // null. It is an error if a field in this list has a non-empty value.
  6881. // This may be used to include null fields in Patch requests.
  6882. NullFields []string `json:"-"`
  6883. }
  6884. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6885. type NoMethod FrequencyCap
  6886. raw := NoMethod(*s)
  6887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6888. }
  6889. // FsCommand: FsCommand.
  6890. type FsCommand struct {
  6891. // Left: Distance from the left of the browser.Applicable when
  6892. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6893. Left int64 `json:"left,omitempty"`
  6894. // PositionOption: Position in the browser where the window will open.
  6895. //
  6896. // Possible values:
  6897. // "CENTERED"
  6898. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6899. PositionOption string `json:"positionOption,omitempty"`
  6900. // Top: Distance from the top of the browser. Applicable when
  6901. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6902. Top int64 `json:"top,omitempty"`
  6903. // WindowHeight: Height of the window.
  6904. WindowHeight int64 `json:"windowHeight,omitempty"`
  6905. // WindowWidth: Width of the window.
  6906. WindowWidth int64 `json:"windowWidth,omitempty"`
  6907. // ForceSendFields is a list of field names (e.g. "Left") to
  6908. // unconditionally include in API requests. By default, fields with
  6909. // empty values are omitted from API requests. However, any non-pointer,
  6910. // non-interface field appearing in ForceSendFields will be sent to the
  6911. // server regardless of whether the field is empty or not. This may be
  6912. // used to include empty fields in Patch requests.
  6913. ForceSendFields []string `json:"-"`
  6914. // NullFields is a list of field names (e.g. "Left") to include in API
  6915. // requests with the JSON null value. By default, fields with empty
  6916. // values are omitted from API requests. However, any field with an
  6917. // empty value appearing in NullFields will be sent to the server as
  6918. // null. It is an error if a field in this list has a non-empty value.
  6919. // This may be used to include null fields in Patch requests.
  6920. NullFields []string `json:"-"`
  6921. }
  6922. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6923. type NoMethod FsCommand
  6924. raw := NoMethod(*s)
  6925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6926. }
  6927. // GeoTargeting: Geographical Targeting.
  6928. type GeoTargeting struct {
  6929. // Cities: Cities to be targeted. For each city only dartId is required.
  6930. // The other fields are populated automatically when the ad is inserted
  6931. // or updated. If targeting a city, do not target or exclude the country
  6932. // of the city, and do not target the metro or region of the city.
  6933. Cities []*City `json:"cities,omitempty"`
  6934. // Countries: Countries to be targeted or excluded from targeting,
  6935. // depending on the setting of the excludeCountries field. For each
  6936. // country only dartId is required. The other fields are populated
  6937. // automatically when the ad is inserted or updated. If targeting or
  6938. // excluding a country, do not target regions, cities, metros, or postal
  6939. // codes in the same country.
  6940. Countries []*Country `json:"countries,omitempty"`
  6941. // ExcludeCountries: Whether or not to exclude the countries in the
  6942. // countries field from targeting. If false, the countries field refers
  6943. // to countries which will be targeted by the ad.
  6944. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6945. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6946. // The other fields are populated automatically when the ad is inserted
  6947. // or updated. If targeting a metro, do not target or exclude the
  6948. // country of the metro.
  6949. Metros []*Metro `json:"metros,omitempty"`
  6950. // PostalCodes: Postal codes to be targeted. For each postal code only
  6951. // id is required. The other fields are populated automatically when the
  6952. // ad is inserted or updated. If targeting a postal code, do not target
  6953. // or exclude the country of the postal code.
  6954. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6955. // Regions: Regions to be targeted. For each region only dartId is
  6956. // required. The other fields are populated automatically when the ad is
  6957. // inserted or updated. If targeting a region, do not target or exclude
  6958. // the country of the region.
  6959. Regions []*Region `json:"regions,omitempty"`
  6960. // ForceSendFields is a list of field names (e.g. "Cities") to
  6961. // unconditionally include in API requests. By default, fields with
  6962. // empty values are omitted from API requests. However, any non-pointer,
  6963. // non-interface field appearing in ForceSendFields will be sent to the
  6964. // server regardless of whether the field is empty or not. This may be
  6965. // used to include empty fields in Patch requests.
  6966. ForceSendFields []string `json:"-"`
  6967. // NullFields is a list of field names (e.g. "Cities") to include in API
  6968. // requests with the JSON null value. By default, fields with empty
  6969. // values are omitted from API requests. However, any field with an
  6970. // empty value appearing in NullFields will be sent to the server as
  6971. // null. It is an error if a field in this list has a non-empty value.
  6972. // This may be used to include null fields in Patch requests.
  6973. NullFields []string `json:"-"`
  6974. }
  6975. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6976. type NoMethod GeoTargeting
  6977. raw := NoMethod(*s)
  6978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6979. }
  6980. // InventoryItem: Represents a buy from the Planning inventory store.
  6981. type InventoryItem struct {
  6982. // AccountId: Account ID of this inventory item.
  6983. AccountId int64 `json:"accountId,omitempty,string"`
  6984. // AdSlots: Ad slots of this inventory item. If this inventory item
  6985. // represents a standalone placement, there will be exactly one ad slot.
  6986. // If this inventory item represents a placement group, there will be
  6987. // more than one ad slot, each representing one child placement in that
  6988. // placement group.
  6989. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6990. // AdvertiserId: Advertiser ID of this inventory item.
  6991. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6992. // ContentCategoryId: Content category ID of this inventory item.
  6993. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6994. // EstimatedClickThroughRate: Estimated click-through rate of this
  6995. // inventory item.
  6996. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6997. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6998. // item.
  6999. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  7000. // Id: ID of this inventory item.
  7001. Id int64 `json:"id,omitempty,string"`
  7002. // InPlan: Whether this inventory item is in plan.
  7003. InPlan bool `json:"inPlan,omitempty"`
  7004. // Kind: Identifies what kind of resource this is. Value: the fixed
  7005. // string "dfareporting#inventoryItem".
  7006. Kind string `json:"kind,omitempty"`
  7007. // LastModifiedInfo: Information about the most recent modification of
  7008. // this inventory item.
  7009. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7010. // Name: Name of this inventory item. For standalone inventory items,
  7011. // this is the same name as that of its only ad slot. For group
  7012. // inventory items, this can differ from the name of any of its ad
  7013. // slots.
  7014. Name string `json:"name,omitempty"`
  7015. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  7016. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  7017. // OrderId: Order ID of this inventory item.
  7018. OrderId int64 `json:"orderId,omitempty,string"`
  7019. // PlacementStrategyId: Placement strategy ID of this inventory item.
  7020. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  7021. // Pricing: Pricing of this inventory item.
  7022. Pricing *Pricing `json:"pricing,omitempty"`
  7023. // ProjectId: Project ID of this inventory item.
  7024. ProjectId int64 `json:"projectId,omitempty,string"`
  7025. // RfpId: RFP ID of this inventory item.
  7026. RfpId int64 `json:"rfpId,omitempty,string"`
  7027. // SiteId: ID of the site this inventory item is associated with.
  7028. SiteId int64 `json:"siteId,omitempty,string"`
  7029. // SubaccountId: Subaccount ID of this inventory item.
  7030. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7031. // Type: Type of inventory item.
  7032. //
  7033. // Possible values:
  7034. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  7035. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  7036. Type string `json:"type,omitempty"`
  7037. // ServerResponse contains the HTTP response code and headers from the
  7038. // server.
  7039. googleapi.ServerResponse `json:"-"`
  7040. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7041. // unconditionally include in API requests. By default, fields with
  7042. // empty values are omitted from API requests. However, any non-pointer,
  7043. // non-interface field appearing in ForceSendFields will be sent to the
  7044. // server regardless of whether the field is empty or not. This may be
  7045. // used to include empty fields in Patch requests.
  7046. ForceSendFields []string `json:"-"`
  7047. // NullFields is a list of field names (e.g. "AccountId") to include in
  7048. // API requests with the JSON null value. By default, fields with empty
  7049. // values are omitted from API requests. However, any field with an
  7050. // empty value appearing in NullFields will be sent to the server as
  7051. // null. It is an error if a field in this list has a non-empty value.
  7052. // This may be used to include null fields in Patch requests.
  7053. NullFields []string `json:"-"`
  7054. }
  7055. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  7056. type NoMethod InventoryItem
  7057. raw := NoMethod(*s)
  7058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7059. }
  7060. // InventoryItemsListResponse: Inventory item List Response
  7061. type InventoryItemsListResponse struct {
  7062. // InventoryItems: Inventory item collection
  7063. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  7064. // Kind: Identifies what kind of resource this is. Value: the fixed
  7065. // string "dfareporting#inventoryItemsListResponse".
  7066. Kind string `json:"kind,omitempty"`
  7067. // NextPageToken: Pagination token to be used for the next list
  7068. // operation.
  7069. NextPageToken string `json:"nextPageToken,omitempty"`
  7070. // ServerResponse contains the HTTP response code and headers from the
  7071. // server.
  7072. googleapi.ServerResponse `json:"-"`
  7073. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  7074. // unconditionally include in API requests. By default, fields with
  7075. // empty values are omitted from API requests. However, any non-pointer,
  7076. // non-interface field appearing in ForceSendFields will be sent to the
  7077. // server regardless of whether the field is empty or not. This may be
  7078. // used to include empty fields in Patch requests.
  7079. ForceSendFields []string `json:"-"`
  7080. // NullFields is a list of field names (e.g. "InventoryItems") to
  7081. // include in API requests with the JSON null value. By default, fields
  7082. // with empty values are omitted from API requests. However, any field
  7083. // with an empty value appearing in NullFields will be sent to the
  7084. // server as null. It is an error if a field in this list has a
  7085. // non-empty value. This may be used to include null fields in Patch
  7086. // requests.
  7087. NullFields []string `json:"-"`
  7088. }
  7089. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  7090. type NoMethod InventoryItemsListResponse
  7091. raw := NoMethod(*s)
  7092. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7093. }
  7094. // KeyValueTargetingExpression: Key Value Targeting Expression.
  7095. type KeyValueTargetingExpression struct {
  7096. // Expression: Keyword expression being targeted by the ad.
  7097. Expression string `json:"expression,omitempty"`
  7098. // ForceSendFields is a list of field names (e.g. "Expression") to
  7099. // unconditionally include in API requests. By default, fields with
  7100. // empty values are omitted from API requests. However, any non-pointer,
  7101. // non-interface field appearing in ForceSendFields will be sent to the
  7102. // server regardless of whether the field is empty or not. This may be
  7103. // used to include empty fields in Patch requests.
  7104. ForceSendFields []string `json:"-"`
  7105. // NullFields is a list of field names (e.g. "Expression") to include in
  7106. // API requests with the JSON null value. By default, fields with empty
  7107. // values are omitted from API requests. However, any field with an
  7108. // empty value appearing in NullFields will be sent to the server as
  7109. // null. It is an error if a field in this list has a non-empty value.
  7110. // This may be used to include null fields in Patch requests.
  7111. NullFields []string `json:"-"`
  7112. }
  7113. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  7114. type NoMethod KeyValueTargetingExpression
  7115. raw := NoMethod(*s)
  7116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7117. }
  7118. // LandingPage: Contains information about where a user's browser is
  7119. // taken after the user clicks an ad.
  7120. type LandingPage struct {
  7121. // AdvertiserId: Advertiser ID of this landing page. This is a required
  7122. // field.
  7123. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7124. // Archived: Whether this landing page has been archived.
  7125. Archived bool `json:"archived,omitempty"`
  7126. // DeepLinks: Links that will direct the user to a mobile app, if
  7127. // installed.
  7128. DeepLinks []*DeepLink `json:"deepLinks,omitempty"`
  7129. // Id: ID of this landing page. This is a read-only, auto-generated
  7130. // field.
  7131. Id int64 `json:"id,omitempty,string"`
  7132. // Kind: Identifies what kind of resource this is. Value: the fixed
  7133. // string "dfareporting#landingPage".
  7134. Kind string `json:"kind,omitempty"`
  7135. // Name: Name of this landing page. This is a required field. It must be
  7136. // less than 256 characters long.
  7137. Name string `json:"name,omitempty"`
  7138. // Url: URL of this landing page. This is a required field.
  7139. Url string `json:"url,omitempty"`
  7140. // ServerResponse contains the HTTP response code and headers from the
  7141. // server.
  7142. googleapi.ServerResponse `json:"-"`
  7143. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  7144. // unconditionally include in API requests. By default, fields with
  7145. // empty values are omitted from API requests. However, any non-pointer,
  7146. // non-interface field appearing in ForceSendFields will be sent to the
  7147. // server regardless of whether the field is empty or not. This may be
  7148. // used to include empty fields in Patch requests.
  7149. ForceSendFields []string `json:"-"`
  7150. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  7151. // in API requests with the JSON null value. By default, fields with
  7152. // empty values are omitted from API requests. However, any field with
  7153. // an empty value appearing in NullFields will be sent to the server as
  7154. // null. It is an error if a field in this list has a non-empty value.
  7155. // This may be used to include null fields in Patch requests.
  7156. NullFields []string `json:"-"`
  7157. }
  7158. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  7159. type NoMethod LandingPage
  7160. raw := NoMethod(*s)
  7161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7162. }
  7163. // Language: Contains information about a language that can be targeted
  7164. // by ads.
  7165. type Language struct {
  7166. // Id: Language ID of this language. This is the ID used for targeting
  7167. // and generating reports.
  7168. Id int64 `json:"id,omitempty,string"`
  7169. // Kind: Identifies what kind of resource this is. Value: the fixed
  7170. // string "dfareporting#language".
  7171. Kind string `json:"kind,omitempty"`
  7172. // LanguageCode: Format of language code is an ISO 639 two-letter
  7173. // language code optionally followed by an underscore followed by an ISO
  7174. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  7175. // Chinese.
  7176. LanguageCode string `json:"languageCode,omitempty"`
  7177. // Name: Name of this language.
  7178. Name string `json:"name,omitempty"`
  7179. // ForceSendFields is a list of field names (e.g. "Id") to
  7180. // unconditionally include in API requests. By default, fields with
  7181. // empty values are omitted from API requests. However, any non-pointer,
  7182. // non-interface field appearing in ForceSendFields will be sent to the
  7183. // server regardless of whether the field is empty or not. This may be
  7184. // used to include empty fields in Patch requests.
  7185. ForceSendFields []string `json:"-"`
  7186. // NullFields is a list of field names (e.g. "Id") to include in API
  7187. // requests with the JSON null value. By default, fields with empty
  7188. // values are omitted from API requests. However, any field with an
  7189. // empty value appearing in NullFields will be sent to the server as
  7190. // null. It is an error if a field in this list has a non-empty value.
  7191. // This may be used to include null fields in Patch requests.
  7192. NullFields []string `json:"-"`
  7193. }
  7194. func (s *Language) MarshalJSON() ([]byte, error) {
  7195. type NoMethod Language
  7196. raw := NoMethod(*s)
  7197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7198. }
  7199. // LanguageTargeting: Language Targeting.
  7200. type LanguageTargeting struct {
  7201. // Languages: Languages that this ad targets. For each language only
  7202. // languageId is required. The other fields are populated automatically
  7203. // when the ad is inserted or updated.
  7204. Languages []*Language `json:"languages,omitempty"`
  7205. // ForceSendFields is a list of field names (e.g. "Languages") to
  7206. // unconditionally include in API requests. By default, fields with
  7207. // empty values are omitted from API requests. However, any non-pointer,
  7208. // non-interface field appearing in ForceSendFields will be sent to the
  7209. // server regardless of whether the field is empty or not. This may be
  7210. // used to include empty fields in Patch requests.
  7211. ForceSendFields []string `json:"-"`
  7212. // NullFields is a list of field names (e.g. "Languages") to include in
  7213. // API requests with the JSON null value. By default, fields with empty
  7214. // values are omitted from API requests. However, any field with an
  7215. // empty value appearing in NullFields will be sent to the server as
  7216. // null. It is an error if a field in this list has a non-empty value.
  7217. // This may be used to include null fields in Patch requests.
  7218. NullFields []string `json:"-"`
  7219. }
  7220. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  7221. type NoMethod LanguageTargeting
  7222. raw := NoMethod(*s)
  7223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7224. }
  7225. // LanguagesListResponse: Language List Response
  7226. type LanguagesListResponse struct {
  7227. // Kind: Identifies what kind of resource this is. Value: the fixed
  7228. // string "dfareporting#languagesListResponse".
  7229. Kind string `json:"kind,omitempty"`
  7230. // Languages: Language collection.
  7231. Languages []*Language `json:"languages,omitempty"`
  7232. // ServerResponse contains the HTTP response code and headers from the
  7233. // server.
  7234. googleapi.ServerResponse `json:"-"`
  7235. // ForceSendFields is a list of field names (e.g. "Kind") to
  7236. // unconditionally include in API requests. By default, fields with
  7237. // empty values are omitted from API requests. However, any non-pointer,
  7238. // non-interface field appearing in ForceSendFields will be sent to the
  7239. // server regardless of whether the field is empty or not. This may be
  7240. // used to include empty fields in Patch requests.
  7241. ForceSendFields []string `json:"-"`
  7242. // NullFields is a list of field names (e.g. "Kind") to include in API
  7243. // requests with the JSON null value. By default, fields with empty
  7244. // values are omitted from API requests. However, any field with an
  7245. // empty value appearing in NullFields will be sent to the server as
  7246. // null. It is an error if a field in this list has a non-empty value.
  7247. // This may be used to include null fields in Patch requests.
  7248. NullFields []string `json:"-"`
  7249. }
  7250. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  7251. type NoMethod LanguagesListResponse
  7252. raw := NoMethod(*s)
  7253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7254. }
  7255. // LastModifiedInfo: Modification timestamp.
  7256. type LastModifiedInfo struct {
  7257. // Time: Timestamp of the last change in milliseconds since epoch.
  7258. Time int64 `json:"time,omitempty,string"`
  7259. // ForceSendFields is a list of field names (e.g. "Time") to
  7260. // unconditionally include in API requests. By default, fields with
  7261. // empty values are omitted from API requests. However, any non-pointer,
  7262. // non-interface field appearing in ForceSendFields will be sent to the
  7263. // server regardless of whether the field is empty or not. This may be
  7264. // used to include empty fields in Patch requests.
  7265. ForceSendFields []string `json:"-"`
  7266. // NullFields is a list of field names (e.g. "Time") to include in API
  7267. // requests with the JSON null value. By default, fields with empty
  7268. // values are omitted from API requests. However, any field with an
  7269. // empty value appearing in NullFields will be sent to the server as
  7270. // null. It is an error if a field in this list has a non-empty value.
  7271. // This may be used to include null fields in Patch requests.
  7272. NullFields []string `json:"-"`
  7273. }
  7274. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  7275. type NoMethod LastModifiedInfo
  7276. raw := NoMethod(*s)
  7277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7278. }
  7279. // ListPopulationClause: A group clause made up of list population terms
  7280. // representing constraints joined by ORs.
  7281. type ListPopulationClause struct {
  7282. // Terms: Terms of this list population clause. Each clause is made up
  7283. // of list population terms representing constraints and are joined by
  7284. // ORs.
  7285. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  7286. // ForceSendFields is a list of field names (e.g. "Terms") to
  7287. // unconditionally include in API requests. By default, fields with
  7288. // empty values are omitted from API requests. However, any non-pointer,
  7289. // non-interface field appearing in ForceSendFields will be sent to the
  7290. // server regardless of whether the field is empty or not. This may be
  7291. // used to include empty fields in Patch requests.
  7292. ForceSendFields []string `json:"-"`
  7293. // NullFields is a list of field names (e.g. "Terms") to include in API
  7294. // requests with the JSON null value. By default, fields with empty
  7295. // values are omitted from API requests. However, any field with an
  7296. // empty value appearing in NullFields will be sent to the server as
  7297. // null. It is an error if a field in this list has a non-empty value.
  7298. // This may be used to include null fields in Patch requests.
  7299. NullFields []string `json:"-"`
  7300. }
  7301. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7302. type NoMethod ListPopulationClause
  7303. raw := NoMethod(*s)
  7304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7305. }
  7306. // ListPopulationRule: Remarketing List Population Rule.
  7307. type ListPopulationRule struct {
  7308. // FloodlightActivityId: Floodlight activity ID associated with this
  7309. // rule. This field can be left blank.
  7310. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7311. // FloodlightActivityName: Name of floodlight activity associated with
  7312. // this rule. This is a read-only, auto-generated field.
  7313. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7314. // ListPopulationClauses: Clauses that make up this list population
  7315. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7316. // up of list population terms which are joined by ORs.
  7317. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7318. // ForceSendFields is a list of field names (e.g.
  7319. // "FloodlightActivityId") to unconditionally include in API requests.
  7320. // By default, fields with empty values are omitted from API requests.
  7321. // However, any non-pointer, non-interface field appearing in
  7322. // ForceSendFields will be sent to the server regardless of whether the
  7323. // field is empty or not. This may be used to include empty fields in
  7324. // Patch requests.
  7325. ForceSendFields []string `json:"-"`
  7326. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7327. // include in API requests with the JSON null value. By default, fields
  7328. // with empty values are omitted from API requests. However, any field
  7329. // with an empty value appearing in NullFields will be sent to the
  7330. // server as null. It is an error if a field in this list has a
  7331. // non-empty value. This may be used to include null fields in Patch
  7332. // requests.
  7333. NullFields []string `json:"-"`
  7334. }
  7335. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7336. type NoMethod ListPopulationRule
  7337. raw := NoMethod(*s)
  7338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7339. }
  7340. // ListPopulationTerm: Remarketing List Population Rule Term.
  7341. type ListPopulationTerm struct {
  7342. // Contains: Will be true if the term should check if the user is in the
  7343. // list and false if the term should check if the user is not in the
  7344. // list. This field is only relevant when type is set to
  7345. // LIST_MEMBERSHIP_TERM. False by default.
  7346. Contains bool `json:"contains,omitempty"`
  7347. // Negation: Whether to negate the comparison result of this term during
  7348. // rule evaluation. This field is only relevant when type is left unset
  7349. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7350. Negation bool `json:"negation,omitempty"`
  7351. // Operator: Comparison operator of this term. This field is only
  7352. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7353. // REFERRER_TERM.
  7354. //
  7355. // Possible values:
  7356. // "NUM_EQUALS"
  7357. // "NUM_GREATER_THAN"
  7358. // "NUM_GREATER_THAN_EQUAL"
  7359. // "NUM_LESS_THAN"
  7360. // "NUM_LESS_THAN_EQUAL"
  7361. // "STRING_CONTAINS"
  7362. // "STRING_EQUALS"
  7363. Operator string `json:"operator,omitempty"`
  7364. // RemarketingListId: ID of the list in question. This field is only
  7365. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7366. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7367. // Type: List population term type determines the applicable fields in
  7368. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7369. // variableName, variableFriendlyName, operator, value, and negation are
  7370. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7371. // contains are applicable. If set to REFERRER_TERM then operator,
  7372. // value, and negation are applicable.
  7373. //
  7374. // Possible values:
  7375. // "CUSTOM_VARIABLE_TERM"
  7376. // "LIST_MEMBERSHIP_TERM"
  7377. // "REFERRER_TERM"
  7378. Type string `json:"type,omitempty"`
  7379. // Value: Literal to compare the variable to. This field is only
  7380. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7381. // REFERRER_TERM.
  7382. Value string `json:"value,omitempty"`
  7383. // VariableFriendlyName: Friendly name of this term's variable. This is
  7384. // a read-only, auto-generated field. This field is only relevant when
  7385. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7386. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7387. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7388. // this term. This field is only relevant when type is set to null,
  7389. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7390. VariableName string `json:"variableName,omitempty"`
  7391. // ForceSendFields is a list of field names (e.g. "Contains") to
  7392. // unconditionally include in API requests. By default, fields with
  7393. // empty values are omitted from API requests. However, any non-pointer,
  7394. // non-interface field appearing in ForceSendFields will be sent to the
  7395. // server regardless of whether the field is empty or not. This may be
  7396. // used to include empty fields in Patch requests.
  7397. ForceSendFields []string `json:"-"`
  7398. // NullFields is a list of field names (e.g. "Contains") to include in
  7399. // API requests with the JSON null value. By default, fields with empty
  7400. // values are omitted from API requests. However, any field with an
  7401. // empty value appearing in NullFields will be sent to the server as
  7402. // null. It is an error if a field in this list has a non-empty value.
  7403. // This may be used to include null fields in Patch requests.
  7404. NullFields []string `json:"-"`
  7405. }
  7406. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7407. type NoMethod ListPopulationTerm
  7408. raw := NoMethod(*s)
  7409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7410. }
  7411. // ListTargetingExpression: Remarketing List Targeting Expression.
  7412. type ListTargetingExpression struct {
  7413. // Expression: Expression describing which lists are being targeted by
  7414. // the ad.
  7415. Expression string `json:"expression,omitempty"`
  7416. // ForceSendFields is a list of field names (e.g. "Expression") to
  7417. // unconditionally include in API requests. By default, fields with
  7418. // empty values are omitted from API requests. However, any non-pointer,
  7419. // non-interface field appearing in ForceSendFields will be sent to the
  7420. // server regardless of whether the field is empty or not. This may be
  7421. // used to include empty fields in Patch requests.
  7422. ForceSendFields []string `json:"-"`
  7423. // NullFields is a list of field names (e.g. "Expression") to include in
  7424. // API requests with the JSON null value. By default, fields with empty
  7425. // values are omitted from API requests. However, any field with an
  7426. // empty value appearing in NullFields will be sent to the server as
  7427. // null. It is an error if a field in this list has a non-empty value.
  7428. // This may be used to include null fields in Patch requests.
  7429. NullFields []string `json:"-"`
  7430. }
  7431. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7432. type NoMethod ListTargetingExpression
  7433. raw := NoMethod(*s)
  7434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7435. }
  7436. // LookbackConfiguration: Lookback configuration settings.
  7437. type LookbackConfiguration struct {
  7438. // ClickDuration: Lookback window, in days, from the last time a given
  7439. // user clicked on one of your ads. If you enter 0, clicks will not be
  7440. // considered as triggering events for floodlight tracking. If you leave
  7441. // this field blank, the default value for your account will be used.
  7442. // Acceptable values are 0 to 90, inclusive.
  7443. ClickDuration int64 `json:"clickDuration,omitempty"`
  7444. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7445. // last time a given user viewed one of your ads. If you enter 0,
  7446. // impressions will not be considered as triggering events for
  7447. // floodlight tracking. If you leave this field blank, the default value
  7448. // for your account will be used. Acceptable values are 0 to 90,
  7449. // inclusive.
  7450. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7451. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7452. // unconditionally include in API requests. By default, fields with
  7453. // empty values are omitted from API requests. However, any non-pointer,
  7454. // non-interface field appearing in ForceSendFields will be sent to the
  7455. // server regardless of whether the field is empty or not. This may be
  7456. // used to include empty fields in Patch requests.
  7457. ForceSendFields []string `json:"-"`
  7458. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7459. // in API requests with the JSON null value. By default, fields with
  7460. // empty values are omitted from API requests. However, any field with
  7461. // an empty value appearing in NullFields will be sent to the server as
  7462. // null. It is an error if a field in this list has a non-empty value.
  7463. // This may be used to include null fields in Patch requests.
  7464. NullFields []string `json:"-"`
  7465. }
  7466. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7467. type NoMethod LookbackConfiguration
  7468. raw := NoMethod(*s)
  7469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7470. }
  7471. // Metric: Represents a metric.
  7472. type Metric struct {
  7473. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7474. Kind string `json:"kind,omitempty"`
  7475. // Name: The metric name, e.g. dfa:impressions
  7476. Name string `json:"name,omitempty"`
  7477. // ForceSendFields is a list of field names (e.g. "Kind") to
  7478. // unconditionally include in API requests. By default, fields with
  7479. // empty values are omitted from API requests. However, any non-pointer,
  7480. // non-interface field appearing in ForceSendFields will be sent to the
  7481. // server regardless of whether the field is empty or not. This may be
  7482. // used to include empty fields in Patch requests.
  7483. ForceSendFields []string `json:"-"`
  7484. // NullFields is a list of field names (e.g. "Kind") to include in API
  7485. // requests with the JSON null value. By default, fields with empty
  7486. // values are omitted from API requests. However, any field with an
  7487. // empty value appearing in NullFields will be sent to the server as
  7488. // null. It is an error if a field in this list has a non-empty value.
  7489. // This may be used to include null fields in Patch requests.
  7490. NullFields []string `json:"-"`
  7491. }
  7492. func (s *Metric) MarshalJSON() ([]byte, error) {
  7493. type NoMethod Metric
  7494. raw := NoMethod(*s)
  7495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7496. }
  7497. // Metro: Contains information about a metro region that can be targeted
  7498. // by ads.
  7499. type Metro struct {
  7500. // CountryCode: Country code of the country to which this metro region
  7501. // belongs.
  7502. CountryCode string `json:"countryCode,omitempty"`
  7503. // CountryDartId: DART ID of the country to which this metro region
  7504. // belongs.
  7505. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7506. // DartId: DART ID of this metro region.
  7507. DartId int64 `json:"dartId,omitempty,string"`
  7508. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7509. // and generating reports, and is equivalent to metro_code.
  7510. DmaId int64 `json:"dmaId,omitempty,string"`
  7511. // Kind: Identifies what kind of resource this is. Value: the fixed
  7512. // string "dfareporting#metro".
  7513. Kind string `json:"kind,omitempty"`
  7514. // MetroCode: Metro code of this metro region. This is equivalent to
  7515. // dma_id.
  7516. MetroCode string `json:"metroCode,omitempty"`
  7517. // Name: Name of this metro region.
  7518. Name string `json:"name,omitempty"`
  7519. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7520. // unconditionally include in API requests. By default, fields with
  7521. // empty values are omitted from API requests. However, any non-pointer,
  7522. // non-interface field appearing in ForceSendFields will be sent to the
  7523. // server regardless of whether the field is empty or not. This may be
  7524. // used to include empty fields in Patch requests.
  7525. ForceSendFields []string `json:"-"`
  7526. // NullFields is a list of field names (e.g. "CountryCode") to include
  7527. // in API requests with the JSON null value. By default, fields with
  7528. // empty values are omitted from API requests. However, any field with
  7529. // an empty value appearing in NullFields will be sent to the server as
  7530. // null. It is an error if a field in this list has a non-empty value.
  7531. // This may be used to include null fields in Patch requests.
  7532. NullFields []string `json:"-"`
  7533. }
  7534. func (s *Metro) MarshalJSON() ([]byte, error) {
  7535. type NoMethod Metro
  7536. raw := NoMethod(*s)
  7537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7538. }
  7539. // MetrosListResponse: Metro List Response
  7540. type MetrosListResponse struct {
  7541. // Kind: Identifies what kind of resource this is. Value: the fixed
  7542. // string "dfareporting#metrosListResponse".
  7543. Kind string `json:"kind,omitempty"`
  7544. // Metros: Metro collection.
  7545. Metros []*Metro `json:"metros,omitempty"`
  7546. // ServerResponse contains the HTTP response code and headers from the
  7547. // server.
  7548. googleapi.ServerResponse `json:"-"`
  7549. // ForceSendFields is a list of field names (e.g. "Kind") to
  7550. // unconditionally include in API requests. By default, fields with
  7551. // empty values are omitted from API requests. However, any non-pointer,
  7552. // non-interface field appearing in ForceSendFields will be sent to the
  7553. // server regardless of whether the field is empty or not. This may be
  7554. // used to include empty fields in Patch requests.
  7555. ForceSendFields []string `json:"-"`
  7556. // NullFields is a list of field names (e.g. "Kind") to include in API
  7557. // requests with the JSON null value. By default, fields with empty
  7558. // values are omitted from API requests. However, any field with an
  7559. // empty value appearing in NullFields will be sent to the server as
  7560. // null. It is an error if a field in this list has a non-empty value.
  7561. // This may be used to include null fields in Patch requests.
  7562. NullFields []string `json:"-"`
  7563. }
  7564. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7565. type NoMethod MetrosListResponse
  7566. raw := NoMethod(*s)
  7567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7568. }
  7569. // MobileApp: Contains information about a mobile app. Used as a landing
  7570. // page deep link.
  7571. type MobileApp struct {
  7572. // Directory: Mobile app directory.
  7573. //
  7574. // Possible values:
  7575. // "APPLE_APP_STORE"
  7576. // "GOOGLE_PLAY_STORE"
  7577. // "UNKNOWN"
  7578. Directory string `json:"directory,omitempty"`
  7579. // Id: ID of this mobile app.
  7580. Id string `json:"id,omitempty"`
  7581. // Kind: Identifies what kind of resource this is. Value: the fixed
  7582. // string "dfareporting#mobileApp".
  7583. Kind string `json:"kind,omitempty"`
  7584. // PublisherName: Publisher name.
  7585. PublisherName string `json:"publisherName,omitempty"`
  7586. // Title: Title of this mobile app.
  7587. Title string `json:"title,omitempty"`
  7588. // ServerResponse contains the HTTP response code and headers from the
  7589. // server.
  7590. googleapi.ServerResponse `json:"-"`
  7591. // ForceSendFields is a list of field names (e.g. "Directory") to
  7592. // unconditionally include in API requests. By default, fields with
  7593. // empty values are omitted from API requests. However, any non-pointer,
  7594. // non-interface field appearing in ForceSendFields will be sent to the
  7595. // server regardless of whether the field is empty or not. This may be
  7596. // used to include empty fields in Patch requests.
  7597. ForceSendFields []string `json:"-"`
  7598. // NullFields is a list of field names (e.g. "Directory") to include in
  7599. // API requests with the JSON null value. By default, fields with empty
  7600. // values are omitted from API requests. However, any field with an
  7601. // empty value appearing in NullFields will be sent to the server as
  7602. // null. It is an error if a field in this list has a non-empty value.
  7603. // This may be used to include null fields in Patch requests.
  7604. NullFields []string `json:"-"`
  7605. }
  7606. func (s *MobileApp) MarshalJSON() ([]byte, error) {
  7607. type NoMethod MobileApp
  7608. raw := NoMethod(*s)
  7609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7610. }
  7611. // MobileAppsListResponse: Mobile app List Response
  7612. type MobileAppsListResponse struct {
  7613. // Kind: Identifies what kind of resource this is. Value: the fixed
  7614. // string "dfareporting#mobileAppsListResponse".
  7615. Kind string `json:"kind,omitempty"`
  7616. // MobileApps: Mobile apps collection.
  7617. MobileApps []*MobileApp `json:"mobileApps,omitempty"`
  7618. // NextPageToken: Pagination token to be used for the next list
  7619. // operation.
  7620. NextPageToken string `json:"nextPageToken,omitempty"`
  7621. // ServerResponse contains the HTTP response code and headers from the
  7622. // server.
  7623. googleapi.ServerResponse `json:"-"`
  7624. // ForceSendFields is a list of field names (e.g. "Kind") to
  7625. // unconditionally include in API requests. By default, fields with
  7626. // empty values are omitted from API requests. However, any non-pointer,
  7627. // non-interface field appearing in ForceSendFields will be sent to the
  7628. // server regardless of whether the field is empty or not. This may be
  7629. // used to include empty fields in Patch requests.
  7630. ForceSendFields []string `json:"-"`
  7631. // NullFields is a list of field names (e.g. "Kind") to include in API
  7632. // requests with the JSON null value. By default, fields with empty
  7633. // values are omitted from API requests. However, any field with an
  7634. // empty value appearing in NullFields will be sent to the server as
  7635. // null. It is an error if a field in this list has a non-empty value.
  7636. // This may be used to include null fields in Patch requests.
  7637. NullFields []string `json:"-"`
  7638. }
  7639. func (s *MobileAppsListResponse) MarshalJSON() ([]byte, error) {
  7640. type NoMethod MobileAppsListResponse
  7641. raw := NoMethod(*s)
  7642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7643. }
  7644. // MobileCarrier: Contains information about a mobile carrier that can
  7645. // be targeted by ads.
  7646. type MobileCarrier struct {
  7647. // CountryCode: Country code of the country to which this mobile carrier
  7648. // belongs.
  7649. CountryCode string `json:"countryCode,omitempty"`
  7650. // CountryDartId: DART ID of the country to which this mobile carrier
  7651. // belongs.
  7652. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7653. // Id: ID of this mobile carrier.
  7654. Id int64 `json:"id,omitempty,string"`
  7655. // Kind: Identifies what kind of resource this is. Value: the fixed
  7656. // string "dfareporting#mobileCarrier".
  7657. Kind string `json:"kind,omitempty"`
  7658. // Name: Name of this mobile carrier.
  7659. Name string `json:"name,omitempty"`
  7660. // ServerResponse contains the HTTP response code and headers from the
  7661. // server.
  7662. googleapi.ServerResponse `json:"-"`
  7663. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7664. // unconditionally include in API requests. By default, fields with
  7665. // empty values are omitted from API requests. However, any non-pointer,
  7666. // non-interface field appearing in ForceSendFields will be sent to the
  7667. // server regardless of whether the field is empty or not. This may be
  7668. // used to include empty fields in Patch requests.
  7669. ForceSendFields []string `json:"-"`
  7670. // NullFields is a list of field names (e.g. "CountryCode") to include
  7671. // in API requests with the JSON null value. By default, fields with
  7672. // empty values are omitted from API requests. However, any field with
  7673. // an empty value appearing in NullFields will be sent to the server as
  7674. // null. It is an error if a field in this list has a non-empty value.
  7675. // This may be used to include null fields in Patch requests.
  7676. NullFields []string `json:"-"`
  7677. }
  7678. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7679. type NoMethod MobileCarrier
  7680. raw := NoMethod(*s)
  7681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7682. }
  7683. // MobileCarriersListResponse: Mobile Carrier List Response
  7684. type MobileCarriersListResponse struct {
  7685. // Kind: Identifies what kind of resource this is. Value: the fixed
  7686. // string "dfareporting#mobileCarriersListResponse".
  7687. Kind string `json:"kind,omitempty"`
  7688. // MobileCarriers: Mobile carrier collection.
  7689. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7690. // ServerResponse contains the HTTP response code and headers from the
  7691. // server.
  7692. googleapi.ServerResponse `json:"-"`
  7693. // ForceSendFields is a list of field names (e.g. "Kind") to
  7694. // unconditionally include in API requests. By default, fields with
  7695. // empty values are omitted from API requests. However, any non-pointer,
  7696. // non-interface field appearing in ForceSendFields will be sent to the
  7697. // server regardless of whether the field is empty or not. This may be
  7698. // used to include empty fields in Patch requests.
  7699. ForceSendFields []string `json:"-"`
  7700. // NullFields is a list of field names (e.g. "Kind") to include in API
  7701. // requests with the JSON null value. By default, fields with empty
  7702. // values are omitted from API requests. However, any field with an
  7703. // empty value appearing in NullFields will be sent to the server as
  7704. // null. It is an error if a field in this list has a non-empty value.
  7705. // This may be used to include null fields in Patch requests.
  7706. NullFields []string `json:"-"`
  7707. }
  7708. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7709. type NoMethod MobileCarriersListResponse
  7710. raw := NoMethod(*s)
  7711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7712. }
  7713. // ObjectFilter: Object Filter.
  7714. type ObjectFilter struct {
  7715. // Kind: Identifies what kind of resource this is. Value: the fixed
  7716. // string "dfareporting#objectFilter".
  7717. Kind string `json:"kind,omitempty"`
  7718. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7719. // objects with these object IDs.
  7720. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7721. // Status: Status of the filter. NONE means the user has access to none
  7722. // of the objects. ALL means the user has access to all objects.
  7723. // ASSIGNED means the user has access to the objects with IDs in the
  7724. // objectIds list.
  7725. //
  7726. // Possible values:
  7727. // "ALL"
  7728. // "ASSIGNED"
  7729. // "NONE"
  7730. Status string `json:"status,omitempty"`
  7731. // ForceSendFields is a list of field names (e.g. "Kind") to
  7732. // unconditionally include in API requests. By default, fields with
  7733. // empty values are omitted from API requests. However, any non-pointer,
  7734. // non-interface field appearing in ForceSendFields will be sent to the
  7735. // server regardless of whether the field is empty or not. This may be
  7736. // used to include empty fields in Patch requests.
  7737. ForceSendFields []string `json:"-"`
  7738. // NullFields is a list of field names (e.g. "Kind") to include in API
  7739. // requests with the JSON null value. By default, fields with empty
  7740. // values are omitted from API requests. However, any field with an
  7741. // empty value appearing in NullFields will be sent to the server as
  7742. // null. It is an error if a field in this list has a non-empty value.
  7743. // This may be used to include null fields in Patch requests.
  7744. NullFields []string `json:"-"`
  7745. }
  7746. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7747. type NoMethod ObjectFilter
  7748. raw := NoMethod(*s)
  7749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7750. }
  7751. // OffsetPosition: Offset Position.
  7752. type OffsetPosition struct {
  7753. // Left: Offset distance from left side of an asset or a window.
  7754. Left int64 `json:"left,omitempty"`
  7755. // Top: Offset distance from top side of an asset or a window.
  7756. Top int64 `json:"top,omitempty"`
  7757. // ForceSendFields is a list of field names (e.g. "Left") to
  7758. // unconditionally include in API requests. By default, fields with
  7759. // empty values are omitted from API requests. However, any non-pointer,
  7760. // non-interface field appearing in ForceSendFields will be sent to the
  7761. // server regardless of whether the field is empty or not. This may be
  7762. // used to include empty fields in Patch requests.
  7763. ForceSendFields []string `json:"-"`
  7764. // NullFields is a list of field names (e.g. "Left") to include in API
  7765. // requests with the JSON null value. By default, fields with empty
  7766. // values are omitted from API requests. However, any field with an
  7767. // empty value appearing in NullFields will be sent to the server as
  7768. // null. It is an error if a field in this list has a non-empty value.
  7769. // This may be used to include null fields in Patch requests.
  7770. NullFields []string `json:"-"`
  7771. }
  7772. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7773. type NoMethod OffsetPosition
  7774. raw := NoMethod(*s)
  7775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7776. }
  7777. // OmnitureSettings: Omniture Integration Settings.
  7778. type OmnitureSettings struct {
  7779. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7780. // Omniture. This property can be enabled only if
  7781. // omnitureIntegrationEnabled is true.
  7782. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7783. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7784. // This property can be enabled only when the "Advanced Ad Serving"
  7785. // account setting is enabled.
  7786. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7787. // ForceSendFields is a list of field names (e.g.
  7788. // "OmnitureCostDataEnabled") to unconditionally include in API
  7789. // requests. By default, fields with empty values are omitted from API
  7790. // requests. However, any non-pointer, non-interface field appearing in
  7791. // ForceSendFields will be sent to the server regardless of whether the
  7792. // field is empty or not. This may be used to include empty fields in
  7793. // Patch requests.
  7794. ForceSendFields []string `json:"-"`
  7795. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7796. // to include in API requests with the JSON null value. By default,
  7797. // fields with empty values are omitted from API requests. However, any
  7798. // field with an empty value appearing in NullFields will be sent to the
  7799. // server as null. It is an error if a field in this list has a
  7800. // non-empty value. This may be used to include null fields in Patch
  7801. // requests.
  7802. NullFields []string `json:"-"`
  7803. }
  7804. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7805. type NoMethod OmnitureSettings
  7806. raw := NoMethod(*s)
  7807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7808. }
  7809. // OperatingSystem: Contains information about an operating system that
  7810. // can be targeted by ads.
  7811. type OperatingSystem struct {
  7812. // DartId: DART ID of this operating system. This is the ID used for
  7813. // targeting.
  7814. DartId int64 `json:"dartId,omitempty,string"`
  7815. // Desktop: Whether this operating system is for desktop.
  7816. Desktop bool `json:"desktop,omitempty"`
  7817. // Kind: Identifies what kind of resource this is. Value: the fixed
  7818. // string "dfareporting#operatingSystem".
  7819. Kind string `json:"kind,omitempty"`
  7820. // Mobile: Whether this operating system is for mobile.
  7821. Mobile bool `json:"mobile,omitempty"`
  7822. // Name: Name of this operating system.
  7823. Name string `json:"name,omitempty"`
  7824. // ServerResponse contains the HTTP response code and headers from the
  7825. // server.
  7826. googleapi.ServerResponse `json:"-"`
  7827. // ForceSendFields is a list of field names (e.g. "DartId") to
  7828. // unconditionally include in API requests. By default, fields with
  7829. // empty values are omitted from API requests. However, any non-pointer,
  7830. // non-interface field appearing in ForceSendFields will be sent to the
  7831. // server regardless of whether the field is empty or not. This may be
  7832. // used to include empty fields in Patch requests.
  7833. ForceSendFields []string `json:"-"`
  7834. // NullFields is a list of field names (e.g. "DartId") to include in API
  7835. // requests with the JSON null value. By default, fields with empty
  7836. // values are omitted from API requests. However, any field with an
  7837. // empty value appearing in NullFields will be sent to the server as
  7838. // null. It is an error if a field in this list has a non-empty value.
  7839. // This may be used to include null fields in Patch requests.
  7840. NullFields []string `json:"-"`
  7841. }
  7842. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7843. type NoMethod OperatingSystem
  7844. raw := NoMethod(*s)
  7845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7846. }
  7847. // OperatingSystemVersion: Contains information about a particular
  7848. // version of an operating system that can be targeted by ads.
  7849. type OperatingSystemVersion struct {
  7850. // Id: ID of this operating system version.
  7851. Id int64 `json:"id,omitempty,string"`
  7852. // Kind: Identifies what kind of resource this is. Value: the fixed
  7853. // string "dfareporting#operatingSystemVersion".
  7854. Kind string `json:"kind,omitempty"`
  7855. // MajorVersion: Major version (leftmost number) of this operating
  7856. // system version.
  7857. MajorVersion string `json:"majorVersion,omitempty"`
  7858. // MinorVersion: Minor version (number after the first dot) of this
  7859. // operating system version.
  7860. MinorVersion string `json:"minorVersion,omitempty"`
  7861. // Name: Name of this operating system version.
  7862. Name string `json:"name,omitempty"`
  7863. // OperatingSystem: Operating system of this operating system version.
  7864. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7865. // ServerResponse contains the HTTP response code and headers from the
  7866. // server.
  7867. googleapi.ServerResponse `json:"-"`
  7868. // ForceSendFields is a list of field names (e.g. "Id") to
  7869. // unconditionally include in API requests. By default, fields with
  7870. // empty values are omitted from API requests. However, any non-pointer,
  7871. // non-interface field appearing in ForceSendFields will be sent to the
  7872. // server regardless of whether the field is empty or not. This may be
  7873. // used to include empty fields in Patch requests.
  7874. ForceSendFields []string `json:"-"`
  7875. // NullFields is a list of field names (e.g. "Id") to include in API
  7876. // requests with the JSON null value. By default, fields with empty
  7877. // values are omitted from API requests. However, any field with an
  7878. // empty value appearing in NullFields will be sent to the server as
  7879. // null. It is an error if a field in this list has a non-empty value.
  7880. // This may be used to include null fields in Patch requests.
  7881. NullFields []string `json:"-"`
  7882. }
  7883. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7884. type NoMethod OperatingSystemVersion
  7885. raw := NoMethod(*s)
  7886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7887. }
  7888. // OperatingSystemVersionsListResponse: Operating System Version List
  7889. // Response
  7890. type OperatingSystemVersionsListResponse struct {
  7891. // Kind: Identifies what kind of resource this is. Value: the fixed
  7892. // string "dfareporting#operatingSystemVersionsListResponse".
  7893. Kind string `json:"kind,omitempty"`
  7894. // OperatingSystemVersions: Operating system version collection.
  7895. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7896. // ServerResponse contains the HTTP response code and headers from the
  7897. // server.
  7898. googleapi.ServerResponse `json:"-"`
  7899. // ForceSendFields is a list of field names (e.g. "Kind") to
  7900. // unconditionally include in API requests. By default, fields with
  7901. // empty values are omitted from API requests. However, any non-pointer,
  7902. // non-interface field appearing in ForceSendFields will be sent to the
  7903. // server regardless of whether the field is empty or not. This may be
  7904. // used to include empty fields in Patch requests.
  7905. ForceSendFields []string `json:"-"`
  7906. // NullFields is a list of field names (e.g. "Kind") to include in API
  7907. // requests with the JSON null value. By default, fields with empty
  7908. // values are omitted from API requests. However, any field with an
  7909. // empty value appearing in NullFields will be sent to the server as
  7910. // null. It is an error if a field in this list has a non-empty value.
  7911. // This may be used to include null fields in Patch requests.
  7912. NullFields []string `json:"-"`
  7913. }
  7914. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7915. type NoMethod OperatingSystemVersionsListResponse
  7916. raw := NoMethod(*s)
  7917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7918. }
  7919. // OperatingSystemsListResponse: Operating System List Response
  7920. type OperatingSystemsListResponse struct {
  7921. // Kind: Identifies what kind of resource this is. Value: the fixed
  7922. // string "dfareporting#operatingSystemsListResponse".
  7923. Kind string `json:"kind,omitempty"`
  7924. // OperatingSystems: Operating system collection.
  7925. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7926. // ServerResponse contains the HTTP response code and headers from the
  7927. // server.
  7928. googleapi.ServerResponse `json:"-"`
  7929. // ForceSendFields is a list of field names (e.g. "Kind") to
  7930. // unconditionally include in API requests. By default, fields with
  7931. // empty values are omitted from API requests. However, any non-pointer,
  7932. // non-interface field appearing in ForceSendFields will be sent to the
  7933. // server regardless of whether the field is empty or not. This may be
  7934. // used to include empty fields in Patch requests.
  7935. ForceSendFields []string `json:"-"`
  7936. // NullFields is a list of field names (e.g. "Kind") to include in API
  7937. // requests with the JSON null value. By default, fields with empty
  7938. // values are omitted from API requests. However, any field with an
  7939. // empty value appearing in NullFields will be sent to the server as
  7940. // null. It is an error if a field in this list has a non-empty value.
  7941. // This may be used to include null fields in Patch requests.
  7942. NullFields []string `json:"-"`
  7943. }
  7944. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7945. type NoMethod OperatingSystemsListResponse
  7946. raw := NoMethod(*s)
  7947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7948. }
  7949. // OptimizationActivity: Creative optimization activity.
  7950. type OptimizationActivity struct {
  7951. // FloodlightActivityId: Floodlight activity ID of this optimization
  7952. // activity. This is a required field.
  7953. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7954. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7955. // floodlight activity. This is a read-only, auto-generated field.
  7956. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7957. // Weight: Weight associated with this optimization. The weight assigned
  7958. // will be understood in proportion to the weights assigned to the other
  7959. // optimization activities. Value must be greater than or equal to 1.
  7960. Weight int64 `json:"weight,omitempty"`
  7961. // ForceSendFields is a list of field names (e.g.
  7962. // "FloodlightActivityId") to unconditionally include in API requests.
  7963. // By default, fields with empty values are omitted from API requests.
  7964. // However, any non-pointer, non-interface field appearing in
  7965. // ForceSendFields will be sent to the server regardless of whether the
  7966. // field is empty or not. This may be used to include empty fields in
  7967. // Patch requests.
  7968. ForceSendFields []string `json:"-"`
  7969. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7970. // include in API requests with the JSON null value. By default, fields
  7971. // with empty values are omitted from API requests. However, any field
  7972. // with an empty value appearing in NullFields will be sent to the
  7973. // server as null. It is an error if a field in this list has a
  7974. // non-empty value. This may be used to include null fields in Patch
  7975. // requests.
  7976. NullFields []string `json:"-"`
  7977. }
  7978. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7979. type NoMethod OptimizationActivity
  7980. raw := NoMethod(*s)
  7981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7982. }
  7983. // Order: Describes properties of a Planning order.
  7984. type Order struct {
  7985. // AccountId: Account ID of this order.
  7986. AccountId int64 `json:"accountId,omitempty,string"`
  7987. // AdvertiserId: Advertiser ID of this order.
  7988. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7989. // ApproverUserProfileIds: IDs for users that have to approve documents
  7990. // created for this order.
  7991. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7992. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7993. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7994. // BuyerOrganizationName: Name of the buyer organization.
  7995. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7996. // Comments: Comments in this order.
  7997. Comments string `json:"comments,omitempty"`
  7998. // Contacts: Contacts for this order.
  7999. Contacts []*OrderContact `json:"contacts,omitempty"`
  8000. // Id: ID of this order. This is a read-only, auto-generated field.
  8001. Id int64 `json:"id,omitempty,string"`
  8002. // Kind: Identifies what kind of resource this is. Value: the fixed
  8003. // string "dfareporting#order".
  8004. Kind string `json:"kind,omitempty"`
  8005. // LastModifiedInfo: Information about the most recent modification of
  8006. // this order.
  8007. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8008. // Name: Name of this order.
  8009. Name string `json:"name,omitempty"`
  8010. // Notes: Notes of this order.
  8011. Notes string `json:"notes,omitempty"`
  8012. // PlanningTermId: ID of the terms and conditions template used in this
  8013. // order.
  8014. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  8015. // ProjectId: Project ID of this order.
  8016. ProjectId int64 `json:"projectId,omitempty,string"`
  8017. // SellerOrderId: Seller order ID associated with this order.
  8018. SellerOrderId string `json:"sellerOrderId,omitempty"`
  8019. // SellerOrganizationName: Name of the seller organization.
  8020. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  8021. // SiteId: Site IDs this order is associated with.
  8022. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  8023. // SiteNames: Free-form site names this order is associated with.
  8024. SiteNames []string `json:"siteNames,omitempty"`
  8025. // SubaccountId: Subaccount ID of this order.
  8026. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8027. // TermsAndConditions: Terms and conditions of this order.
  8028. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  8029. // ServerResponse contains the HTTP response code and headers from the
  8030. // server.
  8031. googleapi.ServerResponse `json:"-"`
  8032. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8033. // unconditionally include in API requests. By default, fields with
  8034. // empty values are omitted from API requests. However, any non-pointer,
  8035. // non-interface field appearing in ForceSendFields will be sent to the
  8036. // server regardless of whether the field is empty or not. This may be
  8037. // used to include empty fields in Patch requests.
  8038. ForceSendFields []string `json:"-"`
  8039. // NullFields is a list of field names (e.g. "AccountId") to include in
  8040. // API requests with the JSON null value. By default, fields with empty
  8041. // values are omitted from API requests. However, any field with an
  8042. // empty value appearing in NullFields will be sent to the server as
  8043. // null. It is an error if a field in this list has a non-empty value.
  8044. // This may be used to include null fields in Patch requests.
  8045. NullFields []string `json:"-"`
  8046. }
  8047. func (s *Order) MarshalJSON() ([]byte, error) {
  8048. type NoMethod Order
  8049. raw := NoMethod(*s)
  8050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8051. }
  8052. // OrderContact: Contact of an order.
  8053. type OrderContact struct {
  8054. // ContactInfo: Free-form information about this contact. It could be
  8055. // any information related to this contact in addition to type, title,
  8056. // name, and signature user profile ID.
  8057. ContactInfo string `json:"contactInfo,omitempty"`
  8058. // ContactName: Name of this contact.
  8059. ContactName string `json:"contactName,omitempty"`
  8060. // ContactTitle: Title of this contact.
  8061. ContactTitle string `json:"contactTitle,omitempty"`
  8062. // ContactType: Type of this contact.
  8063. //
  8064. // Possible values:
  8065. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  8066. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  8067. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  8068. ContactType string `json:"contactType,omitempty"`
  8069. // SignatureUserProfileId: ID of the user profile containing the
  8070. // signature that will be embedded into order documents.
  8071. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  8072. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  8073. // unconditionally include in API requests. By default, fields with
  8074. // empty values are omitted from API requests. However, any non-pointer,
  8075. // non-interface field appearing in ForceSendFields will be sent to the
  8076. // server regardless of whether the field is empty or not. This may be
  8077. // used to include empty fields in Patch requests.
  8078. ForceSendFields []string `json:"-"`
  8079. // NullFields is a list of field names (e.g. "ContactInfo") to include
  8080. // in API requests with the JSON null value. By default, fields with
  8081. // empty values are omitted from API requests. However, any field with
  8082. // an empty value appearing in NullFields will be sent to the server as
  8083. // null. It is an error if a field in this list has a non-empty value.
  8084. // This may be used to include null fields in Patch requests.
  8085. NullFields []string `json:"-"`
  8086. }
  8087. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  8088. type NoMethod OrderContact
  8089. raw := NoMethod(*s)
  8090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8091. }
  8092. // OrderDocument: Contains properties of a Planning order document.
  8093. type OrderDocument struct {
  8094. // AccountId: Account ID of this order document.
  8095. AccountId int64 `json:"accountId,omitempty,string"`
  8096. // AdvertiserId: Advertiser ID of this order document.
  8097. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8098. // AmendedOrderDocumentId: The amended order document ID of this order
  8099. // document. An order document can be created by optionally amending
  8100. // another order document so that the change history can be preserved.
  8101. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  8102. // ApprovedByUserProfileIds: IDs of users who have approved this order
  8103. // document.
  8104. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  8105. // Cancelled: Whether this order document is cancelled.
  8106. Cancelled bool `json:"cancelled,omitempty"`
  8107. // CreatedInfo: Information about the creation of this order document.
  8108. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  8109. // EffectiveDate: Effective date of this order document.
  8110. EffectiveDate string `json:"effectiveDate,omitempty"`
  8111. // Id: ID of this order document.
  8112. Id int64 `json:"id,omitempty,string"`
  8113. // Kind: Identifies what kind of resource this is. Value: the fixed
  8114. // string "dfareporting#orderDocument".
  8115. Kind string `json:"kind,omitempty"`
  8116. // LastSentRecipients: List of email addresses that received the last
  8117. // sent document.
  8118. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  8119. // LastSentTime: Timestamp of the last email sent with this order
  8120. // document.
  8121. LastSentTime string `json:"lastSentTime,omitempty"`
  8122. // OrderId: ID of the order from which this order document is created.
  8123. OrderId int64 `json:"orderId,omitempty,string"`
  8124. // ProjectId: Project ID of this order document.
  8125. ProjectId int64 `json:"projectId,omitempty,string"`
  8126. // Signed: Whether this order document has been signed.
  8127. Signed bool `json:"signed,omitempty"`
  8128. // SubaccountId: Subaccount ID of this order document.
  8129. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8130. // Title: Title of this order document.
  8131. Title string `json:"title,omitempty"`
  8132. // Type: Type of this order document
  8133. //
  8134. // Possible values:
  8135. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  8136. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  8137. Type string `json:"type,omitempty"`
  8138. // ServerResponse contains the HTTP response code and headers from the
  8139. // server.
  8140. googleapi.ServerResponse `json:"-"`
  8141. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8142. // unconditionally include in API requests. By default, fields with
  8143. // empty values are omitted from API requests. However, any non-pointer,
  8144. // non-interface field appearing in ForceSendFields will be sent to the
  8145. // server regardless of whether the field is empty or not. This may be
  8146. // used to include empty fields in Patch requests.
  8147. ForceSendFields []string `json:"-"`
  8148. // NullFields is a list of field names (e.g. "AccountId") to include in
  8149. // API requests with the JSON null value. By default, fields with empty
  8150. // values are omitted from API requests. However, any field with an
  8151. // empty value appearing in NullFields will be sent to the server as
  8152. // null. It is an error if a field in this list has a non-empty value.
  8153. // This may be used to include null fields in Patch requests.
  8154. NullFields []string `json:"-"`
  8155. }
  8156. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  8157. type NoMethod OrderDocument
  8158. raw := NoMethod(*s)
  8159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8160. }
  8161. // OrderDocumentsListResponse: Order document List Response
  8162. type OrderDocumentsListResponse struct {
  8163. // Kind: Identifies what kind of resource this is. Value: the fixed
  8164. // string "dfareporting#orderDocumentsListResponse".
  8165. Kind string `json:"kind,omitempty"`
  8166. // NextPageToken: Pagination token to be used for the next list
  8167. // operation.
  8168. NextPageToken string `json:"nextPageToken,omitempty"`
  8169. // OrderDocuments: Order document collection
  8170. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  8171. // ServerResponse contains the HTTP response code and headers from the
  8172. // server.
  8173. googleapi.ServerResponse `json:"-"`
  8174. // ForceSendFields is a list of field names (e.g. "Kind") to
  8175. // unconditionally include in API requests. By default, fields with
  8176. // empty values are omitted from API requests. However, any non-pointer,
  8177. // non-interface field appearing in ForceSendFields will be sent to the
  8178. // server regardless of whether the field is empty or not. This may be
  8179. // used to include empty fields in Patch requests.
  8180. ForceSendFields []string `json:"-"`
  8181. // NullFields is a list of field names (e.g. "Kind") to include in API
  8182. // requests with the JSON null value. By default, fields with empty
  8183. // values are omitted from API requests. However, any field with an
  8184. // empty value appearing in NullFields will be sent to the server as
  8185. // null. It is an error if a field in this list has a non-empty value.
  8186. // This may be used to include null fields in Patch requests.
  8187. NullFields []string `json:"-"`
  8188. }
  8189. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  8190. type NoMethod OrderDocumentsListResponse
  8191. raw := NoMethod(*s)
  8192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8193. }
  8194. // OrdersListResponse: Order List Response
  8195. type OrdersListResponse struct {
  8196. // Kind: Identifies what kind of resource this is. Value: the fixed
  8197. // string "dfareporting#ordersListResponse".
  8198. Kind string `json:"kind,omitempty"`
  8199. // NextPageToken: Pagination token to be used for the next list
  8200. // operation.
  8201. NextPageToken string `json:"nextPageToken,omitempty"`
  8202. // Orders: Order collection.
  8203. Orders []*Order `json:"orders,omitempty"`
  8204. // ServerResponse contains the HTTP response code and headers from the
  8205. // server.
  8206. googleapi.ServerResponse `json:"-"`
  8207. // ForceSendFields is a list of field names (e.g. "Kind") to
  8208. // unconditionally include in API requests. By default, fields with
  8209. // empty values are omitted from API requests. However, any non-pointer,
  8210. // non-interface field appearing in ForceSendFields will be sent to the
  8211. // server regardless of whether the field is empty or not. This may be
  8212. // used to include empty fields in Patch requests.
  8213. ForceSendFields []string `json:"-"`
  8214. // NullFields is a list of field names (e.g. "Kind") to include in API
  8215. // requests with the JSON null value. By default, fields with empty
  8216. // values are omitted from API requests. However, any field with an
  8217. // empty value appearing in NullFields will be sent to the server as
  8218. // null. It is an error if a field in this list has a non-empty value.
  8219. // This may be used to include null fields in Patch requests.
  8220. NullFields []string `json:"-"`
  8221. }
  8222. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  8223. type NoMethod OrdersListResponse
  8224. raw := NoMethod(*s)
  8225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8226. }
  8227. // PathToConversionReportCompatibleFields: Represents fields that are
  8228. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  8229. type PathToConversionReportCompatibleFields struct {
  8230. // ConversionDimensions: Conversion dimensions which are compatible to
  8231. // be selected in the "conversionDimensions" section of the report.
  8232. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  8233. // CustomFloodlightVariables: Custom floodlight variables which are
  8234. // compatible to be selected in the "customFloodlightVariables" section
  8235. // of the report.
  8236. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  8237. // Kind: The kind of resource this is, in this case
  8238. // dfareporting#pathToConversionReportCompatibleFields.
  8239. Kind string `json:"kind,omitempty"`
  8240. // Metrics: Metrics which are compatible to be selected in the
  8241. // "metricNames" section of the report.
  8242. Metrics []*Metric `json:"metrics,omitempty"`
  8243. // PerInteractionDimensions: Per-interaction dimensions which are
  8244. // compatible to be selected in the "perInteractionDimensions" section
  8245. // of the report.
  8246. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  8247. // ForceSendFields is a list of field names (e.g.
  8248. // "ConversionDimensions") to unconditionally include in API requests.
  8249. // By default, fields with empty values are omitted from API requests.
  8250. // However, any non-pointer, non-interface field appearing in
  8251. // ForceSendFields will be sent to the server regardless of whether the
  8252. // field is empty or not. This may be used to include empty fields in
  8253. // Patch requests.
  8254. ForceSendFields []string `json:"-"`
  8255. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  8256. // include in API requests with the JSON null value. By default, fields
  8257. // with empty values are omitted from API requests. However, any field
  8258. // with an empty value appearing in NullFields will be sent to the
  8259. // server as null. It is an error if a field in this list has a
  8260. // non-empty value. This may be used to include null fields in Patch
  8261. // requests.
  8262. NullFields []string `json:"-"`
  8263. }
  8264. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8265. type NoMethod PathToConversionReportCompatibleFields
  8266. raw := NoMethod(*s)
  8267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8268. }
  8269. // Placement: Contains properties of a placement.
  8270. type Placement struct {
  8271. // AccountId: Account ID of this placement. This field can be left
  8272. // blank.
  8273. AccountId int64 `json:"accountId,omitempty,string"`
  8274. // AdBlockingOptOut: Whether this placement opts out of ad blocking.
  8275. // When true, ad blocking is disabled for this placement. When false,
  8276. // the campaign and site settings take effect.
  8277. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  8278. // AdvertiserId: Advertiser ID of this placement. This field can be left
  8279. // blank.
  8280. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8281. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8282. // advertiser. This is a read-only, auto-generated field.
  8283. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8284. // Archived: Whether this placement is archived.
  8285. Archived bool `json:"archived,omitempty"`
  8286. // CampaignId: Campaign ID of this placement. This field is a required
  8287. // field on insertion.
  8288. CampaignId int64 `json:"campaignId,omitempty,string"`
  8289. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8290. // This is a read-only, auto-generated field.
  8291. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8292. // Comment: Comments for this placement.
  8293. Comment string `json:"comment,omitempty"`
  8294. // Compatibility: Placement compatibility. DISPLAY and
  8295. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  8296. // or in mobile apps for regular or interstitial ads respectively. APP
  8297. // and APP_INTERSTITIAL are no longer allowed for new placement
  8298. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  8299. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  8300. // with the VAST standard. This field is required on insertion.
  8301. //
  8302. // Possible values:
  8303. // "APP"
  8304. // "APP_INTERSTITIAL"
  8305. // "DISPLAY"
  8306. // "DISPLAY_INTERSTITIAL"
  8307. // "IN_STREAM_AUDIO"
  8308. // "IN_STREAM_VIDEO"
  8309. Compatibility string `json:"compatibility,omitempty"`
  8310. // ContentCategoryId: ID of the content category assigned to this
  8311. // placement.
  8312. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8313. // CreateInfo: Information about the creation of this placement. This is
  8314. // a read-only field.
  8315. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8316. // DirectorySiteId: Directory site ID of this placement. On insert, you
  8317. // must set either this field or the siteId field to specify the site
  8318. // associated with this placement. This is a required field that is
  8319. // read-only after insertion.
  8320. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8321. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8322. // directory site. This is a read-only, auto-generated field.
  8323. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8324. // ExternalId: External ID for this placement.
  8325. ExternalId string `json:"externalId,omitempty"`
  8326. // Id: ID of this placement. This is a read-only, auto-generated field.
  8327. Id int64 `json:"id,omitempty,string"`
  8328. // IdDimensionValue: Dimension value for the ID of this placement. This
  8329. // is a read-only, auto-generated field.
  8330. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8331. // KeyName: Key name of this placement. This is a read-only,
  8332. // auto-generated field.
  8333. KeyName string `json:"keyName,omitempty"`
  8334. // Kind: Identifies what kind of resource this is. Value: the fixed
  8335. // string "dfareporting#placement".
  8336. Kind string `json:"kind,omitempty"`
  8337. // LastModifiedInfo: Information about the most recent modification of
  8338. // this placement. This is a read-only field.
  8339. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8340. // LookbackConfiguration: Lookback window settings for this placement.
  8341. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  8342. // Name: Name of this placement.This is a required field and must be
  8343. // less than 256 characters long.
  8344. Name string `json:"name,omitempty"`
  8345. // PaymentApproved: Whether payment was approved for this placement.
  8346. // This is a read-only field relevant only to publisher-paid placements.
  8347. PaymentApproved bool `json:"paymentApproved,omitempty"`
  8348. // PaymentSource: Payment source for this placement. This is a required
  8349. // field that is read-only after insertion.
  8350. //
  8351. // Possible values:
  8352. // "PLACEMENT_AGENCY_PAID"
  8353. // "PLACEMENT_PUBLISHER_PAID"
  8354. PaymentSource string `json:"paymentSource,omitempty"`
  8355. // PlacementGroupId: ID of this placement's group, if applicable.
  8356. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  8357. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  8358. // placement group. This is a read-only, auto-generated field.
  8359. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  8360. // PlacementStrategyId: ID of the placement strategy assigned to this
  8361. // placement.
  8362. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8363. // PricingSchedule: Pricing schedule of this placement. This field is
  8364. // required on insertion, specifically subfields startDate, endDate and
  8365. // pricingType.
  8366. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8367. // Primary: Whether this placement is the primary placement of a
  8368. // roadblock (placement group). You cannot change this field from true
  8369. // to false. Setting this field to true will automatically set the
  8370. // primary field on the original primary placement of the roadblock to
  8371. // false, and it will automatically set the roadblock's
  8372. // primaryPlacementId field to the ID of this placement.
  8373. Primary bool `json:"primary,omitempty"`
  8374. // PublisherUpdateInfo: Information about the last publisher update.
  8375. // This is a read-only field.
  8376. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8377. // SiteId: Site ID associated with this placement. On insert, you must
  8378. // set either this field or the directorySiteId field to specify the
  8379. // site associated with this placement. This is a required field that is
  8380. // read-only after insertion.
  8381. SiteId int64 `json:"siteId,omitempty,string"`
  8382. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8383. // a read-only, auto-generated field.
  8384. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8385. // Size: Size associated with this placement. When inserting or updating
  8386. // a placement, only the size ID field is used. This field is required
  8387. // on insertion.
  8388. Size *Size `json:"size,omitempty"`
  8389. // SslRequired: Whether creatives assigned to this placement must be
  8390. // SSL-compliant.
  8391. SslRequired bool `json:"sslRequired,omitempty"`
  8392. // Status: Third-party placement status.
  8393. //
  8394. // Possible values:
  8395. // "ACKNOWLEDGE_ACCEPTANCE"
  8396. // "ACKNOWLEDGE_REJECTION"
  8397. // "DRAFT"
  8398. // "PAYMENT_ACCEPTED"
  8399. // "PAYMENT_REJECTED"
  8400. // "PENDING_REVIEW"
  8401. Status string `json:"status,omitempty"`
  8402. // SubaccountId: Subaccount ID of this placement. This field can be left
  8403. // blank.
  8404. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8405. // TagFormats: Tag formats to generate for this placement. This field is
  8406. // required on insertion.
  8407. // Acceptable values are:
  8408. // - "PLACEMENT_TAG_STANDARD"
  8409. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8410. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8411. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8412. // - "PLACEMENT_TAG_JAVASCRIPT"
  8413. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8414. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8415. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8416. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8417. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8418. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8419. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8420. // - "PLACEMENT_TAG_TRACKING"
  8421. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8422. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8423. //
  8424. // Possible values:
  8425. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8426. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8427. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8428. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8429. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8430. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8431. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8432. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8433. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8434. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8435. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8436. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8437. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8438. // "PLACEMENT_TAG_JAVASCRIPT"
  8439. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8440. // "PLACEMENT_TAG_STANDARD"
  8441. // "PLACEMENT_TAG_TRACKING"
  8442. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8443. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8444. TagFormats []string `json:"tagFormats,omitempty"`
  8445. // TagSetting: Tag settings for this placement.
  8446. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8447. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8448. // disabled for in-stream video creatives for this placement. The same
  8449. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8450. // occurs if either of these settings are true. These settings are
  8451. // distinct from DirectorySites.settings.activeViewOptOut or
  8452. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8453. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8454. // well as display ads, from Verification and ActiveView.
  8455. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8456. // VideoSettings: A collection of settings which affect video creatives
  8457. // served through this placement. Applicable to placements with
  8458. // IN_STREAM_VIDEO compatibility.
  8459. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8460. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8461. // Controls which VPAID format the measurement adapter will use for
  8462. // in-stream video creatives assigned to this placement.
  8463. //
  8464. // Note: Flash is no longer supported. This field now defaults to HTML5
  8465. // when the following values are provided: FLASH, BOTH.
  8466. //
  8467. // Possible values:
  8468. // "BOTH"
  8469. // "DEFAULT"
  8470. // "FLASH"
  8471. // "HTML5"
  8472. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8473. // ServerResponse contains the HTTP response code and headers from the
  8474. // server.
  8475. googleapi.ServerResponse `json:"-"`
  8476. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8477. // unconditionally include in API requests. By default, fields with
  8478. // empty values are omitted from API requests. However, any non-pointer,
  8479. // non-interface field appearing in ForceSendFields will be sent to the
  8480. // server regardless of whether the field is empty or not. This may be
  8481. // used to include empty fields in Patch requests.
  8482. ForceSendFields []string `json:"-"`
  8483. // NullFields is a list of field names (e.g. "AccountId") to include in
  8484. // API requests with the JSON null value. By default, fields with empty
  8485. // values are omitted from API requests. However, any field with an
  8486. // empty value appearing in NullFields will be sent to the server as
  8487. // null. It is an error if a field in this list has a non-empty value.
  8488. // This may be used to include null fields in Patch requests.
  8489. NullFields []string `json:"-"`
  8490. }
  8491. func (s *Placement) MarshalJSON() ([]byte, error) {
  8492. type NoMethod Placement
  8493. raw := NoMethod(*s)
  8494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8495. }
  8496. // PlacementAssignment: Placement Assignment.
  8497. type PlacementAssignment struct {
  8498. // Active: Whether this placement assignment is active. When true, the
  8499. // placement will be included in the ad's rotation.
  8500. Active bool `json:"active,omitempty"`
  8501. // PlacementId: ID of the placement to be assigned. This is a required
  8502. // field.
  8503. PlacementId int64 `json:"placementId,omitempty,string"`
  8504. // PlacementIdDimensionValue: Dimension value for the ID of the
  8505. // placement. This is a read-only, auto-generated field.
  8506. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8507. // SslRequired: Whether the placement to be assigned requires SSL. This
  8508. // is a read-only field that is auto-generated when the ad is inserted
  8509. // or updated.
  8510. SslRequired bool `json:"sslRequired,omitempty"`
  8511. // ForceSendFields is a list of field names (e.g. "Active") to
  8512. // unconditionally include in API requests. By default, fields with
  8513. // empty values are omitted from API requests. However, any non-pointer,
  8514. // non-interface field appearing in ForceSendFields will be sent to the
  8515. // server regardless of whether the field is empty or not. This may be
  8516. // used to include empty fields in Patch requests.
  8517. ForceSendFields []string `json:"-"`
  8518. // NullFields is a list of field names (e.g. "Active") to include in API
  8519. // requests with the JSON null value. By default, fields with empty
  8520. // values are omitted from API requests. However, any field with an
  8521. // empty value appearing in NullFields will be sent to the server as
  8522. // null. It is an error if a field in this list has a non-empty value.
  8523. // This may be used to include null fields in Patch requests.
  8524. NullFields []string `json:"-"`
  8525. }
  8526. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8527. type NoMethod PlacementAssignment
  8528. raw := NoMethod(*s)
  8529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8530. }
  8531. // PlacementGroup: Contains properties of a package or roadblock.
  8532. type PlacementGroup struct {
  8533. // AccountId: Account ID of this placement group. This is a read-only
  8534. // field that can be left blank.
  8535. AccountId int64 `json:"accountId,omitempty,string"`
  8536. // AdvertiserId: Advertiser ID of this placement group. This is a
  8537. // required field on insertion.
  8538. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8539. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8540. // advertiser. This is a read-only, auto-generated field.
  8541. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8542. // Archived: Whether this placement group is archived.
  8543. Archived bool `json:"archived,omitempty"`
  8544. // CampaignId: Campaign ID of this placement group. This field is
  8545. // required on insertion.
  8546. CampaignId int64 `json:"campaignId,omitempty,string"`
  8547. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8548. // This is a read-only, auto-generated field.
  8549. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8550. // ChildPlacementIds: IDs of placements which are assigned to this
  8551. // placement group. This is a read-only, auto-generated field.
  8552. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8553. // Comment: Comments for this placement group.
  8554. Comment string `json:"comment,omitempty"`
  8555. // ContentCategoryId: ID of the content category assigned to this
  8556. // placement group.
  8557. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8558. // CreateInfo: Information about the creation of this placement group.
  8559. // This is a read-only field.
  8560. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8561. // DirectorySiteId: Directory site ID associated with this placement
  8562. // group. On insert, you must set either this field or the site_id field
  8563. // to specify the site associated with this placement group. This is a
  8564. // required field that is read-only after insertion.
  8565. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8566. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8567. // directory site. This is a read-only, auto-generated field.
  8568. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8569. // ExternalId: External ID for this placement.
  8570. ExternalId string `json:"externalId,omitempty"`
  8571. // Id: ID of this placement group. This is a read-only, auto-generated
  8572. // field.
  8573. Id int64 `json:"id,omitempty,string"`
  8574. // IdDimensionValue: Dimension value for the ID of this placement group.
  8575. // This is a read-only, auto-generated field.
  8576. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8577. // Kind: Identifies what kind of resource this is. Value: the fixed
  8578. // string "dfareporting#placementGroup".
  8579. Kind string `json:"kind,omitempty"`
  8580. // LastModifiedInfo: Information about the most recent modification of
  8581. // this placement group. This is a read-only field.
  8582. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8583. // Name: Name of this placement group. This is a required field and must
  8584. // be less than 256 characters long.
  8585. Name string `json:"name,omitempty"`
  8586. // PlacementGroupType: Type of this placement group. A package is a
  8587. // simple group of placements that acts as a single pricing point for a
  8588. // group of tags. A roadblock is a group of placements that not only
  8589. // acts as a single pricing point, but also assumes that all the tags in
  8590. // it will be served at the same time. A roadblock requires one of its
  8591. // assigned placements to be marked as primary for reporting. This field
  8592. // is required on insertion.
  8593. //
  8594. // Possible values:
  8595. // "PLACEMENT_PACKAGE"
  8596. // "PLACEMENT_ROADBLOCK"
  8597. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8598. // PlacementStrategyId: ID of the placement strategy assigned to this
  8599. // placement group.
  8600. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8601. // PricingSchedule: Pricing schedule of this placement group. This field
  8602. // is required on insertion.
  8603. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8604. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8605. // the media cost of a roadblock (placement group). Modifying this field
  8606. // will automatically modify the primary field on all affected roadblock
  8607. // child placements.
  8608. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8609. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8610. // primary placement. This is a read-only, auto-generated field.
  8611. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8612. // SiteId: Site ID associated with this placement group. On insert, you
  8613. // must set either this field or the directorySiteId field to specify
  8614. // the site associated with this placement group. This is a required
  8615. // field that is read-only after insertion.
  8616. SiteId int64 `json:"siteId,omitempty,string"`
  8617. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8618. // a read-only, auto-generated field.
  8619. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8620. // SubaccountId: Subaccount ID of this placement group. This is a
  8621. // read-only field that can be left blank.
  8622. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8623. // ServerResponse contains the HTTP response code and headers from the
  8624. // server.
  8625. googleapi.ServerResponse `json:"-"`
  8626. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8627. // unconditionally include in API requests. By default, fields with
  8628. // empty values are omitted from API requests. However, any non-pointer,
  8629. // non-interface field appearing in ForceSendFields will be sent to the
  8630. // server regardless of whether the field is empty or not. This may be
  8631. // used to include empty fields in Patch requests.
  8632. ForceSendFields []string `json:"-"`
  8633. // NullFields is a list of field names (e.g. "AccountId") to include in
  8634. // API requests with the JSON null value. By default, fields with empty
  8635. // values are omitted from API requests. However, any field with an
  8636. // empty value appearing in NullFields will be sent to the server as
  8637. // null. It is an error if a field in this list has a non-empty value.
  8638. // This may be used to include null fields in Patch requests.
  8639. NullFields []string `json:"-"`
  8640. }
  8641. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8642. type NoMethod PlacementGroup
  8643. raw := NoMethod(*s)
  8644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8645. }
  8646. // PlacementGroupsListResponse: Placement Group List Response
  8647. type PlacementGroupsListResponse struct {
  8648. // Kind: Identifies what kind of resource this is. Value: the fixed
  8649. // string "dfareporting#placementGroupsListResponse".
  8650. Kind string `json:"kind,omitempty"`
  8651. // NextPageToken: Pagination token to be used for the next list
  8652. // operation.
  8653. NextPageToken string `json:"nextPageToken,omitempty"`
  8654. // PlacementGroups: Placement group collection.
  8655. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8656. // ServerResponse contains the HTTP response code and headers from the
  8657. // server.
  8658. googleapi.ServerResponse `json:"-"`
  8659. // ForceSendFields is a list of field names (e.g. "Kind") to
  8660. // unconditionally include in API requests. By default, fields with
  8661. // empty values are omitted from API requests. However, any non-pointer,
  8662. // non-interface field appearing in ForceSendFields will be sent to the
  8663. // server regardless of whether the field is empty or not. This may be
  8664. // used to include empty fields in Patch requests.
  8665. ForceSendFields []string `json:"-"`
  8666. // NullFields is a list of field names (e.g. "Kind") to include in API
  8667. // requests with the JSON null value. By default, fields with empty
  8668. // values are omitted from API requests. However, any field with an
  8669. // empty value appearing in NullFields will be sent to the server as
  8670. // null. It is an error if a field in this list has a non-empty value.
  8671. // This may be used to include null fields in Patch requests.
  8672. NullFields []string `json:"-"`
  8673. }
  8674. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8675. type NoMethod PlacementGroupsListResponse
  8676. raw := NoMethod(*s)
  8677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8678. }
  8679. // PlacementStrategiesListResponse: Placement Strategy List Response
  8680. type PlacementStrategiesListResponse struct {
  8681. // Kind: Identifies what kind of resource this is. Value: the fixed
  8682. // string "dfareporting#placementStrategiesListResponse".
  8683. Kind string `json:"kind,omitempty"`
  8684. // NextPageToken: Pagination token to be used for the next list
  8685. // operation.
  8686. NextPageToken string `json:"nextPageToken,omitempty"`
  8687. // PlacementStrategies: Placement strategy collection.
  8688. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8689. // ServerResponse contains the HTTP response code and headers from the
  8690. // server.
  8691. googleapi.ServerResponse `json:"-"`
  8692. // ForceSendFields is a list of field names (e.g. "Kind") to
  8693. // unconditionally include in API requests. By default, fields with
  8694. // empty values are omitted from API requests. However, any non-pointer,
  8695. // non-interface field appearing in ForceSendFields will be sent to the
  8696. // server regardless of whether the field is empty or not. This may be
  8697. // used to include empty fields in Patch requests.
  8698. ForceSendFields []string `json:"-"`
  8699. // NullFields is a list of field names (e.g. "Kind") to include in API
  8700. // requests with the JSON null value. By default, fields with empty
  8701. // values are omitted from API requests. However, any field with an
  8702. // empty value appearing in NullFields will be sent to the server as
  8703. // null. It is an error if a field in this list has a non-empty value.
  8704. // This may be used to include null fields in Patch requests.
  8705. NullFields []string `json:"-"`
  8706. }
  8707. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8708. type NoMethod PlacementStrategiesListResponse
  8709. raw := NoMethod(*s)
  8710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8711. }
  8712. // PlacementStrategy: Contains properties of a placement strategy.
  8713. type PlacementStrategy struct {
  8714. // AccountId: Account ID of this placement strategy.This is a read-only
  8715. // field that can be left blank.
  8716. AccountId int64 `json:"accountId,omitempty,string"`
  8717. // Id: ID of this placement strategy. This is a read-only,
  8718. // auto-generated field.
  8719. Id int64 `json:"id,omitempty,string"`
  8720. // Kind: Identifies what kind of resource this is. Value: the fixed
  8721. // string "dfareporting#placementStrategy".
  8722. Kind string `json:"kind,omitempty"`
  8723. // Name: Name of this placement strategy. This is a required field. It
  8724. // must be less than 256 characters long and unique among placement
  8725. // strategies of the same account.
  8726. Name string `json:"name,omitempty"`
  8727. // ServerResponse contains the HTTP response code and headers from the
  8728. // server.
  8729. googleapi.ServerResponse `json:"-"`
  8730. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8731. // unconditionally include in API requests. By default, fields with
  8732. // empty values are omitted from API requests. However, any non-pointer,
  8733. // non-interface field appearing in ForceSendFields will be sent to the
  8734. // server regardless of whether the field is empty or not. This may be
  8735. // used to include empty fields in Patch requests.
  8736. ForceSendFields []string `json:"-"`
  8737. // NullFields is a list of field names (e.g. "AccountId") to include in
  8738. // API requests with the JSON null value. By default, fields with empty
  8739. // values are omitted from API requests. However, any field with an
  8740. // empty value appearing in NullFields will be sent to the server as
  8741. // null. It is an error if a field in this list has a non-empty value.
  8742. // This may be used to include null fields in Patch requests.
  8743. NullFields []string `json:"-"`
  8744. }
  8745. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8746. type NoMethod PlacementStrategy
  8747. raw := NoMethod(*s)
  8748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8749. }
  8750. // PlacementTag: Placement Tag
  8751. type PlacementTag struct {
  8752. // PlacementId: Placement ID
  8753. PlacementId int64 `json:"placementId,omitempty,string"`
  8754. // TagDatas: Tags generated for this placement.
  8755. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8756. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8757. // unconditionally include in API requests. By default, fields with
  8758. // empty values are omitted from API requests. However, any non-pointer,
  8759. // non-interface field appearing in ForceSendFields will be sent to the
  8760. // server regardless of whether the field is empty or not. This may be
  8761. // used to include empty fields in Patch requests.
  8762. ForceSendFields []string `json:"-"`
  8763. // NullFields is a list of field names (e.g. "PlacementId") to include
  8764. // in API requests with the JSON null value. By default, fields with
  8765. // empty values are omitted from API requests. However, any field with
  8766. // an empty value appearing in NullFields will be sent to the server as
  8767. // null. It is an error if a field in this list has a non-empty value.
  8768. // This may be used to include null fields in Patch requests.
  8769. NullFields []string `json:"-"`
  8770. }
  8771. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8772. type NoMethod PlacementTag
  8773. raw := NoMethod(*s)
  8774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8775. }
  8776. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8777. type PlacementsGenerateTagsResponse struct {
  8778. // Kind: Identifies what kind of resource this is. Value: the fixed
  8779. // string "dfareporting#placementsGenerateTagsResponse".
  8780. Kind string `json:"kind,omitempty"`
  8781. // PlacementTags: Set of generated tags for the specified placements.
  8782. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8783. // ServerResponse contains the HTTP response code and headers from the
  8784. // server.
  8785. googleapi.ServerResponse `json:"-"`
  8786. // ForceSendFields is a list of field names (e.g. "Kind") to
  8787. // unconditionally include in API requests. By default, fields with
  8788. // empty values are omitted from API requests. However, any non-pointer,
  8789. // non-interface field appearing in ForceSendFields will be sent to the
  8790. // server regardless of whether the field is empty or not. This may be
  8791. // used to include empty fields in Patch requests.
  8792. ForceSendFields []string `json:"-"`
  8793. // NullFields is a list of field names (e.g. "Kind") to include in API
  8794. // requests with the JSON null value. By default, fields with empty
  8795. // values are omitted from API requests. However, any field with an
  8796. // empty value appearing in NullFields will be sent to the server as
  8797. // null. It is an error if a field in this list has a non-empty value.
  8798. // This may be used to include null fields in Patch requests.
  8799. NullFields []string `json:"-"`
  8800. }
  8801. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8802. type NoMethod PlacementsGenerateTagsResponse
  8803. raw := NoMethod(*s)
  8804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8805. }
  8806. // PlacementsListResponse: Placement List Response
  8807. type PlacementsListResponse struct {
  8808. // Kind: Identifies what kind of resource this is. Value: the fixed
  8809. // string "dfareporting#placementsListResponse".
  8810. Kind string `json:"kind,omitempty"`
  8811. // NextPageToken: Pagination token to be used for the next list
  8812. // operation.
  8813. NextPageToken string `json:"nextPageToken,omitempty"`
  8814. // Placements: Placement collection.
  8815. Placements []*Placement `json:"placements,omitempty"`
  8816. // ServerResponse contains the HTTP response code and headers from the
  8817. // server.
  8818. googleapi.ServerResponse `json:"-"`
  8819. // ForceSendFields is a list of field names (e.g. "Kind") to
  8820. // unconditionally include in API requests. By default, fields with
  8821. // empty values are omitted from API requests. However, any non-pointer,
  8822. // non-interface field appearing in ForceSendFields will be sent to the
  8823. // server regardless of whether the field is empty or not. This may be
  8824. // used to include empty fields in Patch requests.
  8825. ForceSendFields []string `json:"-"`
  8826. // NullFields is a list of field names (e.g. "Kind") to include in API
  8827. // requests with the JSON null value. By default, fields with empty
  8828. // values are omitted from API requests. However, any field with an
  8829. // empty value appearing in NullFields will be sent to the server as
  8830. // null. It is an error if a field in this list has a non-empty value.
  8831. // This may be used to include null fields in Patch requests.
  8832. NullFields []string `json:"-"`
  8833. }
  8834. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8835. type NoMethod PlacementsListResponse
  8836. raw := NoMethod(*s)
  8837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8838. }
  8839. // PlatformType: Contains information about a platform type that can be
  8840. // targeted by ads.
  8841. type PlatformType struct {
  8842. // Id: ID of this platform type.
  8843. Id int64 `json:"id,omitempty,string"`
  8844. // Kind: Identifies what kind of resource this is. Value: the fixed
  8845. // string "dfareporting#platformType".
  8846. Kind string `json:"kind,omitempty"`
  8847. // Name: Name of this platform type.
  8848. Name string `json:"name,omitempty"`
  8849. // ServerResponse contains the HTTP response code and headers from the
  8850. // server.
  8851. googleapi.ServerResponse `json:"-"`
  8852. // ForceSendFields is a list of field names (e.g. "Id") to
  8853. // unconditionally include in API requests. By default, fields with
  8854. // empty values are omitted from API requests. However, any non-pointer,
  8855. // non-interface field appearing in ForceSendFields will be sent to the
  8856. // server regardless of whether the field is empty or not. This may be
  8857. // used to include empty fields in Patch requests.
  8858. ForceSendFields []string `json:"-"`
  8859. // NullFields is a list of field names (e.g. "Id") to include in API
  8860. // requests with the JSON null value. By default, fields with empty
  8861. // values are omitted from API requests. However, any field with an
  8862. // empty value appearing in NullFields will be sent to the server as
  8863. // null. It is an error if a field in this list has a non-empty value.
  8864. // This may be used to include null fields in Patch requests.
  8865. NullFields []string `json:"-"`
  8866. }
  8867. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8868. type NoMethod PlatformType
  8869. raw := NoMethod(*s)
  8870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8871. }
  8872. // PlatformTypesListResponse: Platform Type List Response
  8873. type PlatformTypesListResponse struct {
  8874. // Kind: Identifies what kind of resource this is. Value: the fixed
  8875. // string "dfareporting#platformTypesListResponse".
  8876. Kind string `json:"kind,omitempty"`
  8877. // PlatformTypes: Platform type collection.
  8878. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8879. // ServerResponse contains the HTTP response code and headers from the
  8880. // server.
  8881. googleapi.ServerResponse `json:"-"`
  8882. // ForceSendFields is a list of field names (e.g. "Kind") to
  8883. // unconditionally include in API requests. By default, fields with
  8884. // empty values are omitted from API requests. However, any non-pointer,
  8885. // non-interface field appearing in ForceSendFields will be sent to the
  8886. // server regardless of whether the field is empty or not. This may be
  8887. // used to include empty fields in Patch requests.
  8888. ForceSendFields []string `json:"-"`
  8889. // NullFields is a list of field names (e.g. "Kind") to include in API
  8890. // requests with the JSON null value. By default, fields with empty
  8891. // values are omitted from API requests. However, any field with an
  8892. // empty value appearing in NullFields will be sent to the server as
  8893. // null. It is an error if a field in this list has a non-empty value.
  8894. // This may be used to include null fields in Patch requests.
  8895. NullFields []string `json:"-"`
  8896. }
  8897. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8898. type NoMethod PlatformTypesListResponse
  8899. raw := NoMethod(*s)
  8900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8901. }
  8902. // PopupWindowProperties: Popup Window Properties.
  8903. type PopupWindowProperties struct {
  8904. // Dimension: Popup dimension for a creative. This is a read-only field.
  8905. // Applicable to the following creative types: all RICH_MEDIA and all
  8906. // VPAID
  8907. Dimension *Size `json:"dimension,omitempty"`
  8908. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8909. // if positionType is COORDINATES.
  8910. Offset *OffsetPosition `json:"offset,omitempty"`
  8911. // PositionType: Popup window position either centered or at specific
  8912. // coordinate.
  8913. //
  8914. // Possible values:
  8915. // "CENTER"
  8916. // "COORDINATES"
  8917. PositionType string `json:"positionType,omitempty"`
  8918. // ShowAddressBar: Whether to display the browser address bar.
  8919. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8920. // ShowMenuBar: Whether to display the browser menu bar.
  8921. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8922. // ShowScrollBar: Whether to display the browser scroll bar.
  8923. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8924. // ShowStatusBar: Whether to display the browser status bar.
  8925. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8926. // ShowToolBar: Whether to display the browser tool bar.
  8927. ShowToolBar bool `json:"showToolBar,omitempty"`
  8928. // Title: Title of popup window.
  8929. Title string `json:"title,omitempty"`
  8930. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8931. // unconditionally include in API requests. By default, fields with
  8932. // empty values are omitted from API requests. However, any non-pointer,
  8933. // non-interface field appearing in ForceSendFields will be sent to the
  8934. // server regardless of whether the field is empty or not. This may be
  8935. // used to include empty fields in Patch requests.
  8936. ForceSendFields []string `json:"-"`
  8937. // NullFields is a list of field names (e.g. "Dimension") to include in
  8938. // API requests with the JSON null value. By default, fields with empty
  8939. // values are omitted from API requests. However, any field with an
  8940. // empty value appearing in NullFields will be sent to the server as
  8941. // null. It is an error if a field in this list has a non-empty value.
  8942. // This may be used to include null fields in Patch requests.
  8943. NullFields []string `json:"-"`
  8944. }
  8945. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8946. type NoMethod PopupWindowProperties
  8947. raw := NoMethod(*s)
  8948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8949. }
  8950. // PostalCode: Contains information about a postal code that can be
  8951. // targeted by ads.
  8952. type PostalCode struct {
  8953. // Code: Postal code. This is equivalent to the id field.
  8954. Code string `json:"code,omitempty"`
  8955. // CountryCode: Country code of the country to which this postal code
  8956. // belongs.
  8957. CountryCode string `json:"countryCode,omitempty"`
  8958. // CountryDartId: DART ID of the country to which this postal code
  8959. // belongs.
  8960. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8961. // Id: ID of this postal code.
  8962. Id string `json:"id,omitempty"`
  8963. // Kind: Identifies what kind of resource this is. Value: the fixed
  8964. // string "dfareporting#postalCode".
  8965. Kind string `json:"kind,omitempty"`
  8966. // ServerResponse contains the HTTP response code and headers from the
  8967. // server.
  8968. googleapi.ServerResponse `json:"-"`
  8969. // ForceSendFields is a list of field names (e.g. "Code") to
  8970. // unconditionally include in API requests. By default, fields with
  8971. // empty values are omitted from API requests. However, any non-pointer,
  8972. // non-interface field appearing in ForceSendFields will be sent to the
  8973. // server regardless of whether the field is empty or not. This may be
  8974. // used to include empty fields in Patch requests.
  8975. ForceSendFields []string `json:"-"`
  8976. // NullFields is a list of field names (e.g. "Code") to include in API
  8977. // requests with the JSON null value. By default, fields with empty
  8978. // values are omitted from API requests. However, any field with an
  8979. // empty value appearing in NullFields will be sent to the server as
  8980. // null. It is an error if a field in this list has a non-empty value.
  8981. // This may be used to include null fields in Patch requests.
  8982. NullFields []string `json:"-"`
  8983. }
  8984. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8985. type NoMethod PostalCode
  8986. raw := NoMethod(*s)
  8987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8988. }
  8989. // PostalCodesListResponse: Postal Code List Response
  8990. type PostalCodesListResponse struct {
  8991. // Kind: Identifies what kind of resource this is. Value: the fixed
  8992. // string "dfareporting#postalCodesListResponse".
  8993. Kind string `json:"kind,omitempty"`
  8994. // PostalCodes: Postal code collection.
  8995. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8996. // ServerResponse contains the HTTP response code and headers from the
  8997. // server.
  8998. googleapi.ServerResponse `json:"-"`
  8999. // ForceSendFields is a list of field names (e.g. "Kind") to
  9000. // unconditionally include in API requests. By default, fields with
  9001. // empty values are omitted from API requests. However, any non-pointer,
  9002. // non-interface field appearing in ForceSendFields will be sent to the
  9003. // server regardless of whether the field is empty or not. This may be
  9004. // used to include empty fields in Patch requests.
  9005. ForceSendFields []string `json:"-"`
  9006. // NullFields is a list of field names (e.g. "Kind") to include in API
  9007. // requests with the JSON null value. By default, fields with empty
  9008. // values are omitted from API requests. However, any field with an
  9009. // empty value appearing in NullFields will be sent to the server as
  9010. // null. It is an error if a field in this list has a non-empty value.
  9011. // This may be used to include null fields in Patch requests.
  9012. NullFields []string `json:"-"`
  9013. }
  9014. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  9015. type NoMethod PostalCodesListResponse
  9016. raw := NoMethod(*s)
  9017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9018. }
  9019. // Pricing: Pricing Information
  9020. type Pricing struct {
  9021. // CapCostType: Cap cost type of this inventory item.
  9022. //
  9023. // Possible values:
  9024. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  9025. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  9026. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  9027. CapCostType string `json:"capCostType,omitempty"`
  9028. // EndDate: End date of this inventory item.
  9029. EndDate string `json:"endDate,omitempty"`
  9030. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  9031. // period) represents the inventory item pricing information for a
  9032. // specific period of time.
  9033. Flights []*Flight `json:"flights,omitempty"`
  9034. // GroupType: Group type of this inventory item if it represents a
  9035. // placement group. Is null otherwise. There are two type of placement
  9036. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  9037. // inventory items that acts as a single pricing point for a group of
  9038. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  9039. // items that not only acts as a single pricing point, but also assumes
  9040. // that all the tags in it will be served at the same time. A roadblock
  9041. // requires one of its assigned inventory items to be marked as primary.
  9042. //
  9043. // Possible values:
  9044. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  9045. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  9046. GroupType string `json:"groupType,omitempty"`
  9047. // PricingType: Pricing type of this inventory item.
  9048. //
  9049. // Possible values:
  9050. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  9051. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  9052. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  9053. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  9054. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  9055. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  9056. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  9057. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  9058. PricingType string `json:"pricingType,omitempty"`
  9059. // StartDate: Start date of this inventory item.
  9060. StartDate string `json:"startDate,omitempty"`
  9061. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  9062. // unconditionally include in API requests. By default, fields with
  9063. // empty values are omitted from API requests. However, any non-pointer,
  9064. // non-interface field appearing in ForceSendFields will be sent to the
  9065. // server regardless of whether the field is empty or not. This may be
  9066. // used to include empty fields in Patch requests.
  9067. ForceSendFields []string `json:"-"`
  9068. // NullFields is a list of field names (e.g. "CapCostType") to include
  9069. // in API requests with the JSON null value. By default, fields with
  9070. // empty values are omitted from API requests. However, any field with
  9071. // an empty value appearing in NullFields will be sent to the server as
  9072. // null. It is an error if a field in this list has a non-empty value.
  9073. // This may be used to include null fields in Patch requests.
  9074. NullFields []string `json:"-"`
  9075. }
  9076. func (s *Pricing) MarshalJSON() ([]byte, error) {
  9077. type NoMethod Pricing
  9078. raw := NoMethod(*s)
  9079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9080. }
  9081. // PricingSchedule: Pricing Schedule
  9082. type PricingSchedule struct {
  9083. // CapCostOption: Placement cap cost option.
  9084. //
  9085. // Possible values:
  9086. // "CAP_COST_CUMULATIVE"
  9087. // "CAP_COST_MONTHLY"
  9088. // "CAP_COST_NONE"
  9089. CapCostOption string `json:"capCostOption,omitempty"`
  9090. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  9091. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  9092. // EndDate: Placement end date. This date must be later than, or the
  9093. // same day as, the placement start date, but not later than the
  9094. // campaign end date. If, for example, you set 6/25/2015 as both the
  9095. // start and end dates, the effective placement date is just that day
  9096. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  9097. // should not be set, as doing so will result in an error. This field is
  9098. // required on insertion.
  9099. EndDate string `json:"endDate,omitempty"`
  9100. // Flighted: Whether this placement is flighted. If true, pricing
  9101. // periods will be computed automatically.
  9102. Flighted bool `json:"flighted,omitempty"`
  9103. // FloodlightActivityId: Floodlight activity ID associated with this
  9104. // placement. This field should be set when placement pricing type is
  9105. // set to PRICING_TYPE_CPA.
  9106. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  9107. // PricingPeriods: Pricing periods for this placement.
  9108. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  9109. // PricingType: Placement pricing type. This field is required on
  9110. // insertion.
  9111. //
  9112. // Possible values:
  9113. // "PRICING_TYPE_CPA"
  9114. // "PRICING_TYPE_CPC"
  9115. // "PRICING_TYPE_CPM"
  9116. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  9117. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  9118. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  9119. PricingType string `json:"pricingType,omitempty"`
  9120. // StartDate: Placement start date. This date must be later than, or the
  9121. // same day as, the campaign start date. The hours, minutes, and seconds
  9122. // of the start date should not be set, as doing so will result in an
  9123. // error. This field is required on insertion.
  9124. StartDate string `json:"startDate,omitempty"`
  9125. // TestingStartDate: Testing start date of this placement. The hours,
  9126. // minutes, and seconds of the start date should not be set, as doing so
  9127. // will result in an error.
  9128. TestingStartDate string `json:"testingStartDate,omitempty"`
  9129. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  9130. // unconditionally include in API requests. By default, fields with
  9131. // empty values are omitted from API requests. However, any non-pointer,
  9132. // non-interface field appearing in ForceSendFields will be sent to the
  9133. // server regardless of whether the field is empty or not. This may be
  9134. // used to include empty fields in Patch requests.
  9135. ForceSendFields []string `json:"-"`
  9136. // NullFields is a list of field names (e.g. "CapCostOption") to include
  9137. // in API requests with the JSON null value. By default, fields with
  9138. // empty values are omitted from API requests. However, any field with
  9139. // an empty value appearing in NullFields will be sent to the server as
  9140. // null. It is an error if a field in this list has a non-empty value.
  9141. // This may be used to include null fields in Patch requests.
  9142. NullFields []string `json:"-"`
  9143. }
  9144. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  9145. type NoMethod PricingSchedule
  9146. raw := NoMethod(*s)
  9147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9148. }
  9149. // PricingSchedulePricingPeriod: Pricing Period
  9150. type PricingSchedulePricingPeriod struct {
  9151. // EndDate: Pricing period end date. This date must be later than, or
  9152. // the same day as, the pricing period start date, but not later than
  9153. // the placement end date. The period end date can be the same date as
  9154. // the period start date. If, for example, you set 6/25/2015 as both the
  9155. // start and end dates, the effective pricing period date is just that
  9156. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  9157. // should not be set, as doing so will result in an error.
  9158. EndDate string `json:"endDate,omitempty"`
  9159. // PricingComment: Comments for this pricing period.
  9160. PricingComment string `json:"pricingComment,omitempty"`
  9161. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  9162. // multipled by 1000000000). Acceptable values are 0 to
  9163. // 1000000000000000000, inclusive.
  9164. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  9165. // StartDate: Pricing period start date. This date must be later than,
  9166. // or the same day as, the placement start date. The hours, minutes, and
  9167. // seconds of the start date should not be set, as doing so will result
  9168. // in an error.
  9169. StartDate string `json:"startDate,omitempty"`
  9170. // Units: Units of this pricing period. Acceptable values are 0 to
  9171. // 10000000000, inclusive.
  9172. Units int64 `json:"units,omitempty,string"`
  9173. // ForceSendFields is a list of field names (e.g. "EndDate") to
  9174. // unconditionally include in API requests. By default, fields with
  9175. // empty values are omitted from API requests. However, any non-pointer,
  9176. // non-interface field appearing in ForceSendFields will be sent to the
  9177. // server regardless of whether the field is empty or not. This may be
  9178. // used to include empty fields in Patch requests.
  9179. ForceSendFields []string `json:"-"`
  9180. // NullFields is a list of field names (e.g. "EndDate") to include in
  9181. // API requests with the JSON null value. By default, fields with empty
  9182. // values are omitted from API requests. However, any field with an
  9183. // empty value appearing in NullFields will be sent to the server as
  9184. // null. It is an error if a field in this list has a non-empty value.
  9185. // This may be used to include null fields in Patch requests.
  9186. NullFields []string `json:"-"`
  9187. }
  9188. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  9189. type NoMethod PricingSchedulePricingPeriod
  9190. raw := NoMethod(*s)
  9191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9192. }
  9193. // Project: Contains properties of a Planning project.
  9194. type Project struct {
  9195. // AccountId: Account ID of this project.
  9196. AccountId int64 `json:"accountId,omitempty,string"`
  9197. // AdvertiserId: Advertiser ID of this project.
  9198. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9199. // AudienceAgeGroup: Audience age group of this project.
  9200. //
  9201. // Possible values:
  9202. // "PLANNING_AUDIENCE_AGE_18_24"
  9203. // "PLANNING_AUDIENCE_AGE_25_34"
  9204. // "PLANNING_AUDIENCE_AGE_35_44"
  9205. // "PLANNING_AUDIENCE_AGE_45_54"
  9206. // "PLANNING_AUDIENCE_AGE_55_64"
  9207. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  9208. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  9209. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  9210. // AudienceGender: Audience gender of this project.
  9211. //
  9212. // Possible values:
  9213. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  9214. // "PLANNING_AUDIENCE_GENDER_MALE"
  9215. AudienceGender string `json:"audienceGender,omitempty"`
  9216. // Budget: Budget of this project in the currency specified by the
  9217. // current account. The value stored in this field represents only the
  9218. // non-fractional amount. For example, for USD, the smallest value that
  9219. // can be represented by this field is 1 US dollar.
  9220. Budget int64 `json:"budget,omitempty,string"`
  9221. // ClientBillingCode: Client billing code of this project.
  9222. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  9223. // ClientName: Name of the project client.
  9224. ClientName string `json:"clientName,omitempty"`
  9225. // EndDate: End date of the project.
  9226. EndDate string `json:"endDate,omitempty"`
  9227. // Id: ID of this project. This is a read-only, auto-generated field.
  9228. Id int64 `json:"id,omitempty,string"`
  9229. // Kind: Identifies what kind of resource this is. Value: the fixed
  9230. // string "dfareporting#project".
  9231. Kind string `json:"kind,omitempty"`
  9232. // LastModifiedInfo: Information about the most recent modification of
  9233. // this project.
  9234. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  9235. // Name: Name of this project.
  9236. Name string `json:"name,omitempty"`
  9237. // Overview: Overview of this project.
  9238. Overview string `json:"overview,omitempty"`
  9239. // StartDate: Start date of the project.
  9240. StartDate string `json:"startDate,omitempty"`
  9241. // SubaccountId: Subaccount ID of this project.
  9242. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9243. // TargetClicks: Number of clicks that the advertiser is targeting.
  9244. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  9245. // TargetConversions: Number of conversions that the advertiser is
  9246. // targeting.
  9247. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  9248. // TargetCpaNanos: CPA that the advertiser is targeting.
  9249. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  9250. // TargetCpcNanos: CPC that the advertiser is targeting.
  9251. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  9252. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  9253. // is targeting.
  9254. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  9255. // TargetCpmNanos: CPM that the advertiser is targeting.
  9256. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  9257. // TargetImpressions: Number of impressions that the advertiser is
  9258. // targeting.
  9259. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  9260. // ServerResponse contains the HTTP response code and headers from the
  9261. // server.
  9262. googleapi.ServerResponse `json:"-"`
  9263. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9264. // unconditionally include in API requests. By default, fields with
  9265. // empty values are omitted from API requests. However, any non-pointer,
  9266. // non-interface field appearing in ForceSendFields will be sent to the
  9267. // server regardless of whether the field is empty or not. This may be
  9268. // used to include empty fields in Patch requests.
  9269. ForceSendFields []string `json:"-"`
  9270. // NullFields is a list of field names (e.g. "AccountId") to include in
  9271. // API requests with the JSON null value. By default, fields with empty
  9272. // values are omitted from API requests. However, any field with an
  9273. // empty value appearing in NullFields will be sent to the server as
  9274. // null. It is an error if a field in this list has a non-empty value.
  9275. // This may be used to include null fields in Patch requests.
  9276. NullFields []string `json:"-"`
  9277. }
  9278. func (s *Project) MarshalJSON() ([]byte, error) {
  9279. type NoMethod Project
  9280. raw := NoMethod(*s)
  9281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9282. }
  9283. // ProjectsListResponse: Project List Response
  9284. type ProjectsListResponse struct {
  9285. // Kind: Identifies what kind of resource this is. Value: the fixed
  9286. // string "dfareporting#projectsListResponse".
  9287. Kind string `json:"kind,omitempty"`
  9288. // NextPageToken: Pagination token to be used for the next list
  9289. // operation.
  9290. NextPageToken string `json:"nextPageToken,omitempty"`
  9291. // Projects: Project collection.
  9292. Projects []*Project `json:"projects,omitempty"`
  9293. // ServerResponse contains the HTTP response code and headers from the
  9294. // server.
  9295. googleapi.ServerResponse `json:"-"`
  9296. // ForceSendFields is a list of field names (e.g. "Kind") to
  9297. // unconditionally include in API requests. By default, fields with
  9298. // empty values are omitted from API requests. However, any non-pointer,
  9299. // non-interface field appearing in ForceSendFields will be sent to the
  9300. // server regardless of whether the field is empty or not. This may be
  9301. // used to include empty fields in Patch requests.
  9302. ForceSendFields []string `json:"-"`
  9303. // NullFields is a list of field names (e.g. "Kind") to include in API
  9304. // requests with the JSON null value. By default, fields with empty
  9305. // values are omitted from API requests. However, any field with an
  9306. // empty value appearing in NullFields will be sent to the server as
  9307. // null. It is an error if a field in this list has a non-empty value.
  9308. // This may be used to include null fields in Patch requests.
  9309. NullFields []string `json:"-"`
  9310. }
  9311. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  9312. type NoMethod ProjectsListResponse
  9313. raw := NoMethod(*s)
  9314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9315. }
  9316. // ReachReportCompatibleFields: Represents fields that are compatible to
  9317. // be selected for a report of type "REACH".
  9318. type ReachReportCompatibleFields struct {
  9319. // DimensionFilters: Dimensions which are compatible to be selected in
  9320. // the "dimensionFilters" section of the report.
  9321. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9322. // Dimensions: Dimensions which are compatible to be selected in the
  9323. // "dimensions" section of the report.
  9324. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9325. // Kind: The kind of resource this is, in this case
  9326. // dfareporting#reachReportCompatibleFields.
  9327. Kind string `json:"kind,omitempty"`
  9328. // Metrics: Metrics which are compatible to be selected in the
  9329. // "metricNames" section of the report.
  9330. Metrics []*Metric `json:"metrics,omitempty"`
  9331. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9332. // as activity metrics to pivot on in the "activities" section of the
  9333. // report.
  9334. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9335. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  9336. // in the "reachByFrequencyMetricNames" section of the report.
  9337. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  9338. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9339. // unconditionally include in API requests. By default, fields with
  9340. // empty values are omitted from API requests. However, any non-pointer,
  9341. // non-interface field appearing in ForceSendFields will be sent to the
  9342. // server regardless of whether the field is empty or not. This may be
  9343. // used to include empty fields in Patch requests.
  9344. ForceSendFields []string `json:"-"`
  9345. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9346. // include in API requests with the JSON null value. By default, fields
  9347. // with empty values are omitted from API requests. However, any field
  9348. // with an empty value appearing in NullFields will be sent to the
  9349. // server as null. It is an error if a field in this list has a
  9350. // non-empty value. This may be used to include null fields in Patch
  9351. // requests.
  9352. NullFields []string `json:"-"`
  9353. }
  9354. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9355. type NoMethod ReachReportCompatibleFields
  9356. raw := NoMethod(*s)
  9357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9358. }
  9359. // Recipient: Represents a recipient.
  9360. type Recipient struct {
  9361. // DeliveryType: The delivery type for the recipient.
  9362. //
  9363. // Possible values:
  9364. // "ATTACHMENT"
  9365. // "LINK"
  9366. DeliveryType string `json:"deliveryType,omitempty"`
  9367. // Email: The email address of the recipient.
  9368. Email string `json:"email,omitempty"`
  9369. // Kind: The kind of resource this is, in this case
  9370. // dfareporting#recipient.
  9371. Kind string `json:"kind,omitempty"`
  9372. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9373. // unconditionally include in API requests. By default, fields with
  9374. // empty values are omitted from API requests. However, any non-pointer,
  9375. // non-interface field appearing in ForceSendFields will be sent to the
  9376. // server regardless of whether the field is empty or not. This may be
  9377. // used to include empty fields in Patch requests.
  9378. ForceSendFields []string `json:"-"`
  9379. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9380. // in API requests with the JSON null value. By default, fields with
  9381. // empty values are omitted from API requests. However, any field with
  9382. // an empty value appearing in NullFields will be sent to the server as
  9383. // null. It is an error if a field in this list has a non-empty value.
  9384. // This may be used to include null fields in Patch requests.
  9385. NullFields []string `json:"-"`
  9386. }
  9387. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9388. type NoMethod Recipient
  9389. raw := NoMethod(*s)
  9390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9391. }
  9392. // Region: Contains information about a region that can be targeted by
  9393. // ads.
  9394. type Region struct {
  9395. // CountryCode: Country code of the country to which this region
  9396. // belongs.
  9397. CountryCode string `json:"countryCode,omitempty"`
  9398. // CountryDartId: DART ID of the country to which this region belongs.
  9399. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9400. // DartId: DART ID of this region.
  9401. DartId int64 `json:"dartId,omitempty,string"`
  9402. // Kind: Identifies what kind of resource this is. Value: the fixed
  9403. // string "dfareporting#region".
  9404. Kind string `json:"kind,omitempty"`
  9405. // Name: Name of this region.
  9406. Name string `json:"name,omitempty"`
  9407. // RegionCode: Region code.
  9408. RegionCode string `json:"regionCode,omitempty"`
  9409. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9410. // unconditionally include in API requests. By default, fields with
  9411. // empty values are omitted from API requests. However, any non-pointer,
  9412. // non-interface field appearing in ForceSendFields will be sent to the
  9413. // server regardless of whether the field is empty or not. This may be
  9414. // used to include empty fields in Patch requests.
  9415. ForceSendFields []string `json:"-"`
  9416. // NullFields is a list of field names (e.g. "CountryCode") to include
  9417. // in API requests with the JSON null value. By default, fields with
  9418. // empty values are omitted from API requests. However, any field with
  9419. // an empty value appearing in NullFields will be sent to the server as
  9420. // null. It is an error if a field in this list has a non-empty value.
  9421. // This may be used to include null fields in Patch requests.
  9422. NullFields []string `json:"-"`
  9423. }
  9424. func (s *Region) MarshalJSON() ([]byte, error) {
  9425. type NoMethod Region
  9426. raw := NoMethod(*s)
  9427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9428. }
  9429. // RegionsListResponse: Region List Response
  9430. type RegionsListResponse struct {
  9431. // Kind: Identifies what kind of resource this is. Value: the fixed
  9432. // string "dfareporting#regionsListResponse".
  9433. Kind string `json:"kind,omitempty"`
  9434. // Regions: Region collection.
  9435. Regions []*Region `json:"regions,omitempty"`
  9436. // ServerResponse contains the HTTP response code and headers from the
  9437. // server.
  9438. googleapi.ServerResponse `json:"-"`
  9439. // ForceSendFields is a list of field names (e.g. "Kind") to
  9440. // unconditionally include in API requests. By default, fields with
  9441. // empty values are omitted from API requests. However, any non-pointer,
  9442. // non-interface field appearing in ForceSendFields will be sent to the
  9443. // server regardless of whether the field is empty or not. This may be
  9444. // used to include empty fields in Patch requests.
  9445. ForceSendFields []string `json:"-"`
  9446. // NullFields is a list of field names (e.g. "Kind") to include in API
  9447. // requests with the JSON null value. By default, fields with empty
  9448. // values are omitted from API requests. However, any field with an
  9449. // empty value appearing in NullFields will be sent to the server as
  9450. // null. It is an error if a field in this list has a non-empty value.
  9451. // This may be used to include null fields in Patch requests.
  9452. NullFields []string `json:"-"`
  9453. }
  9454. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9455. type NoMethod RegionsListResponse
  9456. raw := NoMethod(*s)
  9457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9458. }
  9459. // RemarketingList: Contains properties of a remarketing list.
  9460. // Remarketing enables you to create lists of users who have performed
  9461. // specific actions on a site, then target ads to members of those
  9462. // lists. This resource can be used to manage remarketing lists that are
  9463. // owned by your advertisers. To see all remarketing lists that are
  9464. // visible to your advertisers, including those that are shared to your
  9465. // advertiser or account, use the TargetableRemarketingLists resource.
  9466. type RemarketingList struct {
  9467. // AccountId: Account ID of this remarketing list. This is a read-only,
  9468. // auto-generated field that is only returned in GET requests.
  9469. AccountId int64 `json:"accountId,omitempty,string"`
  9470. // Active: Whether this remarketing list is active.
  9471. Active bool `json:"active,omitempty"`
  9472. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9473. // remarketing list. This is a required field.
  9474. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9475. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9476. // advertiser. This is a read-only, auto-generated field.
  9477. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9478. // Description: Remarketing list description.
  9479. Description string `json:"description,omitempty"`
  9480. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9481. Id int64 `json:"id,omitempty,string"`
  9482. // Kind: Identifies what kind of resource this is. Value: the fixed
  9483. // string "dfareporting#remarketingList".
  9484. Kind string `json:"kind,omitempty"`
  9485. // LifeSpan: Number of days that a user should remain in the remarketing
  9486. // list without an impression. Acceptable values are 1 to 540,
  9487. // inclusive.
  9488. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9489. // ListPopulationRule: Rule used to populate the remarketing list with
  9490. // users.
  9491. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9492. // ListSize: Number of users currently in the list. This is a read-only
  9493. // field.
  9494. ListSize int64 `json:"listSize,omitempty,string"`
  9495. // ListSource: Product from which this remarketing list was originated.
  9496. //
  9497. // Possible values:
  9498. // "REMARKETING_LIST_SOURCE_ADX"
  9499. // "REMARKETING_LIST_SOURCE_DBM"
  9500. // "REMARKETING_LIST_SOURCE_DFA"
  9501. // "REMARKETING_LIST_SOURCE_DFP"
  9502. // "REMARKETING_LIST_SOURCE_DMP"
  9503. // "REMARKETING_LIST_SOURCE_GA"
  9504. // "REMARKETING_LIST_SOURCE_GPLUS"
  9505. // "REMARKETING_LIST_SOURCE_OTHER"
  9506. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9507. // "REMARKETING_LIST_SOURCE_XFP"
  9508. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9509. ListSource string `json:"listSource,omitempty"`
  9510. // Name: Name of the remarketing list. This is a required field. Must be
  9511. // no greater than 128 characters long.
  9512. Name string `json:"name,omitempty"`
  9513. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9514. // read-only, auto-generated field that is only returned in GET
  9515. // requests.
  9516. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9517. // ServerResponse contains the HTTP response code and headers from the
  9518. // server.
  9519. googleapi.ServerResponse `json:"-"`
  9520. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9521. // unconditionally include in API requests. By default, fields with
  9522. // empty values are omitted from API requests. However, any non-pointer,
  9523. // non-interface field appearing in ForceSendFields will be sent to the
  9524. // server regardless of whether the field is empty or not. This may be
  9525. // used to include empty fields in Patch requests.
  9526. ForceSendFields []string `json:"-"`
  9527. // NullFields is a list of field names (e.g. "AccountId") to include in
  9528. // API requests with the JSON null value. By default, fields with empty
  9529. // values are omitted from API requests. However, any field with an
  9530. // empty value appearing in NullFields will be sent to the server as
  9531. // null. It is an error if a field in this list has a non-empty value.
  9532. // This may be used to include null fields in Patch requests.
  9533. NullFields []string `json:"-"`
  9534. }
  9535. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9536. type NoMethod RemarketingList
  9537. raw := NoMethod(*s)
  9538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9539. }
  9540. // RemarketingListShare: Contains properties of a remarketing list's
  9541. // sharing information. Sharing allows other accounts or advertisers to
  9542. // target to your remarketing lists. This resource can be used to manage
  9543. // remarketing list sharing to other accounts and advertisers.
  9544. type RemarketingListShare struct {
  9545. // Kind: Identifies what kind of resource this is. Value: the fixed
  9546. // string "dfareporting#remarketingListShare".
  9547. Kind string `json:"kind,omitempty"`
  9548. // RemarketingListId: Remarketing list ID. This is a read-only,
  9549. // auto-generated field.
  9550. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9551. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9552. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9553. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9554. // with.
  9555. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9556. // ServerResponse contains the HTTP response code and headers from the
  9557. // server.
  9558. googleapi.ServerResponse `json:"-"`
  9559. // ForceSendFields is a list of field names (e.g. "Kind") to
  9560. // unconditionally include in API requests. By default, fields with
  9561. // empty values are omitted from API requests. However, any non-pointer,
  9562. // non-interface field appearing in ForceSendFields will be sent to the
  9563. // server regardless of whether the field is empty or not. This may be
  9564. // used to include empty fields in Patch requests.
  9565. ForceSendFields []string `json:"-"`
  9566. // NullFields is a list of field names (e.g. "Kind") to include in API
  9567. // requests with the JSON null value. By default, fields with empty
  9568. // values are omitted from API requests. However, any field with an
  9569. // empty value appearing in NullFields will be sent to the server as
  9570. // null. It is an error if a field in this list has a non-empty value.
  9571. // This may be used to include null fields in Patch requests.
  9572. NullFields []string `json:"-"`
  9573. }
  9574. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9575. type NoMethod RemarketingListShare
  9576. raw := NoMethod(*s)
  9577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9578. }
  9579. // RemarketingListsListResponse: Remarketing list response
  9580. type RemarketingListsListResponse struct {
  9581. // Kind: Identifies what kind of resource this is. Value: the fixed
  9582. // string "dfareporting#remarketingListsListResponse".
  9583. Kind string `json:"kind,omitempty"`
  9584. // NextPageToken: Pagination token to be used for the next list
  9585. // operation.
  9586. NextPageToken string `json:"nextPageToken,omitempty"`
  9587. // RemarketingLists: Remarketing list collection.
  9588. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9589. // ServerResponse contains the HTTP response code and headers from the
  9590. // server.
  9591. googleapi.ServerResponse `json:"-"`
  9592. // ForceSendFields is a list of field names (e.g. "Kind") to
  9593. // unconditionally include in API requests. By default, fields with
  9594. // empty values are omitted from API requests. However, any non-pointer,
  9595. // non-interface field appearing in ForceSendFields will be sent to the
  9596. // server regardless of whether the field is empty or not. This may be
  9597. // used to include empty fields in Patch requests.
  9598. ForceSendFields []string `json:"-"`
  9599. // NullFields is a list of field names (e.g. "Kind") to include in API
  9600. // requests with the JSON null value. By default, fields with empty
  9601. // values are omitted from API requests. However, any field with an
  9602. // empty value appearing in NullFields will be sent to the server as
  9603. // null. It is an error if a field in this list has a non-empty value.
  9604. // This may be used to include null fields in Patch requests.
  9605. NullFields []string `json:"-"`
  9606. }
  9607. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9608. type NoMethod RemarketingListsListResponse
  9609. raw := NoMethod(*s)
  9610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9611. }
  9612. // Report: Represents a Report resource.
  9613. type Report struct {
  9614. // AccountId: The account ID to which this report belongs.
  9615. AccountId int64 `json:"accountId,omitempty,string"`
  9616. // Criteria: The report criteria for a report of type "STANDARD".
  9617. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9618. // CrossDimensionReachCriteria: The report criteria for a report of type
  9619. // "CROSS_DIMENSION_REACH".
  9620. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9621. // Delivery: The report's email delivery settings.
  9622. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9623. // Etag: The eTag of this response for caching purposes.
  9624. Etag string `json:"etag,omitempty"`
  9625. // FileName: The filename used when generating report files for this
  9626. // report.
  9627. FileName string `json:"fileName,omitempty"`
  9628. // FloodlightCriteria: The report criteria for a report of type
  9629. // "FLOODLIGHT".
  9630. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9631. // Format: The output format of the report. If not specified, default
  9632. // format is "CSV". Note that the actual format in the completed report
  9633. // file might differ if for instance the report's size exceeds the
  9634. // format's capabilities. "CSV" will then be the fallback format.
  9635. //
  9636. // Possible values:
  9637. // "CSV"
  9638. // "EXCEL"
  9639. Format string `json:"format,omitempty"`
  9640. // Id: The unique ID identifying this report resource.
  9641. Id int64 `json:"id,omitempty,string"`
  9642. // Kind: The kind of resource this is, in this case dfareporting#report.
  9643. Kind string `json:"kind,omitempty"`
  9644. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9645. // this report was last modified.
  9646. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9647. // Name: The name of the report.
  9648. Name string `json:"name,omitempty"`
  9649. // OwnerProfileId: The user profile id of the owner of this report.
  9650. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9651. // PathToConversionCriteria: The report criteria for a report of type
  9652. // "PATH_TO_CONVERSION".
  9653. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9654. // ReachCriteria: The report criteria for a report of type "REACH".
  9655. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9656. // Schedule: The report's schedule. Can only be set if the report's
  9657. // 'dateRange' is a relative date range and the relative date range is
  9658. // not "TODAY".
  9659. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9660. // SubAccountId: The subaccount ID to which this report belongs if
  9661. // applicable.
  9662. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9663. // Type: The type of the report.
  9664. //
  9665. // Possible values:
  9666. // "CROSS_DIMENSION_REACH"
  9667. // "FLOODLIGHT"
  9668. // "PATH_TO_CONVERSION"
  9669. // "REACH"
  9670. // "STANDARD"
  9671. Type string `json:"type,omitempty"`
  9672. // ServerResponse contains the HTTP response code and headers from the
  9673. // server.
  9674. googleapi.ServerResponse `json:"-"`
  9675. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9676. // unconditionally include in API requests. By default, fields with
  9677. // empty values are omitted from API requests. However, any non-pointer,
  9678. // non-interface field appearing in ForceSendFields will be sent to the
  9679. // server regardless of whether the field is empty or not. This may be
  9680. // used to include empty fields in Patch requests.
  9681. ForceSendFields []string `json:"-"`
  9682. // NullFields is a list of field names (e.g. "AccountId") to include in
  9683. // API requests with the JSON null value. By default, fields with empty
  9684. // values are omitted from API requests. However, any field with an
  9685. // empty value appearing in NullFields will be sent to the server as
  9686. // null. It is an error if a field in this list has a non-empty value.
  9687. // This may be used to include null fields in Patch requests.
  9688. NullFields []string `json:"-"`
  9689. }
  9690. func (s *Report) MarshalJSON() ([]byte, error) {
  9691. type NoMethod Report
  9692. raw := NoMethod(*s)
  9693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9694. }
  9695. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9696. type ReportCriteria struct {
  9697. // Activities: Activity group.
  9698. Activities *Activities `json:"activities,omitempty"`
  9699. // CustomRichMediaEvents: Custom Rich Media Events group.
  9700. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9701. // DateRange: The date range for which this report should be run.
  9702. DateRange *DateRange `json:"dateRange,omitempty"`
  9703. // DimensionFilters: The list of filters on which dimensions are
  9704. // filtered.
  9705. // Filters for different dimensions are ANDed, filters for the same
  9706. // dimension are grouped together and ORed.
  9707. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9708. // Dimensions: The list of standard dimensions the report should
  9709. // include.
  9710. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9711. // MetricNames: The list of names of metrics the report should include.
  9712. MetricNames []string `json:"metricNames,omitempty"`
  9713. // ForceSendFields is a list of field names (e.g. "Activities") to
  9714. // unconditionally include in API requests. By default, fields with
  9715. // empty values are omitted from API requests. However, any non-pointer,
  9716. // non-interface field appearing in ForceSendFields will be sent to the
  9717. // server regardless of whether the field is empty or not. This may be
  9718. // used to include empty fields in Patch requests.
  9719. ForceSendFields []string `json:"-"`
  9720. // NullFields is a list of field names (e.g. "Activities") to include in
  9721. // API requests with the JSON null value. By default, fields with empty
  9722. // values are omitted from API requests. However, any field with an
  9723. // empty value appearing in NullFields will be sent to the server as
  9724. // null. It is an error if a field in this list has a non-empty value.
  9725. // This may be used to include null fields in Patch requests.
  9726. NullFields []string `json:"-"`
  9727. }
  9728. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9729. type NoMethod ReportCriteria
  9730. raw := NoMethod(*s)
  9731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9732. }
  9733. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9734. // of type "CROSS_DIMENSION_REACH".
  9735. type ReportCrossDimensionReachCriteria struct {
  9736. // Breakdown: The list of dimensions the report should include.
  9737. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9738. // DateRange: The date range this report should be run for.
  9739. DateRange *DateRange `json:"dateRange,omitempty"`
  9740. // Dimension: The dimension option.
  9741. //
  9742. // Possible values:
  9743. // "ADVERTISER"
  9744. // "CAMPAIGN"
  9745. // "SITE_BY_ADVERTISER"
  9746. // "SITE_BY_CAMPAIGN"
  9747. Dimension string `json:"dimension,omitempty"`
  9748. // DimensionFilters: The list of filters on which dimensions are
  9749. // filtered.
  9750. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9751. // MetricNames: The list of names of metrics the report should include.
  9752. MetricNames []string `json:"metricNames,omitempty"`
  9753. // OverlapMetricNames: The list of names of overlap metrics the report
  9754. // should include.
  9755. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9756. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9757. Pivoted bool `json:"pivoted,omitempty"`
  9758. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9759. // unconditionally include in API requests. By default, fields with
  9760. // empty values are omitted from API requests. However, any non-pointer,
  9761. // non-interface field appearing in ForceSendFields will be sent to the
  9762. // server regardless of whether the field is empty or not. This may be
  9763. // used to include empty fields in Patch requests.
  9764. ForceSendFields []string `json:"-"`
  9765. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9766. // API requests with the JSON null value. By default, fields with empty
  9767. // values are omitted from API requests. However, any field with an
  9768. // empty value appearing in NullFields will be sent to the server as
  9769. // null. It is an error if a field in this list has a non-empty value.
  9770. // This may be used to include null fields in Patch requests.
  9771. NullFields []string `json:"-"`
  9772. }
  9773. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9774. type NoMethod ReportCrossDimensionReachCriteria
  9775. raw := NoMethod(*s)
  9776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9777. }
  9778. // ReportDelivery: The report's email delivery settings.
  9779. type ReportDelivery struct {
  9780. // EmailOwner: Whether the report should be emailed to the report owner.
  9781. EmailOwner bool `json:"emailOwner,omitempty"`
  9782. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9783. // receive, if enabled.
  9784. //
  9785. // Possible values:
  9786. // "ATTACHMENT"
  9787. // "LINK"
  9788. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9789. // Message: The message to be sent with each email.
  9790. Message string `json:"message,omitempty"`
  9791. // Recipients: The list of recipients to which to email the report.
  9792. Recipients []*Recipient `json:"recipients,omitempty"`
  9793. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9794. // unconditionally include in API requests. By default, fields with
  9795. // empty values are omitted from API requests. However, any non-pointer,
  9796. // non-interface field appearing in ForceSendFields will be sent to the
  9797. // server regardless of whether the field is empty or not. This may be
  9798. // used to include empty fields in Patch requests.
  9799. ForceSendFields []string `json:"-"`
  9800. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9801. // API requests with the JSON null value. By default, fields with empty
  9802. // values are omitted from API requests. However, any field with an
  9803. // empty value appearing in NullFields will be sent to the server as
  9804. // null. It is an error if a field in this list has a non-empty value.
  9805. // This may be used to include null fields in Patch requests.
  9806. NullFields []string `json:"-"`
  9807. }
  9808. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9809. type NoMethod ReportDelivery
  9810. raw := NoMethod(*s)
  9811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9812. }
  9813. // ReportFloodlightCriteria: The report criteria for a report of type
  9814. // "FLOODLIGHT".
  9815. type ReportFloodlightCriteria struct {
  9816. // CustomRichMediaEvents: The list of custom rich media events to
  9817. // include.
  9818. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9819. // DateRange: The date range this report should be run for.
  9820. DateRange *DateRange `json:"dateRange,omitempty"`
  9821. // DimensionFilters: The list of filters on which dimensions are
  9822. // filtered.
  9823. // Filters for different dimensions are ANDed, filters for the same
  9824. // dimension are grouped together and ORed.
  9825. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9826. // Dimensions: The list of dimensions the report should include.
  9827. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9828. // FloodlightConfigId: The floodlight ID for which to show data in this
  9829. // report. All advertisers associated with that ID will automatically be
  9830. // added. The dimension of the value needs to be
  9831. // 'dfa:floodlightConfigId'.
  9832. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9833. // MetricNames: The list of names of metrics the report should include.
  9834. MetricNames []string `json:"metricNames,omitempty"`
  9835. // ReportProperties: The properties of the report.
  9836. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9837. // ForceSendFields is a list of field names (e.g.
  9838. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9839. // By default, fields with empty values are omitted from API requests.
  9840. // However, any non-pointer, non-interface field appearing in
  9841. // ForceSendFields will be sent to the server regardless of whether the
  9842. // field is empty or not. This may be used to include empty fields in
  9843. // Patch requests.
  9844. ForceSendFields []string `json:"-"`
  9845. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9846. // include in API requests with the JSON null value. By default, fields
  9847. // with empty values are omitted from API requests. However, any field
  9848. // with an empty value appearing in NullFields will be sent to the
  9849. // server as null. It is an error if a field in this list has a
  9850. // non-empty value. This may be used to include null fields in Patch
  9851. // requests.
  9852. NullFields []string `json:"-"`
  9853. }
  9854. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9855. type NoMethod ReportFloodlightCriteria
  9856. raw := NoMethod(*s)
  9857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9858. }
  9859. // ReportFloodlightCriteriaReportProperties: The properties of the
  9860. // report.
  9861. type ReportFloodlightCriteriaReportProperties struct {
  9862. // IncludeAttributedIPConversions: Include conversions that have no
  9863. // cookie, but do have an exposure path.
  9864. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9865. // IncludeUnattributedCookieConversions: Include conversions of users
  9866. // with a DoubleClick cookie but without an exposure. That means the
  9867. // user did not click or see an ad from the advertiser within the
  9868. // Floodlight group, or that the interaction happened outside the
  9869. // lookback window.
  9870. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9871. // IncludeUnattributedIPConversions: Include conversions that have no
  9872. // associated cookies and no exposures. It’s therefore impossible to
  9873. // know how the user was exposed to your ads during the lookback window
  9874. // prior to a conversion.
  9875. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9876. // ForceSendFields is a list of field names (e.g.
  9877. // "IncludeAttributedIPConversions") to unconditionally include in API
  9878. // requests. By default, fields with empty values are omitted from API
  9879. // requests. However, any non-pointer, non-interface field appearing in
  9880. // ForceSendFields will be sent to the server regardless of whether the
  9881. // field is empty or not. This may be used to include empty fields in
  9882. // Patch requests.
  9883. ForceSendFields []string `json:"-"`
  9884. // NullFields is a list of field names (e.g.
  9885. // "IncludeAttributedIPConversions") to include in API requests with the
  9886. // JSON null value. By default, fields with empty values are omitted
  9887. // from API requests. However, any field with an empty value appearing
  9888. // in NullFields will be sent to the server as null. It is an error if a
  9889. // field in this list has a non-empty value. This may be used to include
  9890. // null fields in Patch requests.
  9891. NullFields []string `json:"-"`
  9892. }
  9893. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9894. type NoMethod ReportFloodlightCriteriaReportProperties
  9895. raw := NoMethod(*s)
  9896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9897. }
  9898. // ReportPathToConversionCriteria: The report criteria for a report of
  9899. // type "PATH_TO_CONVERSION".
  9900. type ReportPathToConversionCriteria struct {
  9901. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9902. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9903. // ConversionDimensions: The list of conversion dimensions the report
  9904. // should include.
  9905. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9906. // CustomFloodlightVariables: The list of custom floodlight variables
  9907. // the report should include.
  9908. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9909. // CustomRichMediaEvents: The list of custom rich media events to
  9910. // include.
  9911. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9912. // DateRange: The date range this report should be run for.
  9913. DateRange *DateRange `json:"dateRange,omitempty"`
  9914. // FloodlightConfigId: The floodlight ID for which to show data in this
  9915. // report. All advertisers associated with that ID will automatically be
  9916. // added. The dimension of the value needs to be
  9917. // 'dfa:floodlightConfigId'.
  9918. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9919. // MetricNames: The list of names of metrics the report should include.
  9920. MetricNames []string `json:"metricNames,omitempty"`
  9921. // PerInteractionDimensions: The list of per interaction dimensions the
  9922. // report should include.
  9923. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9924. // ReportProperties: The properties of the report.
  9925. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9926. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9927. // unconditionally include in API requests. By default, fields with
  9928. // empty values are omitted from API requests. However, any non-pointer,
  9929. // non-interface field appearing in ForceSendFields will be sent to the
  9930. // server regardless of whether the field is empty or not. This may be
  9931. // used to include empty fields in Patch requests.
  9932. ForceSendFields []string `json:"-"`
  9933. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9934. // include in API requests with the JSON null value. By default, fields
  9935. // with empty values are omitted from API requests. However, any field
  9936. // with an empty value appearing in NullFields will be sent to the
  9937. // server as null. It is an error if a field in this list has a
  9938. // non-empty value. This may be used to include null fields in Patch
  9939. // requests.
  9940. NullFields []string `json:"-"`
  9941. }
  9942. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9943. type NoMethod ReportPathToConversionCriteria
  9944. raw := NoMethod(*s)
  9945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9946. }
  9947. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9948. // report.
  9949. type ReportPathToConversionCriteriaReportProperties struct {
  9950. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9951. // occurred within the specified period of time before a conversion. By
  9952. // default the value is pulled from Floodlight or you can manually enter
  9953. // a custom value. Valid values: 1-90.
  9954. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9955. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9956. // interaction occurred within the specified period of time before a
  9957. // conversion. By default the value is pulled from Floodlight or you can
  9958. // manually enter a custom value. Valid values: 1-90.
  9959. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9960. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9961. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9962. // IncludeUnattributedCookieConversions: Include conversions of users
  9963. // with a DoubleClick cookie but without an exposure. That means the
  9964. // user did not click or see an ad from the advertiser within the
  9965. // Floodlight group, or that the interaction happened outside the
  9966. // lookback window.
  9967. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9968. // IncludeUnattributedIPConversions: Include conversions that have no
  9969. // associated cookies and no exposures. It’s therefore impossible to
  9970. // know how the user was exposed to your ads during the lookback window
  9971. // prior to a conversion.
  9972. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9973. // MaximumClickInteractions: The maximum number of click interactions to
  9974. // include in the report. Advertisers currently paying for E2C reports
  9975. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9976. // your network is paying for E2C, you can have up to 5 total exposures
  9977. // per report.
  9978. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9979. // MaximumImpressionInteractions: The maximum number of click
  9980. // interactions to include in the report. Advertisers currently paying
  9981. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9982. // another advertiser in your network is paying for E2C, you can have up
  9983. // to 5 total exposures per report.
  9984. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9985. // MaximumInteractionGap: The maximum amount of time that can take place
  9986. // between interactions (clicks or impressions) by the same user. Valid
  9987. // values: 1-90.
  9988. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9989. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9990. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9991. // ForceSendFields is a list of field names (e.g.
  9992. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9993. // By default, fields with empty values are omitted from API requests.
  9994. // However, any non-pointer, non-interface field appearing in
  9995. // ForceSendFields will be sent to the server regardless of whether the
  9996. // field is empty or not. This may be used to include empty fields in
  9997. // Patch requests.
  9998. ForceSendFields []string `json:"-"`
  9999. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  10000. // include in API requests with the JSON null value. By default, fields
  10001. // with empty values are omitted from API requests. However, any field
  10002. // with an empty value appearing in NullFields will be sent to the
  10003. // server as null. It is an error if a field in this list has a
  10004. // non-empty value. This may be used to include null fields in Patch
  10005. // requests.
  10006. NullFields []string `json:"-"`
  10007. }
  10008. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  10009. type NoMethod ReportPathToConversionCriteriaReportProperties
  10010. raw := NoMethod(*s)
  10011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10012. }
  10013. // ReportReachCriteria: The report criteria for a report of type
  10014. // "REACH".
  10015. type ReportReachCriteria struct {
  10016. // Activities: Activity group.
  10017. Activities *Activities `json:"activities,omitempty"`
  10018. // CustomRichMediaEvents: Custom Rich Media Events group.
  10019. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  10020. // DateRange: The date range this report should be run for.
  10021. DateRange *DateRange `json:"dateRange,omitempty"`
  10022. // DimensionFilters: The list of filters on which dimensions are
  10023. // filtered.
  10024. // Filters for different dimensions are ANDed, filters for the same
  10025. // dimension are grouped together and ORed.
  10026. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  10027. // Dimensions: The list of dimensions the report should include.
  10028. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  10029. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  10030. // combinations in the report. Defaults to false. If enabled, the date
  10031. // range of the report should be within the last 42 days.
  10032. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  10033. // MetricNames: The list of names of metrics the report should include.
  10034. MetricNames []string `json:"metricNames,omitempty"`
  10035. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  10036. // metrics the report should include.
  10037. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  10038. // ForceSendFields is a list of field names (e.g. "Activities") to
  10039. // unconditionally include in API requests. By default, fields with
  10040. // empty values are omitted from API requests. However, any non-pointer,
  10041. // non-interface field appearing in ForceSendFields will be sent to the
  10042. // server regardless of whether the field is empty or not. This may be
  10043. // used to include empty fields in Patch requests.
  10044. ForceSendFields []string `json:"-"`
  10045. // NullFields is a list of field names (e.g. "Activities") to include in
  10046. // API requests with the JSON null value. By default, fields with empty
  10047. // values are omitted from API requests. However, any field with an
  10048. // empty value appearing in NullFields will be sent to the server as
  10049. // null. It is an error if a field in this list has a non-empty value.
  10050. // This may be used to include null fields in Patch requests.
  10051. NullFields []string `json:"-"`
  10052. }
  10053. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  10054. type NoMethod ReportReachCriteria
  10055. raw := NoMethod(*s)
  10056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10057. }
  10058. // ReportSchedule: The report's schedule. Can only be set if the
  10059. // report's 'dateRange' is a relative date range and the relative date
  10060. // range is not "TODAY".
  10061. type ReportSchedule struct {
  10062. // Active: Whether the schedule is active or not. Must be set to either
  10063. // true or false.
  10064. Active bool `json:"active,omitempty"`
  10065. // Every: Defines every how many days, weeks or months the report should
  10066. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  10067. // "MONTHLY".
  10068. Every int64 `json:"every,omitempty"`
  10069. // ExpirationDate: The expiration date when the scheduled report stops
  10070. // running.
  10071. ExpirationDate string `json:"expirationDate,omitempty"`
  10072. // Repeats: The interval for which the report is repeated. Note:
  10073. // - "DAILY" also requires field "every" to be set.
  10074. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  10075. // set.
  10076. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  10077. // set.
  10078. Repeats string `json:"repeats,omitempty"`
  10079. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  10080. // reports should run.
  10081. //
  10082. // Possible values:
  10083. // "FRIDAY"
  10084. // "MONDAY"
  10085. // "SATURDAY"
  10086. // "SUNDAY"
  10087. // "THURSDAY"
  10088. // "TUESDAY"
  10089. // "WEDNESDAY"
  10090. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  10091. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  10092. // whether reports should be repeated on the same day of the month as
  10093. // "startDate" or the same day of the week of the month.
  10094. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  10095. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  10096. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  10097. // Monday of the month.
  10098. //
  10099. // Possible values:
  10100. // "DAY_OF_MONTH"
  10101. // "WEEK_OF_MONTH"
  10102. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  10103. // StartDate: Start date of date range for which scheduled reports
  10104. // should be run.
  10105. StartDate string `json:"startDate,omitempty"`
  10106. // ForceSendFields is a list of field names (e.g. "Active") to
  10107. // unconditionally include in API requests. By default, fields with
  10108. // empty values are omitted from API requests. However, any non-pointer,
  10109. // non-interface field appearing in ForceSendFields will be sent to the
  10110. // server regardless of whether the field is empty or not. This may be
  10111. // used to include empty fields in Patch requests.
  10112. ForceSendFields []string `json:"-"`
  10113. // NullFields is a list of field names (e.g. "Active") to include in API
  10114. // requests with the JSON null value. By default, fields with empty
  10115. // values are omitted from API requests. However, any field with an
  10116. // empty value appearing in NullFields will be sent to the server as
  10117. // null. It is an error if a field in this list has a non-empty value.
  10118. // This may be used to include null fields in Patch requests.
  10119. NullFields []string `json:"-"`
  10120. }
  10121. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  10122. type NoMethod ReportSchedule
  10123. raw := NoMethod(*s)
  10124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10125. }
  10126. // ReportCompatibleFields: Represents fields that are compatible to be
  10127. // selected for a report of type "STANDARD".
  10128. type ReportCompatibleFields struct {
  10129. // DimensionFilters: Dimensions which are compatible to be selected in
  10130. // the "dimensionFilters" section of the report.
  10131. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  10132. // Dimensions: Dimensions which are compatible to be selected in the
  10133. // "dimensions" section of the report.
  10134. Dimensions []*Dimension `json:"dimensions,omitempty"`
  10135. // Kind: The kind of resource this is, in this case
  10136. // dfareporting#reportCompatibleFields.
  10137. Kind string `json:"kind,omitempty"`
  10138. // Metrics: Metrics which are compatible to be selected in the
  10139. // "metricNames" section of the report.
  10140. Metrics []*Metric `json:"metrics,omitempty"`
  10141. // PivotedActivityMetrics: Metrics which are compatible to be selected
  10142. // as activity metrics to pivot on in the "activities" section of the
  10143. // report.
  10144. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  10145. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  10146. // unconditionally include in API requests. By default, fields with
  10147. // empty values are omitted from API requests. However, any non-pointer,
  10148. // non-interface field appearing in ForceSendFields will be sent to the
  10149. // server regardless of whether the field is empty or not. This may be
  10150. // used to include empty fields in Patch requests.
  10151. ForceSendFields []string `json:"-"`
  10152. // NullFields is a list of field names (e.g. "DimensionFilters") to
  10153. // include in API requests with the JSON null value. By default, fields
  10154. // with empty values are omitted from API requests. However, any field
  10155. // with an empty value appearing in NullFields will be sent to the
  10156. // server as null. It is an error if a field in this list has a
  10157. // non-empty value. This may be used to include null fields in Patch
  10158. // requests.
  10159. NullFields []string `json:"-"`
  10160. }
  10161. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  10162. type NoMethod ReportCompatibleFields
  10163. raw := NoMethod(*s)
  10164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10165. }
  10166. // ReportList: Represents the list of reports.
  10167. type ReportList struct {
  10168. // Etag: The eTag of this response for caching purposes.
  10169. Etag string `json:"etag,omitempty"`
  10170. // Items: The reports returned in this response.
  10171. Items []*Report `json:"items,omitempty"`
  10172. // Kind: The kind of list this is, in this case dfareporting#reportList.
  10173. Kind string `json:"kind,omitempty"`
  10174. // NextPageToken: Continuation token used to page through reports. To
  10175. // retrieve the next page of results, set the next request's "pageToken"
  10176. // to the value of this field. The page token is only valid for a
  10177. // limited amount of time and should not be persisted.
  10178. NextPageToken string `json:"nextPageToken,omitempty"`
  10179. // ServerResponse contains the HTTP response code and headers from the
  10180. // server.
  10181. googleapi.ServerResponse `json:"-"`
  10182. // ForceSendFields is a list of field names (e.g. "Etag") to
  10183. // unconditionally include in API requests. By default, fields with
  10184. // empty values are omitted from API requests. However, any non-pointer,
  10185. // non-interface field appearing in ForceSendFields will be sent to the
  10186. // server regardless of whether the field is empty or not. This may be
  10187. // used to include empty fields in Patch requests.
  10188. ForceSendFields []string `json:"-"`
  10189. // NullFields is a list of field names (e.g. "Etag") to include in API
  10190. // requests with the JSON null value. By default, fields with empty
  10191. // values are omitted from API requests. However, any field with an
  10192. // empty value appearing in NullFields will be sent to the server as
  10193. // null. It is an error if a field in this list has a non-empty value.
  10194. // This may be used to include null fields in Patch requests.
  10195. NullFields []string `json:"-"`
  10196. }
  10197. func (s *ReportList) MarshalJSON() ([]byte, error) {
  10198. type NoMethod ReportList
  10199. raw := NoMethod(*s)
  10200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10201. }
  10202. // ReportsConfiguration: Reporting Configuration
  10203. type ReportsConfiguration struct {
  10204. // ExposureToConversionEnabled: Whether the exposure to conversion
  10205. // report is enabled. This report shows detailed pathway information on
  10206. // up to 10 of the most recent ad exposures seen by a user before
  10207. // converting.
  10208. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  10209. // LookbackConfiguration: Default lookback windows for new advertisers
  10210. // in this account.
  10211. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10212. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  10213. // account. This is a required field that can only be changed by a
  10214. // superuser.
  10215. // Acceptable values are:
  10216. //
  10217. // - "1" for "America/New_York"
  10218. // - "2" for "Europe/London"
  10219. // - "3" for "Europe/Paris"
  10220. // - "4" for "Africa/Johannesburg"
  10221. // - "5" for "Asia/Jerusalem"
  10222. // - "6" for "Asia/Shanghai"
  10223. // - "7" for "Asia/Hong_Kong"
  10224. // - "8" for "Asia/Tokyo"
  10225. // - "9" for "Australia/Sydney"
  10226. // - "10" for "Asia/Dubai"
  10227. // - "11" for "America/Los_Angeles"
  10228. // - "12" for "Pacific/Auckland"
  10229. // - "13" for "America/Sao_Paulo"
  10230. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  10231. // ForceSendFields is a list of field names (e.g.
  10232. // "ExposureToConversionEnabled") to unconditionally include in API
  10233. // requests. By default, fields with empty values are omitted from API
  10234. // requests. However, any non-pointer, non-interface field appearing in
  10235. // ForceSendFields will be sent to the server regardless of whether the
  10236. // field is empty or not. This may be used to include empty fields in
  10237. // Patch requests.
  10238. ForceSendFields []string `json:"-"`
  10239. // NullFields is a list of field names (e.g.
  10240. // "ExposureToConversionEnabled") to include in API requests with the
  10241. // JSON null value. By default, fields with empty values are omitted
  10242. // from API requests. However, any field with an empty value appearing
  10243. // in NullFields will be sent to the server as null. It is an error if a
  10244. // field in this list has a non-empty value. This may be used to include
  10245. // null fields in Patch requests.
  10246. NullFields []string `json:"-"`
  10247. }
  10248. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  10249. type NoMethod ReportsConfiguration
  10250. raw := NoMethod(*s)
  10251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10252. }
  10253. // RichMediaExitOverride: Rich Media Exit Override.
  10254. type RichMediaExitOverride struct {
  10255. // ClickThroughUrl: Click-through URL of this rich media exit override.
  10256. // Applicable if the enabled field is set to true.
  10257. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  10258. // Enabled: Whether to use the clickThroughUrl. If false, the
  10259. // creative-level exit will be used.
  10260. Enabled bool `json:"enabled,omitempty"`
  10261. // ExitId: ID for the override to refer to a specific exit in the
  10262. // creative.
  10263. ExitId int64 `json:"exitId,omitempty,string"`
  10264. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  10265. // unconditionally include in API requests. By default, fields with
  10266. // empty values are omitted from API requests. However, any non-pointer,
  10267. // non-interface field appearing in ForceSendFields will be sent to the
  10268. // server regardless of whether the field is empty or not. This may be
  10269. // used to include empty fields in Patch requests.
  10270. ForceSendFields []string `json:"-"`
  10271. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  10272. // include in API requests with the JSON null value. By default, fields
  10273. // with empty values are omitted from API requests. However, any field
  10274. // with an empty value appearing in NullFields will be sent to the
  10275. // server as null. It is an error if a field in this list has a
  10276. // non-empty value. This may be used to include null fields in Patch
  10277. // requests.
  10278. NullFields []string `json:"-"`
  10279. }
  10280. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  10281. type NoMethod RichMediaExitOverride
  10282. raw := NoMethod(*s)
  10283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10284. }
  10285. // Rule: A rule associates an asset with a targeting template for
  10286. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  10287. type Rule struct {
  10288. // AssetId: A creativeAssets[].id. This should refer to one of the
  10289. // parent assets in this creative. This is a required field.
  10290. AssetId int64 `json:"assetId,omitempty,string"`
  10291. // Name: A user-friendly name for this rule. This is a required field.
  10292. Name string `json:"name,omitempty"`
  10293. // TargetingTemplateId: A targeting template ID. The targeting from the
  10294. // targeting template will be used to determine whether this asset
  10295. // should be served. This is a required field.
  10296. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  10297. // ForceSendFields is a list of field names (e.g. "AssetId") to
  10298. // unconditionally include in API requests. By default, fields with
  10299. // empty values are omitted from API requests. However, any non-pointer,
  10300. // non-interface field appearing in ForceSendFields will be sent to the
  10301. // server regardless of whether the field is empty or not. This may be
  10302. // used to include empty fields in Patch requests.
  10303. ForceSendFields []string `json:"-"`
  10304. // NullFields is a list of field names (e.g. "AssetId") to include in
  10305. // API requests with the JSON null value. By default, fields with empty
  10306. // values are omitted from API requests. However, any field with an
  10307. // empty value appearing in NullFields will be sent to the server as
  10308. // null. It is an error if a field in this list has a non-empty value.
  10309. // This may be used to include null fields in Patch requests.
  10310. NullFields []string `json:"-"`
  10311. }
  10312. func (s *Rule) MarshalJSON() ([]byte, error) {
  10313. type NoMethod Rule
  10314. raw := NoMethod(*s)
  10315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10316. }
  10317. // Site: Contains properties of a site.
  10318. type Site struct {
  10319. // AccountId: Account ID of this site. This is a read-only field that
  10320. // can be left blank.
  10321. AccountId int64 `json:"accountId,omitempty,string"`
  10322. // Approved: Whether this site is approved.
  10323. Approved bool `json:"approved,omitempty"`
  10324. // DirectorySiteId: Directory site associated with this site. This is a
  10325. // required field that is read-only after insertion.
  10326. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  10327. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  10328. // directory site. This is a read-only, auto-generated field.
  10329. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  10330. // Id: ID of this site. This is a read-only, auto-generated field.
  10331. Id int64 `json:"id,omitempty,string"`
  10332. // IdDimensionValue: Dimension value for the ID of this site. This is a
  10333. // read-only, auto-generated field.
  10334. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  10335. // KeyName: Key name of this site. This is a read-only, auto-generated
  10336. // field.
  10337. KeyName string `json:"keyName,omitempty"`
  10338. // Kind: Identifies what kind of resource this is. Value: the fixed
  10339. // string "dfareporting#site".
  10340. Kind string `json:"kind,omitempty"`
  10341. // Name: Name of this site.This is a required field. Must be less than
  10342. // 128 characters long. If this site is under a subaccount, the name
  10343. // must be unique among sites of the same subaccount. Otherwise, this
  10344. // site is a top-level site, and the name must be unique among top-level
  10345. // sites of the same account.
  10346. Name string `json:"name,omitempty"`
  10347. // SiteContacts: Site contacts.
  10348. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  10349. // SiteSettings: Site-wide settings.
  10350. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  10351. // SubaccountId: Subaccount ID of this site. This is a read-only field
  10352. // that can be left blank.
  10353. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10354. // ServerResponse contains the HTTP response code and headers from the
  10355. // server.
  10356. googleapi.ServerResponse `json:"-"`
  10357. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10358. // unconditionally include in API requests. By default, fields with
  10359. // empty values are omitted from API requests. However, any non-pointer,
  10360. // non-interface field appearing in ForceSendFields will be sent to the
  10361. // server regardless of whether the field is empty or not. This may be
  10362. // used to include empty fields in Patch requests.
  10363. ForceSendFields []string `json:"-"`
  10364. // NullFields is a list of field names (e.g. "AccountId") to include in
  10365. // API requests with the JSON null value. By default, fields with empty
  10366. // values are omitted from API requests. However, any field with an
  10367. // empty value appearing in NullFields will be sent to the server as
  10368. // null. It is an error if a field in this list has a non-empty value.
  10369. // This may be used to include null fields in Patch requests.
  10370. NullFields []string `json:"-"`
  10371. }
  10372. func (s *Site) MarshalJSON() ([]byte, error) {
  10373. type NoMethod Site
  10374. raw := NoMethod(*s)
  10375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10376. }
  10377. // SiteContact: Site Contact
  10378. type SiteContact struct {
  10379. // Address: Address of this site contact.
  10380. Address string `json:"address,omitempty"`
  10381. // ContactType: Site contact type.
  10382. //
  10383. // Possible values:
  10384. // "SALES_PERSON"
  10385. // "TRAFFICKER"
  10386. ContactType string `json:"contactType,omitempty"`
  10387. // Email: Email address of this site contact. This is a required field.
  10388. Email string `json:"email,omitempty"`
  10389. // FirstName: First name of this site contact.
  10390. FirstName string `json:"firstName,omitempty"`
  10391. // Id: ID of this site contact. This is a read-only, auto-generated
  10392. // field.
  10393. Id int64 `json:"id,omitempty,string"`
  10394. // LastName: Last name of this site contact.
  10395. LastName string `json:"lastName,omitempty"`
  10396. // Phone: Primary phone number of this site contact.
  10397. Phone string `json:"phone,omitempty"`
  10398. // Title: Title or designation of this site contact.
  10399. Title string `json:"title,omitempty"`
  10400. // ForceSendFields is a list of field names (e.g. "Address") to
  10401. // unconditionally include in API requests. By default, fields with
  10402. // empty values are omitted from API requests. However, any non-pointer,
  10403. // non-interface field appearing in ForceSendFields will be sent to the
  10404. // server regardless of whether the field is empty or not. This may be
  10405. // used to include empty fields in Patch requests.
  10406. ForceSendFields []string `json:"-"`
  10407. // NullFields is a list of field names (e.g. "Address") to include in
  10408. // API requests with the JSON null value. By default, fields with empty
  10409. // values are omitted from API requests. However, any field with an
  10410. // empty value appearing in NullFields will be sent to the server as
  10411. // null. It is an error if a field in this list has a non-empty value.
  10412. // This may be used to include null fields in Patch requests.
  10413. NullFields []string `json:"-"`
  10414. }
  10415. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10416. type NoMethod SiteContact
  10417. raw := NoMethod(*s)
  10418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10419. }
  10420. // SiteSettings: Site Settings
  10421. type SiteSettings struct {
  10422. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10423. // site.
  10424. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10425. // AdBlockingOptOut: Whether this site opts out of ad blocking. When
  10426. // true, ad blocking is disabled for all placements under the site,
  10427. // regardless of the individual placement settings. When false, the
  10428. // campaign and placement settings take effect.
  10429. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  10430. // CreativeSettings: Site-wide creative settings.
  10431. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10432. // DisableNewCookie: Whether new cookies are disabled for this site.
  10433. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10434. // LookbackConfiguration: Lookback window settings for this site.
  10435. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10436. // TagSetting: Configuration settings for dynamic and image floodlight
  10437. // tags.
  10438. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10439. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10440. // for in-stream video creatives are disabled by default for new
  10441. // placements created under this site. This value will be used to
  10442. // populate the placement.videoActiveViewOptOut field, when no value is
  10443. // specified for the new placement.
  10444. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10445. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10446. // placements created under this site. This value will be used to
  10447. // populate the placements.vpaidAdapterChoice field, when no value is
  10448. // specified for the new placement. Controls which VPAID format the
  10449. // measurement adapter will use for in-stream video creatives assigned
  10450. // to the placement. The publisher's specifications will typically
  10451. // determine this setting. For VPAID creatives, the adapter format will
  10452. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10453. // adapter).
  10454. //
  10455. // Note: Flash is no longer supported. This field now defaults to HTML5
  10456. // when the following values are provided: FLASH, BOTH.
  10457. //
  10458. // Possible values:
  10459. // "BOTH"
  10460. // "DEFAULT"
  10461. // "FLASH"
  10462. // "HTML5"
  10463. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10464. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10465. // unconditionally include in API requests. By default, fields with
  10466. // empty values are omitted from API requests. However, any non-pointer,
  10467. // non-interface field appearing in ForceSendFields will be sent to the
  10468. // server regardless of whether the field is empty or not. This may be
  10469. // used to include empty fields in Patch requests.
  10470. ForceSendFields []string `json:"-"`
  10471. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10472. // include in API requests with the JSON null value. By default, fields
  10473. // with empty values are omitted from API requests. However, any field
  10474. // with an empty value appearing in NullFields will be sent to the
  10475. // server as null. It is an error if a field in this list has a
  10476. // non-empty value. This may be used to include null fields in Patch
  10477. // requests.
  10478. NullFields []string `json:"-"`
  10479. }
  10480. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10481. type NoMethod SiteSettings
  10482. raw := NoMethod(*s)
  10483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10484. }
  10485. // SitesListResponse: Site List Response
  10486. type SitesListResponse struct {
  10487. // Kind: Identifies what kind of resource this is. Value: the fixed
  10488. // string "dfareporting#sitesListResponse".
  10489. Kind string `json:"kind,omitempty"`
  10490. // NextPageToken: Pagination token to be used for the next list
  10491. // operation.
  10492. NextPageToken string `json:"nextPageToken,omitempty"`
  10493. // Sites: Site collection.
  10494. Sites []*Site `json:"sites,omitempty"`
  10495. // ServerResponse contains the HTTP response code and headers from the
  10496. // server.
  10497. googleapi.ServerResponse `json:"-"`
  10498. // ForceSendFields is a list of field names (e.g. "Kind") to
  10499. // unconditionally include in API requests. By default, fields with
  10500. // empty values are omitted from API requests. However, any non-pointer,
  10501. // non-interface field appearing in ForceSendFields will be sent to the
  10502. // server regardless of whether the field is empty or not. This may be
  10503. // used to include empty fields in Patch requests.
  10504. ForceSendFields []string `json:"-"`
  10505. // NullFields is a list of field names (e.g. "Kind") to include in API
  10506. // requests with the JSON null value. By default, fields with empty
  10507. // values are omitted from API requests. However, any field with an
  10508. // empty value appearing in NullFields will be sent to the server as
  10509. // null. It is an error if a field in this list has a non-empty value.
  10510. // This may be used to include null fields in Patch requests.
  10511. NullFields []string `json:"-"`
  10512. }
  10513. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10514. type NoMethod SitesListResponse
  10515. raw := NoMethod(*s)
  10516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10517. }
  10518. // Size: Represents the dimensions of ads, placements, creatives, or
  10519. // creative assets.
  10520. type Size struct {
  10521. // Height: Height of this size. Acceptable values are 0 to 32767,
  10522. // inclusive.
  10523. Height int64 `json:"height,omitempty"`
  10524. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10525. Iab bool `json:"iab,omitempty"`
  10526. // Id: ID of this size. This is a read-only, auto-generated field.
  10527. Id int64 `json:"id,omitempty,string"`
  10528. // Kind: Identifies what kind of resource this is. Value: the fixed
  10529. // string "dfareporting#size".
  10530. Kind string `json:"kind,omitempty"`
  10531. // Width: Width of this size. Acceptable values are 0 to 32767,
  10532. // inclusive.
  10533. Width int64 `json:"width,omitempty"`
  10534. // ServerResponse contains the HTTP response code and headers from the
  10535. // server.
  10536. googleapi.ServerResponse `json:"-"`
  10537. // ForceSendFields is a list of field names (e.g. "Height") to
  10538. // unconditionally include in API requests. By default, fields with
  10539. // empty values are omitted from API requests. However, any non-pointer,
  10540. // non-interface field appearing in ForceSendFields will be sent to the
  10541. // server regardless of whether the field is empty or not. This may be
  10542. // used to include empty fields in Patch requests.
  10543. ForceSendFields []string `json:"-"`
  10544. // NullFields is a list of field names (e.g. "Height") to include in API
  10545. // requests with the JSON null value. By default, fields with empty
  10546. // values are omitted from API requests. However, any field with an
  10547. // empty value appearing in NullFields will be sent to the server as
  10548. // null. It is an error if a field in this list has a non-empty value.
  10549. // This may be used to include null fields in Patch requests.
  10550. NullFields []string `json:"-"`
  10551. }
  10552. func (s *Size) MarshalJSON() ([]byte, error) {
  10553. type NoMethod Size
  10554. raw := NoMethod(*s)
  10555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10556. }
  10557. // SizesListResponse: Size List Response
  10558. type SizesListResponse struct {
  10559. // Kind: Identifies what kind of resource this is. Value: the fixed
  10560. // string "dfareporting#sizesListResponse".
  10561. Kind string `json:"kind,omitempty"`
  10562. // Sizes: Size collection.
  10563. Sizes []*Size `json:"sizes,omitempty"`
  10564. // ServerResponse contains the HTTP response code and headers from the
  10565. // server.
  10566. googleapi.ServerResponse `json:"-"`
  10567. // ForceSendFields is a list of field names (e.g. "Kind") to
  10568. // unconditionally include in API requests. By default, fields with
  10569. // empty values are omitted from API requests. However, any non-pointer,
  10570. // non-interface field appearing in ForceSendFields will be sent to the
  10571. // server regardless of whether the field is empty or not. This may be
  10572. // used to include empty fields in Patch requests.
  10573. ForceSendFields []string `json:"-"`
  10574. // NullFields is a list of field names (e.g. "Kind") to include in API
  10575. // requests with the JSON null value. By default, fields with empty
  10576. // values are omitted from API requests. However, any field with an
  10577. // empty value appearing in NullFields will be sent to the server as
  10578. // null. It is an error if a field in this list has a non-empty value.
  10579. // This may be used to include null fields in Patch requests.
  10580. NullFields []string `json:"-"`
  10581. }
  10582. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10583. type NoMethod SizesListResponse
  10584. raw := NoMethod(*s)
  10585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10586. }
  10587. // SkippableSetting: Skippable Settings
  10588. type SkippableSetting struct {
  10589. // Kind: Identifies what kind of resource this is. Value: the fixed
  10590. // string "dfareporting#skippableSetting".
  10591. Kind string `json:"kind,omitempty"`
  10592. // ProgressOffset: Amount of time to play videos served to this
  10593. // placement before counting a view. Applicable when skippable is true.
  10594. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10595. // SkipOffset: Amount of time to play videos served to this placement
  10596. // before the skip button should appear. Applicable when skippable is
  10597. // true.
  10598. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10599. // Skippable: Whether the user can skip creatives served to this
  10600. // placement.
  10601. Skippable bool `json:"skippable,omitempty"`
  10602. // ForceSendFields is a list of field names (e.g. "Kind") to
  10603. // unconditionally include in API requests. By default, fields with
  10604. // empty values are omitted from API requests. However, any non-pointer,
  10605. // non-interface field appearing in ForceSendFields will be sent to the
  10606. // server regardless of whether the field is empty or not. This may be
  10607. // used to include empty fields in Patch requests.
  10608. ForceSendFields []string `json:"-"`
  10609. // NullFields is a list of field names (e.g. "Kind") to include in API
  10610. // requests with the JSON null value. By default, fields with empty
  10611. // values are omitted from API requests. However, any field with an
  10612. // empty value appearing in NullFields will be sent to the server as
  10613. // null. It is an error if a field in this list has a non-empty value.
  10614. // This may be used to include null fields in Patch requests.
  10615. NullFields []string `json:"-"`
  10616. }
  10617. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10618. type NoMethod SkippableSetting
  10619. raw := NoMethod(*s)
  10620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10621. }
  10622. // SortedDimension: Represents a sorted dimension.
  10623. type SortedDimension struct {
  10624. // Kind: The kind of resource this is, in this case
  10625. // dfareporting#sortedDimension.
  10626. Kind string `json:"kind,omitempty"`
  10627. // Name: The name of the dimension.
  10628. Name string `json:"name,omitempty"`
  10629. // SortOrder: An optional sort order for the dimension column.
  10630. //
  10631. // Possible values:
  10632. // "ASCENDING"
  10633. // "DESCENDING"
  10634. SortOrder string `json:"sortOrder,omitempty"`
  10635. // ForceSendFields is a list of field names (e.g. "Kind") to
  10636. // unconditionally include in API requests. By default, fields with
  10637. // empty values are omitted from API requests. However, any non-pointer,
  10638. // non-interface field appearing in ForceSendFields will be sent to the
  10639. // server regardless of whether the field is empty or not. This may be
  10640. // used to include empty fields in Patch requests.
  10641. ForceSendFields []string `json:"-"`
  10642. // NullFields is a list of field names (e.g. "Kind") to include in API
  10643. // requests with the JSON null value. By default, fields with empty
  10644. // values are omitted from API requests. However, any field with an
  10645. // empty value appearing in NullFields will be sent to the server as
  10646. // null. It is an error if a field in this list has a non-empty value.
  10647. // This may be used to include null fields in Patch requests.
  10648. NullFields []string `json:"-"`
  10649. }
  10650. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10651. type NoMethod SortedDimension
  10652. raw := NoMethod(*s)
  10653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10654. }
  10655. // Subaccount: Contains properties of a Campaign Manager subaccount.
  10656. type Subaccount struct {
  10657. // AccountId: ID of the account that contains this subaccount. This is a
  10658. // read-only field that can be left blank.
  10659. AccountId int64 `json:"accountId,omitempty,string"`
  10660. // AvailablePermissionIds: IDs of the available user role permissions
  10661. // for this subaccount.
  10662. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10663. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10664. Id int64 `json:"id,omitempty,string"`
  10665. // Kind: Identifies what kind of resource this is. Value: the fixed
  10666. // string "dfareporting#subaccount".
  10667. Kind string `json:"kind,omitempty"`
  10668. // Name: Name of this subaccount. This is a required field. Must be less
  10669. // than 128 characters long and be unique among subaccounts of the same
  10670. // account.
  10671. Name string `json:"name,omitempty"`
  10672. // ServerResponse contains the HTTP response code and headers from the
  10673. // server.
  10674. googleapi.ServerResponse `json:"-"`
  10675. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10676. // unconditionally include in API requests. By default, fields with
  10677. // empty values are omitted from API requests. However, any non-pointer,
  10678. // non-interface field appearing in ForceSendFields will be sent to the
  10679. // server regardless of whether the field is empty or not. This may be
  10680. // used to include empty fields in Patch requests.
  10681. ForceSendFields []string `json:"-"`
  10682. // NullFields is a list of field names (e.g. "AccountId") to include in
  10683. // API requests with the JSON null value. By default, fields with empty
  10684. // values are omitted from API requests. However, any field with an
  10685. // empty value appearing in NullFields will be sent to the server as
  10686. // null. It is an error if a field in this list has a non-empty value.
  10687. // This may be used to include null fields in Patch requests.
  10688. NullFields []string `json:"-"`
  10689. }
  10690. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10691. type NoMethod Subaccount
  10692. raw := NoMethod(*s)
  10693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10694. }
  10695. // SubaccountsListResponse: Subaccount List Response
  10696. type SubaccountsListResponse struct {
  10697. // Kind: Identifies what kind of resource this is. Value: the fixed
  10698. // string "dfareporting#subaccountsListResponse".
  10699. Kind string `json:"kind,omitempty"`
  10700. // NextPageToken: Pagination token to be used for the next list
  10701. // operation.
  10702. NextPageToken string `json:"nextPageToken,omitempty"`
  10703. // Subaccounts: Subaccount collection.
  10704. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10705. // ServerResponse contains the HTTP response code and headers from the
  10706. // server.
  10707. googleapi.ServerResponse `json:"-"`
  10708. // ForceSendFields is a list of field names (e.g. "Kind") to
  10709. // unconditionally include in API requests. By default, fields with
  10710. // empty values are omitted from API requests. However, any non-pointer,
  10711. // non-interface field appearing in ForceSendFields will be sent to the
  10712. // server regardless of whether the field is empty or not. This may be
  10713. // used to include empty fields in Patch requests.
  10714. ForceSendFields []string `json:"-"`
  10715. // NullFields is a list of field names (e.g. "Kind") to include in API
  10716. // requests with the JSON null value. By default, fields with empty
  10717. // values are omitted from API requests. However, any field with an
  10718. // empty value appearing in NullFields will be sent to the server as
  10719. // null. It is an error if a field in this list has a non-empty value.
  10720. // This may be used to include null fields in Patch requests.
  10721. NullFields []string `json:"-"`
  10722. }
  10723. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10724. type NoMethod SubaccountsListResponse
  10725. raw := NoMethod(*s)
  10726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10727. }
  10728. // TagData: Placement Tag Data
  10729. type TagData struct {
  10730. // AdId: Ad associated with this placement tag. Applicable only when
  10731. // format is PLACEMENT_TAG_TRACKING.
  10732. AdId int64 `json:"adId,omitempty,string"`
  10733. // ClickTag: Tag string to record a click.
  10734. ClickTag string `json:"clickTag,omitempty"`
  10735. // CreativeId: Creative associated with this placement tag. Applicable
  10736. // only when format is PLACEMENT_TAG_TRACKING.
  10737. CreativeId int64 `json:"creativeId,omitempty,string"`
  10738. // Format: TagData tag format of this tag.
  10739. //
  10740. // Possible values:
  10741. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10742. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10743. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10744. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10745. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10746. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10747. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10748. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10749. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10750. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10751. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10752. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10753. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10754. // "PLACEMENT_TAG_JAVASCRIPT"
  10755. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10756. // "PLACEMENT_TAG_STANDARD"
  10757. // "PLACEMENT_TAG_TRACKING"
  10758. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10759. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10760. Format string `json:"format,omitempty"`
  10761. // ImpressionTag: Tag string for serving an ad.
  10762. ImpressionTag string `json:"impressionTag,omitempty"`
  10763. // ForceSendFields is a list of field names (e.g. "AdId") to
  10764. // unconditionally include in API requests. By default, fields with
  10765. // empty values are omitted from API requests. However, any non-pointer,
  10766. // non-interface field appearing in ForceSendFields will be sent to the
  10767. // server regardless of whether the field is empty or not. This may be
  10768. // used to include empty fields in Patch requests.
  10769. ForceSendFields []string `json:"-"`
  10770. // NullFields is a list of field names (e.g. "AdId") to include in API
  10771. // requests with the JSON null value. By default, fields with empty
  10772. // values are omitted from API requests. However, any field with an
  10773. // empty value appearing in NullFields will be sent to the server as
  10774. // null. It is an error if a field in this list has a non-empty value.
  10775. // This may be used to include null fields in Patch requests.
  10776. NullFields []string `json:"-"`
  10777. }
  10778. func (s *TagData) MarshalJSON() ([]byte, error) {
  10779. type NoMethod TagData
  10780. raw := NoMethod(*s)
  10781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10782. }
  10783. // TagSetting: Tag Settings
  10784. type TagSetting struct {
  10785. // AdditionalKeyValues: Additional key-values to be included in tags.
  10786. // Each key-value pair must be of the form key=value, and pairs must be
  10787. // separated by a semicolon (;). Keys and values must not contain
  10788. // commas. For example, id=2;color=red is a valid value for this field.
  10789. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10790. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10791. // included in the tags. This setting applies only to placements.
  10792. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10793. // IncludeClickTracking: Whether click-tracking string should be
  10794. // included in the tags.
  10795. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10796. // KeywordOption: Option specifying how keywords are embedded in ad
  10797. // tags. This setting can be used to specify whether keyword
  10798. // placeholders are inserted in placement tags for this site. Publishers
  10799. // can then add keywords to those placeholders.
  10800. //
  10801. // Possible values:
  10802. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10803. // "IGNORE"
  10804. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10805. KeywordOption string `json:"keywordOption,omitempty"`
  10806. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10807. // to unconditionally include in API requests. By default, fields with
  10808. // empty values are omitted from API requests. However, any non-pointer,
  10809. // non-interface field appearing in ForceSendFields will be sent to the
  10810. // server regardless of whether the field is empty or not. This may be
  10811. // used to include empty fields in Patch requests.
  10812. ForceSendFields []string `json:"-"`
  10813. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10814. // include in API requests with the JSON null value. By default, fields
  10815. // with empty values are omitted from API requests. However, any field
  10816. // with an empty value appearing in NullFields will be sent to the
  10817. // server as null. It is an error if a field in this list has a
  10818. // non-empty value. This may be used to include null fields in Patch
  10819. // requests.
  10820. NullFields []string `json:"-"`
  10821. }
  10822. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10823. type NoMethod TagSetting
  10824. raw := NoMethod(*s)
  10825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10826. }
  10827. // TagSettings: Dynamic and Image Tag Settings.
  10828. type TagSettings struct {
  10829. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10830. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10831. // ImageTagEnabled: Whether image tags are enabled.
  10832. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10833. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10834. // to unconditionally include in API requests. By default, fields with
  10835. // empty values are omitted from API requests. However, any non-pointer,
  10836. // non-interface field appearing in ForceSendFields will be sent to the
  10837. // server regardless of whether the field is empty or not. This may be
  10838. // used to include empty fields in Patch requests.
  10839. ForceSendFields []string `json:"-"`
  10840. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10841. // include in API requests with the JSON null value. By default, fields
  10842. // with empty values are omitted from API requests. However, any field
  10843. // with an empty value appearing in NullFields will be sent to the
  10844. // server as null. It is an error if a field in this list has a
  10845. // non-empty value. This may be used to include null fields in Patch
  10846. // requests.
  10847. NullFields []string `json:"-"`
  10848. }
  10849. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10850. type NoMethod TagSettings
  10851. raw := NoMethod(*s)
  10852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10853. }
  10854. // TargetWindow: Target Window.
  10855. type TargetWindow struct {
  10856. // CustomHtml: User-entered value.
  10857. CustomHtml string `json:"customHtml,omitempty"`
  10858. // TargetWindowOption: Type of browser window for which the backup image
  10859. // of the flash creative can be displayed.
  10860. //
  10861. // Possible values:
  10862. // "CURRENT_WINDOW"
  10863. // "CUSTOM"
  10864. // "NEW_WINDOW"
  10865. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10866. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10867. // unconditionally include in API requests. By default, fields with
  10868. // empty values are omitted from API requests. However, any non-pointer,
  10869. // non-interface field appearing in ForceSendFields will be sent to the
  10870. // server regardless of whether the field is empty or not. This may be
  10871. // used to include empty fields in Patch requests.
  10872. ForceSendFields []string `json:"-"`
  10873. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10874. // API requests with the JSON null value. By default, fields with empty
  10875. // values are omitted from API requests. However, any field with an
  10876. // empty value appearing in NullFields will be sent to the server as
  10877. // null. It is an error if a field in this list has a non-empty value.
  10878. // This may be used to include null fields in Patch requests.
  10879. NullFields []string `json:"-"`
  10880. }
  10881. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10882. type NoMethod TargetWindow
  10883. raw := NoMethod(*s)
  10884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10885. }
  10886. // TargetableRemarketingList: Contains properties of a targetable
  10887. // remarketing list. Remarketing enables you to create lists of users
  10888. // who have performed specific actions on a site, then target ads to
  10889. // members of those lists. This resource is a read-only view of a
  10890. // remarketing list to be used to faciliate targeting ads to specific
  10891. // lists. Remarketing lists that are owned by your advertisers and those
  10892. // that are shared to your advertisers or account are accessible via
  10893. // this resource. To manage remarketing lists that are owned by your
  10894. // advertisers, use the RemarketingLists resource.
  10895. type TargetableRemarketingList struct {
  10896. // AccountId: Account ID of this remarketing list. This is a read-only,
  10897. // auto-generated field that is only returned in GET requests.
  10898. AccountId int64 `json:"accountId,omitempty,string"`
  10899. // Active: Whether this targetable remarketing list is active.
  10900. Active bool `json:"active,omitempty"`
  10901. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10902. // targetable remarketing list.
  10903. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10904. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10905. // advertiser.
  10906. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10907. // Description: Targetable remarketing list description.
  10908. Description string `json:"description,omitempty"`
  10909. // Id: Targetable remarketing list ID.
  10910. Id int64 `json:"id,omitempty,string"`
  10911. // Kind: Identifies what kind of resource this is. Value: the fixed
  10912. // string "dfareporting#targetableRemarketingList".
  10913. Kind string `json:"kind,omitempty"`
  10914. // LifeSpan: Number of days that a user should remain in the targetable
  10915. // remarketing list without an impression.
  10916. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10917. // ListSize: Number of users currently in the list. This is a read-only
  10918. // field.
  10919. ListSize int64 `json:"listSize,omitempty,string"`
  10920. // ListSource: Product from which this targetable remarketing list was
  10921. // originated.
  10922. //
  10923. // Possible values:
  10924. // "REMARKETING_LIST_SOURCE_ADX"
  10925. // "REMARKETING_LIST_SOURCE_DBM"
  10926. // "REMARKETING_LIST_SOURCE_DFA"
  10927. // "REMARKETING_LIST_SOURCE_DFP"
  10928. // "REMARKETING_LIST_SOURCE_DMP"
  10929. // "REMARKETING_LIST_SOURCE_GA"
  10930. // "REMARKETING_LIST_SOURCE_GPLUS"
  10931. // "REMARKETING_LIST_SOURCE_OTHER"
  10932. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10933. // "REMARKETING_LIST_SOURCE_XFP"
  10934. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10935. ListSource string `json:"listSource,omitempty"`
  10936. // Name: Name of the targetable remarketing list. Is no greater than 128
  10937. // characters long.
  10938. Name string `json:"name,omitempty"`
  10939. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10940. // read-only, auto-generated field that is only returned in GET
  10941. // requests.
  10942. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10943. // ServerResponse contains the HTTP response code and headers from the
  10944. // server.
  10945. googleapi.ServerResponse `json:"-"`
  10946. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10947. // unconditionally include in API requests. By default, fields with
  10948. // empty values are omitted from API requests. However, any non-pointer,
  10949. // non-interface field appearing in ForceSendFields will be sent to the
  10950. // server regardless of whether the field is empty or not. This may be
  10951. // used to include empty fields in Patch requests.
  10952. ForceSendFields []string `json:"-"`
  10953. // NullFields is a list of field names (e.g. "AccountId") to include in
  10954. // API requests with the JSON null value. By default, fields with empty
  10955. // values are omitted from API requests. However, any field with an
  10956. // empty value appearing in NullFields will be sent to the server as
  10957. // null. It is an error if a field in this list has a non-empty value.
  10958. // This may be used to include null fields in Patch requests.
  10959. NullFields []string `json:"-"`
  10960. }
  10961. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10962. type NoMethod TargetableRemarketingList
  10963. raw := NoMethod(*s)
  10964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10965. }
  10966. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10967. // response
  10968. type TargetableRemarketingListsListResponse struct {
  10969. // Kind: Identifies what kind of resource this is. Value: the fixed
  10970. // string "dfareporting#targetableRemarketingListsListResponse".
  10971. Kind string `json:"kind,omitempty"`
  10972. // NextPageToken: Pagination token to be used for the next list
  10973. // operation.
  10974. NextPageToken string `json:"nextPageToken,omitempty"`
  10975. // TargetableRemarketingLists: Targetable remarketing list collection.
  10976. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10977. // ServerResponse contains the HTTP response code and headers from the
  10978. // server.
  10979. googleapi.ServerResponse `json:"-"`
  10980. // ForceSendFields is a list of field names (e.g. "Kind") to
  10981. // unconditionally include in API requests. By default, fields with
  10982. // empty values are omitted from API requests. However, any non-pointer,
  10983. // non-interface field appearing in ForceSendFields will be sent to the
  10984. // server regardless of whether the field is empty or not. This may be
  10985. // used to include empty fields in Patch requests.
  10986. ForceSendFields []string `json:"-"`
  10987. // NullFields is a list of field names (e.g. "Kind") to include in API
  10988. // requests with the JSON null value. By default, fields with empty
  10989. // values are omitted from API requests. However, any field with an
  10990. // empty value appearing in NullFields will be sent to the server as
  10991. // null. It is an error if a field in this list has a non-empty value.
  10992. // This may be used to include null fields in Patch requests.
  10993. NullFields []string `json:"-"`
  10994. }
  10995. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  10996. type NoMethod TargetableRemarketingListsListResponse
  10997. raw := NoMethod(*s)
  10998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10999. }
  11000. // TargetingTemplate: Contains properties of a targeting template. A
  11001. // targeting template encapsulates targeting information which can be
  11002. // reused across multiple ads.
  11003. type TargetingTemplate struct {
  11004. // AccountId: Account ID of this targeting template. This field, if left
  11005. // unset, will be auto-generated on insert and is read-only after
  11006. // insert.
  11007. AccountId int64 `json:"accountId,omitempty,string"`
  11008. // AdvertiserId: Advertiser ID of this targeting template. This is a
  11009. // required field on insert and is read-only after insert.
  11010. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  11011. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  11012. // advertiser. This is a read-only, auto-generated field.
  11013. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  11014. // DayPartTargeting: Time and day targeting criteria.
  11015. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  11016. // GeoTargeting: Geographical targeting criteria.
  11017. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  11018. // Id: ID of this targeting template. This is a read-only,
  11019. // auto-generated field.
  11020. Id int64 `json:"id,omitempty,string"`
  11021. // KeyValueTargetingExpression: Key-value targeting criteria.
  11022. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  11023. // Kind: Identifies what kind of resource this is. Value: the fixed
  11024. // string "dfareporting#targetingTemplate".
  11025. Kind string `json:"kind,omitempty"`
  11026. // LanguageTargeting: Language targeting criteria.
  11027. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  11028. // ListTargetingExpression: Remarketing list targeting criteria.
  11029. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  11030. // Name: Name of this targeting template. This field is required. It
  11031. // must be less than 256 characters long and unique within an
  11032. // advertiser.
  11033. Name string `json:"name,omitempty"`
  11034. // SubaccountId: Subaccount ID of this targeting template. This field,
  11035. // if left unset, will be auto-generated on insert and is read-only
  11036. // after insert.
  11037. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11038. // TechnologyTargeting: Technology platform targeting criteria.
  11039. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  11040. // ServerResponse contains the HTTP response code and headers from the
  11041. // server.
  11042. googleapi.ServerResponse `json:"-"`
  11043. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11044. // unconditionally include in API requests. By default, fields with
  11045. // empty values are omitted from API requests. However, any non-pointer,
  11046. // non-interface field appearing in ForceSendFields will be sent to the
  11047. // server regardless of whether the field is empty or not. This may be
  11048. // used to include empty fields in Patch requests.
  11049. ForceSendFields []string `json:"-"`
  11050. // NullFields is a list of field names (e.g. "AccountId") to include in
  11051. // API requests with the JSON null value. By default, fields with empty
  11052. // values are omitted from API requests. However, any field with an
  11053. // empty value appearing in NullFields will be sent to the server as
  11054. // null. It is an error if a field in this list has a non-empty value.
  11055. // This may be used to include null fields in Patch requests.
  11056. NullFields []string `json:"-"`
  11057. }
  11058. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  11059. type NoMethod TargetingTemplate
  11060. raw := NoMethod(*s)
  11061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11062. }
  11063. // TargetingTemplatesListResponse: Targeting Template List Response
  11064. type TargetingTemplatesListResponse struct {
  11065. // Kind: Identifies what kind of resource this is. Value: the fixed
  11066. // string "dfareporting#targetingTemplatesListResponse".
  11067. Kind string `json:"kind,omitempty"`
  11068. // NextPageToken: Pagination token to be used for the next list
  11069. // operation.
  11070. NextPageToken string `json:"nextPageToken,omitempty"`
  11071. // TargetingTemplates: Targeting template collection.
  11072. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  11073. // ServerResponse contains the HTTP response code and headers from the
  11074. // server.
  11075. googleapi.ServerResponse `json:"-"`
  11076. // ForceSendFields is a list of field names (e.g. "Kind") to
  11077. // unconditionally include in API requests. By default, fields with
  11078. // empty values are omitted from API requests. However, any non-pointer,
  11079. // non-interface field appearing in ForceSendFields will be sent to the
  11080. // server regardless of whether the field is empty or not. This may be
  11081. // used to include empty fields in Patch requests.
  11082. ForceSendFields []string `json:"-"`
  11083. // NullFields is a list of field names (e.g. "Kind") to include in API
  11084. // requests with the JSON null value. By default, fields with empty
  11085. // values are omitted from API requests. However, any field with an
  11086. // empty value appearing in NullFields will be sent to the server as
  11087. // null. It is an error if a field in this list has a non-empty value.
  11088. // This may be used to include null fields in Patch requests.
  11089. NullFields []string `json:"-"`
  11090. }
  11091. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  11092. type NoMethod TargetingTemplatesListResponse
  11093. raw := NoMethod(*s)
  11094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11095. }
  11096. // TechnologyTargeting: Technology Targeting.
  11097. type TechnologyTargeting struct {
  11098. // Browsers: Browsers that this ad targets. For each browser either set
  11099. // browserVersionId or dartId along with the version numbers. If both
  11100. // are specified, only browserVersionId will be used. The other fields
  11101. // are populated automatically when the ad is inserted or updated.
  11102. Browsers []*Browser `json:"browsers,omitempty"`
  11103. // ConnectionTypes: Connection types that this ad targets. For each
  11104. // connection type only id is required. The other fields are populated
  11105. // automatically when the ad is inserted or updated.
  11106. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  11107. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  11108. // carrier only id is required, and the other fields are populated
  11109. // automatically when the ad is inserted or updated. If targeting a
  11110. // mobile carrier, do not set targeting for any zip codes.
  11111. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  11112. // OperatingSystemVersions: Operating system versions that this ad
  11113. // targets. To target all versions, use operatingSystems. For each
  11114. // operating system version, only id is required. The other fields are
  11115. // populated automatically when the ad is inserted or updated. If
  11116. // targeting an operating system version, do not set targeting for the
  11117. // corresponding operating system in operatingSystems.
  11118. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  11119. // OperatingSystems: Operating systems that this ad targets. To target
  11120. // specific versions, use operatingSystemVersions. For each operating
  11121. // system only dartId is required. The other fields are populated
  11122. // automatically when the ad is inserted or updated. If targeting an
  11123. // operating system, do not set targeting for operating system versions
  11124. // for the same operating system.
  11125. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  11126. // PlatformTypes: Platform types that this ad targets. For example,
  11127. // desktop, mobile, or tablet. For each platform type, only id is
  11128. // required, and the other fields are populated automatically when the
  11129. // ad is inserted or updated.
  11130. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  11131. // ForceSendFields is a list of field names (e.g. "Browsers") to
  11132. // unconditionally include in API requests. By default, fields with
  11133. // empty values are omitted from API requests. However, any non-pointer,
  11134. // non-interface field appearing in ForceSendFields will be sent to the
  11135. // server regardless of whether the field is empty or not. This may be
  11136. // used to include empty fields in Patch requests.
  11137. ForceSendFields []string `json:"-"`
  11138. // NullFields is a list of field names (e.g. "Browsers") to include in
  11139. // API requests with the JSON null value. By default, fields with empty
  11140. // values are omitted from API requests. However, any field with an
  11141. // empty value appearing in NullFields will be sent to the server as
  11142. // null. It is an error if a field in this list has a non-empty value.
  11143. // This may be used to include null fields in Patch requests.
  11144. NullFields []string `json:"-"`
  11145. }
  11146. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  11147. type NoMethod TechnologyTargeting
  11148. raw := NoMethod(*s)
  11149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11150. }
  11151. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  11152. type ThirdPartyAuthenticationToken struct {
  11153. // Name: Name of the third-party authentication token.
  11154. Name string `json:"name,omitempty"`
  11155. // Value: Value of the third-party authentication token. This is a
  11156. // read-only, auto-generated field.
  11157. Value string `json:"value,omitempty"`
  11158. // ForceSendFields is a list of field names (e.g. "Name") to
  11159. // unconditionally include in API requests. By default, fields with
  11160. // empty values are omitted from API requests. However, any non-pointer,
  11161. // non-interface field appearing in ForceSendFields will be sent to the
  11162. // server regardless of whether the field is empty or not. This may be
  11163. // used to include empty fields in Patch requests.
  11164. ForceSendFields []string `json:"-"`
  11165. // NullFields is a list of field names (e.g. "Name") to include in API
  11166. // requests with the JSON null value. By default, fields with empty
  11167. // values are omitted from API requests. However, any field with an
  11168. // empty value appearing in NullFields will be sent to the server as
  11169. // null. It is an error if a field in this list has a non-empty value.
  11170. // This may be used to include null fields in Patch requests.
  11171. NullFields []string `json:"-"`
  11172. }
  11173. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  11174. type NoMethod ThirdPartyAuthenticationToken
  11175. raw := NoMethod(*s)
  11176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11177. }
  11178. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  11179. type ThirdPartyTrackingUrl struct {
  11180. // ThirdPartyUrlType: Third-party URL type for in-stream video and
  11181. // in-stream audio creatives.
  11182. //
  11183. // Possible values:
  11184. // "CLICK_TRACKING"
  11185. // "IMPRESSION"
  11186. // "RICH_MEDIA_BACKUP_IMPRESSION"
  11187. // "RICH_MEDIA_IMPRESSION"
  11188. // "RICH_MEDIA_RM_IMPRESSION"
  11189. // "SURVEY"
  11190. // "VIDEO_COMPLETE"
  11191. // "VIDEO_CUSTOM"
  11192. // "VIDEO_FIRST_QUARTILE"
  11193. // "VIDEO_FULLSCREEN"
  11194. // "VIDEO_MIDPOINT"
  11195. // "VIDEO_MUTE"
  11196. // "VIDEO_PAUSE"
  11197. // "VIDEO_PROGRESS"
  11198. // "VIDEO_REWIND"
  11199. // "VIDEO_SKIP"
  11200. // "VIDEO_START"
  11201. // "VIDEO_STOP"
  11202. // "VIDEO_THIRD_QUARTILE"
  11203. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  11204. // Url: URL for the specified third-party URL type.
  11205. Url string `json:"url,omitempty"`
  11206. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  11207. // to unconditionally include in API requests. By default, fields with
  11208. // empty values are omitted from API requests. However, any non-pointer,
  11209. // non-interface field appearing in ForceSendFields will be sent to the
  11210. // server regardless of whether the field is empty or not. This may be
  11211. // used to include empty fields in Patch requests.
  11212. ForceSendFields []string `json:"-"`
  11213. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  11214. // include in API requests with the JSON null value. By default, fields
  11215. // with empty values are omitted from API requests. However, any field
  11216. // with an empty value appearing in NullFields will be sent to the
  11217. // server as null. It is an error if a field in this list has a
  11218. // non-empty value. This may be used to include null fields in Patch
  11219. // requests.
  11220. NullFields []string `json:"-"`
  11221. }
  11222. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  11223. type NoMethod ThirdPartyTrackingUrl
  11224. raw := NoMethod(*s)
  11225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11226. }
  11227. // TranscodeSetting: Transcode Settings
  11228. type TranscodeSetting struct {
  11229. // EnabledVideoFormats: Whitelist of video formats to be served to this
  11230. // placement. Set this list to null or empty to serve all video formats.
  11231. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  11232. // Kind: Identifies what kind of resource this is. Value: the fixed
  11233. // string "dfareporting#transcodeSetting".
  11234. Kind string `json:"kind,omitempty"`
  11235. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  11236. // to unconditionally include in API requests. By default, fields with
  11237. // empty values are omitted from API requests. However, any non-pointer,
  11238. // non-interface field appearing in ForceSendFields will be sent to the
  11239. // server regardless of whether the field is empty or not. This may be
  11240. // used to include empty fields in Patch requests.
  11241. ForceSendFields []string `json:"-"`
  11242. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  11243. // include in API requests with the JSON null value. By default, fields
  11244. // with empty values are omitted from API requests. However, any field
  11245. // with an empty value appearing in NullFields will be sent to the
  11246. // server as null. It is an error if a field in this list has a
  11247. // non-empty value. This may be used to include null fields in Patch
  11248. // requests.
  11249. NullFields []string `json:"-"`
  11250. }
  11251. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  11252. type NoMethod TranscodeSetting
  11253. raw := NoMethod(*s)
  11254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11255. }
  11256. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  11257. // to the following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and
  11258. // VPAID.
  11259. type UniversalAdId struct {
  11260. // Registry: Registry used for the Ad ID value.
  11261. //
  11262. // Possible values:
  11263. // "AD_ID.ORG"
  11264. // "CLEARCAST"
  11265. // "DCM"
  11266. // "OTHER"
  11267. Registry string `json:"registry,omitempty"`
  11268. // Value: ID value for this creative. Only alphanumeric characters and
  11269. // the following symbols are valid: "_/\-". Maximum length is 64
  11270. // characters. Read only when registry is DCM.
  11271. Value string `json:"value,omitempty"`
  11272. // ForceSendFields is a list of field names (e.g. "Registry") to
  11273. // unconditionally include in API requests. By default, fields with
  11274. // empty values are omitted from API requests. However, any non-pointer,
  11275. // non-interface field appearing in ForceSendFields will be sent to the
  11276. // server regardless of whether the field is empty or not. This may be
  11277. // used to include empty fields in Patch requests.
  11278. ForceSendFields []string `json:"-"`
  11279. // NullFields is a list of field names (e.g. "Registry") to include in
  11280. // API requests with the JSON null value. By default, fields with empty
  11281. // values are omitted from API requests. However, any field with an
  11282. // empty value appearing in NullFields will be sent to the server as
  11283. // null. It is an error if a field in this list has a non-empty value.
  11284. // This may be used to include null fields in Patch requests.
  11285. NullFields []string `json:"-"`
  11286. }
  11287. func (s *UniversalAdId) MarshalJSON() ([]byte, error) {
  11288. type NoMethod UniversalAdId
  11289. raw := NoMethod(*s)
  11290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11291. }
  11292. // UserDefinedVariableConfiguration: User Defined Variable
  11293. // configuration.
  11294. type UserDefinedVariableConfiguration struct {
  11295. // DataType: Data type for the variable. This is a required field.
  11296. //
  11297. // Possible values:
  11298. // "NUMBER"
  11299. // "STRING"
  11300. DataType string `json:"dataType,omitempty"`
  11301. // ReportName: User-friendly name for the variable which will appear in
  11302. // reports. This is a required field, must be less than 64 characters
  11303. // long, and cannot contain the following characters: ""<>".
  11304. ReportName string `json:"reportName,omitempty"`
  11305. // VariableType: Variable name in the tag. This is a required field.
  11306. //
  11307. // Possible values:
  11308. // "U1"
  11309. // "U10"
  11310. // "U100"
  11311. // "U11"
  11312. // "U12"
  11313. // "U13"
  11314. // "U14"
  11315. // "U15"
  11316. // "U16"
  11317. // "U17"
  11318. // "U18"
  11319. // "U19"
  11320. // "U2"
  11321. // "U20"
  11322. // "U21"
  11323. // "U22"
  11324. // "U23"
  11325. // "U24"
  11326. // "U25"
  11327. // "U26"
  11328. // "U27"
  11329. // "U28"
  11330. // "U29"
  11331. // "U3"
  11332. // "U30"
  11333. // "U31"
  11334. // "U32"
  11335. // "U33"
  11336. // "U34"
  11337. // "U35"
  11338. // "U36"
  11339. // "U37"
  11340. // "U38"
  11341. // "U39"
  11342. // "U4"
  11343. // "U40"
  11344. // "U41"
  11345. // "U42"
  11346. // "U43"
  11347. // "U44"
  11348. // "U45"
  11349. // "U46"
  11350. // "U47"
  11351. // "U48"
  11352. // "U49"
  11353. // "U5"
  11354. // "U50"
  11355. // "U51"
  11356. // "U52"
  11357. // "U53"
  11358. // "U54"
  11359. // "U55"
  11360. // "U56"
  11361. // "U57"
  11362. // "U58"
  11363. // "U59"
  11364. // "U6"
  11365. // "U60"
  11366. // "U61"
  11367. // "U62"
  11368. // "U63"
  11369. // "U64"
  11370. // "U65"
  11371. // "U66"
  11372. // "U67"
  11373. // "U68"
  11374. // "U69"
  11375. // "U7"
  11376. // "U70"
  11377. // "U71"
  11378. // "U72"
  11379. // "U73"
  11380. // "U74"
  11381. // "U75"
  11382. // "U76"
  11383. // "U77"
  11384. // "U78"
  11385. // "U79"
  11386. // "U8"
  11387. // "U80"
  11388. // "U81"
  11389. // "U82"
  11390. // "U83"
  11391. // "U84"
  11392. // "U85"
  11393. // "U86"
  11394. // "U87"
  11395. // "U88"
  11396. // "U89"
  11397. // "U9"
  11398. // "U90"
  11399. // "U91"
  11400. // "U92"
  11401. // "U93"
  11402. // "U94"
  11403. // "U95"
  11404. // "U96"
  11405. // "U97"
  11406. // "U98"
  11407. // "U99"
  11408. VariableType string `json:"variableType,omitempty"`
  11409. // ForceSendFields is a list of field names (e.g. "DataType") to
  11410. // unconditionally include in API requests. By default, fields with
  11411. // empty values are omitted from API requests. However, any non-pointer,
  11412. // non-interface field appearing in ForceSendFields will be sent to the
  11413. // server regardless of whether the field is empty or not. This may be
  11414. // used to include empty fields in Patch requests.
  11415. ForceSendFields []string `json:"-"`
  11416. // NullFields is a list of field names (e.g. "DataType") to include in
  11417. // API requests with the JSON null value. By default, fields with empty
  11418. // values are omitted from API requests. However, any field with an
  11419. // empty value appearing in NullFields will be sent to the server as
  11420. // null. It is an error if a field in this list has a non-empty value.
  11421. // This may be used to include null fields in Patch requests.
  11422. NullFields []string `json:"-"`
  11423. }
  11424. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11425. type NoMethod UserDefinedVariableConfiguration
  11426. raw := NoMethod(*s)
  11427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11428. }
  11429. // UserProfile: Represents a UserProfile resource.
  11430. type UserProfile struct {
  11431. // AccountId: The account ID to which this profile belongs.
  11432. AccountId int64 `json:"accountId,omitempty,string"`
  11433. // AccountName: The account name this profile belongs to.
  11434. AccountName string `json:"accountName,omitempty"`
  11435. // Etag: The eTag of this response for caching purposes.
  11436. Etag string `json:"etag,omitempty"`
  11437. // Kind: The kind of resource this is, in this case
  11438. // dfareporting#userProfile.
  11439. Kind string `json:"kind,omitempty"`
  11440. // ProfileId: The unique ID of the user profile.
  11441. ProfileId int64 `json:"profileId,omitempty,string"`
  11442. // SubAccountId: The sub account ID this profile belongs to if
  11443. // applicable.
  11444. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11445. // SubAccountName: The sub account name this profile belongs to if
  11446. // applicable.
  11447. SubAccountName string `json:"subAccountName,omitempty"`
  11448. // UserName: The user name.
  11449. UserName string `json:"userName,omitempty"`
  11450. // ServerResponse contains the HTTP response code and headers from the
  11451. // server.
  11452. googleapi.ServerResponse `json:"-"`
  11453. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11454. // unconditionally include in API requests. By default, fields with
  11455. // empty values are omitted from API requests. However, any non-pointer,
  11456. // non-interface field appearing in ForceSendFields will be sent to the
  11457. // server regardless of whether the field is empty or not. This may be
  11458. // used to include empty fields in Patch requests.
  11459. ForceSendFields []string `json:"-"`
  11460. // NullFields is a list of field names (e.g. "AccountId") to include in
  11461. // API requests with the JSON null value. By default, fields with empty
  11462. // values are omitted from API requests. However, any field with an
  11463. // empty value appearing in NullFields will be sent to the server as
  11464. // null. It is an error if a field in this list has a non-empty value.
  11465. // This may be used to include null fields in Patch requests.
  11466. NullFields []string `json:"-"`
  11467. }
  11468. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11469. type NoMethod UserProfile
  11470. raw := NoMethod(*s)
  11471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11472. }
  11473. // UserProfileList: Represents the list of user profiles.
  11474. type UserProfileList struct {
  11475. // Etag: The eTag of this response for caching purposes.
  11476. Etag string `json:"etag,omitempty"`
  11477. // Items: The user profiles returned in this response.
  11478. Items []*UserProfile `json:"items,omitempty"`
  11479. // Kind: The kind of list this is, in this case
  11480. // dfareporting#userProfileList.
  11481. Kind string `json:"kind,omitempty"`
  11482. // ServerResponse contains the HTTP response code and headers from the
  11483. // server.
  11484. googleapi.ServerResponse `json:"-"`
  11485. // ForceSendFields is a list of field names (e.g. "Etag") to
  11486. // unconditionally include in API requests. By default, fields with
  11487. // empty values are omitted from API requests. However, any non-pointer,
  11488. // non-interface field appearing in ForceSendFields will be sent to the
  11489. // server regardless of whether the field is empty or not. This may be
  11490. // used to include empty fields in Patch requests.
  11491. ForceSendFields []string `json:"-"`
  11492. // NullFields is a list of field names (e.g. "Etag") to include in API
  11493. // requests with the JSON null value. By default, fields with empty
  11494. // values are omitted from API requests. However, any field with an
  11495. // empty value appearing in NullFields will be sent to the server as
  11496. // null. It is an error if a field in this list has a non-empty value.
  11497. // This may be used to include null fields in Patch requests.
  11498. NullFields []string `json:"-"`
  11499. }
  11500. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11501. type NoMethod UserProfileList
  11502. raw := NoMethod(*s)
  11503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11504. }
  11505. // UserRole: Contains properties of auser role, which is used to manage
  11506. // user access.
  11507. type UserRole struct {
  11508. // AccountId: Account ID of this user role. This is a read-only field
  11509. // that can be left blank.
  11510. AccountId int64 `json:"accountId,omitempty,string"`
  11511. // DefaultUserRole: Whether this is a default user role. Default user
  11512. // roles are created by the system for the account/subaccount and cannot
  11513. // be modified or deleted. Each default user role comes with a basic set
  11514. // of preassigned permissions.
  11515. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11516. // Id: ID of this user role. This is a read-only, auto-generated field.
  11517. Id int64 `json:"id,omitempty,string"`
  11518. // Kind: Identifies what kind of resource this is. Value: the fixed
  11519. // string "dfareporting#userRole".
  11520. Kind string `json:"kind,omitempty"`
  11521. // Name: Name of this user role. This is a required field. Must be less
  11522. // than 256 characters long. If this user role is under a subaccount,
  11523. // the name must be unique among sites of the same subaccount.
  11524. // Otherwise, this user role is a top-level user role, and the name must
  11525. // be unique among top-level user roles of the same account.
  11526. Name string `json:"name,omitempty"`
  11527. // ParentUserRoleId: ID of the user role that this user role is based on
  11528. // or copied from. This is a required field.
  11529. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11530. // Permissions: List of permissions associated with this user role.
  11531. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11532. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11533. // field that can be left blank.
  11534. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11535. // ServerResponse contains the HTTP response code and headers from the
  11536. // server.
  11537. googleapi.ServerResponse `json:"-"`
  11538. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11539. // unconditionally include in API requests. By default, fields with
  11540. // empty values are omitted from API requests. However, any non-pointer,
  11541. // non-interface field appearing in ForceSendFields will be sent to the
  11542. // server regardless of whether the field is empty or not. This may be
  11543. // used to include empty fields in Patch requests.
  11544. ForceSendFields []string `json:"-"`
  11545. // NullFields is a list of field names (e.g. "AccountId") to include in
  11546. // API requests with the JSON null value. By default, fields with empty
  11547. // values are omitted from API requests. However, any field with an
  11548. // empty value appearing in NullFields will be sent to the server as
  11549. // null. It is an error if a field in this list has a non-empty value.
  11550. // This may be used to include null fields in Patch requests.
  11551. NullFields []string `json:"-"`
  11552. }
  11553. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11554. type NoMethod UserRole
  11555. raw := NoMethod(*s)
  11556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11557. }
  11558. // UserRolePermission: Contains properties of a user role permission.
  11559. type UserRolePermission struct {
  11560. // Availability: Levels of availability for a user role permission.
  11561. //
  11562. // Possible values:
  11563. // "ACCOUNT_ALWAYS"
  11564. // "ACCOUNT_BY_DEFAULT"
  11565. // "NOT_AVAILABLE_BY_DEFAULT"
  11566. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11567. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11568. Availability string `json:"availability,omitempty"`
  11569. // Id: ID of this user role permission.
  11570. Id int64 `json:"id,omitempty,string"`
  11571. // Kind: Identifies what kind of resource this is. Value: the fixed
  11572. // string "dfareporting#userRolePermission".
  11573. Kind string `json:"kind,omitempty"`
  11574. // Name: Name of this user role permission.
  11575. Name string `json:"name,omitempty"`
  11576. // PermissionGroupId: ID of the permission group that this user role
  11577. // permission belongs to.
  11578. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11579. // ServerResponse contains the HTTP response code and headers from the
  11580. // server.
  11581. googleapi.ServerResponse `json:"-"`
  11582. // ForceSendFields is a list of field names (e.g. "Availability") to
  11583. // unconditionally include in API requests. By default, fields with
  11584. // empty values are omitted from API requests. However, any non-pointer,
  11585. // non-interface field appearing in ForceSendFields will be sent to the
  11586. // server regardless of whether the field is empty or not. This may be
  11587. // used to include empty fields in Patch requests.
  11588. ForceSendFields []string `json:"-"`
  11589. // NullFields is a list of field names (e.g. "Availability") to include
  11590. // in API requests with the JSON null value. By default, fields with
  11591. // empty values are omitted from API requests. However, any field with
  11592. // an empty value appearing in NullFields will be sent to the server as
  11593. // null. It is an error if a field in this list has a non-empty value.
  11594. // This may be used to include null fields in Patch requests.
  11595. NullFields []string `json:"-"`
  11596. }
  11597. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11598. type NoMethod UserRolePermission
  11599. raw := NoMethod(*s)
  11600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11601. }
  11602. // UserRolePermissionGroup: Represents a grouping of related user role
  11603. // permissions.
  11604. type UserRolePermissionGroup struct {
  11605. // Id: ID of this user role permission.
  11606. Id int64 `json:"id,omitempty,string"`
  11607. // Kind: Identifies what kind of resource this is. Value: the fixed
  11608. // string "dfareporting#userRolePermissionGroup".
  11609. Kind string `json:"kind,omitempty"`
  11610. // Name: Name of this user role permission group.
  11611. Name string `json:"name,omitempty"`
  11612. // ServerResponse contains the HTTP response code and headers from the
  11613. // server.
  11614. googleapi.ServerResponse `json:"-"`
  11615. // ForceSendFields is a list of field names (e.g. "Id") to
  11616. // unconditionally include in API requests. By default, fields with
  11617. // empty values are omitted from API requests. However, any non-pointer,
  11618. // non-interface field appearing in ForceSendFields will be sent to the
  11619. // server regardless of whether the field is empty or not. This may be
  11620. // used to include empty fields in Patch requests.
  11621. ForceSendFields []string `json:"-"`
  11622. // NullFields is a list of field names (e.g. "Id") to include in API
  11623. // requests with the JSON null value. By default, fields with empty
  11624. // values are omitted from API requests. However, any field with an
  11625. // empty value appearing in NullFields will be sent to the server as
  11626. // null. It is an error if a field in this list has a non-empty value.
  11627. // This may be used to include null fields in Patch requests.
  11628. NullFields []string `json:"-"`
  11629. }
  11630. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11631. type NoMethod UserRolePermissionGroup
  11632. raw := NoMethod(*s)
  11633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11634. }
  11635. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11636. // Response
  11637. type UserRolePermissionGroupsListResponse struct {
  11638. // Kind: Identifies what kind of resource this is. Value: the fixed
  11639. // string "dfareporting#userRolePermissionGroupsListResponse".
  11640. Kind string `json:"kind,omitempty"`
  11641. // UserRolePermissionGroups: User role permission group collection.
  11642. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11643. // ServerResponse contains the HTTP response code and headers from the
  11644. // server.
  11645. googleapi.ServerResponse `json:"-"`
  11646. // ForceSendFields is a list of field names (e.g. "Kind") to
  11647. // unconditionally include in API requests. By default, fields with
  11648. // empty values are omitted from API requests. However, any non-pointer,
  11649. // non-interface field appearing in ForceSendFields will be sent to the
  11650. // server regardless of whether the field is empty or not. This may be
  11651. // used to include empty fields in Patch requests.
  11652. ForceSendFields []string `json:"-"`
  11653. // NullFields is a list of field names (e.g. "Kind") to include in API
  11654. // requests with the JSON null value. By default, fields with empty
  11655. // values are omitted from API requests. However, any field with an
  11656. // empty value appearing in NullFields will be sent to the server as
  11657. // null. It is an error if a field in this list has a non-empty value.
  11658. // This may be used to include null fields in Patch requests.
  11659. NullFields []string `json:"-"`
  11660. }
  11661. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11662. type NoMethod UserRolePermissionGroupsListResponse
  11663. raw := NoMethod(*s)
  11664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11665. }
  11666. // UserRolePermissionsListResponse: User Role Permission List Response
  11667. type UserRolePermissionsListResponse struct {
  11668. // Kind: Identifies what kind of resource this is. Value: the fixed
  11669. // string "dfareporting#userRolePermissionsListResponse".
  11670. Kind string `json:"kind,omitempty"`
  11671. // UserRolePermissions: User role permission collection.
  11672. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11673. // ServerResponse contains the HTTP response code and headers from the
  11674. // server.
  11675. googleapi.ServerResponse `json:"-"`
  11676. // ForceSendFields is a list of field names (e.g. "Kind") to
  11677. // unconditionally include in API requests. By default, fields with
  11678. // empty values are omitted from API requests. However, any non-pointer,
  11679. // non-interface field appearing in ForceSendFields will be sent to the
  11680. // server regardless of whether the field is empty or not. This may be
  11681. // used to include empty fields in Patch requests.
  11682. ForceSendFields []string `json:"-"`
  11683. // NullFields is a list of field names (e.g. "Kind") to include in API
  11684. // requests with the JSON null value. By default, fields with empty
  11685. // values are omitted from API requests. However, any field with an
  11686. // empty value appearing in NullFields will be sent to the server as
  11687. // null. It is an error if a field in this list has a non-empty value.
  11688. // This may be used to include null fields in Patch requests.
  11689. NullFields []string `json:"-"`
  11690. }
  11691. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11692. type NoMethod UserRolePermissionsListResponse
  11693. raw := NoMethod(*s)
  11694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11695. }
  11696. // UserRolesListResponse: User Role List Response
  11697. type UserRolesListResponse struct {
  11698. // Kind: Identifies what kind of resource this is. Value: the fixed
  11699. // string "dfareporting#userRolesListResponse".
  11700. Kind string `json:"kind,omitempty"`
  11701. // NextPageToken: Pagination token to be used for the next list
  11702. // operation.
  11703. NextPageToken string `json:"nextPageToken,omitempty"`
  11704. // UserRoles: User role collection.
  11705. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11706. // ServerResponse contains the HTTP response code and headers from the
  11707. // server.
  11708. googleapi.ServerResponse `json:"-"`
  11709. // ForceSendFields is a list of field names (e.g. "Kind") to
  11710. // unconditionally include in API requests. By default, fields with
  11711. // empty values are omitted from API requests. However, any non-pointer,
  11712. // non-interface field appearing in ForceSendFields will be sent to the
  11713. // server regardless of whether the field is empty or not. This may be
  11714. // used to include empty fields in Patch requests.
  11715. ForceSendFields []string `json:"-"`
  11716. // NullFields is a list of field names (e.g. "Kind") to include in API
  11717. // requests with the JSON null value. By default, fields with empty
  11718. // values are omitted from API requests. However, any field with an
  11719. // empty value appearing in NullFields will be sent to the server as
  11720. // null. It is an error if a field in this list has a non-empty value.
  11721. // This may be used to include null fields in Patch requests.
  11722. NullFields []string `json:"-"`
  11723. }
  11724. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11725. type NoMethod UserRolesListResponse
  11726. raw := NoMethod(*s)
  11727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11728. }
  11729. // VideoFormat: Contains information about supported video formats.
  11730. type VideoFormat struct {
  11731. // FileType: File type of the video format.
  11732. //
  11733. // Possible values:
  11734. // "FLV"
  11735. // "M3U8"
  11736. // "MP4"
  11737. // "THREEGPP"
  11738. // "WEBM"
  11739. FileType string `json:"fileType,omitempty"`
  11740. // Id: ID of the video format.
  11741. Id int64 `json:"id,omitempty"`
  11742. // Kind: Identifies what kind of resource this is. Value: the fixed
  11743. // string "dfareporting#videoFormat".
  11744. Kind string `json:"kind,omitempty"`
  11745. // Resolution: The resolution of this video format.
  11746. Resolution *Size `json:"resolution,omitempty"`
  11747. // TargetBitRate: The target bit rate of this video format.
  11748. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11749. // ServerResponse contains the HTTP response code and headers from the
  11750. // server.
  11751. googleapi.ServerResponse `json:"-"`
  11752. // ForceSendFields is a list of field names (e.g. "FileType") to
  11753. // unconditionally include in API requests. By default, fields with
  11754. // empty values are omitted from API requests. However, any non-pointer,
  11755. // non-interface field appearing in ForceSendFields will be sent to the
  11756. // server regardless of whether the field is empty or not. This may be
  11757. // used to include empty fields in Patch requests.
  11758. ForceSendFields []string `json:"-"`
  11759. // NullFields is a list of field names (e.g. "FileType") to include in
  11760. // API requests with the JSON null value. By default, fields with empty
  11761. // values are omitted from API requests. However, any field with an
  11762. // empty value appearing in NullFields will be sent to the server as
  11763. // null. It is an error if a field in this list has a non-empty value.
  11764. // This may be used to include null fields in Patch requests.
  11765. NullFields []string `json:"-"`
  11766. }
  11767. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11768. type NoMethod VideoFormat
  11769. raw := NoMethod(*s)
  11770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11771. }
  11772. // VideoFormatsListResponse: Video Format List Response
  11773. type VideoFormatsListResponse struct {
  11774. // Kind: Identifies what kind of resource this is. Value: the fixed
  11775. // string "dfareporting#videoFormatsListResponse".
  11776. Kind string `json:"kind,omitempty"`
  11777. // VideoFormats: Video format collection.
  11778. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11779. // ServerResponse contains the HTTP response code and headers from the
  11780. // server.
  11781. googleapi.ServerResponse `json:"-"`
  11782. // ForceSendFields is a list of field names (e.g. "Kind") to
  11783. // unconditionally include in API requests. By default, fields with
  11784. // empty values are omitted from API requests. However, any non-pointer,
  11785. // non-interface field appearing in ForceSendFields will be sent to the
  11786. // server regardless of whether the field is empty or not. This may be
  11787. // used to include empty fields in Patch requests.
  11788. ForceSendFields []string `json:"-"`
  11789. // NullFields is a list of field names (e.g. "Kind") to include in API
  11790. // requests with the JSON null value. By default, fields with empty
  11791. // values are omitted from API requests. However, any field with an
  11792. // empty value appearing in NullFields will be sent to the server as
  11793. // null. It is an error if a field in this list has a non-empty value.
  11794. // This may be used to include null fields in Patch requests.
  11795. NullFields []string `json:"-"`
  11796. }
  11797. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11798. type NoMethod VideoFormatsListResponse
  11799. raw := NoMethod(*s)
  11800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11801. }
  11802. // VideoOffset: Video Offset
  11803. type VideoOffset struct {
  11804. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11805. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11806. // inclusive.
  11807. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11808. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11809. // is set. Acceptable values are 0 to 86399, inclusive.
  11810. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11811. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11812. // unconditionally include in API requests. By default, fields with
  11813. // empty values are omitted from API requests. However, any non-pointer,
  11814. // non-interface field appearing in ForceSendFields will be sent to the
  11815. // server regardless of whether the field is empty or not. This may be
  11816. // used to include empty fields in Patch requests.
  11817. ForceSendFields []string `json:"-"`
  11818. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11819. // include in API requests with the JSON null value. By default, fields
  11820. // with empty values are omitted from API requests. However, any field
  11821. // with an empty value appearing in NullFields will be sent to the
  11822. // server as null. It is an error if a field in this list has a
  11823. // non-empty value. This may be used to include null fields in Patch
  11824. // requests.
  11825. NullFields []string `json:"-"`
  11826. }
  11827. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11828. type NoMethod VideoOffset
  11829. raw := NoMethod(*s)
  11830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11831. }
  11832. // VideoSettings: Video Settings
  11833. type VideoSettings struct {
  11834. // CompanionSettings: Settings for the companion creatives of video
  11835. // creatives served to this placement.
  11836. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11837. // Kind: Identifies what kind of resource this is. Value: the fixed
  11838. // string "dfareporting#videoSettings".
  11839. Kind string `json:"kind,omitempty"`
  11840. // Orientation: Orientation of a video placement. If this value is set,
  11841. // placement will return assets matching the specified orientation.
  11842. //
  11843. // Possible values:
  11844. // "ANY"
  11845. // "LANDSCAPE"
  11846. // "PORTRAIT"
  11847. Orientation string `json:"orientation,omitempty"`
  11848. // SkippableSettings: Settings for the skippability of video creatives
  11849. // served to this placement. If this object is provided, the
  11850. // creative-level skippable settings will be overridden.
  11851. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11852. // TranscodeSettings: Settings for the transcodes of video creatives
  11853. // served to this placement. If this object is provided, the
  11854. // creative-level transcode settings will be overridden.
  11855. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11856. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11857. // to unconditionally include in API requests. By default, fields with
  11858. // empty values are omitted from API requests. However, any non-pointer,
  11859. // non-interface field appearing in ForceSendFields will be sent to the
  11860. // server regardless of whether the field is empty or not. This may be
  11861. // used to include empty fields in Patch requests.
  11862. ForceSendFields []string `json:"-"`
  11863. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11864. // include in API requests with the JSON null value. By default, fields
  11865. // with empty values are omitted from API requests. However, any field
  11866. // with an empty value appearing in NullFields will be sent to the
  11867. // server as null. It is an error if a field in this list has a
  11868. // non-empty value. This may be used to include null fields in Patch
  11869. // requests.
  11870. NullFields []string `json:"-"`
  11871. }
  11872. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11873. type NoMethod VideoSettings
  11874. raw := NoMethod(*s)
  11875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11876. }
  11877. // method id "dfareporting.accountActiveAdSummaries.get":
  11878. type AccountActiveAdSummariesGetCall struct {
  11879. s *Service
  11880. profileId int64
  11881. summaryAccountId int64
  11882. urlParams_ gensupport.URLParams
  11883. ifNoneMatch_ string
  11884. ctx_ context.Context
  11885. header_ http.Header
  11886. }
  11887. // Get: Gets the account's active ad summary by account ID.
  11888. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11889. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11890. c.profileId = profileId
  11891. c.summaryAccountId = summaryAccountId
  11892. return c
  11893. }
  11894. // Fields allows partial responses to be retrieved. See
  11895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11896. // for more information.
  11897. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11899. return c
  11900. }
  11901. // IfNoneMatch sets the optional parameter which makes the operation
  11902. // fail if the object's ETag matches the given value. This is useful for
  11903. // getting updates only after the object has changed since the last
  11904. // request. Use googleapi.IsNotModified to check whether the response
  11905. // error from Do is the result of In-None-Match.
  11906. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11907. c.ifNoneMatch_ = entityTag
  11908. return c
  11909. }
  11910. // Context sets the context to be used in this call's Do method. Any
  11911. // pending HTTP request will be aborted if the provided context is
  11912. // canceled.
  11913. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11914. c.ctx_ = ctx
  11915. return c
  11916. }
  11917. // Header returns an http.Header that can be modified by the caller to
  11918. // add HTTP headers to the request.
  11919. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11920. if c.header_ == nil {
  11921. c.header_ = make(http.Header)
  11922. }
  11923. return c.header_
  11924. }
  11925. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11926. reqHeaders := make(http.Header)
  11927. for k, v := range c.header_ {
  11928. reqHeaders[k] = v
  11929. }
  11930. reqHeaders.Set("User-Agent", c.s.userAgent())
  11931. if c.ifNoneMatch_ != "" {
  11932. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11933. }
  11934. var body io.Reader = nil
  11935. c.urlParams_.Set("alt", alt)
  11936. c.urlParams_.Set("prettyPrint", "false")
  11937. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11938. urls += "?" + c.urlParams_.Encode()
  11939. req, err := http.NewRequest("GET", urls, body)
  11940. if err != nil {
  11941. return nil, err
  11942. }
  11943. req.Header = reqHeaders
  11944. googleapi.Expand(req.URL, map[string]string{
  11945. "profileId": strconv.FormatInt(c.profileId, 10),
  11946. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11947. })
  11948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11949. }
  11950. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11951. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11952. // non-2xx status code is an error. Response headers are in either
  11953. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11954. // returned at all) in error.(*googleapi.Error).Header. Use
  11955. // googleapi.IsNotModified to check whether the returned error was
  11956. // because http.StatusNotModified was returned.
  11957. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11958. gensupport.SetOptions(c.urlParams_, opts...)
  11959. res, err := c.doRequest("json")
  11960. if res != nil && res.StatusCode == http.StatusNotModified {
  11961. if res.Body != nil {
  11962. res.Body.Close()
  11963. }
  11964. return nil, &googleapi.Error{
  11965. Code: res.StatusCode,
  11966. Header: res.Header,
  11967. }
  11968. }
  11969. if err != nil {
  11970. return nil, err
  11971. }
  11972. defer googleapi.CloseBody(res)
  11973. if err := googleapi.CheckResponse(res); err != nil {
  11974. return nil, err
  11975. }
  11976. ret := &AccountActiveAdSummary{
  11977. ServerResponse: googleapi.ServerResponse{
  11978. Header: res.Header,
  11979. HTTPStatusCode: res.StatusCode,
  11980. },
  11981. }
  11982. target := &ret
  11983. if err := gensupport.DecodeResponse(target, res); err != nil {
  11984. return nil, err
  11985. }
  11986. return ret, nil
  11987. // {
  11988. // "description": "Gets the account's active ad summary by account ID.",
  11989. // "httpMethod": "GET",
  11990. // "id": "dfareporting.accountActiveAdSummaries.get",
  11991. // "parameterOrder": [
  11992. // "profileId",
  11993. // "summaryAccountId"
  11994. // ],
  11995. // "parameters": {
  11996. // "profileId": {
  11997. // "description": "User profile ID associated with this request.",
  11998. // "format": "int64",
  11999. // "location": "path",
  12000. // "required": true,
  12001. // "type": "string"
  12002. // },
  12003. // "summaryAccountId": {
  12004. // "description": "Account ID.",
  12005. // "format": "int64",
  12006. // "location": "path",
  12007. // "required": true,
  12008. // "type": "string"
  12009. // }
  12010. // },
  12011. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  12012. // "response": {
  12013. // "$ref": "AccountActiveAdSummary"
  12014. // },
  12015. // "scopes": [
  12016. // "https://www.googleapis.com/auth/dfatrafficking"
  12017. // ]
  12018. // }
  12019. }
  12020. // method id "dfareporting.accountPermissionGroups.get":
  12021. type AccountPermissionGroupsGetCall struct {
  12022. s *Service
  12023. profileId int64
  12024. id int64
  12025. urlParams_ gensupport.URLParams
  12026. ifNoneMatch_ string
  12027. ctx_ context.Context
  12028. header_ http.Header
  12029. }
  12030. // Get: Gets one account permission group by ID.
  12031. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  12032. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12033. c.profileId = profileId
  12034. c.id = id
  12035. return c
  12036. }
  12037. // Fields allows partial responses to be retrieved. See
  12038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12039. // for more information.
  12040. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  12041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12042. return c
  12043. }
  12044. // IfNoneMatch sets the optional parameter which makes the operation
  12045. // fail if the object's ETag matches the given value. This is useful for
  12046. // getting updates only after the object has changed since the last
  12047. // request. Use googleapi.IsNotModified to check whether the response
  12048. // error from Do is the result of In-None-Match.
  12049. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  12050. c.ifNoneMatch_ = entityTag
  12051. return c
  12052. }
  12053. // Context sets the context to be used in this call's Do method. Any
  12054. // pending HTTP request will be aborted if the provided context is
  12055. // canceled.
  12056. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  12057. c.ctx_ = ctx
  12058. return c
  12059. }
  12060. // Header returns an http.Header that can be modified by the caller to
  12061. // add HTTP headers to the request.
  12062. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  12063. if c.header_ == nil {
  12064. c.header_ = make(http.Header)
  12065. }
  12066. return c.header_
  12067. }
  12068. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  12069. reqHeaders := make(http.Header)
  12070. for k, v := range c.header_ {
  12071. reqHeaders[k] = v
  12072. }
  12073. reqHeaders.Set("User-Agent", c.s.userAgent())
  12074. if c.ifNoneMatch_ != "" {
  12075. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12076. }
  12077. var body io.Reader = nil
  12078. c.urlParams_.Set("alt", alt)
  12079. c.urlParams_.Set("prettyPrint", "false")
  12080. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  12081. urls += "?" + c.urlParams_.Encode()
  12082. req, err := http.NewRequest("GET", urls, body)
  12083. if err != nil {
  12084. return nil, err
  12085. }
  12086. req.Header = reqHeaders
  12087. googleapi.Expand(req.URL, map[string]string{
  12088. "profileId": strconv.FormatInt(c.profileId, 10),
  12089. "id": strconv.FormatInt(c.id, 10),
  12090. })
  12091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12092. }
  12093. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  12094. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  12095. // non-2xx status code is an error. Response headers are in either
  12096. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  12097. // returned at all) in error.(*googleapi.Error).Header. Use
  12098. // googleapi.IsNotModified to check whether the returned error was
  12099. // because http.StatusNotModified was returned.
  12100. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  12101. gensupport.SetOptions(c.urlParams_, opts...)
  12102. res, err := c.doRequest("json")
  12103. if res != nil && res.StatusCode == http.StatusNotModified {
  12104. if res.Body != nil {
  12105. res.Body.Close()
  12106. }
  12107. return nil, &googleapi.Error{
  12108. Code: res.StatusCode,
  12109. Header: res.Header,
  12110. }
  12111. }
  12112. if err != nil {
  12113. return nil, err
  12114. }
  12115. defer googleapi.CloseBody(res)
  12116. if err := googleapi.CheckResponse(res); err != nil {
  12117. return nil, err
  12118. }
  12119. ret := &AccountPermissionGroup{
  12120. ServerResponse: googleapi.ServerResponse{
  12121. Header: res.Header,
  12122. HTTPStatusCode: res.StatusCode,
  12123. },
  12124. }
  12125. target := &ret
  12126. if err := gensupport.DecodeResponse(target, res); err != nil {
  12127. return nil, err
  12128. }
  12129. return ret, nil
  12130. // {
  12131. // "description": "Gets one account permission group by ID.",
  12132. // "httpMethod": "GET",
  12133. // "id": "dfareporting.accountPermissionGroups.get",
  12134. // "parameterOrder": [
  12135. // "profileId",
  12136. // "id"
  12137. // ],
  12138. // "parameters": {
  12139. // "id": {
  12140. // "description": "Account permission group ID.",
  12141. // "format": "int64",
  12142. // "location": "path",
  12143. // "required": true,
  12144. // "type": "string"
  12145. // },
  12146. // "profileId": {
  12147. // "description": "User profile ID associated with this request.",
  12148. // "format": "int64",
  12149. // "location": "path",
  12150. // "required": true,
  12151. // "type": "string"
  12152. // }
  12153. // },
  12154. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  12155. // "response": {
  12156. // "$ref": "AccountPermissionGroup"
  12157. // },
  12158. // "scopes": [
  12159. // "https://www.googleapis.com/auth/dfatrafficking"
  12160. // ]
  12161. // }
  12162. }
  12163. // method id "dfareporting.accountPermissionGroups.list":
  12164. type AccountPermissionGroupsListCall struct {
  12165. s *Service
  12166. profileId int64
  12167. urlParams_ gensupport.URLParams
  12168. ifNoneMatch_ string
  12169. ctx_ context.Context
  12170. header_ http.Header
  12171. }
  12172. // List: Retrieves the list of account permission groups.
  12173. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  12174. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12175. c.profileId = profileId
  12176. return c
  12177. }
  12178. // Fields allows partial responses to be retrieved. See
  12179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12180. // for more information.
  12181. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  12182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12183. return c
  12184. }
  12185. // IfNoneMatch sets the optional parameter which makes the operation
  12186. // fail if the object's ETag matches the given value. This is useful for
  12187. // getting updates only after the object has changed since the last
  12188. // request. Use googleapi.IsNotModified to check whether the response
  12189. // error from Do is the result of In-None-Match.
  12190. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  12191. c.ifNoneMatch_ = entityTag
  12192. return c
  12193. }
  12194. // Context sets the context to be used in this call's Do method. Any
  12195. // pending HTTP request will be aborted if the provided context is
  12196. // canceled.
  12197. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  12198. c.ctx_ = ctx
  12199. return c
  12200. }
  12201. // Header returns an http.Header that can be modified by the caller to
  12202. // add HTTP headers to the request.
  12203. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  12204. if c.header_ == nil {
  12205. c.header_ = make(http.Header)
  12206. }
  12207. return c.header_
  12208. }
  12209. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  12210. reqHeaders := make(http.Header)
  12211. for k, v := range c.header_ {
  12212. reqHeaders[k] = v
  12213. }
  12214. reqHeaders.Set("User-Agent", c.s.userAgent())
  12215. if c.ifNoneMatch_ != "" {
  12216. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12217. }
  12218. var body io.Reader = nil
  12219. c.urlParams_.Set("alt", alt)
  12220. c.urlParams_.Set("prettyPrint", "false")
  12221. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  12222. urls += "?" + c.urlParams_.Encode()
  12223. req, err := http.NewRequest("GET", urls, body)
  12224. if err != nil {
  12225. return nil, err
  12226. }
  12227. req.Header = reqHeaders
  12228. googleapi.Expand(req.URL, map[string]string{
  12229. "profileId": strconv.FormatInt(c.profileId, 10),
  12230. })
  12231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12232. }
  12233. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  12234. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  12235. // non-nil. Any non-2xx status code is an error. Response headers are in
  12236. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  12237. // (if a response was returned at all) in
  12238. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12239. // whether the returned error was because http.StatusNotModified was
  12240. // returned.
  12241. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  12242. gensupport.SetOptions(c.urlParams_, opts...)
  12243. res, err := c.doRequest("json")
  12244. if res != nil && res.StatusCode == http.StatusNotModified {
  12245. if res.Body != nil {
  12246. res.Body.Close()
  12247. }
  12248. return nil, &googleapi.Error{
  12249. Code: res.StatusCode,
  12250. Header: res.Header,
  12251. }
  12252. }
  12253. if err != nil {
  12254. return nil, err
  12255. }
  12256. defer googleapi.CloseBody(res)
  12257. if err := googleapi.CheckResponse(res); err != nil {
  12258. return nil, err
  12259. }
  12260. ret := &AccountPermissionGroupsListResponse{
  12261. ServerResponse: googleapi.ServerResponse{
  12262. Header: res.Header,
  12263. HTTPStatusCode: res.StatusCode,
  12264. },
  12265. }
  12266. target := &ret
  12267. if err := gensupport.DecodeResponse(target, res); err != nil {
  12268. return nil, err
  12269. }
  12270. return ret, nil
  12271. // {
  12272. // "description": "Retrieves the list of account permission groups.",
  12273. // "httpMethod": "GET",
  12274. // "id": "dfareporting.accountPermissionGroups.list",
  12275. // "parameterOrder": [
  12276. // "profileId"
  12277. // ],
  12278. // "parameters": {
  12279. // "profileId": {
  12280. // "description": "User profile ID associated with this request.",
  12281. // "format": "int64",
  12282. // "location": "path",
  12283. // "required": true,
  12284. // "type": "string"
  12285. // }
  12286. // },
  12287. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  12288. // "response": {
  12289. // "$ref": "AccountPermissionGroupsListResponse"
  12290. // },
  12291. // "scopes": [
  12292. // "https://www.googleapis.com/auth/dfatrafficking"
  12293. // ]
  12294. // }
  12295. }
  12296. // method id "dfareporting.accountPermissions.get":
  12297. type AccountPermissionsGetCall struct {
  12298. s *Service
  12299. profileId int64
  12300. id int64
  12301. urlParams_ gensupport.URLParams
  12302. ifNoneMatch_ string
  12303. ctx_ context.Context
  12304. header_ http.Header
  12305. }
  12306. // Get: Gets one account permission by ID.
  12307. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  12308. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12309. c.profileId = profileId
  12310. c.id = id
  12311. return c
  12312. }
  12313. // Fields allows partial responses to be retrieved. See
  12314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12315. // for more information.
  12316. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  12317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12318. return c
  12319. }
  12320. // IfNoneMatch sets the optional parameter which makes the operation
  12321. // fail if the object's ETag matches the given value. This is useful for
  12322. // getting updates only after the object has changed since the last
  12323. // request. Use googleapi.IsNotModified to check whether the response
  12324. // error from Do is the result of In-None-Match.
  12325. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  12326. c.ifNoneMatch_ = entityTag
  12327. return c
  12328. }
  12329. // Context sets the context to be used in this call's Do method. Any
  12330. // pending HTTP request will be aborted if the provided context is
  12331. // canceled.
  12332. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  12333. c.ctx_ = ctx
  12334. return c
  12335. }
  12336. // Header returns an http.Header that can be modified by the caller to
  12337. // add HTTP headers to the request.
  12338. func (c *AccountPermissionsGetCall) Header() http.Header {
  12339. if c.header_ == nil {
  12340. c.header_ = make(http.Header)
  12341. }
  12342. return c.header_
  12343. }
  12344. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12345. reqHeaders := make(http.Header)
  12346. for k, v := range c.header_ {
  12347. reqHeaders[k] = v
  12348. }
  12349. reqHeaders.Set("User-Agent", c.s.userAgent())
  12350. if c.ifNoneMatch_ != "" {
  12351. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12352. }
  12353. var body io.Reader = nil
  12354. c.urlParams_.Set("alt", alt)
  12355. c.urlParams_.Set("prettyPrint", "false")
  12356. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  12357. urls += "?" + c.urlParams_.Encode()
  12358. req, err := http.NewRequest("GET", urls, body)
  12359. if err != nil {
  12360. return nil, err
  12361. }
  12362. req.Header = reqHeaders
  12363. googleapi.Expand(req.URL, map[string]string{
  12364. "profileId": strconv.FormatInt(c.profileId, 10),
  12365. "id": strconv.FormatInt(c.id, 10),
  12366. })
  12367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12368. }
  12369. // Do executes the "dfareporting.accountPermissions.get" call.
  12370. // Exactly one of *AccountPermission or error will be non-nil. Any
  12371. // non-2xx status code is an error. Response headers are in either
  12372. // *AccountPermission.ServerResponse.Header or (if a response was
  12373. // returned at all) in error.(*googleapi.Error).Header. Use
  12374. // googleapi.IsNotModified to check whether the returned error was
  12375. // because http.StatusNotModified was returned.
  12376. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  12377. gensupport.SetOptions(c.urlParams_, opts...)
  12378. res, err := c.doRequest("json")
  12379. if res != nil && res.StatusCode == http.StatusNotModified {
  12380. if res.Body != nil {
  12381. res.Body.Close()
  12382. }
  12383. return nil, &googleapi.Error{
  12384. Code: res.StatusCode,
  12385. Header: res.Header,
  12386. }
  12387. }
  12388. if err != nil {
  12389. return nil, err
  12390. }
  12391. defer googleapi.CloseBody(res)
  12392. if err := googleapi.CheckResponse(res); err != nil {
  12393. return nil, err
  12394. }
  12395. ret := &AccountPermission{
  12396. ServerResponse: googleapi.ServerResponse{
  12397. Header: res.Header,
  12398. HTTPStatusCode: res.StatusCode,
  12399. },
  12400. }
  12401. target := &ret
  12402. if err := gensupport.DecodeResponse(target, res); err != nil {
  12403. return nil, err
  12404. }
  12405. return ret, nil
  12406. // {
  12407. // "description": "Gets one account permission by ID.",
  12408. // "httpMethod": "GET",
  12409. // "id": "dfareporting.accountPermissions.get",
  12410. // "parameterOrder": [
  12411. // "profileId",
  12412. // "id"
  12413. // ],
  12414. // "parameters": {
  12415. // "id": {
  12416. // "description": "Account permission ID.",
  12417. // "format": "int64",
  12418. // "location": "path",
  12419. // "required": true,
  12420. // "type": "string"
  12421. // },
  12422. // "profileId": {
  12423. // "description": "User profile ID associated with this request.",
  12424. // "format": "int64",
  12425. // "location": "path",
  12426. // "required": true,
  12427. // "type": "string"
  12428. // }
  12429. // },
  12430. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  12431. // "response": {
  12432. // "$ref": "AccountPermission"
  12433. // },
  12434. // "scopes": [
  12435. // "https://www.googleapis.com/auth/dfatrafficking"
  12436. // ]
  12437. // }
  12438. }
  12439. // method id "dfareporting.accountPermissions.list":
  12440. type AccountPermissionsListCall struct {
  12441. s *Service
  12442. profileId int64
  12443. urlParams_ gensupport.URLParams
  12444. ifNoneMatch_ string
  12445. ctx_ context.Context
  12446. header_ http.Header
  12447. }
  12448. // List: Retrieves the list of account permissions.
  12449. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12450. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12451. c.profileId = profileId
  12452. return c
  12453. }
  12454. // Fields allows partial responses to be retrieved. See
  12455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12456. // for more information.
  12457. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12459. return c
  12460. }
  12461. // IfNoneMatch sets the optional parameter which makes the operation
  12462. // fail if the object's ETag matches the given value. This is useful for
  12463. // getting updates only after the object has changed since the last
  12464. // request. Use googleapi.IsNotModified to check whether the response
  12465. // error from Do is the result of In-None-Match.
  12466. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12467. c.ifNoneMatch_ = entityTag
  12468. return c
  12469. }
  12470. // Context sets the context to be used in this call's Do method. Any
  12471. // pending HTTP request will be aborted if the provided context is
  12472. // canceled.
  12473. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12474. c.ctx_ = ctx
  12475. return c
  12476. }
  12477. // Header returns an http.Header that can be modified by the caller to
  12478. // add HTTP headers to the request.
  12479. func (c *AccountPermissionsListCall) Header() http.Header {
  12480. if c.header_ == nil {
  12481. c.header_ = make(http.Header)
  12482. }
  12483. return c.header_
  12484. }
  12485. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12486. reqHeaders := make(http.Header)
  12487. for k, v := range c.header_ {
  12488. reqHeaders[k] = v
  12489. }
  12490. reqHeaders.Set("User-Agent", c.s.userAgent())
  12491. if c.ifNoneMatch_ != "" {
  12492. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12493. }
  12494. var body io.Reader = nil
  12495. c.urlParams_.Set("alt", alt)
  12496. c.urlParams_.Set("prettyPrint", "false")
  12497. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12498. urls += "?" + c.urlParams_.Encode()
  12499. req, err := http.NewRequest("GET", urls, body)
  12500. if err != nil {
  12501. return nil, err
  12502. }
  12503. req.Header = reqHeaders
  12504. googleapi.Expand(req.URL, map[string]string{
  12505. "profileId": strconv.FormatInt(c.profileId, 10),
  12506. })
  12507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12508. }
  12509. // Do executes the "dfareporting.accountPermissions.list" call.
  12510. // Exactly one of *AccountPermissionsListResponse or error will be
  12511. // non-nil. Any non-2xx status code is an error. Response headers are in
  12512. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12513. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12514. // googleapi.IsNotModified to check whether the returned error was
  12515. // because http.StatusNotModified was returned.
  12516. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12517. gensupport.SetOptions(c.urlParams_, opts...)
  12518. res, err := c.doRequest("json")
  12519. if res != nil && res.StatusCode == http.StatusNotModified {
  12520. if res.Body != nil {
  12521. res.Body.Close()
  12522. }
  12523. return nil, &googleapi.Error{
  12524. Code: res.StatusCode,
  12525. Header: res.Header,
  12526. }
  12527. }
  12528. if err != nil {
  12529. return nil, err
  12530. }
  12531. defer googleapi.CloseBody(res)
  12532. if err := googleapi.CheckResponse(res); err != nil {
  12533. return nil, err
  12534. }
  12535. ret := &AccountPermissionsListResponse{
  12536. ServerResponse: googleapi.ServerResponse{
  12537. Header: res.Header,
  12538. HTTPStatusCode: res.StatusCode,
  12539. },
  12540. }
  12541. target := &ret
  12542. if err := gensupport.DecodeResponse(target, res); err != nil {
  12543. return nil, err
  12544. }
  12545. return ret, nil
  12546. // {
  12547. // "description": "Retrieves the list of account permissions.",
  12548. // "httpMethod": "GET",
  12549. // "id": "dfareporting.accountPermissions.list",
  12550. // "parameterOrder": [
  12551. // "profileId"
  12552. // ],
  12553. // "parameters": {
  12554. // "profileId": {
  12555. // "description": "User profile ID associated with this request.",
  12556. // "format": "int64",
  12557. // "location": "path",
  12558. // "required": true,
  12559. // "type": "string"
  12560. // }
  12561. // },
  12562. // "path": "userprofiles/{profileId}/accountPermissions",
  12563. // "response": {
  12564. // "$ref": "AccountPermissionsListResponse"
  12565. // },
  12566. // "scopes": [
  12567. // "https://www.googleapis.com/auth/dfatrafficking"
  12568. // ]
  12569. // }
  12570. }
  12571. // method id "dfareporting.accountUserProfiles.get":
  12572. type AccountUserProfilesGetCall struct {
  12573. s *Service
  12574. profileId int64
  12575. id int64
  12576. urlParams_ gensupport.URLParams
  12577. ifNoneMatch_ string
  12578. ctx_ context.Context
  12579. header_ http.Header
  12580. }
  12581. // Get: Gets one account user profile by ID.
  12582. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12583. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12584. c.profileId = profileId
  12585. c.id = id
  12586. return c
  12587. }
  12588. // Fields allows partial responses to be retrieved. See
  12589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12590. // for more information.
  12591. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12593. return c
  12594. }
  12595. // IfNoneMatch sets the optional parameter which makes the operation
  12596. // fail if the object's ETag matches the given value. This is useful for
  12597. // getting updates only after the object has changed since the last
  12598. // request. Use googleapi.IsNotModified to check whether the response
  12599. // error from Do is the result of In-None-Match.
  12600. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12601. c.ifNoneMatch_ = entityTag
  12602. return c
  12603. }
  12604. // Context sets the context to be used in this call's Do method. Any
  12605. // pending HTTP request will be aborted if the provided context is
  12606. // canceled.
  12607. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12608. c.ctx_ = ctx
  12609. return c
  12610. }
  12611. // Header returns an http.Header that can be modified by the caller to
  12612. // add HTTP headers to the request.
  12613. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12614. if c.header_ == nil {
  12615. c.header_ = make(http.Header)
  12616. }
  12617. return c.header_
  12618. }
  12619. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12620. reqHeaders := make(http.Header)
  12621. for k, v := range c.header_ {
  12622. reqHeaders[k] = v
  12623. }
  12624. reqHeaders.Set("User-Agent", c.s.userAgent())
  12625. if c.ifNoneMatch_ != "" {
  12626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12627. }
  12628. var body io.Reader = nil
  12629. c.urlParams_.Set("alt", alt)
  12630. c.urlParams_.Set("prettyPrint", "false")
  12631. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12632. urls += "?" + c.urlParams_.Encode()
  12633. req, err := http.NewRequest("GET", urls, body)
  12634. if err != nil {
  12635. return nil, err
  12636. }
  12637. req.Header = reqHeaders
  12638. googleapi.Expand(req.URL, map[string]string{
  12639. "profileId": strconv.FormatInt(c.profileId, 10),
  12640. "id": strconv.FormatInt(c.id, 10),
  12641. })
  12642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12643. }
  12644. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12645. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12646. // non-2xx status code is an error. Response headers are in either
  12647. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12648. // returned at all) in error.(*googleapi.Error).Header. Use
  12649. // googleapi.IsNotModified to check whether the returned error was
  12650. // because http.StatusNotModified was returned.
  12651. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12652. gensupport.SetOptions(c.urlParams_, opts...)
  12653. res, err := c.doRequest("json")
  12654. if res != nil && res.StatusCode == http.StatusNotModified {
  12655. if res.Body != nil {
  12656. res.Body.Close()
  12657. }
  12658. return nil, &googleapi.Error{
  12659. Code: res.StatusCode,
  12660. Header: res.Header,
  12661. }
  12662. }
  12663. if err != nil {
  12664. return nil, err
  12665. }
  12666. defer googleapi.CloseBody(res)
  12667. if err := googleapi.CheckResponse(res); err != nil {
  12668. return nil, err
  12669. }
  12670. ret := &AccountUserProfile{
  12671. ServerResponse: googleapi.ServerResponse{
  12672. Header: res.Header,
  12673. HTTPStatusCode: res.StatusCode,
  12674. },
  12675. }
  12676. target := &ret
  12677. if err := gensupport.DecodeResponse(target, res); err != nil {
  12678. return nil, err
  12679. }
  12680. return ret, nil
  12681. // {
  12682. // "description": "Gets one account user profile by ID.",
  12683. // "httpMethod": "GET",
  12684. // "id": "dfareporting.accountUserProfiles.get",
  12685. // "parameterOrder": [
  12686. // "profileId",
  12687. // "id"
  12688. // ],
  12689. // "parameters": {
  12690. // "id": {
  12691. // "description": "User profile ID.",
  12692. // "format": "int64",
  12693. // "location": "path",
  12694. // "required": true,
  12695. // "type": "string"
  12696. // },
  12697. // "profileId": {
  12698. // "description": "User profile ID associated with this request.",
  12699. // "format": "int64",
  12700. // "location": "path",
  12701. // "required": true,
  12702. // "type": "string"
  12703. // }
  12704. // },
  12705. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12706. // "response": {
  12707. // "$ref": "AccountUserProfile"
  12708. // },
  12709. // "scopes": [
  12710. // "https://www.googleapis.com/auth/dfatrafficking"
  12711. // ]
  12712. // }
  12713. }
  12714. // method id "dfareporting.accountUserProfiles.insert":
  12715. type AccountUserProfilesInsertCall struct {
  12716. s *Service
  12717. profileId int64
  12718. accountuserprofile *AccountUserProfile
  12719. urlParams_ gensupport.URLParams
  12720. ctx_ context.Context
  12721. header_ http.Header
  12722. }
  12723. // Insert: Inserts a new account user profile.
  12724. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12725. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12726. c.profileId = profileId
  12727. c.accountuserprofile = accountuserprofile
  12728. return c
  12729. }
  12730. // Fields allows partial responses to be retrieved. See
  12731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12732. // for more information.
  12733. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12735. return c
  12736. }
  12737. // Context sets the context to be used in this call's Do method. Any
  12738. // pending HTTP request will be aborted if the provided context is
  12739. // canceled.
  12740. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12741. c.ctx_ = ctx
  12742. return c
  12743. }
  12744. // Header returns an http.Header that can be modified by the caller to
  12745. // add HTTP headers to the request.
  12746. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12747. if c.header_ == nil {
  12748. c.header_ = make(http.Header)
  12749. }
  12750. return c.header_
  12751. }
  12752. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12753. reqHeaders := make(http.Header)
  12754. for k, v := range c.header_ {
  12755. reqHeaders[k] = v
  12756. }
  12757. reqHeaders.Set("User-Agent", c.s.userAgent())
  12758. var body io.Reader = nil
  12759. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12760. if err != nil {
  12761. return nil, err
  12762. }
  12763. reqHeaders.Set("Content-Type", "application/json")
  12764. c.urlParams_.Set("alt", alt)
  12765. c.urlParams_.Set("prettyPrint", "false")
  12766. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12767. urls += "?" + c.urlParams_.Encode()
  12768. req, err := http.NewRequest("POST", urls, body)
  12769. if err != nil {
  12770. return nil, err
  12771. }
  12772. req.Header = reqHeaders
  12773. googleapi.Expand(req.URL, map[string]string{
  12774. "profileId": strconv.FormatInt(c.profileId, 10),
  12775. })
  12776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12777. }
  12778. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12779. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12780. // non-2xx status code is an error. Response headers are in either
  12781. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12782. // returned at all) in error.(*googleapi.Error).Header. Use
  12783. // googleapi.IsNotModified to check whether the returned error was
  12784. // because http.StatusNotModified was returned.
  12785. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12786. gensupport.SetOptions(c.urlParams_, opts...)
  12787. res, err := c.doRequest("json")
  12788. if res != nil && res.StatusCode == http.StatusNotModified {
  12789. if res.Body != nil {
  12790. res.Body.Close()
  12791. }
  12792. return nil, &googleapi.Error{
  12793. Code: res.StatusCode,
  12794. Header: res.Header,
  12795. }
  12796. }
  12797. if err != nil {
  12798. return nil, err
  12799. }
  12800. defer googleapi.CloseBody(res)
  12801. if err := googleapi.CheckResponse(res); err != nil {
  12802. return nil, err
  12803. }
  12804. ret := &AccountUserProfile{
  12805. ServerResponse: googleapi.ServerResponse{
  12806. Header: res.Header,
  12807. HTTPStatusCode: res.StatusCode,
  12808. },
  12809. }
  12810. target := &ret
  12811. if err := gensupport.DecodeResponse(target, res); err != nil {
  12812. return nil, err
  12813. }
  12814. return ret, nil
  12815. // {
  12816. // "description": "Inserts a new account user profile.",
  12817. // "httpMethod": "POST",
  12818. // "id": "dfareporting.accountUserProfiles.insert",
  12819. // "parameterOrder": [
  12820. // "profileId"
  12821. // ],
  12822. // "parameters": {
  12823. // "profileId": {
  12824. // "description": "User profile ID associated with this request.",
  12825. // "format": "int64",
  12826. // "location": "path",
  12827. // "required": true,
  12828. // "type": "string"
  12829. // }
  12830. // },
  12831. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12832. // "request": {
  12833. // "$ref": "AccountUserProfile"
  12834. // },
  12835. // "response": {
  12836. // "$ref": "AccountUserProfile"
  12837. // },
  12838. // "scopes": [
  12839. // "https://www.googleapis.com/auth/dfatrafficking"
  12840. // ]
  12841. // }
  12842. }
  12843. // method id "dfareporting.accountUserProfiles.list":
  12844. type AccountUserProfilesListCall struct {
  12845. s *Service
  12846. profileId int64
  12847. urlParams_ gensupport.URLParams
  12848. ifNoneMatch_ string
  12849. ctx_ context.Context
  12850. header_ http.Header
  12851. }
  12852. // List: Retrieves a list of account user profiles, possibly filtered.
  12853. // This method supports paging.
  12854. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12855. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12856. c.profileId = profileId
  12857. return c
  12858. }
  12859. // Active sets the optional parameter "active": Select only active user
  12860. // profiles.
  12861. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12862. c.urlParams_.Set("active", fmt.Sprint(active))
  12863. return c
  12864. }
  12865. // Ids sets the optional parameter "ids": Select only user profiles with
  12866. // these IDs.
  12867. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12868. var ids_ []string
  12869. for _, v := range ids {
  12870. ids_ = append(ids_, fmt.Sprint(v))
  12871. }
  12872. c.urlParams_.SetMulti("ids", ids_)
  12873. return c
  12874. }
  12875. // MaxResults sets the optional parameter "maxResults": Maximum number
  12876. // of results to return.
  12877. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12878. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12879. return c
  12880. }
  12881. // PageToken sets the optional parameter "pageToken": Value of the
  12882. // nextPageToken from the previous result page.
  12883. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12884. c.urlParams_.Set("pageToken", pageToken)
  12885. return c
  12886. }
  12887. // SearchString sets the optional parameter "searchString": Allows
  12888. // searching for objects by name, ID or email. Wildcards (*) are
  12889. // allowed. For example, "user profile*2015" will return objects with
  12890. // names like "user profile June 2015", "user profile April 2015", or
  12891. // simply "user profile 2015". Most of the searches also add wildcards
  12892. // implicitly at the start and the end of the search string. For
  12893. // example, a search string of "user profile" will match objects with
  12894. // name "my user profile", "user profile 2015", or simply "user
  12895. // profile".
  12896. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12897. c.urlParams_.Set("searchString", searchString)
  12898. return c
  12899. }
  12900. // SortField sets the optional parameter "sortField": Field by which to
  12901. // sort the list.
  12902. //
  12903. // Possible values:
  12904. // "ID" (default)
  12905. // "NAME"
  12906. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12907. c.urlParams_.Set("sortField", sortField)
  12908. return c
  12909. }
  12910. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12911. // results.
  12912. //
  12913. // Possible values:
  12914. // "ASCENDING" (default)
  12915. // "DESCENDING"
  12916. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12917. c.urlParams_.Set("sortOrder", sortOrder)
  12918. return c
  12919. }
  12920. // SubaccountId sets the optional parameter "subaccountId": Select only
  12921. // user profiles with the specified subaccount ID.
  12922. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12923. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12924. return c
  12925. }
  12926. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12927. // profiles with the specified user role ID.
  12928. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12929. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12930. return c
  12931. }
  12932. // Fields allows partial responses to be retrieved. See
  12933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12934. // for more information.
  12935. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12937. return c
  12938. }
  12939. // IfNoneMatch sets the optional parameter which makes the operation
  12940. // fail if the object's ETag matches the given value. This is useful for
  12941. // getting updates only after the object has changed since the last
  12942. // request. Use googleapi.IsNotModified to check whether the response
  12943. // error from Do is the result of In-None-Match.
  12944. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12945. c.ifNoneMatch_ = entityTag
  12946. return c
  12947. }
  12948. // Context sets the context to be used in this call's Do method. Any
  12949. // pending HTTP request will be aborted if the provided context is
  12950. // canceled.
  12951. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12952. c.ctx_ = ctx
  12953. return c
  12954. }
  12955. // Header returns an http.Header that can be modified by the caller to
  12956. // add HTTP headers to the request.
  12957. func (c *AccountUserProfilesListCall) Header() http.Header {
  12958. if c.header_ == nil {
  12959. c.header_ = make(http.Header)
  12960. }
  12961. return c.header_
  12962. }
  12963. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12964. reqHeaders := make(http.Header)
  12965. for k, v := range c.header_ {
  12966. reqHeaders[k] = v
  12967. }
  12968. reqHeaders.Set("User-Agent", c.s.userAgent())
  12969. if c.ifNoneMatch_ != "" {
  12970. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12971. }
  12972. var body io.Reader = nil
  12973. c.urlParams_.Set("alt", alt)
  12974. c.urlParams_.Set("prettyPrint", "false")
  12975. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12976. urls += "?" + c.urlParams_.Encode()
  12977. req, err := http.NewRequest("GET", urls, body)
  12978. if err != nil {
  12979. return nil, err
  12980. }
  12981. req.Header = reqHeaders
  12982. googleapi.Expand(req.URL, map[string]string{
  12983. "profileId": strconv.FormatInt(c.profileId, 10),
  12984. })
  12985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12986. }
  12987. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12988. // Exactly one of *AccountUserProfilesListResponse or error will be
  12989. // non-nil. Any non-2xx status code is an error. Response headers are in
  12990. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12991. // a response was returned at all) in error.(*googleapi.Error).Header.
  12992. // Use googleapi.IsNotModified to check whether the returned error was
  12993. // because http.StatusNotModified was returned.
  12994. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  12995. gensupport.SetOptions(c.urlParams_, opts...)
  12996. res, err := c.doRequest("json")
  12997. if res != nil && res.StatusCode == http.StatusNotModified {
  12998. if res.Body != nil {
  12999. res.Body.Close()
  13000. }
  13001. return nil, &googleapi.Error{
  13002. Code: res.StatusCode,
  13003. Header: res.Header,
  13004. }
  13005. }
  13006. if err != nil {
  13007. return nil, err
  13008. }
  13009. defer googleapi.CloseBody(res)
  13010. if err := googleapi.CheckResponse(res); err != nil {
  13011. return nil, err
  13012. }
  13013. ret := &AccountUserProfilesListResponse{
  13014. ServerResponse: googleapi.ServerResponse{
  13015. Header: res.Header,
  13016. HTTPStatusCode: res.StatusCode,
  13017. },
  13018. }
  13019. target := &ret
  13020. if err := gensupport.DecodeResponse(target, res); err != nil {
  13021. return nil, err
  13022. }
  13023. return ret, nil
  13024. // {
  13025. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  13026. // "httpMethod": "GET",
  13027. // "id": "dfareporting.accountUserProfiles.list",
  13028. // "parameterOrder": [
  13029. // "profileId"
  13030. // ],
  13031. // "parameters": {
  13032. // "active": {
  13033. // "description": "Select only active user profiles.",
  13034. // "location": "query",
  13035. // "type": "boolean"
  13036. // },
  13037. // "ids": {
  13038. // "description": "Select only user profiles with these IDs.",
  13039. // "format": "int64",
  13040. // "location": "query",
  13041. // "repeated": true,
  13042. // "type": "string"
  13043. // },
  13044. // "maxResults": {
  13045. // "default": "1000",
  13046. // "description": "Maximum number of results to return.",
  13047. // "format": "int32",
  13048. // "location": "query",
  13049. // "maximum": "1000",
  13050. // "minimum": "0",
  13051. // "type": "integer"
  13052. // },
  13053. // "pageToken": {
  13054. // "description": "Value of the nextPageToken from the previous result page.",
  13055. // "location": "query",
  13056. // "type": "string"
  13057. // },
  13058. // "profileId": {
  13059. // "description": "User profile ID associated with this request.",
  13060. // "format": "int64",
  13061. // "location": "path",
  13062. // "required": true,
  13063. // "type": "string"
  13064. // },
  13065. // "searchString": {
  13066. // "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\".",
  13067. // "location": "query",
  13068. // "type": "string"
  13069. // },
  13070. // "sortField": {
  13071. // "default": "ID",
  13072. // "description": "Field by which to sort the list.",
  13073. // "enum": [
  13074. // "ID",
  13075. // "NAME"
  13076. // ],
  13077. // "enumDescriptions": [
  13078. // "",
  13079. // ""
  13080. // ],
  13081. // "location": "query",
  13082. // "type": "string"
  13083. // },
  13084. // "sortOrder": {
  13085. // "default": "ASCENDING",
  13086. // "description": "Order of sorted results.",
  13087. // "enum": [
  13088. // "ASCENDING",
  13089. // "DESCENDING"
  13090. // ],
  13091. // "enumDescriptions": [
  13092. // "",
  13093. // ""
  13094. // ],
  13095. // "location": "query",
  13096. // "type": "string"
  13097. // },
  13098. // "subaccountId": {
  13099. // "description": "Select only user profiles with the specified subaccount ID.",
  13100. // "format": "int64",
  13101. // "location": "query",
  13102. // "type": "string"
  13103. // },
  13104. // "userRoleId": {
  13105. // "description": "Select only user profiles with the specified user role ID.",
  13106. // "format": "int64",
  13107. // "location": "query",
  13108. // "type": "string"
  13109. // }
  13110. // },
  13111. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13112. // "response": {
  13113. // "$ref": "AccountUserProfilesListResponse"
  13114. // },
  13115. // "scopes": [
  13116. // "https://www.googleapis.com/auth/dfatrafficking"
  13117. // ]
  13118. // }
  13119. }
  13120. // Pages invokes f for each page of results.
  13121. // A non-nil error returned from f will halt the iteration.
  13122. // The provided context supersedes any context provided to the Context method.
  13123. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  13124. c.ctx_ = ctx
  13125. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13126. for {
  13127. x, err := c.Do()
  13128. if err != nil {
  13129. return err
  13130. }
  13131. if err := f(x); err != nil {
  13132. return err
  13133. }
  13134. if x.NextPageToken == "" {
  13135. return nil
  13136. }
  13137. c.PageToken(x.NextPageToken)
  13138. }
  13139. }
  13140. // method id "dfareporting.accountUserProfiles.patch":
  13141. type AccountUserProfilesPatchCall struct {
  13142. s *Service
  13143. profileId int64
  13144. accountuserprofile *AccountUserProfile
  13145. urlParams_ gensupport.URLParams
  13146. ctx_ context.Context
  13147. header_ http.Header
  13148. }
  13149. // Patch: Updates an existing account user profile. This method supports
  13150. // patch semantics.
  13151. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  13152. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13153. c.profileId = profileId
  13154. c.urlParams_.Set("id", fmt.Sprint(id))
  13155. c.accountuserprofile = accountuserprofile
  13156. return c
  13157. }
  13158. // Fields allows partial responses to be retrieved. See
  13159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13160. // for more information.
  13161. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  13162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13163. return c
  13164. }
  13165. // Context sets the context to be used in this call's Do method. Any
  13166. // pending HTTP request will be aborted if the provided context is
  13167. // canceled.
  13168. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  13169. c.ctx_ = ctx
  13170. return c
  13171. }
  13172. // Header returns an http.Header that can be modified by the caller to
  13173. // add HTTP headers to the request.
  13174. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  13175. if c.header_ == nil {
  13176. c.header_ = make(http.Header)
  13177. }
  13178. return c.header_
  13179. }
  13180. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  13181. reqHeaders := make(http.Header)
  13182. for k, v := range c.header_ {
  13183. reqHeaders[k] = v
  13184. }
  13185. reqHeaders.Set("User-Agent", c.s.userAgent())
  13186. var body io.Reader = nil
  13187. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13188. if err != nil {
  13189. return nil, err
  13190. }
  13191. reqHeaders.Set("Content-Type", "application/json")
  13192. c.urlParams_.Set("alt", alt)
  13193. c.urlParams_.Set("prettyPrint", "false")
  13194. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13195. urls += "?" + c.urlParams_.Encode()
  13196. req, err := http.NewRequest("PATCH", urls, body)
  13197. if err != nil {
  13198. return nil, err
  13199. }
  13200. req.Header = reqHeaders
  13201. googleapi.Expand(req.URL, map[string]string{
  13202. "profileId": strconv.FormatInt(c.profileId, 10),
  13203. })
  13204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13205. }
  13206. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  13207. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13208. // non-2xx status code is an error. Response headers are in either
  13209. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13210. // returned at all) in error.(*googleapi.Error).Header. Use
  13211. // googleapi.IsNotModified to check whether the returned error was
  13212. // because http.StatusNotModified was returned.
  13213. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13214. gensupport.SetOptions(c.urlParams_, opts...)
  13215. res, err := c.doRequest("json")
  13216. if res != nil && res.StatusCode == http.StatusNotModified {
  13217. if res.Body != nil {
  13218. res.Body.Close()
  13219. }
  13220. return nil, &googleapi.Error{
  13221. Code: res.StatusCode,
  13222. Header: res.Header,
  13223. }
  13224. }
  13225. if err != nil {
  13226. return nil, err
  13227. }
  13228. defer googleapi.CloseBody(res)
  13229. if err := googleapi.CheckResponse(res); err != nil {
  13230. return nil, err
  13231. }
  13232. ret := &AccountUserProfile{
  13233. ServerResponse: googleapi.ServerResponse{
  13234. Header: res.Header,
  13235. HTTPStatusCode: res.StatusCode,
  13236. },
  13237. }
  13238. target := &ret
  13239. if err := gensupport.DecodeResponse(target, res); err != nil {
  13240. return nil, err
  13241. }
  13242. return ret, nil
  13243. // {
  13244. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  13245. // "httpMethod": "PATCH",
  13246. // "id": "dfareporting.accountUserProfiles.patch",
  13247. // "parameterOrder": [
  13248. // "profileId",
  13249. // "id"
  13250. // ],
  13251. // "parameters": {
  13252. // "id": {
  13253. // "description": "User profile ID.",
  13254. // "format": "int64",
  13255. // "location": "query",
  13256. // "required": true,
  13257. // "type": "string"
  13258. // },
  13259. // "profileId": {
  13260. // "description": "User profile ID associated with this request.",
  13261. // "format": "int64",
  13262. // "location": "path",
  13263. // "required": true,
  13264. // "type": "string"
  13265. // }
  13266. // },
  13267. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13268. // "request": {
  13269. // "$ref": "AccountUserProfile"
  13270. // },
  13271. // "response": {
  13272. // "$ref": "AccountUserProfile"
  13273. // },
  13274. // "scopes": [
  13275. // "https://www.googleapis.com/auth/dfatrafficking"
  13276. // ]
  13277. // }
  13278. }
  13279. // method id "dfareporting.accountUserProfiles.update":
  13280. type AccountUserProfilesUpdateCall struct {
  13281. s *Service
  13282. profileId int64
  13283. accountuserprofile *AccountUserProfile
  13284. urlParams_ gensupport.URLParams
  13285. ctx_ context.Context
  13286. header_ http.Header
  13287. }
  13288. // Update: Updates an existing account user profile.
  13289. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  13290. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13291. c.profileId = profileId
  13292. c.accountuserprofile = accountuserprofile
  13293. return c
  13294. }
  13295. // Fields allows partial responses to be retrieved. See
  13296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13297. // for more information.
  13298. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  13299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13300. return c
  13301. }
  13302. // Context sets the context to be used in this call's Do method. Any
  13303. // pending HTTP request will be aborted if the provided context is
  13304. // canceled.
  13305. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  13306. c.ctx_ = ctx
  13307. return c
  13308. }
  13309. // Header returns an http.Header that can be modified by the caller to
  13310. // add HTTP headers to the request.
  13311. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  13312. if c.header_ == nil {
  13313. c.header_ = make(http.Header)
  13314. }
  13315. return c.header_
  13316. }
  13317. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13318. reqHeaders := make(http.Header)
  13319. for k, v := range c.header_ {
  13320. reqHeaders[k] = v
  13321. }
  13322. reqHeaders.Set("User-Agent", c.s.userAgent())
  13323. var body io.Reader = nil
  13324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13325. if err != nil {
  13326. return nil, err
  13327. }
  13328. reqHeaders.Set("Content-Type", "application/json")
  13329. c.urlParams_.Set("alt", alt)
  13330. c.urlParams_.Set("prettyPrint", "false")
  13331. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13332. urls += "?" + c.urlParams_.Encode()
  13333. req, err := http.NewRequest("PUT", urls, body)
  13334. if err != nil {
  13335. return nil, err
  13336. }
  13337. req.Header = reqHeaders
  13338. googleapi.Expand(req.URL, map[string]string{
  13339. "profileId": strconv.FormatInt(c.profileId, 10),
  13340. })
  13341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13342. }
  13343. // Do executes the "dfareporting.accountUserProfiles.update" call.
  13344. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13345. // non-2xx status code is an error. Response headers are in either
  13346. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13347. // returned at all) in error.(*googleapi.Error).Header. Use
  13348. // googleapi.IsNotModified to check whether the returned error was
  13349. // because http.StatusNotModified was returned.
  13350. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13351. gensupport.SetOptions(c.urlParams_, opts...)
  13352. res, err := c.doRequest("json")
  13353. if res != nil && res.StatusCode == http.StatusNotModified {
  13354. if res.Body != nil {
  13355. res.Body.Close()
  13356. }
  13357. return nil, &googleapi.Error{
  13358. Code: res.StatusCode,
  13359. Header: res.Header,
  13360. }
  13361. }
  13362. if err != nil {
  13363. return nil, err
  13364. }
  13365. defer googleapi.CloseBody(res)
  13366. if err := googleapi.CheckResponse(res); err != nil {
  13367. return nil, err
  13368. }
  13369. ret := &AccountUserProfile{
  13370. ServerResponse: googleapi.ServerResponse{
  13371. Header: res.Header,
  13372. HTTPStatusCode: res.StatusCode,
  13373. },
  13374. }
  13375. target := &ret
  13376. if err := gensupport.DecodeResponse(target, res); err != nil {
  13377. return nil, err
  13378. }
  13379. return ret, nil
  13380. // {
  13381. // "description": "Updates an existing account user profile.",
  13382. // "httpMethod": "PUT",
  13383. // "id": "dfareporting.accountUserProfiles.update",
  13384. // "parameterOrder": [
  13385. // "profileId"
  13386. // ],
  13387. // "parameters": {
  13388. // "profileId": {
  13389. // "description": "User profile ID associated with this request.",
  13390. // "format": "int64",
  13391. // "location": "path",
  13392. // "required": true,
  13393. // "type": "string"
  13394. // }
  13395. // },
  13396. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13397. // "request": {
  13398. // "$ref": "AccountUserProfile"
  13399. // },
  13400. // "response": {
  13401. // "$ref": "AccountUserProfile"
  13402. // },
  13403. // "scopes": [
  13404. // "https://www.googleapis.com/auth/dfatrafficking"
  13405. // ]
  13406. // }
  13407. }
  13408. // method id "dfareporting.accounts.get":
  13409. type AccountsGetCall struct {
  13410. s *Service
  13411. profileId int64
  13412. id int64
  13413. urlParams_ gensupport.URLParams
  13414. ifNoneMatch_ string
  13415. ctx_ context.Context
  13416. header_ http.Header
  13417. }
  13418. // Get: Gets one account by ID.
  13419. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  13420. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13421. c.profileId = profileId
  13422. c.id = id
  13423. return c
  13424. }
  13425. // Fields allows partial responses to be retrieved. See
  13426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13427. // for more information.
  13428. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  13429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13430. return c
  13431. }
  13432. // IfNoneMatch sets the optional parameter which makes the operation
  13433. // fail if the object's ETag matches the given value. This is useful for
  13434. // getting updates only after the object has changed since the last
  13435. // request. Use googleapi.IsNotModified to check whether the response
  13436. // error from Do is the result of In-None-Match.
  13437. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  13438. c.ifNoneMatch_ = entityTag
  13439. return c
  13440. }
  13441. // Context sets the context to be used in this call's Do method. Any
  13442. // pending HTTP request will be aborted if the provided context is
  13443. // canceled.
  13444. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  13445. c.ctx_ = ctx
  13446. return c
  13447. }
  13448. // Header returns an http.Header that can be modified by the caller to
  13449. // add HTTP headers to the request.
  13450. func (c *AccountsGetCall) Header() http.Header {
  13451. if c.header_ == nil {
  13452. c.header_ = make(http.Header)
  13453. }
  13454. return c.header_
  13455. }
  13456. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  13457. reqHeaders := make(http.Header)
  13458. for k, v := range c.header_ {
  13459. reqHeaders[k] = v
  13460. }
  13461. reqHeaders.Set("User-Agent", c.s.userAgent())
  13462. if c.ifNoneMatch_ != "" {
  13463. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13464. }
  13465. var body io.Reader = nil
  13466. c.urlParams_.Set("alt", alt)
  13467. c.urlParams_.Set("prettyPrint", "false")
  13468. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13469. urls += "?" + c.urlParams_.Encode()
  13470. req, err := http.NewRequest("GET", urls, body)
  13471. if err != nil {
  13472. return nil, err
  13473. }
  13474. req.Header = reqHeaders
  13475. googleapi.Expand(req.URL, map[string]string{
  13476. "profileId": strconv.FormatInt(c.profileId, 10),
  13477. "id": strconv.FormatInt(c.id, 10),
  13478. })
  13479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13480. }
  13481. // Do executes the "dfareporting.accounts.get" call.
  13482. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13483. // code is an error. Response headers are in either
  13484. // *Account.ServerResponse.Header or (if a response was returned at all)
  13485. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13486. // check whether the returned error was because http.StatusNotModified
  13487. // was returned.
  13488. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13489. gensupport.SetOptions(c.urlParams_, opts...)
  13490. res, err := c.doRequest("json")
  13491. if res != nil && res.StatusCode == http.StatusNotModified {
  13492. if res.Body != nil {
  13493. res.Body.Close()
  13494. }
  13495. return nil, &googleapi.Error{
  13496. Code: res.StatusCode,
  13497. Header: res.Header,
  13498. }
  13499. }
  13500. if err != nil {
  13501. return nil, err
  13502. }
  13503. defer googleapi.CloseBody(res)
  13504. if err := googleapi.CheckResponse(res); err != nil {
  13505. return nil, err
  13506. }
  13507. ret := &Account{
  13508. ServerResponse: googleapi.ServerResponse{
  13509. Header: res.Header,
  13510. HTTPStatusCode: res.StatusCode,
  13511. },
  13512. }
  13513. target := &ret
  13514. if err := gensupport.DecodeResponse(target, res); err != nil {
  13515. return nil, err
  13516. }
  13517. return ret, nil
  13518. // {
  13519. // "description": "Gets one account by ID.",
  13520. // "httpMethod": "GET",
  13521. // "id": "dfareporting.accounts.get",
  13522. // "parameterOrder": [
  13523. // "profileId",
  13524. // "id"
  13525. // ],
  13526. // "parameters": {
  13527. // "id": {
  13528. // "description": "Account ID.",
  13529. // "format": "int64",
  13530. // "location": "path",
  13531. // "required": true,
  13532. // "type": "string"
  13533. // },
  13534. // "profileId": {
  13535. // "description": "User profile ID associated with this request.",
  13536. // "format": "int64",
  13537. // "location": "path",
  13538. // "required": true,
  13539. // "type": "string"
  13540. // }
  13541. // },
  13542. // "path": "userprofiles/{profileId}/accounts/{id}",
  13543. // "response": {
  13544. // "$ref": "Account"
  13545. // },
  13546. // "scopes": [
  13547. // "https://www.googleapis.com/auth/dfatrafficking"
  13548. // ]
  13549. // }
  13550. }
  13551. // method id "dfareporting.accounts.list":
  13552. type AccountsListCall struct {
  13553. s *Service
  13554. profileId int64
  13555. urlParams_ gensupport.URLParams
  13556. ifNoneMatch_ string
  13557. ctx_ context.Context
  13558. header_ http.Header
  13559. }
  13560. // List: Retrieves the list of accounts, possibly filtered. This method
  13561. // supports paging.
  13562. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13563. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13564. c.profileId = profileId
  13565. return c
  13566. }
  13567. // Active sets the optional parameter "active": Select only active
  13568. // accounts. Don't set this field to select both active and non-active
  13569. // accounts.
  13570. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13571. c.urlParams_.Set("active", fmt.Sprint(active))
  13572. return c
  13573. }
  13574. // Ids sets the optional parameter "ids": Select only accounts with
  13575. // these IDs.
  13576. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13577. var ids_ []string
  13578. for _, v := range ids {
  13579. ids_ = append(ids_, fmt.Sprint(v))
  13580. }
  13581. c.urlParams_.SetMulti("ids", ids_)
  13582. return c
  13583. }
  13584. // MaxResults sets the optional parameter "maxResults": Maximum number
  13585. // of results to return.
  13586. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13587. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13588. return c
  13589. }
  13590. // PageToken sets the optional parameter "pageToken": Value of the
  13591. // nextPageToken from the previous result page.
  13592. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13593. c.urlParams_.Set("pageToken", pageToken)
  13594. return c
  13595. }
  13596. // SearchString sets the optional parameter "searchString": Allows
  13597. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13598. // example, "account*2015" will return objects with names like "account
  13599. // June 2015", "account April 2015", or simply "account 2015". Most of
  13600. // the searches also add wildcards implicitly at the start and the end
  13601. // of the search string. For example, a search string of "account" will
  13602. // match objects with name "my account", "account 2015", or simply
  13603. // "account".
  13604. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13605. c.urlParams_.Set("searchString", searchString)
  13606. return c
  13607. }
  13608. // SortField sets the optional parameter "sortField": Field by which to
  13609. // sort the list.
  13610. //
  13611. // Possible values:
  13612. // "ID" (default)
  13613. // "NAME"
  13614. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13615. c.urlParams_.Set("sortField", sortField)
  13616. return c
  13617. }
  13618. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13619. // results.
  13620. //
  13621. // Possible values:
  13622. // "ASCENDING" (default)
  13623. // "DESCENDING"
  13624. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13625. c.urlParams_.Set("sortOrder", sortOrder)
  13626. return c
  13627. }
  13628. // Fields allows partial responses to be retrieved. See
  13629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13630. // for more information.
  13631. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13633. return c
  13634. }
  13635. // IfNoneMatch sets the optional parameter which makes the operation
  13636. // fail if the object's ETag matches the given value. This is useful for
  13637. // getting updates only after the object has changed since the last
  13638. // request. Use googleapi.IsNotModified to check whether the response
  13639. // error from Do is the result of In-None-Match.
  13640. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13641. c.ifNoneMatch_ = entityTag
  13642. return c
  13643. }
  13644. // Context sets the context to be used in this call's Do method. Any
  13645. // pending HTTP request will be aborted if the provided context is
  13646. // canceled.
  13647. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13648. c.ctx_ = ctx
  13649. return c
  13650. }
  13651. // Header returns an http.Header that can be modified by the caller to
  13652. // add HTTP headers to the request.
  13653. func (c *AccountsListCall) Header() http.Header {
  13654. if c.header_ == nil {
  13655. c.header_ = make(http.Header)
  13656. }
  13657. return c.header_
  13658. }
  13659. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13660. reqHeaders := make(http.Header)
  13661. for k, v := range c.header_ {
  13662. reqHeaders[k] = v
  13663. }
  13664. reqHeaders.Set("User-Agent", c.s.userAgent())
  13665. if c.ifNoneMatch_ != "" {
  13666. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13667. }
  13668. var body io.Reader = nil
  13669. c.urlParams_.Set("alt", alt)
  13670. c.urlParams_.Set("prettyPrint", "false")
  13671. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13672. urls += "?" + c.urlParams_.Encode()
  13673. req, err := http.NewRequest("GET", urls, body)
  13674. if err != nil {
  13675. return nil, err
  13676. }
  13677. req.Header = reqHeaders
  13678. googleapi.Expand(req.URL, map[string]string{
  13679. "profileId": strconv.FormatInt(c.profileId, 10),
  13680. })
  13681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13682. }
  13683. // Do executes the "dfareporting.accounts.list" call.
  13684. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13685. // non-2xx status code is an error. Response headers are in either
  13686. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13687. // returned at all) in error.(*googleapi.Error).Header. Use
  13688. // googleapi.IsNotModified to check whether the returned error was
  13689. // because http.StatusNotModified was returned.
  13690. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13691. gensupport.SetOptions(c.urlParams_, opts...)
  13692. res, err := c.doRequest("json")
  13693. if res != nil && res.StatusCode == http.StatusNotModified {
  13694. if res.Body != nil {
  13695. res.Body.Close()
  13696. }
  13697. return nil, &googleapi.Error{
  13698. Code: res.StatusCode,
  13699. Header: res.Header,
  13700. }
  13701. }
  13702. if err != nil {
  13703. return nil, err
  13704. }
  13705. defer googleapi.CloseBody(res)
  13706. if err := googleapi.CheckResponse(res); err != nil {
  13707. return nil, err
  13708. }
  13709. ret := &AccountsListResponse{
  13710. ServerResponse: googleapi.ServerResponse{
  13711. Header: res.Header,
  13712. HTTPStatusCode: res.StatusCode,
  13713. },
  13714. }
  13715. target := &ret
  13716. if err := gensupport.DecodeResponse(target, res); err != nil {
  13717. return nil, err
  13718. }
  13719. return ret, nil
  13720. // {
  13721. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13722. // "httpMethod": "GET",
  13723. // "id": "dfareporting.accounts.list",
  13724. // "parameterOrder": [
  13725. // "profileId"
  13726. // ],
  13727. // "parameters": {
  13728. // "active": {
  13729. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13730. // "location": "query",
  13731. // "type": "boolean"
  13732. // },
  13733. // "ids": {
  13734. // "description": "Select only accounts with these IDs.",
  13735. // "format": "int64",
  13736. // "location": "query",
  13737. // "repeated": true,
  13738. // "type": "string"
  13739. // },
  13740. // "maxResults": {
  13741. // "default": "1000",
  13742. // "description": "Maximum number of results to return.",
  13743. // "format": "int32",
  13744. // "location": "query",
  13745. // "maximum": "1000",
  13746. // "minimum": "0",
  13747. // "type": "integer"
  13748. // },
  13749. // "pageToken": {
  13750. // "description": "Value of the nextPageToken from the previous result page.",
  13751. // "location": "query",
  13752. // "type": "string"
  13753. // },
  13754. // "profileId": {
  13755. // "description": "User profile ID associated with this request.",
  13756. // "format": "int64",
  13757. // "location": "path",
  13758. // "required": true,
  13759. // "type": "string"
  13760. // },
  13761. // "searchString": {
  13762. // "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\".",
  13763. // "location": "query",
  13764. // "type": "string"
  13765. // },
  13766. // "sortField": {
  13767. // "default": "ID",
  13768. // "description": "Field by which to sort the list.",
  13769. // "enum": [
  13770. // "ID",
  13771. // "NAME"
  13772. // ],
  13773. // "enumDescriptions": [
  13774. // "",
  13775. // ""
  13776. // ],
  13777. // "location": "query",
  13778. // "type": "string"
  13779. // },
  13780. // "sortOrder": {
  13781. // "default": "ASCENDING",
  13782. // "description": "Order of sorted results.",
  13783. // "enum": [
  13784. // "ASCENDING",
  13785. // "DESCENDING"
  13786. // ],
  13787. // "enumDescriptions": [
  13788. // "",
  13789. // ""
  13790. // ],
  13791. // "location": "query",
  13792. // "type": "string"
  13793. // }
  13794. // },
  13795. // "path": "userprofiles/{profileId}/accounts",
  13796. // "response": {
  13797. // "$ref": "AccountsListResponse"
  13798. // },
  13799. // "scopes": [
  13800. // "https://www.googleapis.com/auth/dfatrafficking"
  13801. // ]
  13802. // }
  13803. }
  13804. // Pages invokes f for each page of results.
  13805. // A non-nil error returned from f will halt the iteration.
  13806. // The provided context supersedes any context provided to the Context method.
  13807. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13808. c.ctx_ = ctx
  13809. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13810. for {
  13811. x, err := c.Do()
  13812. if err != nil {
  13813. return err
  13814. }
  13815. if err := f(x); err != nil {
  13816. return err
  13817. }
  13818. if x.NextPageToken == "" {
  13819. return nil
  13820. }
  13821. c.PageToken(x.NextPageToken)
  13822. }
  13823. }
  13824. // method id "dfareporting.accounts.patch":
  13825. type AccountsPatchCall struct {
  13826. s *Service
  13827. profileId int64
  13828. account *Account
  13829. urlParams_ gensupport.URLParams
  13830. ctx_ context.Context
  13831. header_ http.Header
  13832. }
  13833. // Patch: Updates an existing account. This method supports patch
  13834. // semantics.
  13835. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13836. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13837. c.profileId = profileId
  13838. c.urlParams_.Set("id", fmt.Sprint(id))
  13839. c.account = account
  13840. return c
  13841. }
  13842. // Fields allows partial responses to be retrieved. See
  13843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13844. // for more information.
  13845. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13847. return c
  13848. }
  13849. // Context sets the context to be used in this call's Do method. Any
  13850. // pending HTTP request will be aborted if the provided context is
  13851. // canceled.
  13852. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13853. c.ctx_ = ctx
  13854. return c
  13855. }
  13856. // Header returns an http.Header that can be modified by the caller to
  13857. // add HTTP headers to the request.
  13858. func (c *AccountsPatchCall) Header() http.Header {
  13859. if c.header_ == nil {
  13860. c.header_ = make(http.Header)
  13861. }
  13862. return c.header_
  13863. }
  13864. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13865. reqHeaders := make(http.Header)
  13866. for k, v := range c.header_ {
  13867. reqHeaders[k] = v
  13868. }
  13869. reqHeaders.Set("User-Agent", c.s.userAgent())
  13870. var body io.Reader = nil
  13871. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13872. if err != nil {
  13873. return nil, err
  13874. }
  13875. reqHeaders.Set("Content-Type", "application/json")
  13876. c.urlParams_.Set("alt", alt)
  13877. c.urlParams_.Set("prettyPrint", "false")
  13878. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13879. urls += "?" + c.urlParams_.Encode()
  13880. req, err := http.NewRequest("PATCH", urls, body)
  13881. if err != nil {
  13882. return nil, err
  13883. }
  13884. req.Header = reqHeaders
  13885. googleapi.Expand(req.URL, map[string]string{
  13886. "profileId": strconv.FormatInt(c.profileId, 10),
  13887. })
  13888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13889. }
  13890. // Do executes the "dfareporting.accounts.patch" call.
  13891. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13892. // code is an error. Response headers are in either
  13893. // *Account.ServerResponse.Header or (if a response was returned at all)
  13894. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13895. // check whether the returned error was because http.StatusNotModified
  13896. // was returned.
  13897. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13898. gensupport.SetOptions(c.urlParams_, opts...)
  13899. res, err := c.doRequest("json")
  13900. if res != nil && res.StatusCode == http.StatusNotModified {
  13901. if res.Body != nil {
  13902. res.Body.Close()
  13903. }
  13904. return nil, &googleapi.Error{
  13905. Code: res.StatusCode,
  13906. Header: res.Header,
  13907. }
  13908. }
  13909. if err != nil {
  13910. return nil, err
  13911. }
  13912. defer googleapi.CloseBody(res)
  13913. if err := googleapi.CheckResponse(res); err != nil {
  13914. return nil, err
  13915. }
  13916. ret := &Account{
  13917. ServerResponse: googleapi.ServerResponse{
  13918. Header: res.Header,
  13919. HTTPStatusCode: res.StatusCode,
  13920. },
  13921. }
  13922. target := &ret
  13923. if err := gensupport.DecodeResponse(target, res); err != nil {
  13924. return nil, err
  13925. }
  13926. return ret, nil
  13927. // {
  13928. // "description": "Updates an existing account. This method supports patch semantics.",
  13929. // "httpMethod": "PATCH",
  13930. // "id": "dfareporting.accounts.patch",
  13931. // "parameterOrder": [
  13932. // "profileId",
  13933. // "id"
  13934. // ],
  13935. // "parameters": {
  13936. // "id": {
  13937. // "description": "Account ID.",
  13938. // "format": "int64",
  13939. // "location": "query",
  13940. // "required": true,
  13941. // "type": "string"
  13942. // },
  13943. // "profileId": {
  13944. // "description": "User profile ID associated with this request.",
  13945. // "format": "int64",
  13946. // "location": "path",
  13947. // "required": true,
  13948. // "type": "string"
  13949. // }
  13950. // },
  13951. // "path": "userprofiles/{profileId}/accounts",
  13952. // "request": {
  13953. // "$ref": "Account"
  13954. // },
  13955. // "response": {
  13956. // "$ref": "Account"
  13957. // },
  13958. // "scopes": [
  13959. // "https://www.googleapis.com/auth/dfatrafficking"
  13960. // ]
  13961. // }
  13962. }
  13963. // method id "dfareporting.accounts.update":
  13964. type AccountsUpdateCall struct {
  13965. s *Service
  13966. profileId int64
  13967. account *Account
  13968. urlParams_ gensupport.URLParams
  13969. ctx_ context.Context
  13970. header_ http.Header
  13971. }
  13972. // Update: Updates an existing account.
  13973. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13974. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13975. c.profileId = profileId
  13976. c.account = account
  13977. return c
  13978. }
  13979. // Fields allows partial responses to be retrieved. See
  13980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13981. // for more information.
  13982. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13984. return c
  13985. }
  13986. // Context sets the context to be used in this call's Do method. Any
  13987. // pending HTTP request will be aborted if the provided context is
  13988. // canceled.
  13989. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13990. c.ctx_ = ctx
  13991. return c
  13992. }
  13993. // Header returns an http.Header that can be modified by the caller to
  13994. // add HTTP headers to the request.
  13995. func (c *AccountsUpdateCall) Header() http.Header {
  13996. if c.header_ == nil {
  13997. c.header_ = make(http.Header)
  13998. }
  13999. return c.header_
  14000. }
  14001. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14002. reqHeaders := make(http.Header)
  14003. for k, v := range c.header_ {
  14004. reqHeaders[k] = v
  14005. }
  14006. reqHeaders.Set("User-Agent", c.s.userAgent())
  14007. var body io.Reader = nil
  14008. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  14009. if err != nil {
  14010. return nil, err
  14011. }
  14012. reqHeaders.Set("Content-Type", "application/json")
  14013. c.urlParams_.Set("alt", alt)
  14014. c.urlParams_.Set("prettyPrint", "false")
  14015. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  14016. urls += "?" + c.urlParams_.Encode()
  14017. req, err := http.NewRequest("PUT", urls, body)
  14018. if err != nil {
  14019. return nil, err
  14020. }
  14021. req.Header = reqHeaders
  14022. googleapi.Expand(req.URL, map[string]string{
  14023. "profileId": strconv.FormatInt(c.profileId, 10),
  14024. })
  14025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14026. }
  14027. // Do executes the "dfareporting.accounts.update" call.
  14028. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  14029. // code is an error. Response headers are in either
  14030. // *Account.ServerResponse.Header or (if a response was returned at all)
  14031. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14032. // check whether the returned error was because http.StatusNotModified
  14033. // was returned.
  14034. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  14035. gensupport.SetOptions(c.urlParams_, opts...)
  14036. res, err := c.doRequest("json")
  14037. if res != nil && res.StatusCode == http.StatusNotModified {
  14038. if res.Body != nil {
  14039. res.Body.Close()
  14040. }
  14041. return nil, &googleapi.Error{
  14042. Code: res.StatusCode,
  14043. Header: res.Header,
  14044. }
  14045. }
  14046. if err != nil {
  14047. return nil, err
  14048. }
  14049. defer googleapi.CloseBody(res)
  14050. if err := googleapi.CheckResponse(res); err != nil {
  14051. return nil, err
  14052. }
  14053. ret := &Account{
  14054. ServerResponse: googleapi.ServerResponse{
  14055. Header: res.Header,
  14056. HTTPStatusCode: res.StatusCode,
  14057. },
  14058. }
  14059. target := &ret
  14060. if err := gensupport.DecodeResponse(target, res); err != nil {
  14061. return nil, err
  14062. }
  14063. return ret, nil
  14064. // {
  14065. // "description": "Updates an existing account.",
  14066. // "httpMethod": "PUT",
  14067. // "id": "dfareporting.accounts.update",
  14068. // "parameterOrder": [
  14069. // "profileId"
  14070. // ],
  14071. // "parameters": {
  14072. // "profileId": {
  14073. // "description": "User profile ID associated with this request.",
  14074. // "format": "int64",
  14075. // "location": "path",
  14076. // "required": true,
  14077. // "type": "string"
  14078. // }
  14079. // },
  14080. // "path": "userprofiles/{profileId}/accounts",
  14081. // "request": {
  14082. // "$ref": "Account"
  14083. // },
  14084. // "response": {
  14085. // "$ref": "Account"
  14086. // },
  14087. // "scopes": [
  14088. // "https://www.googleapis.com/auth/dfatrafficking"
  14089. // ]
  14090. // }
  14091. }
  14092. // method id "dfareporting.ads.get":
  14093. type AdsGetCall struct {
  14094. s *Service
  14095. profileId int64
  14096. id int64
  14097. urlParams_ gensupport.URLParams
  14098. ifNoneMatch_ string
  14099. ctx_ context.Context
  14100. header_ http.Header
  14101. }
  14102. // Get: Gets one ad by ID.
  14103. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  14104. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14105. c.profileId = profileId
  14106. c.id = id
  14107. return c
  14108. }
  14109. // Fields allows partial responses to be retrieved. See
  14110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14111. // for more information.
  14112. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  14113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14114. return c
  14115. }
  14116. // IfNoneMatch sets the optional parameter which makes the operation
  14117. // fail if the object's ETag matches the given value. This is useful for
  14118. // getting updates only after the object has changed since the last
  14119. // request. Use googleapi.IsNotModified to check whether the response
  14120. // error from Do is the result of In-None-Match.
  14121. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  14122. c.ifNoneMatch_ = entityTag
  14123. return c
  14124. }
  14125. // Context sets the context to be used in this call's Do method. Any
  14126. // pending HTTP request will be aborted if the provided context is
  14127. // canceled.
  14128. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  14129. c.ctx_ = ctx
  14130. return c
  14131. }
  14132. // Header returns an http.Header that can be modified by the caller to
  14133. // add HTTP headers to the request.
  14134. func (c *AdsGetCall) Header() http.Header {
  14135. if c.header_ == nil {
  14136. c.header_ = make(http.Header)
  14137. }
  14138. return c.header_
  14139. }
  14140. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  14141. reqHeaders := make(http.Header)
  14142. for k, v := range c.header_ {
  14143. reqHeaders[k] = v
  14144. }
  14145. reqHeaders.Set("User-Agent", c.s.userAgent())
  14146. if c.ifNoneMatch_ != "" {
  14147. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14148. }
  14149. var body io.Reader = nil
  14150. c.urlParams_.Set("alt", alt)
  14151. c.urlParams_.Set("prettyPrint", "false")
  14152. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  14153. urls += "?" + c.urlParams_.Encode()
  14154. req, err := http.NewRequest("GET", urls, body)
  14155. if err != nil {
  14156. return nil, err
  14157. }
  14158. req.Header = reqHeaders
  14159. googleapi.Expand(req.URL, map[string]string{
  14160. "profileId": strconv.FormatInt(c.profileId, 10),
  14161. "id": strconv.FormatInt(c.id, 10),
  14162. })
  14163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14164. }
  14165. // Do executes the "dfareporting.ads.get" call.
  14166. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14167. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14168. // or (if a response was returned at all) in
  14169. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14170. // whether the returned error was because http.StatusNotModified was
  14171. // returned.
  14172. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14173. gensupport.SetOptions(c.urlParams_, opts...)
  14174. res, err := c.doRequest("json")
  14175. if res != nil && res.StatusCode == http.StatusNotModified {
  14176. if res.Body != nil {
  14177. res.Body.Close()
  14178. }
  14179. return nil, &googleapi.Error{
  14180. Code: res.StatusCode,
  14181. Header: res.Header,
  14182. }
  14183. }
  14184. if err != nil {
  14185. return nil, err
  14186. }
  14187. defer googleapi.CloseBody(res)
  14188. if err := googleapi.CheckResponse(res); err != nil {
  14189. return nil, err
  14190. }
  14191. ret := &Ad{
  14192. ServerResponse: googleapi.ServerResponse{
  14193. Header: res.Header,
  14194. HTTPStatusCode: res.StatusCode,
  14195. },
  14196. }
  14197. target := &ret
  14198. if err := gensupport.DecodeResponse(target, res); err != nil {
  14199. return nil, err
  14200. }
  14201. return ret, nil
  14202. // {
  14203. // "description": "Gets one ad by ID.",
  14204. // "httpMethod": "GET",
  14205. // "id": "dfareporting.ads.get",
  14206. // "parameterOrder": [
  14207. // "profileId",
  14208. // "id"
  14209. // ],
  14210. // "parameters": {
  14211. // "id": {
  14212. // "description": "Ad ID.",
  14213. // "format": "int64",
  14214. // "location": "path",
  14215. // "required": true,
  14216. // "type": "string"
  14217. // },
  14218. // "profileId": {
  14219. // "description": "User profile ID associated with this request.",
  14220. // "format": "int64",
  14221. // "location": "path",
  14222. // "required": true,
  14223. // "type": "string"
  14224. // }
  14225. // },
  14226. // "path": "userprofiles/{profileId}/ads/{id}",
  14227. // "response": {
  14228. // "$ref": "Ad"
  14229. // },
  14230. // "scopes": [
  14231. // "https://www.googleapis.com/auth/dfatrafficking"
  14232. // ]
  14233. // }
  14234. }
  14235. // method id "dfareporting.ads.insert":
  14236. type AdsInsertCall struct {
  14237. s *Service
  14238. profileId int64
  14239. ad *Ad
  14240. urlParams_ gensupport.URLParams
  14241. ctx_ context.Context
  14242. header_ http.Header
  14243. }
  14244. // Insert: Inserts a new ad.
  14245. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  14246. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14247. c.profileId = profileId
  14248. c.ad = ad
  14249. return c
  14250. }
  14251. // Fields allows partial responses to be retrieved. See
  14252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14253. // for more information.
  14254. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  14255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14256. return c
  14257. }
  14258. // Context sets the context to be used in this call's Do method. Any
  14259. // pending HTTP request will be aborted if the provided context is
  14260. // canceled.
  14261. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  14262. c.ctx_ = ctx
  14263. return c
  14264. }
  14265. // Header returns an http.Header that can be modified by the caller to
  14266. // add HTTP headers to the request.
  14267. func (c *AdsInsertCall) Header() http.Header {
  14268. if c.header_ == nil {
  14269. c.header_ = make(http.Header)
  14270. }
  14271. return c.header_
  14272. }
  14273. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  14274. reqHeaders := make(http.Header)
  14275. for k, v := range c.header_ {
  14276. reqHeaders[k] = v
  14277. }
  14278. reqHeaders.Set("User-Agent", c.s.userAgent())
  14279. var body io.Reader = nil
  14280. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14281. if err != nil {
  14282. return nil, err
  14283. }
  14284. reqHeaders.Set("Content-Type", "application/json")
  14285. c.urlParams_.Set("alt", alt)
  14286. c.urlParams_.Set("prettyPrint", "false")
  14287. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14288. urls += "?" + c.urlParams_.Encode()
  14289. req, err := http.NewRequest("POST", urls, body)
  14290. if err != nil {
  14291. return nil, err
  14292. }
  14293. req.Header = reqHeaders
  14294. googleapi.Expand(req.URL, map[string]string{
  14295. "profileId": strconv.FormatInt(c.profileId, 10),
  14296. })
  14297. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14298. }
  14299. // Do executes the "dfareporting.ads.insert" call.
  14300. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14301. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14302. // or (if a response was returned at all) in
  14303. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14304. // whether the returned error was because http.StatusNotModified was
  14305. // returned.
  14306. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14307. gensupport.SetOptions(c.urlParams_, opts...)
  14308. res, err := c.doRequest("json")
  14309. if res != nil && res.StatusCode == http.StatusNotModified {
  14310. if res.Body != nil {
  14311. res.Body.Close()
  14312. }
  14313. return nil, &googleapi.Error{
  14314. Code: res.StatusCode,
  14315. Header: res.Header,
  14316. }
  14317. }
  14318. if err != nil {
  14319. return nil, err
  14320. }
  14321. defer googleapi.CloseBody(res)
  14322. if err := googleapi.CheckResponse(res); err != nil {
  14323. return nil, err
  14324. }
  14325. ret := &Ad{
  14326. ServerResponse: googleapi.ServerResponse{
  14327. Header: res.Header,
  14328. HTTPStatusCode: res.StatusCode,
  14329. },
  14330. }
  14331. target := &ret
  14332. if err := gensupport.DecodeResponse(target, res); err != nil {
  14333. return nil, err
  14334. }
  14335. return ret, nil
  14336. // {
  14337. // "description": "Inserts a new ad.",
  14338. // "httpMethod": "POST",
  14339. // "id": "dfareporting.ads.insert",
  14340. // "parameterOrder": [
  14341. // "profileId"
  14342. // ],
  14343. // "parameters": {
  14344. // "profileId": {
  14345. // "description": "User profile ID associated with this request.",
  14346. // "format": "int64",
  14347. // "location": "path",
  14348. // "required": true,
  14349. // "type": "string"
  14350. // }
  14351. // },
  14352. // "path": "userprofiles/{profileId}/ads",
  14353. // "request": {
  14354. // "$ref": "Ad"
  14355. // },
  14356. // "response": {
  14357. // "$ref": "Ad"
  14358. // },
  14359. // "scopes": [
  14360. // "https://www.googleapis.com/auth/dfatrafficking"
  14361. // ]
  14362. // }
  14363. }
  14364. // method id "dfareporting.ads.list":
  14365. type AdsListCall struct {
  14366. s *Service
  14367. profileId int64
  14368. urlParams_ gensupport.URLParams
  14369. ifNoneMatch_ string
  14370. ctx_ context.Context
  14371. header_ http.Header
  14372. }
  14373. // List: Retrieves a list of ads, possibly filtered. This method
  14374. // supports paging.
  14375. func (r *AdsService) List(profileId int64) *AdsListCall {
  14376. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14377. c.profileId = profileId
  14378. return c
  14379. }
  14380. // Active sets the optional parameter "active": Select only active ads.
  14381. func (c *AdsListCall) Active(active bool) *AdsListCall {
  14382. c.urlParams_.Set("active", fmt.Sprint(active))
  14383. return c
  14384. }
  14385. // AdvertiserId sets the optional parameter "advertiserId": Select only
  14386. // ads with this advertiser ID.
  14387. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  14388. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  14389. return c
  14390. }
  14391. // Archived sets the optional parameter "archived": Select only archived
  14392. // ads.
  14393. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  14394. c.urlParams_.Set("archived", fmt.Sprint(archived))
  14395. return c
  14396. }
  14397. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  14398. // Select only ads with these audience segment IDs.
  14399. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  14400. var audienceSegmentIds_ []string
  14401. for _, v := range audienceSegmentIds {
  14402. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  14403. }
  14404. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  14405. return c
  14406. }
  14407. // CampaignIds sets the optional parameter "campaignIds": Select only
  14408. // ads with these campaign IDs.
  14409. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  14410. var campaignIds_ []string
  14411. for _, v := range campaignIds {
  14412. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  14413. }
  14414. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  14415. return c
  14416. }
  14417. // Compatibility sets the optional parameter "compatibility": Select
  14418. // default ads with the specified compatibility. Applicable when type is
  14419. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  14420. // rendering either on desktop or on mobile devices for regular or
  14421. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  14422. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  14423. // in-stream video ads developed with the VAST standard.
  14424. //
  14425. // Possible values:
  14426. // "APP"
  14427. // "APP_INTERSTITIAL"
  14428. // "DISPLAY"
  14429. // "DISPLAY_INTERSTITIAL"
  14430. // "IN_STREAM_AUDIO"
  14431. // "IN_STREAM_VIDEO"
  14432. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  14433. c.urlParams_.Set("compatibility", compatibility)
  14434. return c
  14435. }
  14436. // CreativeIds sets the optional parameter "creativeIds": Select only
  14437. // ads with these creative IDs assigned.
  14438. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  14439. var creativeIds_ []string
  14440. for _, v := range creativeIds {
  14441. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  14442. }
  14443. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  14444. return c
  14445. }
  14446. // CreativeOptimizationConfigurationIds sets the optional parameter
  14447. // "creativeOptimizationConfigurationIds": Select only ads with these
  14448. // creative optimization configuration IDs.
  14449. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  14450. var creativeOptimizationConfigurationIds_ []string
  14451. for _, v := range creativeOptimizationConfigurationIds {
  14452. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  14453. }
  14454. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  14455. return c
  14456. }
  14457. // DynamicClickTracker sets the optional parameter
  14458. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  14459. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  14460. // trackers. If false, select static click trackers. Leave unset to
  14461. // select both.
  14462. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  14463. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  14464. return c
  14465. }
  14466. // Ids sets the optional parameter "ids": Select only ads with these
  14467. // IDs.
  14468. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  14469. var ids_ []string
  14470. for _, v := range ids {
  14471. ids_ = append(ids_, fmt.Sprint(v))
  14472. }
  14473. c.urlParams_.SetMulti("ids", ids_)
  14474. return c
  14475. }
  14476. // LandingPageIds sets the optional parameter "landingPageIds": Select
  14477. // only ads with these landing page IDs.
  14478. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  14479. var landingPageIds_ []string
  14480. for _, v := range landingPageIds {
  14481. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  14482. }
  14483. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14484. return c
  14485. }
  14486. // MaxResults sets the optional parameter "maxResults": Maximum number
  14487. // of results to return.
  14488. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14489. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14490. return c
  14491. }
  14492. // OverriddenEventTagId sets the optional parameter
  14493. // "overriddenEventTagId": Select only ads with this event tag override
  14494. // ID.
  14495. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14496. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14497. return c
  14498. }
  14499. // PageToken sets the optional parameter "pageToken": Value of the
  14500. // nextPageToken from the previous result page.
  14501. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14502. c.urlParams_.Set("pageToken", pageToken)
  14503. return c
  14504. }
  14505. // PlacementIds sets the optional parameter "placementIds": Select only
  14506. // ads with these placement IDs assigned.
  14507. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14508. var placementIds_ []string
  14509. for _, v := range placementIds {
  14510. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14511. }
  14512. c.urlParams_.SetMulti("placementIds", placementIds_)
  14513. return c
  14514. }
  14515. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14516. // Select only ads whose list targeting expression use these remarketing
  14517. // list IDs.
  14518. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14519. var remarketingListIds_ []string
  14520. for _, v := range remarketingListIds {
  14521. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14522. }
  14523. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14524. return c
  14525. }
  14526. // SearchString sets the optional parameter "searchString": Allows
  14527. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14528. // example, "ad*2015" will return objects with names like "ad June
  14529. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14530. // also add wildcards implicitly at the start and the end of the search
  14531. // string. For example, a search string of "ad" will match objects with
  14532. // name "my ad", "ad 2015", or simply "ad".
  14533. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14534. c.urlParams_.Set("searchString", searchString)
  14535. return c
  14536. }
  14537. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14538. // these size IDs.
  14539. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14540. var sizeIds_ []string
  14541. for _, v := range sizeIds {
  14542. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14543. }
  14544. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14545. return c
  14546. }
  14547. // SortField sets the optional parameter "sortField": Field by which to
  14548. // sort the list.
  14549. //
  14550. // Possible values:
  14551. // "ID" (default)
  14552. // "NAME"
  14553. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14554. c.urlParams_.Set("sortField", sortField)
  14555. return c
  14556. }
  14557. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14558. // results.
  14559. //
  14560. // Possible values:
  14561. // "ASCENDING" (default)
  14562. // "DESCENDING"
  14563. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14564. c.urlParams_.Set("sortOrder", sortOrder)
  14565. return c
  14566. }
  14567. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14568. // ads that are SSL-compliant.
  14569. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14570. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14571. return c
  14572. }
  14573. // SslRequired sets the optional parameter "sslRequired": Select only
  14574. // ads that require SSL.
  14575. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14576. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14577. return c
  14578. }
  14579. // Type sets the optional parameter "type": Select only ads with these
  14580. // types.
  14581. //
  14582. // Possible values:
  14583. // "AD_SERVING_CLICK_TRACKER"
  14584. // "AD_SERVING_DEFAULT_AD"
  14585. // "AD_SERVING_STANDARD_AD"
  14586. // "AD_SERVING_TRACKING"
  14587. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14588. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14589. return c
  14590. }
  14591. // Fields allows partial responses to be retrieved. See
  14592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14593. // for more information.
  14594. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14596. return c
  14597. }
  14598. // IfNoneMatch sets the optional parameter which makes the operation
  14599. // fail if the object's ETag matches the given value. This is useful for
  14600. // getting updates only after the object has changed since the last
  14601. // request. Use googleapi.IsNotModified to check whether the response
  14602. // error from Do is the result of In-None-Match.
  14603. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14604. c.ifNoneMatch_ = entityTag
  14605. return c
  14606. }
  14607. // Context sets the context to be used in this call's Do method. Any
  14608. // pending HTTP request will be aborted if the provided context is
  14609. // canceled.
  14610. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14611. c.ctx_ = ctx
  14612. return c
  14613. }
  14614. // Header returns an http.Header that can be modified by the caller to
  14615. // add HTTP headers to the request.
  14616. func (c *AdsListCall) Header() http.Header {
  14617. if c.header_ == nil {
  14618. c.header_ = make(http.Header)
  14619. }
  14620. return c.header_
  14621. }
  14622. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14623. reqHeaders := make(http.Header)
  14624. for k, v := range c.header_ {
  14625. reqHeaders[k] = v
  14626. }
  14627. reqHeaders.Set("User-Agent", c.s.userAgent())
  14628. if c.ifNoneMatch_ != "" {
  14629. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14630. }
  14631. var body io.Reader = nil
  14632. c.urlParams_.Set("alt", alt)
  14633. c.urlParams_.Set("prettyPrint", "false")
  14634. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14635. urls += "?" + c.urlParams_.Encode()
  14636. req, err := http.NewRequest("GET", urls, body)
  14637. if err != nil {
  14638. return nil, err
  14639. }
  14640. req.Header = reqHeaders
  14641. googleapi.Expand(req.URL, map[string]string{
  14642. "profileId": strconv.FormatInt(c.profileId, 10),
  14643. })
  14644. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14645. }
  14646. // Do executes the "dfareporting.ads.list" call.
  14647. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14648. // status code is an error. Response headers are in either
  14649. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14650. // at all) in error.(*googleapi.Error).Header. Use
  14651. // googleapi.IsNotModified to check whether the returned error was
  14652. // because http.StatusNotModified was returned.
  14653. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14654. gensupport.SetOptions(c.urlParams_, opts...)
  14655. res, err := c.doRequest("json")
  14656. if res != nil && res.StatusCode == http.StatusNotModified {
  14657. if res.Body != nil {
  14658. res.Body.Close()
  14659. }
  14660. return nil, &googleapi.Error{
  14661. Code: res.StatusCode,
  14662. Header: res.Header,
  14663. }
  14664. }
  14665. if err != nil {
  14666. return nil, err
  14667. }
  14668. defer googleapi.CloseBody(res)
  14669. if err := googleapi.CheckResponse(res); err != nil {
  14670. return nil, err
  14671. }
  14672. ret := &AdsListResponse{
  14673. ServerResponse: googleapi.ServerResponse{
  14674. Header: res.Header,
  14675. HTTPStatusCode: res.StatusCode,
  14676. },
  14677. }
  14678. target := &ret
  14679. if err := gensupport.DecodeResponse(target, res); err != nil {
  14680. return nil, err
  14681. }
  14682. return ret, nil
  14683. // {
  14684. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14685. // "httpMethod": "GET",
  14686. // "id": "dfareporting.ads.list",
  14687. // "parameterOrder": [
  14688. // "profileId"
  14689. // ],
  14690. // "parameters": {
  14691. // "active": {
  14692. // "description": "Select only active ads.",
  14693. // "location": "query",
  14694. // "type": "boolean"
  14695. // },
  14696. // "advertiserId": {
  14697. // "description": "Select only ads with this advertiser ID.",
  14698. // "format": "int64",
  14699. // "location": "query",
  14700. // "type": "string"
  14701. // },
  14702. // "archived": {
  14703. // "description": "Select only archived ads.",
  14704. // "location": "query",
  14705. // "type": "boolean"
  14706. // },
  14707. // "audienceSegmentIds": {
  14708. // "description": "Select only ads with these audience segment IDs.",
  14709. // "format": "int64",
  14710. // "location": "query",
  14711. // "repeated": true,
  14712. // "type": "string"
  14713. // },
  14714. // "campaignIds": {
  14715. // "description": "Select only ads with these campaign IDs.",
  14716. // "format": "int64",
  14717. // "location": "query",
  14718. // "repeated": true,
  14719. // "type": "string"
  14720. // },
  14721. // "compatibility": {
  14722. // "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.",
  14723. // "enum": [
  14724. // "APP",
  14725. // "APP_INTERSTITIAL",
  14726. // "DISPLAY",
  14727. // "DISPLAY_INTERSTITIAL",
  14728. // "IN_STREAM_AUDIO",
  14729. // "IN_STREAM_VIDEO"
  14730. // ],
  14731. // "enumDescriptions": [
  14732. // "",
  14733. // "",
  14734. // "",
  14735. // "",
  14736. // "",
  14737. // ""
  14738. // ],
  14739. // "location": "query",
  14740. // "type": "string"
  14741. // },
  14742. // "creativeIds": {
  14743. // "description": "Select only ads with these creative IDs assigned.",
  14744. // "format": "int64",
  14745. // "location": "query",
  14746. // "repeated": true,
  14747. // "type": "string"
  14748. // },
  14749. // "creativeOptimizationConfigurationIds": {
  14750. // "description": "Select only ads with these creative optimization configuration IDs.",
  14751. // "format": "int64",
  14752. // "location": "query",
  14753. // "repeated": true,
  14754. // "type": "string"
  14755. // },
  14756. // "dynamicClickTracker": {
  14757. // "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.",
  14758. // "location": "query",
  14759. // "type": "boolean"
  14760. // },
  14761. // "ids": {
  14762. // "description": "Select only ads with these IDs.",
  14763. // "format": "int64",
  14764. // "location": "query",
  14765. // "repeated": true,
  14766. // "type": "string"
  14767. // },
  14768. // "landingPageIds": {
  14769. // "description": "Select only ads with these landing page IDs.",
  14770. // "format": "int64",
  14771. // "location": "query",
  14772. // "repeated": true,
  14773. // "type": "string"
  14774. // },
  14775. // "maxResults": {
  14776. // "default": "1000",
  14777. // "description": "Maximum number of results to return.",
  14778. // "format": "int32",
  14779. // "location": "query",
  14780. // "maximum": "1000",
  14781. // "minimum": "0",
  14782. // "type": "integer"
  14783. // },
  14784. // "overriddenEventTagId": {
  14785. // "description": "Select only ads with this event tag override ID.",
  14786. // "format": "int64",
  14787. // "location": "query",
  14788. // "type": "string"
  14789. // },
  14790. // "pageToken": {
  14791. // "description": "Value of the nextPageToken from the previous result page.",
  14792. // "location": "query",
  14793. // "type": "string"
  14794. // },
  14795. // "placementIds": {
  14796. // "description": "Select only ads with these placement IDs assigned.",
  14797. // "format": "int64",
  14798. // "location": "query",
  14799. // "repeated": true,
  14800. // "type": "string"
  14801. // },
  14802. // "profileId": {
  14803. // "description": "User profile ID associated with this request.",
  14804. // "format": "int64",
  14805. // "location": "path",
  14806. // "required": true,
  14807. // "type": "string"
  14808. // },
  14809. // "remarketingListIds": {
  14810. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14811. // "format": "int64",
  14812. // "location": "query",
  14813. // "repeated": true,
  14814. // "type": "string"
  14815. // },
  14816. // "searchString": {
  14817. // "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\".",
  14818. // "location": "query",
  14819. // "type": "string"
  14820. // },
  14821. // "sizeIds": {
  14822. // "description": "Select only ads with these size IDs.",
  14823. // "format": "int64",
  14824. // "location": "query",
  14825. // "repeated": true,
  14826. // "type": "string"
  14827. // },
  14828. // "sortField": {
  14829. // "default": "ID",
  14830. // "description": "Field by which to sort the list.",
  14831. // "enum": [
  14832. // "ID",
  14833. // "NAME"
  14834. // ],
  14835. // "enumDescriptions": [
  14836. // "",
  14837. // ""
  14838. // ],
  14839. // "location": "query",
  14840. // "type": "string"
  14841. // },
  14842. // "sortOrder": {
  14843. // "default": "ASCENDING",
  14844. // "description": "Order of sorted results.",
  14845. // "enum": [
  14846. // "ASCENDING",
  14847. // "DESCENDING"
  14848. // ],
  14849. // "enumDescriptions": [
  14850. // "",
  14851. // ""
  14852. // ],
  14853. // "location": "query",
  14854. // "type": "string"
  14855. // },
  14856. // "sslCompliant": {
  14857. // "description": "Select only ads that are SSL-compliant.",
  14858. // "location": "query",
  14859. // "type": "boolean"
  14860. // },
  14861. // "sslRequired": {
  14862. // "description": "Select only ads that require SSL.",
  14863. // "location": "query",
  14864. // "type": "boolean"
  14865. // },
  14866. // "type": {
  14867. // "description": "Select only ads with these types.",
  14868. // "enum": [
  14869. // "AD_SERVING_CLICK_TRACKER",
  14870. // "AD_SERVING_DEFAULT_AD",
  14871. // "AD_SERVING_STANDARD_AD",
  14872. // "AD_SERVING_TRACKING"
  14873. // ],
  14874. // "enumDescriptions": [
  14875. // "",
  14876. // "",
  14877. // "",
  14878. // ""
  14879. // ],
  14880. // "location": "query",
  14881. // "repeated": true,
  14882. // "type": "string"
  14883. // }
  14884. // },
  14885. // "path": "userprofiles/{profileId}/ads",
  14886. // "response": {
  14887. // "$ref": "AdsListResponse"
  14888. // },
  14889. // "scopes": [
  14890. // "https://www.googleapis.com/auth/dfatrafficking"
  14891. // ]
  14892. // }
  14893. }
  14894. // Pages invokes f for each page of results.
  14895. // A non-nil error returned from f will halt the iteration.
  14896. // The provided context supersedes any context provided to the Context method.
  14897. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14898. c.ctx_ = ctx
  14899. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14900. for {
  14901. x, err := c.Do()
  14902. if err != nil {
  14903. return err
  14904. }
  14905. if err := f(x); err != nil {
  14906. return err
  14907. }
  14908. if x.NextPageToken == "" {
  14909. return nil
  14910. }
  14911. c.PageToken(x.NextPageToken)
  14912. }
  14913. }
  14914. // method id "dfareporting.ads.patch":
  14915. type AdsPatchCall struct {
  14916. s *Service
  14917. profileId int64
  14918. ad *Ad
  14919. urlParams_ gensupport.URLParams
  14920. ctx_ context.Context
  14921. header_ http.Header
  14922. }
  14923. // Patch: Updates an existing ad. This method supports patch semantics.
  14924. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14925. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14926. c.profileId = profileId
  14927. c.urlParams_.Set("id", fmt.Sprint(id))
  14928. c.ad = ad
  14929. return c
  14930. }
  14931. // Fields allows partial responses to be retrieved. See
  14932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14933. // for more information.
  14934. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14936. return c
  14937. }
  14938. // Context sets the context to be used in this call's Do method. Any
  14939. // pending HTTP request will be aborted if the provided context is
  14940. // canceled.
  14941. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14942. c.ctx_ = ctx
  14943. return c
  14944. }
  14945. // Header returns an http.Header that can be modified by the caller to
  14946. // add HTTP headers to the request.
  14947. func (c *AdsPatchCall) Header() http.Header {
  14948. if c.header_ == nil {
  14949. c.header_ = make(http.Header)
  14950. }
  14951. return c.header_
  14952. }
  14953. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14954. reqHeaders := make(http.Header)
  14955. for k, v := range c.header_ {
  14956. reqHeaders[k] = v
  14957. }
  14958. reqHeaders.Set("User-Agent", c.s.userAgent())
  14959. var body io.Reader = nil
  14960. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14961. if err != nil {
  14962. return nil, err
  14963. }
  14964. reqHeaders.Set("Content-Type", "application/json")
  14965. c.urlParams_.Set("alt", alt)
  14966. c.urlParams_.Set("prettyPrint", "false")
  14967. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14968. urls += "?" + c.urlParams_.Encode()
  14969. req, err := http.NewRequest("PATCH", urls, body)
  14970. if err != nil {
  14971. return nil, err
  14972. }
  14973. req.Header = reqHeaders
  14974. googleapi.Expand(req.URL, map[string]string{
  14975. "profileId": strconv.FormatInt(c.profileId, 10),
  14976. })
  14977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14978. }
  14979. // Do executes the "dfareporting.ads.patch" call.
  14980. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14981. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14982. // or (if a response was returned at all) in
  14983. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14984. // whether the returned error was because http.StatusNotModified was
  14985. // returned.
  14986. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14987. gensupport.SetOptions(c.urlParams_, opts...)
  14988. res, err := c.doRequest("json")
  14989. if res != nil && res.StatusCode == http.StatusNotModified {
  14990. if res.Body != nil {
  14991. res.Body.Close()
  14992. }
  14993. return nil, &googleapi.Error{
  14994. Code: res.StatusCode,
  14995. Header: res.Header,
  14996. }
  14997. }
  14998. if err != nil {
  14999. return nil, err
  15000. }
  15001. defer googleapi.CloseBody(res)
  15002. if err := googleapi.CheckResponse(res); err != nil {
  15003. return nil, err
  15004. }
  15005. ret := &Ad{
  15006. ServerResponse: googleapi.ServerResponse{
  15007. Header: res.Header,
  15008. HTTPStatusCode: res.StatusCode,
  15009. },
  15010. }
  15011. target := &ret
  15012. if err := gensupport.DecodeResponse(target, res); err != nil {
  15013. return nil, err
  15014. }
  15015. return ret, nil
  15016. // {
  15017. // "description": "Updates an existing ad. This method supports patch semantics.",
  15018. // "httpMethod": "PATCH",
  15019. // "id": "dfareporting.ads.patch",
  15020. // "parameterOrder": [
  15021. // "profileId",
  15022. // "id"
  15023. // ],
  15024. // "parameters": {
  15025. // "id": {
  15026. // "description": "Ad ID.",
  15027. // "format": "int64",
  15028. // "location": "query",
  15029. // "required": true,
  15030. // "type": "string"
  15031. // },
  15032. // "profileId": {
  15033. // "description": "User profile ID associated with this request.",
  15034. // "format": "int64",
  15035. // "location": "path",
  15036. // "required": true,
  15037. // "type": "string"
  15038. // }
  15039. // },
  15040. // "path": "userprofiles/{profileId}/ads",
  15041. // "request": {
  15042. // "$ref": "Ad"
  15043. // },
  15044. // "response": {
  15045. // "$ref": "Ad"
  15046. // },
  15047. // "scopes": [
  15048. // "https://www.googleapis.com/auth/dfatrafficking"
  15049. // ]
  15050. // }
  15051. }
  15052. // method id "dfareporting.ads.update":
  15053. type AdsUpdateCall struct {
  15054. s *Service
  15055. profileId int64
  15056. ad *Ad
  15057. urlParams_ gensupport.URLParams
  15058. ctx_ context.Context
  15059. header_ http.Header
  15060. }
  15061. // Update: Updates an existing ad.
  15062. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  15063. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15064. c.profileId = profileId
  15065. c.ad = ad
  15066. return c
  15067. }
  15068. // Fields allows partial responses to be retrieved. See
  15069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15070. // for more information.
  15071. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  15072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15073. return c
  15074. }
  15075. // Context sets the context to be used in this call's Do method. Any
  15076. // pending HTTP request will be aborted if the provided context is
  15077. // canceled.
  15078. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  15079. c.ctx_ = ctx
  15080. return c
  15081. }
  15082. // Header returns an http.Header that can be modified by the caller to
  15083. // add HTTP headers to the request.
  15084. func (c *AdsUpdateCall) Header() http.Header {
  15085. if c.header_ == nil {
  15086. c.header_ = make(http.Header)
  15087. }
  15088. return c.header_
  15089. }
  15090. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15091. reqHeaders := make(http.Header)
  15092. for k, v := range c.header_ {
  15093. reqHeaders[k] = v
  15094. }
  15095. reqHeaders.Set("User-Agent", c.s.userAgent())
  15096. var body io.Reader = nil
  15097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  15098. if err != nil {
  15099. return nil, err
  15100. }
  15101. reqHeaders.Set("Content-Type", "application/json")
  15102. c.urlParams_.Set("alt", alt)
  15103. c.urlParams_.Set("prettyPrint", "false")
  15104. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  15105. urls += "?" + c.urlParams_.Encode()
  15106. req, err := http.NewRequest("PUT", urls, body)
  15107. if err != nil {
  15108. return nil, err
  15109. }
  15110. req.Header = reqHeaders
  15111. googleapi.Expand(req.URL, map[string]string{
  15112. "profileId": strconv.FormatInt(c.profileId, 10),
  15113. })
  15114. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15115. }
  15116. // Do executes the "dfareporting.ads.update" call.
  15117. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  15118. // is an error. Response headers are in either *Ad.ServerResponse.Header
  15119. // or (if a response was returned at all) in
  15120. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15121. // whether the returned error was because http.StatusNotModified was
  15122. // returned.
  15123. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  15124. gensupport.SetOptions(c.urlParams_, opts...)
  15125. res, err := c.doRequest("json")
  15126. if res != nil && res.StatusCode == http.StatusNotModified {
  15127. if res.Body != nil {
  15128. res.Body.Close()
  15129. }
  15130. return nil, &googleapi.Error{
  15131. Code: res.StatusCode,
  15132. Header: res.Header,
  15133. }
  15134. }
  15135. if err != nil {
  15136. return nil, err
  15137. }
  15138. defer googleapi.CloseBody(res)
  15139. if err := googleapi.CheckResponse(res); err != nil {
  15140. return nil, err
  15141. }
  15142. ret := &Ad{
  15143. ServerResponse: googleapi.ServerResponse{
  15144. Header: res.Header,
  15145. HTTPStatusCode: res.StatusCode,
  15146. },
  15147. }
  15148. target := &ret
  15149. if err := gensupport.DecodeResponse(target, res); err != nil {
  15150. return nil, err
  15151. }
  15152. return ret, nil
  15153. // {
  15154. // "description": "Updates an existing ad.",
  15155. // "httpMethod": "PUT",
  15156. // "id": "dfareporting.ads.update",
  15157. // "parameterOrder": [
  15158. // "profileId"
  15159. // ],
  15160. // "parameters": {
  15161. // "profileId": {
  15162. // "description": "User profile ID associated with this request.",
  15163. // "format": "int64",
  15164. // "location": "path",
  15165. // "required": true,
  15166. // "type": "string"
  15167. // }
  15168. // },
  15169. // "path": "userprofiles/{profileId}/ads",
  15170. // "request": {
  15171. // "$ref": "Ad"
  15172. // },
  15173. // "response": {
  15174. // "$ref": "Ad"
  15175. // },
  15176. // "scopes": [
  15177. // "https://www.googleapis.com/auth/dfatrafficking"
  15178. // ]
  15179. // }
  15180. }
  15181. // method id "dfareporting.advertiserGroups.delete":
  15182. type AdvertiserGroupsDeleteCall struct {
  15183. s *Service
  15184. profileId int64
  15185. id int64
  15186. urlParams_ gensupport.URLParams
  15187. ctx_ context.Context
  15188. header_ http.Header
  15189. }
  15190. // Delete: Deletes an existing advertiser group.
  15191. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  15192. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15193. c.profileId = profileId
  15194. c.id = id
  15195. return c
  15196. }
  15197. // Fields allows partial responses to be retrieved. See
  15198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15199. // for more information.
  15200. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  15201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15202. return c
  15203. }
  15204. // Context sets the context to be used in this call's Do method. Any
  15205. // pending HTTP request will be aborted if the provided context is
  15206. // canceled.
  15207. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  15208. c.ctx_ = ctx
  15209. return c
  15210. }
  15211. // Header returns an http.Header that can be modified by the caller to
  15212. // add HTTP headers to the request.
  15213. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  15214. if c.header_ == nil {
  15215. c.header_ = make(http.Header)
  15216. }
  15217. return c.header_
  15218. }
  15219. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15220. reqHeaders := make(http.Header)
  15221. for k, v := range c.header_ {
  15222. reqHeaders[k] = v
  15223. }
  15224. reqHeaders.Set("User-Agent", c.s.userAgent())
  15225. var body io.Reader = nil
  15226. c.urlParams_.Set("alt", alt)
  15227. c.urlParams_.Set("prettyPrint", "false")
  15228. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15229. urls += "?" + c.urlParams_.Encode()
  15230. req, err := http.NewRequest("DELETE", urls, body)
  15231. if err != nil {
  15232. return nil, err
  15233. }
  15234. req.Header = reqHeaders
  15235. googleapi.Expand(req.URL, map[string]string{
  15236. "profileId": strconv.FormatInt(c.profileId, 10),
  15237. "id": strconv.FormatInt(c.id, 10),
  15238. })
  15239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15240. }
  15241. // Do executes the "dfareporting.advertiserGroups.delete" call.
  15242. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15243. gensupport.SetOptions(c.urlParams_, opts...)
  15244. res, err := c.doRequest("json")
  15245. if err != nil {
  15246. return err
  15247. }
  15248. defer googleapi.CloseBody(res)
  15249. if err := googleapi.CheckResponse(res); err != nil {
  15250. return err
  15251. }
  15252. return nil
  15253. // {
  15254. // "description": "Deletes an existing advertiser group.",
  15255. // "httpMethod": "DELETE",
  15256. // "id": "dfareporting.advertiserGroups.delete",
  15257. // "parameterOrder": [
  15258. // "profileId",
  15259. // "id"
  15260. // ],
  15261. // "parameters": {
  15262. // "id": {
  15263. // "description": "Advertiser group ID.",
  15264. // "format": "int64",
  15265. // "location": "path",
  15266. // "required": true,
  15267. // "type": "string"
  15268. // },
  15269. // "profileId": {
  15270. // "description": "User profile ID associated with this request.",
  15271. // "format": "int64",
  15272. // "location": "path",
  15273. // "required": true,
  15274. // "type": "string"
  15275. // }
  15276. // },
  15277. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15278. // "scopes": [
  15279. // "https://www.googleapis.com/auth/dfatrafficking"
  15280. // ]
  15281. // }
  15282. }
  15283. // method id "dfareporting.advertiserGroups.get":
  15284. type AdvertiserGroupsGetCall struct {
  15285. s *Service
  15286. profileId int64
  15287. id int64
  15288. urlParams_ gensupport.URLParams
  15289. ifNoneMatch_ string
  15290. ctx_ context.Context
  15291. header_ http.Header
  15292. }
  15293. // Get: Gets one advertiser group by ID.
  15294. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  15295. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15296. c.profileId = profileId
  15297. c.id = id
  15298. return c
  15299. }
  15300. // Fields allows partial responses to be retrieved. See
  15301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15302. // for more information.
  15303. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  15304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15305. return c
  15306. }
  15307. // IfNoneMatch sets the optional parameter which makes the operation
  15308. // fail if the object's ETag matches the given value. This is useful for
  15309. // getting updates only after the object has changed since the last
  15310. // request. Use googleapi.IsNotModified to check whether the response
  15311. // error from Do is the result of In-None-Match.
  15312. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  15313. c.ifNoneMatch_ = entityTag
  15314. return c
  15315. }
  15316. // Context sets the context to be used in this call's Do method. Any
  15317. // pending HTTP request will be aborted if the provided context is
  15318. // canceled.
  15319. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  15320. c.ctx_ = ctx
  15321. return c
  15322. }
  15323. // Header returns an http.Header that can be modified by the caller to
  15324. // add HTTP headers to the request.
  15325. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  15326. if c.header_ == nil {
  15327. c.header_ = make(http.Header)
  15328. }
  15329. return c.header_
  15330. }
  15331. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  15332. reqHeaders := make(http.Header)
  15333. for k, v := range c.header_ {
  15334. reqHeaders[k] = v
  15335. }
  15336. reqHeaders.Set("User-Agent", c.s.userAgent())
  15337. if c.ifNoneMatch_ != "" {
  15338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15339. }
  15340. var body io.Reader = nil
  15341. c.urlParams_.Set("alt", alt)
  15342. c.urlParams_.Set("prettyPrint", "false")
  15343. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15344. urls += "?" + c.urlParams_.Encode()
  15345. req, err := http.NewRequest("GET", urls, body)
  15346. if err != nil {
  15347. return nil, err
  15348. }
  15349. req.Header = reqHeaders
  15350. googleapi.Expand(req.URL, map[string]string{
  15351. "profileId": strconv.FormatInt(c.profileId, 10),
  15352. "id": strconv.FormatInt(c.id, 10),
  15353. })
  15354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15355. }
  15356. // Do executes the "dfareporting.advertiserGroups.get" call.
  15357. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15358. // status code is an error. Response headers are in either
  15359. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15360. // at all) in error.(*googleapi.Error).Header. Use
  15361. // googleapi.IsNotModified to check whether the returned error was
  15362. // because http.StatusNotModified was returned.
  15363. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15364. gensupport.SetOptions(c.urlParams_, opts...)
  15365. res, err := c.doRequest("json")
  15366. if res != nil && res.StatusCode == http.StatusNotModified {
  15367. if res.Body != nil {
  15368. res.Body.Close()
  15369. }
  15370. return nil, &googleapi.Error{
  15371. Code: res.StatusCode,
  15372. Header: res.Header,
  15373. }
  15374. }
  15375. if err != nil {
  15376. return nil, err
  15377. }
  15378. defer googleapi.CloseBody(res)
  15379. if err := googleapi.CheckResponse(res); err != nil {
  15380. return nil, err
  15381. }
  15382. ret := &AdvertiserGroup{
  15383. ServerResponse: googleapi.ServerResponse{
  15384. Header: res.Header,
  15385. HTTPStatusCode: res.StatusCode,
  15386. },
  15387. }
  15388. target := &ret
  15389. if err := gensupport.DecodeResponse(target, res); err != nil {
  15390. return nil, err
  15391. }
  15392. return ret, nil
  15393. // {
  15394. // "description": "Gets one advertiser group by ID.",
  15395. // "httpMethod": "GET",
  15396. // "id": "dfareporting.advertiserGroups.get",
  15397. // "parameterOrder": [
  15398. // "profileId",
  15399. // "id"
  15400. // ],
  15401. // "parameters": {
  15402. // "id": {
  15403. // "description": "Advertiser group ID.",
  15404. // "format": "int64",
  15405. // "location": "path",
  15406. // "required": true,
  15407. // "type": "string"
  15408. // },
  15409. // "profileId": {
  15410. // "description": "User profile ID associated with this request.",
  15411. // "format": "int64",
  15412. // "location": "path",
  15413. // "required": true,
  15414. // "type": "string"
  15415. // }
  15416. // },
  15417. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15418. // "response": {
  15419. // "$ref": "AdvertiserGroup"
  15420. // },
  15421. // "scopes": [
  15422. // "https://www.googleapis.com/auth/dfatrafficking"
  15423. // ]
  15424. // }
  15425. }
  15426. // method id "dfareporting.advertiserGroups.insert":
  15427. type AdvertiserGroupsInsertCall struct {
  15428. s *Service
  15429. profileId int64
  15430. advertisergroup *AdvertiserGroup
  15431. urlParams_ gensupport.URLParams
  15432. ctx_ context.Context
  15433. header_ http.Header
  15434. }
  15435. // Insert: Inserts a new advertiser group.
  15436. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  15437. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15438. c.profileId = profileId
  15439. c.advertisergroup = advertisergroup
  15440. return c
  15441. }
  15442. // Fields allows partial responses to be retrieved. See
  15443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15444. // for more information.
  15445. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  15446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15447. return c
  15448. }
  15449. // Context sets the context to be used in this call's Do method. Any
  15450. // pending HTTP request will be aborted if the provided context is
  15451. // canceled.
  15452. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  15453. c.ctx_ = ctx
  15454. return c
  15455. }
  15456. // Header returns an http.Header that can be modified by the caller to
  15457. // add HTTP headers to the request.
  15458. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  15459. if c.header_ == nil {
  15460. c.header_ = make(http.Header)
  15461. }
  15462. return c.header_
  15463. }
  15464. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  15465. reqHeaders := make(http.Header)
  15466. for k, v := range c.header_ {
  15467. reqHeaders[k] = v
  15468. }
  15469. reqHeaders.Set("User-Agent", c.s.userAgent())
  15470. var body io.Reader = nil
  15471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15472. if err != nil {
  15473. return nil, err
  15474. }
  15475. reqHeaders.Set("Content-Type", "application/json")
  15476. c.urlParams_.Set("alt", alt)
  15477. c.urlParams_.Set("prettyPrint", "false")
  15478. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15479. urls += "?" + c.urlParams_.Encode()
  15480. req, err := http.NewRequest("POST", urls, body)
  15481. if err != nil {
  15482. return nil, err
  15483. }
  15484. req.Header = reqHeaders
  15485. googleapi.Expand(req.URL, map[string]string{
  15486. "profileId": strconv.FormatInt(c.profileId, 10),
  15487. })
  15488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15489. }
  15490. // Do executes the "dfareporting.advertiserGroups.insert" call.
  15491. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15492. // status code is an error. Response headers are in either
  15493. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15494. // at all) in error.(*googleapi.Error).Header. Use
  15495. // googleapi.IsNotModified to check whether the returned error was
  15496. // because http.StatusNotModified was returned.
  15497. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15498. gensupport.SetOptions(c.urlParams_, opts...)
  15499. res, err := c.doRequest("json")
  15500. if res != nil && res.StatusCode == http.StatusNotModified {
  15501. if res.Body != nil {
  15502. res.Body.Close()
  15503. }
  15504. return nil, &googleapi.Error{
  15505. Code: res.StatusCode,
  15506. Header: res.Header,
  15507. }
  15508. }
  15509. if err != nil {
  15510. return nil, err
  15511. }
  15512. defer googleapi.CloseBody(res)
  15513. if err := googleapi.CheckResponse(res); err != nil {
  15514. return nil, err
  15515. }
  15516. ret := &AdvertiserGroup{
  15517. ServerResponse: googleapi.ServerResponse{
  15518. Header: res.Header,
  15519. HTTPStatusCode: res.StatusCode,
  15520. },
  15521. }
  15522. target := &ret
  15523. if err := gensupport.DecodeResponse(target, res); err != nil {
  15524. return nil, err
  15525. }
  15526. return ret, nil
  15527. // {
  15528. // "description": "Inserts a new advertiser group.",
  15529. // "httpMethod": "POST",
  15530. // "id": "dfareporting.advertiserGroups.insert",
  15531. // "parameterOrder": [
  15532. // "profileId"
  15533. // ],
  15534. // "parameters": {
  15535. // "profileId": {
  15536. // "description": "User profile ID associated with this request.",
  15537. // "format": "int64",
  15538. // "location": "path",
  15539. // "required": true,
  15540. // "type": "string"
  15541. // }
  15542. // },
  15543. // "path": "userprofiles/{profileId}/advertiserGroups",
  15544. // "request": {
  15545. // "$ref": "AdvertiserGroup"
  15546. // },
  15547. // "response": {
  15548. // "$ref": "AdvertiserGroup"
  15549. // },
  15550. // "scopes": [
  15551. // "https://www.googleapis.com/auth/dfatrafficking"
  15552. // ]
  15553. // }
  15554. }
  15555. // method id "dfareporting.advertiserGroups.list":
  15556. type AdvertiserGroupsListCall struct {
  15557. s *Service
  15558. profileId int64
  15559. urlParams_ gensupport.URLParams
  15560. ifNoneMatch_ string
  15561. ctx_ context.Context
  15562. header_ http.Header
  15563. }
  15564. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15565. // method supports paging.
  15566. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15567. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15568. c.profileId = profileId
  15569. return c
  15570. }
  15571. // Ids sets the optional parameter "ids": Select only advertiser groups
  15572. // with these IDs.
  15573. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15574. var ids_ []string
  15575. for _, v := range ids {
  15576. ids_ = append(ids_, fmt.Sprint(v))
  15577. }
  15578. c.urlParams_.SetMulti("ids", ids_)
  15579. return c
  15580. }
  15581. // MaxResults sets the optional parameter "maxResults": Maximum number
  15582. // of results to return.
  15583. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15584. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15585. return c
  15586. }
  15587. // PageToken sets the optional parameter "pageToken": Value of the
  15588. // nextPageToken from the previous result page.
  15589. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15590. c.urlParams_.Set("pageToken", pageToken)
  15591. return c
  15592. }
  15593. // SearchString sets the optional parameter "searchString": Allows
  15594. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15595. // example, "advertiser*2015" will return objects with names like
  15596. // "advertiser group June 2015", "advertiser group April 2015", or
  15597. // simply "advertiser group 2015". Most of the searches also add
  15598. // wildcards implicitly at the start and the end of the search string.
  15599. // For example, a search string of "advertisergroup" will match objects
  15600. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15601. // "advertisergroup".
  15602. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15603. c.urlParams_.Set("searchString", searchString)
  15604. return c
  15605. }
  15606. // SortField sets the optional parameter "sortField": Field by which to
  15607. // sort the list.
  15608. //
  15609. // Possible values:
  15610. // "ID" (default)
  15611. // "NAME"
  15612. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15613. c.urlParams_.Set("sortField", sortField)
  15614. return c
  15615. }
  15616. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15617. // results.
  15618. //
  15619. // Possible values:
  15620. // "ASCENDING" (default)
  15621. // "DESCENDING"
  15622. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15623. c.urlParams_.Set("sortOrder", sortOrder)
  15624. return c
  15625. }
  15626. // Fields allows partial responses to be retrieved. See
  15627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15628. // for more information.
  15629. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15631. return c
  15632. }
  15633. // IfNoneMatch sets the optional parameter which makes the operation
  15634. // fail if the object's ETag matches the given value. This is useful for
  15635. // getting updates only after the object has changed since the last
  15636. // request. Use googleapi.IsNotModified to check whether the response
  15637. // error from Do is the result of In-None-Match.
  15638. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15639. c.ifNoneMatch_ = entityTag
  15640. return c
  15641. }
  15642. // Context sets the context to be used in this call's Do method. Any
  15643. // pending HTTP request will be aborted if the provided context is
  15644. // canceled.
  15645. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15646. c.ctx_ = ctx
  15647. return c
  15648. }
  15649. // Header returns an http.Header that can be modified by the caller to
  15650. // add HTTP headers to the request.
  15651. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15652. if c.header_ == nil {
  15653. c.header_ = make(http.Header)
  15654. }
  15655. return c.header_
  15656. }
  15657. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15658. reqHeaders := make(http.Header)
  15659. for k, v := range c.header_ {
  15660. reqHeaders[k] = v
  15661. }
  15662. reqHeaders.Set("User-Agent", c.s.userAgent())
  15663. if c.ifNoneMatch_ != "" {
  15664. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15665. }
  15666. var body io.Reader = nil
  15667. c.urlParams_.Set("alt", alt)
  15668. c.urlParams_.Set("prettyPrint", "false")
  15669. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15670. urls += "?" + c.urlParams_.Encode()
  15671. req, err := http.NewRequest("GET", urls, body)
  15672. if err != nil {
  15673. return nil, err
  15674. }
  15675. req.Header = reqHeaders
  15676. googleapi.Expand(req.URL, map[string]string{
  15677. "profileId": strconv.FormatInt(c.profileId, 10),
  15678. })
  15679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15680. }
  15681. // Do executes the "dfareporting.advertiserGroups.list" call.
  15682. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15683. // non-nil. Any non-2xx status code is an error. Response headers are in
  15684. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15685. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15686. // googleapi.IsNotModified to check whether the returned error was
  15687. // because http.StatusNotModified was returned.
  15688. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15689. gensupport.SetOptions(c.urlParams_, opts...)
  15690. res, err := c.doRequest("json")
  15691. if res != nil && res.StatusCode == http.StatusNotModified {
  15692. if res.Body != nil {
  15693. res.Body.Close()
  15694. }
  15695. return nil, &googleapi.Error{
  15696. Code: res.StatusCode,
  15697. Header: res.Header,
  15698. }
  15699. }
  15700. if err != nil {
  15701. return nil, err
  15702. }
  15703. defer googleapi.CloseBody(res)
  15704. if err := googleapi.CheckResponse(res); err != nil {
  15705. return nil, err
  15706. }
  15707. ret := &AdvertiserGroupsListResponse{
  15708. ServerResponse: googleapi.ServerResponse{
  15709. Header: res.Header,
  15710. HTTPStatusCode: res.StatusCode,
  15711. },
  15712. }
  15713. target := &ret
  15714. if err := gensupport.DecodeResponse(target, res); err != nil {
  15715. return nil, err
  15716. }
  15717. return ret, nil
  15718. // {
  15719. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15720. // "httpMethod": "GET",
  15721. // "id": "dfareporting.advertiserGroups.list",
  15722. // "parameterOrder": [
  15723. // "profileId"
  15724. // ],
  15725. // "parameters": {
  15726. // "ids": {
  15727. // "description": "Select only advertiser groups with these IDs.",
  15728. // "format": "int64",
  15729. // "location": "query",
  15730. // "repeated": true,
  15731. // "type": "string"
  15732. // },
  15733. // "maxResults": {
  15734. // "default": "1000",
  15735. // "description": "Maximum number of results to return.",
  15736. // "format": "int32",
  15737. // "location": "query",
  15738. // "maximum": "1000",
  15739. // "minimum": "0",
  15740. // "type": "integer"
  15741. // },
  15742. // "pageToken": {
  15743. // "description": "Value of the nextPageToken from the previous result page.",
  15744. // "location": "query",
  15745. // "type": "string"
  15746. // },
  15747. // "profileId": {
  15748. // "description": "User profile ID associated with this request.",
  15749. // "format": "int64",
  15750. // "location": "path",
  15751. // "required": true,
  15752. // "type": "string"
  15753. // },
  15754. // "searchString": {
  15755. // "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\".",
  15756. // "location": "query",
  15757. // "type": "string"
  15758. // },
  15759. // "sortField": {
  15760. // "default": "ID",
  15761. // "description": "Field by which to sort the list.",
  15762. // "enum": [
  15763. // "ID",
  15764. // "NAME"
  15765. // ],
  15766. // "enumDescriptions": [
  15767. // "",
  15768. // ""
  15769. // ],
  15770. // "location": "query",
  15771. // "type": "string"
  15772. // },
  15773. // "sortOrder": {
  15774. // "default": "ASCENDING",
  15775. // "description": "Order of sorted results.",
  15776. // "enum": [
  15777. // "ASCENDING",
  15778. // "DESCENDING"
  15779. // ],
  15780. // "enumDescriptions": [
  15781. // "",
  15782. // ""
  15783. // ],
  15784. // "location": "query",
  15785. // "type": "string"
  15786. // }
  15787. // },
  15788. // "path": "userprofiles/{profileId}/advertiserGroups",
  15789. // "response": {
  15790. // "$ref": "AdvertiserGroupsListResponse"
  15791. // },
  15792. // "scopes": [
  15793. // "https://www.googleapis.com/auth/dfatrafficking"
  15794. // ]
  15795. // }
  15796. }
  15797. // Pages invokes f for each page of results.
  15798. // A non-nil error returned from f will halt the iteration.
  15799. // The provided context supersedes any context provided to the Context method.
  15800. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15801. c.ctx_ = ctx
  15802. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15803. for {
  15804. x, err := c.Do()
  15805. if err != nil {
  15806. return err
  15807. }
  15808. if err := f(x); err != nil {
  15809. return err
  15810. }
  15811. if x.NextPageToken == "" {
  15812. return nil
  15813. }
  15814. c.PageToken(x.NextPageToken)
  15815. }
  15816. }
  15817. // method id "dfareporting.advertiserGroups.patch":
  15818. type AdvertiserGroupsPatchCall struct {
  15819. s *Service
  15820. profileId int64
  15821. advertisergroup *AdvertiserGroup
  15822. urlParams_ gensupport.URLParams
  15823. ctx_ context.Context
  15824. header_ http.Header
  15825. }
  15826. // Patch: Updates an existing advertiser group. This method supports
  15827. // patch semantics.
  15828. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15829. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15830. c.profileId = profileId
  15831. c.urlParams_.Set("id", fmt.Sprint(id))
  15832. c.advertisergroup = advertisergroup
  15833. return c
  15834. }
  15835. // Fields allows partial responses to be retrieved. See
  15836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15837. // for more information.
  15838. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15840. return c
  15841. }
  15842. // Context sets the context to be used in this call's Do method. Any
  15843. // pending HTTP request will be aborted if the provided context is
  15844. // canceled.
  15845. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15846. c.ctx_ = ctx
  15847. return c
  15848. }
  15849. // Header returns an http.Header that can be modified by the caller to
  15850. // add HTTP headers to the request.
  15851. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15852. if c.header_ == nil {
  15853. c.header_ = make(http.Header)
  15854. }
  15855. return c.header_
  15856. }
  15857. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15858. reqHeaders := make(http.Header)
  15859. for k, v := range c.header_ {
  15860. reqHeaders[k] = v
  15861. }
  15862. reqHeaders.Set("User-Agent", c.s.userAgent())
  15863. var body io.Reader = nil
  15864. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15865. if err != nil {
  15866. return nil, err
  15867. }
  15868. reqHeaders.Set("Content-Type", "application/json")
  15869. c.urlParams_.Set("alt", alt)
  15870. c.urlParams_.Set("prettyPrint", "false")
  15871. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15872. urls += "?" + c.urlParams_.Encode()
  15873. req, err := http.NewRequest("PATCH", urls, body)
  15874. if err != nil {
  15875. return nil, err
  15876. }
  15877. req.Header = reqHeaders
  15878. googleapi.Expand(req.URL, map[string]string{
  15879. "profileId": strconv.FormatInt(c.profileId, 10),
  15880. })
  15881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15882. }
  15883. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15884. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15885. // status code is an error. Response headers are in either
  15886. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15887. // at all) in error.(*googleapi.Error).Header. Use
  15888. // googleapi.IsNotModified to check whether the returned error was
  15889. // because http.StatusNotModified was returned.
  15890. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15891. gensupport.SetOptions(c.urlParams_, opts...)
  15892. res, err := c.doRequest("json")
  15893. if res != nil && res.StatusCode == http.StatusNotModified {
  15894. if res.Body != nil {
  15895. res.Body.Close()
  15896. }
  15897. return nil, &googleapi.Error{
  15898. Code: res.StatusCode,
  15899. Header: res.Header,
  15900. }
  15901. }
  15902. if err != nil {
  15903. return nil, err
  15904. }
  15905. defer googleapi.CloseBody(res)
  15906. if err := googleapi.CheckResponse(res); err != nil {
  15907. return nil, err
  15908. }
  15909. ret := &AdvertiserGroup{
  15910. ServerResponse: googleapi.ServerResponse{
  15911. Header: res.Header,
  15912. HTTPStatusCode: res.StatusCode,
  15913. },
  15914. }
  15915. target := &ret
  15916. if err := gensupport.DecodeResponse(target, res); err != nil {
  15917. return nil, err
  15918. }
  15919. return ret, nil
  15920. // {
  15921. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15922. // "httpMethod": "PATCH",
  15923. // "id": "dfareporting.advertiserGroups.patch",
  15924. // "parameterOrder": [
  15925. // "profileId",
  15926. // "id"
  15927. // ],
  15928. // "parameters": {
  15929. // "id": {
  15930. // "description": "Advertiser group ID.",
  15931. // "format": "int64",
  15932. // "location": "query",
  15933. // "required": true,
  15934. // "type": "string"
  15935. // },
  15936. // "profileId": {
  15937. // "description": "User profile ID associated with this request.",
  15938. // "format": "int64",
  15939. // "location": "path",
  15940. // "required": true,
  15941. // "type": "string"
  15942. // }
  15943. // },
  15944. // "path": "userprofiles/{profileId}/advertiserGroups",
  15945. // "request": {
  15946. // "$ref": "AdvertiserGroup"
  15947. // },
  15948. // "response": {
  15949. // "$ref": "AdvertiserGroup"
  15950. // },
  15951. // "scopes": [
  15952. // "https://www.googleapis.com/auth/dfatrafficking"
  15953. // ]
  15954. // }
  15955. }
  15956. // method id "dfareporting.advertiserGroups.update":
  15957. type AdvertiserGroupsUpdateCall struct {
  15958. s *Service
  15959. profileId int64
  15960. advertisergroup *AdvertiserGroup
  15961. urlParams_ gensupport.URLParams
  15962. ctx_ context.Context
  15963. header_ http.Header
  15964. }
  15965. // Update: Updates an existing advertiser group.
  15966. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15967. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15968. c.profileId = profileId
  15969. c.advertisergroup = advertisergroup
  15970. return c
  15971. }
  15972. // Fields allows partial responses to be retrieved. See
  15973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15974. // for more information.
  15975. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15977. return c
  15978. }
  15979. // Context sets the context to be used in this call's Do method. Any
  15980. // pending HTTP request will be aborted if the provided context is
  15981. // canceled.
  15982. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15983. c.ctx_ = ctx
  15984. return c
  15985. }
  15986. // Header returns an http.Header that can be modified by the caller to
  15987. // add HTTP headers to the request.
  15988. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15989. if c.header_ == nil {
  15990. c.header_ = make(http.Header)
  15991. }
  15992. return c.header_
  15993. }
  15994. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15995. reqHeaders := make(http.Header)
  15996. for k, v := range c.header_ {
  15997. reqHeaders[k] = v
  15998. }
  15999. reqHeaders.Set("User-Agent", c.s.userAgent())
  16000. var body io.Reader = nil
  16001. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  16002. if err != nil {
  16003. return nil, err
  16004. }
  16005. reqHeaders.Set("Content-Type", "application/json")
  16006. c.urlParams_.Set("alt", alt)
  16007. c.urlParams_.Set("prettyPrint", "false")
  16008. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  16009. urls += "?" + c.urlParams_.Encode()
  16010. req, err := http.NewRequest("PUT", urls, body)
  16011. if err != nil {
  16012. return nil, err
  16013. }
  16014. req.Header = reqHeaders
  16015. googleapi.Expand(req.URL, map[string]string{
  16016. "profileId": strconv.FormatInt(c.profileId, 10),
  16017. })
  16018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16019. }
  16020. // Do executes the "dfareporting.advertiserGroups.update" call.
  16021. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  16022. // status code is an error. Response headers are in either
  16023. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  16024. // at all) in error.(*googleapi.Error).Header. Use
  16025. // googleapi.IsNotModified to check whether the returned error was
  16026. // because http.StatusNotModified was returned.
  16027. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  16028. gensupport.SetOptions(c.urlParams_, opts...)
  16029. res, err := c.doRequest("json")
  16030. if res != nil && res.StatusCode == http.StatusNotModified {
  16031. if res.Body != nil {
  16032. res.Body.Close()
  16033. }
  16034. return nil, &googleapi.Error{
  16035. Code: res.StatusCode,
  16036. Header: res.Header,
  16037. }
  16038. }
  16039. if err != nil {
  16040. return nil, err
  16041. }
  16042. defer googleapi.CloseBody(res)
  16043. if err := googleapi.CheckResponse(res); err != nil {
  16044. return nil, err
  16045. }
  16046. ret := &AdvertiserGroup{
  16047. ServerResponse: googleapi.ServerResponse{
  16048. Header: res.Header,
  16049. HTTPStatusCode: res.StatusCode,
  16050. },
  16051. }
  16052. target := &ret
  16053. if err := gensupport.DecodeResponse(target, res); err != nil {
  16054. return nil, err
  16055. }
  16056. return ret, nil
  16057. // {
  16058. // "description": "Updates an existing advertiser group.",
  16059. // "httpMethod": "PUT",
  16060. // "id": "dfareporting.advertiserGroups.update",
  16061. // "parameterOrder": [
  16062. // "profileId"
  16063. // ],
  16064. // "parameters": {
  16065. // "profileId": {
  16066. // "description": "User profile ID associated with this request.",
  16067. // "format": "int64",
  16068. // "location": "path",
  16069. // "required": true,
  16070. // "type": "string"
  16071. // }
  16072. // },
  16073. // "path": "userprofiles/{profileId}/advertiserGroups",
  16074. // "request": {
  16075. // "$ref": "AdvertiserGroup"
  16076. // },
  16077. // "response": {
  16078. // "$ref": "AdvertiserGroup"
  16079. // },
  16080. // "scopes": [
  16081. // "https://www.googleapis.com/auth/dfatrafficking"
  16082. // ]
  16083. // }
  16084. }
  16085. // method id "dfareporting.advertiserLandingPages.get":
  16086. type AdvertiserLandingPagesGetCall struct {
  16087. s *Service
  16088. profileId int64
  16089. id int64
  16090. urlParams_ gensupport.URLParams
  16091. ifNoneMatch_ string
  16092. ctx_ context.Context
  16093. header_ http.Header
  16094. }
  16095. // Get: Gets one landing page by ID.
  16096. func (r *AdvertiserLandingPagesService) Get(profileId int64, id int64) *AdvertiserLandingPagesGetCall {
  16097. c := &AdvertiserLandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16098. c.profileId = profileId
  16099. c.id = id
  16100. return c
  16101. }
  16102. // Fields allows partial responses to be retrieved. See
  16103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16104. // for more information.
  16105. func (c *AdvertiserLandingPagesGetCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesGetCall {
  16106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16107. return c
  16108. }
  16109. // IfNoneMatch sets the optional parameter which makes the operation
  16110. // fail if the object's ETag matches the given value. This is useful for
  16111. // getting updates only after the object has changed since the last
  16112. // request. Use googleapi.IsNotModified to check whether the response
  16113. // error from Do is the result of In-None-Match.
  16114. func (c *AdvertiserLandingPagesGetCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesGetCall {
  16115. c.ifNoneMatch_ = entityTag
  16116. return c
  16117. }
  16118. // Context sets the context to be used in this call's Do method. Any
  16119. // pending HTTP request will be aborted if the provided context is
  16120. // canceled.
  16121. func (c *AdvertiserLandingPagesGetCall) Context(ctx context.Context) *AdvertiserLandingPagesGetCall {
  16122. c.ctx_ = ctx
  16123. return c
  16124. }
  16125. // Header returns an http.Header that can be modified by the caller to
  16126. // add HTTP headers to the request.
  16127. func (c *AdvertiserLandingPagesGetCall) Header() http.Header {
  16128. if c.header_ == nil {
  16129. c.header_ = make(http.Header)
  16130. }
  16131. return c.header_
  16132. }
  16133. func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  16134. reqHeaders := make(http.Header)
  16135. for k, v := range c.header_ {
  16136. reqHeaders[k] = v
  16137. }
  16138. reqHeaders.Set("User-Agent", c.s.userAgent())
  16139. if c.ifNoneMatch_ != "" {
  16140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16141. }
  16142. var body io.Reader = nil
  16143. c.urlParams_.Set("alt", alt)
  16144. c.urlParams_.Set("prettyPrint", "false")
  16145. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages/{id}")
  16146. urls += "?" + c.urlParams_.Encode()
  16147. req, err := http.NewRequest("GET", urls, body)
  16148. if err != nil {
  16149. return nil, err
  16150. }
  16151. req.Header = reqHeaders
  16152. googleapi.Expand(req.URL, map[string]string{
  16153. "profileId": strconv.FormatInt(c.profileId, 10),
  16154. "id": strconv.FormatInt(c.id, 10),
  16155. })
  16156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16157. }
  16158. // Do executes the "dfareporting.advertiserLandingPages.get" call.
  16159. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16160. // status code is an error. Response headers are in either
  16161. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16162. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16163. // to check whether the returned error was because
  16164. // http.StatusNotModified was returned.
  16165. func (c *AdvertiserLandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16166. gensupport.SetOptions(c.urlParams_, opts...)
  16167. res, err := c.doRequest("json")
  16168. if res != nil && res.StatusCode == http.StatusNotModified {
  16169. if res.Body != nil {
  16170. res.Body.Close()
  16171. }
  16172. return nil, &googleapi.Error{
  16173. Code: res.StatusCode,
  16174. Header: res.Header,
  16175. }
  16176. }
  16177. if err != nil {
  16178. return nil, err
  16179. }
  16180. defer googleapi.CloseBody(res)
  16181. if err := googleapi.CheckResponse(res); err != nil {
  16182. return nil, err
  16183. }
  16184. ret := &LandingPage{
  16185. ServerResponse: googleapi.ServerResponse{
  16186. Header: res.Header,
  16187. HTTPStatusCode: res.StatusCode,
  16188. },
  16189. }
  16190. target := &ret
  16191. if err := gensupport.DecodeResponse(target, res); err != nil {
  16192. return nil, err
  16193. }
  16194. return ret, nil
  16195. // {
  16196. // "description": "Gets one landing page by ID.",
  16197. // "httpMethod": "GET",
  16198. // "id": "dfareporting.advertiserLandingPages.get",
  16199. // "parameterOrder": [
  16200. // "profileId",
  16201. // "id"
  16202. // ],
  16203. // "parameters": {
  16204. // "id": {
  16205. // "description": "Landing page ID.",
  16206. // "format": "int64",
  16207. // "location": "path",
  16208. // "required": true,
  16209. // "type": "string"
  16210. // },
  16211. // "profileId": {
  16212. // "description": "User profile ID associated with this request.",
  16213. // "format": "int64",
  16214. // "location": "path",
  16215. // "required": true,
  16216. // "type": "string"
  16217. // }
  16218. // },
  16219. // "path": "userprofiles/{profileId}/advertiserLandingPages/{id}",
  16220. // "response": {
  16221. // "$ref": "LandingPage"
  16222. // },
  16223. // "scopes": [
  16224. // "https://www.googleapis.com/auth/dfatrafficking"
  16225. // ]
  16226. // }
  16227. }
  16228. // method id "dfareporting.advertiserLandingPages.insert":
  16229. type AdvertiserLandingPagesInsertCall struct {
  16230. s *Service
  16231. profileId int64
  16232. landingpage *LandingPage
  16233. urlParams_ gensupport.URLParams
  16234. ctx_ context.Context
  16235. header_ http.Header
  16236. }
  16237. // Insert: Inserts a new landing page.
  16238. func (r *AdvertiserLandingPagesService) Insert(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesInsertCall {
  16239. c := &AdvertiserLandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16240. c.profileId = profileId
  16241. c.landingpage = landingpage
  16242. return c
  16243. }
  16244. // Fields allows partial responses to be retrieved. See
  16245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16246. // for more information.
  16247. func (c *AdvertiserLandingPagesInsertCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesInsertCall {
  16248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16249. return c
  16250. }
  16251. // Context sets the context to be used in this call's Do method. Any
  16252. // pending HTTP request will be aborted if the provided context is
  16253. // canceled.
  16254. func (c *AdvertiserLandingPagesInsertCall) Context(ctx context.Context) *AdvertiserLandingPagesInsertCall {
  16255. c.ctx_ = ctx
  16256. return c
  16257. }
  16258. // Header returns an http.Header that can be modified by the caller to
  16259. // add HTTP headers to the request.
  16260. func (c *AdvertiserLandingPagesInsertCall) Header() http.Header {
  16261. if c.header_ == nil {
  16262. c.header_ = make(http.Header)
  16263. }
  16264. return c.header_
  16265. }
  16266. func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  16267. reqHeaders := make(http.Header)
  16268. for k, v := range c.header_ {
  16269. reqHeaders[k] = v
  16270. }
  16271. reqHeaders.Set("User-Agent", c.s.userAgent())
  16272. var body io.Reader = nil
  16273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16274. if err != nil {
  16275. return nil, err
  16276. }
  16277. reqHeaders.Set("Content-Type", "application/json")
  16278. c.urlParams_.Set("alt", alt)
  16279. c.urlParams_.Set("prettyPrint", "false")
  16280. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16281. urls += "?" + c.urlParams_.Encode()
  16282. req, err := http.NewRequest("POST", urls, body)
  16283. if err != nil {
  16284. return nil, err
  16285. }
  16286. req.Header = reqHeaders
  16287. googleapi.Expand(req.URL, map[string]string{
  16288. "profileId": strconv.FormatInt(c.profileId, 10),
  16289. })
  16290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16291. }
  16292. // Do executes the "dfareporting.advertiserLandingPages.insert" call.
  16293. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16294. // status code is an error. Response headers are in either
  16295. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16296. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16297. // to check whether the returned error was because
  16298. // http.StatusNotModified was returned.
  16299. func (c *AdvertiserLandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16300. gensupport.SetOptions(c.urlParams_, opts...)
  16301. res, err := c.doRequest("json")
  16302. if res != nil && res.StatusCode == http.StatusNotModified {
  16303. if res.Body != nil {
  16304. res.Body.Close()
  16305. }
  16306. return nil, &googleapi.Error{
  16307. Code: res.StatusCode,
  16308. Header: res.Header,
  16309. }
  16310. }
  16311. if err != nil {
  16312. return nil, err
  16313. }
  16314. defer googleapi.CloseBody(res)
  16315. if err := googleapi.CheckResponse(res); err != nil {
  16316. return nil, err
  16317. }
  16318. ret := &LandingPage{
  16319. ServerResponse: googleapi.ServerResponse{
  16320. Header: res.Header,
  16321. HTTPStatusCode: res.StatusCode,
  16322. },
  16323. }
  16324. target := &ret
  16325. if err := gensupport.DecodeResponse(target, res); err != nil {
  16326. return nil, err
  16327. }
  16328. return ret, nil
  16329. // {
  16330. // "description": "Inserts a new landing page.",
  16331. // "httpMethod": "POST",
  16332. // "id": "dfareporting.advertiserLandingPages.insert",
  16333. // "parameterOrder": [
  16334. // "profileId"
  16335. // ],
  16336. // "parameters": {
  16337. // "profileId": {
  16338. // "description": "User profile ID associated with this request.",
  16339. // "format": "int64",
  16340. // "location": "path",
  16341. // "required": true,
  16342. // "type": "string"
  16343. // }
  16344. // },
  16345. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16346. // "request": {
  16347. // "$ref": "LandingPage"
  16348. // },
  16349. // "response": {
  16350. // "$ref": "LandingPage"
  16351. // },
  16352. // "scopes": [
  16353. // "https://www.googleapis.com/auth/dfatrafficking"
  16354. // ]
  16355. // }
  16356. }
  16357. // method id "dfareporting.advertiserLandingPages.list":
  16358. type AdvertiserLandingPagesListCall struct {
  16359. s *Service
  16360. profileId int64
  16361. urlParams_ gensupport.URLParams
  16362. ifNoneMatch_ string
  16363. ctx_ context.Context
  16364. header_ http.Header
  16365. }
  16366. // List: Retrieves a list of landing pages.
  16367. func (r *AdvertiserLandingPagesService) List(profileId int64) *AdvertiserLandingPagesListCall {
  16368. c := &AdvertiserLandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16369. c.profileId = profileId
  16370. return c
  16371. }
  16372. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  16373. // only landing pages that belong to these advertisers.
  16374. func (c *AdvertiserLandingPagesListCall) AdvertiserIds(advertiserIds ...int64) *AdvertiserLandingPagesListCall {
  16375. var advertiserIds_ []string
  16376. for _, v := range advertiserIds {
  16377. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  16378. }
  16379. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  16380. return c
  16381. }
  16382. // Archived sets the optional parameter "archived": Select only archived
  16383. // landing pages. Don't set this field to select both archived and
  16384. // non-archived landing pages.
  16385. func (c *AdvertiserLandingPagesListCall) Archived(archived bool) *AdvertiserLandingPagesListCall {
  16386. c.urlParams_.Set("archived", fmt.Sprint(archived))
  16387. return c
  16388. }
  16389. // Ids sets the optional parameter "ids": Select only landing pages with
  16390. // these IDs.
  16391. func (c *AdvertiserLandingPagesListCall) Ids(ids ...int64) *AdvertiserLandingPagesListCall {
  16392. var ids_ []string
  16393. for _, v := range ids {
  16394. ids_ = append(ids_, fmt.Sprint(v))
  16395. }
  16396. c.urlParams_.SetMulti("ids", ids_)
  16397. return c
  16398. }
  16399. // MaxResults sets the optional parameter "maxResults": Maximum number
  16400. // of results to return.
  16401. func (c *AdvertiserLandingPagesListCall) MaxResults(maxResults int64) *AdvertiserLandingPagesListCall {
  16402. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16403. return c
  16404. }
  16405. // PageToken sets the optional parameter "pageToken": Value of the
  16406. // nextPageToken from the previous result page.
  16407. func (c *AdvertiserLandingPagesListCall) PageToken(pageToken string) *AdvertiserLandingPagesListCall {
  16408. c.urlParams_.Set("pageToken", pageToken)
  16409. return c
  16410. }
  16411. // SearchString sets the optional parameter "searchString": Allows
  16412. // searching for landing pages by name or ID. Wildcards (*) are allowed.
  16413. // For example, "landingpage*2017" will return landing pages with names
  16414. // like "landingpage July 2017", "landingpage March 2017", or simply
  16415. // "landingpage 2017". Most of the searches also add wildcards
  16416. // implicitly at the start and the end of the search string. For
  16417. // example, a search string of "landingpage" will match campaigns with
  16418. // name "my landingpage", "landingpage 2015", or simply "landingpage".
  16419. func (c *AdvertiserLandingPagesListCall) SearchString(searchString string) *AdvertiserLandingPagesListCall {
  16420. c.urlParams_.Set("searchString", searchString)
  16421. return c
  16422. }
  16423. // SortField sets the optional parameter "sortField": Field by which to
  16424. // sort the list.
  16425. //
  16426. // Possible values:
  16427. // "ID" (default)
  16428. // "NAME"
  16429. func (c *AdvertiserLandingPagesListCall) SortField(sortField string) *AdvertiserLandingPagesListCall {
  16430. c.urlParams_.Set("sortField", sortField)
  16431. return c
  16432. }
  16433. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16434. // results.
  16435. //
  16436. // Possible values:
  16437. // "ASCENDING" (default)
  16438. // "DESCENDING"
  16439. func (c *AdvertiserLandingPagesListCall) SortOrder(sortOrder string) *AdvertiserLandingPagesListCall {
  16440. c.urlParams_.Set("sortOrder", sortOrder)
  16441. return c
  16442. }
  16443. // SubaccountId sets the optional parameter "subaccountId": Select only
  16444. // landing pages that belong to this subaccount.
  16445. func (c *AdvertiserLandingPagesListCall) SubaccountId(subaccountId int64) *AdvertiserLandingPagesListCall {
  16446. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16447. return c
  16448. }
  16449. // Fields allows partial responses to be retrieved. See
  16450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16451. // for more information.
  16452. func (c *AdvertiserLandingPagesListCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesListCall {
  16453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16454. return c
  16455. }
  16456. // IfNoneMatch sets the optional parameter which makes the operation
  16457. // fail if the object's ETag matches the given value. This is useful for
  16458. // getting updates only after the object has changed since the last
  16459. // request. Use googleapi.IsNotModified to check whether the response
  16460. // error from Do is the result of In-None-Match.
  16461. func (c *AdvertiserLandingPagesListCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesListCall {
  16462. c.ifNoneMatch_ = entityTag
  16463. return c
  16464. }
  16465. // Context sets the context to be used in this call's Do method. Any
  16466. // pending HTTP request will be aborted if the provided context is
  16467. // canceled.
  16468. func (c *AdvertiserLandingPagesListCall) Context(ctx context.Context) *AdvertiserLandingPagesListCall {
  16469. c.ctx_ = ctx
  16470. return c
  16471. }
  16472. // Header returns an http.Header that can be modified by the caller to
  16473. // add HTTP headers to the request.
  16474. func (c *AdvertiserLandingPagesListCall) Header() http.Header {
  16475. if c.header_ == nil {
  16476. c.header_ = make(http.Header)
  16477. }
  16478. return c.header_
  16479. }
  16480. func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  16481. reqHeaders := make(http.Header)
  16482. for k, v := range c.header_ {
  16483. reqHeaders[k] = v
  16484. }
  16485. reqHeaders.Set("User-Agent", c.s.userAgent())
  16486. if c.ifNoneMatch_ != "" {
  16487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16488. }
  16489. var body io.Reader = nil
  16490. c.urlParams_.Set("alt", alt)
  16491. c.urlParams_.Set("prettyPrint", "false")
  16492. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16493. urls += "?" + c.urlParams_.Encode()
  16494. req, err := http.NewRequest("GET", urls, body)
  16495. if err != nil {
  16496. return nil, err
  16497. }
  16498. req.Header = reqHeaders
  16499. googleapi.Expand(req.URL, map[string]string{
  16500. "profileId": strconv.FormatInt(c.profileId, 10),
  16501. })
  16502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16503. }
  16504. // Do executes the "dfareporting.advertiserLandingPages.list" call.
  16505. // Exactly one of *AdvertiserLandingPagesListResponse or error will be
  16506. // non-nil. Any non-2xx status code is an error. Response headers are in
  16507. // either *AdvertiserLandingPagesListResponse.ServerResponse.Header or
  16508. // (if a response was returned at all) in
  16509. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16510. // whether the returned error was because http.StatusNotModified was
  16511. // returned.
  16512. func (c *AdvertiserLandingPagesListCall) Do(opts ...googleapi.CallOption) (*AdvertiserLandingPagesListResponse, error) {
  16513. gensupport.SetOptions(c.urlParams_, opts...)
  16514. res, err := c.doRequest("json")
  16515. if res != nil && res.StatusCode == http.StatusNotModified {
  16516. if res.Body != nil {
  16517. res.Body.Close()
  16518. }
  16519. return nil, &googleapi.Error{
  16520. Code: res.StatusCode,
  16521. Header: res.Header,
  16522. }
  16523. }
  16524. if err != nil {
  16525. return nil, err
  16526. }
  16527. defer googleapi.CloseBody(res)
  16528. if err := googleapi.CheckResponse(res); err != nil {
  16529. return nil, err
  16530. }
  16531. ret := &AdvertiserLandingPagesListResponse{
  16532. ServerResponse: googleapi.ServerResponse{
  16533. Header: res.Header,
  16534. HTTPStatusCode: res.StatusCode,
  16535. },
  16536. }
  16537. target := &ret
  16538. if err := gensupport.DecodeResponse(target, res); err != nil {
  16539. return nil, err
  16540. }
  16541. return ret, nil
  16542. // {
  16543. // "description": "Retrieves a list of landing pages.",
  16544. // "httpMethod": "GET",
  16545. // "id": "dfareporting.advertiserLandingPages.list",
  16546. // "parameterOrder": [
  16547. // "profileId"
  16548. // ],
  16549. // "parameters": {
  16550. // "advertiserIds": {
  16551. // "description": "Select only landing pages that belong to these advertisers.",
  16552. // "format": "int64",
  16553. // "location": "query",
  16554. // "repeated": true,
  16555. // "type": "string"
  16556. // },
  16557. // "archived": {
  16558. // "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.",
  16559. // "location": "query",
  16560. // "type": "boolean"
  16561. // },
  16562. // "ids": {
  16563. // "description": "Select only landing pages with these IDs.",
  16564. // "format": "int64",
  16565. // "location": "query",
  16566. // "repeated": true,
  16567. // "type": "string"
  16568. // },
  16569. // "maxResults": {
  16570. // "default": "1000",
  16571. // "description": "Maximum number of results to return.",
  16572. // "format": "int32",
  16573. // "location": "query",
  16574. // "maximum": "1000",
  16575. // "minimum": "0",
  16576. // "type": "integer"
  16577. // },
  16578. // "pageToken": {
  16579. // "description": "Value of the nextPageToken from the previous result page.",
  16580. // "location": "query",
  16581. // "type": "string"
  16582. // },
  16583. // "profileId": {
  16584. // "description": "User profile ID associated with this request.",
  16585. // "format": "int64",
  16586. // "location": "path",
  16587. // "required": true,
  16588. // "type": "string"
  16589. // },
  16590. // "searchString": {
  16591. // "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\".",
  16592. // "location": "query",
  16593. // "type": "string"
  16594. // },
  16595. // "sortField": {
  16596. // "default": "ID",
  16597. // "description": "Field by which to sort the list.",
  16598. // "enum": [
  16599. // "ID",
  16600. // "NAME"
  16601. // ],
  16602. // "enumDescriptions": [
  16603. // "",
  16604. // ""
  16605. // ],
  16606. // "location": "query",
  16607. // "type": "string"
  16608. // },
  16609. // "sortOrder": {
  16610. // "default": "ASCENDING",
  16611. // "description": "Order of sorted results.",
  16612. // "enum": [
  16613. // "ASCENDING",
  16614. // "DESCENDING"
  16615. // ],
  16616. // "enumDescriptions": [
  16617. // "",
  16618. // ""
  16619. // ],
  16620. // "location": "query",
  16621. // "type": "string"
  16622. // },
  16623. // "subaccountId": {
  16624. // "description": "Select only landing pages that belong to this subaccount.",
  16625. // "format": "int64",
  16626. // "location": "query",
  16627. // "type": "string"
  16628. // }
  16629. // },
  16630. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16631. // "response": {
  16632. // "$ref": "AdvertiserLandingPagesListResponse"
  16633. // },
  16634. // "scopes": [
  16635. // "https://www.googleapis.com/auth/dfatrafficking"
  16636. // ]
  16637. // }
  16638. }
  16639. // Pages invokes f for each page of results.
  16640. // A non-nil error returned from f will halt the iteration.
  16641. // The provided context supersedes any context provided to the Context method.
  16642. func (c *AdvertiserLandingPagesListCall) Pages(ctx context.Context, f func(*AdvertiserLandingPagesListResponse) error) error {
  16643. c.ctx_ = ctx
  16644. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16645. for {
  16646. x, err := c.Do()
  16647. if err != nil {
  16648. return err
  16649. }
  16650. if err := f(x); err != nil {
  16651. return err
  16652. }
  16653. if x.NextPageToken == "" {
  16654. return nil
  16655. }
  16656. c.PageToken(x.NextPageToken)
  16657. }
  16658. }
  16659. // method id "dfareporting.advertiserLandingPages.patch":
  16660. type AdvertiserLandingPagesPatchCall struct {
  16661. s *Service
  16662. profileId int64
  16663. landingpage *LandingPage
  16664. urlParams_ gensupport.URLParams
  16665. ctx_ context.Context
  16666. header_ http.Header
  16667. }
  16668. // Patch: Updates an existing landing page. This method supports patch
  16669. // semantics.
  16670. func (r *AdvertiserLandingPagesService) Patch(profileId int64, id int64, landingpage *LandingPage) *AdvertiserLandingPagesPatchCall {
  16671. c := &AdvertiserLandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16672. c.profileId = profileId
  16673. c.urlParams_.Set("id", fmt.Sprint(id))
  16674. c.landingpage = landingpage
  16675. return c
  16676. }
  16677. // Fields allows partial responses to be retrieved. See
  16678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16679. // for more information.
  16680. func (c *AdvertiserLandingPagesPatchCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesPatchCall {
  16681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16682. return c
  16683. }
  16684. // Context sets the context to be used in this call's Do method. Any
  16685. // pending HTTP request will be aborted if the provided context is
  16686. // canceled.
  16687. func (c *AdvertiserLandingPagesPatchCall) Context(ctx context.Context) *AdvertiserLandingPagesPatchCall {
  16688. c.ctx_ = ctx
  16689. return c
  16690. }
  16691. // Header returns an http.Header that can be modified by the caller to
  16692. // add HTTP headers to the request.
  16693. func (c *AdvertiserLandingPagesPatchCall) Header() http.Header {
  16694. if c.header_ == nil {
  16695. c.header_ = make(http.Header)
  16696. }
  16697. return c.header_
  16698. }
  16699. func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  16700. reqHeaders := make(http.Header)
  16701. for k, v := range c.header_ {
  16702. reqHeaders[k] = v
  16703. }
  16704. reqHeaders.Set("User-Agent", c.s.userAgent())
  16705. var body io.Reader = nil
  16706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16707. if err != nil {
  16708. return nil, err
  16709. }
  16710. reqHeaders.Set("Content-Type", "application/json")
  16711. c.urlParams_.Set("alt", alt)
  16712. c.urlParams_.Set("prettyPrint", "false")
  16713. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16714. urls += "?" + c.urlParams_.Encode()
  16715. req, err := http.NewRequest("PATCH", urls, body)
  16716. if err != nil {
  16717. return nil, err
  16718. }
  16719. req.Header = reqHeaders
  16720. googleapi.Expand(req.URL, map[string]string{
  16721. "profileId": strconv.FormatInt(c.profileId, 10),
  16722. })
  16723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16724. }
  16725. // Do executes the "dfareporting.advertiserLandingPages.patch" call.
  16726. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16727. // status code is an error. Response headers are in either
  16728. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16729. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16730. // to check whether the returned error was because
  16731. // http.StatusNotModified was returned.
  16732. func (c *AdvertiserLandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16733. gensupport.SetOptions(c.urlParams_, opts...)
  16734. res, err := c.doRequest("json")
  16735. if res != nil && res.StatusCode == http.StatusNotModified {
  16736. if res.Body != nil {
  16737. res.Body.Close()
  16738. }
  16739. return nil, &googleapi.Error{
  16740. Code: res.StatusCode,
  16741. Header: res.Header,
  16742. }
  16743. }
  16744. if err != nil {
  16745. return nil, err
  16746. }
  16747. defer googleapi.CloseBody(res)
  16748. if err := googleapi.CheckResponse(res); err != nil {
  16749. return nil, err
  16750. }
  16751. ret := &LandingPage{
  16752. ServerResponse: googleapi.ServerResponse{
  16753. Header: res.Header,
  16754. HTTPStatusCode: res.StatusCode,
  16755. },
  16756. }
  16757. target := &ret
  16758. if err := gensupport.DecodeResponse(target, res); err != nil {
  16759. return nil, err
  16760. }
  16761. return ret, nil
  16762. // {
  16763. // "description": "Updates an existing landing page. This method supports patch semantics.",
  16764. // "httpMethod": "PATCH",
  16765. // "id": "dfareporting.advertiserLandingPages.patch",
  16766. // "parameterOrder": [
  16767. // "profileId",
  16768. // "id"
  16769. // ],
  16770. // "parameters": {
  16771. // "id": {
  16772. // "description": "Landing page ID.",
  16773. // "format": "int64",
  16774. // "location": "query",
  16775. // "required": true,
  16776. // "type": "string"
  16777. // },
  16778. // "profileId": {
  16779. // "description": "User profile ID associated with this request.",
  16780. // "format": "int64",
  16781. // "location": "path",
  16782. // "required": true,
  16783. // "type": "string"
  16784. // }
  16785. // },
  16786. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16787. // "request": {
  16788. // "$ref": "LandingPage"
  16789. // },
  16790. // "response": {
  16791. // "$ref": "LandingPage"
  16792. // },
  16793. // "scopes": [
  16794. // "https://www.googleapis.com/auth/dfatrafficking"
  16795. // ]
  16796. // }
  16797. }
  16798. // method id "dfareporting.advertiserLandingPages.update":
  16799. type AdvertiserLandingPagesUpdateCall struct {
  16800. s *Service
  16801. profileId int64
  16802. landingpage *LandingPage
  16803. urlParams_ gensupport.URLParams
  16804. ctx_ context.Context
  16805. header_ http.Header
  16806. }
  16807. // Update: Updates an existing landing page.
  16808. func (r *AdvertiserLandingPagesService) Update(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesUpdateCall {
  16809. c := &AdvertiserLandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16810. c.profileId = profileId
  16811. c.landingpage = landingpage
  16812. return c
  16813. }
  16814. // Fields allows partial responses to be retrieved. See
  16815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16816. // for more information.
  16817. func (c *AdvertiserLandingPagesUpdateCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesUpdateCall {
  16818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16819. return c
  16820. }
  16821. // Context sets the context to be used in this call's Do method. Any
  16822. // pending HTTP request will be aborted if the provided context is
  16823. // canceled.
  16824. func (c *AdvertiserLandingPagesUpdateCall) Context(ctx context.Context) *AdvertiserLandingPagesUpdateCall {
  16825. c.ctx_ = ctx
  16826. return c
  16827. }
  16828. // Header returns an http.Header that can be modified by the caller to
  16829. // add HTTP headers to the request.
  16830. func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header {
  16831. if c.header_ == nil {
  16832. c.header_ = make(http.Header)
  16833. }
  16834. return c.header_
  16835. }
  16836. func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16837. reqHeaders := make(http.Header)
  16838. for k, v := range c.header_ {
  16839. reqHeaders[k] = v
  16840. }
  16841. reqHeaders.Set("User-Agent", c.s.userAgent())
  16842. var body io.Reader = nil
  16843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16844. if err != nil {
  16845. return nil, err
  16846. }
  16847. reqHeaders.Set("Content-Type", "application/json")
  16848. c.urlParams_.Set("alt", alt)
  16849. c.urlParams_.Set("prettyPrint", "false")
  16850. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16851. urls += "?" + c.urlParams_.Encode()
  16852. req, err := http.NewRequest("PUT", urls, body)
  16853. if err != nil {
  16854. return nil, err
  16855. }
  16856. req.Header = reqHeaders
  16857. googleapi.Expand(req.URL, map[string]string{
  16858. "profileId": strconv.FormatInt(c.profileId, 10),
  16859. })
  16860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16861. }
  16862. // Do executes the "dfareporting.advertiserLandingPages.update" call.
  16863. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16864. // status code is an error. Response headers are in either
  16865. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16867. // to check whether the returned error was because
  16868. // http.StatusNotModified was returned.
  16869. func (c *AdvertiserLandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16870. gensupport.SetOptions(c.urlParams_, opts...)
  16871. res, err := c.doRequest("json")
  16872. if res != nil && res.StatusCode == http.StatusNotModified {
  16873. if res.Body != nil {
  16874. res.Body.Close()
  16875. }
  16876. return nil, &googleapi.Error{
  16877. Code: res.StatusCode,
  16878. Header: res.Header,
  16879. }
  16880. }
  16881. if err != nil {
  16882. return nil, err
  16883. }
  16884. defer googleapi.CloseBody(res)
  16885. if err := googleapi.CheckResponse(res); err != nil {
  16886. return nil, err
  16887. }
  16888. ret := &LandingPage{
  16889. ServerResponse: googleapi.ServerResponse{
  16890. Header: res.Header,
  16891. HTTPStatusCode: res.StatusCode,
  16892. },
  16893. }
  16894. target := &ret
  16895. if err := gensupport.DecodeResponse(target, res); err != nil {
  16896. return nil, err
  16897. }
  16898. return ret, nil
  16899. // {
  16900. // "description": "Updates an existing landing page.",
  16901. // "httpMethod": "PUT",
  16902. // "id": "dfareporting.advertiserLandingPages.update",
  16903. // "parameterOrder": [
  16904. // "profileId"
  16905. // ],
  16906. // "parameters": {
  16907. // "profileId": {
  16908. // "description": "User profile ID associated with this request.",
  16909. // "format": "int64",
  16910. // "location": "path",
  16911. // "required": true,
  16912. // "type": "string"
  16913. // }
  16914. // },
  16915. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16916. // "request": {
  16917. // "$ref": "LandingPage"
  16918. // },
  16919. // "response": {
  16920. // "$ref": "LandingPage"
  16921. // },
  16922. // "scopes": [
  16923. // "https://www.googleapis.com/auth/dfatrafficking"
  16924. // ]
  16925. // }
  16926. }
  16927. // method id "dfareporting.advertisers.get":
  16928. type AdvertisersGetCall struct {
  16929. s *Service
  16930. profileId int64
  16931. id int64
  16932. urlParams_ gensupport.URLParams
  16933. ifNoneMatch_ string
  16934. ctx_ context.Context
  16935. header_ http.Header
  16936. }
  16937. // Get: Gets one advertiser by ID.
  16938. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  16939. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16940. c.profileId = profileId
  16941. c.id = id
  16942. return c
  16943. }
  16944. // Fields allows partial responses to be retrieved. See
  16945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16946. // for more information.
  16947. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  16948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16949. return c
  16950. }
  16951. // IfNoneMatch sets the optional parameter which makes the operation
  16952. // fail if the object's ETag matches the given value. This is useful for
  16953. // getting updates only after the object has changed since the last
  16954. // request. Use googleapi.IsNotModified to check whether the response
  16955. // error from Do is the result of In-None-Match.
  16956. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  16957. c.ifNoneMatch_ = entityTag
  16958. return c
  16959. }
  16960. // Context sets the context to be used in this call's Do method. Any
  16961. // pending HTTP request will be aborted if the provided context is
  16962. // canceled.
  16963. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  16964. c.ctx_ = ctx
  16965. return c
  16966. }
  16967. // Header returns an http.Header that can be modified by the caller to
  16968. // add HTTP headers to the request.
  16969. func (c *AdvertisersGetCall) Header() http.Header {
  16970. if c.header_ == nil {
  16971. c.header_ = make(http.Header)
  16972. }
  16973. return c.header_
  16974. }
  16975. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  16976. reqHeaders := make(http.Header)
  16977. for k, v := range c.header_ {
  16978. reqHeaders[k] = v
  16979. }
  16980. reqHeaders.Set("User-Agent", c.s.userAgent())
  16981. if c.ifNoneMatch_ != "" {
  16982. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16983. }
  16984. var body io.Reader = nil
  16985. c.urlParams_.Set("alt", alt)
  16986. c.urlParams_.Set("prettyPrint", "false")
  16987. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  16988. urls += "?" + c.urlParams_.Encode()
  16989. req, err := http.NewRequest("GET", urls, body)
  16990. if err != nil {
  16991. return nil, err
  16992. }
  16993. req.Header = reqHeaders
  16994. googleapi.Expand(req.URL, map[string]string{
  16995. "profileId": strconv.FormatInt(c.profileId, 10),
  16996. "id": strconv.FormatInt(c.id, 10),
  16997. })
  16998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16999. }
  17000. // Do executes the "dfareporting.advertisers.get" call.
  17001. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17002. // status code is an error. Response headers are in either
  17003. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17004. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17005. // to check whether the returned error was because
  17006. // http.StatusNotModified was returned.
  17007. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17008. gensupport.SetOptions(c.urlParams_, opts...)
  17009. res, err := c.doRequest("json")
  17010. if res != nil && res.StatusCode == http.StatusNotModified {
  17011. if res.Body != nil {
  17012. res.Body.Close()
  17013. }
  17014. return nil, &googleapi.Error{
  17015. Code: res.StatusCode,
  17016. Header: res.Header,
  17017. }
  17018. }
  17019. if err != nil {
  17020. return nil, err
  17021. }
  17022. defer googleapi.CloseBody(res)
  17023. if err := googleapi.CheckResponse(res); err != nil {
  17024. return nil, err
  17025. }
  17026. ret := &Advertiser{
  17027. ServerResponse: googleapi.ServerResponse{
  17028. Header: res.Header,
  17029. HTTPStatusCode: res.StatusCode,
  17030. },
  17031. }
  17032. target := &ret
  17033. if err := gensupport.DecodeResponse(target, res); err != nil {
  17034. return nil, err
  17035. }
  17036. return ret, nil
  17037. // {
  17038. // "description": "Gets one advertiser by ID.",
  17039. // "httpMethod": "GET",
  17040. // "id": "dfareporting.advertisers.get",
  17041. // "parameterOrder": [
  17042. // "profileId",
  17043. // "id"
  17044. // ],
  17045. // "parameters": {
  17046. // "id": {
  17047. // "description": "Advertiser ID.",
  17048. // "format": "int64",
  17049. // "location": "path",
  17050. // "required": true,
  17051. // "type": "string"
  17052. // },
  17053. // "profileId": {
  17054. // "description": "User profile ID associated with this request.",
  17055. // "format": "int64",
  17056. // "location": "path",
  17057. // "required": true,
  17058. // "type": "string"
  17059. // }
  17060. // },
  17061. // "path": "userprofiles/{profileId}/advertisers/{id}",
  17062. // "response": {
  17063. // "$ref": "Advertiser"
  17064. // },
  17065. // "scopes": [
  17066. // "https://www.googleapis.com/auth/dfatrafficking"
  17067. // ]
  17068. // }
  17069. }
  17070. // method id "dfareporting.advertisers.insert":
  17071. type AdvertisersInsertCall struct {
  17072. s *Service
  17073. profileId int64
  17074. advertiser *Advertiser
  17075. urlParams_ gensupport.URLParams
  17076. ctx_ context.Context
  17077. header_ http.Header
  17078. }
  17079. // Insert: Inserts a new advertiser.
  17080. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  17081. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17082. c.profileId = profileId
  17083. c.advertiser = advertiser
  17084. return c
  17085. }
  17086. // Fields allows partial responses to be retrieved. See
  17087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17088. // for more information.
  17089. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  17090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17091. return c
  17092. }
  17093. // Context sets the context to be used in this call's Do method. Any
  17094. // pending HTTP request will be aborted if the provided context is
  17095. // canceled.
  17096. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  17097. c.ctx_ = ctx
  17098. return c
  17099. }
  17100. // Header returns an http.Header that can be modified by the caller to
  17101. // add HTTP headers to the request.
  17102. func (c *AdvertisersInsertCall) Header() http.Header {
  17103. if c.header_ == nil {
  17104. c.header_ = make(http.Header)
  17105. }
  17106. return c.header_
  17107. }
  17108. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  17109. reqHeaders := make(http.Header)
  17110. for k, v := range c.header_ {
  17111. reqHeaders[k] = v
  17112. }
  17113. reqHeaders.Set("User-Agent", c.s.userAgent())
  17114. var body io.Reader = nil
  17115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17116. if err != nil {
  17117. return nil, err
  17118. }
  17119. reqHeaders.Set("Content-Type", "application/json")
  17120. c.urlParams_.Set("alt", alt)
  17121. c.urlParams_.Set("prettyPrint", "false")
  17122. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17123. urls += "?" + c.urlParams_.Encode()
  17124. req, err := http.NewRequest("POST", urls, body)
  17125. if err != nil {
  17126. return nil, err
  17127. }
  17128. req.Header = reqHeaders
  17129. googleapi.Expand(req.URL, map[string]string{
  17130. "profileId": strconv.FormatInt(c.profileId, 10),
  17131. })
  17132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17133. }
  17134. // Do executes the "dfareporting.advertisers.insert" call.
  17135. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17136. // status code is an error. Response headers are in either
  17137. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17138. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17139. // to check whether the returned error was because
  17140. // http.StatusNotModified was returned.
  17141. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17142. gensupport.SetOptions(c.urlParams_, opts...)
  17143. res, err := c.doRequest("json")
  17144. if res != nil && res.StatusCode == http.StatusNotModified {
  17145. if res.Body != nil {
  17146. res.Body.Close()
  17147. }
  17148. return nil, &googleapi.Error{
  17149. Code: res.StatusCode,
  17150. Header: res.Header,
  17151. }
  17152. }
  17153. if err != nil {
  17154. return nil, err
  17155. }
  17156. defer googleapi.CloseBody(res)
  17157. if err := googleapi.CheckResponse(res); err != nil {
  17158. return nil, err
  17159. }
  17160. ret := &Advertiser{
  17161. ServerResponse: googleapi.ServerResponse{
  17162. Header: res.Header,
  17163. HTTPStatusCode: res.StatusCode,
  17164. },
  17165. }
  17166. target := &ret
  17167. if err := gensupport.DecodeResponse(target, res); err != nil {
  17168. return nil, err
  17169. }
  17170. return ret, nil
  17171. // {
  17172. // "description": "Inserts a new advertiser.",
  17173. // "httpMethod": "POST",
  17174. // "id": "dfareporting.advertisers.insert",
  17175. // "parameterOrder": [
  17176. // "profileId"
  17177. // ],
  17178. // "parameters": {
  17179. // "profileId": {
  17180. // "description": "User profile ID associated with this request.",
  17181. // "format": "int64",
  17182. // "location": "path",
  17183. // "required": true,
  17184. // "type": "string"
  17185. // }
  17186. // },
  17187. // "path": "userprofiles/{profileId}/advertisers",
  17188. // "request": {
  17189. // "$ref": "Advertiser"
  17190. // },
  17191. // "response": {
  17192. // "$ref": "Advertiser"
  17193. // },
  17194. // "scopes": [
  17195. // "https://www.googleapis.com/auth/dfatrafficking"
  17196. // ]
  17197. // }
  17198. }
  17199. // method id "dfareporting.advertisers.list":
  17200. type AdvertisersListCall struct {
  17201. s *Service
  17202. profileId int64
  17203. urlParams_ gensupport.URLParams
  17204. ifNoneMatch_ string
  17205. ctx_ context.Context
  17206. header_ http.Header
  17207. }
  17208. // List: Retrieves a list of advertisers, possibly filtered. This method
  17209. // supports paging.
  17210. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  17211. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17212. c.profileId = profileId
  17213. return c
  17214. }
  17215. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17216. // Select only advertisers with these advertiser group IDs.
  17217. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  17218. var advertiserGroupIds_ []string
  17219. for _, v := range advertiserGroupIds {
  17220. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17221. }
  17222. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17223. return c
  17224. }
  17225. // FloodlightConfigurationIds sets the optional parameter
  17226. // "floodlightConfigurationIds": Select only advertisers with these
  17227. // floodlight configuration IDs.
  17228. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  17229. var floodlightConfigurationIds_ []string
  17230. for _, v := range floodlightConfigurationIds {
  17231. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  17232. }
  17233. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  17234. return c
  17235. }
  17236. // Ids sets the optional parameter "ids": Select only advertisers with
  17237. // these IDs.
  17238. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  17239. var ids_ []string
  17240. for _, v := range ids {
  17241. ids_ = append(ids_, fmt.Sprint(v))
  17242. }
  17243. c.urlParams_.SetMulti("ids", ids_)
  17244. return c
  17245. }
  17246. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  17247. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  17248. // do not belong to any advertiser group.
  17249. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  17250. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  17251. return c
  17252. }
  17253. // MaxResults sets the optional parameter "maxResults": Maximum number
  17254. // of results to return.
  17255. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  17256. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17257. return c
  17258. }
  17259. // OnlyParent sets the optional parameter "onlyParent": Select only
  17260. // advertisers which use another advertiser's floodlight configuration.
  17261. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  17262. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  17263. return c
  17264. }
  17265. // PageToken sets the optional parameter "pageToken": Value of the
  17266. // nextPageToken from the previous result page.
  17267. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  17268. c.urlParams_.Set("pageToken", pageToken)
  17269. return c
  17270. }
  17271. // SearchString sets the optional parameter "searchString": Allows
  17272. // searching for objects by name or ID. Wildcards (*) are allowed. For
  17273. // example, "advertiser*2015" will return objects with names like
  17274. // "advertiser June 2015", "advertiser April 2015", or simply
  17275. // "advertiser 2015". Most of the searches also add wildcards implicitly
  17276. // at the start and the end of the search string. For example, a search
  17277. // string of "advertiser" will match objects with name "my advertiser",
  17278. // "advertiser 2015", or simply "advertiser".
  17279. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  17280. c.urlParams_.Set("searchString", searchString)
  17281. return c
  17282. }
  17283. // SortField sets the optional parameter "sortField": Field by which to
  17284. // sort the list.
  17285. //
  17286. // Possible values:
  17287. // "ID" (default)
  17288. // "NAME"
  17289. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  17290. c.urlParams_.Set("sortField", sortField)
  17291. return c
  17292. }
  17293. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17294. // results.
  17295. //
  17296. // Possible values:
  17297. // "ASCENDING" (default)
  17298. // "DESCENDING"
  17299. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  17300. c.urlParams_.Set("sortOrder", sortOrder)
  17301. return c
  17302. }
  17303. // Status sets the optional parameter "status": Select only advertisers
  17304. // with the specified status.
  17305. //
  17306. // Possible values:
  17307. // "APPROVED"
  17308. // "ON_HOLD"
  17309. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  17310. c.urlParams_.Set("status", status)
  17311. return c
  17312. }
  17313. // SubaccountId sets the optional parameter "subaccountId": Select only
  17314. // advertisers with these subaccount IDs.
  17315. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  17316. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17317. return c
  17318. }
  17319. // Fields allows partial responses to be retrieved. See
  17320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17321. // for more information.
  17322. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  17323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17324. return c
  17325. }
  17326. // IfNoneMatch sets the optional parameter which makes the operation
  17327. // fail if the object's ETag matches the given value. This is useful for
  17328. // getting updates only after the object has changed since the last
  17329. // request. Use googleapi.IsNotModified to check whether the response
  17330. // error from Do is the result of In-None-Match.
  17331. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  17332. c.ifNoneMatch_ = entityTag
  17333. return c
  17334. }
  17335. // Context sets the context to be used in this call's Do method. Any
  17336. // pending HTTP request will be aborted if the provided context is
  17337. // canceled.
  17338. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  17339. c.ctx_ = ctx
  17340. return c
  17341. }
  17342. // Header returns an http.Header that can be modified by the caller to
  17343. // add HTTP headers to the request.
  17344. func (c *AdvertisersListCall) Header() http.Header {
  17345. if c.header_ == nil {
  17346. c.header_ = make(http.Header)
  17347. }
  17348. return c.header_
  17349. }
  17350. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  17351. reqHeaders := make(http.Header)
  17352. for k, v := range c.header_ {
  17353. reqHeaders[k] = v
  17354. }
  17355. reqHeaders.Set("User-Agent", c.s.userAgent())
  17356. if c.ifNoneMatch_ != "" {
  17357. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17358. }
  17359. var body io.Reader = nil
  17360. c.urlParams_.Set("alt", alt)
  17361. c.urlParams_.Set("prettyPrint", "false")
  17362. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17363. urls += "?" + c.urlParams_.Encode()
  17364. req, err := http.NewRequest("GET", urls, body)
  17365. if err != nil {
  17366. return nil, err
  17367. }
  17368. req.Header = reqHeaders
  17369. googleapi.Expand(req.URL, map[string]string{
  17370. "profileId": strconv.FormatInt(c.profileId, 10),
  17371. })
  17372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17373. }
  17374. // Do executes the "dfareporting.advertisers.list" call.
  17375. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  17376. // non-2xx status code is an error. Response headers are in either
  17377. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  17378. // returned at all) in error.(*googleapi.Error).Header. Use
  17379. // googleapi.IsNotModified to check whether the returned error was
  17380. // because http.StatusNotModified was returned.
  17381. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  17382. gensupport.SetOptions(c.urlParams_, opts...)
  17383. res, err := c.doRequest("json")
  17384. if res != nil && res.StatusCode == http.StatusNotModified {
  17385. if res.Body != nil {
  17386. res.Body.Close()
  17387. }
  17388. return nil, &googleapi.Error{
  17389. Code: res.StatusCode,
  17390. Header: res.Header,
  17391. }
  17392. }
  17393. if err != nil {
  17394. return nil, err
  17395. }
  17396. defer googleapi.CloseBody(res)
  17397. if err := googleapi.CheckResponse(res); err != nil {
  17398. return nil, err
  17399. }
  17400. ret := &AdvertisersListResponse{
  17401. ServerResponse: googleapi.ServerResponse{
  17402. Header: res.Header,
  17403. HTTPStatusCode: res.StatusCode,
  17404. },
  17405. }
  17406. target := &ret
  17407. if err := gensupport.DecodeResponse(target, res); err != nil {
  17408. return nil, err
  17409. }
  17410. return ret, nil
  17411. // {
  17412. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  17413. // "httpMethod": "GET",
  17414. // "id": "dfareporting.advertisers.list",
  17415. // "parameterOrder": [
  17416. // "profileId"
  17417. // ],
  17418. // "parameters": {
  17419. // "advertiserGroupIds": {
  17420. // "description": "Select only advertisers with these advertiser group IDs.",
  17421. // "format": "int64",
  17422. // "location": "query",
  17423. // "repeated": true,
  17424. // "type": "string"
  17425. // },
  17426. // "floodlightConfigurationIds": {
  17427. // "description": "Select only advertisers with these floodlight configuration IDs.",
  17428. // "format": "int64",
  17429. // "location": "query",
  17430. // "repeated": true,
  17431. // "type": "string"
  17432. // },
  17433. // "ids": {
  17434. // "description": "Select only advertisers with these IDs.",
  17435. // "format": "int64",
  17436. // "location": "query",
  17437. // "repeated": true,
  17438. // "type": "string"
  17439. // },
  17440. // "includeAdvertisersWithoutGroupsOnly": {
  17441. // "description": "Select only advertisers which do not belong to any advertiser group.",
  17442. // "location": "query",
  17443. // "type": "boolean"
  17444. // },
  17445. // "maxResults": {
  17446. // "default": "1000",
  17447. // "description": "Maximum number of results to return.",
  17448. // "format": "int32",
  17449. // "location": "query",
  17450. // "maximum": "1000",
  17451. // "minimum": "0",
  17452. // "type": "integer"
  17453. // },
  17454. // "onlyParent": {
  17455. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  17456. // "location": "query",
  17457. // "type": "boolean"
  17458. // },
  17459. // "pageToken": {
  17460. // "description": "Value of the nextPageToken from the previous result page.",
  17461. // "location": "query",
  17462. // "type": "string"
  17463. // },
  17464. // "profileId": {
  17465. // "description": "User profile ID associated with this request.",
  17466. // "format": "int64",
  17467. // "location": "path",
  17468. // "required": true,
  17469. // "type": "string"
  17470. // },
  17471. // "searchString": {
  17472. // "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\".",
  17473. // "location": "query",
  17474. // "type": "string"
  17475. // },
  17476. // "sortField": {
  17477. // "default": "ID",
  17478. // "description": "Field by which to sort the list.",
  17479. // "enum": [
  17480. // "ID",
  17481. // "NAME"
  17482. // ],
  17483. // "enumDescriptions": [
  17484. // "",
  17485. // ""
  17486. // ],
  17487. // "location": "query",
  17488. // "type": "string"
  17489. // },
  17490. // "sortOrder": {
  17491. // "default": "ASCENDING",
  17492. // "description": "Order of sorted results.",
  17493. // "enum": [
  17494. // "ASCENDING",
  17495. // "DESCENDING"
  17496. // ],
  17497. // "enumDescriptions": [
  17498. // "",
  17499. // ""
  17500. // ],
  17501. // "location": "query",
  17502. // "type": "string"
  17503. // },
  17504. // "status": {
  17505. // "description": "Select only advertisers with the specified status.",
  17506. // "enum": [
  17507. // "APPROVED",
  17508. // "ON_HOLD"
  17509. // ],
  17510. // "enumDescriptions": [
  17511. // "",
  17512. // ""
  17513. // ],
  17514. // "location": "query",
  17515. // "type": "string"
  17516. // },
  17517. // "subaccountId": {
  17518. // "description": "Select only advertisers with these subaccount IDs.",
  17519. // "format": "int64",
  17520. // "location": "query",
  17521. // "type": "string"
  17522. // }
  17523. // },
  17524. // "path": "userprofiles/{profileId}/advertisers",
  17525. // "response": {
  17526. // "$ref": "AdvertisersListResponse"
  17527. // },
  17528. // "scopes": [
  17529. // "https://www.googleapis.com/auth/dfatrafficking"
  17530. // ]
  17531. // }
  17532. }
  17533. // Pages invokes f for each page of results.
  17534. // A non-nil error returned from f will halt the iteration.
  17535. // The provided context supersedes any context provided to the Context method.
  17536. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  17537. c.ctx_ = ctx
  17538. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17539. for {
  17540. x, err := c.Do()
  17541. if err != nil {
  17542. return err
  17543. }
  17544. if err := f(x); err != nil {
  17545. return err
  17546. }
  17547. if x.NextPageToken == "" {
  17548. return nil
  17549. }
  17550. c.PageToken(x.NextPageToken)
  17551. }
  17552. }
  17553. // method id "dfareporting.advertisers.patch":
  17554. type AdvertisersPatchCall struct {
  17555. s *Service
  17556. profileId int64
  17557. advertiser *Advertiser
  17558. urlParams_ gensupport.URLParams
  17559. ctx_ context.Context
  17560. header_ http.Header
  17561. }
  17562. // Patch: Updates an existing advertiser. This method supports patch
  17563. // semantics.
  17564. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  17565. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17566. c.profileId = profileId
  17567. c.urlParams_.Set("id", fmt.Sprint(id))
  17568. c.advertiser = advertiser
  17569. return c
  17570. }
  17571. // Fields allows partial responses to be retrieved. See
  17572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17573. // for more information.
  17574. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  17575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17576. return c
  17577. }
  17578. // Context sets the context to be used in this call's Do method. Any
  17579. // pending HTTP request will be aborted if the provided context is
  17580. // canceled.
  17581. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  17582. c.ctx_ = ctx
  17583. return c
  17584. }
  17585. // Header returns an http.Header that can be modified by the caller to
  17586. // add HTTP headers to the request.
  17587. func (c *AdvertisersPatchCall) Header() http.Header {
  17588. if c.header_ == nil {
  17589. c.header_ = make(http.Header)
  17590. }
  17591. return c.header_
  17592. }
  17593. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  17594. reqHeaders := make(http.Header)
  17595. for k, v := range c.header_ {
  17596. reqHeaders[k] = v
  17597. }
  17598. reqHeaders.Set("User-Agent", c.s.userAgent())
  17599. var body io.Reader = nil
  17600. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17601. if err != nil {
  17602. return nil, err
  17603. }
  17604. reqHeaders.Set("Content-Type", "application/json")
  17605. c.urlParams_.Set("alt", alt)
  17606. c.urlParams_.Set("prettyPrint", "false")
  17607. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17608. urls += "?" + c.urlParams_.Encode()
  17609. req, err := http.NewRequest("PATCH", urls, body)
  17610. if err != nil {
  17611. return nil, err
  17612. }
  17613. req.Header = reqHeaders
  17614. googleapi.Expand(req.URL, map[string]string{
  17615. "profileId": strconv.FormatInt(c.profileId, 10),
  17616. })
  17617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17618. }
  17619. // Do executes the "dfareporting.advertisers.patch" call.
  17620. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17621. // status code is an error. Response headers are in either
  17622. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17623. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17624. // to check whether the returned error was because
  17625. // http.StatusNotModified was returned.
  17626. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17627. gensupport.SetOptions(c.urlParams_, opts...)
  17628. res, err := c.doRequest("json")
  17629. if res != nil && res.StatusCode == http.StatusNotModified {
  17630. if res.Body != nil {
  17631. res.Body.Close()
  17632. }
  17633. return nil, &googleapi.Error{
  17634. Code: res.StatusCode,
  17635. Header: res.Header,
  17636. }
  17637. }
  17638. if err != nil {
  17639. return nil, err
  17640. }
  17641. defer googleapi.CloseBody(res)
  17642. if err := googleapi.CheckResponse(res); err != nil {
  17643. return nil, err
  17644. }
  17645. ret := &Advertiser{
  17646. ServerResponse: googleapi.ServerResponse{
  17647. Header: res.Header,
  17648. HTTPStatusCode: res.StatusCode,
  17649. },
  17650. }
  17651. target := &ret
  17652. if err := gensupport.DecodeResponse(target, res); err != nil {
  17653. return nil, err
  17654. }
  17655. return ret, nil
  17656. // {
  17657. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  17658. // "httpMethod": "PATCH",
  17659. // "id": "dfareporting.advertisers.patch",
  17660. // "parameterOrder": [
  17661. // "profileId",
  17662. // "id"
  17663. // ],
  17664. // "parameters": {
  17665. // "id": {
  17666. // "description": "Advertiser ID.",
  17667. // "format": "int64",
  17668. // "location": "query",
  17669. // "required": true,
  17670. // "type": "string"
  17671. // },
  17672. // "profileId": {
  17673. // "description": "User profile ID associated with this request.",
  17674. // "format": "int64",
  17675. // "location": "path",
  17676. // "required": true,
  17677. // "type": "string"
  17678. // }
  17679. // },
  17680. // "path": "userprofiles/{profileId}/advertisers",
  17681. // "request": {
  17682. // "$ref": "Advertiser"
  17683. // },
  17684. // "response": {
  17685. // "$ref": "Advertiser"
  17686. // },
  17687. // "scopes": [
  17688. // "https://www.googleapis.com/auth/dfatrafficking"
  17689. // ]
  17690. // }
  17691. }
  17692. // method id "dfareporting.advertisers.update":
  17693. type AdvertisersUpdateCall struct {
  17694. s *Service
  17695. profileId int64
  17696. advertiser *Advertiser
  17697. urlParams_ gensupport.URLParams
  17698. ctx_ context.Context
  17699. header_ http.Header
  17700. }
  17701. // Update: Updates an existing advertiser.
  17702. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  17703. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17704. c.profileId = profileId
  17705. c.advertiser = advertiser
  17706. return c
  17707. }
  17708. // Fields allows partial responses to be retrieved. See
  17709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17710. // for more information.
  17711. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  17712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17713. return c
  17714. }
  17715. // Context sets the context to be used in this call's Do method. Any
  17716. // pending HTTP request will be aborted if the provided context is
  17717. // canceled.
  17718. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  17719. c.ctx_ = ctx
  17720. return c
  17721. }
  17722. // Header returns an http.Header that can be modified by the caller to
  17723. // add HTTP headers to the request.
  17724. func (c *AdvertisersUpdateCall) Header() http.Header {
  17725. if c.header_ == nil {
  17726. c.header_ = make(http.Header)
  17727. }
  17728. return c.header_
  17729. }
  17730. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  17731. reqHeaders := make(http.Header)
  17732. for k, v := range c.header_ {
  17733. reqHeaders[k] = v
  17734. }
  17735. reqHeaders.Set("User-Agent", c.s.userAgent())
  17736. var body io.Reader = nil
  17737. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17738. if err != nil {
  17739. return nil, err
  17740. }
  17741. reqHeaders.Set("Content-Type", "application/json")
  17742. c.urlParams_.Set("alt", alt)
  17743. c.urlParams_.Set("prettyPrint", "false")
  17744. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17745. urls += "?" + c.urlParams_.Encode()
  17746. req, err := http.NewRequest("PUT", urls, body)
  17747. if err != nil {
  17748. return nil, err
  17749. }
  17750. req.Header = reqHeaders
  17751. googleapi.Expand(req.URL, map[string]string{
  17752. "profileId": strconv.FormatInt(c.profileId, 10),
  17753. })
  17754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17755. }
  17756. // Do executes the "dfareporting.advertisers.update" call.
  17757. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17758. // status code is an error. Response headers are in either
  17759. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17760. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17761. // to check whether the returned error was because
  17762. // http.StatusNotModified was returned.
  17763. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17764. gensupport.SetOptions(c.urlParams_, opts...)
  17765. res, err := c.doRequest("json")
  17766. if res != nil && res.StatusCode == http.StatusNotModified {
  17767. if res.Body != nil {
  17768. res.Body.Close()
  17769. }
  17770. return nil, &googleapi.Error{
  17771. Code: res.StatusCode,
  17772. Header: res.Header,
  17773. }
  17774. }
  17775. if err != nil {
  17776. return nil, err
  17777. }
  17778. defer googleapi.CloseBody(res)
  17779. if err := googleapi.CheckResponse(res); err != nil {
  17780. return nil, err
  17781. }
  17782. ret := &Advertiser{
  17783. ServerResponse: googleapi.ServerResponse{
  17784. Header: res.Header,
  17785. HTTPStatusCode: res.StatusCode,
  17786. },
  17787. }
  17788. target := &ret
  17789. if err := gensupport.DecodeResponse(target, res); err != nil {
  17790. return nil, err
  17791. }
  17792. return ret, nil
  17793. // {
  17794. // "description": "Updates an existing advertiser.",
  17795. // "httpMethod": "PUT",
  17796. // "id": "dfareporting.advertisers.update",
  17797. // "parameterOrder": [
  17798. // "profileId"
  17799. // ],
  17800. // "parameters": {
  17801. // "profileId": {
  17802. // "description": "User profile ID associated with this request.",
  17803. // "format": "int64",
  17804. // "location": "path",
  17805. // "required": true,
  17806. // "type": "string"
  17807. // }
  17808. // },
  17809. // "path": "userprofiles/{profileId}/advertisers",
  17810. // "request": {
  17811. // "$ref": "Advertiser"
  17812. // },
  17813. // "response": {
  17814. // "$ref": "Advertiser"
  17815. // },
  17816. // "scopes": [
  17817. // "https://www.googleapis.com/auth/dfatrafficking"
  17818. // ]
  17819. // }
  17820. }
  17821. // method id "dfareporting.browsers.list":
  17822. type BrowsersListCall struct {
  17823. s *Service
  17824. profileId int64
  17825. urlParams_ gensupport.URLParams
  17826. ifNoneMatch_ string
  17827. ctx_ context.Context
  17828. header_ http.Header
  17829. }
  17830. // List: Retrieves a list of browsers.
  17831. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  17832. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17833. c.profileId = profileId
  17834. return c
  17835. }
  17836. // Fields allows partial responses to be retrieved. See
  17837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17838. // for more information.
  17839. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  17840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17841. return c
  17842. }
  17843. // IfNoneMatch sets the optional parameter which makes the operation
  17844. // fail if the object's ETag matches the given value. This is useful for
  17845. // getting updates only after the object has changed since the last
  17846. // request. Use googleapi.IsNotModified to check whether the response
  17847. // error from Do is the result of In-None-Match.
  17848. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  17849. c.ifNoneMatch_ = entityTag
  17850. return c
  17851. }
  17852. // Context sets the context to be used in this call's Do method. Any
  17853. // pending HTTP request will be aborted if the provided context is
  17854. // canceled.
  17855. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  17856. c.ctx_ = ctx
  17857. return c
  17858. }
  17859. // Header returns an http.Header that can be modified by the caller to
  17860. // add HTTP headers to the request.
  17861. func (c *BrowsersListCall) Header() http.Header {
  17862. if c.header_ == nil {
  17863. c.header_ = make(http.Header)
  17864. }
  17865. return c.header_
  17866. }
  17867. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  17868. reqHeaders := make(http.Header)
  17869. for k, v := range c.header_ {
  17870. reqHeaders[k] = v
  17871. }
  17872. reqHeaders.Set("User-Agent", c.s.userAgent())
  17873. if c.ifNoneMatch_ != "" {
  17874. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17875. }
  17876. var body io.Reader = nil
  17877. c.urlParams_.Set("alt", alt)
  17878. c.urlParams_.Set("prettyPrint", "false")
  17879. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  17880. urls += "?" + c.urlParams_.Encode()
  17881. req, err := http.NewRequest("GET", urls, body)
  17882. if err != nil {
  17883. return nil, err
  17884. }
  17885. req.Header = reqHeaders
  17886. googleapi.Expand(req.URL, map[string]string{
  17887. "profileId": strconv.FormatInt(c.profileId, 10),
  17888. })
  17889. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17890. }
  17891. // Do executes the "dfareporting.browsers.list" call.
  17892. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  17893. // non-2xx status code is an error. Response headers are in either
  17894. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  17895. // returned at all) in error.(*googleapi.Error).Header. Use
  17896. // googleapi.IsNotModified to check whether the returned error was
  17897. // because http.StatusNotModified was returned.
  17898. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  17899. gensupport.SetOptions(c.urlParams_, opts...)
  17900. res, err := c.doRequest("json")
  17901. if res != nil && res.StatusCode == http.StatusNotModified {
  17902. if res.Body != nil {
  17903. res.Body.Close()
  17904. }
  17905. return nil, &googleapi.Error{
  17906. Code: res.StatusCode,
  17907. Header: res.Header,
  17908. }
  17909. }
  17910. if err != nil {
  17911. return nil, err
  17912. }
  17913. defer googleapi.CloseBody(res)
  17914. if err := googleapi.CheckResponse(res); err != nil {
  17915. return nil, err
  17916. }
  17917. ret := &BrowsersListResponse{
  17918. ServerResponse: googleapi.ServerResponse{
  17919. Header: res.Header,
  17920. HTTPStatusCode: res.StatusCode,
  17921. },
  17922. }
  17923. target := &ret
  17924. if err := gensupport.DecodeResponse(target, res); err != nil {
  17925. return nil, err
  17926. }
  17927. return ret, nil
  17928. // {
  17929. // "description": "Retrieves a list of browsers.",
  17930. // "httpMethod": "GET",
  17931. // "id": "dfareporting.browsers.list",
  17932. // "parameterOrder": [
  17933. // "profileId"
  17934. // ],
  17935. // "parameters": {
  17936. // "profileId": {
  17937. // "description": "User profile ID associated with this request.",
  17938. // "format": "int64",
  17939. // "location": "path",
  17940. // "required": true,
  17941. // "type": "string"
  17942. // }
  17943. // },
  17944. // "path": "userprofiles/{profileId}/browsers",
  17945. // "response": {
  17946. // "$ref": "BrowsersListResponse"
  17947. // },
  17948. // "scopes": [
  17949. // "https://www.googleapis.com/auth/dfatrafficking"
  17950. // ]
  17951. // }
  17952. }
  17953. // method id "dfareporting.campaignCreativeAssociations.insert":
  17954. type CampaignCreativeAssociationsInsertCall struct {
  17955. s *Service
  17956. profileId int64
  17957. campaignId int64
  17958. campaigncreativeassociation *CampaignCreativeAssociation
  17959. urlParams_ gensupport.URLParams
  17960. ctx_ context.Context
  17961. header_ http.Header
  17962. }
  17963. // Insert: Associates a creative with the specified campaign. This
  17964. // method creates a default ad with dimensions matching the creative in
  17965. // the campaign if such a default ad does not exist already.
  17966. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  17967. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17968. c.profileId = profileId
  17969. c.campaignId = campaignId
  17970. c.campaigncreativeassociation = campaigncreativeassociation
  17971. return c
  17972. }
  17973. // Fields allows partial responses to be retrieved. See
  17974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17975. // for more information.
  17976. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  17977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17978. return c
  17979. }
  17980. // Context sets the context to be used in this call's Do method. Any
  17981. // pending HTTP request will be aborted if the provided context is
  17982. // canceled.
  17983. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  17984. c.ctx_ = ctx
  17985. return c
  17986. }
  17987. // Header returns an http.Header that can be modified by the caller to
  17988. // add HTTP headers to the request.
  17989. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  17990. if c.header_ == nil {
  17991. c.header_ = make(http.Header)
  17992. }
  17993. return c.header_
  17994. }
  17995. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  17996. reqHeaders := make(http.Header)
  17997. for k, v := range c.header_ {
  17998. reqHeaders[k] = v
  17999. }
  18000. reqHeaders.Set("User-Agent", c.s.userAgent())
  18001. var body io.Reader = nil
  18002. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  18003. if err != nil {
  18004. return nil, err
  18005. }
  18006. reqHeaders.Set("Content-Type", "application/json")
  18007. c.urlParams_.Set("alt", alt)
  18008. c.urlParams_.Set("prettyPrint", "false")
  18009. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  18010. urls += "?" + c.urlParams_.Encode()
  18011. req, err := http.NewRequest("POST", urls, body)
  18012. if err != nil {
  18013. return nil, err
  18014. }
  18015. req.Header = reqHeaders
  18016. googleapi.Expand(req.URL, map[string]string{
  18017. "profileId": strconv.FormatInt(c.profileId, 10),
  18018. "campaignId": strconv.FormatInt(c.campaignId, 10),
  18019. })
  18020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18021. }
  18022. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  18023. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  18024. // Any non-2xx status code is an error. Response headers are in either
  18025. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  18026. // was returned at all) in error.(*googleapi.Error).Header. Use
  18027. // googleapi.IsNotModified to check whether the returned error was
  18028. // because http.StatusNotModified was returned.
  18029. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  18030. gensupport.SetOptions(c.urlParams_, opts...)
  18031. res, err := c.doRequest("json")
  18032. if res != nil && res.StatusCode == http.StatusNotModified {
  18033. if res.Body != nil {
  18034. res.Body.Close()
  18035. }
  18036. return nil, &googleapi.Error{
  18037. Code: res.StatusCode,
  18038. Header: res.Header,
  18039. }
  18040. }
  18041. if err != nil {
  18042. return nil, err
  18043. }
  18044. defer googleapi.CloseBody(res)
  18045. if err := googleapi.CheckResponse(res); err != nil {
  18046. return nil, err
  18047. }
  18048. ret := &CampaignCreativeAssociation{
  18049. ServerResponse: googleapi.ServerResponse{
  18050. Header: res.Header,
  18051. HTTPStatusCode: res.StatusCode,
  18052. },
  18053. }
  18054. target := &ret
  18055. if err := gensupport.DecodeResponse(target, res); err != nil {
  18056. return nil, err
  18057. }
  18058. return ret, nil
  18059. // {
  18060. // "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.",
  18061. // "httpMethod": "POST",
  18062. // "id": "dfareporting.campaignCreativeAssociations.insert",
  18063. // "parameterOrder": [
  18064. // "profileId",
  18065. // "campaignId"
  18066. // ],
  18067. // "parameters": {
  18068. // "campaignId": {
  18069. // "description": "Campaign ID in this association.",
  18070. // "format": "int64",
  18071. // "location": "path",
  18072. // "required": true,
  18073. // "type": "string"
  18074. // },
  18075. // "profileId": {
  18076. // "description": "User profile ID associated with this request.",
  18077. // "format": "int64",
  18078. // "location": "path",
  18079. // "required": true,
  18080. // "type": "string"
  18081. // }
  18082. // },
  18083. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18084. // "request": {
  18085. // "$ref": "CampaignCreativeAssociation"
  18086. // },
  18087. // "response": {
  18088. // "$ref": "CampaignCreativeAssociation"
  18089. // },
  18090. // "scopes": [
  18091. // "https://www.googleapis.com/auth/dfatrafficking"
  18092. // ]
  18093. // }
  18094. }
  18095. // method id "dfareporting.campaignCreativeAssociations.list":
  18096. type CampaignCreativeAssociationsListCall struct {
  18097. s *Service
  18098. profileId int64
  18099. campaignId int64
  18100. urlParams_ gensupport.URLParams
  18101. ifNoneMatch_ string
  18102. ctx_ context.Context
  18103. header_ http.Header
  18104. }
  18105. // List: Retrieves the list of creative IDs associated with the
  18106. // specified campaign. This method supports paging.
  18107. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  18108. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18109. c.profileId = profileId
  18110. c.campaignId = campaignId
  18111. return c
  18112. }
  18113. // MaxResults sets the optional parameter "maxResults": Maximum number
  18114. // of results to return.
  18115. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  18116. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18117. return c
  18118. }
  18119. // PageToken sets the optional parameter "pageToken": Value of the
  18120. // nextPageToken from the previous result page.
  18121. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  18122. c.urlParams_.Set("pageToken", pageToken)
  18123. return c
  18124. }
  18125. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18126. // results.
  18127. //
  18128. // Possible values:
  18129. // "ASCENDING" (default)
  18130. // "DESCENDING"
  18131. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  18132. c.urlParams_.Set("sortOrder", sortOrder)
  18133. return c
  18134. }
  18135. // Fields allows partial responses to be retrieved. See
  18136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18137. // for more information.
  18138. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  18139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18140. return c
  18141. }
  18142. // IfNoneMatch sets the optional parameter which makes the operation
  18143. // fail if the object's ETag matches the given value. This is useful for
  18144. // getting updates only after the object has changed since the last
  18145. // request. Use googleapi.IsNotModified to check whether the response
  18146. // error from Do is the result of In-None-Match.
  18147. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  18148. c.ifNoneMatch_ = entityTag
  18149. return c
  18150. }
  18151. // Context sets the context to be used in this call's Do method. Any
  18152. // pending HTTP request will be aborted if the provided context is
  18153. // canceled.
  18154. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  18155. c.ctx_ = ctx
  18156. return c
  18157. }
  18158. // Header returns an http.Header that can be modified by the caller to
  18159. // add HTTP headers to the request.
  18160. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  18161. if c.header_ == nil {
  18162. c.header_ = make(http.Header)
  18163. }
  18164. return c.header_
  18165. }
  18166. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  18167. reqHeaders := make(http.Header)
  18168. for k, v := range c.header_ {
  18169. reqHeaders[k] = v
  18170. }
  18171. reqHeaders.Set("User-Agent", c.s.userAgent())
  18172. if c.ifNoneMatch_ != "" {
  18173. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18174. }
  18175. var body io.Reader = nil
  18176. c.urlParams_.Set("alt", alt)
  18177. c.urlParams_.Set("prettyPrint", "false")
  18178. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  18179. urls += "?" + c.urlParams_.Encode()
  18180. req, err := http.NewRequest("GET", urls, body)
  18181. if err != nil {
  18182. return nil, err
  18183. }
  18184. req.Header = reqHeaders
  18185. googleapi.Expand(req.URL, map[string]string{
  18186. "profileId": strconv.FormatInt(c.profileId, 10),
  18187. "campaignId": strconv.FormatInt(c.campaignId, 10),
  18188. })
  18189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18190. }
  18191. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  18192. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  18193. // will be non-nil. Any non-2xx status code is an error. Response
  18194. // headers are in either
  18195. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  18196. // (if a response was returned at all) in
  18197. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18198. // whether the returned error was because http.StatusNotModified was
  18199. // returned.
  18200. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  18201. gensupport.SetOptions(c.urlParams_, opts...)
  18202. res, err := c.doRequest("json")
  18203. if res != nil && res.StatusCode == http.StatusNotModified {
  18204. if res.Body != nil {
  18205. res.Body.Close()
  18206. }
  18207. return nil, &googleapi.Error{
  18208. Code: res.StatusCode,
  18209. Header: res.Header,
  18210. }
  18211. }
  18212. if err != nil {
  18213. return nil, err
  18214. }
  18215. defer googleapi.CloseBody(res)
  18216. if err := googleapi.CheckResponse(res); err != nil {
  18217. return nil, err
  18218. }
  18219. ret := &CampaignCreativeAssociationsListResponse{
  18220. ServerResponse: googleapi.ServerResponse{
  18221. Header: res.Header,
  18222. HTTPStatusCode: res.StatusCode,
  18223. },
  18224. }
  18225. target := &ret
  18226. if err := gensupport.DecodeResponse(target, res); err != nil {
  18227. return nil, err
  18228. }
  18229. return ret, nil
  18230. // {
  18231. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  18232. // "httpMethod": "GET",
  18233. // "id": "dfareporting.campaignCreativeAssociations.list",
  18234. // "parameterOrder": [
  18235. // "profileId",
  18236. // "campaignId"
  18237. // ],
  18238. // "parameters": {
  18239. // "campaignId": {
  18240. // "description": "Campaign ID in this association.",
  18241. // "format": "int64",
  18242. // "location": "path",
  18243. // "required": true,
  18244. // "type": "string"
  18245. // },
  18246. // "maxResults": {
  18247. // "default": "1000",
  18248. // "description": "Maximum number of results to return.",
  18249. // "format": "int32",
  18250. // "location": "query",
  18251. // "maximum": "1000",
  18252. // "minimum": "0",
  18253. // "type": "integer"
  18254. // },
  18255. // "pageToken": {
  18256. // "description": "Value of the nextPageToken from the previous result page.",
  18257. // "location": "query",
  18258. // "type": "string"
  18259. // },
  18260. // "profileId": {
  18261. // "description": "User profile ID associated with this request.",
  18262. // "format": "int64",
  18263. // "location": "path",
  18264. // "required": true,
  18265. // "type": "string"
  18266. // },
  18267. // "sortOrder": {
  18268. // "default": "ASCENDING",
  18269. // "description": "Order of sorted results.",
  18270. // "enum": [
  18271. // "ASCENDING",
  18272. // "DESCENDING"
  18273. // ],
  18274. // "enumDescriptions": [
  18275. // "",
  18276. // ""
  18277. // ],
  18278. // "location": "query",
  18279. // "type": "string"
  18280. // }
  18281. // },
  18282. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18283. // "response": {
  18284. // "$ref": "CampaignCreativeAssociationsListResponse"
  18285. // },
  18286. // "scopes": [
  18287. // "https://www.googleapis.com/auth/dfatrafficking"
  18288. // ]
  18289. // }
  18290. }
  18291. // Pages invokes f for each page of results.
  18292. // A non-nil error returned from f will halt the iteration.
  18293. // The provided context supersedes any context provided to the Context method.
  18294. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  18295. c.ctx_ = ctx
  18296. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18297. for {
  18298. x, err := c.Do()
  18299. if err != nil {
  18300. return err
  18301. }
  18302. if err := f(x); err != nil {
  18303. return err
  18304. }
  18305. if x.NextPageToken == "" {
  18306. return nil
  18307. }
  18308. c.PageToken(x.NextPageToken)
  18309. }
  18310. }
  18311. // method id "dfareporting.campaigns.get":
  18312. type CampaignsGetCall struct {
  18313. s *Service
  18314. profileId int64
  18315. id int64
  18316. urlParams_ gensupport.URLParams
  18317. ifNoneMatch_ string
  18318. ctx_ context.Context
  18319. header_ http.Header
  18320. }
  18321. // Get: Gets one campaign by ID.
  18322. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  18323. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18324. c.profileId = profileId
  18325. c.id = id
  18326. return c
  18327. }
  18328. // Fields allows partial responses to be retrieved. See
  18329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18330. // for more information.
  18331. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  18332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18333. return c
  18334. }
  18335. // IfNoneMatch sets the optional parameter which makes the operation
  18336. // fail if the object's ETag matches the given value. This is useful for
  18337. // getting updates only after the object has changed since the last
  18338. // request. Use googleapi.IsNotModified to check whether the response
  18339. // error from Do is the result of In-None-Match.
  18340. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  18341. c.ifNoneMatch_ = entityTag
  18342. return c
  18343. }
  18344. // Context sets the context to be used in this call's Do method. Any
  18345. // pending HTTP request will be aborted if the provided context is
  18346. // canceled.
  18347. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  18348. c.ctx_ = ctx
  18349. return c
  18350. }
  18351. // Header returns an http.Header that can be modified by the caller to
  18352. // add HTTP headers to the request.
  18353. func (c *CampaignsGetCall) Header() http.Header {
  18354. if c.header_ == nil {
  18355. c.header_ = make(http.Header)
  18356. }
  18357. return c.header_
  18358. }
  18359. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  18360. reqHeaders := make(http.Header)
  18361. for k, v := range c.header_ {
  18362. reqHeaders[k] = v
  18363. }
  18364. reqHeaders.Set("User-Agent", c.s.userAgent())
  18365. if c.ifNoneMatch_ != "" {
  18366. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18367. }
  18368. var body io.Reader = nil
  18369. c.urlParams_.Set("alt", alt)
  18370. c.urlParams_.Set("prettyPrint", "false")
  18371. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  18372. urls += "?" + c.urlParams_.Encode()
  18373. req, err := http.NewRequest("GET", urls, body)
  18374. if err != nil {
  18375. return nil, err
  18376. }
  18377. req.Header = reqHeaders
  18378. googleapi.Expand(req.URL, map[string]string{
  18379. "profileId": strconv.FormatInt(c.profileId, 10),
  18380. "id": strconv.FormatInt(c.id, 10),
  18381. })
  18382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18383. }
  18384. // Do executes the "dfareporting.campaigns.get" call.
  18385. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18386. // code is an error. Response headers are in either
  18387. // *Campaign.ServerResponse.Header or (if a response was returned at
  18388. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18389. // to check whether the returned error was because
  18390. // http.StatusNotModified was returned.
  18391. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18392. gensupport.SetOptions(c.urlParams_, opts...)
  18393. res, err := c.doRequest("json")
  18394. if res != nil && res.StatusCode == http.StatusNotModified {
  18395. if res.Body != nil {
  18396. res.Body.Close()
  18397. }
  18398. return nil, &googleapi.Error{
  18399. Code: res.StatusCode,
  18400. Header: res.Header,
  18401. }
  18402. }
  18403. if err != nil {
  18404. return nil, err
  18405. }
  18406. defer googleapi.CloseBody(res)
  18407. if err := googleapi.CheckResponse(res); err != nil {
  18408. return nil, err
  18409. }
  18410. ret := &Campaign{
  18411. ServerResponse: googleapi.ServerResponse{
  18412. Header: res.Header,
  18413. HTTPStatusCode: res.StatusCode,
  18414. },
  18415. }
  18416. target := &ret
  18417. if err := gensupport.DecodeResponse(target, res); err != nil {
  18418. return nil, err
  18419. }
  18420. return ret, nil
  18421. // {
  18422. // "description": "Gets one campaign by ID.",
  18423. // "httpMethod": "GET",
  18424. // "id": "dfareporting.campaigns.get",
  18425. // "parameterOrder": [
  18426. // "profileId",
  18427. // "id"
  18428. // ],
  18429. // "parameters": {
  18430. // "id": {
  18431. // "description": "Campaign ID.",
  18432. // "format": "int64",
  18433. // "location": "path",
  18434. // "required": true,
  18435. // "type": "string"
  18436. // },
  18437. // "profileId": {
  18438. // "description": "User profile ID associated with this request.",
  18439. // "format": "int64",
  18440. // "location": "path",
  18441. // "required": true,
  18442. // "type": "string"
  18443. // }
  18444. // },
  18445. // "path": "userprofiles/{profileId}/campaigns/{id}",
  18446. // "response": {
  18447. // "$ref": "Campaign"
  18448. // },
  18449. // "scopes": [
  18450. // "https://www.googleapis.com/auth/dfatrafficking"
  18451. // ]
  18452. // }
  18453. }
  18454. // method id "dfareporting.campaigns.insert":
  18455. type CampaignsInsertCall struct {
  18456. s *Service
  18457. profileId int64
  18458. campaign *Campaign
  18459. urlParams_ gensupport.URLParams
  18460. ctx_ context.Context
  18461. header_ http.Header
  18462. }
  18463. // Insert: Inserts a new campaign.
  18464. func (r *CampaignsService) Insert(profileId int64, campaign *Campaign) *CampaignsInsertCall {
  18465. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18466. c.profileId = profileId
  18467. c.campaign = campaign
  18468. return c
  18469. }
  18470. // Fields allows partial responses to be retrieved. See
  18471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18472. // for more information.
  18473. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  18474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18475. return c
  18476. }
  18477. // Context sets the context to be used in this call's Do method. Any
  18478. // pending HTTP request will be aborted if the provided context is
  18479. // canceled.
  18480. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  18481. c.ctx_ = ctx
  18482. return c
  18483. }
  18484. // Header returns an http.Header that can be modified by the caller to
  18485. // add HTTP headers to the request.
  18486. func (c *CampaignsInsertCall) Header() http.Header {
  18487. if c.header_ == nil {
  18488. c.header_ = make(http.Header)
  18489. }
  18490. return c.header_
  18491. }
  18492. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  18493. reqHeaders := make(http.Header)
  18494. for k, v := range c.header_ {
  18495. reqHeaders[k] = v
  18496. }
  18497. reqHeaders.Set("User-Agent", c.s.userAgent())
  18498. var body io.Reader = nil
  18499. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18500. if err != nil {
  18501. return nil, err
  18502. }
  18503. reqHeaders.Set("Content-Type", "application/json")
  18504. c.urlParams_.Set("alt", alt)
  18505. c.urlParams_.Set("prettyPrint", "false")
  18506. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18507. urls += "?" + c.urlParams_.Encode()
  18508. req, err := http.NewRequest("POST", urls, body)
  18509. if err != nil {
  18510. return nil, err
  18511. }
  18512. req.Header = reqHeaders
  18513. googleapi.Expand(req.URL, map[string]string{
  18514. "profileId": strconv.FormatInt(c.profileId, 10),
  18515. })
  18516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18517. }
  18518. // Do executes the "dfareporting.campaigns.insert" call.
  18519. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18520. // code is an error. Response headers are in either
  18521. // *Campaign.ServerResponse.Header or (if a response was returned at
  18522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18523. // to check whether the returned error was because
  18524. // http.StatusNotModified was returned.
  18525. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18526. gensupport.SetOptions(c.urlParams_, opts...)
  18527. res, err := c.doRequest("json")
  18528. if res != nil && res.StatusCode == http.StatusNotModified {
  18529. if res.Body != nil {
  18530. res.Body.Close()
  18531. }
  18532. return nil, &googleapi.Error{
  18533. Code: res.StatusCode,
  18534. Header: res.Header,
  18535. }
  18536. }
  18537. if err != nil {
  18538. return nil, err
  18539. }
  18540. defer googleapi.CloseBody(res)
  18541. if err := googleapi.CheckResponse(res); err != nil {
  18542. return nil, err
  18543. }
  18544. ret := &Campaign{
  18545. ServerResponse: googleapi.ServerResponse{
  18546. Header: res.Header,
  18547. HTTPStatusCode: res.StatusCode,
  18548. },
  18549. }
  18550. target := &ret
  18551. if err := gensupport.DecodeResponse(target, res); err != nil {
  18552. return nil, err
  18553. }
  18554. return ret, nil
  18555. // {
  18556. // "description": "Inserts a new campaign.",
  18557. // "httpMethod": "POST",
  18558. // "id": "dfareporting.campaigns.insert",
  18559. // "parameterOrder": [
  18560. // "profileId"
  18561. // ],
  18562. // "parameters": {
  18563. // "profileId": {
  18564. // "description": "User profile ID associated with this request.",
  18565. // "format": "int64",
  18566. // "location": "path",
  18567. // "required": true,
  18568. // "type": "string"
  18569. // }
  18570. // },
  18571. // "path": "userprofiles/{profileId}/campaigns",
  18572. // "request": {
  18573. // "$ref": "Campaign"
  18574. // },
  18575. // "response": {
  18576. // "$ref": "Campaign"
  18577. // },
  18578. // "scopes": [
  18579. // "https://www.googleapis.com/auth/dfatrafficking"
  18580. // ]
  18581. // }
  18582. }
  18583. // method id "dfareporting.campaigns.list":
  18584. type CampaignsListCall struct {
  18585. s *Service
  18586. profileId int64
  18587. urlParams_ gensupport.URLParams
  18588. ifNoneMatch_ string
  18589. ctx_ context.Context
  18590. header_ http.Header
  18591. }
  18592. // List: Retrieves a list of campaigns, possibly filtered. This method
  18593. // supports paging.
  18594. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  18595. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18596. c.profileId = profileId
  18597. return c
  18598. }
  18599. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  18600. // Select only campaigns whose advertisers belong to these advertiser
  18601. // groups.
  18602. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  18603. var advertiserGroupIds_ []string
  18604. for _, v := range advertiserGroupIds {
  18605. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  18606. }
  18607. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  18608. return c
  18609. }
  18610. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  18611. // only campaigns that belong to these advertisers.
  18612. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  18613. var advertiserIds_ []string
  18614. for _, v := range advertiserIds {
  18615. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  18616. }
  18617. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  18618. return c
  18619. }
  18620. // Archived sets the optional parameter "archived": Select only archived
  18621. // campaigns. Don't set this field to select both archived and
  18622. // non-archived campaigns.
  18623. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  18624. c.urlParams_.Set("archived", fmt.Sprint(archived))
  18625. return c
  18626. }
  18627. // AtLeastOneOptimizationActivity sets the optional parameter
  18628. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  18629. // least one optimization activity.
  18630. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  18631. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  18632. return c
  18633. }
  18634. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  18635. // campaigns with these IDs.
  18636. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  18637. var excludedIds_ []string
  18638. for _, v := range excludedIds {
  18639. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  18640. }
  18641. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  18642. return c
  18643. }
  18644. // Ids sets the optional parameter "ids": Select only campaigns with
  18645. // these IDs.
  18646. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  18647. var ids_ []string
  18648. for _, v := range ids {
  18649. ids_ = append(ids_, fmt.Sprint(v))
  18650. }
  18651. c.urlParams_.SetMulti("ids", ids_)
  18652. return c
  18653. }
  18654. // MaxResults sets the optional parameter "maxResults": Maximum number
  18655. // of results to return.
  18656. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  18657. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18658. return c
  18659. }
  18660. // OverriddenEventTagId sets the optional parameter
  18661. // "overriddenEventTagId": Select only campaigns that have overridden
  18662. // this event tag ID.
  18663. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  18664. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  18665. return c
  18666. }
  18667. // PageToken sets the optional parameter "pageToken": Value of the
  18668. // nextPageToken from the previous result page.
  18669. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  18670. c.urlParams_.Set("pageToken", pageToken)
  18671. return c
  18672. }
  18673. // SearchString sets the optional parameter "searchString": Allows
  18674. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  18675. // example, "campaign*2015" will return campaigns with names like
  18676. // "campaign June 2015", "campaign April 2015", or simply "campaign
  18677. // 2015". Most of the searches also add wildcards implicitly at the
  18678. // start and the end of the search string. For example, a search string
  18679. // of "campaign" will match campaigns with name "my campaign", "campaign
  18680. // 2015", or simply "campaign".
  18681. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  18682. c.urlParams_.Set("searchString", searchString)
  18683. return c
  18684. }
  18685. // SortField sets the optional parameter "sortField": Field by which to
  18686. // sort the list.
  18687. //
  18688. // Possible values:
  18689. // "ID" (default)
  18690. // "NAME"
  18691. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  18692. c.urlParams_.Set("sortField", sortField)
  18693. return c
  18694. }
  18695. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18696. // results.
  18697. //
  18698. // Possible values:
  18699. // "ASCENDING" (default)
  18700. // "DESCENDING"
  18701. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  18702. c.urlParams_.Set("sortOrder", sortOrder)
  18703. return c
  18704. }
  18705. // SubaccountId sets the optional parameter "subaccountId": Select only
  18706. // campaigns that belong to this subaccount.
  18707. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  18708. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  18709. return c
  18710. }
  18711. // Fields allows partial responses to be retrieved. See
  18712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18713. // for more information.
  18714. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  18715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18716. return c
  18717. }
  18718. // IfNoneMatch sets the optional parameter which makes the operation
  18719. // fail if the object's ETag matches the given value. This is useful for
  18720. // getting updates only after the object has changed since the last
  18721. // request. Use googleapi.IsNotModified to check whether the response
  18722. // error from Do is the result of In-None-Match.
  18723. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  18724. c.ifNoneMatch_ = entityTag
  18725. return c
  18726. }
  18727. // Context sets the context to be used in this call's Do method. Any
  18728. // pending HTTP request will be aborted if the provided context is
  18729. // canceled.
  18730. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  18731. c.ctx_ = ctx
  18732. return c
  18733. }
  18734. // Header returns an http.Header that can be modified by the caller to
  18735. // add HTTP headers to the request.
  18736. func (c *CampaignsListCall) Header() http.Header {
  18737. if c.header_ == nil {
  18738. c.header_ = make(http.Header)
  18739. }
  18740. return c.header_
  18741. }
  18742. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  18743. reqHeaders := make(http.Header)
  18744. for k, v := range c.header_ {
  18745. reqHeaders[k] = v
  18746. }
  18747. reqHeaders.Set("User-Agent", c.s.userAgent())
  18748. if c.ifNoneMatch_ != "" {
  18749. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18750. }
  18751. var body io.Reader = nil
  18752. c.urlParams_.Set("alt", alt)
  18753. c.urlParams_.Set("prettyPrint", "false")
  18754. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18755. urls += "?" + c.urlParams_.Encode()
  18756. req, err := http.NewRequest("GET", urls, body)
  18757. if err != nil {
  18758. return nil, err
  18759. }
  18760. req.Header = reqHeaders
  18761. googleapi.Expand(req.URL, map[string]string{
  18762. "profileId": strconv.FormatInt(c.profileId, 10),
  18763. })
  18764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18765. }
  18766. // Do executes the "dfareporting.campaigns.list" call.
  18767. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  18768. // non-2xx status code is an error. Response headers are in either
  18769. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  18770. // returned at all) in error.(*googleapi.Error).Header. Use
  18771. // googleapi.IsNotModified to check whether the returned error was
  18772. // because http.StatusNotModified was returned.
  18773. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  18774. gensupport.SetOptions(c.urlParams_, opts...)
  18775. res, err := c.doRequest("json")
  18776. if res != nil && res.StatusCode == http.StatusNotModified {
  18777. if res.Body != nil {
  18778. res.Body.Close()
  18779. }
  18780. return nil, &googleapi.Error{
  18781. Code: res.StatusCode,
  18782. Header: res.Header,
  18783. }
  18784. }
  18785. if err != nil {
  18786. return nil, err
  18787. }
  18788. defer googleapi.CloseBody(res)
  18789. if err := googleapi.CheckResponse(res); err != nil {
  18790. return nil, err
  18791. }
  18792. ret := &CampaignsListResponse{
  18793. ServerResponse: googleapi.ServerResponse{
  18794. Header: res.Header,
  18795. HTTPStatusCode: res.StatusCode,
  18796. },
  18797. }
  18798. target := &ret
  18799. if err := gensupport.DecodeResponse(target, res); err != nil {
  18800. return nil, err
  18801. }
  18802. return ret, nil
  18803. // {
  18804. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  18805. // "httpMethod": "GET",
  18806. // "id": "dfareporting.campaigns.list",
  18807. // "parameterOrder": [
  18808. // "profileId"
  18809. // ],
  18810. // "parameters": {
  18811. // "advertiserGroupIds": {
  18812. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  18813. // "format": "int64",
  18814. // "location": "query",
  18815. // "repeated": true,
  18816. // "type": "string"
  18817. // },
  18818. // "advertiserIds": {
  18819. // "description": "Select only campaigns that belong to these advertisers.",
  18820. // "format": "int64",
  18821. // "location": "query",
  18822. // "repeated": true,
  18823. // "type": "string"
  18824. // },
  18825. // "archived": {
  18826. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  18827. // "location": "query",
  18828. // "type": "boolean"
  18829. // },
  18830. // "atLeastOneOptimizationActivity": {
  18831. // "description": "Select only campaigns that have at least one optimization activity.",
  18832. // "location": "query",
  18833. // "type": "boolean"
  18834. // },
  18835. // "excludedIds": {
  18836. // "description": "Exclude campaigns with these IDs.",
  18837. // "format": "int64",
  18838. // "location": "query",
  18839. // "repeated": true,
  18840. // "type": "string"
  18841. // },
  18842. // "ids": {
  18843. // "description": "Select only campaigns with these IDs.",
  18844. // "format": "int64",
  18845. // "location": "query",
  18846. // "repeated": true,
  18847. // "type": "string"
  18848. // },
  18849. // "maxResults": {
  18850. // "default": "1000",
  18851. // "description": "Maximum number of results to return.",
  18852. // "format": "int32",
  18853. // "location": "query",
  18854. // "maximum": "1000",
  18855. // "minimum": "0",
  18856. // "type": "integer"
  18857. // },
  18858. // "overriddenEventTagId": {
  18859. // "description": "Select only campaigns that have overridden this event tag ID.",
  18860. // "format": "int64",
  18861. // "location": "query",
  18862. // "type": "string"
  18863. // },
  18864. // "pageToken": {
  18865. // "description": "Value of the nextPageToken from the previous result page.",
  18866. // "location": "query",
  18867. // "type": "string"
  18868. // },
  18869. // "profileId": {
  18870. // "description": "User profile ID associated with this request.",
  18871. // "format": "int64",
  18872. // "location": "path",
  18873. // "required": true,
  18874. // "type": "string"
  18875. // },
  18876. // "searchString": {
  18877. // "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\".",
  18878. // "location": "query",
  18879. // "type": "string"
  18880. // },
  18881. // "sortField": {
  18882. // "default": "ID",
  18883. // "description": "Field by which to sort the list.",
  18884. // "enum": [
  18885. // "ID",
  18886. // "NAME"
  18887. // ],
  18888. // "enumDescriptions": [
  18889. // "",
  18890. // ""
  18891. // ],
  18892. // "location": "query",
  18893. // "type": "string"
  18894. // },
  18895. // "sortOrder": {
  18896. // "default": "ASCENDING",
  18897. // "description": "Order of sorted results.",
  18898. // "enum": [
  18899. // "ASCENDING",
  18900. // "DESCENDING"
  18901. // ],
  18902. // "enumDescriptions": [
  18903. // "",
  18904. // ""
  18905. // ],
  18906. // "location": "query",
  18907. // "type": "string"
  18908. // },
  18909. // "subaccountId": {
  18910. // "description": "Select only campaigns that belong to this subaccount.",
  18911. // "format": "int64",
  18912. // "location": "query",
  18913. // "type": "string"
  18914. // }
  18915. // },
  18916. // "path": "userprofiles/{profileId}/campaigns",
  18917. // "response": {
  18918. // "$ref": "CampaignsListResponse"
  18919. // },
  18920. // "scopes": [
  18921. // "https://www.googleapis.com/auth/dfatrafficking"
  18922. // ]
  18923. // }
  18924. }
  18925. // Pages invokes f for each page of results.
  18926. // A non-nil error returned from f will halt the iteration.
  18927. // The provided context supersedes any context provided to the Context method.
  18928. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  18929. c.ctx_ = ctx
  18930. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18931. for {
  18932. x, err := c.Do()
  18933. if err != nil {
  18934. return err
  18935. }
  18936. if err := f(x); err != nil {
  18937. return err
  18938. }
  18939. if x.NextPageToken == "" {
  18940. return nil
  18941. }
  18942. c.PageToken(x.NextPageToken)
  18943. }
  18944. }
  18945. // method id "dfareporting.campaigns.patch":
  18946. type CampaignsPatchCall struct {
  18947. s *Service
  18948. profileId int64
  18949. campaign *Campaign
  18950. urlParams_ gensupport.URLParams
  18951. ctx_ context.Context
  18952. header_ http.Header
  18953. }
  18954. // Patch: Updates an existing campaign. This method supports patch
  18955. // semantics.
  18956. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  18957. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18958. c.profileId = profileId
  18959. c.urlParams_.Set("id", fmt.Sprint(id))
  18960. c.campaign = campaign
  18961. return c
  18962. }
  18963. // Fields allows partial responses to be retrieved. See
  18964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18965. // for more information.
  18966. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  18967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18968. return c
  18969. }
  18970. // Context sets the context to be used in this call's Do method. Any
  18971. // pending HTTP request will be aborted if the provided context is
  18972. // canceled.
  18973. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  18974. c.ctx_ = ctx
  18975. return c
  18976. }
  18977. // Header returns an http.Header that can be modified by the caller to
  18978. // add HTTP headers to the request.
  18979. func (c *CampaignsPatchCall) Header() http.Header {
  18980. if c.header_ == nil {
  18981. c.header_ = make(http.Header)
  18982. }
  18983. return c.header_
  18984. }
  18985. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  18986. reqHeaders := make(http.Header)
  18987. for k, v := range c.header_ {
  18988. reqHeaders[k] = v
  18989. }
  18990. reqHeaders.Set("User-Agent", c.s.userAgent())
  18991. var body io.Reader = nil
  18992. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18993. if err != nil {
  18994. return nil, err
  18995. }
  18996. reqHeaders.Set("Content-Type", "application/json")
  18997. c.urlParams_.Set("alt", alt)
  18998. c.urlParams_.Set("prettyPrint", "false")
  18999. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  19000. urls += "?" + c.urlParams_.Encode()
  19001. req, err := http.NewRequest("PATCH", urls, body)
  19002. if err != nil {
  19003. return nil, err
  19004. }
  19005. req.Header = reqHeaders
  19006. googleapi.Expand(req.URL, map[string]string{
  19007. "profileId": strconv.FormatInt(c.profileId, 10),
  19008. })
  19009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19010. }
  19011. // Do executes the "dfareporting.campaigns.patch" call.
  19012. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  19013. // code is an error. Response headers are in either
  19014. // *Campaign.ServerResponse.Header or (if a response was returned at
  19015. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19016. // to check whether the returned error was because
  19017. // http.StatusNotModified was returned.
  19018. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  19019. gensupport.SetOptions(c.urlParams_, opts...)
  19020. res, err := c.doRequest("json")
  19021. if res != nil && res.StatusCode == http.StatusNotModified {
  19022. if res.Body != nil {
  19023. res.Body.Close()
  19024. }
  19025. return nil, &googleapi.Error{
  19026. Code: res.StatusCode,
  19027. Header: res.Header,
  19028. }
  19029. }
  19030. if err != nil {
  19031. return nil, err
  19032. }
  19033. defer googleapi.CloseBody(res)
  19034. if err := googleapi.CheckResponse(res); err != nil {
  19035. return nil, err
  19036. }
  19037. ret := &Campaign{
  19038. ServerResponse: googleapi.ServerResponse{
  19039. Header: res.Header,
  19040. HTTPStatusCode: res.StatusCode,
  19041. },
  19042. }
  19043. target := &ret
  19044. if err := gensupport.DecodeResponse(target, res); err != nil {
  19045. return nil, err
  19046. }
  19047. return ret, nil
  19048. // {
  19049. // "description": "Updates an existing campaign. This method supports patch semantics.",
  19050. // "httpMethod": "PATCH",
  19051. // "id": "dfareporting.campaigns.patch",
  19052. // "parameterOrder": [
  19053. // "profileId",
  19054. // "id"
  19055. // ],
  19056. // "parameters": {
  19057. // "id": {
  19058. // "description": "Campaign ID.",
  19059. // "format": "int64",
  19060. // "location": "query",
  19061. // "required": true,
  19062. // "type": "string"
  19063. // },
  19064. // "profileId": {
  19065. // "description": "User profile ID associated with this request.",
  19066. // "format": "int64",
  19067. // "location": "path",
  19068. // "required": true,
  19069. // "type": "string"
  19070. // }
  19071. // },
  19072. // "path": "userprofiles/{profileId}/campaigns",
  19073. // "request": {
  19074. // "$ref": "Campaign"
  19075. // },
  19076. // "response": {
  19077. // "$ref": "Campaign"
  19078. // },
  19079. // "scopes": [
  19080. // "https://www.googleapis.com/auth/dfatrafficking"
  19081. // ]
  19082. // }
  19083. }
  19084. // method id "dfareporting.campaigns.update":
  19085. type CampaignsUpdateCall struct {
  19086. s *Service
  19087. profileId int64
  19088. campaign *Campaign
  19089. urlParams_ gensupport.URLParams
  19090. ctx_ context.Context
  19091. header_ http.Header
  19092. }
  19093. // Update: Updates an existing campaign.
  19094. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  19095. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19096. c.profileId = profileId
  19097. c.campaign = campaign
  19098. return c
  19099. }
  19100. // Fields allows partial responses to be retrieved. See
  19101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19102. // for more information.
  19103. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  19104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19105. return c
  19106. }
  19107. // Context sets the context to be used in this call's Do method. Any
  19108. // pending HTTP request will be aborted if the provided context is
  19109. // canceled.
  19110. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  19111. c.ctx_ = ctx
  19112. return c
  19113. }
  19114. // Header returns an http.Header that can be modified by the caller to
  19115. // add HTTP headers to the request.
  19116. func (c *CampaignsUpdateCall) Header() http.Header {
  19117. if c.header_ == nil {
  19118. c.header_ = make(http.Header)
  19119. }
  19120. return c.header_
  19121. }
  19122. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  19123. reqHeaders := make(http.Header)
  19124. for k, v := range c.header_ {
  19125. reqHeaders[k] = v
  19126. }
  19127. reqHeaders.Set("User-Agent", c.s.userAgent())
  19128. var body io.Reader = nil
  19129. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  19130. if err != nil {
  19131. return nil, err
  19132. }
  19133. reqHeaders.Set("Content-Type", "application/json")
  19134. c.urlParams_.Set("alt", alt)
  19135. c.urlParams_.Set("prettyPrint", "false")
  19136. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  19137. urls += "?" + c.urlParams_.Encode()
  19138. req, err := http.NewRequest("PUT", urls, body)
  19139. if err != nil {
  19140. return nil, err
  19141. }
  19142. req.Header = reqHeaders
  19143. googleapi.Expand(req.URL, map[string]string{
  19144. "profileId": strconv.FormatInt(c.profileId, 10),
  19145. })
  19146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19147. }
  19148. // Do executes the "dfareporting.campaigns.update" call.
  19149. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  19150. // code is an error. Response headers are in either
  19151. // *Campaign.ServerResponse.Header or (if a response was returned at
  19152. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19153. // to check whether the returned error was because
  19154. // http.StatusNotModified was returned.
  19155. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  19156. gensupport.SetOptions(c.urlParams_, opts...)
  19157. res, err := c.doRequest("json")
  19158. if res != nil && res.StatusCode == http.StatusNotModified {
  19159. if res.Body != nil {
  19160. res.Body.Close()
  19161. }
  19162. return nil, &googleapi.Error{
  19163. Code: res.StatusCode,
  19164. Header: res.Header,
  19165. }
  19166. }
  19167. if err != nil {
  19168. return nil, err
  19169. }
  19170. defer googleapi.CloseBody(res)
  19171. if err := googleapi.CheckResponse(res); err != nil {
  19172. return nil, err
  19173. }
  19174. ret := &Campaign{
  19175. ServerResponse: googleapi.ServerResponse{
  19176. Header: res.Header,
  19177. HTTPStatusCode: res.StatusCode,
  19178. },
  19179. }
  19180. target := &ret
  19181. if err := gensupport.DecodeResponse(target, res); err != nil {
  19182. return nil, err
  19183. }
  19184. return ret, nil
  19185. // {
  19186. // "description": "Updates an existing campaign.",
  19187. // "httpMethod": "PUT",
  19188. // "id": "dfareporting.campaigns.update",
  19189. // "parameterOrder": [
  19190. // "profileId"
  19191. // ],
  19192. // "parameters": {
  19193. // "profileId": {
  19194. // "description": "User profile ID associated with this request.",
  19195. // "format": "int64",
  19196. // "location": "path",
  19197. // "required": true,
  19198. // "type": "string"
  19199. // }
  19200. // },
  19201. // "path": "userprofiles/{profileId}/campaigns",
  19202. // "request": {
  19203. // "$ref": "Campaign"
  19204. // },
  19205. // "response": {
  19206. // "$ref": "Campaign"
  19207. // },
  19208. // "scopes": [
  19209. // "https://www.googleapis.com/auth/dfatrafficking"
  19210. // ]
  19211. // }
  19212. }
  19213. // method id "dfareporting.changeLogs.get":
  19214. type ChangeLogsGetCall struct {
  19215. s *Service
  19216. profileId int64
  19217. id int64
  19218. urlParams_ gensupport.URLParams
  19219. ifNoneMatch_ string
  19220. ctx_ context.Context
  19221. header_ http.Header
  19222. }
  19223. // Get: Gets one change log by ID.
  19224. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  19225. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19226. c.profileId = profileId
  19227. c.id = id
  19228. return c
  19229. }
  19230. // Fields allows partial responses to be retrieved. See
  19231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19232. // for more information.
  19233. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  19234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19235. return c
  19236. }
  19237. // IfNoneMatch sets the optional parameter which makes the operation
  19238. // fail if the object's ETag matches the given value. This is useful for
  19239. // getting updates only after the object has changed since the last
  19240. // request. Use googleapi.IsNotModified to check whether the response
  19241. // error from Do is the result of In-None-Match.
  19242. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  19243. c.ifNoneMatch_ = entityTag
  19244. return c
  19245. }
  19246. // Context sets the context to be used in this call's Do method. Any
  19247. // pending HTTP request will be aborted if the provided context is
  19248. // canceled.
  19249. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  19250. c.ctx_ = ctx
  19251. return c
  19252. }
  19253. // Header returns an http.Header that can be modified by the caller to
  19254. // add HTTP headers to the request.
  19255. func (c *ChangeLogsGetCall) Header() http.Header {
  19256. if c.header_ == nil {
  19257. c.header_ = make(http.Header)
  19258. }
  19259. return c.header_
  19260. }
  19261. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  19262. reqHeaders := make(http.Header)
  19263. for k, v := range c.header_ {
  19264. reqHeaders[k] = v
  19265. }
  19266. reqHeaders.Set("User-Agent", c.s.userAgent())
  19267. if c.ifNoneMatch_ != "" {
  19268. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19269. }
  19270. var body io.Reader = nil
  19271. c.urlParams_.Set("alt", alt)
  19272. c.urlParams_.Set("prettyPrint", "false")
  19273. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  19274. urls += "?" + c.urlParams_.Encode()
  19275. req, err := http.NewRequest("GET", urls, body)
  19276. if err != nil {
  19277. return nil, err
  19278. }
  19279. req.Header = reqHeaders
  19280. googleapi.Expand(req.URL, map[string]string{
  19281. "profileId": strconv.FormatInt(c.profileId, 10),
  19282. "id": strconv.FormatInt(c.id, 10),
  19283. })
  19284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19285. }
  19286. // Do executes the "dfareporting.changeLogs.get" call.
  19287. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  19288. // status code is an error. Response headers are in either
  19289. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  19290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19291. // to check whether the returned error was because
  19292. // http.StatusNotModified was returned.
  19293. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  19294. gensupport.SetOptions(c.urlParams_, opts...)
  19295. res, err := c.doRequest("json")
  19296. if res != nil && res.StatusCode == http.StatusNotModified {
  19297. if res.Body != nil {
  19298. res.Body.Close()
  19299. }
  19300. return nil, &googleapi.Error{
  19301. Code: res.StatusCode,
  19302. Header: res.Header,
  19303. }
  19304. }
  19305. if err != nil {
  19306. return nil, err
  19307. }
  19308. defer googleapi.CloseBody(res)
  19309. if err := googleapi.CheckResponse(res); err != nil {
  19310. return nil, err
  19311. }
  19312. ret := &ChangeLog{
  19313. ServerResponse: googleapi.ServerResponse{
  19314. Header: res.Header,
  19315. HTTPStatusCode: res.StatusCode,
  19316. },
  19317. }
  19318. target := &ret
  19319. if err := gensupport.DecodeResponse(target, res); err != nil {
  19320. return nil, err
  19321. }
  19322. return ret, nil
  19323. // {
  19324. // "description": "Gets one change log by ID.",
  19325. // "httpMethod": "GET",
  19326. // "id": "dfareporting.changeLogs.get",
  19327. // "parameterOrder": [
  19328. // "profileId",
  19329. // "id"
  19330. // ],
  19331. // "parameters": {
  19332. // "id": {
  19333. // "description": "Change log ID.",
  19334. // "format": "int64",
  19335. // "location": "path",
  19336. // "required": true,
  19337. // "type": "string"
  19338. // },
  19339. // "profileId": {
  19340. // "description": "User profile ID associated with this request.",
  19341. // "format": "int64",
  19342. // "location": "path",
  19343. // "required": true,
  19344. // "type": "string"
  19345. // }
  19346. // },
  19347. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  19348. // "response": {
  19349. // "$ref": "ChangeLog"
  19350. // },
  19351. // "scopes": [
  19352. // "https://www.googleapis.com/auth/dfatrafficking"
  19353. // ]
  19354. // }
  19355. }
  19356. // method id "dfareporting.changeLogs.list":
  19357. type ChangeLogsListCall struct {
  19358. s *Service
  19359. profileId int64
  19360. urlParams_ gensupport.URLParams
  19361. ifNoneMatch_ string
  19362. ctx_ context.Context
  19363. header_ http.Header
  19364. }
  19365. // List: Retrieves a list of change logs. This method supports paging.
  19366. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  19367. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19368. c.profileId = profileId
  19369. return c
  19370. }
  19371. // Action sets the optional parameter "action": Select only change logs
  19372. // with the specified action.
  19373. //
  19374. // Possible values:
  19375. // "ACTION_ADD"
  19376. // "ACTION_ASSIGN"
  19377. // "ACTION_ASSOCIATE"
  19378. // "ACTION_CREATE"
  19379. // "ACTION_DELETE"
  19380. // "ACTION_DISABLE"
  19381. // "ACTION_EMAIL_TAGS"
  19382. // "ACTION_ENABLE"
  19383. // "ACTION_LINK"
  19384. // "ACTION_MARK_AS_DEFAULT"
  19385. // "ACTION_PUSH"
  19386. // "ACTION_REMOVE"
  19387. // "ACTION_SEND"
  19388. // "ACTION_SHARE"
  19389. // "ACTION_UNASSIGN"
  19390. // "ACTION_UNLINK"
  19391. // "ACTION_UPDATE"
  19392. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  19393. c.urlParams_.Set("action", action)
  19394. return c
  19395. }
  19396. // Ids sets the optional parameter "ids": Select only change logs with
  19397. // these IDs.
  19398. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  19399. var ids_ []string
  19400. for _, v := range ids {
  19401. ids_ = append(ids_, fmt.Sprint(v))
  19402. }
  19403. c.urlParams_.SetMulti("ids", ids_)
  19404. return c
  19405. }
  19406. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  19407. // only change logs whose change time is before the specified
  19408. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  19409. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19410. // America/New York time zone, the format is
  19411. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19412. // the letter T, the hour (24-hour clock system), minute, second, and
  19413. // then the time zone offset.
  19414. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  19415. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  19416. return c
  19417. }
  19418. // MaxResults sets the optional parameter "maxResults": Maximum number
  19419. // of results to return.
  19420. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  19421. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19422. return c
  19423. }
  19424. // MinChangeTime sets the optional parameter "minChangeTime": Select
  19425. // only change logs whose change time is before the specified
  19426. // minChangeTime.The time should be formatted as an RFC3339 date/time
  19427. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19428. // America/New York time zone, the format is
  19429. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19430. // the letter T, the hour (24-hour clock system), minute, second, and
  19431. // then the time zone offset.
  19432. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  19433. c.urlParams_.Set("minChangeTime", minChangeTime)
  19434. return c
  19435. }
  19436. // ObjectIds sets the optional parameter "objectIds": Select only change
  19437. // logs with these object IDs.
  19438. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  19439. var objectIds_ []string
  19440. for _, v := range objectIds {
  19441. objectIds_ = append(objectIds_, fmt.Sprint(v))
  19442. }
  19443. c.urlParams_.SetMulti("objectIds", objectIds_)
  19444. return c
  19445. }
  19446. // ObjectType sets the optional parameter "objectType": Select only
  19447. // change logs with the specified object type.
  19448. //
  19449. // Possible values:
  19450. // "OBJECT_ACCOUNT"
  19451. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  19452. // "OBJECT_AD"
  19453. // "OBJECT_ADVERTISER"
  19454. // "OBJECT_ADVERTISER_GROUP"
  19455. // "OBJECT_BILLING_ACCOUNT_GROUP"
  19456. // "OBJECT_BILLING_FEATURE"
  19457. // "OBJECT_BILLING_MINIMUM_FEE"
  19458. // "OBJECT_BILLING_PROFILE"
  19459. // "OBJECT_CAMPAIGN"
  19460. // "OBJECT_CONTENT_CATEGORY"
  19461. // "OBJECT_CREATIVE"
  19462. // "OBJECT_CREATIVE_ASSET"
  19463. // "OBJECT_CREATIVE_BUNDLE"
  19464. // "OBJECT_CREATIVE_FIELD"
  19465. // "OBJECT_CREATIVE_GROUP"
  19466. // "OBJECT_DFA_SITE"
  19467. // "OBJECT_EVENT_TAG"
  19468. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  19469. // "OBJECT_FLOODLIGHT_ACTVITY"
  19470. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  19471. // "OBJECT_INSTREAM_CREATIVE"
  19472. // "OBJECT_LANDING_PAGE"
  19473. // "OBJECT_MEDIA_ORDER"
  19474. // "OBJECT_PLACEMENT"
  19475. // "OBJECT_PLACEMENT_STRATEGY"
  19476. // "OBJECT_PLAYSTORE_LINK"
  19477. // "OBJECT_PROVIDED_LIST_CLIENT"
  19478. // "OBJECT_RATE_CARD"
  19479. // "OBJECT_REMARKETING_LIST"
  19480. // "OBJECT_RICHMEDIA_CREATIVE"
  19481. // "OBJECT_SD_SITE"
  19482. // "OBJECT_SEARCH_LIFT_STUDY"
  19483. // "OBJECT_SIZE"
  19484. // "OBJECT_SUBACCOUNT"
  19485. // "OBJECT_TARGETING_TEMPLATE"
  19486. // "OBJECT_USER_PROFILE"
  19487. // "OBJECT_USER_PROFILE_FILTER"
  19488. // "OBJECT_USER_ROLE"
  19489. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  19490. c.urlParams_.Set("objectType", objectType)
  19491. return c
  19492. }
  19493. // PageToken sets the optional parameter "pageToken": Value of the
  19494. // nextPageToken from the previous result page.
  19495. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  19496. c.urlParams_.Set("pageToken", pageToken)
  19497. return c
  19498. }
  19499. // SearchString sets the optional parameter "searchString": Select only
  19500. // change logs whose object ID, user name, old or new values match the
  19501. // search string.
  19502. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  19503. c.urlParams_.Set("searchString", searchString)
  19504. return c
  19505. }
  19506. // UserProfileIds sets the optional parameter "userProfileIds": Select
  19507. // only change logs with these user profile IDs.
  19508. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  19509. var userProfileIds_ []string
  19510. for _, v := range userProfileIds {
  19511. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  19512. }
  19513. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  19514. return c
  19515. }
  19516. // Fields allows partial responses to be retrieved. See
  19517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19518. // for more information.
  19519. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  19520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19521. return c
  19522. }
  19523. // IfNoneMatch sets the optional parameter which makes the operation
  19524. // fail if the object's ETag matches the given value. This is useful for
  19525. // getting updates only after the object has changed since the last
  19526. // request. Use googleapi.IsNotModified to check whether the response
  19527. // error from Do is the result of In-None-Match.
  19528. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  19529. c.ifNoneMatch_ = entityTag
  19530. return c
  19531. }
  19532. // Context sets the context to be used in this call's Do method. Any
  19533. // pending HTTP request will be aborted if the provided context is
  19534. // canceled.
  19535. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  19536. c.ctx_ = ctx
  19537. return c
  19538. }
  19539. // Header returns an http.Header that can be modified by the caller to
  19540. // add HTTP headers to the request.
  19541. func (c *ChangeLogsListCall) Header() http.Header {
  19542. if c.header_ == nil {
  19543. c.header_ = make(http.Header)
  19544. }
  19545. return c.header_
  19546. }
  19547. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  19548. reqHeaders := make(http.Header)
  19549. for k, v := range c.header_ {
  19550. reqHeaders[k] = v
  19551. }
  19552. reqHeaders.Set("User-Agent", c.s.userAgent())
  19553. if c.ifNoneMatch_ != "" {
  19554. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19555. }
  19556. var body io.Reader = nil
  19557. c.urlParams_.Set("alt", alt)
  19558. c.urlParams_.Set("prettyPrint", "false")
  19559. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  19560. urls += "?" + c.urlParams_.Encode()
  19561. req, err := http.NewRequest("GET", urls, body)
  19562. if err != nil {
  19563. return nil, err
  19564. }
  19565. req.Header = reqHeaders
  19566. googleapi.Expand(req.URL, map[string]string{
  19567. "profileId": strconv.FormatInt(c.profileId, 10),
  19568. })
  19569. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19570. }
  19571. // Do executes the "dfareporting.changeLogs.list" call.
  19572. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  19573. // non-2xx status code is an error. Response headers are in either
  19574. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  19575. // returned at all) in error.(*googleapi.Error).Header. Use
  19576. // googleapi.IsNotModified to check whether the returned error was
  19577. // because http.StatusNotModified was returned.
  19578. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  19579. gensupport.SetOptions(c.urlParams_, opts...)
  19580. res, err := c.doRequest("json")
  19581. if res != nil && res.StatusCode == http.StatusNotModified {
  19582. if res.Body != nil {
  19583. res.Body.Close()
  19584. }
  19585. return nil, &googleapi.Error{
  19586. Code: res.StatusCode,
  19587. Header: res.Header,
  19588. }
  19589. }
  19590. if err != nil {
  19591. return nil, err
  19592. }
  19593. defer googleapi.CloseBody(res)
  19594. if err := googleapi.CheckResponse(res); err != nil {
  19595. return nil, err
  19596. }
  19597. ret := &ChangeLogsListResponse{
  19598. ServerResponse: googleapi.ServerResponse{
  19599. Header: res.Header,
  19600. HTTPStatusCode: res.StatusCode,
  19601. },
  19602. }
  19603. target := &ret
  19604. if err := gensupport.DecodeResponse(target, res); err != nil {
  19605. return nil, err
  19606. }
  19607. return ret, nil
  19608. // {
  19609. // "description": "Retrieves a list of change logs. This method supports paging.",
  19610. // "httpMethod": "GET",
  19611. // "id": "dfareporting.changeLogs.list",
  19612. // "parameterOrder": [
  19613. // "profileId"
  19614. // ],
  19615. // "parameters": {
  19616. // "action": {
  19617. // "description": "Select only change logs with the specified action.",
  19618. // "enum": [
  19619. // "ACTION_ADD",
  19620. // "ACTION_ASSIGN",
  19621. // "ACTION_ASSOCIATE",
  19622. // "ACTION_CREATE",
  19623. // "ACTION_DELETE",
  19624. // "ACTION_DISABLE",
  19625. // "ACTION_EMAIL_TAGS",
  19626. // "ACTION_ENABLE",
  19627. // "ACTION_LINK",
  19628. // "ACTION_MARK_AS_DEFAULT",
  19629. // "ACTION_PUSH",
  19630. // "ACTION_REMOVE",
  19631. // "ACTION_SEND",
  19632. // "ACTION_SHARE",
  19633. // "ACTION_UNASSIGN",
  19634. // "ACTION_UNLINK",
  19635. // "ACTION_UPDATE"
  19636. // ],
  19637. // "enumDescriptions": [
  19638. // "",
  19639. // "",
  19640. // "",
  19641. // "",
  19642. // "",
  19643. // "",
  19644. // "",
  19645. // "",
  19646. // "",
  19647. // "",
  19648. // "",
  19649. // "",
  19650. // "",
  19651. // "",
  19652. // "",
  19653. // "",
  19654. // ""
  19655. // ],
  19656. // "location": "query",
  19657. // "type": "string"
  19658. // },
  19659. // "ids": {
  19660. // "description": "Select only change logs with these IDs.",
  19661. // "format": "int64",
  19662. // "location": "query",
  19663. // "repeated": true,
  19664. // "type": "string"
  19665. // },
  19666. // "maxChangeTime": {
  19667. // "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.",
  19668. // "location": "query",
  19669. // "type": "string"
  19670. // },
  19671. // "maxResults": {
  19672. // "default": "1000",
  19673. // "description": "Maximum number of results to return.",
  19674. // "format": "int32",
  19675. // "location": "query",
  19676. // "maximum": "1000",
  19677. // "minimum": "0",
  19678. // "type": "integer"
  19679. // },
  19680. // "minChangeTime": {
  19681. // "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.",
  19682. // "location": "query",
  19683. // "type": "string"
  19684. // },
  19685. // "objectIds": {
  19686. // "description": "Select only change logs with these object IDs.",
  19687. // "format": "int64",
  19688. // "location": "query",
  19689. // "repeated": true,
  19690. // "type": "string"
  19691. // },
  19692. // "objectType": {
  19693. // "description": "Select only change logs with the specified object type.",
  19694. // "enum": [
  19695. // "OBJECT_ACCOUNT",
  19696. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  19697. // "OBJECT_AD",
  19698. // "OBJECT_ADVERTISER",
  19699. // "OBJECT_ADVERTISER_GROUP",
  19700. // "OBJECT_BILLING_ACCOUNT_GROUP",
  19701. // "OBJECT_BILLING_FEATURE",
  19702. // "OBJECT_BILLING_MINIMUM_FEE",
  19703. // "OBJECT_BILLING_PROFILE",
  19704. // "OBJECT_CAMPAIGN",
  19705. // "OBJECT_CONTENT_CATEGORY",
  19706. // "OBJECT_CREATIVE",
  19707. // "OBJECT_CREATIVE_ASSET",
  19708. // "OBJECT_CREATIVE_BUNDLE",
  19709. // "OBJECT_CREATIVE_FIELD",
  19710. // "OBJECT_CREATIVE_GROUP",
  19711. // "OBJECT_DFA_SITE",
  19712. // "OBJECT_EVENT_TAG",
  19713. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  19714. // "OBJECT_FLOODLIGHT_ACTVITY",
  19715. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  19716. // "OBJECT_INSTREAM_CREATIVE",
  19717. // "OBJECT_LANDING_PAGE",
  19718. // "OBJECT_MEDIA_ORDER",
  19719. // "OBJECT_PLACEMENT",
  19720. // "OBJECT_PLACEMENT_STRATEGY",
  19721. // "OBJECT_PLAYSTORE_LINK",
  19722. // "OBJECT_PROVIDED_LIST_CLIENT",
  19723. // "OBJECT_RATE_CARD",
  19724. // "OBJECT_REMARKETING_LIST",
  19725. // "OBJECT_RICHMEDIA_CREATIVE",
  19726. // "OBJECT_SD_SITE",
  19727. // "OBJECT_SEARCH_LIFT_STUDY",
  19728. // "OBJECT_SIZE",
  19729. // "OBJECT_SUBACCOUNT",
  19730. // "OBJECT_TARGETING_TEMPLATE",
  19731. // "OBJECT_USER_PROFILE",
  19732. // "OBJECT_USER_PROFILE_FILTER",
  19733. // "OBJECT_USER_ROLE"
  19734. // ],
  19735. // "enumDescriptions": [
  19736. // "",
  19737. // "",
  19738. // "",
  19739. // "",
  19740. // "",
  19741. // "",
  19742. // "",
  19743. // "",
  19744. // "",
  19745. // "",
  19746. // "",
  19747. // "",
  19748. // "",
  19749. // "",
  19750. // "",
  19751. // "",
  19752. // "",
  19753. // "",
  19754. // "",
  19755. // "",
  19756. // "",
  19757. // "",
  19758. // "",
  19759. // "",
  19760. // "",
  19761. // "",
  19762. // "",
  19763. // "",
  19764. // "",
  19765. // "",
  19766. // "",
  19767. // "",
  19768. // "",
  19769. // "",
  19770. // "",
  19771. // "",
  19772. // "",
  19773. // "",
  19774. // ""
  19775. // ],
  19776. // "location": "query",
  19777. // "type": "string"
  19778. // },
  19779. // "pageToken": {
  19780. // "description": "Value of the nextPageToken from the previous result page.",
  19781. // "location": "query",
  19782. // "type": "string"
  19783. // },
  19784. // "profileId": {
  19785. // "description": "User profile ID associated with this request.",
  19786. // "format": "int64",
  19787. // "location": "path",
  19788. // "required": true,
  19789. // "type": "string"
  19790. // },
  19791. // "searchString": {
  19792. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  19793. // "location": "query",
  19794. // "type": "string"
  19795. // },
  19796. // "userProfileIds": {
  19797. // "description": "Select only change logs with these user profile IDs.",
  19798. // "format": "int64",
  19799. // "location": "query",
  19800. // "repeated": true,
  19801. // "type": "string"
  19802. // }
  19803. // },
  19804. // "path": "userprofiles/{profileId}/changeLogs",
  19805. // "response": {
  19806. // "$ref": "ChangeLogsListResponse"
  19807. // },
  19808. // "scopes": [
  19809. // "https://www.googleapis.com/auth/dfatrafficking"
  19810. // ]
  19811. // }
  19812. }
  19813. // Pages invokes f for each page of results.
  19814. // A non-nil error returned from f will halt the iteration.
  19815. // The provided context supersedes any context provided to the Context method.
  19816. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  19817. c.ctx_ = ctx
  19818. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19819. for {
  19820. x, err := c.Do()
  19821. if err != nil {
  19822. return err
  19823. }
  19824. if err := f(x); err != nil {
  19825. return err
  19826. }
  19827. if x.NextPageToken == "" {
  19828. return nil
  19829. }
  19830. c.PageToken(x.NextPageToken)
  19831. }
  19832. }
  19833. // method id "dfareporting.cities.list":
  19834. type CitiesListCall struct {
  19835. s *Service
  19836. profileId int64
  19837. urlParams_ gensupport.URLParams
  19838. ifNoneMatch_ string
  19839. ctx_ context.Context
  19840. header_ http.Header
  19841. }
  19842. // List: Retrieves a list of cities, possibly filtered.
  19843. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  19844. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19845. c.profileId = profileId
  19846. return c
  19847. }
  19848. // CountryDartIds sets the optional parameter "countryDartIds": Select
  19849. // only cities from these countries.
  19850. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  19851. var countryDartIds_ []string
  19852. for _, v := range countryDartIds {
  19853. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  19854. }
  19855. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  19856. return c
  19857. }
  19858. // DartIds sets the optional parameter "dartIds": Select only cities
  19859. // with these DART IDs.
  19860. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  19861. var dartIds_ []string
  19862. for _, v := range dartIds {
  19863. dartIds_ = append(dartIds_, fmt.Sprint(v))
  19864. }
  19865. c.urlParams_.SetMulti("dartIds", dartIds_)
  19866. return c
  19867. }
  19868. // NamePrefix sets the optional parameter "namePrefix": Select only
  19869. // cities with names starting with this prefix.
  19870. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  19871. c.urlParams_.Set("namePrefix", namePrefix)
  19872. return c
  19873. }
  19874. // RegionDartIds sets the optional parameter "regionDartIds": Select
  19875. // only cities from these regions.
  19876. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  19877. var regionDartIds_ []string
  19878. for _, v := range regionDartIds {
  19879. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  19880. }
  19881. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  19882. return c
  19883. }
  19884. // Fields allows partial responses to be retrieved. See
  19885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19886. // for more information.
  19887. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  19888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19889. return c
  19890. }
  19891. // IfNoneMatch sets the optional parameter which makes the operation
  19892. // fail if the object's ETag matches the given value. This is useful for
  19893. // getting updates only after the object has changed since the last
  19894. // request. Use googleapi.IsNotModified to check whether the response
  19895. // error from Do is the result of In-None-Match.
  19896. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  19897. c.ifNoneMatch_ = entityTag
  19898. return c
  19899. }
  19900. // Context sets the context to be used in this call's Do method. Any
  19901. // pending HTTP request will be aborted if the provided context is
  19902. // canceled.
  19903. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  19904. c.ctx_ = ctx
  19905. return c
  19906. }
  19907. // Header returns an http.Header that can be modified by the caller to
  19908. // add HTTP headers to the request.
  19909. func (c *CitiesListCall) Header() http.Header {
  19910. if c.header_ == nil {
  19911. c.header_ = make(http.Header)
  19912. }
  19913. return c.header_
  19914. }
  19915. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  19916. reqHeaders := make(http.Header)
  19917. for k, v := range c.header_ {
  19918. reqHeaders[k] = v
  19919. }
  19920. reqHeaders.Set("User-Agent", c.s.userAgent())
  19921. if c.ifNoneMatch_ != "" {
  19922. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19923. }
  19924. var body io.Reader = nil
  19925. c.urlParams_.Set("alt", alt)
  19926. c.urlParams_.Set("prettyPrint", "false")
  19927. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  19928. urls += "?" + c.urlParams_.Encode()
  19929. req, err := http.NewRequest("GET", urls, body)
  19930. if err != nil {
  19931. return nil, err
  19932. }
  19933. req.Header = reqHeaders
  19934. googleapi.Expand(req.URL, map[string]string{
  19935. "profileId": strconv.FormatInt(c.profileId, 10),
  19936. })
  19937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19938. }
  19939. // Do executes the "dfareporting.cities.list" call.
  19940. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  19941. // non-2xx status code is an error. Response headers are in either
  19942. // *CitiesListResponse.ServerResponse.Header or (if a response was
  19943. // returned at all) in error.(*googleapi.Error).Header. Use
  19944. // googleapi.IsNotModified to check whether the returned error was
  19945. // because http.StatusNotModified was returned.
  19946. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  19947. gensupport.SetOptions(c.urlParams_, opts...)
  19948. res, err := c.doRequest("json")
  19949. if res != nil && res.StatusCode == http.StatusNotModified {
  19950. if res.Body != nil {
  19951. res.Body.Close()
  19952. }
  19953. return nil, &googleapi.Error{
  19954. Code: res.StatusCode,
  19955. Header: res.Header,
  19956. }
  19957. }
  19958. if err != nil {
  19959. return nil, err
  19960. }
  19961. defer googleapi.CloseBody(res)
  19962. if err := googleapi.CheckResponse(res); err != nil {
  19963. return nil, err
  19964. }
  19965. ret := &CitiesListResponse{
  19966. ServerResponse: googleapi.ServerResponse{
  19967. Header: res.Header,
  19968. HTTPStatusCode: res.StatusCode,
  19969. },
  19970. }
  19971. target := &ret
  19972. if err := gensupport.DecodeResponse(target, res); err != nil {
  19973. return nil, err
  19974. }
  19975. return ret, nil
  19976. // {
  19977. // "description": "Retrieves a list of cities, possibly filtered.",
  19978. // "httpMethod": "GET",
  19979. // "id": "dfareporting.cities.list",
  19980. // "parameterOrder": [
  19981. // "profileId"
  19982. // ],
  19983. // "parameters": {
  19984. // "countryDartIds": {
  19985. // "description": "Select only cities from these countries.",
  19986. // "format": "int64",
  19987. // "location": "query",
  19988. // "repeated": true,
  19989. // "type": "string"
  19990. // },
  19991. // "dartIds": {
  19992. // "description": "Select only cities with these DART IDs.",
  19993. // "format": "int64",
  19994. // "location": "query",
  19995. // "repeated": true,
  19996. // "type": "string"
  19997. // },
  19998. // "namePrefix": {
  19999. // "description": "Select only cities with names starting with this prefix.",
  20000. // "location": "query",
  20001. // "type": "string"
  20002. // },
  20003. // "profileId": {
  20004. // "description": "User profile ID associated with this request.",
  20005. // "format": "int64",
  20006. // "location": "path",
  20007. // "required": true,
  20008. // "type": "string"
  20009. // },
  20010. // "regionDartIds": {
  20011. // "description": "Select only cities from these regions.",
  20012. // "format": "int64",
  20013. // "location": "query",
  20014. // "repeated": true,
  20015. // "type": "string"
  20016. // }
  20017. // },
  20018. // "path": "userprofiles/{profileId}/cities",
  20019. // "response": {
  20020. // "$ref": "CitiesListResponse"
  20021. // },
  20022. // "scopes": [
  20023. // "https://www.googleapis.com/auth/dfatrafficking"
  20024. // ]
  20025. // }
  20026. }
  20027. // method id "dfareporting.connectionTypes.get":
  20028. type ConnectionTypesGetCall struct {
  20029. s *Service
  20030. profileId int64
  20031. id int64
  20032. urlParams_ gensupport.URLParams
  20033. ifNoneMatch_ string
  20034. ctx_ context.Context
  20035. header_ http.Header
  20036. }
  20037. // Get: Gets one connection type by ID.
  20038. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  20039. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20040. c.profileId = profileId
  20041. c.id = id
  20042. return c
  20043. }
  20044. // Fields allows partial responses to be retrieved. See
  20045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20046. // for more information.
  20047. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  20048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20049. return c
  20050. }
  20051. // IfNoneMatch sets the optional parameter which makes the operation
  20052. // fail if the object's ETag matches the given value. This is useful for
  20053. // getting updates only after the object has changed since the last
  20054. // request. Use googleapi.IsNotModified to check whether the response
  20055. // error from Do is the result of In-None-Match.
  20056. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  20057. c.ifNoneMatch_ = entityTag
  20058. return c
  20059. }
  20060. // Context sets the context to be used in this call's Do method. Any
  20061. // pending HTTP request will be aborted if the provided context is
  20062. // canceled.
  20063. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  20064. c.ctx_ = ctx
  20065. return c
  20066. }
  20067. // Header returns an http.Header that can be modified by the caller to
  20068. // add HTTP headers to the request.
  20069. func (c *ConnectionTypesGetCall) Header() http.Header {
  20070. if c.header_ == nil {
  20071. c.header_ = make(http.Header)
  20072. }
  20073. return c.header_
  20074. }
  20075. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  20076. reqHeaders := make(http.Header)
  20077. for k, v := range c.header_ {
  20078. reqHeaders[k] = v
  20079. }
  20080. reqHeaders.Set("User-Agent", c.s.userAgent())
  20081. if c.ifNoneMatch_ != "" {
  20082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20083. }
  20084. var body io.Reader = nil
  20085. c.urlParams_.Set("alt", alt)
  20086. c.urlParams_.Set("prettyPrint", "false")
  20087. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  20088. urls += "?" + c.urlParams_.Encode()
  20089. req, err := http.NewRequest("GET", urls, body)
  20090. if err != nil {
  20091. return nil, err
  20092. }
  20093. req.Header = reqHeaders
  20094. googleapi.Expand(req.URL, map[string]string{
  20095. "profileId": strconv.FormatInt(c.profileId, 10),
  20096. "id": strconv.FormatInt(c.id, 10),
  20097. })
  20098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20099. }
  20100. // Do executes the "dfareporting.connectionTypes.get" call.
  20101. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  20102. // status code is an error. Response headers are in either
  20103. // *ConnectionType.ServerResponse.Header or (if a response was returned
  20104. // at all) in error.(*googleapi.Error).Header. Use
  20105. // googleapi.IsNotModified to check whether the returned error was
  20106. // because http.StatusNotModified was returned.
  20107. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  20108. gensupport.SetOptions(c.urlParams_, opts...)
  20109. res, err := c.doRequest("json")
  20110. if res != nil && res.StatusCode == http.StatusNotModified {
  20111. if res.Body != nil {
  20112. res.Body.Close()
  20113. }
  20114. return nil, &googleapi.Error{
  20115. Code: res.StatusCode,
  20116. Header: res.Header,
  20117. }
  20118. }
  20119. if err != nil {
  20120. return nil, err
  20121. }
  20122. defer googleapi.CloseBody(res)
  20123. if err := googleapi.CheckResponse(res); err != nil {
  20124. return nil, err
  20125. }
  20126. ret := &ConnectionType{
  20127. ServerResponse: googleapi.ServerResponse{
  20128. Header: res.Header,
  20129. HTTPStatusCode: res.StatusCode,
  20130. },
  20131. }
  20132. target := &ret
  20133. if err := gensupport.DecodeResponse(target, res); err != nil {
  20134. return nil, err
  20135. }
  20136. return ret, nil
  20137. // {
  20138. // "description": "Gets one connection type by ID.",
  20139. // "httpMethod": "GET",
  20140. // "id": "dfareporting.connectionTypes.get",
  20141. // "parameterOrder": [
  20142. // "profileId",
  20143. // "id"
  20144. // ],
  20145. // "parameters": {
  20146. // "id": {
  20147. // "description": "Connection type ID.",
  20148. // "format": "int64",
  20149. // "location": "path",
  20150. // "required": true,
  20151. // "type": "string"
  20152. // },
  20153. // "profileId": {
  20154. // "description": "User profile ID associated with this request.",
  20155. // "format": "int64",
  20156. // "location": "path",
  20157. // "required": true,
  20158. // "type": "string"
  20159. // }
  20160. // },
  20161. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  20162. // "response": {
  20163. // "$ref": "ConnectionType"
  20164. // },
  20165. // "scopes": [
  20166. // "https://www.googleapis.com/auth/dfatrafficking"
  20167. // ]
  20168. // }
  20169. }
  20170. // method id "dfareporting.connectionTypes.list":
  20171. type ConnectionTypesListCall struct {
  20172. s *Service
  20173. profileId int64
  20174. urlParams_ gensupport.URLParams
  20175. ifNoneMatch_ string
  20176. ctx_ context.Context
  20177. header_ http.Header
  20178. }
  20179. // List: Retrieves a list of connection types.
  20180. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  20181. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20182. c.profileId = profileId
  20183. return c
  20184. }
  20185. // Fields allows partial responses to be retrieved. See
  20186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20187. // for more information.
  20188. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  20189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20190. return c
  20191. }
  20192. // IfNoneMatch sets the optional parameter which makes the operation
  20193. // fail if the object's ETag matches the given value. This is useful for
  20194. // getting updates only after the object has changed since the last
  20195. // request. Use googleapi.IsNotModified to check whether the response
  20196. // error from Do is the result of In-None-Match.
  20197. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  20198. c.ifNoneMatch_ = entityTag
  20199. return c
  20200. }
  20201. // Context sets the context to be used in this call's Do method. Any
  20202. // pending HTTP request will be aborted if the provided context is
  20203. // canceled.
  20204. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  20205. c.ctx_ = ctx
  20206. return c
  20207. }
  20208. // Header returns an http.Header that can be modified by the caller to
  20209. // add HTTP headers to the request.
  20210. func (c *ConnectionTypesListCall) Header() http.Header {
  20211. if c.header_ == nil {
  20212. c.header_ = make(http.Header)
  20213. }
  20214. return c.header_
  20215. }
  20216. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  20217. reqHeaders := make(http.Header)
  20218. for k, v := range c.header_ {
  20219. reqHeaders[k] = v
  20220. }
  20221. reqHeaders.Set("User-Agent", c.s.userAgent())
  20222. if c.ifNoneMatch_ != "" {
  20223. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20224. }
  20225. var body io.Reader = nil
  20226. c.urlParams_.Set("alt", alt)
  20227. c.urlParams_.Set("prettyPrint", "false")
  20228. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  20229. urls += "?" + c.urlParams_.Encode()
  20230. req, err := http.NewRequest("GET", urls, body)
  20231. if err != nil {
  20232. return nil, err
  20233. }
  20234. req.Header = reqHeaders
  20235. googleapi.Expand(req.URL, map[string]string{
  20236. "profileId": strconv.FormatInt(c.profileId, 10),
  20237. })
  20238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20239. }
  20240. // Do executes the "dfareporting.connectionTypes.list" call.
  20241. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  20242. // Any non-2xx status code is an error. Response headers are in either
  20243. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  20244. // was returned at all) in error.(*googleapi.Error).Header. Use
  20245. // googleapi.IsNotModified to check whether the returned error was
  20246. // because http.StatusNotModified was returned.
  20247. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  20248. gensupport.SetOptions(c.urlParams_, opts...)
  20249. res, err := c.doRequest("json")
  20250. if res != nil && res.StatusCode == http.StatusNotModified {
  20251. if res.Body != nil {
  20252. res.Body.Close()
  20253. }
  20254. return nil, &googleapi.Error{
  20255. Code: res.StatusCode,
  20256. Header: res.Header,
  20257. }
  20258. }
  20259. if err != nil {
  20260. return nil, err
  20261. }
  20262. defer googleapi.CloseBody(res)
  20263. if err := googleapi.CheckResponse(res); err != nil {
  20264. return nil, err
  20265. }
  20266. ret := &ConnectionTypesListResponse{
  20267. ServerResponse: googleapi.ServerResponse{
  20268. Header: res.Header,
  20269. HTTPStatusCode: res.StatusCode,
  20270. },
  20271. }
  20272. target := &ret
  20273. if err := gensupport.DecodeResponse(target, res); err != nil {
  20274. return nil, err
  20275. }
  20276. return ret, nil
  20277. // {
  20278. // "description": "Retrieves a list of connection types.",
  20279. // "httpMethod": "GET",
  20280. // "id": "dfareporting.connectionTypes.list",
  20281. // "parameterOrder": [
  20282. // "profileId"
  20283. // ],
  20284. // "parameters": {
  20285. // "profileId": {
  20286. // "description": "User profile ID associated with this request.",
  20287. // "format": "int64",
  20288. // "location": "path",
  20289. // "required": true,
  20290. // "type": "string"
  20291. // }
  20292. // },
  20293. // "path": "userprofiles/{profileId}/connectionTypes",
  20294. // "response": {
  20295. // "$ref": "ConnectionTypesListResponse"
  20296. // },
  20297. // "scopes": [
  20298. // "https://www.googleapis.com/auth/dfatrafficking"
  20299. // ]
  20300. // }
  20301. }
  20302. // method id "dfareporting.contentCategories.delete":
  20303. type ContentCategoriesDeleteCall struct {
  20304. s *Service
  20305. profileId int64
  20306. id int64
  20307. urlParams_ gensupport.URLParams
  20308. ctx_ context.Context
  20309. header_ http.Header
  20310. }
  20311. // Delete: Deletes an existing content category.
  20312. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  20313. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20314. c.profileId = profileId
  20315. c.id = id
  20316. return c
  20317. }
  20318. // Fields allows partial responses to be retrieved. See
  20319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20320. // for more information.
  20321. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  20322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20323. return c
  20324. }
  20325. // Context sets the context to be used in this call's Do method. Any
  20326. // pending HTTP request will be aborted if the provided context is
  20327. // canceled.
  20328. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  20329. c.ctx_ = ctx
  20330. return c
  20331. }
  20332. // Header returns an http.Header that can be modified by the caller to
  20333. // add HTTP headers to the request.
  20334. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  20335. if c.header_ == nil {
  20336. c.header_ = make(http.Header)
  20337. }
  20338. return c.header_
  20339. }
  20340. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20341. reqHeaders := make(http.Header)
  20342. for k, v := range c.header_ {
  20343. reqHeaders[k] = v
  20344. }
  20345. reqHeaders.Set("User-Agent", c.s.userAgent())
  20346. var body io.Reader = nil
  20347. c.urlParams_.Set("alt", alt)
  20348. c.urlParams_.Set("prettyPrint", "false")
  20349. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20350. urls += "?" + c.urlParams_.Encode()
  20351. req, err := http.NewRequest("DELETE", urls, body)
  20352. if err != nil {
  20353. return nil, err
  20354. }
  20355. req.Header = reqHeaders
  20356. googleapi.Expand(req.URL, map[string]string{
  20357. "profileId": strconv.FormatInt(c.profileId, 10),
  20358. "id": strconv.FormatInt(c.id, 10),
  20359. })
  20360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20361. }
  20362. // Do executes the "dfareporting.contentCategories.delete" call.
  20363. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20364. gensupport.SetOptions(c.urlParams_, opts...)
  20365. res, err := c.doRequest("json")
  20366. if err != nil {
  20367. return err
  20368. }
  20369. defer googleapi.CloseBody(res)
  20370. if err := googleapi.CheckResponse(res); err != nil {
  20371. return err
  20372. }
  20373. return nil
  20374. // {
  20375. // "description": "Deletes an existing content category.",
  20376. // "httpMethod": "DELETE",
  20377. // "id": "dfareporting.contentCategories.delete",
  20378. // "parameterOrder": [
  20379. // "profileId",
  20380. // "id"
  20381. // ],
  20382. // "parameters": {
  20383. // "id": {
  20384. // "description": "Content category ID.",
  20385. // "format": "int64",
  20386. // "location": "path",
  20387. // "required": true,
  20388. // "type": "string"
  20389. // },
  20390. // "profileId": {
  20391. // "description": "User profile ID associated with this request.",
  20392. // "format": "int64",
  20393. // "location": "path",
  20394. // "required": true,
  20395. // "type": "string"
  20396. // }
  20397. // },
  20398. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20399. // "scopes": [
  20400. // "https://www.googleapis.com/auth/dfatrafficking"
  20401. // ]
  20402. // }
  20403. }
  20404. // method id "dfareporting.contentCategories.get":
  20405. type ContentCategoriesGetCall struct {
  20406. s *Service
  20407. profileId int64
  20408. id int64
  20409. urlParams_ gensupport.URLParams
  20410. ifNoneMatch_ string
  20411. ctx_ context.Context
  20412. header_ http.Header
  20413. }
  20414. // Get: Gets one content category by ID.
  20415. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  20416. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20417. c.profileId = profileId
  20418. c.id = id
  20419. return c
  20420. }
  20421. // Fields allows partial responses to be retrieved. See
  20422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20423. // for more information.
  20424. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  20425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20426. return c
  20427. }
  20428. // IfNoneMatch sets the optional parameter which makes the operation
  20429. // fail if the object's ETag matches the given value. This is useful for
  20430. // getting updates only after the object has changed since the last
  20431. // request. Use googleapi.IsNotModified to check whether the response
  20432. // error from Do is the result of In-None-Match.
  20433. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  20434. c.ifNoneMatch_ = entityTag
  20435. return c
  20436. }
  20437. // Context sets the context to be used in this call's Do method. Any
  20438. // pending HTTP request will be aborted if the provided context is
  20439. // canceled.
  20440. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  20441. c.ctx_ = ctx
  20442. return c
  20443. }
  20444. // Header returns an http.Header that can be modified by the caller to
  20445. // add HTTP headers to the request.
  20446. func (c *ContentCategoriesGetCall) Header() http.Header {
  20447. if c.header_ == nil {
  20448. c.header_ = make(http.Header)
  20449. }
  20450. return c.header_
  20451. }
  20452. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  20453. reqHeaders := make(http.Header)
  20454. for k, v := range c.header_ {
  20455. reqHeaders[k] = v
  20456. }
  20457. reqHeaders.Set("User-Agent", c.s.userAgent())
  20458. if c.ifNoneMatch_ != "" {
  20459. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20460. }
  20461. var body io.Reader = nil
  20462. c.urlParams_.Set("alt", alt)
  20463. c.urlParams_.Set("prettyPrint", "false")
  20464. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20465. urls += "?" + c.urlParams_.Encode()
  20466. req, err := http.NewRequest("GET", urls, body)
  20467. if err != nil {
  20468. return nil, err
  20469. }
  20470. req.Header = reqHeaders
  20471. googleapi.Expand(req.URL, map[string]string{
  20472. "profileId": strconv.FormatInt(c.profileId, 10),
  20473. "id": strconv.FormatInt(c.id, 10),
  20474. })
  20475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20476. }
  20477. // Do executes the "dfareporting.contentCategories.get" call.
  20478. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20479. // status code is an error. Response headers are in either
  20480. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20481. // at all) in error.(*googleapi.Error).Header. Use
  20482. // googleapi.IsNotModified to check whether the returned error was
  20483. // because http.StatusNotModified was returned.
  20484. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20485. gensupport.SetOptions(c.urlParams_, opts...)
  20486. res, err := c.doRequest("json")
  20487. if res != nil && res.StatusCode == http.StatusNotModified {
  20488. if res.Body != nil {
  20489. res.Body.Close()
  20490. }
  20491. return nil, &googleapi.Error{
  20492. Code: res.StatusCode,
  20493. Header: res.Header,
  20494. }
  20495. }
  20496. if err != nil {
  20497. return nil, err
  20498. }
  20499. defer googleapi.CloseBody(res)
  20500. if err := googleapi.CheckResponse(res); err != nil {
  20501. return nil, err
  20502. }
  20503. ret := &ContentCategory{
  20504. ServerResponse: googleapi.ServerResponse{
  20505. Header: res.Header,
  20506. HTTPStatusCode: res.StatusCode,
  20507. },
  20508. }
  20509. target := &ret
  20510. if err := gensupport.DecodeResponse(target, res); err != nil {
  20511. return nil, err
  20512. }
  20513. return ret, nil
  20514. // {
  20515. // "description": "Gets one content category by ID.",
  20516. // "httpMethod": "GET",
  20517. // "id": "dfareporting.contentCategories.get",
  20518. // "parameterOrder": [
  20519. // "profileId",
  20520. // "id"
  20521. // ],
  20522. // "parameters": {
  20523. // "id": {
  20524. // "description": "Content category ID.",
  20525. // "format": "int64",
  20526. // "location": "path",
  20527. // "required": true,
  20528. // "type": "string"
  20529. // },
  20530. // "profileId": {
  20531. // "description": "User profile ID associated with this request.",
  20532. // "format": "int64",
  20533. // "location": "path",
  20534. // "required": true,
  20535. // "type": "string"
  20536. // }
  20537. // },
  20538. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20539. // "response": {
  20540. // "$ref": "ContentCategory"
  20541. // },
  20542. // "scopes": [
  20543. // "https://www.googleapis.com/auth/dfatrafficking"
  20544. // ]
  20545. // }
  20546. }
  20547. // method id "dfareporting.contentCategories.insert":
  20548. type ContentCategoriesInsertCall struct {
  20549. s *Service
  20550. profileId int64
  20551. contentcategory *ContentCategory
  20552. urlParams_ gensupport.URLParams
  20553. ctx_ context.Context
  20554. header_ http.Header
  20555. }
  20556. // Insert: Inserts a new content category.
  20557. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  20558. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20559. c.profileId = profileId
  20560. c.contentcategory = contentcategory
  20561. return c
  20562. }
  20563. // Fields allows partial responses to be retrieved. See
  20564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20565. // for more information.
  20566. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  20567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20568. return c
  20569. }
  20570. // Context sets the context to be used in this call's Do method. Any
  20571. // pending HTTP request will be aborted if the provided context is
  20572. // canceled.
  20573. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  20574. c.ctx_ = ctx
  20575. return c
  20576. }
  20577. // Header returns an http.Header that can be modified by the caller to
  20578. // add HTTP headers to the request.
  20579. func (c *ContentCategoriesInsertCall) Header() http.Header {
  20580. if c.header_ == nil {
  20581. c.header_ = make(http.Header)
  20582. }
  20583. return c.header_
  20584. }
  20585. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  20586. reqHeaders := make(http.Header)
  20587. for k, v := range c.header_ {
  20588. reqHeaders[k] = v
  20589. }
  20590. reqHeaders.Set("User-Agent", c.s.userAgent())
  20591. var body io.Reader = nil
  20592. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20593. if err != nil {
  20594. return nil, err
  20595. }
  20596. reqHeaders.Set("Content-Type", "application/json")
  20597. c.urlParams_.Set("alt", alt)
  20598. c.urlParams_.Set("prettyPrint", "false")
  20599. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20600. urls += "?" + c.urlParams_.Encode()
  20601. req, err := http.NewRequest("POST", urls, body)
  20602. if err != nil {
  20603. return nil, err
  20604. }
  20605. req.Header = reqHeaders
  20606. googleapi.Expand(req.URL, map[string]string{
  20607. "profileId": strconv.FormatInt(c.profileId, 10),
  20608. })
  20609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20610. }
  20611. // Do executes the "dfareporting.contentCategories.insert" call.
  20612. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20613. // status code is an error. Response headers are in either
  20614. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20615. // at all) in error.(*googleapi.Error).Header. Use
  20616. // googleapi.IsNotModified to check whether the returned error was
  20617. // because http.StatusNotModified was returned.
  20618. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20619. gensupport.SetOptions(c.urlParams_, opts...)
  20620. res, err := c.doRequest("json")
  20621. if res != nil && res.StatusCode == http.StatusNotModified {
  20622. if res.Body != nil {
  20623. res.Body.Close()
  20624. }
  20625. return nil, &googleapi.Error{
  20626. Code: res.StatusCode,
  20627. Header: res.Header,
  20628. }
  20629. }
  20630. if err != nil {
  20631. return nil, err
  20632. }
  20633. defer googleapi.CloseBody(res)
  20634. if err := googleapi.CheckResponse(res); err != nil {
  20635. return nil, err
  20636. }
  20637. ret := &ContentCategory{
  20638. ServerResponse: googleapi.ServerResponse{
  20639. Header: res.Header,
  20640. HTTPStatusCode: res.StatusCode,
  20641. },
  20642. }
  20643. target := &ret
  20644. if err := gensupport.DecodeResponse(target, res); err != nil {
  20645. return nil, err
  20646. }
  20647. return ret, nil
  20648. // {
  20649. // "description": "Inserts a new content category.",
  20650. // "httpMethod": "POST",
  20651. // "id": "dfareporting.contentCategories.insert",
  20652. // "parameterOrder": [
  20653. // "profileId"
  20654. // ],
  20655. // "parameters": {
  20656. // "profileId": {
  20657. // "description": "User profile ID associated with this request.",
  20658. // "format": "int64",
  20659. // "location": "path",
  20660. // "required": true,
  20661. // "type": "string"
  20662. // }
  20663. // },
  20664. // "path": "userprofiles/{profileId}/contentCategories",
  20665. // "request": {
  20666. // "$ref": "ContentCategory"
  20667. // },
  20668. // "response": {
  20669. // "$ref": "ContentCategory"
  20670. // },
  20671. // "scopes": [
  20672. // "https://www.googleapis.com/auth/dfatrafficking"
  20673. // ]
  20674. // }
  20675. }
  20676. // method id "dfareporting.contentCategories.list":
  20677. type ContentCategoriesListCall struct {
  20678. s *Service
  20679. profileId int64
  20680. urlParams_ gensupport.URLParams
  20681. ifNoneMatch_ string
  20682. ctx_ context.Context
  20683. header_ http.Header
  20684. }
  20685. // List: Retrieves a list of content categories, possibly filtered. This
  20686. // method supports paging.
  20687. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  20688. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20689. c.profileId = profileId
  20690. return c
  20691. }
  20692. // Ids sets the optional parameter "ids": Select only content categories
  20693. // with these IDs.
  20694. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  20695. var ids_ []string
  20696. for _, v := range ids {
  20697. ids_ = append(ids_, fmt.Sprint(v))
  20698. }
  20699. c.urlParams_.SetMulti("ids", ids_)
  20700. return c
  20701. }
  20702. // MaxResults sets the optional parameter "maxResults": Maximum number
  20703. // of results to return.
  20704. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  20705. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20706. return c
  20707. }
  20708. // PageToken sets the optional parameter "pageToken": Value of the
  20709. // nextPageToken from the previous result page.
  20710. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  20711. c.urlParams_.Set("pageToken", pageToken)
  20712. return c
  20713. }
  20714. // SearchString sets the optional parameter "searchString": Allows
  20715. // searching for objects by name or ID. Wildcards (*) are allowed. For
  20716. // example, "contentcategory*2015" will return objects with names like
  20717. // "contentcategory June 2015", "contentcategory April 2015", or simply
  20718. // "contentcategory 2015". Most of the searches also add wildcards
  20719. // implicitly at the start and the end of the search string. For
  20720. // example, a search string of "contentcategory" will match objects with
  20721. // name "my contentcategory", "contentcategory 2015", or simply
  20722. // "contentcategory".
  20723. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  20724. c.urlParams_.Set("searchString", searchString)
  20725. return c
  20726. }
  20727. // SortField sets the optional parameter "sortField": Field by which to
  20728. // sort the list.
  20729. //
  20730. // Possible values:
  20731. // "ID" (default)
  20732. // "NAME"
  20733. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  20734. c.urlParams_.Set("sortField", sortField)
  20735. return c
  20736. }
  20737. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20738. // results.
  20739. //
  20740. // Possible values:
  20741. // "ASCENDING" (default)
  20742. // "DESCENDING"
  20743. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  20744. c.urlParams_.Set("sortOrder", sortOrder)
  20745. return c
  20746. }
  20747. // Fields allows partial responses to be retrieved. See
  20748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20749. // for more information.
  20750. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  20751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20752. return c
  20753. }
  20754. // IfNoneMatch sets the optional parameter which makes the operation
  20755. // fail if the object's ETag matches the given value. This is useful for
  20756. // getting updates only after the object has changed since the last
  20757. // request. Use googleapi.IsNotModified to check whether the response
  20758. // error from Do is the result of In-None-Match.
  20759. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  20760. c.ifNoneMatch_ = entityTag
  20761. return c
  20762. }
  20763. // Context sets the context to be used in this call's Do method. Any
  20764. // pending HTTP request will be aborted if the provided context is
  20765. // canceled.
  20766. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  20767. c.ctx_ = ctx
  20768. return c
  20769. }
  20770. // Header returns an http.Header that can be modified by the caller to
  20771. // add HTTP headers to the request.
  20772. func (c *ContentCategoriesListCall) Header() http.Header {
  20773. if c.header_ == nil {
  20774. c.header_ = make(http.Header)
  20775. }
  20776. return c.header_
  20777. }
  20778. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  20779. reqHeaders := make(http.Header)
  20780. for k, v := range c.header_ {
  20781. reqHeaders[k] = v
  20782. }
  20783. reqHeaders.Set("User-Agent", c.s.userAgent())
  20784. if c.ifNoneMatch_ != "" {
  20785. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20786. }
  20787. var body io.Reader = nil
  20788. c.urlParams_.Set("alt", alt)
  20789. c.urlParams_.Set("prettyPrint", "false")
  20790. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20791. urls += "?" + c.urlParams_.Encode()
  20792. req, err := http.NewRequest("GET", urls, body)
  20793. if err != nil {
  20794. return nil, err
  20795. }
  20796. req.Header = reqHeaders
  20797. googleapi.Expand(req.URL, map[string]string{
  20798. "profileId": strconv.FormatInt(c.profileId, 10),
  20799. })
  20800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20801. }
  20802. // Do executes the "dfareporting.contentCategories.list" call.
  20803. // Exactly one of *ContentCategoriesListResponse or error will be
  20804. // non-nil. Any non-2xx status code is an error. Response headers are in
  20805. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  20806. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20807. // googleapi.IsNotModified to check whether the returned error was
  20808. // because http.StatusNotModified was returned.
  20809. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  20810. gensupport.SetOptions(c.urlParams_, opts...)
  20811. res, err := c.doRequest("json")
  20812. if res != nil && res.StatusCode == http.StatusNotModified {
  20813. if res.Body != nil {
  20814. res.Body.Close()
  20815. }
  20816. return nil, &googleapi.Error{
  20817. Code: res.StatusCode,
  20818. Header: res.Header,
  20819. }
  20820. }
  20821. if err != nil {
  20822. return nil, err
  20823. }
  20824. defer googleapi.CloseBody(res)
  20825. if err := googleapi.CheckResponse(res); err != nil {
  20826. return nil, err
  20827. }
  20828. ret := &ContentCategoriesListResponse{
  20829. ServerResponse: googleapi.ServerResponse{
  20830. Header: res.Header,
  20831. HTTPStatusCode: res.StatusCode,
  20832. },
  20833. }
  20834. target := &ret
  20835. if err := gensupport.DecodeResponse(target, res); err != nil {
  20836. return nil, err
  20837. }
  20838. return ret, nil
  20839. // {
  20840. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  20841. // "httpMethod": "GET",
  20842. // "id": "dfareporting.contentCategories.list",
  20843. // "parameterOrder": [
  20844. // "profileId"
  20845. // ],
  20846. // "parameters": {
  20847. // "ids": {
  20848. // "description": "Select only content categories with these IDs.",
  20849. // "format": "int64",
  20850. // "location": "query",
  20851. // "repeated": true,
  20852. // "type": "string"
  20853. // },
  20854. // "maxResults": {
  20855. // "default": "1000",
  20856. // "description": "Maximum number of results to return.",
  20857. // "format": "int32",
  20858. // "location": "query",
  20859. // "maximum": "1000",
  20860. // "minimum": "0",
  20861. // "type": "integer"
  20862. // },
  20863. // "pageToken": {
  20864. // "description": "Value of the nextPageToken from the previous result page.",
  20865. // "location": "query",
  20866. // "type": "string"
  20867. // },
  20868. // "profileId": {
  20869. // "description": "User profile ID associated with this request.",
  20870. // "format": "int64",
  20871. // "location": "path",
  20872. // "required": true,
  20873. // "type": "string"
  20874. // },
  20875. // "searchString": {
  20876. // "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\".",
  20877. // "location": "query",
  20878. // "type": "string"
  20879. // },
  20880. // "sortField": {
  20881. // "default": "ID",
  20882. // "description": "Field by which to sort the list.",
  20883. // "enum": [
  20884. // "ID",
  20885. // "NAME"
  20886. // ],
  20887. // "enumDescriptions": [
  20888. // "",
  20889. // ""
  20890. // ],
  20891. // "location": "query",
  20892. // "type": "string"
  20893. // },
  20894. // "sortOrder": {
  20895. // "default": "ASCENDING",
  20896. // "description": "Order of sorted results.",
  20897. // "enum": [
  20898. // "ASCENDING",
  20899. // "DESCENDING"
  20900. // ],
  20901. // "enumDescriptions": [
  20902. // "",
  20903. // ""
  20904. // ],
  20905. // "location": "query",
  20906. // "type": "string"
  20907. // }
  20908. // },
  20909. // "path": "userprofiles/{profileId}/contentCategories",
  20910. // "response": {
  20911. // "$ref": "ContentCategoriesListResponse"
  20912. // },
  20913. // "scopes": [
  20914. // "https://www.googleapis.com/auth/dfatrafficking"
  20915. // ]
  20916. // }
  20917. }
  20918. // Pages invokes f for each page of results.
  20919. // A non-nil error returned from f will halt the iteration.
  20920. // The provided context supersedes any context provided to the Context method.
  20921. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  20922. c.ctx_ = ctx
  20923. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20924. for {
  20925. x, err := c.Do()
  20926. if err != nil {
  20927. return err
  20928. }
  20929. if err := f(x); err != nil {
  20930. return err
  20931. }
  20932. if x.NextPageToken == "" {
  20933. return nil
  20934. }
  20935. c.PageToken(x.NextPageToken)
  20936. }
  20937. }
  20938. // method id "dfareporting.contentCategories.patch":
  20939. type ContentCategoriesPatchCall struct {
  20940. s *Service
  20941. profileId int64
  20942. contentcategory *ContentCategory
  20943. urlParams_ gensupport.URLParams
  20944. ctx_ context.Context
  20945. header_ http.Header
  20946. }
  20947. // Patch: Updates an existing content category. This method supports
  20948. // patch semantics.
  20949. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  20950. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20951. c.profileId = profileId
  20952. c.urlParams_.Set("id", fmt.Sprint(id))
  20953. c.contentcategory = contentcategory
  20954. return c
  20955. }
  20956. // Fields allows partial responses to be retrieved. See
  20957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20958. // for more information.
  20959. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  20960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20961. return c
  20962. }
  20963. // Context sets the context to be used in this call's Do method. Any
  20964. // pending HTTP request will be aborted if the provided context is
  20965. // canceled.
  20966. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  20967. c.ctx_ = ctx
  20968. return c
  20969. }
  20970. // Header returns an http.Header that can be modified by the caller to
  20971. // add HTTP headers to the request.
  20972. func (c *ContentCategoriesPatchCall) Header() http.Header {
  20973. if c.header_ == nil {
  20974. c.header_ = make(http.Header)
  20975. }
  20976. return c.header_
  20977. }
  20978. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  20979. reqHeaders := make(http.Header)
  20980. for k, v := range c.header_ {
  20981. reqHeaders[k] = v
  20982. }
  20983. reqHeaders.Set("User-Agent", c.s.userAgent())
  20984. var body io.Reader = nil
  20985. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20986. if err != nil {
  20987. return nil, err
  20988. }
  20989. reqHeaders.Set("Content-Type", "application/json")
  20990. c.urlParams_.Set("alt", alt)
  20991. c.urlParams_.Set("prettyPrint", "false")
  20992. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20993. urls += "?" + c.urlParams_.Encode()
  20994. req, err := http.NewRequest("PATCH", urls, body)
  20995. if err != nil {
  20996. return nil, err
  20997. }
  20998. req.Header = reqHeaders
  20999. googleapi.Expand(req.URL, map[string]string{
  21000. "profileId": strconv.FormatInt(c.profileId, 10),
  21001. })
  21002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21003. }
  21004. // Do executes the "dfareporting.contentCategories.patch" call.
  21005. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  21006. // status code is an error. Response headers are in either
  21007. // *ContentCategory.ServerResponse.Header or (if a response was returned
  21008. // at all) in error.(*googleapi.Error).Header. Use
  21009. // googleapi.IsNotModified to check whether the returned error was
  21010. // because http.StatusNotModified was returned.
  21011. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  21012. gensupport.SetOptions(c.urlParams_, opts...)
  21013. res, err := c.doRequest("json")
  21014. if res != nil && res.StatusCode == http.StatusNotModified {
  21015. if res.Body != nil {
  21016. res.Body.Close()
  21017. }
  21018. return nil, &googleapi.Error{
  21019. Code: res.StatusCode,
  21020. Header: res.Header,
  21021. }
  21022. }
  21023. if err != nil {
  21024. return nil, err
  21025. }
  21026. defer googleapi.CloseBody(res)
  21027. if err := googleapi.CheckResponse(res); err != nil {
  21028. return nil, err
  21029. }
  21030. ret := &ContentCategory{
  21031. ServerResponse: googleapi.ServerResponse{
  21032. Header: res.Header,
  21033. HTTPStatusCode: res.StatusCode,
  21034. },
  21035. }
  21036. target := &ret
  21037. if err := gensupport.DecodeResponse(target, res); err != nil {
  21038. return nil, err
  21039. }
  21040. return ret, nil
  21041. // {
  21042. // "description": "Updates an existing content category. This method supports patch semantics.",
  21043. // "httpMethod": "PATCH",
  21044. // "id": "dfareporting.contentCategories.patch",
  21045. // "parameterOrder": [
  21046. // "profileId",
  21047. // "id"
  21048. // ],
  21049. // "parameters": {
  21050. // "id": {
  21051. // "description": "Content category ID.",
  21052. // "format": "int64",
  21053. // "location": "query",
  21054. // "required": true,
  21055. // "type": "string"
  21056. // },
  21057. // "profileId": {
  21058. // "description": "User profile ID associated with this request.",
  21059. // "format": "int64",
  21060. // "location": "path",
  21061. // "required": true,
  21062. // "type": "string"
  21063. // }
  21064. // },
  21065. // "path": "userprofiles/{profileId}/contentCategories",
  21066. // "request": {
  21067. // "$ref": "ContentCategory"
  21068. // },
  21069. // "response": {
  21070. // "$ref": "ContentCategory"
  21071. // },
  21072. // "scopes": [
  21073. // "https://www.googleapis.com/auth/dfatrafficking"
  21074. // ]
  21075. // }
  21076. }
  21077. // method id "dfareporting.contentCategories.update":
  21078. type ContentCategoriesUpdateCall struct {
  21079. s *Service
  21080. profileId int64
  21081. contentcategory *ContentCategory
  21082. urlParams_ gensupport.URLParams
  21083. ctx_ context.Context
  21084. header_ http.Header
  21085. }
  21086. // Update: Updates an existing content category.
  21087. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  21088. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21089. c.profileId = profileId
  21090. c.contentcategory = contentcategory
  21091. return c
  21092. }
  21093. // Fields allows partial responses to be retrieved. See
  21094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21095. // for more information.
  21096. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  21097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21098. return c
  21099. }
  21100. // Context sets the context to be used in this call's Do method. Any
  21101. // pending HTTP request will be aborted if the provided context is
  21102. // canceled.
  21103. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  21104. c.ctx_ = ctx
  21105. return c
  21106. }
  21107. // Header returns an http.Header that can be modified by the caller to
  21108. // add HTTP headers to the request.
  21109. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  21110. if c.header_ == nil {
  21111. c.header_ = make(http.Header)
  21112. }
  21113. return c.header_
  21114. }
  21115. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  21116. reqHeaders := make(http.Header)
  21117. for k, v := range c.header_ {
  21118. reqHeaders[k] = v
  21119. }
  21120. reqHeaders.Set("User-Agent", c.s.userAgent())
  21121. var body io.Reader = nil
  21122. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  21123. if err != nil {
  21124. return nil, err
  21125. }
  21126. reqHeaders.Set("Content-Type", "application/json")
  21127. c.urlParams_.Set("alt", alt)
  21128. c.urlParams_.Set("prettyPrint", "false")
  21129. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  21130. urls += "?" + c.urlParams_.Encode()
  21131. req, err := http.NewRequest("PUT", urls, body)
  21132. if err != nil {
  21133. return nil, err
  21134. }
  21135. req.Header = reqHeaders
  21136. googleapi.Expand(req.URL, map[string]string{
  21137. "profileId": strconv.FormatInt(c.profileId, 10),
  21138. })
  21139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21140. }
  21141. // Do executes the "dfareporting.contentCategories.update" call.
  21142. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  21143. // status code is an error. Response headers are in either
  21144. // *ContentCategory.ServerResponse.Header or (if a response was returned
  21145. // at all) in error.(*googleapi.Error).Header. Use
  21146. // googleapi.IsNotModified to check whether the returned error was
  21147. // because http.StatusNotModified was returned.
  21148. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  21149. gensupport.SetOptions(c.urlParams_, opts...)
  21150. res, err := c.doRequest("json")
  21151. if res != nil && res.StatusCode == http.StatusNotModified {
  21152. if res.Body != nil {
  21153. res.Body.Close()
  21154. }
  21155. return nil, &googleapi.Error{
  21156. Code: res.StatusCode,
  21157. Header: res.Header,
  21158. }
  21159. }
  21160. if err != nil {
  21161. return nil, err
  21162. }
  21163. defer googleapi.CloseBody(res)
  21164. if err := googleapi.CheckResponse(res); err != nil {
  21165. return nil, err
  21166. }
  21167. ret := &ContentCategory{
  21168. ServerResponse: googleapi.ServerResponse{
  21169. Header: res.Header,
  21170. HTTPStatusCode: res.StatusCode,
  21171. },
  21172. }
  21173. target := &ret
  21174. if err := gensupport.DecodeResponse(target, res); err != nil {
  21175. return nil, err
  21176. }
  21177. return ret, nil
  21178. // {
  21179. // "description": "Updates an existing content category.",
  21180. // "httpMethod": "PUT",
  21181. // "id": "dfareporting.contentCategories.update",
  21182. // "parameterOrder": [
  21183. // "profileId"
  21184. // ],
  21185. // "parameters": {
  21186. // "profileId": {
  21187. // "description": "User profile ID associated with this request.",
  21188. // "format": "int64",
  21189. // "location": "path",
  21190. // "required": true,
  21191. // "type": "string"
  21192. // }
  21193. // },
  21194. // "path": "userprofiles/{profileId}/contentCategories",
  21195. // "request": {
  21196. // "$ref": "ContentCategory"
  21197. // },
  21198. // "response": {
  21199. // "$ref": "ContentCategory"
  21200. // },
  21201. // "scopes": [
  21202. // "https://www.googleapis.com/auth/dfatrafficking"
  21203. // ]
  21204. // }
  21205. }
  21206. // method id "dfareporting.conversions.batchinsert":
  21207. type ConversionsBatchinsertCall struct {
  21208. s *Service
  21209. profileId int64
  21210. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  21211. urlParams_ gensupport.URLParams
  21212. ctx_ context.Context
  21213. header_ http.Header
  21214. }
  21215. // Batchinsert: Inserts conversions.
  21216. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  21217. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21218. c.profileId = profileId
  21219. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  21220. return c
  21221. }
  21222. // Fields allows partial responses to be retrieved. See
  21223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21224. // for more information.
  21225. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  21226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21227. return c
  21228. }
  21229. // Context sets the context to be used in this call's Do method. Any
  21230. // pending HTTP request will be aborted if the provided context is
  21231. // canceled.
  21232. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  21233. c.ctx_ = ctx
  21234. return c
  21235. }
  21236. // Header returns an http.Header that can be modified by the caller to
  21237. // add HTTP headers to the request.
  21238. func (c *ConversionsBatchinsertCall) Header() http.Header {
  21239. if c.header_ == nil {
  21240. c.header_ = make(http.Header)
  21241. }
  21242. return c.header_
  21243. }
  21244. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  21245. reqHeaders := make(http.Header)
  21246. for k, v := range c.header_ {
  21247. reqHeaders[k] = v
  21248. }
  21249. reqHeaders.Set("User-Agent", c.s.userAgent())
  21250. var body io.Reader = nil
  21251. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  21252. if err != nil {
  21253. return nil, err
  21254. }
  21255. reqHeaders.Set("Content-Type", "application/json")
  21256. c.urlParams_.Set("alt", alt)
  21257. c.urlParams_.Set("prettyPrint", "false")
  21258. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  21259. urls += "?" + c.urlParams_.Encode()
  21260. req, err := http.NewRequest("POST", urls, body)
  21261. if err != nil {
  21262. return nil, err
  21263. }
  21264. req.Header = reqHeaders
  21265. googleapi.Expand(req.URL, map[string]string{
  21266. "profileId": strconv.FormatInt(c.profileId, 10),
  21267. })
  21268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21269. }
  21270. // Do executes the "dfareporting.conversions.batchinsert" call.
  21271. // Exactly one of *ConversionsBatchInsertResponse or error will be
  21272. // non-nil. Any non-2xx status code is an error. Response headers are in
  21273. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  21274. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21275. // googleapi.IsNotModified to check whether the returned error was
  21276. // because http.StatusNotModified was returned.
  21277. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  21278. gensupport.SetOptions(c.urlParams_, opts...)
  21279. res, err := c.doRequest("json")
  21280. if res != nil && res.StatusCode == http.StatusNotModified {
  21281. if res.Body != nil {
  21282. res.Body.Close()
  21283. }
  21284. return nil, &googleapi.Error{
  21285. Code: res.StatusCode,
  21286. Header: res.Header,
  21287. }
  21288. }
  21289. if err != nil {
  21290. return nil, err
  21291. }
  21292. defer googleapi.CloseBody(res)
  21293. if err := googleapi.CheckResponse(res); err != nil {
  21294. return nil, err
  21295. }
  21296. ret := &ConversionsBatchInsertResponse{
  21297. ServerResponse: googleapi.ServerResponse{
  21298. Header: res.Header,
  21299. HTTPStatusCode: res.StatusCode,
  21300. },
  21301. }
  21302. target := &ret
  21303. if err := gensupport.DecodeResponse(target, res); err != nil {
  21304. return nil, err
  21305. }
  21306. return ret, nil
  21307. // {
  21308. // "description": "Inserts conversions.",
  21309. // "httpMethod": "POST",
  21310. // "id": "dfareporting.conversions.batchinsert",
  21311. // "parameterOrder": [
  21312. // "profileId"
  21313. // ],
  21314. // "parameters": {
  21315. // "profileId": {
  21316. // "description": "User profile ID associated with this request.",
  21317. // "format": "int64",
  21318. // "location": "path",
  21319. // "required": true,
  21320. // "type": "string"
  21321. // }
  21322. // },
  21323. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  21324. // "request": {
  21325. // "$ref": "ConversionsBatchInsertRequest"
  21326. // },
  21327. // "response": {
  21328. // "$ref": "ConversionsBatchInsertResponse"
  21329. // },
  21330. // "scopes": [
  21331. // "https://www.googleapis.com/auth/ddmconversions"
  21332. // ]
  21333. // }
  21334. }
  21335. // method id "dfareporting.conversions.batchupdate":
  21336. type ConversionsBatchupdateCall struct {
  21337. s *Service
  21338. profileId int64
  21339. conversionsbatchupdaterequest *ConversionsBatchUpdateRequest
  21340. urlParams_ gensupport.URLParams
  21341. ctx_ context.Context
  21342. header_ http.Header
  21343. }
  21344. // Batchupdate: Updates existing conversions.
  21345. func (r *ConversionsService) Batchupdate(profileId int64, conversionsbatchupdaterequest *ConversionsBatchUpdateRequest) *ConversionsBatchupdateCall {
  21346. c := &ConversionsBatchupdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21347. c.profileId = profileId
  21348. c.conversionsbatchupdaterequest = conversionsbatchupdaterequest
  21349. return c
  21350. }
  21351. // Fields allows partial responses to be retrieved. See
  21352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21353. // for more information.
  21354. func (c *ConversionsBatchupdateCall) Fields(s ...googleapi.Field) *ConversionsBatchupdateCall {
  21355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21356. return c
  21357. }
  21358. // Context sets the context to be used in this call's Do method. Any
  21359. // pending HTTP request will be aborted if the provided context is
  21360. // canceled.
  21361. func (c *ConversionsBatchupdateCall) Context(ctx context.Context) *ConversionsBatchupdateCall {
  21362. c.ctx_ = ctx
  21363. return c
  21364. }
  21365. // Header returns an http.Header that can be modified by the caller to
  21366. // add HTTP headers to the request.
  21367. func (c *ConversionsBatchupdateCall) Header() http.Header {
  21368. if c.header_ == nil {
  21369. c.header_ = make(http.Header)
  21370. }
  21371. return c.header_
  21372. }
  21373. func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) {
  21374. reqHeaders := make(http.Header)
  21375. for k, v := range c.header_ {
  21376. reqHeaders[k] = v
  21377. }
  21378. reqHeaders.Set("User-Agent", c.s.userAgent())
  21379. var body io.Reader = nil
  21380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest)
  21381. if err != nil {
  21382. return nil, err
  21383. }
  21384. reqHeaders.Set("Content-Type", "application/json")
  21385. c.urlParams_.Set("alt", alt)
  21386. c.urlParams_.Set("prettyPrint", "false")
  21387. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchupdate")
  21388. urls += "?" + c.urlParams_.Encode()
  21389. req, err := http.NewRequest("POST", urls, body)
  21390. if err != nil {
  21391. return nil, err
  21392. }
  21393. req.Header = reqHeaders
  21394. googleapi.Expand(req.URL, map[string]string{
  21395. "profileId": strconv.FormatInt(c.profileId, 10),
  21396. })
  21397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21398. }
  21399. // Do executes the "dfareporting.conversions.batchupdate" call.
  21400. // Exactly one of *ConversionsBatchUpdateResponse or error will be
  21401. // non-nil. Any non-2xx status code is an error. Response headers are in
  21402. // either *ConversionsBatchUpdateResponse.ServerResponse.Header or (if a
  21403. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21404. // googleapi.IsNotModified to check whether the returned error was
  21405. // because http.StatusNotModified was returned.
  21406. func (c *ConversionsBatchupdateCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchUpdateResponse, error) {
  21407. gensupport.SetOptions(c.urlParams_, opts...)
  21408. res, err := c.doRequest("json")
  21409. if res != nil && res.StatusCode == http.StatusNotModified {
  21410. if res.Body != nil {
  21411. res.Body.Close()
  21412. }
  21413. return nil, &googleapi.Error{
  21414. Code: res.StatusCode,
  21415. Header: res.Header,
  21416. }
  21417. }
  21418. if err != nil {
  21419. return nil, err
  21420. }
  21421. defer googleapi.CloseBody(res)
  21422. if err := googleapi.CheckResponse(res); err != nil {
  21423. return nil, err
  21424. }
  21425. ret := &ConversionsBatchUpdateResponse{
  21426. ServerResponse: googleapi.ServerResponse{
  21427. Header: res.Header,
  21428. HTTPStatusCode: res.StatusCode,
  21429. },
  21430. }
  21431. target := &ret
  21432. if err := gensupport.DecodeResponse(target, res); err != nil {
  21433. return nil, err
  21434. }
  21435. return ret, nil
  21436. // {
  21437. // "description": "Updates existing conversions.",
  21438. // "httpMethod": "POST",
  21439. // "id": "dfareporting.conversions.batchupdate",
  21440. // "parameterOrder": [
  21441. // "profileId"
  21442. // ],
  21443. // "parameters": {
  21444. // "profileId": {
  21445. // "description": "User profile ID associated with this request.",
  21446. // "format": "int64",
  21447. // "location": "path",
  21448. // "required": true,
  21449. // "type": "string"
  21450. // }
  21451. // },
  21452. // "path": "userprofiles/{profileId}/conversions/batchupdate",
  21453. // "request": {
  21454. // "$ref": "ConversionsBatchUpdateRequest"
  21455. // },
  21456. // "response": {
  21457. // "$ref": "ConversionsBatchUpdateResponse"
  21458. // },
  21459. // "scopes": [
  21460. // "https://www.googleapis.com/auth/ddmconversions"
  21461. // ]
  21462. // }
  21463. }
  21464. // method id "dfareporting.countries.get":
  21465. type CountriesGetCall struct {
  21466. s *Service
  21467. profileId int64
  21468. dartId int64
  21469. urlParams_ gensupport.URLParams
  21470. ifNoneMatch_ string
  21471. ctx_ context.Context
  21472. header_ http.Header
  21473. }
  21474. // Get: Gets one country by ID.
  21475. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  21476. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21477. c.profileId = profileId
  21478. c.dartId = dartId
  21479. return c
  21480. }
  21481. // Fields allows partial responses to be retrieved. See
  21482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21483. // for more information.
  21484. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  21485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21486. return c
  21487. }
  21488. // IfNoneMatch sets the optional parameter which makes the operation
  21489. // fail if the object's ETag matches the given value. This is useful for
  21490. // getting updates only after the object has changed since the last
  21491. // request. Use googleapi.IsNotModified to check whether the response
  21492. // error from Do is the result of In-None-Match.
  21493. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  21494. c.ifNoneMatch_ = entityTag
  21495. return c
  21496. }
  21497. // Context sets the context to be used in this call's Do method. Any
  21498. // pending HTTP request will be aborted if the provided context is
  21499. // canceled.
  21500. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  21501. c.ctx_ = ctx
  21502. return c
  21503. }
  21504. // Header returns an http.Header that can be modified by the caller to
  21505. // add HTTP headers to the request.
  21506. func (c *CountriesGetCall) Header() http.Header {
  21507. if c.header_ == nil {
  21508. c.header_ = make(http.Header)
  21509. }
  21510. return c.header_
  21511. }
  21512. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  21513. reqHeaders := make(http.Header)
  21514. for k, v := range c.header_ {
  21515. reqHeaders[k] = v
  21516. }
  21517. reqHeaders.Set("User-Agent", c.s.userAgent())
  21518. if c.ifNoneMatch_ != "" {
  21519. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21520. }
  21521. var body io.Reader = nil
  21522. c.urlParams_.Set("alt", alt)
  21523. c.urlParams_.Set("prettyPrint", "false")
  21524. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  21525. urls += "?" + c.urlParams_.Encode()
  21526. req, err := http.NewRequest("GET", urls, body)
  21527. if err != nil {
  21528. return nil, err
  21529. }
  21530. req.Header = reqHeaders
  21531. googleapi.Expand(req.URL, map[string]string{
  21532. "profileId": strconv.FormatInt(c.profileId, 10),
  21533. "dartId": strconv.FormatInt(c.dartId, 10),
  21534. })
  21535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21536. }
  21537. // Do executes the "dfareporting.countries.get" call.
  21538. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  21539. // code is an error. Response headers are in either
  21540. // *Country.ServerResponse.Header or (if a response was returned at all)
  21541. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21542. // check whether the returned error was because http.StatusNotModified
  21543. // was returned.
  21544. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  21545. gensupport.SetOptions(c.urlParams_, opts...)
  21546. res, err := c.doRequest("json")
  21547. if res != nil && res.StatusCode == http.StatusNotModified {
  21548. if res.Body != nil {
  21549. res.Body.Close()
  21550. }
  21551. return nil, &googleapi.Error{
  21552. Code: res.StatusCode,
  21553. Header: res.Header,
  21554. }
  21555. }
  21556. if err != nil {
  21557. return nil, err
  21558. }
  21559. defer googleapi.CloseBody(res)
  21560. if err := googleapi.CheckResponse(res); err != nil {
  21561. return nil, err
  21562. }
  21563. ret := &Country{
  21564. ServerResponse: googleapi.ServerResponse{
  21565. Header: res.Header,
  21566. HTTPStatusCode: res.StatusCode,
  21567. },
  21568. }
  21569. target := &ret
  21570. if err := gensupport.DecodeResponse(target, res); err != nil {
  21571. return nil, err
  21572. }
  21573. return ret, nil
  21574. // {
  21575. // "description": "Gets one country by ID.",
  21576. // "httpMethod": "GET",
  21577. // "id": "dfareporting.countries.get",
  21578. // "parameterOrder": [
  21579. // "profileId",
  21580. // "dartId"
  21581. // ],
  21582. // "parameters": {
  21583. // "dartId": {
  21584. // "description": "Country DART ID.",
  21585. // "format": "int64",
  21586. // "location": "path",
  21587. // "required": true,
  21588. // "type": "string"
  21589. // },
  21590. // "profileId": {
  21591. // "description": "User profile ID associated with this request.",
  21592. // "format": "int64",
  21593. // "location": "path",
  21594. // "required": true,
  21595. // "type": "string"
  21596. // }
  21597. // },
  21598. // "path": "userprofiles/{profileId}/countries/{dartId}",
  21599. // "response": {
  21600. // "$ref": "Country"
  21601. // },
  21602. // "scopes": [
  21603. // "https://www.googleapis.com/auth/dfatrafficking"
  21604. // ]
  21605. // }
  21606. }
  21607. // method id "dfareporting.countries.list":
  21608. type CountriesListCall struct {
  21609. s *Service
  21610. profileId int64
  21611. urlParams_ gensupport.URLParams
  21612. ifNoneMatch_ string
  21613. ctx_ context.Context
  21614. header_ http.Header
  21615. }
  21616. // List: Retrieves a list of countries.
  21617. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  21618. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21619. c.profileId = profileId
  21620. return c
  21621. }
  21622. // Fields allows partial responses to be retrieved. See
  21623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21624. // for more information.
  21625. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  21626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21627. return c
  21628. }
  21629. // IfNoneMatch sets the optional parameter which makes the operation
  21630. // fail if the object's ETag matches the given value. This is useful for
  21631. // getting updates only after the object has changed since the last
  21632. // request. Use googleapi.IsNotModified to check whether the response
  21633. // error from Do is the result of In-None-Match.
  21634. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  21635. c.ifNoneMatch_ = entityTag
  21636. return c
  21637. }
  21638. // Context sets the context to be used in this call's Do method. Any
  21639. // pending HTTP request will be aborted if the provided context is
  21640. // canceled.
  21641. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  21642. c.ctx_ = ctx
  21643. return c
  21644. }
  21645. // Header returns an http.Header that can be modified by the caller to
  21646. // add HTTP headers to the request.
  21647. func (c *CountriesListCall) Header() http.Header {
  21648. if c.header_ == nil {
  21649. c.header_ = make(http.Header)
  21650. }
  21651. return c.header_
  21652. }
  21653. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  21654. reqHeaders := make(http.Header)
  21655. for k, v := range c.header_ {
  21656. reqHeaders[k] = v
  21657. }
  21658. reqHeaders.Set("User-Agent", c.s.userAgent())
  21659. if c.ifNoneMatch_ != "" {
  21660. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21661. }
  21662. var body io.Reader = nil
  21663. c.urlParams_.Set("alt", alt)
  21664. c.urlParams_.Set("prettyPrint", "false")
  21665. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  21666. urls += "?" + c.urlParams_.Encode()
  21667. req, err := http.NewRequest("GET", urls, body)
  21668. if err != nil {
  21669. return nil, err
  21670. }
  21671. req.Header = reqHeaders
  21672. googleapi.Expand(req.URL, map[string]string{
  21673. "profileId": strconv.FormatInt(c.profileId, 10),
  21674. })
  21675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21676. }
  21677. // Do executes the "dfareporting.countries.list" call.
  21678. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  21679. // non-2xx status code is an error. Response headers are in either
  21680. // *CountriesListResponse.ServerResponse.Header or (if a response was
  21681. // returned at all) in error.(*googleapi.Error).Header. Use
  21682. // googleapi.IsNotModified to check whether the returned error was
  21683. // because http.StatusNotModified was returned.
  21684. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  21685. gensupport.SetOptions(c.urlParams_, opts...)
  21686. res, err := c.doRequest("json")
  21687. if res != nil && res.StatusCode == http.StatusNotModified {
  21688. if res.Body != nil {
  21689. res.Body.Close()
  21690. }
  21691. return nil, &googleapi.Error{
  21692. Code: res.StatusCode,
  21693. Header: res.Header,
  21694. }
  21695. }
  21696. if err != nil {
  21697. return nil, err
  21698. }
  21699. defer googleapi.CloseBody(res)
  21700. if err := googleapi.CheckResponse(res); err != nil {
  21701. return nil, err
  21702. }
  21703. ret := &CountriesListResponse{
  21704. ServerResponse: googleapi.ServerResponse{
  21705. Header: res.Header,
  21706. HTTPStatusCode: res.StatusCode,
  21707. },
  21708. }
  21709. target := &ret
  21710. if err := gensupport.DecodeResponse(target, res); err != nil {
  21711. return nil, err
  21712. }
  21713. return ret, nil
  21714. // {
  21715. // "description": "Retrieves a list of countries.",
  21716. // "httpMethod": "GET",
  21717. // "id": "dfareporting.countries.list",
  21718. // "parameterOrder": [
  21719. // "profileId"
  21720. // ],
  21721. // "parameters": {
  21722. // "profileId": {
  21723. // "description": "User profile ID associated with this request.",
  21724. // "format": "int64",
  21725. // "location": "path",
  21726. // "required": true,
  21727. // "type": "string"
  21728. // }
  21729. // },
  21730. // "path": "userprofiles/{profileId}/countries",
  21731. // "response": {
  21732. // "$ref": "CountriesListResponse"
  21733. // },
  21734. // "scopes": [
  21735. // "https://www.googleapis.com/auth/dfatrafficking"
  21736. // ]
  21737. // }
  21738. }
  21739. // method id "dfareporting.creativeAssets.insert":
  21740. type CreativeAssetsInsertCall struct {
  21741. s *Service
  21742. profileId int64
  21743. advertiserId int64
  21744. creativeassetmetadata *CreativeAssetMetadata
  21745. urlParams_ gensupport.URLParams
  21746. mediaInfo_ *gensupport.MediaInfo
  21747. ctx_ context.Context
  21748. header_ http.Header
  21749. }
  21750. // Insert: Inserts a new creative asset.
  21751. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  21752. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21753. c.profileId = profileId
  21754. c.advertiserId = advertiserId
  21755. c.creativeassetmetadata = creativeassetmetadata
  21756. return c
  21757. }
  21758. // Media specifies the media to upload in one or more chunks. The chunk
  21759. // size may be controlled by supplying a MediaOption generated by
  21760. // googleapi.ChunkSize. The chunk size defaults to
  21761. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21762. // upload request will be determined by sniffing the contents of r,
  21763. // unless a MediaOption generated by googleapi.ContentType is
  21764. // supplied.
  21765. // At most one of Media and ResumableMedia may be set.
  21766. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  21767. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21768. return c
  21769. }
  21770. // ResumableMedia specifies the media to upload in chunks and can be
  21771. // canceled with ctx.
  21772. //
  21773. // Deprecated: use Media instead.
  21774. //
  21775. // At most one of Media and ResumableMedia may be set. mediaType
  21776. // identifies the MIME media type of the upload, such as "image/png". If
  21777. // mediaType is "", it will be auto-detected. The provided ctx will
  21778. // supersede any context previously provided to the Context method.
  21779. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  21780. c.ctx_ = ctx
  21781. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21782. return c
  21783. }
  21784. // ProgressUpdater provides a callback function that will be called
  21785. // after every chunk. It should be a low-latency function in order to
  21786. // not slow down the upload operation. This should only be called when
  21787. // using ResumableMedia (as opposed to Media).
  21788. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  21789. c.mediaInfo_.SetProgressUpdater(pu)
  21790. return c
  21791. }
  21792. // Fields allows partial responses to be retrieved. See
  21793. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21794. // for more information.
  21795. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  21796. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21797. return c
  21798. }
  21799. // Context sets the context to be used in this call's Do method. Any
  21800. // pending HTTP request will be aborted if the provided context is
  21801. // canceled.
  21802. // This context will supersede any context previously provided to the
  21803. // ResumableMedia method.
  21804. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  21805. c.ctx_ = ctx
  21806. return c
  21807. }
  21808. // Header returns an http.Header that can be modified by the caller to
  21809. // add HTTP headers to the request.
  21810. func (c *CreativeAssetsInsertCall) Header() http.Header {
  21811. if c.header_ == nil {
  21812. c.header_ = make(http.Header)
  21813. }
  21814. return c.header_
  21815. }
  21816. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  21817. reqHeaders := make(http.Header)
  21818. for k, v := range c.header_ {
  21819. reqHeaders[k] = v
  21820. }
  21821. reqHeaders.Set("User-Agent", c.s.userAgent())
  21822. var body io.Reader = nil
  21823. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  21824. if err != nil {
  21825. return nil, err
  21826. }
  21827. reqHeaders.Set("Content-Type", "application/json")
  21828. c.urlParams_.Set("alt", alt)
  21829. c.urlParams_.Set("prettyPrint", "false")
  21830. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  21831. if c.mediaInfo_ != nil {
  21832. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21833. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21834. }
  21835. if body == nil {
  21836. body = new(bytes.Buffer)
  21837. reqHeaders.Set("Content-Type", "application/json")
  21838. }
  21839. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21840. defer cleanup()
  21841. urls += "?" + c.urlParams_.Encode()
  21842. req, err := http.NewRequest("POST", urls, body)
  21843. if err != nil {
  21844. return nil, err
  21845. }
  21846. req.Header = reqHeaders
  21847. req.GetBody = getBody
  21848. googleapi.Expand(req.URL, map[string]string{
  21849. "profileId": strconv.FormatInt(c.profileId, 10),
  21850. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  21851. })
  21852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21853. }
  21854. // Do executes the "dfareporting.creativeAssets.insert" call.
  21855. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  21856. // non-2xx status code is an error. Response headers are in either
  21857. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  21858. // returned at all) in error.(*googleapi.Error).Header. Use
  21859. // googleapi.IsNotModified to check whether the returned error was
  21860. // because http.StatusNotModified was returned.
  21861. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  21862. gensupport.SetOptions(c.urlParams_, opts...)
  21863. res, err := c.doRequest("json")
  21864. if res != nil && res.StatusCode == http.StatusNotModified {
  21865. if res.Body != nil {
  21866. res.Body.Close()
  21867. }
  21868. return nil, &googleapi.Error{
  21869. Code: res.StatusCode,
  21870. Header: res.Header,
  21871. }
  21872. }
  21873. if err != nil {
  21874. return nil, err
  21875. }
  21876. defer googleapi.CloseBody(res)
  21877. if err := googleapi.CheckResponse(res); err != nil {
  21878. return nil, err
  21879. }
  21880. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21881. if rx != nil {
  21882. rx.Client = c.s.client
  21883. rx.UserAgent = c.s.userAgent()
  21884. ctx := c.ctx_
  21885. if ctx == nil {
  21886. ctx = context.TODO()
  21887. }
  21888. res, err = rx.Upload(ctx)
  21889. if err != nil {
  21890. return nil, err
  21891. }
  21892. defer res.Body.Close()
  21893. if err := googleapi.CheckResponse(res); err != nil {
  21894. return nil, err
  21895. }
  21896. }
  21897. ret := &CreativeAssetMetadata{
  21898. ServerResponse: googleapi.ServerResponse{
  21899. Header: res.Header,
  21900. HTTPStatusCode: res.StatusCode,
  21901. },
  21902. }
  21903. target := &ret
  21904. if err := gensupport.DecodeResponse(target, res); err != nil {
  21905. return nil, err
  21906. }
  21907. return ret, nil
  21908. // {
  21909. // "description": "Inserts a new creative asset.",
  21910. // "httpMethod": "POST",
  21911. // "id": "dfareporting.creativeAssets.insert",
  21912. // "mediaUpload": {
  21913. // "accept": [
  21914. // "*/*"
  21915. // ],
  21916. // "maxSize": "1024MB",
  21917. // "protocols": {
  21918. // "resumable": {
  21919. // "multipart": true,
  21920. // "path": "/resumable/upload/dfareporting/v3.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21921. // },
  21922. // "simple": {
  21923. // "multipart": true,
  21924. // "path": "/upload/dfareporting/v3.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21925. // }
  21926. // }
  21927. // },
  21928. // "parameterOrder": [
  21929. // "profileId",
  21930. // "advertiserId"
  21931. // ],
  21932. // "parameters": {
  21933. // "advertiserId": {
  21934. // "description": "Advertiser ID of this creative. This is a required field.",
  21935. // "format": "int64",
  21936. // "location": "path",
  21937. // "required": true,
  21938. // "type": "string"
  21939. // },
  21940. // "profileId": {
  21941. // "description": "User profile ID associated with this request.",
  21942. // "format": "int64",
  21943. // "location": "path",
  21944. // "required": true,
  21945. // "type": "string"
  21946. // }
  21947. // },
  21948. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  21949. // "request": {
  21950. // "$ref": "CreativeAssetMetadata"
  21951. // },
  21952. // "response": {
  21953. // "$ref": "CreativeAssetMetadata"
  21954. // },
  21955. // "scopes": [
  21956. // "https://www.googleapis.com/auth/dfatrafficking"
  21957. // ],
  21958. // "supportsMediaUpload": true
  21959. // }
  21960. }
  21961. // method id "dfareporting.creativeFieldValues.delete":
  21962. type CreativeFieldValuesDeleteCall struct {
  21963. s *Service
  21964. profileId int64
  21965. creativeFieldId int64
  21966. id int64
  21967. urlParams_ gensupport.URLParams
  21968. ctx_ context.Context
  21969. header_ http.Header
  21970. }
  21971. // Delete: Deletes an existing creative field value.
  21972. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  21973. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21974. c.profileId = profileId
  21975. c.creativeFieldId = creativeFieldId
  21976. c.id = id
  21977. return c
  21978. }
  21979. // Fields allows partial responses to be retrieved. See
  21980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21981. // for more information.
  21982. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  21983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21984. return c
  21985. }
  21986. // Context sets the context to be used in this call's Do method. Any
  21987. // pending HTTP request will be aborted if the provided context is
  21988. // canceled.
  21989. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  21990. c.ctx_ = ctx
  21991. return c
  21992. }
  21993. // Header returns an http.Header that can be modified by the caller to
  21994. // add HTTP headers to the request.
  21995. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  21996. if c.header_ == nil {
  21997. c.header_ = make(http.Header)
  21998. }
  21999. return c.header_
  22000. }
  22001. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  22002. reqHeaders := make(http.Header)
  22003. for k, v := range c.header_ {
  22004. reqHeaders[k] = v
  22005. }
  22006. reqHeaders.Set("User-Agent", c.s.userAgent())
  22007. var body io.Reader = nil
  22008. c.urlParams_.Set("alt", alt)
  22009. c.urlParams_.Set("prettyPrint", "false")
  22010. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  22011. urls += "?" + c.urlParams_.Encode()
  22012. req, err := http.NewRequest("DELETE", urls, body)
  22013. if err != nil {
  22014. return nil, err
  22015. }
  22016. req.Header = reqHeaders
  22017. googleapi.Expand(req.URL, map[string]string{
  22018. "profileId": strconv.FormatInt(c.profileId, 10),
  22019. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22020. "id": strconv.FormatInt(c.id, 10),
  22021. })
  22022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22023. }
  22024. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  22025. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  22026. gensupport.SetOptions(c.urlParams_, opts...)
  22027. res, err := c.doRequest("json")
  22028. if err != nil {
  22029. return err
  22030. }
  22031. defer googleapi.CloseBody(res)
  22032. if err := googleapi.CheckResponse(res); err != nil {
  22033. return err
  22034. }
  22035. return nil
  22036. // {
  22037. // "description": "Deletes an existing creative field value.",
  22038. // "httpMethod": "DELETE",
  22039. // "id": "dfareporting.creativeFieldValues.delete",
  22040. // "parameterOrder": [
  22041. // "profileId",
  22042. // "creativeFieldId",
  22043. // "id"
  22044. // ],
  22045. // "parameters": {
  22046. // "creativeFieldId": {
  22047. // "description": "Creative field ID for this creative field value.",
  22048. // "format": "int64",
  22049. // "location": "path",
  22050. // "required": true,
  22051. // "type": "string"
  22052. // },
  22053. // "id": {
  22054. // "description": "Creative Field Value ID",
  22055. // "format": "int64",
  22056. // "location": "path",
  22057. // "required": true,
  22058. // "type": "string"
  22059. // },
  22060. // "profileId": {
  22061. // "description": "User profile ID associated with this request.",
  22062. // "format": "int64",
  22063. // "location": "path",
  22064. // "required": true,
  22065. // "type": "string"
  22066. // }
  22067. // },
  22068. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22069. // "scopes": [
  22070. // "https://www.googleapis.com/auth/dfatrafficking"
  22071. // ]
  22072. // }
  22073. }
  22074. // method id "dfareporting.creativeFieldValues.get":
  22075. type CreativeFieldValuesGetCall struct {
  22076. s *Service
  22077. profileId int64
  22078. creativeFieldId int64
  22079. id int64
  22080. urlParams_ gensupport.URLParams
  22081. ifNoneMatch_ string
  22082. ctx_ context.Context
  22083. header_ http.Header
  22084. }
  22085. // Get: Gets one creative field value by ID.
  22086. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  22087. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22088. c.profileId = profileId
  22089. c.creativeFieldId = creativeFieldId
  22090. c.id = id
  22091. return c
  22092. }
  22093. // Fields allows partial responses to be retrieved. See
  22094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22095. // for more information.
  22096. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  22097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22098. return c
  22099. }
  22100. // IfNoneMatch sets the optional parameter which makes the operation
  22101. // fail if the object's ETag matches the given value. This is useful for
  22102. // getting updates only after the object has changed since the last
  22103. // request. Use googleapi.IsNotModified to check whether the response
  22104. // error from Do is the result of In-None-Match.
  22105. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  22106. c.ifNoneMatch_ = entityTag
  22107. return c
  22108. }
  22109. // Context sets the context to be used in this call's Do method. Any
  22110. // pending HTTP request will be aborted if the provided context is
  22111. // canceled.
  22112. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  22113. c.ctx_ = ctx
  22114. return c
  22115. }
  22116. // Header returns an http.Header that can be modified by the caller to
  22117. // add HTTP headers to the request.
  22118. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  22119. if c.header_ == nil {
  22120. c.header_ = make(http.Header)
  22121. }
  22122. return c.header_
  22123. }
  22124. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  22125. reqHeaders := make(http.Header)
  22126. for k, v := range c.header_ {
  22127. reqHeaders[k] = v
  22128. }
  22129. reqHeaders.Set("User-Agent", c.s.userAgent())
  22130. if c.ifNoneMatch_ != "" {
  22131. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22132. }
  22133. var body io.Reader = nil
  22134. c.urlParams_.Set("alt", alt)
  22135. c.urlParams_.Set("prettyPrint", "false")
  22136. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  22137. urls += "?" + c.urlParams_.Encode()
  22138. req, err := http.NewRequest("GET", urls, body)
  22139. if err != nil {
  22140. return nil, err
  22141. }
  22142. req.Header = reqHeaders
  22143. googleapi.Expand(req.URL, map[string]string{
  22144. "profileId": strconv.FormatInt(c.profileId, 10),
  22145. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22146. "id": strconv.FormatInt(c.id, 10),
  22147. })
  22148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22149. }
  22150. // Do executes the "dfareporting.creativeFieldValues.get" call.
  22151. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22152. // non-2xx status code is an error. Response headers are in either
  22153. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22154. // returned at all) in error.(*googleapi.Error).Header. Use
  22155. // googleapi.IsNotModified to check whether the returned error was
  22156. // because http.StatusNotModified was returned.
  22157. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22158. gensupport.SetOptions(c.urlParams_, opts...)
  22159. res, err := c.doRequest("json")
  22160. if res != nil && res.StatusCode == http.StatusNotModified {
  22161. if res.Body != nil {
  22162. res.Body.Close()
  22163. }
  22164. return nil, &googleapi.Error{
  22165. Code: res.StatusCode,
  22166. Header: res.Header,
  22167. }
  22168. }
  22169. if err != nil {
  22170. return nil, err
  22171. }
  22172. defer googleapi.CloseBody(res)
  22173. if err := googleapi.CheckResponse(res); err != nil {
  22174. return nil, err
  22175. }
  22176. ret := &CreativeFieldValue{
  22177. ServerResponse: googleapi.ServerResponse{
  22178. Header: res.Header,
  22179. HTTPStatusCode: res.StatusCode,
  22180. },
  22181. }
  22182. target := &ret
  22183. if err := gensupport.DecodeResponse(target, res); err != nil {
  22184. return nil, err
  22185. }
  22186. return ret, nil
  22187. // {
  22188. // "description": "Gets one creative field value by ID.",
  22189. // "httpMethod": "GET",
  22190. // "id": "dfareporting.creativeFieldValues.get",
  22191. // "parameterOrder": [
  22192. // "profileId",
  22193. // "creativeFieldId",
  22194. // "id"
  22195. // ],
  22196. // "parameters": {
  22197. // "creativeFieldId": {
  22198. // "description": "Creative field ID for this creative field value.",
  22199. // "format": "int64",
  22200. // "location": "path",
  22201. // "required": true,
  22202. // "type": "string"
  22203. // },
  22204. // "id": {
  22205. // "description": "Creative Field Value ID",
  22206. // "format": "int64",
  22207. // "location": "path",
  22208. // "required": true,
  22209. // "type": "string"
  22210. // },
  22211. // "profileId": {
  22212. // "description": "User profile ID associated with this request.",
  22213. // "format": "int64",
  22214. // "location": "path",
  22215. // "required": true,
  22216. // "type": "string"
  22217. // }
  22218. // },
  22219. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22220. // "response": {
  22221. // "$ref": "CreativeFieldValue"
  22222. // },
  22223. // "scopes": [
  22224. // "https://www.googleapis.com/auth/dfatrafficking"
  22225. // ]
  22226. // }
  22227. }
  22228. // method id "dfareporting.creativeFieldValues.insert":
  22229. type CreativeFieldValuesInsertCall struct {
  22230. s *Service
  22231. profileId int64
  22232. creativeFieldId int64
  22233. creativefieldvalue *CreativeFieldValue
  22234. urlParams_ gensupport.URLParams
  22235. ctx_ context.Context
  22236. header_ http.Header
  22237. }
  22238. // Insert: Inserts a new creative field value.
  22239. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  22240. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22241. c.profileId = profileId
  22242. c.creativeFieldId = creativeFieldId
  22243. c.creativefieldvalue = creativefieldvalue
  22244. return c
  22245. }
  22246. // Fields allows partial responses to be retrieved. See
  22247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22248. // for more information.
  22249. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  22250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22251. return c
  22252. }
  22253. // Context sets the context to be used in this call's Do method. Any
  22254. // pending HTTP request will be aborted if the provided context is
  22255. // canceled.
  22256. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  22257. c.ctx_ = ctx
  22258. return c
  22259. }
  22260. // Header returns an http.Header that can be modified by the caller to
  22261. // add HTTP headers to the request.
  22262. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  22263. if c.header_ == nil {
  22264. c.header_ = make(http.Header)
  22265. }
  22266. return c.header_
  22267. }
  22268. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  22269. reqHeaders := make(http.Header)
  22270. for k, v := range c.header_ {
  22271. reqHeaders[k] = v
  22272. }
  22273. reqHeaders.Set("User-Agent", c.s.userAgent())
  22274. var body io.Reader = nil
  22275. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22276. if err != nil {
  22277. return nil, err
  22278. }
  22279. reqHeaders.Set("Content-Type", "application/json")
  22280. c.urlParams_.Set("alt", alt)
  22281. c.urlParams_.Set("prettyPrint", "false")
  22282. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22283. urls += "?" + c.urlParams_.Encode()
  22284. req, err := http.NewRequest("POST", urls, body)
  22285. if err != nil {
  22286. return nil, err
  22287. }
  22288. req.Header = reqHeaders
  22289. googleapi.Expand(req.URL, map[string]string{
  22290. "profileId": strconv.FormatInt(c.profileId, 10),
  22291. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22292. })
  22293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22294. }
  22295. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  22296. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22297. // non-2xx status code is an error. Response headers are in either
  22298. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22299. // returned at all) in error.(*googleapi.Error).Header. Use
  22300. // googleapi.IsNotModified to check whether the returned error was
  22301. // because http.StatusNotModified was returned.
  22302. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22303. gensupport.SetOptions(c.urlParams_, opts...)
  22304. res, err := c.doRequest("json")
  22305. if res != nil && res.StatusCode == http.StatusNotModified {
  22306. if res.Body != nil {
  22307. res.Body.Close()
  22308. }
  22309. return nil, &googleapi.Error{
  22310. Code: res.StatusCode,
  22311. Header: res.Header,
  22312. }
  22313. }
  22314. if err != nil {
  22315. return nil, err
  22316. }
  22317. defer googleapi.CloseBody(res)
  22318. if err := googleapi.CheckResponse(res); err != nil {
  22319. return nil, err
  22320. }
  22321. ret := &CreativeFieldValue{
  22322. ServerResponse: googleapi.ServerResponse{
  22323. Header: res.Header,
  22324. HTTPStatusCode: res.StatusCode,
  22325. },
  22326. }
  22327. target := &ret
  22328. if err := gensupport.DecodeResponse(target, res); err != nil {
  22329. return nil, err
  22330. }
  22331. return ret, nil
  22332. // {
  22333. // "description": "Inserts a new creative field value.",
  22334. // "httpMethod": "POST",
  22335. // "id": "dfareporting.creativeFieldValues.insert",
  22336. // "parameterOrder": [
  22337. // "profileId",
  22338. // "creativeFieldId"
  22339. // ],
  22340. // "parameters": {
  22341. // "creativeFieldId": {
  22342. // "description": "Creative field ID for this creative field value.",
  22343. // "format": "int64",
  22344. // "location": "path",
  22345. // "required": true,
  22346. // "type": "string"
  22347. // },
  22348. // "profileId": {
  22349. // "description": "User profile ID associated with this request.",
  22350. // "format": "int64",
  22351. // "location": "path",
  22352. // "required": true,
  22353. // "type": "string"
  22354. // }
  22355. // },
  22356. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22357. // "request": {
  22358. // "$ref": "CreativeFieldValue"
  22359. // },
  22360. // "response": {
  22361. // "$ref": "CreativeFieldValue"
  22362. // },
  22363. // "scopes": [
  22364. // "https://www.googleapis.com/auth/dfatrafficking"
  22365. // ]
  22366. // }
  22367. }
  22368. // method id "dfareporting.creativeFieldValues.list":
  22369. type CreativeFieldValuesListCall struct {
  22370. s *Service
  22371. profileId int64
  22372. creativeFieldId int64
  22373. urlParams_ gensupport.URLParams
  22374. ifNoneMatch_ string
  22375. ctx_ context.Context
  22376. header_ http.Header
  22377. }
  22378. // List: Retrieves a list of creative field values, possibly filtered.
  22379. // This method supports paging.
  22380. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  22381. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22382. c.profileId = profileId
  22383. c.creativeFieldId = creativeFieldId
  22384. return c
  22385. }
  22386. // Ids sets the optional parameter "ids": Select only creative field
  22387. // values with these IDs.
  22388. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  22389. var ids_ []string
  22390. for _, v := range ids {
  22391. ids_ = append(ids_, fmt.Sprint(v))
  22392. }
  22393. c.urlParams_.SetMulti("ids", ids_)
  22394. return c
  22395. }
  22396. // MaxResults sets the optional parameter "maxResults": Maximum number
  22397. // of results to return.
  22398. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  22399. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22400. return c
  22401. }
  22402. // PageToken sets the optional parameter "pageToken": Value of the
  22403. // nextPageToken from the previous result page.
  22404. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  22405. c.urlParams_.Set("pageToken", pageToken)
  22406. return c
  22407. }
  22408. // SearchString sets the optional parameter "searchString": Allows
  22409. // searching for creative field values by their values. Wildcards (e.g.
  22410. // *) are not allowed.
  22411. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  22412. c.urlParams_.Set("searchString", searchString)
  22413. return c
  22414. }
  22415. // SortField sets the optional parameter "sortField": Field by which to
  22416. // sort the list.
  22417. //
  22418. // Possible values:
  22419. // "ID" (default)
  22420. // "VALUE"
  22421. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  22422. c.urlParams_.Set("sortField", sortField)
  22423. return c
  22424. }
  22425. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22426. // results.
  22427. //
  22428. // Possible values:
  22429. // "ASCENDING" (default)
  22430. // "DESCENDING"
  22431. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  22432. c.urlParams_.Set("sortOrder", sortOrder)
  22433. return c
  22434. }
  22435. // Fields allows partial responses to be retrieved. See
  22436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22437. // for more information.
  22438. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  22439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22440. return c
  22441. }
  22442. // IfNoneMatch sets the optional parameter which makes the operation
  22443. // fail if the object's ETag matches the given value. This is useful for
  22444. // getting updates only after the object has changed since the last
  22445. // request. Use googleapi.IsNotModified to check whether the response
  22446. // error from Do is the result of In-None-Match.
  22447. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  22448. c.ifNoneMatch_ = entityTag
  22449. return c
  22450. }
  22451. // Context sets the context to be used in this call's Do method. Any
  22452. // pending HTTP request will be aborted if the provided context is
  22453. // canceled.
  22454. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  22455. c.ctx_ = ctx
  22456. return c
  22457. }
  22458. // Header returns an http.Header that can be modified by the caller to
  22459. // add HTTP headers to the request.
  22460. func (c *CreativeFieldValuesListCall) Header() http.Header {
  22461. if c.header_ == nil {
  22462. c.header_ = make(http.Header)
  22463. }
  22464. return c.header_
  22465. }
  22466. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  22467. reqHeaders := make(http.Header)
  22468. for k, v := range c.header_ {
  22469. reqHeaders[k] = v
  22470. }
  22471. reqHeaders.Set("User-Agent", c.s.userAgent())
  22472. if c.ifNoneMatch_ != "" {
  22473. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22474. }
  22475. var body io.Reader = nil
  22476. c.urlParams_.Set("alt", alt)
  22477. c.urlParams_.Set("prettyPrint", "false")
  22478. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22479. urls += "?" + c.urlParams_.Encode()
  22480. req, err := http.NewRequest("GET", urls, body)
  22481. if err != nil {
  22482. return nil, err
  22483. }
  22484. req.Header = reqHeaders
  22485. googleapi.Expand(req.URL, map[string]string{
  22486. "profileId": strconv.FormatInt(c.profileId, 10),
  22487. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22488. })
  22489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22490. }
  22491. // Do executes the "dfareporting.creativeFieldValues.list" call.
  22492. // Exactly one of *CreativeFieldValuesListResponse or error will be
  22493. // non-nil. Any non-2xx status code is an error. Response headers are in
  22494. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  22495. // a response was returned at all) in error.(*googleapi.Error).Header.
  22496. // Use googleapi.IsNotModified to check whether the returned error was
  22497. // because http.StatusNotModified was returned.
  22498. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  22499. gensupport.SetOptions(c.urlParams_, opts...)
  22500. res, err := c.doRequest("json")
  22501. if res != nil && res.StatusCode == http.StatusNotModified {
  22502. if res.Body != nil {
  22503. res.Body.Close()
  22504. }
  22505. return nil, &googleapi.Error{
  22506. Code: res.StatusCode,
  22507. Header: res.Header,
  22508. }
  22509. }
  22510. if err != nil {
  22511. return nil, err
  22512. }
  22513. defer googleapi.CloseBody(res)
  22514. if err := googleapi.CheckResponse(res); err != nil {
  22515. return nil, err
  22516. }
  22517. ret := &CreativeFieldValuesListResponse{
  22518. ServerResponse: googleapi.ServerResponse{
  22519. Header: res.Header,
  22520. HTTPStatusCode: res.StatusCode,
  22521. },
  22522. }
  22523. target := &ret
  22524. if err := gensupport.DecodeResponse(target, res); err != nil {
  22525. return nil, err
  22526. }
  22527. return ret, nil
  22528. // {
  22529. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  22530. // "httpMethod": "GET",
  22531. // "id": "dfareporting.creativeFieldValues.list",
  22532. // "parameterOrder": [
  22533. // "profileId",
  22534. // "creativeFieldId"
  22535. // ],
  22536. // "parameters": {
  22537. // "creativeFieldId": {
  22538. // "description": "Creative field ID for this creative field value.",
  22539. // "format": "int64",
  22540. // "location": "path",
  22541. // "required": true,
  22542. // "type": "string"
  22543. // },
  22544. // "ids": {
  22545. // "description": "Select only creative field values with these IDs.",
  22546. // "format": "int64",
  22547. // "location": "query",
  22548. // "repeated": true,
  22549. // "type": "string"
  22550. // },
  22551. // "maxResults": {
  22552. // "default": "1000",
  22553. // "description": "Maximum number of results to return.",
  22554. // "format": "int32",
  22555. // "location": "query",
  22556. // "maximum": "1000",
  22557. // "minimum": "0",
  22558. // "type": "integer"
  22559. // },
  22560. // "pageToken": {
  22561. // "description": "Value of the nextPageToken from the previous result page.",
  22562. // "location": "query",
  22563. // "type": "string"
  22564. // },
  22565. // "profileId": {
  22566. // "description": "User profile ID associated with this request.",
  22567. // "format": "int64",
  22568. // "location": "path",
  22569. // "required": true,
  22570. // "type": "string"
  22571. // },
  22572. // "searchString": {
  22573. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  22574. // "location": "query",
  22575. // "type": "string"
  22576. // },
  22577. // "sortField": {
  22578. // "default": "ID",
  22579. // "description": "Field by which to sort the list.",
  22580. // "enum": [
  22581. // "ID",
  22582. // "VALUE"
  22583. // ],
  22584. // "enumDescriptions": [
  22585. // "",
  22586. // ""
  22587. // ],
  22588. // "location": "query",
  22589. // "type": "string"
  22590. // },
  22591. // "sortOrder": {
  22592. // "default": "ASCENDING",
  22593. // "description": "Order of sorted results.",
  22594. // "enum": [
  22595. // "ASCENDING",
  22596. // "DESCENDING"
  22597. // ],
  22598. // "enumDescriptions": [
  22599. // "",
  22600. // ""
  22601. // ],
  22602. // "location": "query",
  22603. // "type": "string"
  22604. // }
  22605. // },
  22606. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22607. // "response": {
  22608. // "$ref": "CreativeFieldValuesListResponse"
  22609. // },
  22610. // "scopes": [
  22611. // "https://www.googleapis.com/auth/dfatrafficking"
  22612. // ]
  22613. // }
  22614. }
  22615. // Pages invokes f for each page of results.
  22616. // A non-nil error returned from f will halt the iteration.
  22617. // The provided context supersedes any context provided to the Context method.
  22618. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  22619. c.ctx_ = ctx
  22620. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22621. for {
  22622. x, err := c.Do()
  22623. if err != nil {
  22624. return err
  22625. }
  22626. if err := f(x); err != nil {
  22627. return err
  22628. }
  22629. if x.NextPageToken == "" {
  22630. return nil
  22631. }
  22632. c.PageToken(x.NextPageToken)
  22633. }
  22634. }
  22635. // method id "dfareporting.creativeFieldValues.patch":
  22636. type CreativeFieldValuesPatchCall struct {
  22637. s *Service
  22638. profileId int64
  22639. creativeFieldId int64
  22640. creativefieldvalue *CreativeFieldValue
  22641. urlParams_ gensupport.URLParams
  22642. ctx_ context.Context
  22643. header_ http.Header
  22644. }
  22645. // Patch: Updates an existing creative field value. This method supports
  22646. // patch semantics.
  22647. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  22648. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22649. c.profileId = profileId
  22650. c.creativeFieldId = creativeFieldId
  22651. c.urlParams_.Set("id", fmt.Sprint(id))
  22652. c.creativefieldvalue = creativefieldvalue
  22653. return c
  22654. }
  22655. // Fields allows partial responses to be retrieved. See
  22656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22657. // for more information.
  22658. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  22659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22660. return c
  22661. }
  22662. // Context sets the context to be used in this call's Do method. Any
  22663. // pending HTTP request will be aborted if the provided context is
  22664. // canceled.
  22665. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  22666. c.ctx_ = ctx
  22667. return c
  22668. }
  22669. // Header returns an http.Header that can be modified by the caller to
  22670. // add HTTP headers to the request.
  22671. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  22672. if c.header_ == nil {
  22673. c.header_ = make(http.Header)
  22674. }
  22675. return c.header_
  22676. }
  22677. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  22678. reqHeaders := make(http.Header)
  22679. for k, v := range c.header_ {
  22680. reqHeaders[k] = v
  22681. }
  22682. reqHeaders.Set("User-Agent", c.s.userAgent())
  22683. var body io.Reader = nil
  22684. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22685. if err != nil {
  22686. return nil, err
  22687. }
  22688. reqHeaders.Set("Content-Type", "application/json")
  22689. c.urlParams_.Set("alt", alt)
  22690. c.urlParams_.Set("prettyPrint", "false")
  22691. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22692. urls += "?" + c.urlParams_.Encode()
  22693. req, err := http.NewRequest("PATCH", urls, body)
  22694. if err != nil {
  22695. return nil, err
  22696. }
  22697. req.Header = reqHeaders
  22698. googleapi.Expand(req.URL, map[string]string{
  22699. "profileId": strconv.FormatInt(c.profileId, 10),
  22700. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22701. })
  22702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22703. }
  22704. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  22705. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22706. // non-2xx status code is an error. Response headers are in either
  22707. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22708. // returned at all) in error.(*googleapi.Error).Header. Use
  22709. // googleapi.IsNotModified to check whether the returned error was
  22710. // because http.StatusNotModified was returned.
  22711. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22712. gensupport.SetOptions(c.urlParams_, opts...)
  22713. res, err := c.doRequest("json")
  22714. if res != nil && res.StatusCode == http.StatusNotModified {
  22715. if res.Body != nil {
  22716. res.Body.Close()
  22717. }
  22718. return nil, &googleapi.Error{
  22719. Code: res.StatusCode,
  22720. Header: res.Header,
  22721. }
  22722. }
  22723. if err != nil {
  22724. return nil, err
  22725. }
  22726. defer googleapi.CloseBody(res)
  22727. if err := googleapi.CheckResponse(res); err != nil {
  22728. return nil, err
  22729. }
  22730. ret := &CreativeFieldValue{
  22731. ServerResponse: googleapi.ServerResponse{
  22732. Header: res.Header,
  22733. HTTPStatusCode: res.StatusCode,
  22734. },
  22735. }
  22736. target := &ret
  22737. if err := gensupport.DecodeResponse(target, res); err != nil {
  22738. return nil, err
  22739. }
  22740. return ret, nil
  22741. // {
  22742. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  22743. // "httpMethod": "PATCH",
  22744. // "id": "dfareporting.creativeFieldValues.patch",
  22745. // "parameterOrder": [
  22746. // "profileId",
  22747. // "creativeFieldId",
  22748. // "id"
  22749. // ],
  22750. // "parameters": {
  22751. // "creativeFieldId": {
  22752. // "description": "Creative field ID for this creative field value.",
  22753. // "format": "int64",
  22754. // "location": "path",
  22755. // "required": true,
  22756. // "type": "string"
  22757. // },
  22758. // "id": {
  22759. // "description": "Creative Field Value ID",
  22760. // "format": "int64",
  22761. // "location": "query",
  22762. // "required": true,
  22763. // "type": "string"
  22764. // },
  22765. // "profileId": {
  22766. // "description": "User profile ID associated with this request.",
  22767. // "format": "int64",
  22768. // "location": "path",
  22769. // "required": true,
  22770. // "type": "string"
  22771. // }
  22772. // },
  22773. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22774. // "request": {
  22775. // "$ref": "CreativeFieldValue"
  22776. // },
  22777. // "response": {
  22778. // "$ref": "CreativeFieldValue"
  22779. // },
  22780. // "scopes": [
  22781. // "https://www.googleapis.com/auth/dfatrafficking"
  22782. // ]
  22783. // }
  22784. }
  22785. // method id "dfareporting.creativeFieldValues.update":
  22786. type CreativeFieldValuesUpdateCall struct {
  22787. s *Service
  22788. profileId int64
  22789. creativeFieldId int64
  22790. creativefieldvalue *CreativeFieldValue
  22791. urlParams_ gensupport.URLParams
  22792. ctx_ context.Context
  22793. header_ http.Header
  22794. }
  22795. // Update: Updates an existing creative field value.
  22796. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  22797. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22798. c.profileId = profileId
  22799. c.creativeFieldId = creativeFieldId
  22800. c.creativefieldvalue = creativefieldvalue
  22801. return c
  22802. }
  22803. // Fields allows partial responses to be retrieved. See
  22804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22805. // for more information.
  22806. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  22807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22808. return c
  22809. }
  22810. // Context sets the context to be used in this call's Do method. Any
  22811. // pending HTTP request will be aborted if the provided context is
  22812. // canceled.
  22813. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  22814. c.ctx_ = ctx
  22815. return c
  22816. }
  22817. // Header returns an http.Header that can be modified by the caller to
  22818. // add HTTP headers to the request.
  22819. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  22820. if c.header_ == nil {
  22821. c.header_ = make(http.Header)
  22822. }
  22823. return c.header_
  22824. }
  22825. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  22826. reqHeaders := make(http.Header)
  22827. for k, v := range c.header_ {
  22828. reqHeaders[k] = v
  22829. }
  22830. reqHeaders.Set("User-Agent", c.s.userAgent())
  22831. var body io.Reader = nil
  22832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22833. if err != nil {
  22834. return nil, err
  22835. }
  22836. reqHeaders.Set("Content-Type", "application/json")
  22837. c.urlParams_.Set("alt", alt)
  22838. c.urlParams_.Set("prettyPrint", "false")
  22839. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22840. urls += "?" + c.urlParams_.Encode()
  22841. req, err := http.NewRequest("PUT", urls, body)
  22842. if err != nil {
  22843. return nil, err
  22844. }
  22845. req.Header = reqHeaders
  22846. googleapi.Expand(req.URL, map[string]string{
  22847. "profileId": strconv.FormatInt(c.profileId, 10),
  22848. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22849. })
  22850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22851. }
  22852. // Do executes the "dfareporting.creativeFieldValues.update" call.
  22853. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22854. // non-2xx status code is an error. Response headers are in either
  22855. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22856. // returned at all) in error.(*googleapi.Error).Header. Use
  22857. // googleapi.IsNotModified to check whether the returned error was
  22858. // because http.StatusNotModified was returned.
  22859. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22860. gensupport.SetOptions(c.urlParams_, opts...)
  22861. res, err := c.doRequest("json")
  22862. if res != nil && res.StatusCode == http.StatusNotModified {
  22863. if res.Body != nil {
  22864. res.Body.Close()
  22865. }
  22866. return nil, &googleapi.Error{
  22867. Code: res.StatusCode,
  22868. Header: res.Header,
  22869. }
  22870. }
  22871. if err != nil {
  22872. return nil, err
  22873. }
  22874. defer googleapi.CloseBody(res)
  22875. if err := googleapi.CheckResponse(res); err != nil {
  22876. return nil, err
  22877. }
  22878. ret := &CreativeFieldValue{
  22879. ServerResponse: googleapi.ServerResponse{
  22880. Header: res.Header,
  22881. HTTPStatusCode: res.StatusCode,
  22882. },
  22883. }
  22884. target := &ret
  22885. if err := gensupport.DecodeResponse(target, res); err != nil {
  22886. return nil, err
  22887. }
  22888. return ret, nil
  22889. // {
  22890. // "description": "Updates an existing creative field value.",
  22891. // "httpMethod": "PUT",
  22892. // "id": "dfareporting.creativeFieldValues.update",
  22893. // "parameterOrder": [
  22894. // "profileId",
  22895. // "creativeFieldId"
  22896. // ],
  22897. // "parameters": {
  22898. // "creativeFieldId": {
  22899. // "description": "Creative field ID for this creative field value.",
  22900. // "format": "int64",
  22901. // "location": "path",
  22902. // "required": true,
  22903. // "type": "string"
  22904. // },
  22905. // "profileId": {
  22906. // "description": "User profile ID associated with this request.",
  22907. // "format": "int64",
  22908. // "location": "path",
  22909. // "required": true,
  22910. // "type": "string"
  22911. // }
  22912. // },
  22913. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22914. // "request": {
  22915. // "$ref": "CreativeFieldValue"
  22916. // },
  22917. // "response": {
  22918. // "$ref": "CreativeFieldValue"
  22919. // },
  22920. // "scopes": [
  22921. // "https://www.googleapis.com/auth/dfatrafficking"
  22922. // ]
  22923. // }
  22924. }
  22925. // method id "dfareporting.creativeFields.delete":
  22926. type CreativeFieldsDeleteCall struct {
  22927. s *Service
  22928. profileId int64
  22929. id int64
  22930. urlParams_ gensupport.URLParams
  22931. ctx_ context.Context
  22932. header_ http.Header
  22933. }
  22934. // Delete: Deletes an existing creative field.
  22935. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  22936. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22937. c.profileId = profileId
  22938. c.id = id
  22939. return c
  22940. }
  22941. // Fields allows partial responses to be retrieved. See
  22942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22943. // for more information.
  22944. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  22945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22946. return c
  22947. }
  22948. // Context sets the context to be used in this call's Do method. Any
  22949. // pending HTTP request will be aborted if the provided context is
  22950. // canceled.
  22951. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  22952. c.ctx_ = ctx
  22953. return c
  22954. }
  22955. // Header returns an http.Header that can be modified by the caller to
  22956. // add HTTP headers to the request.
  22957. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  22958. if c.header_ == nil {
  22959. c.header_ = make(http.Header)
  22960. }
  22961. return c.header_
  22962. }
  22963. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  22964. reqHeaders := make(http.Header)
  22965. for k, v := range c.header_ {
  22966. reqHeaders[k] = v
  22967. }
  22968. reqHeaders.Set("User-Agent", c.s.userAgent())
  22969. var body io.Reader = nil
  22970. c.urlParams_.Set("alt", alt)
  22971. c.urlParams_.Set("prettyPrint", "false")
  22972. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22973. urls += "?" + c.urlParams_.Encode()
  22974. req, err := http.NewRequest("DELETE", urls, body)
  22975. if err != nil {
  22976. return nil, err
  22977. }
  22978. req.Header = reqHeaders
  22979. googleapi.Expand(req.URL, map[string]string{
  22980. "profileId": strconv.FormatInt(c.profileId, 10),
  22981. "id": strconv.FormatInt(c.id, 10),
  22982. })
  22983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22984. }
  22985. // Do executes the "dfareporting.creativeFields.delete" call.
  22986. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  22987. gensupport.SetOptions(c.urlParams_, opts...)
  22988. res, err := c.doRequest("json")
  22989. if err != nil {
  22990. return err
  22991. }
  22992. defer googleapi.CloseBody(res)
  22993. if err := googleapi.CheckResponse(res); err != nil {
  22994. return err
  22995. }
  22996. return nil
  22997. // {
  22998. // "description": "Deletes an existing creative field.",
  22999. // "httpMethod": "DELETE",
  23000. // "id": "dfareporting.creativeFields.delete",
  23001. // "parameterOrder": [
  23002. // "profileId",
  23003. // "id"
  23004. // ],
  23005. // "parameters": {
  23006. // "id": {
  23007. // "description": "Creative Field ID",
  23008. // "format": "int64",
  23009. // "location": "path",
  23010. // "required": true,
  23011. // "type": "string"
  23012. // },
  23013. // "profileId": {
  23014. // "description": "User profile ID associated with this request.",
  23015. // "format": "int64",
  23016. // "location": "path",
  23017. // "required": true,
  23018. // "type": "string"
  23019. // }
  23020. // },
  23021. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  23022. // "scopes": [
  23023. // "https://www.googleapis.com/auth/dfatrafficking"
  23024. // ]
  23025. // }
  23026. }
  23027. // method id "dfareporting.creativeFields.get":
  23028. type CreativeFieldsGetCall struct {
  23029. s *Service
  23030. profileId int64
  23031. id int64
  23032. urlParams_ gensupport.URLParams
  23033. ifNoneMatch_ string
  23034. ctx_ context.Context
  23035. header_ http.Header
  23036. }
  23037. // Get: Gets one creative field by ID.
  23038. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  23039. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23040. c.profileId = profileId
  23041. c.id = id
  23042. return c
  23043. }
  23044. // Fields allows partial responses to be retrieved. See
  23045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23046. // for more information.
  23047. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  23048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23049. return c
  23050. }
  23051. // IfNoneMatch sets the optional parameter which makes the operation
  23052. // fail if the object's ETag matches the given value. This is useful for
  23053. // getting updates only after the object has changed since the last
  23054. // request. Use googleapi.IsNotModified to check whether the response
  23055. // error from Do is the result of In-None-Match.
  23056. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  23057. c.ifNoneMatch_ = entityTag
  23058. return c
  23059. }
  23060. // Context sets the context to be used in this call's Do method. Any
  23061. // pending HTTP request will be aborted if the provided context is
  23062. // canceled.
  23063. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  23064. c.ctx_ = ctx
  23065. return c
  23066. }
  23067. // Header returns an http.Header that can be modified by the caller to
  23068. // add HTTP headers to the request.
  23069. func (c *CreativeFieldsGetCall) Header() http.Header {
  23070. if c.header_ == nil {
  23071. c.header_ = make(http.Header)
  23072. }
  23073. return c.header_
  23074. }
  23075. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  23076. reqHeaders := make(http.Header)
  23077. for k, v := range c.header_ {
  23078. reqHeaders[k] = v
  23079. }
  23080. reqHeaders.Set("User-Agent", c.s.userAgent())
  23081. if c.ifNoneMatch_ != "" {
  23082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23083. }
  23084. var body io.Reader = nil
  23085. c.urlParams_.Set("alt", alt)
  23086. c.urlParams_.Set("prettyPrint", "false")
  23087. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  23088. urls += "?" + c.urlParams_.Encode()
  23089. req, err := http.NewRequest("GET", urls, body)
  23090. if err != nil {
  23091. return nil, err
  23092. }
  23093. req.Header = reqHeaders
  23094. googleapi.Expand(req.URL, map[string]string{
  23095. "profileId": strconv.FormatInt(c.profileId, 10),
  23096. "id": strconv.FormatInt(c.id, 10),
  23097. })
  23098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23099. }
  23100. // Do executes the "dfareporting.creativeFields.get" call.
  23101. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23102. // status code is an error. Response headers are in either
  23103. // *CreativeField.ServerResponse.Header or (if a response was returned
  23104. // at all) in error.(*googleapi.Error).Header. Use
  23105. // googleapi.IsNotModified to check whether the returned error was
  23106. // because http.StatusNotModified was returned.
  23107. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23108. gensupport.SetOptions(c.urlParams_, opts...)
  23109. res, err := c.doRequest("json")
  23110. if res != nil && res.StatusCode == http.StatusNotModified {
  23111. if res.Body != nil {
  23112. res.Body.Close()
  23113. }
  23114. return nil, &googleapi.Error{
  23115. Code: res.StatusCode,
  23116. Header: res.Header,
  23117. }
  23118. }
  23119. if err != nil {
  23120. return nil, err
  23121. }
  23122. defer googleapi.CloseBody(res)
  23123. if err := googleapi.CheckResponse(res); err != nil {
  23124. return nil, err
  23125. }
  23126. ret := &CreativeField{
  23127. ServerResponse: googleapi.ServerResponse{
  23128. Header: res.Header,
  23129. HTTPStatusCode: res.StatusCode,
  23130. },
  23131. }
  23132. target := &ret
  23133. if err := gensupport.DecodeResponse(target, res); err != nil {
  23134. return nil, err
  23135. }
  23136. return ret, nil
  23137. // {
  23138. // "description": "Gets one creative field by ID.",
  23139. // "httpMethod": "GET",
  23140. // "id": "dfareporting.creativeFields.get",
  23141. // "parameterOrder": [
  23142. // "profileId",
  23143. // "id"
  23144. // ],
  23145. // "parameters": {
  23146. // "id": {
  23147. // "description": "Creative Field ID",
  23148. // "format": "int64",
  23149. // "location": "path",
  23150. // "required": true,
  23151. // "type": "string"
  23152. // },
  23153. // "profileId": {
  23154. // "description": "User profile ID associated with this request.",
  23155. // "format": "int64",
  23156. // "location": "path",
  23157. // "required": true,
  23158. // "type": "string"
  23159. // }
  23160. // },
  23161. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  23162. // "response": {
  23163. // "$ref": "CreativeField"
  23164. // },
  23165. // "scopes": [
  23166. // "https://www.googleapis.com/auth/dfatrafficking"
  23167. // ]
  23168. // }
  23169. }
  23170. // method id "dfareporting.creativeFields.insert":
  23171. type CreativeFieldsInsertCall struct {
  23172. s *Service
  23173. profileId int64
  23174. creativefield *CreativeField
  23175. urlParams_ gensupport.URLParams
  23176. ctx_ context.Context
  23177. header_ http.Header
  23178. }
  23179. // Insert: Inserts a new creative field.
  23180. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  23181. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23182. c.profileId = profileId
  23183. c.creativefield = creativefield
  23184. return c
  23185. }
  23186. // Fields allows partial responses to be retrieved. See
  23187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23188. // for more information.
  23189. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  23190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23191. return c
  23192. }
  23193. // Context sets the context to be used in this call's Do method. Any
  23194. // pending HTTP request will be aborted if the provided context is
  23195. // canceled.
  23196. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  23197. c.ctx_ = ctx
  23198. return c
  23199. }
  23200. // Header returns an http.Header that can be modified by the caller to
  23201. // add HTTP headers to the request.
  23202. func (c *CreativeFieldsInsertCall) Header() http.Header {
  23203. if c.header_ == nil {
  23204. c.header_ = make(http.Header)
  23205. }
  23206. return c.header_
  23207. }
  23208. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  23209. reqHeaders := make(http.Header)
  23210. for k, v := range c.header_ {
  23211. reqHeaders[k] = v
  23212. }
  23213. reqHeaders.Set("User-Agent", c.s.userAgent())
  23214. var body io.Reader = nil
  23215. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23216. if err != nil {
  23217. return nil, err
  23218. }
  23219. reqHeaders.Set("Content-Type", "application/json")
  23220. c.urlParams_.Set("alt", alt)
  23221. c.urlParams_.Set("prettyPrint", "false")
  23222. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23223. urls += "?" + c.urlParams_.Encode()
  23224. req, err := http.NewRequest("POST", urls, body)
  23225. if err != nil {
  23226. return nil, err
  23227. }
  23228. req.Header = reqHeaders
  23229. googleapi.Expand(req.URL, map[string]string{
  23230. "profileId": strconv.FormatInt(c.profileId, 10),
  23231. })
  23232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23233. }
  23234. // Do executes the "dfareporting.creativeFields.insert" call.
  23235. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23236. // status code is an error. Response headers are in either
  23237. // *CreativeField.ServerResponse.Header or (if a response was returned
  23238. // at all) in error.(*googleapi.Error).Header. Use
  23239. // googleapi.IsNotModified to check whether the returned error was
  23240. // because http.StatusNotModified was returned.
  23241. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23242. gensupport.SetOptions(c.urlParams_, opts...)
  23243. res, err := c.doRequest("json")
  23244. if res != nil && res.StatusCode == http.StatusNotModified {
  23245. if res.Body != nil {
  23246. res.Body.Close()
  23247. }
  23248. return nil, &googleapi.Error{
  23249. Code: res.StatusCode,
  23250. Header: res.Header,
  23251. }
  23252. }
  23253. if err != nil {
  23254. return nil, err
  23255. }
  23256. defer googleapi.CloseBody(res)
  23257. if err := googleapi.CheckResponse(res); err != nil {
  23258. return nil, err
  23259. }
  23260. ret := &CreativeField{
  23261. ServerResponse: googleapi.ServerResponse{
  23262. Header: res.Header,
  23263. HTTPStatusCode: res.StatusCode,
  23264. },
  23265. }
  23266. target := &ret
  23267. if err := gensupport.DecodeResponse(target, res); err != nil {
  23268. return nil, err
  23269. }
  23270. return ret, nil
  23271. // {
  23272. // "description": "Inserts a new creative field.",
  23273. // "httpMethod": "POST",
  23274. // "id": "dfareporting.creativeFields.insert",
  23275. // "parameterOrder": [
  23276. // "profileId"
  23277. // ],
  23278. // "parameters": {
  23279. // "profileId": {
  23280. // "description": "User profile ID associated with this request.",
  23281. // "format": "int64",
  23282. // "location": "path",
  23283. // "required": true,
  23284. // "type": "string"
  23285. // }
  23286. // },
  23287. // "path": "userprofiles/{profileId}/creativeFields",
  23288. // "request": {
  23289. // "$ref": "CreativeField"
  23290. // },
  23291. // "response": {
  23292. // "$ref": "CreativeField"
  23293. // },
  23294. // "scopes": [
  23295. // "https://www.googleapis.com/auth/dfatrafficking"
  23296. // ]
  23297. // }
  23298. }
  23299. // method id "dfareporting.creativeFields.list":
  23300. type CreativeFieldsListCall struct {
  23301. s *Service
  23302. profileId int64
  23303. urlParams_ gensupport.URLParams
  23304. ifNoneMatch_ string
  23305. ctx_ context.Context
  23306. header_ http.Header
  23307. }
  23308. // List: Retrieves a list of creative fields, possibly filtered. This
  23309. // method supports paging.
  23310. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  23311. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23312. c.profileId = profileId
  23313. return c
  23314. }
  23315. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23316. // only creative fields that belong to these advertisers.
  23317. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  23318. var advertiserIds_ []string
  23319. for _, v := range advertiserIds {
  23320. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23321. }
  23322. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23323. return c
  23324. }
  23325. // Ids sets the optional parameter "ids": Select only creative fields
  23326. // with these IDs.
  23327. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  23328. var ids_ []string
  23329. for _, v := range ids {
  23330. ids_ = append(ids_, fmt.Sprint(v))
  23331. }
  23332. c.urlParams_.SetMulti("ids", ids_)
  23333. return c
  23334. }
  23335. // MaxResults sets the optional parameter "maxResults": Maximum number
  23336. // of results to return.
  23337. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  23338. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23339. return c
  23340. }
  23341. // PageToken sets the optional parameter "pageToken": Value of the
  23342. // nextPageToken from the previous result page.
  23343. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  23344. c.urlParams_.Set("pageToken", pageToken)
  23345. return c
  23346. }
  23347. // SearchString sets the optional parameter "searchString": Allows
  23348. // searching for creative fields by name or ID. Wildcards (*) are
  23349. // allowed. For example, "creativefield*2015" will return creative
  23350. // fields with names like "creativefield June 2015", "creativefield
  23351. // April 2015", or simply "creativefield 2015". Most of the searches
  23352. // also add wild-cards implicitly at the start and the end of the search
  23353. // string. For example, a search string of "creativefield" will match
  23354. // creative fields with the name "my creativefield", "creativefield
  23355. // 2015", or simply "creativefield".
  23356. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  23357. c.urlParams_.Set("searchString", searchString)
  23358. return c
  23359. }
  23360. // SortField sets the optional parameter "sortField": Field by which to
  23361. // sort the list.
  23362. //
  23363. // Possible values:
  23364. // "ID" (default)
  23365. // "NAME"
  23366. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  23367. c.urlParams_.Set("sortField", sortField)
  23368. return c
  23369. }
  23370. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23371. // results.
  23372. //
  23373. // Possible values:
  23374. // "ASCENDING" (default)
  23375. // "DESCENDING"
  23376. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  23377. c.urlParams_.Set("sortOrder", sortOrder)
  23378. return c
  23379. }
  23380. // Fields allows partial responses to be retrieved. See
  23381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23382. // for more information.
  23383. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  23384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23385. return c
  23386. }
  23387. // IfNoneMatch sets the optional parameter which makes the operation
  23388. // fail if the object's ETag matches the given value. This is useful for
  23389. // getting updates only after the object has changed since the last
  23390. // request. Use googleapi.IsNotModified to check whether the response
  23391. // error from Do is the result of In-None-Match.
  23392. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  23393. c.ifNoneMatch_ = entityTag
  23394. return c
  23395. }
  23396. // Context sets the context to be used in this call's Do method. Any
  23397. // pending HTTP request will be aborted if the provided context is
  23398. // canceled.
  23399. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  23400. c.ctx_ = ctx
  23401. return c
  23402. }
  23403. // Header returns an http.Header that can be modified by the caller to
  23404. // add HTTP headers to the request.
  23405. func (c *CreativeFieldsListCall) Header() http.Header {
  23406. if c.header_ == nil {
  23407. c.header_ = make(http.Header)
  23408. }
  23409. return c.header_
  23410. }
  23411. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  23412. reqHeaders := make(http.Header)
  23413. for k, v := range c.header_ {
  23414. reqHeaders[k] = v
  23415. }
  23416. reqHeaders.Set("User-Agent", c.s.userAgent())
  23417. if c.ifNoneMatch_ != "" {
  23418. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23419. }
  23420. var body io.Reader = nil
  23421. c.urlParams_.Set("alt", alt)
  23422. c.urlParams_.Set("prettyPrint", "false")
  23423. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23424. urls += "?" + c.urlParams_.Encode()
  23425. req, err := http.NewRequest("GET", urls, body)
  23426. if err != nil {
  23427. return nil, err
  23428. }
  23429. req.Header = reqHeaders
  23430. googleapi.Expand(req.URL, map[string]string{
  23431. "profileId": strconv.FormatInt(c.profileId, 10),
  23432. })
  23433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23434. }
  23435. // Do executes the "dfareporting.creativeFields.list" call.
  23436. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  23437. // Any non-2xx status code is an error. Response headers are in either
  23438. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  23439. // was returned at all) in error.(*googleapi.Error).Header. Use
  23440. // googleapi.IsNotModified to check whether the returned error was
  23441. // because http.StatusNotModified was returned.
  23442. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  23443. gensupport.SetOptions(c.urlParams_, opts...)
  23444. res, err := c.doRequest("json")
  23445. if res != nil && res.StatusCode == http.StatusNotModified {
  23446. if res.Body != nil {
  23447. res.Body.Close()
  23448. }
  23449. return nil, &googleapi.Error{
  23450. Code: res.StatusCode,
  23451. Header: res.Header,
  23452. }
  23453. }
  23454. if err != nil {
  23455. return nil, err
  23456. }
  23457. defer googleapi.CloseBody(res)
  23458. if err := googleapi.CheckResponse(res); err != nil {
  23459. return nil, err
  23460. }
  23461. ret := &CreativeFieldsListResponse{
  23462. ServerResponse: googleapi.ServerResponse{
  23463. Header: res.Header,
  23464. HTTPStatusCode: res.StatusCode,
  23465. },
  23466. }
  23467. target := &ret
  23468. if err := gensupport.DecodeResponse(target, res); err != nil {
  23469. return nil, err
  23470. }
  23471. return ret, nil
  23472. // {
  23473. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  23474. // "httpMethod": "GET",
  23475. // "id": "dfareporting.creativeFields.list",
  23476. // "parameterOrder": [
  23477. // "profileId"
  23478. // ],
  23479. // "parameters": {
  23480. // "advertiserIds": {
  23481. // "description": "Select only creative fields that belong to these advertisers.",
  23482. // "format": "int64",
  23483. // "location": "query",
  23484. // "repeated": true,
  23485. // "type": "string"
  23486. // },
  23487. // "ids": {
  23488. // "description": "Select only creative fields with these IDs.",
  23489. // "format": "int64",
  23490. // "location": "query",
  23491. // "repeated": true,
  23492. // "type": "string"
  23493. // },
  23494. // "maxResults": {
  23495. // "default": "1000",
  23496. // "description": "Maximum number of results to return.",
  23497. // "format": "int32",
  23498. // "location": "query",
  23499. // "maximum": "1000",
  23500. // "minimum": "0",
  23501. // "type": "integer"
  23502. // },
  23503. // "pageToken": {
  23504. // "description": "Value of the nextPageToken from the previous result page.",
  23505. // "location": "query",
  23506. // "type": "string"
  23507. // },
  23508. // "profileId": {
  23509. // "description": "User profile ID associated with this request.",
  23510. // "format": "int64",
  23511. // "location": "path",
  23512. // "required": true,
  23513. // "type": "string"
  23514. // },
  23515. // "searchString": {
  23516. // "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\".",
  23517. // "location": "query",
  23518. // "type": "string"
  23519. // },
  23520. // "sortField": {
  23521. // "default": "ID",
  23522. // "description": "Field by which to sort the list.",
  23523. // "enum": [
  23524. // "ID",
  23525. // "NAME"
  23526. // ],
  23527. // "enumDescriptions": [
  23528. // "",
  23529. // ""
  23530. // ],
  23531. // "location": "query",
  23532. // "type": "string"
  23533. // },
  23534. // "sortOrder": {
  23535. // "default": "ASCENDING",
  23536. // "description": "Order of sorted results.",
  23537. // "enum": [
  23538. // "ASCENDING",
  23539. // "DESCENDING"
  23540. // ],
  23541. // "enumDescriptions": [
  23542. // "",
  23543. // ""
  23544. // ],
  23545. // "location": "query",
  23546. // "type": "string"
  23547. // }
  23548. // },
  23549. // "path": "userprofiles/{profileId}/creativeFields",
  23550. // "response": {
  23551. // "$ref": "CreativeFieldsListResponse"
  23552. // },
  23553. // "scopes": [
  23554. // "https://www.googleapis.com/auth/dfatrafficking"
  23555. // ]
  23556. // }
  23557. }
  23558. // Pages invokes f for each page of results.
  23559. // A non-nil error returned from f will halt the iteration.
  23560. // The provided context supersedes any context provided to the Context method.
  23561. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  23562. c.ctx_ = ctx
  23563. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23564. for {
  23565. x, err := c.Do()
  23566. if err != nil {
  23567. return err
  23568. }
  23569. if err := f(x); err != nil {
  23570. return err
  23571. }
  23572. if x.NextPageToken == "" {
  23573. return nil
  23574. }
  23575. c.PageToken(x.NextPageToken)
  23576. }
  23577. }
  23578. // method id "dfareporting.creativeFields.patch":
  23579. type CreativeFieldsPatchCall struct {
  23580. s *Service
  23581. profileId int64
  23582. creativefield *CreativeField
  23583. urlParams_ gensupport.URLParams
  23584. ctx_ context.Context
  23585. header_ http.Header
  23586. }
  23587. // Patch: Updates an existing creative field. This method supports patch
  23588. // semantics.
  23589. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  23590. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23591. c.profileId = profileId
  23592. c.urlParams_.Set("id", fmt.Sprint(id))
  23593. c.creativefield = creativefield
  23594. return c
  23595. }
  23596. // Fields allows partial responses to be retrieved. See
  23597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23598. // for more information.
  23599. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  23600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23601. return c
  23602. }
  23603. // Context sets the context to be used in this call's Do method. Any
  23604. // pending HTTP request will be aborted if the provided context is
  23605. // canceled.
  23606. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  23607. c.ctx_ = ctx
  23608. return c
  23609. }
  23610. // Header returns an http.Header that can be modified by the caller to
  23611. // add HTTP headers to the request.
  23612. func (c *CreativeFieldsPatchCall) Header() http.Header {
  23613. if c.header_ == nil {
  23614. c.header_ = make(http.Header)
  23615. }
  23616. return c.header_
  23617. }
  23618. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  23619. reqHeaders := make(http.Header)
  23620. for k, v := range c.header_ {
  23621. reqHeaders[k] = v
  23622. }
  23623. reqHeaders.Set("User-Agent", c.s.userAgent())
  23624. var body io.Reader = nil
  23625. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23626. if err != nil {
  23627. return nil, err
  23628. }
  23629. reqHeaders.Set("Content-Type", "application/json")
  23630. c.urlParams_.Set("alt", alt)
  23631. c.urlParams_.Set("prettyPrint", "false")
  23632. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23633. urls += "?" + c.urlParams_.Encode()
  23634. req, err := http.NewRequest("PATCH", urls, body)
  23635. if err != nil {
  23636. return nil, err
  23637. }
  23638. req.Header = reqHeaders
  23639. googleapi.Expand(req.URL, map[string]string{
  23640. "profileId": strconv.FormatInt(c.profileId, 10),
  23641. })
  23642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23643. }
  23644. // Do executes the "dfareporting.creativeFields.patch" call.
  23645. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23646. // status code is an error. Response headers are in either
  23647. // *CreativeField.ServerResponse.Header or (if a response was returned
  23648. // at all) in error.(*googleapi.Error).Header. Use
  23649. // googleapi.IsNotModified to check whether the returned error was
  23650. // because http.StatusNotModified was returned.
  23651. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23652. gensupport.SetOptions(c.urlParams_, opts...)
  23653. res, err := c.doRequest("json")
  23654. if res != nil && res.StatusCode == http.StatusNotModified {
  23655. if res.Body != nil {
  23656. res.Body.Close()
  23657. }
  23658. return nil, &googleapi.Error{
  23659. Code: res.StatusCode,
  23660. Header: res.Header,
  23661. }
  23662. }
  23663. if err != nil {
  23664. return nil, err
  23665. }
  23666. defer googleapi.CloseBody(res)
  23667. if err := googleapi.CheckResponse(res); err != nil {
  23668. return nil, err
  23669. }
  23670. ret := &CreativeField{
  23671. ServerResponse: googleapi.ServerResponse{
  23672. Header: res.Header,
  23673. HTTPStatusCode: res.StatusCode,
  23674. },
  23675. }
  23676. target := &ret
  23677. if err := gensupport.DecodeResponse(target, res); err != nil {
  23678. return nil, err
  23679. }
  23680. return ret, nil
  23681. // {
  23682. // "description": "Updates an existing creative field. This method supports patch semantics.",
  23683. // "httpMethod": "PATCH",
  23684. // "id": "dfareporting.creativeFields.patch",
  23685. // "parameterOrder": [
  23686. // "profileId",
  23687. // "id"
  23688. // ],
  23689. // "parameters": {
  23690. // "id": {
  23691. // "description": "Creative Field ID",
  23692. // "format": "int64",
  23693. // "location": "query",
  23694. // "required": true,
  23695. // "type": "string"
  23696. // },
  23697. // "profileId": {
  23698. // "description": "User profile ID associated with this request.",
  23699. // "format": "int64",
  23700. // "location": "path",
  23701. // "required": true,
  23702. // "type": "string"
  23703. // }
  23704. // },
  23705. // "path": "userprofiles/{profileId}/creativeFields",
  23706. // "request": {
  23707. // "$ref": "CreativeField"
  23708. // },
  23709. // "response": {
  23710. // "$ref": "CreativeField"
  23711. // },
  23712. // "scopes": [
  23713. // "https://www.googleapis.com/auth/dfatrafficking"
  23714. // ]
  23715. // }
  23716. }
  23717. // method id "dfareporting.creativeFields.update":
  23718. type CreativeFieldsUpdateCall struct {
  23719. s *Service
  23720. profileId int64
  23721. creativefield *CreativeField
  23722. urlParams_ gensupport.URLParams
  23723. ctx_ context.Context
  23724. header_ http.Header
  23725. }
  23726. // Update: Updates an existing creative field.
  23727. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  23728. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23729. c.profileId = profileId
  23730. c.creativefield = creativefield
  23731. return c
  23732. }
  23733. // Fields allows partial responses to be retrieved. See
  23734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23735. // for more information.
  23736. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  23737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23738. return c
  23739. }
  23740. // Context sets the context to be used in this call's Do method. Any
  23741. // pending HTTP request will be aborted if the provided context is
  23742. // canceled.
  23743. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  23744. c.ctx_ = ctx
  23745. return c
  23746. }
  23747. // Header returns an http.Header that can be modified by the caller to
  23748. // add HTTP headers to the request.
  23749. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  23750. if c.header_ == nil {
  23751. c.header_ = make(http.Header)
  23752. }
  23753. return c.header_
  23754. }
  23755. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23756. reqHeaders := make(http.Header)
  23757. for k, v := range c.header_ {
  23758. reqHeaders[k] = v
  23759. }
  23760. reqHeaders.Set("User-Agent", c.s.userAgent())
  23761. var body io.Reader = nil
  23762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23763. if err != nil {
  23764. return nil, err
  23765. }
  23766. reqHeaders.Set("Content-Type", "application/json")
  23767. c.urlParams_.Set("alt", alt)
  23768. c.urlParams_.Set("prettyPrint", "false")
  23769. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23770. urls += "?" + c.urlParams_.Encode()
  23771. req, err := http.NewRequest("PUT", urls, body)
  23772. if err != nil {
  23773. return nil, err
  23774. }
  23775. req.Header = reqHeaders
  23776. googleapi.Expand(req.URL, map[string]string{
  23777. "profileId": strconv.FormatInt(c.profileId, 10),
  23778. })
  23779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23780. }
  23781. // Do executes the "dfareporting.creativeFields.update" call.
  23782. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23783. // status code is an error. Response headers are in either
  23784. // *CreativeField.ServerResponse.Header or (if a response was returned
  23785. // at all) in error.(*googleapi.Error).Header. Use
  23786. // googleapi.IsNotModified to check whether the returned error was
  23787. // because http.StatusNotModified was returned.
  23788. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23789. gensupport.SetOptions(c.urlParams_, opts...)
  23790. res, err := c.doRequest("json")
  23791. if res != nil && res.StatusCode == http.StatusNotModified {
  23792. if res.Body != nil {
  23793. res.Body.Close()
  23794. }
  23795. return nil, &googleapi.Error{
  23796. Code: res.StatusCode,
  23797. Header: res.Header,
  23798. }
  23799. }
  23800. if err != nil {
  23801. return nil, err
  23802. }
  23803. defer googleapi.CloseBody(res)
  23804. if err := googleapi.CheckResponse(res); err != nil {
  23805. return nil, err
  23806. }
  23807. ret := &CreativeField{
  23808. ServerResponse: googleapi.ServerResponse{
  23809. Header: res.Header,
  23810. HTTPStatusCode: res.StatusCode,
  23811. },
  23812. }
  23813. target := &ret
  23814. if err := gensupport.DecodeResponse(target, res); err != nil {
  23815. return nil, err
  23816. }
  23817. return ret, nil
  23818. // {
  23819. // "description": "Updates an existing creative field.",
  23820. // "httpMethod": "PUT",
  23821. // "id": "dfareporting.creativeFields.update",
  23822. // "parameterOrder": [
  23823. // "profileId"
  23824. // ],
  23825. // "parameters": {
  23826. // "profileId": {
  23827. // "description": "User profile ID associated with this request.",
  23828. // "format": "int64",
  23829. // "location": "path",
  23830. // "required": true,
  23831. // "type": "string"
  23832. // }
  23833. // },
  23834. // "path": "userprofiles/{profileId}/creativeFields",
  23835. // "request": {
  23836. // "$ref": "CreativeField"
  23837. // },
  23838. // "response": {
  23839. // "$ref": "CreativeField"
  23840. // },
  23841. // "scopes": [
  23842. // "https://www.googleapis.com/auth/dfatrafficking"
  23843. // ]
  23844. // }
  23845. }
  23846. // method id "dfareporting.creativeGroups.get":
  23847. type CreativeGroupsGetCall struct {
  23848. s *Service
  23849. profileId int64
  23850. id int64
  23851. urlParams_ gensupport.URLParams
  23852. ifNoneMatch_ string
  23853. ctx_ context.Context
  23854. header_ http.Header
  23855. }
  23856. // Get: Gets one creative group by ID.
  23857. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  23858. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23859. c.profileId = profileId
  23860. c.id = id
  23861. return c
  23862. }
  23863. // Fields allows partial responses to be retrieved. See
  23864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23865. // for more information.
  23866. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  23867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23868. return c
  23869. }
  23870. // IfNoneMatch sets the optional parameter which makes the operation
  23871. // fail if the object's ETag matches the given value. This is useful for
  23872. // getting updates only after the object has changed since the last
  23873. // request. Use googleapi.IsNotModified to check whether the response
  23874. // error from Do is the result of In-None-Match.
  23875. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  23876. c.ifNoneMatch_ = entityTag
  23877. return c
  23878. }
  23879. // Context sets the context to be used in this call's Do method. Any
  23880. // pending HTTP request will be aborted if the provided context is
  23881. // canceled.
  23882. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  23883. c.ctx_ = ctx
  23884. return c
  23885. }
  23886. // Header returns an http.Header that can be modified by the caller to
  23887. // add HTTP headers to the request.
  23888. func (c *CreativeGroupsGetCall) Header() http.Header {
  23889. if c.header_ == nil {
  23890. c.header_ = make(http.Header)
  23891. }
  23892. return c.header_
  23893. }
  23894. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  23895. reqHeaders := make(http.Header)
  23896. for k, v := range c.header_ {
  23897. reqHeaders[k] = v
  23898. }
  23899. reqHeaders.Set("User-Agent", c.s.userAgent())
  23900. if c.ifNoneMatch_ != "" {
  23901. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23902. }
  23903. var body io.Reader = nil
  23904. c.urlParams_.Set("alt", alt)
  23905. c.urlParams_.Set("prettyPrint", "false")
  23906. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  23907. urls += "?" + c.urlParams_.Encode()
  23908. req, err := http.NewRequest("GET", urls, body)
  23909. if err != nil {
  23910. return nil, err
  23911. }
  23912. req.Header = reqHeaders
  23913. googleapi.Expand(req.URL, map[string]string{
  23914. "profileId": strconv.FormatInt(c.profileId, 10),
  23915. "id": strconv.FormatInt(c.id, 10),
  23916. })
  23917. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23918. }
  23919. // Do executes the "dfareporting.creativeGroups.get" call.
  23920. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23921. // status code is an error. Response headers are in either
  23922. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23923. // at all) in error.(*googleapi.Error).Header. Use
  23924. // googleapi.IsNotModified to check whether the returned error was
  23925. // because http.StatusNotModified was returned.
  23926. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23927. gensupport.SetOptions(c.urlParams_, opts...)
  23928. res, err := c.doRequest("json")
  23929. if res != nil && res.StatusCode == http.StatusNotModified {
  23930. if res.Body != nil {
  23931. res.Body.Close()
  23932. }
  23933. return nil, &googleapi.Error{
  23934. Code: res.StatusCode,
  23935. Header: res.Header,
  23936. }
  23937. }
  23938. if err != nil {
  23939. return nil, err
  23940. }
  23941. defer googleapi.CloseBody(res)
  23942. if err := googleapi.CheckResponse(res); err != nil {
  23943. return nil, err
  23944. }
  23945. ret := &CreativeGroup{
  23946. ServerResponse: googleapi.ServerResponse{
  23947. Header: res.Header,
  23948. HTTPStatusCode: res.StatusCode,
  23949. },
  23950. }
  23951. target := &ret
  23952. if err := gensupport.DecodeResponse(target, res); err != nil {
  23953. return nil, err
  23954. }
  23955. return ret, nil
  23956. // {
  23957. // "description": "Gets one creative group by ID.",
  23958. // "httpMethod": "GET",
  23959. // "id": "dfareporting.creativeGroups.get",
  23960. // "parameterOrder": [
  23961. // "profileId",
  23962. // "id"
  23963. // ],
  23964. // "parameters": {
  23965. // "id": {
  23966. // "description": "Creative group ID.",
  23967. // "format": "int64",
  23968. // "location": "path",
  23969. // "required": true,
  23970. // "type": "string"
  23971. // },
  23972. // "profileId": {
  23973. // "description": "User profile ID associated with this request.",
  23974. // "format": "int64",
  23975. // "location": "path",
  23976. // "required": true,
  23977. // "type": "string"
  23978. // }
  23979. // },
  23980. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  23981. // "response": {
  23982. // "$ref": "CreativeGroup"
  23983. // },
  23984. // "scopes": [
  23985. // "https://www.googleapis.com/auth/dfatrafficking"
  23986. // ]
  23987. // }
  23988. }
  23989. // method id "dfareporting.creativeGroups.insert":
  23990. type CreativeGroupsInsertCall struct {
  23991. s *Service
  23992. profileId int64
  23993. creativegroup *CreativeGroup
  23994. urlParams_ gensupport.URLParams
  23995. ctx_ context.Context
  23996. header_ http.Header
  23997. }
  23998. // Insert: Inserts a new creative group.
  23999. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  24000. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24001. c.profileId = profileId
  24002. c.creativegroup = creativegroup
  24003. return c
  24004. }
  24005. // Fields allows partial responses to be retrieved. See
  24006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24007. // for more information.
  24008. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  24009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24010. return c
  24011. }
  24012. // Context sets the context to be used in this call's Do method. Any
  24013. // pending HTTP request will be aborted if the provided context is
  24014. // canceled.
  24015. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  24016. c.ctx_ = ctx
  24017. return c
  24018. }
  24019. // Header returns an http.Header that can be modified by the caller to
  24020. // add HTTP headers to the request.
  24021. func (c *CreativeGroupsInsertCall) Header() http.Header {
  24022. if c.header_ == nil {
  24023. c.header_ = make(http.Header)
  24024. }
  24025. return c.header_
  24026. }
  24027. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  24028. reqHeaders := make(http.Header)
  24029. for k, v := range c.header_ {
  24030. reqHeaders[k] = v
  24031. }
  24032. reqHeaders.Set("User-Agent", c.s.userAgent())
  24033. var body io.Reader = nil
  24034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24035. if err != nil {
  24036. return nil, err
  24037. }
  24038. reqHeaders.Set("Content-Type", "application/json")
  24039. c.urlParams_.Set("alt", alt)
  24040. c.urlParams_.Set("prettyPrint", "false")
  24041. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24042. urls += "?" + c.urlParams_.Encode()
  24043. req, err := http.NewRequest("POST", urls, body)
  24044. if err != nil {
  24045. return nil, err
  24046. }
  24047. req.Header = reqHeaders
  24048. googleapi.Expand(req.URL, map[string]string{
  24049. "profileId": strconv.FormatInt(c.profileId, 10),
  24050. })
  24051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24052. }
  24053. // Do executes the "dfareporting.creativeGroups.insert" call.
  24054. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24055. // status code is an error. Response headers are in either
  24056. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24057. // at all) in error.(*googleapi.Error).Header. Use
  24058. // googleapi.IsNotModified to check whether the returned error was
  24059. // because http.StatusNotModified was returned.
  24060. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24061. gensupport.SetOptions(c.urlParams_, opts...)
  24062. res, err := c.doRequest("json")
  24063. if res != nil && res.StatusCode == http.StatusNotModified {
  24064. if res.Body != nil {
  24065. res.Body.Close()
  24066. }
  24067. return nil, &googleapi.Error{
  24068. Code: res.StatusCode,
  24069. Header: res.Header,
  24070. }
  24071. }
  24072. if err != nil {
  24073. return nil, err
  24074. }
  24075. defer googleapi.CloseBody(res)
  24076. if err := googleapi.CheckResponse(res); err != nil {
  24077. return nil, err
  24078. }
  24079. ret := &CreativeGroup{
  24080. ServerResponse: googleapi.ServerResponse{
  24081. Header: res.Header,
  24082. HTTPStatusCode: res.StatusCode,
  24083. },
  24084. }
  24085. target := &ret
  24086. if err := gensupport.DecodeResponse(target, res); err != nil {
  24087. return nil, err
  24088. }
  24089. return ret, nil
  24090. // {
  24091. // "description": "Inserts a new creative group.",
  24092. // "httpMethod": "POST",
  24093. // "id": "dfareporting.creativeGroups.insert",
  24094. // "parameterOrder": [
  24095. // "profileId"
  24096. // ],
  24097. // "parameters": {
  24098. // "profileId": {
  24099. // "description": "User profile ID associated with this request.",
  24100. // "format": "int64",
  24101. // "location": "path",
  24102. // "required": true,
  24103. // "type": "string"
  24104. // }
  24105. // },
  24106. // "path": "userprofiles/{profileId}/creativeGroups",
  24107. // "request": {
  24108. // "$ref": "CreativeGroup"
  24109. // },
  24110. // "response": {
  24111. // "$ref": "CreativeGroup"
  24112. // },
  24113. // "scopes": [
  24114. // "https://www.googleapis.com/auth/dfatrafficking"
  24115. // ]
  24116. // }
  24117. }
  24118. // method id "dfareporting.creativeGroups.list":
  24119. type CreativeGroupsListCall struct {
  24120. s *Service
  24121. profileId int64
  24122. urlParams_ gensupport.URLParams
  24123. ifNoneMatch_ string
  24124. ctx_ context.Context
  24125. header_ http.Header
  24126. }
  24127. // List: Retrieves a list of creative groups, possibly filtered. This
  24128. // method supports paging.
  24129. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  24130. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24131. c.profileId = profileId
  24132. return c
  24133. }
  24134. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  24135. // only creative groups that belong to these advertisers.
  24136. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  24137. var advertiserIds_ []string
  24138. for _, v := range advertiserIds {
  24139. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  24140. }
  24141. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  24142. return c
  24143. }
  24144. // GroupNumber sets the optional parameter "groupNumber": Select only
  24145. // creative groups that belong to this subgroup.
  24146. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  24147. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  24148. return c
  24149. }
  24150. // Ids sets the optional parameter "ids": Select only creative groups
  24151. // with these IDs.
  24152. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  24153. var ids_ []string
  24154. for _, v := range ids {
  24155. ids_ = append(ids_, fmt.Sprint(v))
  24156. }
  24157. c.urlParams_.SetMulti("ids", ids_)
  24158. return c
  24159. }
  24160. // MaxResults sets the optional parameter "maxResults": Maximum number
  24161. // of results to return.
  24162. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  24163. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24164. return c
  24165. }
  24166. // PageToken sets the optional parameter "pageToken": Value of the
  24167. // nextPageToken from the previous result page.
  24168. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  24169. c.urlParams_.Set("pageToken", pageToken)
  24170. return c
  24171. }
  24172. // SearchString sets the optional parameter "searchString": Allows
  24173. // searching for creative groups by name or ID. Wildcards (*) are
  24174. // allowed. For example, "creativegroup*2015" will return creative
  24175. // groups with names like "creativegroup June 2015", "creativegroup
  24176. // April 2015", or simply "creativegroup 2015". Most of the searches
  24177. // also add wild-cards implicitly at the start and the end of the search
  24178. // string. For example, a search string of "creativegroup" will match
  24179. // creative groups with the name "my creativegroup", "creativegroup
  24180. // 2015", or simply "creativegroup".
  24181. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  24182. c.urlParams_.Set("searchString", searchString)
  24183. return c
  24184. }
  24185. // SortField sets the optional parameter "sortField": Field by which to
  24186. // sort the list.
  24187. //
  24188. // Possible values:
  24189. // "ID" (default)
  24190. // "NAME"
  24191. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  24192. c.urlParams_.Set("sortField", sortField)
  24193. return c
  24194. }
  24195. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24196. // results.
  24197. //
  24198. // Possible values:
  24199. // "ASCENDING" (default)
  24200. // "DESCENDING"
  24201. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  24202. c.urlParams_.Set("sortOrder", sortOrder)
  24203. return c
  24204. }
  24205. // Fields allows partial responses to be retrieved. See
  24206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24207. // for more information.
  24208. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  24209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24210. return c
  24211. }
  24212. // IfNoneMatch sets the optional parameter which makes the operation
  24213. // fail if the object's ETag matches the given value. This is useful for
  24214. // getting updates only after the object has changed since the last
  24215. // request. Use googleapi.IsNotModified to check whether the response
  24216. // error from Do is the result of In-None-Match.
  24217. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  24218. c.ifNoneMatch_ = entityTag
  24219. return c
  24220. }
  24221. // Context sets the context to be used in this call's Do method. Any
  24222. // pending HTTP request will be aborted if the provided context is
  24223. // canceled.
  24224. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  24225. c.ctx_ = ctx
  24226. return c
  24227. }
  24228. // Header returns an http.Header that can be modified by the caller to
  24229. // add HTTP headers to the request.
  24230. func (c *CreativeGroupsListCall) Header() http.Header {
  24231. if c.header_ == nil {
  24232. c.header_ = make(http.Header)
  24233. }
  24234. return c.header_
  24235. }
  24236. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  24237. reqHeaders := make(http.Header)
  24238. for k, v := range c.header_ {
  24239. reqHeaders[k] = v
  24240. }
  24241. reqHeaders.Set("User-Agent", c.s.userAgent())
  24242. if c.ifNoneMatch_ != "" {
  24243. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24244. }
  24245. var body io.Reader = nil
  24246. c.urlParams_.Set("alt", alt)
  24247. c.urlParams_.Set("prettyPrint", "false")
  24248. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24249. urls += "?" + c.urlParams_.Encode()
  24250. req, err := http.NewRequest("GET", urls, body)
  24251. if err != nil {
  24252. return nil, err
  24253. }
  24254. req.Header = reqHeaders
  24255. googleapi.Expand(req.URL, map[string]string{
  24256. "profileId": strconv.FormatInt(c.profileId, 10),
  24257. })
  24258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24259. }
  24260. // Do executes the "dfareporting.creativeGroups.list" call.
  24261. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  24262. // Any non-2xx status code is an error. Response headers are in either
  24263. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  24264. // was returned at all) in error.(*googleapi.Error).Header. Use
  24265. // googleapi.IsNotModified to check whether the returned error was
  24266. // because http.StatusNotModified was returned.
  24267. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  24268. gensupport.SetOptions(c.urlParams_, opts...)
  24269. res, err := c.doRequest("json")
  24270. if res != nil && res.StatusCode == http.StatusNotModified {
  24271. if res.Body != nil {
  24272. res.Body.Close()
  24273. }
  24274. return nil, &googleapi.Error{
  24275. Code: res.StatusCode,
  24276. Header: res.Header,
  24277. }
  24278. }
  24279. if err != nil {
  24280. return nil, err
  24281. }
  24282. defer googleapi.CloseBody(res)
  24283. if err := googleapi.CheckResponse(res); err != nil {
  24284. return nil, err
  24285. }
  24286. ret := &CreativeGroupsListResponse{
  24287. ServerResponse: googleapi.ServerResponse{
  24288. Header: res.Header,
  24289. HTTPStatusCode: res.StatusCode,
  24290. },
  24291. }
  24292. target := &ret
  24293. if err := gensupport.DecodeResponse(target, res); err != nil {
  24294. return nil, err
  24295. }
  24296. return ret, nil
  24297. // {
  24298. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  24299. // "httpMethod": "GET",
  24300. // "id": "dfareporting.creativeGroups.list",
  24301. // "parameterOrder": [
  24302. // "profileId"
  24303. // ],
  24304. // "parameters": {
  24305. // "advertiserIds": {
  24306. // "description": "Select only creative groups that belong to these advertisers.",
  24307. // "format": "int64",
  24308. // "location": "query",
  24309. // "repeated": true,
  24310. // "type": "string"
  24311. // },
  24312. // "groupNumber": {
  24313. // "description": "Select only creative groups that belong to this subgroup.",
  24314. // "format": "int32",
  24315. // "location": "query",
  24316. // "maximum": "2",
  24317. // "minimum": "1",
  24318. // "type": "integer"
  24319. // },
  24320. // "ids": {
  24321. // "description": "Select only creative groups with these IDs.",
  24322. // "format": "int64",
  24323. // "location": "query",
  24324. // "repeated": true,
  24325. // "type": "string"
  24326. // },
  24327. // "maxResults": {
  24328. // "default": "1000",
  24329. // "description": "Maximum number of results to return.",
  24330. // "format": "int32",
  24331. // "location": "query",
  24332. // "maximum": "1000",
  24333. // "minimum": "0",
  24334. // "type": "integer"
  24335. // },
  24336. // "pageToken": {
  24337. // "description": "Value of the nextPageToken from the previous result page.",
  24338. // "location": "query",
  24339. // "type": "string"
  24340. // },
  24341. // "profileId": {
  24342. // "description": "User profile ID associated with this request.",
  24343. // "format": "int64",
  24344. // "location": "path",
  24345. // "required": true,
  24346. // "type": "string"
  24347. // },
  24348. // "searchString": {
  24349. // "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\".",
  24350. // "location": "query",
  24351. // "type": "string"
  24352. // },
  24353. // "sortField": {
  24354. // "default": "ID",
  24355. // "description": "Field by which to sort the list.",
  24356. // "enum": [
  24357. // "ID",
  24358. // "NAME"
  24359. // ],
  24360. // "enumDescriptions": [
  24361. // "",
  24362. // ""
  24363. // ],
  24364. // "location": "query",
  24365. // "type": "string"
  24366. // },
  24367. // "sortOrder": {
  24368. // "default": "ASCENDING",
  24369. // "description": "Order of sorted results.",
  24370. // "enum": [
  24371. // "ASCENDING",
  24372. // "DESCENDING"
  24373. // ],
  24374. // "enumDescriptions": [
  24375. // "",
  24376. // ""
  24377. // ],
  24378. // "location": "query",
  24379. // "type": "string"
  24380. // }
  24381. // },
  24382. // "path": "userprofiles/{profileId}/creativeGroups",
  24383. // "response": {
  24384. // "$ref": "CreativeGroupsListResponse"
  24385. // },
  24386. // "scopes": [
  24387. // "https://www.googleapis.com/auth/dfatrafficking"
  24388. // ]
  24389. // }
  24390. }
  24391. // Pages invokes f for each page of results.
  24392. // A non-nil error returned from f will halt the iteration.
  24393. // The provided context supersedes any context provided to the Context method.
  24394. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  24395. c.ctx_ = ctx
  24396. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24397. for {
  24398. x, err := c.Do()
  24399. if err != nil {
  24400. return err
  24401. }
  24402. if err := f(x); err != nil {
  24403. return err
  24404. }
  24405. if x.NextPageToken == "" {
  24406. return nil
  24407. }
  24408. c.PageToken(x.NextPageToken)
  24409. }
  24410. }
  24411. // method id "dfareporting.creativeGroups.patch":
  24412. type CreativeGroupsPatchCall struct {
  24413. s *Service
  24414. profileId int64
  24415. creativegroup *CreativeGroup
  24416. urlParams_ gensupport.URLParams
  24417. ctx_ context.Context
  24418. header_ http.Header
  24419. }
  24420. // Patch: Updates an existing creative group. This method supports patch
  24421. // semantics.
  24422. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  24423. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24424. c.profileId = profileId
  24425. c.urlParams_.Set("id", fmt.Sprint(id))
  24426. c.creativegroup = creativegroup
  24427. return c
  24428. }
  24429. // Fields allows partial responses to be retrieved. See
  24430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24431. // for more information.
  24432. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  24433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24434. return c
  24435. }
  24436. // Context sets the context to be used in this call's Do method. Any
  24437. // pending HTTP request will be aborted if the provided context is
  24438. // canceled.
  24439. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  24440. c.ctx_ = ctx
  24441. return c
  24442. }
  24443. // Header returns an http.Header that can be modified by the caller to
  24444. // add HTTP headers to the request.
  24445. func (c *CreativeGroupsPatchCall) Header() http.Header {
  24446. if c.header_ == nil {
  24447. c.header_ = make(http.Header)
  24448. }
  24449. return c.header_
  24450. }
  24451. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  24452. reqHeaders := make(http.Header)
  24453. for k, v := range c.header_ {
  24454. reqHeaders[k] = v
  24455. }
  24456. reqHeaders.Set("User-Agent", c.s.userAgent())
  24457. var body io.Reader = nil
  24458. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24459. if err != nil {
  24460. return nil, err
  24461. }
  24462. reqHeaders.Set("Content-Type", "application/json")
  24463. c.urlParams_.Set("alt", alt)
  24464. c.urlParams_.Set("prettyPrint", "false")
  24465. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24466. urls += "?" + c.urlParams_.Encode()
  24467. req, err := http.NewRequest("PATCH", urls, body)
  24468. if err != nil {
  24469. return nil, err
  24470. }
  24471. req.Header = reqHeaders
  24472. googleapi.Expand(req.URL, map[string]string{
  24473. "profileId": strconv.FormatInt(c.profileId, 10),
  24474. })
  24475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24476. }
  24477. // Do executes the "dfareporting.creativeGroups.patch" call.
  24478. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24479. // status code is an error. Response headers are in either
  24480. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24481. // at all) in error.(*googleapi.Error).Header. Use
  24482. // googleapi.IsNotModified to check whether the returned error was
  24483. // because http.StatusNotModified was returned.
  24484. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24485. gensupport.SetOptions(c.urlParams_, opts...)
  24486. res, err := c.doRequest("json")
  24487. if res != nil && res.StatusCode == http.StatusNotModified {
  24488. if res.Body != nil {
  24489. res.Body.Close()
  24490. }
  24491. return nil, &googleapi.Error{
  24492. Code: res.StatusCode,
  24493. Header: res.Header,
  24494. }
  24495. }
  24496. if err != nil {
  24497. return nil, err
  24498. }
  24499. defer googleapi.CloseBody(res)
  24500. if err := googleapi.CheckResponse(res); err != nil {
  24501. return nil, err
  24502. }
  24503. ret := &CreativeGroup{
  24504. ServerResponse: googleapi.ServerResponse{
  24505. Header: res.Header,
  24506. HTTPStatusCode: res.StatusCode,
  24507. },
  24508. }
  24509. target := &ret
  24510. if err := gensupport.DecodeResponse(target, res); err != nil {
  24511. return nil, err
  24512. }
  24513. return ret, nil
  24514. // {
  24515. // "description": "Updates an existing creative group. This method supports patch semantics.",
  24516. // "httpMethod": "PATCH",
  24517. // "id": "dfareporting.creativeGroups.patch",
  24518. // "parameterOrder": [
  24519. // "profileId",
  24520. // "id"
  24521. // ],
  24522. // "parameters": {
  24523. // "id": {
  24524. // "description": "Creative group ID.",
  24525. // "format": "int64",
  24526. // "location": "query",
  24527. // "required": true,
  24528. // "type": "string"
  24529. // },
  24530. // "profileId": {
  24531. // "description": "User profile ID associated with this request.",
  24532. // "format": "int64",
  24533. // "location": "path",
  24534. // "required": true,
  24535. // "type": "string"
  24536. // }
  24537. // },
  24538. // "path": "userprofiles/{profileId}/creativeGroups",
  24539. // "request": {
  24540. // "$ref": "CreativeGroup"
  24541. // },
  24542. // "response": {
  24543. // "$ref": "CreativeGroup"
  24544. // },
  24545. // "scopes": [
  24546. // "https://www.googleapis.com/auth/dfatrafficking"
  24547. // ]
  24548. // }
  24549. }
  24550. // method id "dfareporting.creativeGroups.update":
  24551. type CreativeGroupsUpdateCall struct {
  24552. s *Service
  24553. profileId int64
  24554. creativegroup *CreativeGroup
  24555. urlParams_ gensupport.URLParams
  24556. ctx_ context.Context
  24557. header_ http.Header
  24558. }
  24559. // Update: Updates an existing creative group.
  24560. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  24561. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24562. c.profileId = profileId
  24563. c.creativegroup = creativegroup
  24564. return c
  24565. }
  24566. // Fields allows partial responses to be retrieved. See
  24567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24568. // for more information.
  24569. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  24570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24571. return c
  24572. }
  24573. // Context sets the context to be used in this call's Do method. Any
  24574. // pending HTTP request will be aborted if the provided context is
  24575. // canceled.
  24576. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  24577. c.ctx_ = ctx
  24578. return c
  24579. }
  24580. // Header returns an http.Header that can be modified by the caller to
  24581. // add HTTP headers to the request.
  24582. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  24583. if c.header_ == nil {
  24584. c.header_ = make(http.Header)
  24585. }
  24586. return c.header_
  24587. }
  24588. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  24589. reqHeaders := make(http.Header)
  24590. for k, v := range c.header_ {
  24591. reqHeaders[k] = v
  24592. }
  24593. reqHeaders.Set("User-Agent", c.s.userAgent())
  24594. var body io.Reader = nil
  24595. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24596. if err != nil {
  24597. return nil, err
  24598. }
  24599. reqHeaders.Set("Content-Type", "application/json")
  24600. c.urlParams_.Set("alt", alt)
  24601. c.urlParams_.Set("prettyPrint", "false")
  24602. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24603. urls += "?" + c.urlParams_.Encode()
  24604. req, err := http.NewRequest("PUT", urls, body)
  24605. if err != nil {
  24606. return nil, err
  24607. }
  24608. req.Header = reqHeaders
  24609. googleapi.Expand(req.URL, map[string]string{
  24610. "profileId": strconv.FormatInt(c.profileId, 10),
  24611. })
  24612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24613. }
  24614. // Do executes the "dfareporting.creativeGroups.update" call.
  24615. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24616. // status code is an error. Response headers are in either
  24617. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24618. // at all) in error.(*googleapi.Error).Header. Use
  24619. // googleapi.IsNotModified to check whether the returned error was
  24620. // because http.StatusNotModified was returned.
  24621. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24622. gensupport.SetOptions(c.urlParams_, opts...)
  24623. res, err := c.doRequest("json")
  24624. if res != nil && res.StatusCode == http.StatusNotModified {
  24625. if res.Body != nil {
  24626. res.Body.Close()
  24627. }
  24628. return nil, &googleapi.Error{
  24629. Code: res.StatusCode,
  24630. Header: res.Header,
  24631. }
  24632. }
  24633. if err != nil {
  24634. return nil, err
  24635. }
  24636. defer googleapi.CloseBody(res)
  24637. if err := googleapi.CheckResponse(res); err != nil {
  24638. return nil, err
  24639. }
  24640. ret := &CreativeGroup{
  24641. ServerResponse: googleapi.ServerResponse{
  24642. Header: res.Header,
  24643. HTTPStatusCode: res.StatusCode,
  24644. },
  24645. }
  24646. target := &ret
  24647. if err := gensupport.DecodeResponse(target, res); err != nil {
  24648. return nil, err
  24649. }
  24650. return ret, nil
  24651. // {
  24652. // "description": "Updates an existing creative group.",
  24653. // "httpMethod": "PUT",
  24654. // "id": "dfareporting.creativeGroups.update",
  24655. // "parameterOrder": [
  24656. // "profileId"
  24657. // ],
  24658. // "parameters": {
  24659. // "profileId": {
  24660. // "description": "User profile ID associated with this request.",
  24661. // "format": "int64",
  24662. // "location": "path",
  24663. // "required": true,
  24664. // "type": "string"
  24665. // }
  24666. // },
  24667. // "path": "userprofiles/{profileId}/creativeGroups",
  24668. // "request": {
  24669. // "$ref": "CreativeGroup"
  24670. // },
  24671. // "response": {
  24672. // "$ref": "CreativeGroup"
  24673. // },
  24674. // "scopes": [
  24675. // "https://www.googleapis.com/auth/dfatrafficking"
  24676. // ]
  24677. // }
  24678. }
  24679. // method id "dfareporting.creatives.get":
  24680. type CreativesGetCall struct {
  24681. s *Service
  24682. profileId int64
  24683. id int64
  24684. urlParams_ gensupport.URLParams
  24685. ifNoneMatch_ string
  24686. ctx_ context.Context
  24687. header_ http.Header
  24688. }
  24689. // Get: Gets one creative by ID.
  24690. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  24691. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24692. c.profileId = profileId
  24693. c.id = id
  24694. return c
  24695. }
  24696. // Fields allows partial responses to be retrieved. See
  24697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24698. // for more information.
  24699. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  24700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24701. return c
  24702. }
  24703. // IfNoneMatch sets the optional parameter which makes the operation
  24704. // fail if the object's ETag matches the given value. This is useful for
  24705. // getting updates only after the object has changed since the last
  24706. // request. Use googleapi.IsNotModified to check whether the response
  24707. // error from Do is the result of In-None-Match.
  24708. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  24709. c.ifNoneMatch_ = entityTag
  24710. return c
  24711. }
  24712. // Context sets the context to be used in this call's Do method. Any
  24713. // pending HTTP request will be aborted if the provided context is
  24714. // canceled.
  24715. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  24716. c.ctx_ = ctx
  24717. return c
  24718. }
  24719. // Header returns an http.Header that can be modified by the caller to
  24720. // add HTTP headers to the request.
  24721. func (c *CreativesGetCall) Header() http.Header {
  24722. if c.header_ == nil {
  24723. c.header_ = make(http.Header)
  24724. }
  24725. return c.header_
  24726. }
  24727. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  24728. reqHeaders := make(http.Header)
  24729. for k, v := range c.header_ {
  24730. reqHeaders[k] = v
  24731. }
  24732. reqHeaders.Set("User-Agent", c.s.userAgent())
  24733. if c.ifNoneMatch_ != "" {
  24734. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24735. }
  24736. var body io.Reader = nil
  24737. c.urlParams_.Set("alt", alt)
  24738. c.urlParams_.Set("prettyPrint", "false")
  24739. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  24740. urls += "?" + c.urlParams_.Encode()
  24741. req, err := http.NewRequest("GET", urls, body)
  24742. if err != nil {
  24743. return nil, err
  24744. }
  24745. req.Header = reqHeaders
  24746. googleapi.Expand(req.URL, map[string]string{
  24747. "profileId": strconv.FormatInt(c.profileId, 10),
  24748. "id": strconv.FormatInt(c.id, 10),
  24749. })
  24750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24751. }
  24752. // Do executes the "dfareporting.creatives.get" call.
  24753. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24754. // code is an error. Response headers are in either
  24755. // *Creative.ServerResponse.Header or (if a response was returned at
  24756. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24757. // to check whether the returned error was because
  24758. // http.StatusNotModified was returned.
  24759. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24760. gensupport.SetOptions(c.urlParams_, opts...)
  24761. res, err := c.doRequest("json")
  24762. if res != nil && res.StatusCode == http.StatusNotModified {
  24763. if res.Body != nil {
  24764. res.Body.Close()
  24765. }
  24766. return nil, &googleapi.Error{
  24767. Code: res.StatusCode,
  24768. Header: res.Header,
  24769. }
  24770. }
  24771. if err != nil {
  24772. return nil, err
  24773. }
  24774. defer googleapi.CloseBody(res)
  24775. if err := googleapi.CheckResponse(res); err != nil {
  24776. return nil, err
  24777. }
  24778. ret := &Creative{
  24779. ServerResponse: googleapi.ServerResponse{
  24780. Header: res.Header,
  24781. HTTPStatusCode: res.StatusCode,
  24782. },
  24783. }
  24784. target := &ret
  24785. if err := gensupport.DecodeResponse(target, res); err != nil {
  24786. return nil, err
  24787. }
  24788. return ret, nil
  24789. // {
  24790. // "description": "Gets one creative by ID.",
  24791. // "httpMethod": "GET",
  24792. // "id": "dfareporting.creatives.get",
  24793. // "parameterOrder": [
  24794. // "profileId",
  24795. // "id"
  24796. // ],
  24797. // "parameters": {
  24798. // "id": {
  24799. // "description": "Creative ID.",
  24800. // "format": "int64",
  24801. // "location": "path",
  24802. // "required": true,
  24803. // "type": "string"
  24804. // },
  24805. // "profileId": {
  24806. // "description": "User profile ID associated with this request.",
  24807. // "format": "int64",
  24808. // "location": "path",
  24809. // "required": true,
  24810. // "type": "string"
  24811. // }
  24812. // },
  24813. // "path": "userprofiles/{profileId}/creatives/{id}",
  24814. // "response": {
  24815. // "$ref": "Creative"
  24816. // },
  24817. // "scopes": [
  24818. // "https://www.googleapis.com/auth/dfatrafficking"
  24819. // ]
  24820. // }
  24821. }
  24822. // method id "dfareporting.creatives.insert":
  24823. type CreativesInsertCall struct {
  24824. s *Service
  24825. profileId int64
  24826. creative *Creative
  24827. urlParams_ gensupport.URLParams
  24828. ctx_ context.Context
  24829. header_ http.Header
  24830. }
  24831. // Insert: Inserts a new creative.
  24832. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  24833. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24834. c.profileId = profileId
  24835. c.creative = creative
  24836. return c
  24837. }
  24838. // Fields allows partial responses to be retrieved. See
  24839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24840. // for more information.
  24841. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  24842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24843. return c
  24844. }
  24845. // Context sets the context to be used in this call's Do method. Any
  24846. // pending HTTP request will be aborted if the provided context is
  24847. // canceled.
  24848. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  24849. c.ctx_ = ctx
  24850. return c
  24851. }
  24852. // Header returns an http.Header that can be modified by the caller to
  24853. // add HTTP headers to the request.
  24854. func (c *CreativesInsertCall) Header() http.Header {
  24855. if c.header_ == nil {
  24856. c.header_ = make(http.Header)
  24857. }
  24858. return c.header_
  24859. }
  24860. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  24861. reqHeaders := make(http.Header)
  24862. for k, v := range c.header_ {
  24863. reqHeaders[k] = v
  24864. }
  24865. reqHeaders.Set("User-Agent", c.s.userAgent())
  24866. var body io.Reader = nil
  24867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24868. if err != nil {
  24869. return nil, err
  24870. }
  24871. reqHeaders.Set("Content-Type", "application/json")
  24872. c.urlParams_.Set("alt", alt)
  24873. c.urlParams_.Set("prettyPrint", "false")
  24874. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24875. urls += "?" + c.urlParams_.Encode()
  24876. req, err := http.NewRequest("POST", urls, body)
  24877. if err != nil {
  24878. return nil, err
  24879. }
  24880. req.Header = reqHeaders
  24881. googleapi.Expand(req.URL, map[string]string{
  24882. "profileId": strconv.FormatInt(c.profileId, 10),
  24883. })
  24884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24885. }
  24886. // Do executes the "dfareporting.creatives.insert" call.
  24887. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24888. // code is an error. Response headers are in either
  24889. // *Creative.ServerResponse.Header or (if a response was returned at
  24890. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24891. // to check whether the returned error was because
  24892. // http.StatusNotModified was returned.
  24893. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24894. gensupport.SetOptions(c.urlParams_, opts...)
  24895. res, err := c.doRequest("json")
  24896. if res != nil && res.StatusCode == http.StatusNotModified {
  24897. if res.Body != nil {
  24898. res.Body.Close()
  24899. }
  24900. return nil, &googleapi.Error{
  24901. Code: res.StatusCode,
  24902. Header: res.Header,
  24903. }
  24904. }
  24905. if err != nil {
  24906. return nil, err
  24907. }
  24908. defer googleapi.CloseBody(res)
  24909. if err := googleapi.CheckResponse(res); err != nil {
  24910. return nil, err
  24911. }
  24912. ret := &Creative{
  24913. ServerResponse: googleapi.ServerResponse{
  24914. Header: res.Header,
  24915. HTTPStatusCode: res.StatusCode,
  24916. },
  24917. }
  24918. target := &ret
  24919. if err := gensupport.DecodeResponse(target, res); err != nil {
  24920. return nil, err
  24921. }
  24922. return ret, nil
  24923. // {
  24924. // "description": "Inserts a new creative.",
  24925. // "httpMethod": "POST",
  24926. // "id": "dfareporting.creatives.insert",
  24927. // "parameterOrder": [
  24928. // "profileId"
  24929. // ],
  24930. // "parameters": {
  24931. // "profileId": {
  24932. // "description": "User profile ID associated with this request.",
  24933. // "format": "int64",
  24934. // "location": "path",
  24935. // "required": true,
  24936. // "type": "string"
  24937. // }
  24938. // },
  24939. // "path": "userprofiles/{profileId}/creatives",
  24940. // "request": {
  24941. // "$ref": "Creative"
  24942. // },
  24943. // "response": {
  24944. // "$ref": "Creative"
  24945. // },
  24946. // "scopes": [
  24947. // "https://www.googleapis.com/auth/dfatrafficking"
  24948. // ]
  24949. // }
  24950. }
  24951. // method id "dfareporting.creatives.list":
  24952. type CreativesListCall struct {
  24953. s *Service
  24954. profileId int64
  24955. urlParams_ gensupport.URLParams
  24956. ifNoneMatch_ string
  24957. ctx_ context.Context
  24958. header_ http.Header
  24959. }
  24960. // List: Retrieves a list of creatives, possibly filtered. This method
  24961. // supports paging.
  24962. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  24963. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24964. c.profileId = profileId
  24965. return c
  24966. }
  24967. // Active sets the optional parameter "active": Select only active
  24968. // creatives. Leave blank to select active and inactive creatives.
  24969. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  24970. c.urlParams_.Set("active", fmt.Sprint(active))
  24971. return c
  24972. }
  24973. // AdvertiserId sets the optional parameter "advertiserId": Select only
  24974. // creatives with this advertiser ID.
  24975. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  24976. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  24977. return c
  24978. }
  24979. // Archived sets the optional parameter "archived": Select only archived
  24980. // creatives. Leave blank to select archived and unarchived creatives.
  24981. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  24982. c.urlParams_.Set("archived", fmt.Sprint(archived))
  24983. return c
  24984. }
  24985. // CampaignId sets the optional parameter "campaignId": Select only
  24986. // creatives with this campaign ID.
  24987. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  24988. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  24989. return c
  24990. }
  24991. // CompanionCreativeIds sets the optional parameter
  24992. // "companionCreativeIds": Select only in-stream video creatives with
  24993. // these companion IDs.
  24994. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  24995. var companionCreativeIds_ []string
  24996. for _, v := range companionCreativeIds {
  24997. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  24998. }
  24999. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  25000. return c
  25001. }
  25002. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  25003. // Select only creatives with these creative field IDs.
  25004. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  25005. var creativeFieldIds_ []string
  25006. for _, v := range creativeFieldIds {
  25007. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  25008. }
  25009. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  25010. return c
  25011. }
  25012. // Ids sets the optional parameter "ids": Select only creatives with
  25013. // these IDs.
  25014. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  25015. var ids_ []string
  25016. for _, v := range ids {
  25017. ids_ = append(ids_, fmt.Sprint(v))
  25018. }
  25019. c.urlParams_.SetMulti("ids", ids_)
  25020. return c
  25021. }
  25022. // MaxResults sets the optional parameter "maxResults": Maximum number
  25023. // of results to return.
  25024. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  25025. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25026. return c
  25027. }
  25028. // PageToken sets the optional parameter "pageToken": Value of the
  25029. // nextPageToken from the previous result page.
  25030. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  25031. c.urlParams_.Set("pageToken", pageToken)
  25032. return c
  25033. }
  25034. // RenderingIds sets the optional parameter "renderingIds": Select only
  25035. // creatives with these rendering IDs.
  25036. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  25037. var renderingIds_ []string
  25038. for _, v := range renderingIds {
  25039. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  25040. }
  25041. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  25042. return c
  25043. }
  25044. // SearchString sets the optional parameter "searchString": Allows
  25045. // searching for objects by name or ID. Wildcards (*) are allowed. For
  25046. // example, "creative*2015" will return objects with names like
  25047. // "creative June 2015", "creative April 2015", or simply "creative
  25048. // 2015". Most of the searches also add wildcards implicitly at the
  25049. // start and the end of the search string. For example, a search string
  25050. // of "creative" will match objects with name "my creative", "creative
  25051. // 2015", or simply "creative".
  25052. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  25053. c.urlParams_.Set("searchString", searchString)
  25054. return c
  25055. }
  25056. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  25057. // with these size IDs.
  25058. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  25059. var sizeIds_ []string
  25060. for _, v := range sizeIds {
  25061. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  25062. }
  25063. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  25064. return c
  25065. }
  25066. // SortField sets the optional parameter "sortField": Field by which to
  25067. // sort the list.
  25068. //
  25069. // Possible values:
  25070. // "ID" (default)
  25071. // "NAME"
  25072. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  25073. c.urlParams_.Set("sortField", sortField)
  25074. return c
  25075. }
  25076. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  25077. // results.
  25078. //
  25079. // Possible values:
  25080. // "ASCENDING" (default)
  25081. // "DESCENDING"
  25082. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  25083. c.urlParams_.Set("sortOrder", sortOrder)
  25084. return c
  25085. }
  25086. // StudioCreativeId sets the optional parameter "studioCreativeId":
  25087. // Select only creatives corresponding to this Studio creative ID.
  25088. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  25089. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  25090. return c
  25091. }
  25092. // Types sets the optional parameter "types": Select only creatives with
  25093. // these creative types.
  25094. //
  25095. // Possible values:
  25096. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  25097. // "CUSTOM_DISPLAY"
  25098. // "CUSTOM_DISPLAY_INTERSTITIAL"
  25099. // "DISPLAY"
  25100. // "DISPLAY_IMAGE_GALLERY"
  25101. // "DISPLAY_REDIRECT"
  25102. // "FLASH_INPAGE"
  25103. // "HTML5_BANNER"
  25104. // "IMAGE"
  25105. // "INSTREAM_AUDIO"
  25106. // "INSTREAM_VIDEO"
  25107. // "INSTREAM_VIDEO_REDIRECT"
  25108. // "INTERNAL_REDIRECT"
  25109. // "INTERSTITIAL_INTERNAL_REDIRECT"
  25110. // "RICH_MEDIA_DISPLAY_BANNER"
  25111. // "RICH_MEDIA_DISPLAY_EXPANDING"
  25112. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  25113. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  25114. // "RICH_MEDIA_IM_EXPAND"
  25115. // "RICH_MEDIA_INPAGE_FLOATING"
  25116. // "RICH_MEDIA_MOBILE_IN_APP"
  25117. // "RICH_MEDIA_PEEL_DOWN"
  25118. // "TRACKING_TEXT"
  25119. // "VPAID_LINEAR_VIDEO"
  25120. // "VPAID_NON_LINEAR_VIDEO"
  25121. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  25122. c.urlParams_.SetMulti("types", append([]string{}, types...))
  25123. return c
  25124. }
  25125. // Fields allows partial responses to be retrieved. See
  25126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25127. // for more information.
  25128. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  25129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25130. return c
  25131. }
  25132. // IfNoneMatch sets the optional parameter which makes the operation
  25133. // fail if the object's ETag matches the given value. This is useful for
  25134. // getting updates only after the object has changed since the last
  25135. // request. Use googleapi.IsNotModified to check whether the response
  25136. // error from Do is the result of In-None-Match.
  25137. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  25138. c.ifNoneMatch_ = entityTag
  25139. return c
  25140. }
  25141. // Context sets the context to be used in this call's Do method. Any
  25142. // pending HTTP request will be aborted if the provided context is
  25143. // canceled.
  25144. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  25145. c.ctx_ = ctx
  25146. return c
  25147. }
  25148. // Header returns an http.Header that can be modified by the caller to
  25149. // add HTTP headers to the request.
  25150. func (c *CreativesListCall) Header() http.Header {
  25151. if c.header_ == nil {
  25152. c.header_ = make(http.Header)
  25153. }
  25154. return c.header_
  25155. }
  25156. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  25157. reqHeaders := make(http.Header)
  25158. for k, v := range c.header_ {
  25159. reqHeaders[k] = v
  25160. }
  25161. reqHeaders.Set("User-Agent", c.s.userAgent())
  25162. if c.ifNoneMatch_ != "" {
  25163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25164. }
  25165. var body io.Reader = nil
  25166. c.urlParams_.Set("alt", alt)
  25167. c.urlParams_.Set("prettyPrint", "false")
  25168. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25169. urls += "?" + c.urlParams_.Encode()
  25170. req, err := http.NewRequest("GET", urls, body)
  25171. if err != nil {
  25172. return nil, err
  25173. }
  25174. req.Header = reqHeaders
  25175. googleapi.Expand(req.URL, map[string]string{
  25176. "profileId": strconv.FormatInt(c.profileId, 10),
  25177. })
  25178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25179. }
  25180. // Do executes the "dfareporting.creatives.list" call.
  25181. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  25182. // non-2xx status code is an error. Response headers are in either
  25183. // *CreativesListResponse.ServerResponse.Header or (if a response was
  25184. // returned at all) in error.(*googleapi.Error).Header. Use
  25185. // googleapi.IsNotModified to check whether the returned error was
  25186. // because http.StatusNotModified was returned.
  25187. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  25188. gensupport.SetOptions(c.urlParams_, opts...)
  25189. res, err := c.doRequest("json")
  25190. if res != nil && res.StatusCode == http.StatusNotModified {
  25191. if res.Body != nil {
  25192. res.Body.Close()
  25193. }
  25194. return nil, &googleapi.Error{
  25195. Code: res.StatusCode,
  25196. Header: res.Header,
  25197. }
  25198. }
  25199. if err != nil {
  25200. return nil, err
  25201. }
  25202. defer googleapi.CloseBody(res)
  25203. if err := googleapi.CheckResponse(res); err != nil {
  25204. return nil, err
  25205. }
  25206. ret := &CreativesListResponse{
  25207. ServerResponse: googleapi.ServerResponse{
  25208. Header: res.Header,
  25209. HTTPStatusCode: res.StatusCode,
  25210. },
  25211. }
  25212. target := &ret
  25213. if err := gensupport.DecodeResponse(target, res); err != nil {
  25214. return nil, err
  25215. }
  25216. return ret, nil
  25217. // {
  25218. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  25219. // "httpMethod": "GET",
  25220. // "id": "dfareporting.creatives.list",
  25221. // "parameterOrder": [
  25222. // "profileId"
  25223. // ],
  25224. // "parameters": {
  25225. // "active": {
  25226. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  25227. // "location": "query",
  25228. // "type": "boolean"
  25229. // },
  25230. // "advertiserId": {
  25231. // "description": "Select only creatives with this advertiser ID.",
  25232. // "format": "int64",
  25233. // "location": "query",
  25234. // "type": "string"
  25235. // },
  25236. // "archived": {
  25237. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  25238. // "location": "query",
  25239. // "type": "boolean"
  25240. // },
  25241. // "campaignId": {
  25242. // "description": "Select only creatives with this campaign ID.",
  25243. // "format": "int64",
  25244. // "location": "query",
  25245. // "type": "string"
  25246. // },
  25247. // "companionCreativeIds": {
  25248. // "description": "Select only in-stream video creatives with these companion IDs.",
  25249. // "format": "int64",
  25250. // "location": "query",
  25251. // "repeated": true,
  25252. // "type": "string"
  25253. // },
  25254. // "creativeFieldIds": {
  25255. // "description": "Select only creatives with these creative field IDs.",
  25256. // "format": "int64",
  25257. // "location": "query",
  25258. // "repeated": true,
  25259. // "type": "string"
  25260. // },
  25261. // "ids": {
  25262. // "description": "Select only creatives with these IDs.",
  25263. // "format": "int64",
  25264. // "location": "query",
  25265. // "repeated": true,
  25266. // "type": "string"
  25267. // },
  25268. // "maxResults": {
  25269. // "default": "1000",
  25270. // "description": "Maximum number of results to return.",
  25271. // "format": "int32",
  25272. // "location": "query",
  25273. // "maximum": "1000",
  25274. // "minimum": "0",
  25275. // "type": "integer"
  25276. // },
  25277. // "pageToken": {
  25278. // "description": "Value of the nextPageToken from the previous result page.",
  25279. // "location": "query",
  25280. // "type": "string"
  25281. // },
  25282. // "profileId": {
  25283. // "description": "User profile ID associated with this request.",
  25284. // "format": "int64",
  25285. // "location": "path",
  25286. // "required": true,
  25287. // "type": "string"
  25288. // },
  25289. // "renderingIds": {
  25290. // "description": "Select only creatives with these rendering IDs.",
  25291. // "format": "int64",
  25292. // "location": "query",
  25293. // "repeated": true,
  25294. // "type": "string"
  25295. // },
  25296. // "searchString": {
  25297. // "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\".",
  25298. // "location": "query",
  25299. // "type": "string"
  25300. // },
  25301. // "sizeIds": {
  25302. // "description": "Select only creatives with these size IDs.",
  25303. // "format": "int64",
  25304. // "location": "query",
  25305. // "repeated": true,
  25306. // "type": "string"
  25307. // },
  25308. // "sortField": {
  25309. // "default": "ID",
  25310. // "description": "Field by which to sort the list.",
  25311. // "enum": [
  25312. // "ID",
  25313. // "NAME"
  25314. // ],
  25315. // "enumDescriptions": [
  25316. // "",
  25317. // ""
  25318. // ],
  25319. // "location": "query",
  25320. // "type": "string"
  25321. // },
  25322. // "sortOrder": {
  25323. // "default": "ASCENDING",
  25324. // "description": "Order of sorted results.",
  25325. // "enum": [
  25326. // "ASCENDING",
  25327. // "DESCENDING"
  25328. // ],
  25329. // "enumDescriptions": [
  25330. // "",
  25331. // ""
  25332. // ],
  25333. // "location": "query",
  25334. // "type": "string"
  25335. // },
  25336. // "studioCreativeId": {
  25337. // "description": "Select only creatives corresponding to this Studio creative ID.",
  25338. // "format": "int64",
  25339. // "location": "query",
  25340. // "type": "string"
  25341. // },
  25342. // "types": {
  25343. // "description": "Select only creatives with these creative types.",
  25344. // "enum": [
  25345. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  25346. // "CUSTOM_DISPLAY",
  25347. // "CUSTOM_DISPLAY_INTERSTITIAL",
  25348. // "DISPLAY",
  25349. // "DISPLAY_IMAGE_GALLERY",
  25350. // "DISPLAY_REDIRECT",
  25351. // "FLASH_INPAGE",
  25352. // "HTML5_BANNER",
  25353. // "IMAGE",
  25354. // "INSTREAM_AUDIO",
  25355. // "INSTREAM_VIDEO",
  25356. // "INSTREAM_VIDEO_REDIRECT",
  25357. // "INTERNAL_REDIRECT",
  25358. // "INTERSTITIAL_INTERNAL_REDIRECT",
  25359. // "RICH_MEDIA_DISPLAY_BANNER",
  25360. // "RICH_MEDIA_DISPLAY_EXPANDING",
  25361. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  25362. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  25363. // "RICH_MEDIA_IM_EXPAND",
  25364. // "RICH_MEDIA_INPAGE_FLOATING",
  25365. // "RICH_MEDIA_MOBILE_IN_APP",
  25366. // "RICH_MEDIA_PEEL_DOWN",
  25367. // "TRACKING_TEXT",
  25368. // "VPAID_LINEAR_VIDEO",
  25369. // "VPAID_NON_LINEAR_VIDEO"
  25370. // ],
  25371. // "enumDescriptions": [
  25372. // "",
  25373. // "",
  25374. // "",
  25375. // "",
  25376. // "",
  25377. // "",
  25378. // "",
  25379. // "",
  25380. // "",
  25381. // "",
  25382. // "",
  25383. // "",
  25384. // "",
  25385. // "",
  25386. // "",
  25387. // "",
  25388. // "",
  25389. // "",
  25390. // "",
  25391. // "",
  25392. // "",
  25393. // "",
  25394. // "",
  25395. // "",
  25396. // ""
  25397. // ],
  25398. // "location": "query",
  25399. // "repeated": true,
  25400. // "type": "string"
  25401. // }
  25402. // },
  25403. // "path": "userprofiles/{profileId}/creatives",
  25404. // "response": {
  25405. // "$ref": "CreativesListResponse"
  25406. // },
  25407. // "scopes": [
  25408. // "https://www.googleapis.com/auth/dfatrafficking"
  25409. // ]
  25410. // }
  25411. }
  25412. // Pages invokes f for each page of results.
  25413. // A non-nil error returned from f will halt the iteration.
  25414. // The provided context supersedes any context provided to the Context method.
  25415. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  25416. c.ctx_ = ctx
  25417. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25418. for {
  25419. x, err := c.Do()
  25420. if err != nil {
  25421. return err
  25422. }
  25423. if err := f(x); err != nil {
  25424. return err
  25425. }
  25426. if x.NextPageToken == "" {
  25427. return nil
  25428. }
  25429. c.PageToken(x.NextPageToken)
  25430. }
  25431. }
  25432. // method id "dfareporting.creatives.patch":
  25433. type CreativesPatchCall struct {
  25434. s *Service
  25435. profileId int64
  25436. creative *Creative
  25437. urlParams_ gensupport.URLParams
  25438. ctx_ context.Context
  25439. header_ http.Header
  25440. }
  25441. // Patch: Updates an existing creative. This method supports patch
  25442. // semantics.
  25443. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  25444. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25445. c.profileId = profileId
  25446. c.urlParams_.Set("id", fmt.Sprint(id))
  25447. c.creative = creative
  25448. return c
  25449. }
  25450. // Fields allows partial responses to be retrieved. See
  25451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25452. // for more information.
  25453. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  25454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25455. return c
  25456. }
  25457. // Context sets the context to be used in this call's Do method. Any
  25458. // pending HTTP request will be aborted if the provided context is
  25459. // canceled.
  25460. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  25461. c.ctx_ = ctx
  25462. return c
  25463. }
  25464. // Header returns an http.Header that can be modified by the caller to
  25465. // add HTTP headers to the request.
  25466. func (c *CreativesPatchCall) Header() http.Header {
  25467. if c.header_ == nil {
  25468. c.header_ = make(http.Header)
  25469. }
  25470. return c.header_
  25471. }
  25472. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  25473. reqHeaders := make(http.Header)
  25474. for k, v := range c.header_ {
  25475. reqHeaders[k] = v
  25476. }
  25477. reqHeaders.Set("User-Agent", c.s.userAgent())
  25478. var body io.Reader = nil
  25479. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25480. if err != nil {
  25481. return nil, err
  25482. }
  25483. reqHeaders.Set("Content-Type", "application/json")
  25484. c.urlParams_.Set("alt", alt)
  25485. c.urlParams_.Set("prettyPrint", "false")
  25486. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25487. urls += "?" + c.urlParams_.Encode()
  25488. req, err := http.NewRequest("PATCH", urls, body)
  25489. if err != nil {
  25490. return nil, err
  25491. }
  25492. req.Header = reqHeaders
  25493. googleapi.Expand(req.URL, map[string]string{
  25494. "profileId": strconv.FormatInt(c.profileId, 10),
  25495. })
  25496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25497. }
  25498. // Do executes the "dfareporting.creatives.patch" call.
  25499. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25500. // code is an error. Response headers are in either
  25501. // *Creative.ServerResponse.Header or (if a response was returned at
  25502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25503. // to check whether the returned error was because
  25504. // http.StatusNotModified was returned.
  25505. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25506. gensupport.SetOptions(c.urlParams_, opts...)
  25507. res, err := c.doRequest("json")
  25508. if res != nil && res.StatusCode == http.StatusNotModified {
  25509. if res.Body != nil {
  25510. res.Body.Close()
  25511. }
  25512. return nil, &googleapi.Error{
  25513. Code: res.StatusCode,
  25514. Header: res.Header,
  25515. }
  25516. }
  25517. if err != nil {
  25518. return nil, err
  25519. }
  25520. defer googleapi.CloseBody(res)
  25521. if err := googleapi.CheckResponse(res); err != nil {
  25522. return nil, err
  25523. }
  25524. ret := &Creative{
  25525. ServerResponse: googleapi.ServerResponse{
  25526. Header: res.Header,
  25527. HTTPStatusCode: res.StatusCode,
  25528. },
  25529. }
  25530. target := &ret
  25531. if err := gensupport.DecodeResponse(target, res); err != nil {
  25532. return nil, err
  25533. }
  25534. return ret, nil
  25535. // {
  25536. // "description": "Updates an existing creative. This method supports patch semantics.",
  25537. // "httpMethod": "PATCH",
  25538. // "id": "dfareporting.creatives.patch",
  25539. // "parameterOrder": [
  25540. // "profileId",
  25541. // "id"
  25542. // ],
  25543. // "parameters": {
  25544. // "id": {
  25545. // "description": "Creative ID.",
  25546. // "format": "int64",
  25547. // "location": "query",
  25548. // "required": true,
  25549. // "type": "string"
  25550. // },
  25551. // "profileId": {
  25552. // "description": "User profile ID associated with this request.",
  25553. // "format": "int64",
  25554. // "location": "path",
  25555. // "required": true,
  25556. // "type": "string"
  25557. // }
  25558. // },
  25559. // "path": "userprofiles/{profileId}/creatives",
  25560. // "request": {
  25561. // "$ref": "Creative"
  25562. // },
  25563. // "response": {
  25564. // "$ref": "Creative"
  25565. // },
  25566. // "scopes": [
  25567. // "https://www.googleapis.com/auth/dfatrafficking"
  25568. // ]
  25569. // }
  25570. }
  25571. // method id "dfareporting.creatives.update":
  25572. type CreativesUpdateCall struct {
  25573. s *Service
  25574. profileId int64
  25575. creative *Creative
  25576. urlParams_ gensupport.URLParams
  25577. ctx_ context.Context
  25578. header_ http.Header
  25579. }
  25580. // Update: Updates an existing creative.
  25581. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  25582. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25583. c.profileId = profileId
  25584. c.creative = creative
  25585. return c
  25586. }
  25587. // Fields allows partial responses to be retrieved. See
  25588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25589. // for more information.
  25590. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  25591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25592. return c
  25593. }
  25594. // Context sets the context to be used in this call's Do method. Any
  25595. // pending HTTP request will be aborted if the provided context is
  25596. // canceled.
  25597. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  25598. c.ctx_ = ctx
  25599. return c
  25600. }
  25601. // Header returns an http.Header that can be modified by the caller to
  25602. // add HTTP headers to the request.
  25603. func (c *CreativesUpdateCall) Header() http.Header {
  25604. if c.header_ == nil {
  25605. c.header_ = make(http.Header)
  25606. }
  25607. return c.header_
  25608. }
  25609. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  25610. reqHeaders := make(http.Header)
  25611. for k, v := range c.header_ {
  25612. reqHeaders[k] = v
  25613. }
  25614. reqHeaders.Set("User-Agent", c.s.userAgent())
  25615. var body io.Reader = nil
  25616. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25617. if err != nil {
  25618. return nil, err
  25619. }
  25620. reqHeaders.Set("Content-Type", "application/json")
  25621. c.urlParams_.Set("alt", alt)
  25622. c.urlParams_.Set("prettyPrint", "false")
  25623. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25624. urls += "?" + c.urlParams_.Encode()
  25625. req, err := http.NewRequest("PUT", urls, body)
  25626. if err != nil {
  25627. return nil, err
  25628. }
  25629. req.Header = reqHeaders
  25630. googleapi.Expand(req.URL, map[string]string{
  25631. "profileId": strconv.FormatInt(c.profileId, 10),
  25632. })
  25633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25634. }
  25635. // Do executes the "dfareporting.creatives.update" call.
  25636. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25637. // code is an error. Response headers are in either
  25638. // *Creative.ServerResponse.Header or (if a response was returned at
  25639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25640. // to check whether the returned error was because
  25641. // http.StatusNotModified was returned.
  25642. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25643. gensupport.SetOptions(c.urlParams_, opts...)
  25644. res, err := c.doRequest("json")
  25645. if res != nil && res.StatusCode == http.StatusNotModified {
  25646. if res.Body != nil {
  25647. res.Body.Close()
  25648. }
  25649. return nil, &googleapi.Error{
  25650. Code: res.StatusCode,
  25651. Header: res.Header,
  25652. }
  25653. }
  25654. if err != nil {
  25655. return nil, err
  25656. }
  25657. defer googleapi.CloseBody(res)
  25658. if err := googleapi.CheckResponse(res); err != nil {
  25659. return nil, err
  25660. }
  25661. ret := &Creative{
  25662. ServerResponse: googleapi.ServerResponse{
  25663. Header: res.Header,
  25664. HTTPStatusCode: res.StatusCode,
  25665. },
  25666. }
  25667. target := &ret
  25668. if err := gensupport.DecodeResponse(target, res); err != nil {
  25669. return nil, err
  25670. }
  25671. return ret, nil
  25672. // {
  25673. // "description": "Updates an existing creative.",
  25674. // "httpMethod": "PUT",
  25675. // "id": "dfareporting.creatives.update",
  25676. // "parameterOrder": [
  25677. // "profileId"
  25678. // ],
  25679. // "parameters": {
  25680. // "profileId": {
  25681. // "description": "User profile ID associated with this request.",
  25682. // "format": "int64",
  25683. // "location": "path",
  25684. // "required": true,
  25685. // "type": "string"
  25686. // }
  25687. // },
  25688. // "path": "userprofiles/{profileId}/creatives",
  25689. // "request": {
  25690. // "$ref": "Creative"
  25691. // },
  25692. // "response": {
  25693. // "$ref": "Creative"
  25694. // },
  25695. // "scopes": [
  25696. // "https://www.googleapis.com/auth/dfatrafficking"
  25697. // ]
  25698. // }
  25699. }
  25700. // method id "dfareporting.dimensionValues.query":
  25701. type DimensionValuesQueryCall struct {
  25702. s *Service
  25703. profileId int64
  25704. dimensionvaluerequest *DimensionValueRequest
  25705. urlParams_ gensupport.URLParams
  25706. ctx_ context.Context
  25707. header_ http.Header
  25708. }
  25709. // Query: Retrieves list of report dimension values for a list of
  25710. // filters.
  25711. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  25712. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25713. c.profileId = profileId
  25714. c.dimensionvaluerequest = dimensionvaluerequest
  25715. return c
  25716. }
  25717. // MaxResults sets the optional parameter "maxResults": Maximum number
  25718. // of results to return.
  25719. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  25720. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25721. return c
  25722. }
  25723. // PageToken sets the optional parameter "pageToken": The value of the
  25724. // nextToken from the previous result page.
  25725. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  25726. c.urlParams_.Set("pageToken", pageToken)
  25727. return c
  25728. }
  25729. // Fields allows partial responses to be retrieved. See
  25730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25731. // for more information.
  25732. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  25733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25734. return c
  25735. }
  25736. // Context sets the context to be used in this call's Do method. Any
  25737. // pending HTTP request will be aborted if the provided context is
  25738. // canceled.
  25739. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  25740. c.ctx_ = ctx
  25741. return c
  25742. }
  25743. // Header returns an http.Header that can be modified by the caller to
  25744. // add HTTP headers to the request.
  25745. func (c *DimensionValuesQueryCall) Header() http.Header {
  25746. if c.header_ == nil {
  25747. c.header_ = make(http.Header)
  25748. }
  25749. return c.header_
  25750. }
  25751. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  25752. reqHeaders := make(http.Header)
  25753. for k, v := range c.header_ {
  25754. reqHeaders[k] = v
  25755. }
  25756. reqHeaders.Set("User-Agent", c.s.userAgent())
  25757. var body io.Reader = nil
  25758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  25759. if err != nil {
  25760. return nil, err
  25761. }
  25762. reqHeaders.Set("Content-Type", "application/json")
  25763. c.urlParams_.Set("alt", alt)
  25764. c.urlParams_.Set("prettyPrint", "false")
  25765. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  25766. urls += "?" + c.urlParams_.Encode()
  25767. req, err := http.NewRequest("POST", urls, body)
  25768. if err != nil {
  25769. return nil, err
  25770. }
  25771. req.Header = reqHeaders
  25772. googleapi.Expand(req.URL, map[string]string{
  25773. "profileId": strconv.FormatInt(c.profileId, 10),
  25774. })
  25775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25776. }
  25777. // Do executes the "dfareporting.dimensionValues.query" call.
  25778. // Exactly one of *DimensionValueList or error will be non-nil. Any
  25779. // non-2xx status code is an error. Response headers are in either
  25780. // *DimensionValueList.ServerResponse.Header or (if a response was
  25781. // returned at all) in error.(*googleapi.Error).Header. Use
  25782. // googleapi.IsNotModified to check whether the returned error was
  25783. // because http.StatusNotModified was returned.
  25784. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  25785. gensupport.SetOptions(c.urlParams_, opts...)
  25786. res, err := c.doRequest("json")
  25787. if res != nil && res.StatusCode == http.StatusNotModified {
  25788. if res.Body != nil {
  25789. res.Body.Close()
  25790. }
  25791. return nil, &googleapi.Error{
  25792. Code: res.StatusCode,
  25793. Header: res.Header,
  25794. }
  25795. }
  25796. if err != nil {
  25797. return nil, err
  25798. }
  25799. defer googleapi.CloseBody(res)
  25800. if err := googleapi.CheckResponse(res); err != nil {
  25801. return nil, err
  25802. }
  25803. ret := &DimensionValueList{
  25804. ServerResponse: googleapi.ServerResponse{
  25805. Header: res.Header,
  25806. HTTPStatusCode: res.StatusCode,
  25807. },
  25808. }
  25809. target := &ret
  25810. if err := gensupport.DecodeResponse(target, res); err != nil {
  25811. return nil, err
  25812. }
  25813. return ret, nil
  25814. // {
  25815. // "description": "Retrieves list of report dimension values for a list of filters.",
  25816. // "httpMethod": "POST",
  25817. // "id": "dfareporting.dimensionValues.query",
  25818. // "parameterOrder": [
  25819. // "profileId"
  25820. // ],
  25821. // "parameters": {
  25822. // "maxResults": {
  25823. // "default": "100",
  25824. // "description": "Maximum number of results to return.",
  25825. // "format": "int32",
  25826. // "location": "query",
  25827. // "maximum": "100",
  25828. // "minimum": "0",
  25829. // "type": "integer"
  25830. // },
  25831. // "pageToken": {
  25832. // "description": "The value of the nextToken from the previous result page.",
  25833. // "location": "query",
  25834. // "type": "string"
  25835. // },
  25836. // "profileId": {
  25837. // "description": "The DFA user profile ID.",
  25838. // "format": "int64",
  25839. // "location": "path",
  25840. // "required": true,
  25841. // "type": "string"
  25842. // }
  25843. // },
  25844. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  25845. // "request": {
  25846. // "$ref": "DimensionValueRequest"
  25847. // },
  25848. // "response": {
  25849. // "$ref": "DimensionValueList"
  25850. // },
  25851. // "scopes": [
  25852. // "https://www.googleapis.com/auth/dfareporting"
  25853. // ]
  25854. // }
  25855. }
  25856. // Pages invokes f for each page of results.
  25857. // A non-nil error returned from f will halt the iteration.
  25858. // The provided context supersedes any context provided to the Context method.
  25859. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  25860. c.ctx_ = ctx
  25861. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25862. for {
  25863. x, err := c.Do()
  25864. if err != nil {
  25865. return err
  25866. }
  25867. if err := f(x); err != nil {
  25868. return err
  25869. }
  25870. if x.NextPageToken == "" {
  25871. return nil
  25872. }
  25873. c.PageToken(x.NextPageToken)
  25874. }
  25875. }
  25876. // method id "dfareporting.directorySiteContacts.get":
  25877. type DirectorySiteContactsGetCall struct {
  25878. s *Service
  25879. profileId int64
  25880. id int64
  25881. urlParams_ gensupport.URLParams
  25882. ifNoneMatch_ string
  25883. ctx_ context.Context
  25884. header_ http.Header
  25885. }
  25886. // Get: Gets one directory site contact by ID.
  25887. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  25888. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25889. c.profileId = profileId
  25890. c.id = id
  25891. return c
  25892. }
  25893. // Fields allows partial responses to be retrieved. See
  25894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25895. // for more information.
  25896. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  25897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25898. return c
  25899. }
  25900. // IfNoneMatch sets the optional parameter which makes the operation
  25901. // fail if the object's ETag matches the given value. This is useful for
  25902. // getting updates only after the object has changed since the last
  25903. // request. Use googleapi.IsNotModified to check whether the response
  25904. // error from Do is the result of In-None-Match.
  25905. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  25906. c.ifNoneMatch_ = entityTag
  25907. return c
  25908. }
  25909. // Context sets the context to be used in this call's Do method. Any
  25910. // pending HTTP request will be aborted if the provided context is
  25911. // canceled.
  25912. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  25913. c.ctx_ = ctx
  25914. return c
  25915. }
  25916. // Header returns an http.Header that can be modified by the caller to
  25917. // add HTTP headers to the request.
  25918. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  25919. if c.header_ == nil {
  25920. c.header_ = make(http.Header)
  25921. }
  25922. return c.header_
  25923. }
  25924. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  25925. reqHeaders := make(http.Header)
  25926. for k, v := range c.header_ {
  25927. reqHeaders[k] = v
  25928. }
  25929. reqHeaders.Set("User-Agent", c.s.userAgent())
  25930. if c.ifNoneMatch_ != "" {
  25931. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25932. }
  25933. var body io.Reader = nil
  25934. c.urlParams_.Set("alt", alt)
  25935. c.urlParams_.Set("prettyPrint", "false")
  25936. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  25937. urls += "?" + c.urlParams_.Encode()
  25938. req, err := http.NewRequest("GET", urls, body)
  25939. if err != nil {
  25940. return nil, err
  25941. }
  25942. req.Header = reqHeaders
  25943. googleapi.Expand(req.URL, map[string]string{
  25944. "profileId": strconv.FormatInt(c.profileId, 10),
  25945. "id": strconv.FormatInt(c.id, 10),
  25946. })
  25947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25948. }
  25949. // Do executes the "dfareporting.directorySiteContacts.get" call.
  25950. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  25951. // non-2xx status code is an error. Response headers are in either
  25952. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  25953. // returned at all) in error.(*googleapi.Error).Header. Use
  25954. // googleapi.IsNotModified to check whether the returned error was
  25955. // because http.StatusNotModified was returned.
  25956. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  25957. gensupport.SetOptions(c.urlParams_, opts...)
  25958. res, err := c.doRequest("json")
  25959. if res != nil && res.StatusCode == http.StatusNotModified {
  25960. if res.Body != nil {
  25961. res.Body.Close()
  25962. }
  25963. return nil, &googleapi.Error{
  25964. Code: res.StatusCode,
  25965. Header: res.Header,
  25966. }
  25967. }
  25968. if err != nil {
  25969. return nil, err
  25970. }
  25971. defer googleapi.CloseBody(res)
  25972. if err := googleapi.CheckResponse(res); err != nil {
  25973. return nil, err
  25974. }
  25975. ret := &DirectorySiteContact{
  25976. ServerResponse: googleapi.ServerResponse{
  25977. Header: res.Header,
  25978. HTTPStatusCode: res.StatusCode,
  25979. },
  25980. }
  25981. target := &ret
  25982. if err := gensupport.DecodeResponse(target, res); err != nil {
  25983. return nil, err
  25984. }
  25985. return ret, nil
  25986. // {
  25987. // "description": "Gets one directory site contact by ID.",
  25988. // "httpMethod": "GET",
  25989. // "id": "dfareporting.directorySiteContacts.get",
  25990. // "parameterOrder": [
  25991. // "profileId",
  25992. // "id"
  25993. // ],
  25994. // "parameters": {
  25995. // "id": {
  25996. // "description": "Directory site contact ID.",
  25997. // "format": "int64",
  25998. // "location": "path",
  25999. // "required": true,
  26000. // "type": "string"
  26001. // },
  26002. // "profileId": {
  26003. // "description": "User profile ID associated with this request.",
  26004. // "format": "int64",
  26005. // "location": "path",
  26006. // "required": true,
  26007. // "type": "string"
  26008. // }
  26009. // },
  26010. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  26011. // "response": {
  26012. // "$ref": "DirectorySiteContact"
  26013. // },
  26014. // "scopes": [
  26015. // "https://www.googleapis.com/auth/dfatrafficking"
  26016. // ]
  26017. // }
  26018. }
  26019. // method id "dfareporting.directorySiteContacts.list":
  26020. type DirectorySiteContactsListCall struct {
  26021. s *Service
  26022. profileId int64
  26023. urlParams_ gensupport.URLParams
  26024. ifNoneMatch_ string
  26025. ctx_ context.Context
  26026. header_ http.Header
  26027. }
  26028. // List: Retrieves a list of directory site contacts, possibly filtered.
  26029. // This method supports paging.
  26030. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  26031. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26032. c.profileId = profileId
  26033. return c
  26034. }
  26035. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  26036. // Select only directory site contacts with these directory site IDs.
  26037. // This is a required field.
  26038. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  26039. var directorySiteIds_ []string
  26040. for _, v := range directorySiteIds {
  26041. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  26042. }
  26043. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  26044. return c
  26045. }
  26046. // Ids sets the optional parameter "ids": Select only directory site
  26047. // contacts with these IDs.
  26048. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  26049. var ids_ []string
  26050. for _, v := range ids {
  26051. ids_ = append(ids_, fmt.Sprint(v))
  26052. }
  26053. c.urlParams_.SetMulti("ids", ids_)
  26054. return c
  26055. }
  26056. // MaxResults sets the optional parameter "maxResults": Maximum number
  26057. // of results to return.
  26058. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  26059. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26060. return c
  26061. }
  26062. // PageToken sets the optional parameter "pageToken": Value of the
  26063. // nextPageToken from the previous result page.
  26064. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  26065. c.urlParams_.Set("pageToken", pageToken)
  26066. return c
  26067. }
  26068. // SearchString sets the optional parameter "searchString": Allows
  26069. // searching for objects by name, ID or email. Wildcards (*) are
  26070. // allowed. For example, "directory site contact*2015" will return
  26071. // objects with names like "directory site contact June 2015",
  26072. // "directory site contact April 2015", or simply "directory site
  26073. // contact 2015". Most of the searches also add wildcards implicitly at
  26074. // the start and the end of the search string. For example, a search
  26075. // string of "directory site contact" will match objects with name "my
  26076. // directory site contact", "directory site contact 2015", or simply
  26077. // "directory site contact".
  26078. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  26079. c.urlParams_.Set("searchString", searchString)
  26080. return c
  26081. }
  26082. // SortField sets the optional parameter "sortField": Field by which to
  26083. // sort the list.
  26084. //
  26085. // Possible values:
  26086. // "ID" (default)
  26087. // "NAME"
  26088. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  26089. c.urlParams_.Set("sortField", sortField)
  26090. return c
  26091. }
  26092. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26093. // results.
  26094. //
  26095. // Possible values:
  26096. // "ASCENDING" (default)
  26097. // "DESCENDING"
  26098. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  26099. c.urlParams_.Set("sortOrder", sortOrder)
  26100. return c
  26101. }
  26102. // Fields allows partial responses to be retrieved. See
  26103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26104. // for more information.
  26105. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  26106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26107. return c
  26108. }
  26109. // IfNoneMatch sets the optional parameter which makes the operation
  26110. // fail if the object's ETag matches the given value. This is useful for
  26111. // getting updates only after the object has changed since the last
  26112. // request. Use googleapi.IsNotModified to check whether the response
  26113. // error from Do is the result of In-None-Match.
  26114. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  26115. c.ifNoneMatch_ = entityTag
  26116. return c
  26117. }
  26118. // Context sets the context to be used in this call's Do method. Any
  26119. // pending HTTP request will be aborted if the provided context is
  26120. // canceled.
  26121. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  26122. c.ctx_ = ctx
  26123. return c
  26124. }
  26125. // Header returns an http.Header that can be modified by the caller to
  26126. // add HTTP headers to the request.
  26127. func (c *DirectorySiteContactsListCall) Header() http.Header {
  26128. if c.header_ == nil {
  26129. c.header_ = make(http.Header)
  26130. }
  26131. return c.header_
  26132. }
  26133. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  26134. reqHeaders := make(http.Header)
  26135. for k, v := range c.header_ {
  26136. reqHeaders[k] = v
  26137. }
  26138. reqHeaders.Set("User-Agent", c.s.userAgent())
  26139. if c.ifNoneMatch_ != "" {
  26140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26141. }
  26142. var body io.Reader = nil
  26143. c.urlParams_.Set("alt", alt)
  26144. c.urlParams_.Set("prettyPrint", "false")
  26145. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  26146. urls += "?" + c.urlParams_.Encode()
  26147. req, err := http.NewRequest("GET", urls, body)
  26148. if err != nil {
  26149. return nil, err
  26150. }
  26151. req.Header = reqHeaders
  26152. googleapi.Expand(req.URL, map[string]string{
  26153. "profileId": strconv.FormatInt(c.profileId, 10),
  26154. })
  26155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26156. }
  26157. // Do executes the "dfareporting.directorySiteContacts.list" call.
  26158. // Exactly one of *DirectorySiteContactsListResponse or error will be
  26159. // non-nil. Any non-2xx status code is an error. Response headers are in
  26160. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  26161. // (if a response was returned at all) in
  26162. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  26163. // whether the returned error was because http.StatusNotModified was
  26164. // returned.
  26165. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  26166. gensupport.SetOptions(c.urlParams_, opts...)
  26167. res, err := c.doRequest("json")
  26168. if res != nil && res.StatusCode == http.StatusNotModified {
  26169. if res.Body != nil {
  26170. res.Body.Close()
  26171. }
  26172. return nil, &googleapi.Error{
  26173. Code: res.StatusCode,
  26174. Header: res.Header,
  26175. }
  26176. }
  26177. if err != nil {
  26178. return nil, err
  26179. }
  26180. defer googleapi.CloseBody(res)
  26181. if err := googleapi.CheckResponse(res); err != nil {
  26182. return nil, err
  26183. }
  26184. ret := &DirectorySiteContactsListResponse{
  26185. ServerResponse: googleapi.ServerResponse{
  26186. Header: res.Header,
  26187. HTTPStatusCode: res.StatusCode,
  26188. },
  26189. }
  26190. target := &ret
  26191. if err := gensupport.DecodeResponse(target, res); err != nil {
  26192. return nil, err
  26193. }
  26194. return ret, nil
  26195. // {
  26196. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  26197. // "httpMethod": "GET",
  26198. // "id": "dfareporting.directorySiteContacts.list",
  26199. // "parameterOrder": [
  26200. // "profileId"
  26201. // ],
  26202. // "parameters": {
  26203. // "directorySiteIds": {
  26204. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  26205. // "format": "int64",
  26206. // "location": "query",
  26207. // "repeated": true,
  26208. // "type": "string"
  26209. // },
  26210. // "ids": {
  26211. // "description": "Select only directory site contacts with these IDs.",
  26212. // "format": "int64",
  26213. // "location": "query",
  26214. // "repeated": true,
  26215. // "type": "string"
  26216. // },
  26217. // "maxResults": {
  26218. // "default": "1000",
  26219. // "description": "Maximum number of results to return.",
  26220. // "format": "int32",
  26221. // "location": "query",
  26222. // "maximum": "1000",
  26223. // "minimum": "0",
  26224. // "type": "integer"
  26225. // },
  26226. // "pageToken": {
  26227. // "description": "Value of the nextPageToken from the previous result page.",
  26228. // "location": "query",
  26229. // "type": "string"
  26230. // },
  26231. // "profileId": {
  26232. // "description": "User profile ID associated with this request.",
  26233. // "format": "int64",
  26234. // "location": "path",
  26235. // "required": true,
  26236. // "type": "string"
  26237. // },
  26238. // "searchString": {
  26239. // "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\".",
  26240. // "location": "query",
  26241. // "type": "string"
  26242. // },
  26243. // "sortField": {
  26244. // "default": "ID",
  26245. // "description": "Field by which to sort the list.",
  26246. // "enum": [
  26247. // "ID",
  26248. // "NAME"
  26249. // ],
  26250. // "enumDescriptions": [
  26251. // "",
  26252. // ""
  26253. // ],
  26254. // "location": "query",
  26255. // "type": "string"
  26256. // },
  26257. // "sortOrder": {
  26258. // "default": "ASCENDING",
  26259. // "description": "Order of sorted results.",
  26260. // "enum": [
  26261. // "ASCENDING",
  26262. // "DESCENDING"
  26263. // ],
  26264. // "enumDescriptions": [
  26265. // "",
  26266. // ""
  26267. // ],
  26268. // "location": "query",
  26269. // "type": "string"
  26270. // }
  26271. // },
  26272. // "path": "userprofiles/{profileId}/directorySiteContacts",
  26273. // "response": {
  26274. // "$ref": "DirectorySiteContactsListResponse"
  26275. // },
  26276. // "scopes": [
  26277. // "https://www.googleapis.com/auth/dfatrafficking"
  26278. // ]
  26279. // }
  26280. }
  26281. // Pages invokes f for each page of results.
  26282. // A non-nil error returned from f will halt the iteration.
  26283. // The provided context supersedes any context provided to the Context method.
  26284. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  26285. c.ctx_ = ctx
  26286. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26287. for {
  26288. x, err := c.Do()
  26289. if err != nil {
  26290. return err
  26291. }
  26292. if err := f(x); err != nil {
  26293. return err
  26294. }
  26295. if x.NextPageToken == "" {
  26296. return nil
  26297. }
  26298. c.PageToken(x.NextPageToken)
  26299. }
  26300. }
  26301. // method id "dfareporting.directorySites.get":
  26302. type DirectorySitesGetCall struct {
  26303. s *Service
  26304. profileId int64
  26305. id int64
  26306. urlParams_ gensupport.URLParams
  26307. ifNoneMatch_ string
  26308. ctx_ context.Context
  26309. header_ http.Header
  26310. }
  26311. // Get: Gets one directory site by ID.
  26312. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  26313. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26314. c.profileId = profileId
  26315. c.id = id
  26316. return c
  26317. }
  26318. // Fields allows partial responses to be retrieved. See
  26319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26320. // for more information.
  26321. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  26322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26323. return c
  26324. }
  26325. // IfNoneMatch sets the optional parameter which makes the operation
  26326. // fail if the object's ETag matches the given value. This is useful for
  26327. // getting updates only after the object has changed since the last
  26328. // request. Use googleapi.IsNotModified to check whether the response
  26329. // error from Do is the result of In-None-Match.
  26330. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  26331. c.ifNoneMatch_ = entityTag
  26332. return c
  26333. }
  26334. // Context sets the context to be used in this call's Do method. Any
  26335. // pending HTTP request will be aborted if the provided context is
  26336. // canceled.
  26337. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  26338. c.ctx_ = ctx
  26339. return c
  26340. }
  26341. // Header returns an http.Header that can be modified by the caller to
  26342. // add HTTP headers to the request.
  26343. func (c *DirectorySitesGetCall) Header() http.Header {
  26344. if c.header_ == nil {
  26345. c.header_ = make(http.Header)
  26346. }
  26347. return c.header_
  26348. }
  26349. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  26350. reqHeaders := make(http.Header)
  26351. for k, v := range c.header_ {
  26352. reqHeaders[k] = v
  26353. }
  26354. reqHeaders.Set("User-Agent", c.s.userAgent())
  26355. if c.ifNoneMatch_ != "" {
  26356. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26357. }
  26358. var body io.Reader = nil
  26359. c.urlParams_.Set("alt", alt)
  26360. c.urlParams_.Set("prettyPrint", "false")
  26361. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  26362. urls += "?" + c.urlParams_.Encode()
  26363. req, err := http.NewRequest("GET", urls, body)
  26364. if err != nil {
  26365. return nil, err
  26366. }
  26367. req.Header = reqHeaders
  26368. googleapi.Expand(req.URL, map[string]string{
  26369. "profileId": strconv.FormatInt(c.profileId, 10),
  26370. "id": strconv.FormatInt(c.id, 10),
  26371. })
  26372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26373. }
  26374. // Do executes the "dfareporting.directorySites.get" call.
  26375. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26376. // status code is an error. Response headers are in either
  26377. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26378. // at all) in error.(*googleapi.Error).Header. Use
  26379. // googleapi.IsNotModified to check whether the returned error was
  26380. // because http.StatusNotModified was returned.
  26381. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26382. gensupport.SetOptions(c.urlParams_, opts...)
  26383. res, err := c.doRequest("json")
  26384. if res != nil && res.StatusCode == http.StatusNotModified {
  26385. if res.Body != nil {
  26386. res.Body.Close()
  26387. }
  26388. return nil, &googleapi.Error{
  26389. Code: res.StatusCode,
  26390. Header: res.Header,
  26391. }
  26392. }
  26393. if err != nil {
  26394. return nil, err
  26395. }
  26396. defer googleapi.CloseBody(res)
  26397. if err := googleapi.CheckResponse(res); err != nil {
  26398. return nil, err
  26399. }
  26400. ret := &DirectorySite{
  26401. ServerResponse: googleapi.ServerResponse{
  26402. Header: res.Header,
  26403. HTTPStatusCode: res.StatusCode,
  26404. },
  26405. }
  26406. target := &ret
  26407. if err := gensupport.DecodeResponse(target, res); err != nil {
  26408. return nil, err
  26409. }
  26410. return ret, nil
  26411. // {
  26412. // "description": "Gets one directory site by ID.",
  26413. // "httpMethod": "GET",
  26414. // "id": "dfareporting.directorySites.get",
  26415. // "parameterOrder": [
  26416. // "profileId",
  26417. // "id"
  26418. // ],
  26419. // "parameters": {
  26420. // "id": {
  26421. // "description": "Directory site ID.",
  26422. // "format": "int64",
  26423. // "location": "path",
  26424. // "required": true,
  26425. // "type": "string"
  26426. // },
  26427. // "profileId": {
  26428. // "description": "User profile ID associated with this request.",
  26429. // "format": "int64",
  26430. // "location": "path",
  26431. // "required": true,
  26432. // "type": "string"
  26433. // }
  26434. // },
  26435. // "path": "userprofiles/{profileId}/directorySites/{id}",
  26436. // "response": {
  26437. // "$ref": "DirectorySite"
  26438. // },
  26439. // "scopes": [
  26440. // "https://www.googleapis.com/auth/dfatrafficking"
  26441. // ]
  26442. // }
  26443. }
  26444. // method id "dfareporting.directorySites.insert":
  26445. type DirectorySitesInsertCall struct {
  26446. s *Service
  26447. profileId int64
  26448. directorysite *DirectorySite
  26449. urlParams_ gensupport.URLParams
  26450. ctx_ context.Context
  26451. header_ http.Header
  26452. }
  26453. // Insert: Inserts a new directory site.
  26454. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  26455. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26456. c.profileId = profileId
  26457. c.directorysite = directorysite
  26458. return c
  26459. }
  26460. // Fields allows partial responses to be retrieved. See
  26461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26462. // for more information.
  26463. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  26464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26465. return c
  26466. }
  26467. // Context sets the context to be used in this call's Do method. Any
  26468. // pending HTTP request will be aborted if the provided context is
  26469. // canceled.
  26470. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  26471. c.ctx_ = ctx
  26472. return c
  26473. }
  26474. // Header returns an http.Header that can be modified by the caller to
  26475. // add HTTP headers to the request.
  26476. func (c *DirectorySitesInsertCall) Header() http.Header {
  26477. if c.header_ == nil {
  26478. c.header_ = make(http.Header)
  26479. }
  26480. return c.header_
  26481. }
  26482. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  26483. reqHeaders := make(http.Header)
  26484. for k, v := range c.header_ {
  26485. reqHeaders[k] = v
  26486. }
  26487. reqHeaders.Set("User-Agent", c.s.userAgent())
  26488. var body io.Reader = nil
  26489. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  26490. if err != nil {
  26491. return nil, err
  26492. }
  26493. reqHeaders.Set("Content-Type", "application/json")
  26494. c.urlParams_.Set("alt", alt)
  26495. c.urlParams_.Set("prettyPrint", "false")
  26496. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26497. urls += "?" + c.urlParams_.Encode()
  26498. req, err := http.NewRequest("POST", urls, body)
  26499. if err != nil {
  26500. return nil, err
  26501. }
  26502. req.Header = reqHeaders
  26503. googleapi.Expand(req.URL, map[string]string{
  26504. "profileId": strconv.FormatInt(c.profileId, 10),
  26505. })
  26506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26507. }
  26508. // Do executes the "dfareporting.directorySites.insert" call.
  26509. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26510. // status code is an error. Response headers are in either
  26511. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26512. // at all) in error.(*googleapi.Error).Header. Use
  26513. // googleapi.IsNotModified to check whether the returned error was
  26514. // because http.StatusNotModified was returned.
  26515. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26516. gensupport.SetOptions(c.urlParams_, opts...)
  26517. res, err := c.doRequest("json")
  26518. if res != nil && res.StatusCode == http.StatusNotModified {
  26519. if res.Body != nil {
  26520. res.Body.Close()
  26521. }
  26522. return nil, &googleapi.Error{
  26523. Code: res.StatusCode,
  26524. Header: res.Header,
  26525. }
  26526. }
  26527. if err != nil {
  26528. return nil, err
  26529. }
  26530. defer googleapi.CloseBody(res)
  26531. if err := googleapi.CheckResponse(res); err != nil {
  26532. return nil, err
  26533. }
  26534. ret := &DirectorySite{
  26535. ServerResponse: googleapi.ServerResponse{
  26536. Header: res.Header,
  26537. HTTPStatusCode: res.StatusCode,
  26538. },
  26539. }
  26540. target := &ret
  26541. if err := gensupport.DecodeResponse(target, res); err != nil {
  26542. return nil, err
  26543. }
  26544. return ret, nil
  26545. // {
  26546. // "description": "Inserts a new directory site.",
  26547. // "httpMethod": "POST",
  26548. // "id": "dfareporting.directorySites.insert",
  26549. // "parameterOrder": [
  26550. // "profileId"
  26551. // ],
  26552. // "parameters": {
  26553. // "profileId": {
  26554. // "description": "User profile ID associated with this request.",
  26555. // "format": "int64",
  26556. // "location": "path",
  26557. // "required": true,
  26558. // "type": "string"
  26559. // }
  26560. // },
  26561. // "path": "userprofiles/{profileId}/directorySites",
  26562. // "request": {
  26563. // "$ref": "DirectorySite"
  26564. // },
  26565. // "response": {
  26566. // "$ref": "DirectorySite"
  26567. // },
  26568. // "scopes": [
  26569. // "https://www.googleapis.com/auth/dfatrafficking"
  26570. // ]
  26571. // }
  26572. }
  26573. // method id "dfareporting.directorySites.list":
  26574. type DirectorySitesListCall struct {
  26575. s *Service
  26576. profileId int64
  26577. urlParams_ gensupport.URLParams
  26578. ifNoneMatch_ string
  26579. ctx_ context.Context
  26580. header_ http.Header
  26581. }
  26582. // List: Retrieves a list of directory sites, possibly filtered. This
  26583. // method supports paging.
  26584. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  26585. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26586. c.profileId = profileId
  26587. return c
  26588. }
  26589. // AcceptsInStreamVideoPlacements sets the optional parameter
  26590. // "acceptsInStreamVideoPlacements": This search filter is no longer
  26591. // supported and will have no effect on the results returned.
  26592. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  26593. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  26594. return c
  26595. }
  26596. // AcceptsInterstitialPlacements sets the optional parameter
  26597. // "acceptsInterstitialPlacements": This search filter is no longer
  26598. // supported and will have no effect on the results returned.
  26599. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  26600. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  26601. return c
  26602. }
  26603. // AcceptsPublisherPaidPlacements sets the optional parameter
  26604. // "acceptsPublisherPaidPlacements": Select only directory sites that
  26605. // accept publisher paid placements. This field can be left blank.
  26606. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  26607. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  26608. return c
  26609. }
  26610. // Active sets the optional parameter "active": Select only active
  26611. // directory sites. Leave blank to retrieve both active and inactive
  26612. // directory sites.
  26613. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  26614. c.urlParams_.Set("active", fmt.Sprint(active))
  26615. return c
  26616. }
  26617. // CountryId sets the optional parameter "countryId": Select only
  26618. // directory sites with this country ID.
  26619. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  26620. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  26621. return c
  26622. }
  26623. // DfpNetworkCode sets the optional parameter "dfpNetworkCode": Select
  26624. // only directory sites with this Ad Manager network code.
  26625. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  26626. c.urlParams_.Set("dfpNetworkCode", dfpNetworkCode)
  26627. return c
  26628. }
  26629. // Ids sets the optional parameter "ids": Select only directory sites
  26630. // with these IDs.
  26631. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  26632. var ids_ []string
  26633. for _, v := range ids {
  26634. ids_ = append(ids_, fmt.Sprint(v))
  26635. }
  26636. c.urlParams_.SetMulti("ids", ids_)
  26637. return c
  26638. }
  26639. // MaxResults sets the optional parameter "maxResults": Maximum number
  26640. // of results to return.
  26641. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  26642. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26643. return c
  26644. }
  26645. // PageToken sets the optional parameter "pageToken": Value of the
  26646. // nextPageToken from the previous result page.
  26647. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  26648. c.urlParams_.Set("pageToken", pageToken)
  26649. return c
  26650. }
  26651. // ParentId sets the optional parameter "parentId": Select only
  26652. // directory sites with this parent ID.
  26653. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  26654. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  26655. return c
  26656. }
  26657. // SearchString sets the optional parameter "searchString": Allows
  26658. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  26659. // For example, "directory site*2015" will return objects with names
  26660. // like "directory site June 2015", "directory site April 2015", or
  26661. // simply "directory site 2015". Most of the searches also add wildcards
  26662. // implicitly at the start and the end of the search string. For
  26663. // example, a search string of "directory site" will match objects with
  26664. // name "my directory site", "directory site 2015" or simply, "directory
  26665. // site".
  26666. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  26667. c.urlParams_.Set("searchString", searchString)
  26668. return c
  26669. }
  26670. // SortField sets the optional parameter "sortField": Field by which to
  26671. // sort the list.
  26672. //
  26673. // Possible values:
  26674. // "ID" (default)
  26675. // "NAME"
  26676. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  26677. c.urlParams_.Set("sortField", sortField)
  26678. return c
  26679. }
  26680. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26681. // results.
  26682. //
  26683. // Possible values:
  26684. // "ASCENDING" (default)
  26685. // "DESCENDING"
  26686. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  26687. c.urlParams_.Set("sortOrder", sortOrder)
  26688. return c
  26689. }
  26690. // Fields allows partial responses to be retrieved. See
  26691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26692. // for more information.
  26693. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  26694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26695. return c
  26696. }
  26697. // IfNoneMatch sets the optional parameter which makes the operation
  26698. // fail if the object's ETag matches the given value. This is useful for
  26699. // getting updates only after the object has changed since the last
  26700. // request. Use googleapi.IsNotModified to check whether the response
  26701. // error from Do is the result of In-None-Match.
  26702. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  26703. c.ifNoneMatch_ = entityTag
  26704. return c
  26705. }
  26706. // Context sets the context to be used in this call's Do method. Any
  26707. // pending HTTP request will be aborted if the provided context is
  26708. // canceled.
  26709. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  26710. c.ctx_ = ctx
  26711. return c
  26712. }
  26713. // Header returns an http.Header that can be modified by the caller to
  26714. // add HTTP headers to the request.
  26715. func (c *DirectorySitesListCall) Header() http.Header {
  26716. if c.header_ == nil {
  26717. c.header_ = make(http.Header)
  26718. }
  26719. return c.header_
  26720. }
  26721. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  26722. reqHeaders := make(http.Header)
  26723. for k, v := range c.header_ {
  26724. reqHeaders[k] = v
  26725. }
  26726. reqHeaders.Set("User-Agent", c.s.userAgent())
  26727. if c.ifNoneMatch_ != "" {
  26728. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26729. }
  26730. var body io.Reader = nil
  26731. c.urlParams_.Set("alt", alt)
  26732. c.urlParams_.Set("prettyPrint", "false")
  26733. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26734. urls += "?" + c.urlParams_.Encode()
  26735. req, err := http.NewRequest("GET", urls, body)
  26736. if err != nil {
  26737. return nil, err
  26738. }
  26739. req.Header = reqHeaders
  26740. googleapi.Expand(req.URL, map[string]string{
  26741. "profileId": strconv.FormatInt(c.profileId, 10),
  26742. })
  26743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26744. }
  26745. // Do executes the "dfareporting.directorySites.list" call.
  26746. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  26747. // Any non-2xx status code is an error. Response headers are in either
  26748. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  26749. // was returned at all) in error.(*googleapi.Error).Header. Use
  26750. // googleapi.IsNotModified to check whether the returned error was
  26751. // because http.StatusNotModified was returned.
  26752. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  26753. gensupport.SetOptions(c.urlParams_, opts...)
  26754. res, err := c.doRequest("json")
  26755. if res != nil && res.StatusCode == http.StatusNotModified {
  26756. if res.Body != nil {
  26757. res.Body.Close()
  26758. }
  26759. return nil, &googleapi.Error{
  26760. Code: res.StatusCode,
  26761. Header: res.Header,
  26762. }
  26763. }
  26764. if err != nil {
  26765. return nil, err
  26766. }
  26767. defer googleapi.CloseBody(res)
  26768. if err := googleapi.CheckResponse(res); err != nil {
  26769. return nil, err
  26770. }
  26771. ret := &DirectorySitesListResponse{
  26772. ServerResponse: googleapi.ServerResponse{
  26773. Header: res.Header,
  26774. HTTPStatusCode: res.StatusCode,
  26775. },
  26776. }
  26777. target := &ret
  26778. if err := gensupport.DecodeResponse(target, res); err != nil {
  26779. return nil, err
  26780. }
  26781. return ret, nil
  26782. // {
  26783. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  26784. // "httpMethod": "GET",
  26785. // "id": "dfareporting.directorySites.list",
  26786. // "parameterOrder": [
  26787. // "profileId"
  26788. // ],
  26789. // "parameters": {
  26790. // "acceptsInStreamVideoPlacements": {
  26791. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26792. // "location": "query",
  26793. // "type": "boolean"
  26794. // },
  26795. // "acceptsInterstitialPlacements": {
  26796. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26797. // "location": "query",
  26798. // "type": "boolean"
  26799. // },
  26800. // "acceptsPublisherPaidPlacements": {
  26801. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  26802. // "location": "query",
  26803. // "type": "boolean"
  26804. // },
  26805. // "active": {
  26806. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  26807. // "location": "query",
  26808. // "type": "boolean"
  26809. // },
  26810. // "countryId": {
  26811. // "description": "Select only directory sites with this country ID.",
  26812. // "format": "int64",
  26813. // "location": "query",
  26814. // "type": "string"
  26815. // },
  26816. // "dfpNetworkCode": {
  26817. // "description": "Select only directory sites with this Ad Manager network code.",
  26818. // "location": "query",
  26819. // "type": "string"
  26820. // },
  26821. // "ids": {
  26822. // "description": "Select only directory sites with these IDs.",
  26823. // "format": "int64",
  26824. // "location": "query",
  26825. // "repeated": true,
  26826. // "type": "string"
  26827. // },
  26828. // "maxResults": {
  26829. // "default": "1000",
  26830. // "description": "Maximum number of results to return.",
  26831. // "format": "int32",
  26832. // "location": "query",
  26833. // "maximum": "1000",
  26834. // "minimum": "0",
  26835. // "type": "integer"
  26836. // },
  26837. // "pageToken": {
  26838. // "description": "Value of the nextPageToken from the previous result page.",
  26839. // "location": "query",
  26840. // "type": "string"
  26841. // },
  26842. // "parentId": {
  26843. // "description": "Select only directory sites with this parent ID.",
  26844. // "format": "int64",
  26845. // "location": "query",
  26846. // "type": "string"
  26847. // },
  26848. // "profileId": {
  26849. // "description": "User profile ID associated with this request.",
  26850. // "format": "int64",
  26851. // "location": "path",
  26852. // "required": true,
  26853. // "type": "string"
  26854. // },
  26855. // "searchString": {
  26856. // "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\".",
  26857. // "location": "query",
  26858. // "type": "string"
  26859. // },
  26860. // "sortField": {
  26861. // "default": "ID",
  26862. // "description": "Field by which to sort the list.",
  26863. // "enum": [
  26864. // "ID",
  26865. // "NAME"
  26866. // ],
  26867. // "enumDescriptions": [
  26868. // "",
  26869. // ""
  26870. // ],
  26871. // "location": "query",
  26872. // "type": "string"
  26873. // },
  26874. // "sortOrder": {
  26875. // "default": "ASCENDING",
  26876. // "description": "Order of sorted results.",
  26877. // "enum": [
  26878. // "ASCENDING",
  26879. // "DESCENDING"
  26880. // ],
  26881. // "enumDescriptions": [
  26882. // "",
  26883. // ""
  26884. // ],
  26885. // "location": "query",
  26886. // "type": "string"
  26887. // }
  26888. // },
  26889. // "path": "userprofiles/{profileId}/directorySites",
  26890. // "response": {
  26891. // "$ref": "DirectorySitesListResponse"
  26892. // },
  26893. // "scopes": [
  26894. // "https://www.googleapis.com/auth/dfatrafficking"
  26895. // ]
  26896. // }
  26897. }
  26898. // Pages invokes f for each page of results.
  26899. // A non-nil error returned from f will halt the iteration.
  26900. // The provided context supersedes any context provided to the Context method.
  26901. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  26902. c.ctx_ = ctx
  26903. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26904. for {
  26905. x, err := c.Do()
  26906. if err != nil {
  26907. return err
  26908. }
  26909. if err := f(x); err != nil {
  26910. return err
  26911. }
  26912. if x.NextPageToken == "" {
  26913. return nil
  26914. }
  26915. c.PageToken(x.NextPageToken)
  26916. }
  26917. }
  26918. // method id "dfareporting.dynamicTargetingKeys.delete":
  26919. type DynamicTargetingKeysDeleteCall struct {
  26920. s *Service
  26921. profileId int64
  26922. objectId int64
  26923. urlParams_ gensupport.URLParams
  26924. ctx_ context.Context
  26925. header_ http.Header
  26926. }
  26927. // Delete: Deletes an existing dynamic targeting key.
  26928. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  26929. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26930. c.profileId = profileId
  26931. c.objectId = objectId
  26932. c.urlParams_.Set("name", name)
  26933. c.urlParams_.Set("objectType", objectType)
  26934. return c
  26935. }
  26936. // Fields allows partial responses to be retrieved. See
  26937. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26938. // for more information.
  26939. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  26940. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26941. return c
  26942. }
  26943. // Context sets the context to be used in this call's Do method. Any
  26944. // pending HTTP request will be aborted if the provided context is
  26945. // canceled.
  26946. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  26947. c.ctx_ = ctx
  26948. return c
  26949. }
  26950. // Header returns an http.Header that can be modified by the caller to
  26951. // add HTTP headers to the request.
  26952. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  26953. if c.header_ == nil {
  26954. c.header_ = make(http.Header)
  26955. }
  26956. return c.header_
  26957. }
  26958. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  26959. reqHeaders := make(http.Header)
  26960. for k, v := range c.header_ {
  26961. reqHeaders[k] = v
  26962. }
  26963. reqHeaders.Set("User-Agent", c.s.userAgent())
  26964. var body io.Reader = nil
  26965. c.urlParams_.Set("alt", alt)
  26966. c.urlParams_.Set("prettyPrint", "false")
  26967. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  26968. urls += "?" + c.urlParams_.Encode()
  26969. req, err := http.NewRequest("DELETE", urls, body)
  26970. if err != nil {
  26971. return nil, err
  26972. }
  26973. req.Header = reqHeaders
  26974. googleapi.Expand(req.URL, map[string]string{
  26975. "profileId": strconv.FormatInt(c.profileId, 10),
  26976. "objectId": strconv.FormatInt(c.objectId, 10),
  26977. })
  26978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26979. }
  26980. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  26981. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  26982. gensupport.SetOptions(c.urlParams_, opts...)
  26983. res, err := c.doRequest("json")
  26984. if err != nil {
  26985. return err
  26986. }
  26987. defer googleapi.CloseBody(res)
  26988. if err := googleapi.CheckResponse(res); err != nil {
  26989. return err
  26990. }
  26991. return nil
  26992. // {
  26993. // "description": "Deletes an existing dynamic targeting key.",
  26994. // "httpMethod": "DELETE",
  26995. // "id": "dfareporting.dynamicTargetingKeys.delete",
  26996. // "parameterOrder": [
  26997. // "profileId",
  26998. // "objectId",
  26999. // "name",
  27000. // "objectType"
  27001. // ],
  27002. // "parameters": {
  27003. // "name": {
  27004. // "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.",
  27005. // "location": "query",
  27006. // "required": true,
  27007. // "type": "string"
  27008. // },
  27009. // "objectId": {
  27010. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  27011. // "format": "int64",
  27012. // "location": "path",
  27013. // "required": true,
  27014. // "type": "string"
  27015. // },
  27016. // "objectType": {
  27017. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  27018. // "enum": [
  27019. // "OBJECT_AD",
  27020. // "OBJECT_ADVERTISER",
  27021. // "OBJECT_CREATIVE",
  27022. // "OBJECT_PLACEMENT"
  27023. // ],
  27024. // "enumDescriptions": [
  27025. // "",
  27026. // "",
  27027. // "",
  27028. // ""
  27029. // ],
  27030. // "location": "query",
  27031. // "required": true,
  27032. // "type": "string"
  27033. // },
  27034. // "profileId": {
  27035. // "description": "User profile ID associated with this request.",
  27036. // "format": "int64",
  27037. // "location": "path",
  27038. // "required": true,
  27039. // "type": "string"
  27040. // }
  27041. // },
  27042. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  27043. // "scopes": [
  27044. // "https://www.googleapis.com/auth/dfatrafficking"
  27045. // ]
  27046. // }
  27047. }
  27048. // method id "dfareporting.dynamicTargetingKeys.insert":
  27049. type DynamicTargetingKeysInsertCall struct {
  27050. s *Service
  27051. profileId int64
  27052. dynamictargetingkey *DynamicTargetingKey
  27053. urlParams_ gensupport.URLParams
  27054. ctx_ context.Context
  27055. header_ http.Header
  27056. }
  27057. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  27058. // the advertiser level before being assigned to the advertiser's ads,
  27059. // creatives, or placements. There is a maximum of 1000 keys per
  27060. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  27061. // creative, or placement.
  27062. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  27063. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27064. c.profileId = profileId
  27065. c.dynamictargetingkey = dynamictargetingkey
  27066. return c
  27067. }
  27068. // Fields allows partial responses to be retrieved. See
  27069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27070. // for more information.
  27071. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  27072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27073. return c
  27074. }
  27075. // Context sets the context to be used in this call's Do method. Any
  27076. // pending HTTP request will be aborted if the provided context is
  27077. // canceled.
  27078. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  27079. c.ctx_ = ctx
  27080. return c
  27081. }
  27082. // Header returns an http.Header that can be modified by the caller to
  27083. // add HTTP headers to the request.
  27084. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  27085. if c.header_ == nil {
  27086. c.header_ = make(http.Header)
  27087. }
  27088. return c.header_
  27089. }
  27090. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  27091. reqHeaders := make(http.Header)
  27092. for k, v := range c.header_ {
  27093. reqHeaders[k] = v
  27094. }
  27095. reqHeaders.Set("User-Agent", c.s.userAgent())
  27096. var body io.Reader = nil
  27097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  27098. if err != nil {
  27099. return nil, err
  27100. }
  27101. reqHeaders.Set("Content-Type", "application/json")
  27102. c.urlParams_.Set("alt", alt)
  27103. c.urlParams_.Set("prettyPrint", "false")
  27104. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  27105. urls += "?" + c.urlParams_.Encode()
  27106. req, err := http.NewRequest("POST", urls, body)
  27107. if err != nil {
  27108. return nil, err
  27109. }
  27110. req.Header = reqHeaders
  27111. googleapi.Expand(req.URL, map[string]string{
  27112. "profileId": strconv.FormatInt(c.profileId, 10),
  27113. })
  27114. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27115. }
  27116. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  27117. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  27118. // non-2xx status code is an error. Response headers are in either
  27119. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  27120. // returned at all) in error.(*googleapi.Error).Header. Use
  27121. // googleapi.IsNotModified to check whether the returned error was
  27122. // because http.StatusNotModified was returned.
  27123. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  27124. gensupport.SetOptions(c.urlParams_, opts...)
  27125. res, err := c.doRequest("json")
  27126. if res != nil && res.StatusCode == http.StatusNotModified {
  27127. if res.Body != nil {
  27128. res.Body.Close()
  27129. }
  27130. return nil, &googleapi.Error{
  27131. Code: res.StatusCode,
  27132. Header: res.Header,
  27133. }
  27134. }
  27135. if err != nil {
  27136. return nil, err
  27137. }
  27138. defer googleapi.CloseBody(res)
  27139. if err := googleapi.CheckResponse(res); err != nil {
  27140. return nil, err
  27141. }
  27142. ret := &DynamicTargetingKey{
  27143. ServerResponse: googleapi.ServerResponse{
  27144. Header: res.Header,
  27145. HTTPStatusCode: res.StatusCode,
  27146. },
  27147. }
  27148. target := &ret
  27149. if err := gensupport.DecodeResponse(target, res); err != nil {
  27150. return nil, err
  27151. }
  27152. return ret, nil
  27153. // {
  27154. // "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.",
  27155. // "httpMethod": "POST",
  27156. // "id": "dfareporting.dynamicTargetingKeys.insert",
  27157. // "parameterOrder": [
  27158. // "profileId"
  27159. // ],
  27160. // "parameters": {
  27161. // "profileId": {
  27162. // "description": "User profile ID associated with this request.",
  27163. // "format": "int64",
  27164. // "location": "path",
  27165. // "required": true,
  27166. // "type": "string"
  27167. // }
  27168. // },
  27169. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  27170. // "request": {
  27171. // "$ref": "DynamicTargetingKey"
  27172. // },
  27173. // "response": {
  27174. // "$ref": "DynamicTargetingKey"
  27175. // },
  27176. // "scopes": [
  27177. // "https://www.googleapis.com/auth/dfatrafficking"
  27178. // ]
  27179. // }
  27180. }
  27181. // method id "dfareporting.dynamicTargetingKeys.list":
  27182. type DynamicTargetingKeysListCall struct {
  27183. s *Service
  27184. profileId int64
  27185. urlParams_ gensupport.URLParams
  27186. ifNoneMatch_ string
  27187. ctx_ context.Context
  27188. header_ http.Header
  27189. }
  27190. // List: Retrieves a list of dynamic targeting keys.
  27191. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  27192. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27193. c.profileId = profileId
  27194. return c
  27195. }
  27196. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27197. // dynamic targeting keys whose object has this advertiser ID.
  27198. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  27199. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27200. return c
  27201. }
  27202. // Names sets the optional parameter "names": Select only dynamic
  27203. // targeting keys exactly matching these names.
  27204. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  27205. c.urlParams_.SetMulti("names", append([]string{}, names...))
  27206. return c
  27207. }
  27208. // ObjectId sets the optional parameter "objectId": Select only dynamic
  27209. // targeting keys with this object ID.
  27210. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  27211. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  27212. return c
  27213. }
  27214. // ObjectType sets the optional parameter "objectType": Select only
  27215. // dynamic targeting keys with this object type.
  27216. //
  27217. // Possible values:
  27218. // "OBJECT_AD"
  27219. // "OBJECT_ADVERTISER"
  27220. // "OBJECT_CREATIVE"
  27221. // "OBJECT_PLACEMENT"
  27222. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  27223. c.urlParams_.Set("objectType", objectType)
  27224. return c
  27225. }
  27226. // Fields allows partial responses to be retrieved. See
  27227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27228. // for more information.
  27229. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  27230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27231. return c
  27232. }
  27233. // IfNoneMatch sets the optional parameter which makes the operation
  27234. // fail if the object's ETag matches the given value. This is useful for
  27235. // getting updates only after the object has changed since the last
  27236. // request. Use googleapi.IsNotModified to check whether the response
  27237. // error from Do is the result of In-None-Match.
  27238. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  27239. c.ifNoneMatch_ = entityTag
  27240. return c
  27241. }
  27242. // Context sets the context to be used in this call's Do method. Any
  27243. // pending HTTP request will be aborted if the provided context is
  27244. // canceled.
  27245. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  27246. c.ctx_ = ctx
  27247. return c
  27248. }
  27249. // Header returns an http.Header that can be modified by the caller to
  27250. // add HTTP headers to the request.
  27251. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  27252. if c.header_ == nil {
  27253. c.header_ = make(http.Header)
  27254. }
  27255. return c.header_
  27256. }
  27257. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  27258. reqHeaders := make(http.Header)
  27259. for k, v := range c.header_ {
  27260. reqHeaders[k] = v
  27261. }
  27262. reqHeaders.Set("User-Agent", c.s.userAgent())
  27263. if c.ifNoneMatch_ != "" {
  27264. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27265. }
  27266. var body io.Reader = nil
  27267. c.urlParams_.Set("alt", alt)
  27268. c.urlParams_.Set("prettyPrint", "false")
  27269. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  27270. urls += "?" + c.urlParams_.Encode()
  27271. req, err := http.NewRequest("GET", urls, body)
  27272. if err != nil {
  27273. return nil, err
  27274. }
  27275. req.Header = reqHeaders
  27276. googleapi.Expand(req.URL, map[string]string{
  27277. "profileId": strconv.FormatInt(c.profileId, 10),
  27278. })
  27279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27280. }
  27281. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  27282. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  27283. // non-nil. Any non-2xx status code is an error. Response headers are in
  27284. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  27285. // a response was returned at all) in error.(*googleapi.Error).Header.
  27286. // Use googleapi.IsNotModified to check whether the returned error was
  27287. // because http.StatusNotModified was returned.
  27288. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  27289. gensupport.SetOptions(c.urlParams_, opts...)
  27290. res, err := c.doRequest("json")
  27291. if res != nil && res.StatusCode == http.StatusNotModified {
  27292. if res.Body != nil {
  27293. res.Body.Close()
  27294. }
  27295. return nil, &googleapi.Error{
  27296. Code: res.StatusCode,
  27297. Header: res.Header,
  27298. }
  27299. }
  27300. if err != nil {
  27301. return nil, err
  27302. }
  27303. defer googleapi.CloseBody(res)
  27304. if err := googleapi.CheckResponse(res); err != nil {
  27305. return nil, err
  27306. }
  27307. ret := &DynamicTargetingKeysListResponse{
  27308. ServerResponse: googleapi.ServerResponse{
  27309. Header: res.Header,
  27310. HTTPStatusCode: res.StatusCode,
  27311. },
  27312. }
  27313. target := &ret
  27314. if err := gensupport.DecodeResponse(target, res); err != nil {
  27315. return nil, err
  27316. }
  27317. return ret, nil
  27318. // {
  27319. // "description": "Retrieves a list of dynamic targeting keys.",
  27320. // "httpMethod": "GET",
  27321. // "id": "dfareporting.dynamicTargetingKeys.list",
  27322. // "parameterOrder": [
  27323. // "profileId"
  27324. // ],
  27325. // "parameters": {
  27326. // "advertiserId": {
  27327. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  27328. // "format": "int64",
  27329. // "location": "query",
  27330. // "type": "string"
  27331. // },
  27332. // "names": {
  27333. // "description": "Select only dynamic targeting keys exactly matching these names.",
  27334. // "location": "query",
  27335. // "repeated": true,
  27336. // "type": "string"
  27337. // },
  27338. // "objectId": {
  27339. // "description": "Select only dynamic targeting keys with this object ID.",
  27340. // "format": "int64",
  27341. // "location": "query",
  27342. // "type": "string"
  27343. // },
  27344. // "objectType": {
  27345. // "description": "Select only dynamic targeting keys with this object type.",
  27346. // "enum": [
  27347. // "OBJECT_AD",
  27348. // "OBJECT_ADVERTISER",
  27349. // "OBJECT_CREATIVE",
  27350. // "OBJECT_PLACEMENT"
  27351. // ],
  27352. // "enumDescriptions": [
  27353. // "",
  27354. // "",
  27355. // "",
  27356. // ""
  27357. // ],
  27358. // "location": "query",
  27359. // "type": "string"
  27360. // },
  27361. // "profileId": {
  27362. // "description": "User profile ID associated with this request.",
  27363. // "format": "int64",
  27364. // "location": "path",
  27365. // "required": true,
  27366. // "type": "string"
  27367. // }
  27368. // },
  27369. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  27370. // "response": {
  27371. // "$ref": "DynamicTargetingKeysListResponse"
  27372. // },
  27373. // "scopes": [
  27374. // "https://www.googleapis.com/auth/dfatrafficking"
  27375. // ]
  27376. // }
  27377. }
  27378. // method id "dfareporting.eventTags.delete":
  27379. type EventTagsDeleteCall struct {
  27380. s *Service
  27381. profileId int64
  27382. id int64
  27383. urlParams_ gensupport.URLParams
  27384. ctx_ context.Context
  27385. header_ http.Header
  27386. }
  27387. // Delete: Deletes an existing event tag.
  27388. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  27389. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27390. c.profileId = profileId
  27391. c.id = id
  27392. return c
  27393. }
  27394. // Fields allows partial responses to be retrieved. See
  27395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27396. // for more information.
  27397. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  27398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27399. return c
  27400. }
  27401. // Context sets the context to be used in this call's Do method. Any
  27402. // pending HTTP request will be aborted if the provided context is
  27403. // canceled.
  27404. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  27405. c.ctx_ = ctx
  27406. return c
  27407. }
  27408. // Header returns an http.Header that can be modified by the caller to
  27409. // add HTTP headers to the request.
  27410. func (c *EventTagsDeleteCall) Header() http.Header {
  27411. if c.header_ == nil {
  27412. c.header_ = make(http.Header)
  27413. }
  27414. return c.header_
  27415. }
  27416. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  27417. reqHeaders := make(http.Header)
  27418. for k, v := range c.header_ {
  27419. reqHeaders[k] = v
  27420. }
  27421. reqHeaders.Set("User-Agent", c.s.userAgent())
  27422. var body io.Reader = nil
  27423. c.urlParams_.Set("alt", alt)
  27424. c.urlParams_.Set("prettyPrint", "false")
  27425. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27426. urls += "?" + c.urlParams_.Encode()
  27427. req, err := http.NewRequest("DELETE", urls, body)
  27428. if err != nil {
  27429. return nil, err
  27430. }
  27431. req.Header = reqHeaders
  27432. googleapi.Expand(req.URL, map[string]string{
  27433. "profileId": strconv.FormatInt(c.profileId, 10),
  27434. "id": strconv.FormatInt(c.id, 10),
  27435. })
  27436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27437. }
  27438. // Do executes the "dfareporting.eventTags.delete" call.
  27439. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  27440. gensupport.SetOptions(c.urlParams_, opts...)
  27441. res, err := c.doRequest("json")
  27442. if err != nil {
  27443. return err
  27444. }
  27445. defer googleapi.CloseBody(res)
  27446. if err := googleapi.CheckResponse(res); err != nil {
  27447. return err
  27448. }
  27449. return nil
  27450. // {
  27451. // "description": "Deletes an existing event tag.",
  27452. // "httpMethod": "DELETE",
  27453. // "id": "dfareporting.eventTags.delete",
  27454. // "parameterOrder": [
  27455. // "profileId",
  27456. // "id"
  27457. // ],
  27458. // "parameters": {
  27459. // "id": {
  27460. // "description": "Event tag ID.",
  27461. // "format": "int64",
  27462. // "location": "path",
  27463. // "required": true,
  27464. // "type": "string"
  27465. // },
  27466. // "profileId": {
  27467. // "description": "User profile ID associated with this request.",
  27468. // "format": "int64",
  27469. // "location": "path",
  27470. // "required": true,
  27471. // "type": "string"
  27472. // }
  27473. // },
  27474. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27475. // "scopes": [
  27476. // "https://www.googleapis.com/auth/dfatrafficking"
  27477. // ]
  27478. // }
  27479. }
  27480. // method id "dfareporting.eventTags.get":
  27481. type EventTagsGetCall struct {
  27482. s *Service
  27483. profileId int64
  27484. id int64
  27485. urlParams_ gensupport.URLParams
  27486. ifNoneMatch_ string
  27487. ctx_ context.Context
  27488. header_ http.Header
  27489. }
  27490. // Get: Gets one event tag by ID.
  27491. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  27492. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27493. c.profileId = profileId
  27494. c.id = id
  27495. return c
  27496. }
  27497. // Fields allows partial responses to be retrieved. See
  27498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27499. // for more information.
  27500. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  27501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27502. return c
  27503. }
  27504. // IfNoneMatch sets the optional parameter which makes the operation
  27505. // fail if the object's ETag matches the given value. This is useful for
  27506. // getting updates only after the object has changed since the last
  27507. // request. Use googleapi.IsNotModified to check whether the response
  27508. // error from Do is the result of In-None-Match.
  27509. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  27510. c.ifNoneMatch_ = entityTag
  27511. return c
  27512. }
  27513. // Context sets the context to be used in this call's Do method. Any
  27514. // pending HTTP request will be aborted if the provided context is
  27515. // canceled.
  27516. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  27517. c.ctx_ = ctx
  27518. return c
  27519. }
  27520. // Header returns an http.Header that can be modified by the caller to
  27521. // add HTTP headers to the request.
  27522. func (c *EventTagsGetCall) Header() http.Header {
  27523. if c.header_ == nil {
  27524. c.header_ = make(http.Header)
  27525. }
  27526. return c.header_
  27527. }
  27528. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  27529. reqHeaders := make(http.Header)
  27530. for k, v := range c.header_ {
  27531. reqHeaders[k] = v
  27532. }
  27533. reqHeaders.Set("User-Agent", c.s.userAgent())
  27534. if c.ifNoneMatch_ != "" {
  27535. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27536. }
  27537. var body io.Reader = nil
  27538. c.urlParams_.Set("alt", alt)
  27539. c.urlParams_.Set("prettyPrint", "false")
  27540. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27541. urls += "?" + c.urlParams_.Encode()
  27542. req, err := http.NewRequest("GET", urls, body)
  27543. if err != nil {
  27544. return nil, err
  27545. }
  27546. req.Header = reqHeaders
  27547. googleapi.Expand(req.URL, map[string]string{
  27548. "profileId": strconv.FormatInt(c.profileId, 10),
  27549. "id": strconv.FormatInt(c.id, 10),
  27550. })
  27551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27552. }
  27553. // Do executes the "dfareporting.eventTags.get" call.
  27554. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27555. // code is an error. Response headers are in either
  27556. // *EventTag.ServerResponse.Header or (if a response was returned at
  27557. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27558. // to check whether the returned error was because
  27559. // http.StatusNotModified was returned.
  27560. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27561. gensupport.SetOptions(c.urlParams_, opts...)
  27562. res, err := c.doRequest("json")
  27563. if res != nil && res.StatusCode == http.StatusNotModified {
  27564. if res.Body != nil {
  27565. res.Body.Close()
  27566. }
  27567. return nil, &googleapi.Error{
  27568. Code: res.StatusCode,
  27569. Header: res.Header,
  27570. }
  27571. }
  27572. if err != nil {
  27573. return nil, err
  27574. }
  27575. defer googleapi.CloseBody(res)
  27576. if err := googleapi.CheckResponse(res); err != nil {
  27577. return nil, err
  27578. }
  27579. ret := &EventTag{
  27580. ServerResponse: googleapi.ServerResponse{
  27581. Header: res.Header,
  27582. HTTPStatusCode: res.StatusCode,
  27583. },
  27584. }
  27585. target := &ret
  27586. if err := gensupport.DecodeResponse(target, res); err != nil {
  27587. return nil, err
  27588. }
  27589. return ret, nil
  27590. // {
  27591. // "description": "Gets one event tag by ID.",
  27592. // "httpMethod": "GET",
  27593. // "id": "dfareporting.eventTags.get",
  27594. // "parameterOrder": [
  27595. // "profileId",
  27596. // "id"
  27597. // ],
  27598. // "parameters": {
  27599. // "id": {
  27600. // "description": "Event tag ID.",
  27601. // "format": "int64",
  27602. // "location": "path",
  27603. // "required": true,
  27604. // "type": "string"
  27605. // },
  27606. // "profileId": {
  27607. // "description": "User profile ID associated with this request.",
  27608. // "format": "int64",
  27609. // "location": "path",
  27610. // "required": true,
  27611. // "type": "string"
  27612. // }
  27613. // },
  27614. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27615. // "response": {
  27616. // "$ref": "EventTag"
  27617. // },
  27618. // "scopes": [
  27619. // "https://www.googleapis.com/auth/dfatrafficking"
  27620. // ]
  27621. // }
  27622. }
  27623. // method id "dfareporting.eventTags.insert":
  27624. type EventTagsInsertCall struct {
  27625. s *Service
  27626. profileId int64
  27627. eventtag *EventTag
  27628. urlParams_ gensupport.URLParams
  27629. ctx_ context.Context
  27630. header_ http.Header
  27631. }
  27632. // Insert: Inserts a new event tag.
  27633. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  27634. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27635. c.profileId = profileId
  27636. c.eventtag = eventtag
  27637. return c
  27638. }
  27639. // Fields allows partial responses to be retrieved. See
  27640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27641. // for more information.
  27642. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  27643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27644. return c
  27645. }
  27646. // Context sets the context to be used in this call's Do method. Any
  27647. // pending HTTP request will be aborted if the provided context is
  27648. // canceled.
  27649. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  27650. c.ctx_ = ctx
  27651. return c
  27652. }
  27653. // Header returns an http.Header that can be modified by the caller to
  27654. // add HTTP headers to the request.
  27655. func (c *EventTagsInsertCall) Header() http.Header {
  27656. if c.header_ == nil {
  27657. c.header_ = make(http.Header)
  27658. }
  27659. return c.header_
  27660. }
  27661. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  27662. reqHeaders := make(http.Header)
  27663. for k, v := range c.header_ {
  27664. reqHeaders[k] = v
  27665. }
  27666. reqHeaders.Set("User-Agent", c.s.userAgent())
  27667. var body io.Reader = nil
  27668. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27669. if err != nil {
  27670. return nil, err
  27671. }
  27672. reqHeaders.Set("Content-Type", "application/json")
  27673. c.urlParams_.Set("alt", alt)
  27674. c.urlParams_.Set("prettyPrint", "false")
  27675. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27676. urls += "?" + c.urlParams_.Encode()
  27677. req, err := http.NewRequest("POST", urls, body)
  27678. if err != nil {
  27679. return nil, err
  27680. }
  27681. req.Header = reqHeaders
  27682. googleapi.Expand(req.URL, map[string]string{
  27683. "profileId": strconv.FormatInt(c.profileId, 10),
  27684. })
  27685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27686. }
  27687. // Do executes the "dfareporting.eventTags.insert" call.
  27688. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27689. // code is an error. Response headers are in either
  27690. // *EventTag.ServerResponse.Header or (if a response was returned at
  27691. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27692. // to check whether the returned error was because
  27693. // http.StatusNotModified was returned.
  27694. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27695. gensupport.SetOptions(c.urlParams_, opts...)
  27696. res, err := c.doRequest("json")
  27697. if res != nil && res.StatusCode == http.StatusNotModified {
  27698. if res.Body != nil {
  27699. res.Body.Close()
  27700. }
  27701. return nil, &googleapi.Error{
  27702. Code: res.StatusCode,
  27703. Header: res.Header,
  27704. }
  27705. }
  27706. if err != nil {
  27707. return nil, err
  27708. }
  27709. defer googleapi.CloseBody(res)
  27710. if err := googleapi.CheckResponse(res); err != nil {
  27711. return nil, err
  27712. }
  27713. ret := &EventTag{
  27714. ServerResponse: googleapi.ServerResponse{
  27715. Header: res.Header,
  27716. HTTPStatusCode: res.StatusCode,
  27717. },
  27718. }
  27719. target := &ret
  27720. if err := gensupport.DecodeResponse(target, res); err != nil {
  27721. return nil, err
  27722. }
  27723. return ret, nil
  27724. // {
  27725. // "description": "Inserts a new event tag.",
  27726. // "httpMethod": "POST",
  27727. // "id": "dfareporting.eventTags.insert",
  27728. // "parameterOrder": [
  27729. // "profileId"
  27730. // ],
  27731. // "parameters": {
  27732. // "profileId": {
  27733. // "description": "User profile ID associated with this request.",
  27734. // "format": "int64",
  27735. // "location": "path",
  27736. // "required": true,
  27737. // "type": "string"
  27738. // }
  27739. // },
  27740. // "path": "userprofiles/{profileId}/eventTags",
  27741. // "request": {
  27742. // "$ref": "EventTag"
  27743. // },
  27744. // "response": {
  27745. // "$ref": "EventTag"
  27746. // },
  27747. // "scopes": [
  27748. // "https://www.googleapis.com/auth/dfatrafficking"
  27749. // ]
  27750. // }
  27751. }
  27752. // method id "dfareporting.eventTags.list":
  27753. type EventTagsListCall struct {
  27754. s *Service
  27755. profileId int64
  27756. urlParams_ gensupport.URLParams
  27757. ifNoneMatch_ string
  27758. ctx_ context.Context
  27759. header_ http.Header
  27760. }
  27761. // List: Retrieves a list of event tags, possibly filtered.
  27762. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  27763. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27764. c.profileId = profileId
  27765. return c
  27766. }
  27767. // AdId sets the optional parameter "adId": Select only event tags that
  27768. // belong to this ad.
  27769. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  27770. c.urlParams_.Set("adId", fmt.Sprint(adId))
  27771. return c
  27772. }
  27773. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27774. // event tags that belong to this advertiser.
  27775. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  27776. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27777. return c
  27778. }
  27779. // CampaignId sets the optional parameter "campaignId": Select only
  27780. // event tags that belong to this campaign.
  27781. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  27782. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  27783. return c
  27784. }
  27785. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  27786. // Examine only the specified campaign or advertiser's event tags for
  27787. // matching selector criteria. When set to false, the parent advertiser
  27788. // and parent campaign of the specified ad or campaign is examined as
  27789. // well. In addition, when set to false, the status field is examined as
  27790. // well, along with the enabledByDefault field. This parameter can not
  27791. // be set to true when adId is specified as ads do not define their own
  27792. // even tags.
  27793. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  27794. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  27795. return c
  27796. }
  27797. // Enabled sets the optional parameter "enabled": Select only enabled
  27798. // event tags. What is considered enabled or disabled depends on the
  27799. // definitionsOnly parameter. When definitionsOnly is set to true, only
  27800. // the specified advertiser or campaign's event tags' enabledByDefault
  27801. // field is examined. When definitionsOnly is set to false, the
  27802. // specified ad or specified campaign's parent advertiser's or parent
  27803. // campaign's event tags' enabledByDefault and status fields are
  27804. // examined as well.
  27805. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  27806. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  27807. return c
  27808. }
  27809. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  27810. // only event tags with the specified event tag types. Event tag types
  27811. // can be used to specify whether to use a third-party pixel, a
  27812. // third-party JavaScript URL, or a third-party click-through URL for
  27813. // either impression or click tracking.
  27814. //
  27815. // Possible values:
  27816. // "CLICK_THROUGH_EVENT_TAG"
  27817. // "IMPRESSION_IMAGE_EVENT_TAG"
  27818. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27819. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  27820. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  27821. return c
  27822. }
  27823. // Ids sets the optional parameter "ids": Select only event tags with
  27824. // these IDs.
  27825. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  27826. var ids_ []string
  27827. for _, v := range ids {
  27828. ids_ = append(ids_, fmt.Sprint(v))
  27829. }
  27830. c.urlParams_.SetMulti("ids", ids_)
  27831. return c
  27832. }
  27833. // SearchString sets the optional parameter "searchString": Allows
  27834. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27835. // example, "eventtag*2015" will return objects with names like
  27836. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  27837. // 2015". Most of the searches also add wildcards implicitly at the
  27838. // start and the end of the search string. For example, a search string
  27839. // of "eventtag" will match objects with name "my eventtag", "eventtag
  27840. // 2015", or simply "eventtag".
  27841. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  27842. c.urlParams_.Set("searchString", searchString)
  27843. return c
  27844. }
  27845. // SortField sets the optional parameter "sortField": Field by which to
  27846. // sort the list.
  27847. //
  27848. // Possible values:
  27849. // "ID" (default)
  27850. // "NAME"
  27851. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  27852. c.urlParams_.Set("sortField", sortField)
  27853. return c
  27854. }
  27855. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27856. // results.
  27857. //
  27858. // Possible values:
  27859. // "ASCENDING" (default)
  27860. // "DESCENDING"
  27861. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  27862. c.urlParams_.Set("sortOrder", sortOrder)
  27863. return c
  27864. }
  27865. // Fields allows partial responses to be retrieved. See
  27866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27867. // for more information.
  27868. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  27869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27870. return c
  27871. }
  27872. // IfNoneMatch sets the optional parameter which makes the operation
  27873. // fail if the object's ETag matches the given value. This is useful for
  27874. // getting updates only after the object has changed since the last
  27875. // request. Use googleapi.IsNotModified to check whether the response
  27876. // error from Do is the result of In-None-Match.
  27877. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  27878. c.ifNoneMatch_ = entityTag
  27879. return c
  27880. }
  27881. // Context sets the context to be used in this call's Do method. Any
  27882. // pending HTTP request will be aborted if the provided context is
  27883. // canceled.
  27884. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  27885. c.ctx_ = ctx
  27886. return c
  27887. }
  27888. // Header returns an http.Header that can be modified by the caller to
  27889. // add HTTP headers to the request.
  27890. func (c *EventTagsListCall) Header() http.Header {
  27891. if c.header_ == nil {
  27892. c.header_ = make(http.Header)
  27893. }
  27894. return c.header_
  27895. }
  27896. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  27897. reqHeaders := make(http.Header)
  27898. for k, v := range c.header_ {
  27899. reqHeaders[k] = v
  27900. }
  27901. reqHeaders.Set("User-Agent", c.s.userAgent())
  27902. if c.ifNoneMatch_ != "" {
  27903. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27904. }
  27905. var body io.Reader = nil
  27906. c.urlParams_.Set("alt", alt)
  27907. c.urlParams_.Set("prettyPrint", "false")
  27908. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27909. urls += "?" + c.urlParams_.Encode()
  27910. req, err := http.NewRequest("GET", urls, body)
  27911. if err != nil {
  27912. return nil, err
  27913. }
  27914. req.Header = reqHeaders
  27915. googleapi.Expand(req.URL, map[string]string{
  27916. "profileId": strconv.FormatInt(c.profileId, 10),
  27917. })
  27918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27919. }
  27920. // Do executes the "dfareporting.eventTags.list" call.
  27921. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  27922. // non-2xx status code is an error. Response headers are in either
  27923. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  27924. // returned at all) in error.(*googleapi.Error).Header. Use
  27925. // googleapi.IsNotModified to check whether the returned error was
  27926. // because http.StatusNotModified was returned.
  27927. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  27928. gensupport.SetOptions(c.urlParams_, opts...)
  27929. res, err := c.doRequest("json")
  27930. if res != nil && res.StatusCode == http.StatusNotModified {
  27931. if res.Body != nil {
  27932. res.Body.Close()
  27933. }
  27934. return nil, &googleapi.Error{
  27935. Code: res.StatusCode,
  27936. Header: res.Header,
  27937. }
  27938. }
  27939. if err != nil {
  27940. return nil, err
  27941. }
  27942. defer googleapi.CloseBody(res)
  27943. if err := googleapi.CheckResponse(res); err != nil {
  27944. return nil, err
  27945. }
  27946. ret := &EventTagsListResponse{
  27947. ServerResponse: googleapi.ServerResponse{
  27948. Header: res.Header,
  27949. HTTPStatusCode: res.StatusCode,
  27950. },
  27951. }
  27952. target := &ret
  27953. if err := gensupport.DecodeResponse(target, res); err != nil {
  27954. return nil, err
  27955. }
  27956. return ret, nil
  27957. // {
  27958. // "description": "Retrieves a list of event tags, possibly filtered.",
  27959. // "httpMethod": "GET",
  27960. // "id": "dfareporting.eventTags.list",
  27961. // "parameterOrder": [
  27962. // "profileId"
  27963. // ],
  27964. // "parameters": {
  27965. // "adId": {
  27966. // "description": "Select only event tags that belong to this ad.",
  27967. // "format": "int64",
  27968. // "location": "query",
  27969. // "type": "string"
  27970. // },
  27971. // "advertiserId": {
  27972. // "description": "Select only event tags that belong to this advertiser.",
  27973. // "format": "int64",
  27974. // "location": "query",
  27975. // "type": "string"
  27976. // },
  27977. // "campaignId": {
  27978. // "description": "Select only event tags that belong to this campaign.",
  27979. // "format": "int64",
  27980. // "location": "query",
  27981. // "type": "string"
  27982. // },
  27983. // "definitionsOnly": {
  27984. // "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.",
  27985. // "location": "query",
  27986. // "type": "boolean"
  27987. // },
  27988. // "enabled": {
  27989. // "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.",
  27990. // "location": "query",
  27991. // "type": "boolean"
  27992. // },
  27993. // "eventTagTypes": {
  27994. // "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.",
  27995. // "enum": [
  27996. // "CLICK_THROUGH_EVENT_TAG",
  27997. // "IMPRESSION_IMAGE_EVENT_TAG",
  27998. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27999. // ],
  28000. // "enumDescriptions": [
  28001. // "",
  28002. // "",
  28003. // ""
  28004. // ],
  28005. // "location": "query",
  28006. // "repeated": true,
  28007. // "type": "string"
  28008. // },
  28009. // "ids": {
  28010. // "description": "Select only event tags with these IDs.",
  28011. // "format": "int64",
  28012. // "location": "query",
  28013. // "repeated": true,
  28014. // "type": "string"
  28015. // },
  28016. // "profileId": {
  28017. // "description": "User profile ID associated with this request.",
  28018. // "format": "int64",
  28019. // "location": "path",
  28020. // "required": true,
  28021. // "type": "string"
  28022. // },
  28023. // "searchString": {
  28024. // "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\".",
  28025. // "location": "query",
  28026. // "type": "string"
  28027. // },
  28028. // "sortField": {
  28029. // "default": "ID",
  28030. // "description": "Field by which to sort the list.",
  28031. // "enum": [
  28032. // "ID",
  28033. // "NAME"
  28034. // ],
  28035. // "enumDescriptions": [
  28036. // "",
  28037. // ""
  28038. // ],
  28039. // "location": "query",
  28040. // "type": "string"
  28041. // },
  28042. // "sortOrder": {
  28043. // "default": "ASCENDING",
  28044. // "description": "Order of sorted results.",
  28045. // "enum": [
  28046. // "ASCENDING",
  28047. // "DESCENDING"
  28048. // ],
  28049. // "enumDescriptions": [
  28050. // "",
  28051. // ""
  28052. // ],
  28053. // "location": "query",
  28054. // "type": "string"
  28055. // }
  28056. // },
  28057. // "path": "userprofiles/{profileId}/eventTags",
  28058. // "response": {
  28059. // "$ref": "EventTagsListResponse"
  28060. // },
  28061. // "scopes": [
  28062. // "https://www.googleapis.com/auth/dfatrafficking"
  28063. // ]
  28064. // }
  28065. }
  28066. // method id "dfareporting.eventTags.patch":
  28067. type EventTagsPatchCall struct {
  28068. s *Service
  28069. profileId int64
  28070. eventtag *EventTag
  28071. urlParams_ gensupport.URLParams
  28072. ctx_ context.Context
  28073. header_ http.Header
  28074. }
  28075. // Patch: Updates an existing event tag. This method supports patch
  28076. // semantics.
  28077. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  28078. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28079. c.profileId = profileId
  28080. c.urlParams_.Set("id", fmt.Sprint(id))
  28081. c.eventtag = eventtag
  28082. return c
  28083. }
  28084. // Fields allows partial responses to be retrieved. See
  28085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28086. // for more information.
  28087. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  28088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28089. return c
  28090. }
  28091. // Context sets the context to be used in this call's Do method. Any
  28092. // pending HTTP request will be aborted if the provided context is
  28093. // canceled.
  28094. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  28095. c.ctx_ = ctx
  28096. return c
  28097. }
  28098. // Header returns an http.Header that can be modified by the caller to
  28099. // add HTTP headers to the request.
  28100. func (c *EventTagsPatchCall) Header() http.Header {
  28101. if c.header_ == nil {
  28102. c.header_ = make(http.Header)
  28103. }
  28104. return c.header_
  28105. }
  28106. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  28107. reqHeaders := make(http.Header)
  28108. for k, v := range c.header_ {
  28109. reqHeaders[k] = v
  28110. }
  28111. reqHeaders.Set("User-Agent", c.s.userAgent())
  28112. var body io.Reader = nil
  28113. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  28114. if err != nil {
  28115. return nil, err
  28116. }
  28117. reqHeaders.Set("Content-Type", "application/json")
  28118. c.urlParams_.Set("alt", alt)
  28119. c.urlParams_.Set("prettyPrint", "false")
  28120. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  28121. urls += "?" + c.urlParams_.Encode()
  28122. req, err := http.NewRequest("PATCH", urls, body)
  28123. if err != nil {
  28124. return nil, err
  28125. }
  28126. req.Header = reqHeaders
  28127. googleapi.Expand(req.URL, map[string]string{
  28128. "profileId": strconv.FormatInt(c.profileId, 10),
  28129. })
  28130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28131. }
  28132. // Do executes the "dfareporting.eventTags.patch" call.
  28133. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  28134. // code is an error. Response headers are in either
  28135. // *EventTag.ServerResponse.Header or (if a response was returned at
  28136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28137. // to check whether the returned error was because
  28138. // http.StatusNotModified was returned.
  28139. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  28140. gensupport.SetOptions(c.urlParams_, opts...)
  28141. res, err := c.doRequest("json")
  28142. if res != nil && res.StatusCode == http.StatusNotModified {
  28143. if res.Body != nil {
  28144. res.Body.Close()
  28145. }
  28146. return nil, &googleapi.Error{
  28147. Code: res.StatusCode,
  28148. Header: res.Header,
  28149. }
  28150. }
  28151. if err != nil {
  28152. return nil, err
  28153. }
  28154. defer googleapi.CloseBody(res)
  28155. if err := googleapi.CheckResponse(res); err != nil {
  28156. return nil, err
  28157. }
  28158. ret := &EventTag{
  28159. ServerResponse: googleapi.ServerResponse{
  28160. Header: res.Header,
  28161. HTTPStatusCode: res.StatusCode,
  28162. },
  28163. }
  28164. target := &ret
  28165. if err := gensupport.DecodeResponse(target, res); err != nil {
  28166. return nil, err
  28167. }
  28168. return ret, nil
  28169. // {
  28170. // "description": "Updates an existing event tag. This method supports patch semantics.",
  28171. // "httpMethod": "PATCH",
  28172. // "id": "dfareporting.eventTags.patch",
  28173. // "parameterOrder": [
  28174. // "profileId",
  28175. // "id"
  28176. // ],
  28177. // "parameters": {
  28178. // "id": {
  28179. // "description": "Event tag ID.",
  28180. // "format": "int64",
  28181. // "location": "query",
  28182. // "required": true,
  28183. // "type": "string"
  28184. // },
  28185. // "profileId": {
  28186. // "description": "User profile ID associated with this request.",
  28187. // "format": "int64",
  28188. // "location": "path",
  28189. // "required": true,
  28190. // "type": "string"
  28191. // }
  28192. // },
  28193. // "path": "userprofiles/{profileId}/eventTags",
  28194. // "request": {
  28195. // "$ref": "EventTag"
  28196. // },
  28197. // "response": {
  28198. // "$ref": "EventTag"
  28199. // },
  28200. // "scopes": [
  28201. // "https://www.googleapis.com/auth/dfatrafficking"
  28202. // ]
  28203. // }
  28204. }
  28205. // method id "dfareporting.eventTags.update":
  28206. type EventTagsUpdateCall struct {
  28207. s *Service
  28208. profileId int64
  28209. eventtag *EventTag
  28210. urlParams_ gensupport.URLParams
  28211. ctx_ context.Context
  28212. header_ http.Header
  28213. }
  28214. // Update: Updates an existing event tag.
  28215. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  28216. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28217. c.profileId = profileId
  28218. c.eventtag = eventtag
  28219. return c
  28220. }
  28221. // Fields allows partial responses to be retrieved. See
  28222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28223. // for more information.
  28224. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  28225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28226. return c
  28227. }
  28228. // Context sets the context to be used in this call's Do method. Any
  28229. // pending HTTP request will be aborted if the provided context is
  28230. // canceled.
  28231. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  28232. c.ctx_ = ctx
  28233. return c
  28234. }
  28235. // Header returns an http.Header that can be modified by the caller to
  28236. // add HTTP headers to the request.
  28237. func (c *EventTagsUpdateCall) Header() http.Header {
  28238. if c.header_ == nil {
  28239. c.header_ = make(http.Header)
  28240. }
  28241. return c.header_
  28242. }
  28243. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  28244. reqHeaders := make(http.Header)
  28245. for k, v := range c.header_ {
  28246. reqHeaders[k] = v
  28247. }
  28248. reqHeaders.Set("User-Agent", c.s.userAgent())
  28249. var body io.Reader = nil
  28250. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  28251. if err != nil {
  28252. return nil, err
  28253. }
  28254. reqHeaders.Set("Content-Type", "application/json")
  28255. c.urlParams_.Set("alt", alt)
  28256. c.urlParams_.Set("prettyPrint", "false")
  28257. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  28258. urls += "?" + c.urlParams_.Encode()
  28259. req, err := http.NewRequest("PUT", urls, body)
  28260. if err != nil {
  28261. return nil, err
  28262. }
  28263. req.Header = reqHeaders
  28264. googleapi.Expand(req.URL, map[string]string{
  28265. "profileId": strconv.FormatInt(c.profileId, 10),
  28266. })
  28267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28268. }
  28269. // Do executes the "dfareporting.eventTags.update" call.
  28270. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  28271. // code is an error. Response headers are in either
  28272. // *EventTag.ServerResponse.Header or (if a response was returned at
  28273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28274. // to check whether the returned error was because
  28275. // http.StatusNotModified was returned.
  28276. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  28277. gensupport.SetOptions(c.urlParams_, opts...)
  28278. res, err := c.doRequest("json")
  28279. if res != nil && res.StatusCode == http.StatusNotModified {
  28280. if res.Body != nil {
  28281. res.Body.Close()
  28282. }
  28283. return nil, &googleapi.Error{
  28284. Code: res.StatusCode,
  28285. Header: res.Header,
  28286. }
  28287. }
  28288. if err != nil {
  28289. return nil, err
  28290. }
  28291. defer googleapi.CloseBody(res)
  28292. if err := googleapi.CheckResponse(res); err != nil {
  28293. return nil, err
  28294. }
  28295. ret := &EventTag{
  28296. ServerResponse: googleapi.ServerResponse{
  28297. Header: res.Header,
  28298. HTTPStatusCode: res.StatusCode,
  28299. },
  28300. }
  28301. target := &ret
  28302. if err := gensupport.DecodeResponse(target, res); err != nil {
  28303. return nil, err
  28304. }
  28305. return ret, nil
  28306. // {
  28307. // "description": "Updates an existing event tag.",
  28308. // "httpMethod": "PUT",
  28309. // "id": "dfareporting.eventTags.update",
  28310. // "parameterOrder": [
  28311. // "profileId"
  28312. // ],
  28313. // "parameters": {
  28314. // "profileId": {
  28315. // "description": "User profile ID associated with this request.",
  28316. // "format": "int64",
  28317. // "location": "path",
  28318. // "required": true,
  28319. // "type": "string"
  28320. // }
  28321. // },
  28322. // "path": "userprofiles/{profileId}/eventTags",
  28323. // "request": {
  28324. // "$ref": "EventTag"
  28325. // },
  28326. // "response": {
  28327. // "$ref": "EventTag"
  28328. // },
  28329. // "scopes": [
  28330. // "https://www.googleapis.com/auth/dfatrafficking"
  28331. // ]
  28332. // }
  28333. }
  28334. // method id "dfareporting.files.get":
  28335. type FilesGetCall struct {
  28336. s *Service
  28337. reportId int64
  28338. fileId int64
  28339. urlParams_ gensupport.URLParams
  28340. ifNoneMatch_ string
  28341. ctx_ context.Context
  28342. header_ http.Header
  28343. }
  28344. // Get: Retrieves a report file by its report ID and file ID. This
  28345. // method supports media download.
  28346. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  28347. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28348. c.reportId = reportId
  28349. c.fileId = fileId
  28350. return c
  28351. }
  28352. // Fields allows partial responses to be retrieved. See
  28353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28354. // for more information.
  28355. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  28356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28357. return c
  28358. }
  28359. // IfNoneMatch sets the optional parameter which makes the operation
  28360. // fail if the object's ETag matches the given value. This is useful for
  28361. // getting updates only after the object has changed since the last
  28362. // request. Use googleapi.IsNotModified to check whether the response
  28363. // error from Do is the result of In-None-Match.
  28364. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  28365. c.ifNoneMatch_ = entityTag
  28366. return c
  28367. }
  28368. // Context sets the context to be used in this call's Do and Download
  28369. // methods. Any pending HTTP request will be aborted if the provided
  28370. // context is canceled.
  28371. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  28372. c.ctx_ = ctx
  28373. return c
  28374. }
  28375. // Header returns an http.Header that can be modified by the caller to
  28376. // add HTTP headers to the request.
  28377. func (c *FilesGetCall) Header() http.Header {
  28378. if c.header_ == nil {
  28379. c.header_ = make(http.Header)
  28380. }
  28381. return c.header_
  28382. }
  28383. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  28384. reqHeaders := make(http.Header)
  28385. for k, v := range c.header_ {
  28386. reqHeaders[k] = v
  28387. }
  28388. reqHeaders.Set("User-Agent", c.s.userAgent())
  28389. if c.ifNoneMatch_ != "" {
  28390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28391. }
  28392. var body io.Reader = nil
  28393. c.urlParams_.Set("alt", alt)
  28394. c.urlParams_.Set("prettyPrint", "false")
  28395. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  28396. urls += "?" + c.urlParams_.Encode()
  28397. req, err := http.NewRequest("GET", urls, body)
  28398. if err != nil {
  28399. return nil, err
  28400. }
  28401. req.Header = reqHeaders
  28402. googleapi.Expand(req.URL, map[string]string{
  28403. "reportId": strconv.FormatInt(c.reportId, 10),
  28404. "fileId": strconv.FormatInt(c.fileId, 10),
  28405. })
  28406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28407. }
  28408. // Download fetches the API endpoint's "media" value, instead of the normal
  28409. // API response value. If the returned error is nil, the Response is guaranteed to
  28410. // have a 2xx status code. Callers must close the Response.Body as usual.
  28411. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  28412. gensupport.SetOptions(c.urlParams_, opts...)
  28413. res, err := c.doRequest("media")
  28414. if err != nil {
  28415. return nil, err
  28416. }
  28417. if err := googleapi.CheckMediaResponse(res); err != nil {
  28418. res.Body.Close()
  28419. return nil, err
  28420. }
  28421. return res, nil
  28422. }
  28423. // Do executes the "dfareporting.files.get" call.
  28424. // Exactly one of *File or error will be non-nil. Any non-2xx status
  28425. // code is an error. Response headers are in either
  28426. // *File.ServerResponse.Header or (if a response was returned at all) in
  28427. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28428. // whether the returned error was because http.StatusNotModified was
  28429. // returned.
  28430. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  28431. gensupport.SetOptions(c.urlParams_, opts...)
  28432. res, err := c.doRequest("json")
  28433. if res != nil && res.StatusCode == http.StatusNotModified {
  28434. if res.Body != nil {
  28435. res.Body.Close()
  28436. }
  28437. return nil, &googleapi.Error{
  28438. Code: res.StatusCode,
  28439. Header: res.Header,
  28440. }
  28441. }
  28442. if err != nil {
  28443. return nil, err
  28444. }
  28445. defer googleapi.CloseBody(res)
  28446. if err := googleapi.CheckResponse(res); err != nil {
  28447. return nil, err
  28448. }
  28449. ret := &File{
  28450. ServerResponse: googleapi.ServerResponse{
  28451. Header: res.Header,
  28452. HTTPStatusCode: res.StatusCode,
  28453. },
  28454. }
  28455. target := &ret
  28456. if err := gensupport.DecodeResponse(target, res); err != nil {
  28457. return nil, err
  28458. }
  28459. return ret, nil
  28460. // {
  28461. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  28462. // "httpMethod": "GET",
  28463. // "id": "dfareporting.files.get",
  28464. // "parameterOrder": [
  28465. // "reportId",
  28466. // "fileId"
  28467. // ],
  28468. // "parameters": {
  28469. // "fileId": {
  28470. // "description": "The ID of the report file.",
  28471. // "format": "int64",
  28472. // "location": "path",
  28473. // "required": true,
  28474. // "type": "string"
  28475. // },
  28476. // "reportId": {
  28477. // "description": "The ID of the report.",
  28478. // "format": "int64",
  28479. // "location": "path",
  28480. // "required": true,
  28481. // "type": "string"
  28482. // }
  28483. // },
  28484. // "path": "reports/{reportId}/files/{fileId}",
  28485. // "response": {
  28486. // "$ref": "File"
  28487. // },
  28488. // "scopes": [
  28489. // "https://www.googleapis.com/auth/dfareporting"
  28490. // ],
  28491. // "supportsMediaDownload": true
  28492. // }
  28493. }
  28494. // method id "dfareporting.files.list":
  28495. type FilesListCall struct {
  28496. s *Service
  28497. profileId int64
  28498. urlParams_ gensupport.URLParams
  28499. ifNoneMatch_ string
  28500. ctx_ context.Context
  28501. header_ http.Header
  28502. }
  28503. // List: Lists files for a user profile.
  28504. func (r *FilesService) List(profileId int64) *FilesListCall {
  28505. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28506. c.profileId = profileId
  28507. return c
  28508. }
  28509. // MaxResults sets the optional parameter "maxResults": Maximum number
  28510. // of results to return.
  28511. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  28512. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28513. return c
  28514. }
  28515. // PageToken sets the optional parameter "pageToken": The value of the
  28516. // nextToken from the previous result page.
  28517. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  28518. c.urlParams_.Set("pageToken", pageToken)
  28519. return c
  28520. }
  28521. // Scope sets the optional parameter "scope": The scope that defines
  28522. // which results are returned.
  28523. //
  28524. // Possible values:
  28525. // "ALL" - All files in account.
  28526. // "MINE" (default) - My files.
  28527. // "SHARED_WITH_ME" - Files shared with me.
  28528. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  28529. c.urlParams_.Set("scope", scope)
  28530. return c
  28531. }
  28532. // SortField sets the optional parameter "sortField": The field by which
  28533. // to sort the list.
  28534. //
  28535. // Possible values:
  28536. // "ID" - Sort by file ID.
  28537. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  28538. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  28539. c.urlParams_.Set("sortField", sortField)
  28540. return c
  28541. }
  28542. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28543. // results.
  28544. //
  28545. // Possible values:
  28546. // "ASCENDING" - Ascending order.
  28547. // "DESCENDING" (default) - Descending order.
  28548. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  28549. c.urlParams_.Set("sortOrder", sortOrder)
  28550. return c
  28551. }
  28552. // Fields allows partial responses to be retrieved. See
  28553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28554. // for more information.
  28555. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  28556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28557. return c
  28558. }
  28559. // IfNoneMatch sets the optional parameter which makes the operation
  28560. // fail if the object's ETag matches the given value. This is useful for
  28561. // getting updates only after the object has changed since the last
  28562. // request. Use googleapi.IsNotModified to check whether the response
  28563. // error from Do is the result of In-None-Match.
  28564. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  28565. c.ifNoneMatch_ = entityTag
  28566. return c
  28567. }
  28568. // Context sets the context to be used in this call's Do method. Any
  28569. // pending HTTP request will be aborted if the provided context is
  28570. // canceled.
  28571. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  28572. c.ctx_ = ctx
  28573. return c
  28574. }
  28575. // Header returns an http.Header that can be modified by the caller to
  28576. // add HTTP headers to the request.
  28577. func (c *FilesListCall) Header() http.Header {
  28578. if c.header_ == nil {
  28579. c.header_ = make(http.Header)
  28580. }
  28581. return c.header_
  28582. }
  28583. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  28584. reqHeaders := make(http.Header)
  28585. for k, v := range c.header_ {
  28586. reqHeaders[k] = v
  28587. }
  28588. reqHeaders.Set("User-Agent", c.s.userAgent())
  28589. if c.ifNoneMatch_ != "" {
  28590. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28591. }
  28592. var body io.Reader = nil
  28593. c.urlParams_.Set("alt", alt)
  28594. c.urlParams_.Set("prettyPrint", "false")
  28595. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  28596. urls += "?" + c.urlParams_.Encode()
  28597. req, err := http.NewRequest("GET", urls, body)
  28598. if err != nil {
  28599. return nil, err
  28600. }
  28601. req.Header = reqHeaders
  28602. googleapi.Expand(req.URL, map[string]string{
  28603. "profileId": strconv.FormatInt(c.profileId, 10),
  28604. })
  28605. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28606. }
  28607. // Do executes the "dfareporting.files.list" call.
  28608. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  28609. // code is an error. Response headers are in either
  28610. // *FileList.ServerResponse.Header or (if a response was returned at
  28611. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28612. // to check whether the returned error was because
  28613. // http.StatusNotModified was returned.
  28614. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  28615. gensupport.SetOptions(c.urlParams_, opts...)
  28616. res, err := c.doRequest("json")
  28617. if res != nil && res.StatusCode == http.StatusNotModified {
  28618. if res.Body != nil {
  28619. res.Body.Close()
  28620. }
  28621. return nil, &googleapi.Error{
  28622. Code: res.StatusCode,
  28623. Header: res.Header,
  28624. }
  28625. }
  28626. if err != nil {
  28627. return nil, err
  28628. }
  28629. defer googleapi.CloseBody(res)
  28630. if err := googleapi.CheckResponse(res); err != nil {
  28631. return nil, err
  28632. }
  28633. ret := &FileList{
  28634. ServerResponse: googleapi.ServerResponse{
  28635. Header: res.Header,
  28636. HTTPStatusCode: res.StatusCode,
  28637. },
  28638. }
  28639. target := &ret
  28640. if err := gensupport.DecodeResponse(target, res); err != nil {
  28641. return nil, err
  28642. }
  28643. return ret, nil
  28644. // {
  28645. // "description": "Lists files for a user profile.",
  28646. // "httpMethod": "GET",
  28647. // "id": "dfareporting.files.list",
  28648. // "parameterOrder": [
  28649. // "profileId"
  28650. // ],
  28651. // "parameters": {
  28652. // "maxResults": {
  28653. // "default": "10",
  28654. // "description": "Maximum number of results to return.",
  28655. // "format": "int32",
  28656. // "location": "query",
  28657. // "maximum": "10",
  28658. // "minimum": "0",
  28659. // "type": "integer"
  28660. // },
  28661. // "pageToken": {
  28662. // "description": "The value of the nextToken from the previous result page.",
  28663. // "location": "query",
  28664. // "type": "string"
  28665. // },
  28666. // "profileId": {
  28667. // "description": "The DFA profile ID.",
  28668. // "format": "int64",
  28669. // "location": "path",
  28670. // "required": true,
  28671. // "type": "string"
  28672. // },
  28673. // "scope": {
  28674. // "default": "MINE",
  28675. // "description": "The scope that defines which results are returned.",
  28676. // "enum": [
  28677. // "ALL",
  28678. // "MINE",
  28679. // "SHARED_WITH_ME"
  28680. // ],
  28681. // "enumDescriptions": [
  28682. // "All files in account.",
  28683. // "My files.",
  28684. // "Files shared with me."
  28685. // ],
  28686. // "location": "query",
  28687. // "type": "string"
  28688. // },
  28689. // "sortField": {
  28690. // "default": "LAST_MODIFIED_TIME",
  28691. // "description": "The field by which to sort the list.",
  28692. // "enum": [
  28693. // "ID",
  28694. // "LAST_MODIFIED_TIME"
  28695. // ],
  28696. // "enumDescriptions": [
  28697. // "Sort by file ID.",
  28698. // "Sort by 'lastmodifiedAt' field."
  28699. // ],
  28700. // "location": "query",
  28701. // "type": "string"
  28702. // },
  28703. // "sortOrder": {
  28704. // "default": "DESCENDING",
  28705. // "description": "Order of sorted results.",
  28706. // "enum": [
  28707. // "ASCENDING",
  28708. // "DESCENDING"
  28709. // ],
  28710. // "enumDescriptions": [
  28711. // "Ascending order.",
  28712. // "Descending order."
  28713. // ],
  28714. // "location": "query",
  28715. // "type": "string"
  28716. // }
  28717. // },
  28718. // "path": "userprofiles/{profileId}/files",
  28719. // "response": {
  28720. // "$ref": "FileList"
  28721. // },
  28722. // "scopes": [
  28723. // "https://www.googleapis.com/auth/dfareporting"
  28724. // ]
  28725. // }
  28726. }
  28727. // Pages invokes f for each page of results.
  28728. // A non-nil error returned from f will halt the iteration.
  28729. // The provided context supersedes any context provided to the Context method.
  28730. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  28731. c.ctx_ = ctx
  28732. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28733. for {
  28734. x, err := c.Do()
  28735. if err != nil {
  28736. return err
  28737. }
  28738. if err := f(x); err != nil {
  28739. return err
  28740. }
  28741. if x.NextPageToken == "" {
  28742. return nil
  28743. }
  28744. c.PageToken(x.NextPageToken)
  28745. }
  28746. }
  28747. // method id "dfareporting.floodlightActivities.delete":
  28748. type FloodlightActivitiesDeleteCall struct {
  28749. s *Service
  28750. profileId int64
  28751. id int64
  28752. urlParams_ gensupport.URLParams
  28753. ctx_ context.Context
  28754. header_ http.Header
  28755. }
  28756. // Delete: Deletes an existing floodlight activity.
  28757. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  28758. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28759. c.profileId = profileId
  28760. c.id = id
  28761. return c
  28762. }
  28763. // Fields allows partial responses to be retrieved. See
  28764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28765. // for more information.
  28766. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  28767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28768. return c
  28769. }
  28770. // Context sets the context to be used in this call's Do method. Any
  28771. // pending HTTP request will be aborted if the provided context is
  28772. // canceled.
  28773. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  28774. c.ctx_ = ctx
  28775. return c
  28776. }
  28777. // Header returns an http.Header that can be modified by the caller to
  28778. // add HTTP headers to the request.
  28779. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  28780. if c.header_ == nil {
  28781. c.header_ = make(http.Header)
  28782. }
  28783. return c.header_
  28784. }
  28785. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28786. reqHeaders := make(http.Header)
  28787. for k, v := range c.header_ {
  28788. reqHeaders[k] = v
  28789. }
  28790. reqHeaders.Set("User-Agent", c.s.userAgent())
  28791. var body io.Reader = nil
  28792. c.urlParams_.Set("alt", alt)
  28793. c.urlParams_.Set("prettyPrint", "false")
  28794. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28795. urls += "?" + c.urlParams_.Encode()
  28796. req, err := http.NewRequest("DELETE", urls, body)
  28797. if err != nil {
  28798. return nil, err
  28799. }
  28800. req.Header = reqHeaders
  28801. googleapi.Expand(req.URL, map[string]string{
  28802. "profileId": strconv.FormatInt(c.profileId, 10),
  28803. "id": strconv.FormatInt(c.id, 10),
  28804. })
  28805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28806. }
  28807. // Do executes the "dfareporting.floodlightActivities.delete" call.
  28808. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  28809. gensupport.SetOptions(c.urlParams_, opts...)
  28810. res, err := c.doRequest("json")
  28811. if err != nil {
  28812. return err
  28813. }
  28814. defer googleapi.CloseBody(res)
  28815. if err := googleapi.CheckResponse(res); err != nil {
  28816. return err
  28817. }
  28818. return nil
  28819. // {
  28820. // "description": "Deletes an existing floodlight activity.",
  28821. // "httpMethod": "DELETE",
  28822. // "id": "dfareporting.floodlightActivities.delete",
  28823. // "parameterOrder": [
  28824. // "profileId",
  28825. // "id"
  28826. // ],
  28827. // "parameters": {
  28828. // "id": {
  28829. // "description": "Floodlight activity ID.",
  28830. // "format": "int64",
  28831. // "location": "path",
  28832. // "required": true,
  28833. // "type": "string"
  28834. // },
  28835. // "profileId": {
  28836. // "description": "User profile ID associated with this request.",
  28837. // "format": "int64",
  28838. // "location": "path",
  28839. // "required": true,
  28840. // "type": "string"
  28841. // }
  28842. // },
  28843. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28844. // "scopes": [
  28845. // "https://www.googleapis.com/auth/dfatrafficking"
  28846. // ]
  28847. // }
  28848. }
  28849. // method id "dfareporting.floodlightActivities.generatetag":
  28850. type FloodlightActivitiesGeneratetagCall struct {
  28851. s *Service
  28852. profileId int64
  28853. urlParams_ gensupport.URLParams
  28854. ctx_ context.Context
  28855. header_ http.Header
  28856. }
  28857. // Generatetag: Generates a tag for a floodlight activity.
  28858. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  28859. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28860. c.profileId = profileId
  28861. return c
  28862. }
  28863. // FloodlightActivityId sets the optional parameter
  28864. // "floodlightActivityId": Floodlight activity ID for which we want to
  28865. // generate a tag.
  28866. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  28867. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  28868. return c
  28869. }
  28870. // Fields allows partial responses to be retrieved. See
  28871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28872. // for more information.
  28873. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  28874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28875. return c
  28876. }
  28877. // Context sets the context to be used in this call's Do method. Any
  28878. // pending HTTP request will be aborted if the provided context is
  28879. // canceled.
  28880. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  28881. c.ctx_ = ctx
  28882. return c
  28883. }
  28884. // Header returns an http.Header that can be modified by the caller to
  28885. // add HTTP headers to the request.
  28886. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  28887. if c.header_ == nil {
  28888. c.header_ = make(http.Header)
  28889. }
  28890. return c.header_
  28891. }
  28892. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  28893. reqHeaders := make(http.Header)
  28894. for k, v := range c.header_ {
  28895. reqHeaders[k] = v
  28896. }
  28897. reqHeaders.Set("User-Agent", c.s.userAgent())
  28898. var body io.Reader = nil
  28899. c.urlParams_.Set("alt", alt)
  28900. c.urlParams_.Set("prettyPrint", "false")
  28901. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  28902. urls += "?" + c.urlParams_.Encode()
  28903. req, err := http.NewRequest("POST", urls, body)
  28904. if err != nil {
  28905. return nil, err
  28906. }
  28907. req.Header = reqHeaders
  28908. googleapi.Expand(req.URL, map[string]string{
  28909. "profileId": strconv.FormatInt(c.profileId, 10),
  28910. })
  28911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28912. }
  28913. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  28914. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  28915. // be non-nil. Any non-2xx status code is an error. Response headers are
  28916. // in either
  28917. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  28918. // a response was returned at all) in error.(*googleapi.Error).Header.
  28919. // Use googleapi.IsNotModified to check whether the returned error was
  28920. // because http.StatusNotModified was returned.
  28921. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  28922. gensupport.SetOptions(c.urlParams_, opts...)
  28923. res, err := c.doRequest("json")
  28924. if res != nil && res.StatusCode == http.StatusNotModified {
  28925. if res.Body != nil {
  28926. res.Body.Close()
  28927. }
  28928. return nil, &googleapi.Error{
  28929. Code: res.StatusCode,
  28930. Header: res.Header,
  28931. }
  28932. }
  28933. if err != nil {
  28934. return nil, err
  28935. }
  28936. defer googleapi.CloseBody(res)
  28937. if err := googleapi.CheckResponse(res); err != nil {
  28938. return nil, err
  28939. }
  28940. ret := &FloodlightActivitiesGenerateTagResponse{
  28941. ServerResponse: googleapi.ServerResponse{
  28942. Header: res.Header,
  28943. HTTPStatusCode: res.StatusCode,
  28944. },
  28945. }
  28946. target := &ret
  28947. if err := gensupport.DecodeResponse(target, res); err != nil {
  28948. return nil, err
  28949. }
  28950. return ret, nil
  28951. // {
  28952. // "description": "Generates a tag for a floodlight activity.",
  28953. // "httpMethod": "POST",
  28954. // "id": "dfareporting.floodlightActivities.generatetag",
  28955. // "parameterOrder": [
  28956. // "profileId"
  28957. // ],
  28958. // "parameters": {
  28959. // "floodlightActivityId": {
  28960. // "description": "Floodlight activity ID for which we want to generate a tag.",
  28961. // "format": "int64",
  28962. // "location": "query",
  28963. // "type": "string"
  28964. // },
  28965. // "profileId": {
  28966. // "description": "User profile ID associated with this request.",
  28967. // "format": "int64",
  28968. // "location": "path",
  28969. // "required": true,
  28970. // "type": "string"
  28971. // }
  28972. // },
  28973. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  28974. // "response": {
  28975. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  28976. // },
  28977. // "scopes": [
  28978. // "https://www.googleapis.com/auth/dfatrafficking"
  28979. // ]
  28980. // }
  28981. }
  28982. // method id "dfareporting.floodlightActivities.get":
  28983. type FloodlightActivitiesGetCall struct {
  28984. s *Service
  28985. profileId int64
  28986. id int64
  28987. urlParams_ gensupport.URLParams
  28988. ifNoneMatch_ string
  28989. ctx_ context.Context
  28990. header_ http.Header
  28991. }
  28992. // Get: Gets one floodlight activity by ID.
  28993. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  28994. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28995. c.profileId = profileId
  28996. c.id = id
  28997. return c
  28998. }
  28999. // Fields allows partial responses to be retrieved. See
  29000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29001. // for more information.
  29002. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  29003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29004. return c
  29005. }
  29006. // IfNoneMatch sets the optional parameter which makes the operation
  29007. // fail if the object's ETag matches the given value. This is useful for
  29008. // getting updates only after the object has changed since the last
  29009. // request. Use googleapi.IsNotModified to check whether the response
  29010. // error from Do is the result of In-None-Match.
  29011. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  29012. c.ifNoneMatch_ = entityTag
  29013. return c
  29014. }
  29015. // Context sets the context to be used in this call's Do method. Any
  29016. // pending HTTP request will be aborted if the provided context is
  29017. // canceled.
  29018. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  29019. c.ctx_ = ctx
  29020. return c
  29021. }
  29022. // Header returns an http.Header that can be modified by the caller to
  29023. // add HTTP headers to the request.
  29024. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  29025. if c.header_ == nil {
  29026. c.header_ = make(http.Header)
  29027. }
  29028. return c.header_
  29029. }
  29030. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  29031. reqHeaders := make(http.Header)
  29032. for k, v := range c.header_ {
  29033. reqHeaders[k] = v
  29034. }
  29035. reqHeaders.Set("User-Agent", c.s.userAgent())
  29036. if c.ifNoneMatch_ != "" {
  29037. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29038. }
  29039. var body io.Reader = nil
  29040. c.urlParams_.Set("alt", alt)
  29041. c.urlParams_.Set("prettyPrint", "false")
  29042. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  29043. urls += "?" + c.urlParams_.Encode()
  29044. req, err := http.NewRequest("GET", urls, body)
  29045. if err != nil {
  29046. return nil, err
  29047. }
  29048. req.Header = reqHeaders
  29049. googleapi.Expand(req.URL, map[string]string{
  29050. "profileId": strconv.FormatInt(c.profileId, 10),
  29051. "id": strconv.FormatInt(c.id, 10),
  29052. })
  29053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29054. }
  29055. // Do executes the "dfareporting.floodlightActivities.get" call.
  29056. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29057. // non-2xx status code is an error. Response headers are in either
  29058. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29059. // returned at all) in error.(*googleapi.Error).Header. Use
  29060. // googleapi.IsNotModified to check whether the returned error was
  29061. // because http.StatusNotModified was returned.
  29062. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29063. gensupport.SetOptions(c.urlParams_, opts...)
  29064. res, err := c.doRequest("json")
  29065. if res != nil && res.StatusCode == http.StatusNotModified {
  29066. if res.Body != nil {
  29067. res.Body.Close()
  29068. }
  29069. return nil, &googleapi.Error{
  29070. Code: res.StatusCode,
  29071. Header: res.Header,
  29072. }
  29073. }
  29074. if err != nil {
  29075. return nil, err
  29076. }
  29077. defer googleapi.CloseBody(res)
  29078. if err := googleapi.CheckResponse(res); err != nil {
  29079. return nil, err
  29080. }
  29081. ret := &FloodlightActivity{
  29082. ServerResponse: googleapi.ServerResponse{
  29083. Header: res.Header,
  29084. HTTPStatusCode: res.StatusCode,
  29085. },
  29086. }
  29087. target := &ret
  29088. if err := gensupport.DecodeResponse(target, res); err != nil {
  29089. return nil, err
  29090. }
  29091. return ret, nil
  29092. // {
  29093. // "description": "Gets one floodlight activity by ID.",
  29094. // "httpMethod": "GET",
  29095. // "id": "dfareporting.floodlightActivities.get",
  29096. // "parameterOrder": [
  29097. // "profileId",
  29098. // "id"
  29099. // ],
  29100. // "parameters": {
  29101. // "id": {
  29102. // "description": "Floodlight activity ID.",
  29103. // "format": "int64",
  29104. // "location": "path",
  29105. // "required": true,
  29106. // "type": "string"
  29107. // },
  29108. // "profileId": {
  29109. // "description": "User profile ID associated with this request.",
  29110. // "format": "int64",
  29111. // "location": "path",
  29112. // "required": true,
  29113. // "type": "string"
  29114. // }
  29115. // },
  29116. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  29117. // "response": {
  29118. // "$ref": "FloodlightActivity"
  29119. // },
  29120. // "scopes": [
  29121. // "https://www.googleapis.com/auth/dfatrafficking"
  29122. // ]
  29123. // }
  29124. }
  29125. // method id "dfareporting.floodlightActivities.insert":
  29126. type FloodlightActivitiesInsertCall struct {
  29127. s *Service
  29128. profileId int64
  29129. floodlightactivity *FloodlightActivity
  29130. urlParams_ gensupport.URLParams
  29131. ctx_ context.Context
  29132. header_ http.Header
  29133. }
  29134. // Insert: Inserts a new floodlight activity.
  29135. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  29136. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29137. c.profileId = profileId
  29138. c.floodlightactivity = floodlightactivity
  29139. return c
  29140. }
  29141. // Fields allows partial responses to be retrieved. See
  29142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29143. // for more information.
  29144. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  29145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29146. return c
  29147. }
  29148. // Context sets the context to be used in this call's Do method. Any
  29149. // pending HTTP request will be aborted if the provided context is
  29150. // canceled.
  29151. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  29152. c.ctx_ = ctx
  29153. return c
  29154. }
  29155. // Header returns an http.Header that can be modified by the caller to
  29156. // add HTTP headers to the request.
  29157. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  29158. if c.header_ == nil {
  29159. c.header_ = make(http.Header)
  29160. }
  29161. return c.header_
  29162. }
  29163. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  29164. reqHeaders := make(http.Header)
  29165. for k, v := range c.header_ {
  29166. reqHeaders[k] = v
  29167. }
  29168. reqHeaders.Set("User-Agent", c.s.userAgent())
  29169. var body io.Reader = nil
  29170. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29171. if err != nil {
  29172. return nil, err
  29173. }
  29174. reqHeaders.Set("Content-Type", "application/json")
  29175. c.urlParams_.Set("alt", alt)
  29176. c.urlParams_.Set("prettyPrint", "false")
  29177. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29178. urls += "?" + c.urlParams_.Encode()
  29179. req, err := http.NewRequest("POST", urls, body)
  29180. if err != nil {
  29181. return nil, err
  29182. }
  29183. req.Header = reqHeaders
  29184. googleapi.Expand(req.URL, map[string]string{
  29185. "profileId": strconv.FormatInt(c.profileId, 10),
  29186. })
  29187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29188. }
  29189. // Do executes the "dfareporting.floodlightActivities.insert" call.
  29190. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29191. // non-2xx status code is an error. Response headers are in either
  29192. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29193. // returned at all) in error.(*googleapi.Error).Header. Use
  29194. // googleapi.IsNotModified to check whether the returned error was
  29195. // because http.StatusNotModified was returned.
  29196. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29197. gensupport.SetOptions(c.urlParams_, opts...)
  29198. res, err := c.doRequest("json")
  29199. if res != nil && res.StatusCode == http.StatusNotModified {
  29200. if res.Body != nil {
  29201. res.Body.Close()
  29202. }
  29203. return nil, &googleapi.Error{
  29204. Code: res.StatusCode,
  29205. Header: res.Header,
  29206. }
  29207. }
  29208. if err != nil {
  29209. return nil, err
  29210. }
  29211. defer googleapi.CloseBody(res)
  29212. if err := googleapi.CheckResponse(res); err != nil {
  29213. return nil, err
  29214. }
  29215. ret := &FloodlightActivity{
  29216. ServerResponse: googleapi.ServerResponse{
  29217. Header: res.Header,
  29218. HTTPStatusCode: res.StatusCode,
  29219. },
  29220. }
  29221. target := &ret
  29222. if err := gensupport.DecodeResponse(target, res); err != nil {
  29223. return nil, err
  29224. }
  29225. return ret, nil
  29226. // {
  29227. // "description": "Inserts a new floodlight activity.",
  29228. // "httpMethod": "POST",
  29229. // "id": "dfareporting.floodlightActivities.insert",
  29230. // "parameterOrder": [
  29231. // "profileId"
  29232. // ],
  29233. // "parameters": {
  29234. // "profileId": {
  29235. // "description": "User profile ID associated with this request.",
  29236. // "format": "int64",
  29237. // "location": "path",
  29238. // "required": true,
  29239. // "type": "string"
  29240. // }
  29241. // },
  29242. // "path": "userprofiles/{profileId}/floodlightActivities",
  29243. // "request": {
  29244. // "$ref": "FloodlightActivity"
  29245. // },
  29246. // "response": {
  29247. // "$ref": "FloodlightActivity"
  29248. // },
  29249. // "scopes": [
  29250. // "https://www.googleapis.com/auth/dfatrafficking"
  29251. // ]
  29252. // }
  29253. }
  29254. // method id "dfareporting.floodlightActivities.list":
  29255. type FloodlightActivitiesListCall struct {
  29256. s *Service
  29257. profileId int64
  29258. urlParams_ gensupport.URLParams
  29259. ifNoneMatch_ string
  29260. ctx_ context.Context
  29261. header_ http.Header
  29262. }
  29263. // List: Retrieves a list of floodlight activities, possibly filtered.
  29264. // This method supports paging.
  29265. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  29266. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29267. c.profileId = profileId
  29268. return c
  29269. }
  29270. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29271. // floodlight activities for the specified advertiser ID. Must specify
  29272. // either ids, advertiserId, or floodlightConfigurationId for a
  29273. // non-empty result.
  29274. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  29275. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29276. return c
  29277. }
  29278. // FloodlightActivityGroupIds sets the optional parameter
  29279. // "floodlightActivityGroupIds": Select only floodlight activities with
  29280. // the specified floodlight activity group IDs.
  29281. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  29282. var floodlightActivityGroupIds_ []string
  29283. for _, v := range floodlightActivityGroupIds {
  29284. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  29285. }
  29286. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  29287. return c
  29288. }
  29289. // FloodlightActivityGroupName sets the optional parameter
  29290. // "floodlightActivityGroupName": Select only floodlight activities with
  29291. // the specified floodlight activity group name.
  29292. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  29293. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  29294. return c
  29295. }
  29296. // FloodlightActivityGroupTagString sets the optional parameter
  29297. // "floodlightActivityGroupTagString": Select only floodlight activities
  29298. // with the specified floodlight activity group tag string.
  29299. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  29300. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  29301. return c
  29302. }
  29303. // FloodlightActivityGroupType sets the optional parameter
  29304. // "floodlightActivityGroupType": Select only floodlight activities with
  29305. // the specified floodlight activity group type.
  29306. //
  29307. // Possible values:
  29308. // "COUNTER"
  29309. // "SALE"
  29310. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  29311. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  29312. return c
  29313. }
  29314. // FloodlightConfigurationId sets the optional parameter
  29315. // "floodlightConfigurationId": Select only floodlight activities for
  29316. // the specified floodlight configuration ID. Must specify either ids,
  29317. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29318. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  29319. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29320. return c
  29321. }
  29322. // Ids sets the optional parameter "ids": Select only floodlight
  29323. // activities with the specified IDs. Must specify either ids,
  29324. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29325. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  29326. var ids_ []string
  29327. for _, v := range ids {
  29328. ids_ = append(ids_, fmt.Sprint(v))
  29329. }
  29330. c.urlParams_.SetMulti("ids", ids_)
  29331. return c
  29332. }
  29333. // MaxResults sets the optional parameter "maxResults": Maximum number
  29334. // of results to return.
  29335. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  29336. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29337. return c
  29338. }
  29339. // PageToken sets the optional parameter "pageToken": Value of the
  29340. // nextPageToken from the previous result page.
  29341. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  29342. c.urlParams_.Set("pageToken", pageToken)
  29343. return c
  29344. }
  29345. // SearchString sets the optional parameter "searchString": Allows
  29346. // searching for objects by name or ID. Wildcards (*) are allowed. For
  29347. // example, "floodlightactivity*2015" will return objects with names
  29348. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  29349. // or simply "floodlightactivity 2015". Most of the searches also add
  29350. // wildcards implicitly at the start and the end of the search string.
  29351. // For example, a search string of "floodlightactivity" will match
  29352. // objects with name "my floodlightactivity activity",
  29353. // "floodlightactivity 2015", or simply "floodlightactivity".
  29354. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  29355. c.urlParams_.Set("searchString", searchString)
  29356. return c
  29357. }
  29358. // SortField sets the optional parameter "sortField": Field by which to
  29359. // sort the list.
  29360. //
  29361. // Possible values:
  29362. // "ID" (default)
  29363. // "NAME"
  29364. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  29365. c.urlParams_.Set("sortField", sortField)
  29366. return c
  29367. }
  29368. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29369. // results.
  29370. //
  29371. // Possible values:
  29372. // "ASCENDING" (default)
  29373. // "DESCENDING"
  29374. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  29375. c.urlParams_.Set("sortOrder", sortOrder)
  29376. return c
  29377. }
  29378. // TagString sets the optional parameter "tagString": Select only
  29379. // floodlight activities with the specified tag string.
  29380. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  29381. c.urlParams_.Set("tagString", tagString)
  29382. return c
  29383. }
  29384. // Fields allows partial responses to be retrieved. See
  29385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29386. // for more information.
  29387. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  29388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29389. return c
  29390. }
  29391. // IfNoneMatch sets the optional parameter which makes the operation
  29392. // fail if the object's ETag matches the given value. This is useful for
  29393. // getting updates only after the object has changed since the last
  29394. // request. Use googleapi.IsNotModified to check whether the response
  29395. // error from Do is the result of In-None-Match.
  29396. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  29397. c.ifNoneMatch_ = entityTag
  29398. return c
  29399. }
  29400. // Context sets the context to be used in this call's Do method. Any
  29401. // pending HTTP request will be aborted if the provided context is
  29402. // canceled.
  29403. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  29404. c.ctx_ = ctx
  29405. return c
  29406. }
  29407. // Header returns an http.Header that can be modified by the caller to
  29408. // add HTTP headers to the request.
  29409. func (c *FloodlightActivitiesListCall) Header() http.Header {
  29410. if c.header_ == nil {
  29411. c.header_ = make(http.Header)
  29412. }
  29413. return c.header_
  29414. }
  29415. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  29416. reqHeaders := make(http.Header)
  29417. for k, v := range c.header_ {
  29418. reqHeaders[k] = v
  29419. }
  29420. reqHeaders.Set("User-Agent", c.s.userAgent())
  29421. if c.ifNoneMatch_ != "" {
  29422. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29423. }
  29424. var body io.Reader = nil
  29425. c.urlParams_.Set("alt", alt)
  29426. c.urlParams_.Set("prettyPrint", "false")
  29427. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29428. urls += "?" + c.urlParams_.Encode()
  29429. req, err := http.NewRequest("GET", urls, body)
  29430. if err != nil {
  29431. return nil, err
  29432. }
  29433. req.Header = reqHeaders
  29434. googleapi.Expand(req.URL, map[string]string{
  29435. "profileId": strconv.FormatInt(c.profileId, 10),
  29436. })
  29437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29438. }
  29439. // Do executes the "dfareporting.floodlightActivities.list" call.
  29440. // Exactly one of *FloodlightActivitiesListResponse or error will be
  29441. // non-nil. Any non-2xx status code is an error. Response headers are in
  29442. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  29443. // a response was returned at all) in error.(*googleapi.Error).Header.
  29444. // Use googleapi.IsNotModified to check whether the returned error was
  29445. // because http.StatusNotModified was returned.
  29446. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  29447. gensupport.SetOptions(c.urlParams_, opts...)
  29448. res, err := c.doRequest("json")
  29449. if res != nil && res.StatusCode == http.StatusNotModified {
  29450. if res.Body != nil {
  29451. res.Body.Close()
  29452. }
  29453. return nil, &googleapi.Error{
  29454. Code: res.StatusCode,
  29455. Header: res.Header,
  29456. }
  29457. }
  29458. if err != nil {
  29459. return nil, err
  29460. }
  29461. defer googleapi.CloseBody(res)
  29462. if err := googleapi.CheckResponse(res); err != nil {
  29463. return nil, err
  29464. }
  29465. ret := &FloodlightActivitiesListResponse{
  29466. ServerResponse: googleapi.ServerResponse{
  29467. Header: res.Header,
  29468. HTTPStatusCode: res.StatusCode,
  29469. },
  29470. }
  29471. target := &ret
  29472. if err := gensupport.DecodeResponse(target, res); err != nil {
  29473. return nil, err
  29474. }
  29475. return ret, nil
  29476. // {
  29477. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  29478. // "httpMethod": "GET",
  29479. // "id": "dfareporting.floodlightActivities.list",
  29480. // "parameterOrder": [
  29481. // "profileId"
  29482. // ],
  29483. // "parameters": {
  29484. // "advertiserId": {
  29485. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29486. // "format": "int64",
  29487. // "location": "query",
  29488. // "type": "string"
  29489. // },
  29490. // "floodlightActivityGroupIds": {
  29491. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  29492. // "format": "int64",
  29493. // "location": "query",
  29494. // "repeated": true,
  29495. // "type": "string"
  29496. // },
  29497. // "floodlightActivityGroupName": {
  29498. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  29499. // "location": "query",
  29500. // "type": "string"
  29501. // },
  29502. // "floodlightActivityGroupTagString": {
  29503. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  29504. // "location": "query",
  29505. // "type": "string"
  29506. // },
  29507. // "floodlightActivityGroupType": {
  29508. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  29509. // "enum": [
  29510. // "COUNTER",
  29511. // "SALE"
  29512. // ],
  29513. // "enumDescriptions": [
  29514. // "",
  29515. // ""
  29516. // ],
  29517. // "location": "query",
  29518. // "type": "string"
  29519. // },
  29520. // "floodlightConfigurationId": {
  29521. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29522. // "format": "int64",
  29523. // "location": "query",
  29524. // "type": "string"
  29525. // },
  29526. // "ids": {
  29527. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29528. // "format": "int64",
  29529. // "location": "query",
  29530. // "repeated": true,
  29531. // "type": "string"
  29532. // },
  29533. // "maxResults": {
  29534. // "default": "1000",
  29535. // "description": "Maximum number of results to return.",
  29536. // "format": "int32",
  29537. // "location": "query",
  29538. // "maximum": "1000",
  29539. // "minimum": "0",
  29540. // "type": "integer"
  29541. // },
  29542. // "pageToken": {
  29543. // "description": "Value of the nextPageToken from the previous result page.",
  29544. // "location": "query",
  29545. // "type": "string"
  29546. // },
  29547. // "profileId": {
  29548. // "description": "User profile ID associated with this request.",
  29549. // "format": "int64",
  29550. // "location": "path",
  29551. // "required": true,
  29552. // "type": "string"
  29553. // },
  29554. // "searchString": {
  29555. // "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\".",
  29556. // "location": "query",
  29557. // "type": "string"
  29558. // },
  29559. // "sortField": {
  29560. // "default": "ID",
  29561. // "description": "Field by which to sort the list.",
  29562. // "enum": [
  29563. // "ID",
  29564. // "NAME"
  29565. // ],
  29566. // "enumDescriptions": [
  29567. // "",
  29568. // ""
  29569. // ],
  29570. // "location": "query",
  29571. // "type": "string"
  29572. // },
  29573. // "sortOrder": {
  29574. // "default": "ASCENDING",
  29575. // "description": "Order of sorted results.",
  29576. // "enum": [
  29577. // "ASCENDING",
  29578. // "DESCENDING"
  29579. // ],
  29580. // "enumDescriptions": [
  29581. // "",
  29582. // ""
  29583. // ],
  29584. // "location": "query",
  29585. // "type": "string"
  29586. // },
  29587. // "tagString": {
  29588. // "description": "Select only floodlight activities with the specified tag string.",
  29589. // "location": "query",
  29590. // "type": "string"
  29591. // }
  29592. // },
  29593. // "path": "userprofiles/{profileId}/floodlightActivities",
  29594. // "response": {
  29595. // "$ref": "FloodlightActivitiesListResponse"
  29596. // },
  29597. // "scopes": [
  29598. // "https://www.googleapis.com/auth/dfatrafficking"
  29599. // ]
  29600. // }
  29601. }
  29602. // Pages invokes f for each page of results.
  29603. // A non-nil error returned from f will halt the iteration.
  29604. // The provided context supersedes any context provided to the Context method.
  29605. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  29606. c.ctx_ = ctx
  29607. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29608. for {
  29609. x, err := c.Do()
  29610. if err != nil {
  29611. return err
  29612. }
  29613. if err := f(x); err != nil {
  29614. return err
  29615. }
  29616. if x.NextPageToken == "" {
  29617. return nil
  29618. }
  29619. c.PageToken(x.NextPageToken)
  29620. }
  29621. }
  29622. // method id "dfareporting.floodlightActivities.patch":
  29623. type FloodlightActivitiesPatchCall struct {
  29624. s *Service
  29625. profileId int64
  29626. floodlightactivity *FloodlightActivity
  29627. urlParams_ gensupport.URLParams
  29628. ctx_ context.Context
  29629. header_ http.Header
  29630. }
  29631. // Patch: Updates an existing floodlight activity. This method supports
  29632. // patch semantics.
  29633. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  29634. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29635. c.profileId = profileId
  29636. c.urlParams_.Set("id", fmt.Sprint(id))
  29637. c.floodlightactivity = floodlightactivity
  29638. return c
  29639. }
  29640. // Fields allows partial responses to be retrieved. See
  29641. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29642. // for more information.
  29643. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  29644. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29645. return c
  29646. }
  29647. // Context sets the context to be used in this call's Do method. Any
  29648. // pending HTTP request will be aborted if the provided context is
  29649. // canceled.
  29650. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  29651. c.ctx_ = ctx
  29652. return c
  29653. }
  29654. // Header returns an http.Header that can be modified by the caller to
  29655. // add HTTP headers to the request.
  29656. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  29657. if c.header_ == nil {
  29658. c.header_ = make(http.Header)
  29659. }
  29660. return c.header_
  29661. }
  29662. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  29663. reqHeaders := make(http.Header)
  29664. for k, v := range c.header_ {
  29665. reqHeaders[k] = v
  29666. }
  29667. reqHeaders.Set("User-Agent", c.s.userAgent())
  29668. var body io.Reader = nil
  29669. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29670. if err != nil {
  29671. return nil, err
  29672. }
  29673. reqHeaders.Set("Content-Type", "application/json")
  29674. c.urlParams_.Set("alt", alt)
  29675. c.urlParams_.Set("prettyPrint", "false")
  29676. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29677. urls += "?" + c.urlParams_.Encode()
  29678. req, err := http.NewRequest("PATCH", urls, body)
  29679. if err != nil {
  29680. return nil, err
  29681. }
  29682. req.Header = reqHeaders
  29683. googleapi.Expand(req.URL, map[string]string{
  29684. "profileId": strconv.FormatInt(c.profileId, 10),
  29685. })
  29686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29687. }
  29688. // Do executes the "dfareporting.floodlightActivities.patch" call.
  29689. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29690. // non-2xx status code is an error. Response headers are in either
  29691. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29692. // returned at all) in error.(*googleapi.Error).Header. Use
  29693. // googleapi.IsNotModified to check whether the returned error was
  29694. // because http.StatusNotModified was returned.
  29695. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29696. gensupport.SetOptions(c.urlParams_, opts...)
  29697. res, err := c.doRequest("json")
  29698. if res != nil && res.StatusCode == http.StatusNotModified {
  29699. if res.Body != nil {
  29700. res.Body.Close()
  29701. }
  29702. return nil, &googleapi.Error{
  29703. Code: res.StatusCode,
  29704. Header: res.Header,
  29705. }
  29706. }
  29707. if err != nil {
  29708. return nil, err
  29709. }
  29710. defer googleapi.CloseBody(res)
  29711. if err := googleapi.CheckResponse(res); err != nil {
  29712. return nil, err
  29713. }
  29714. ret := &FloodlightActivity{
  29715. ServerResponse: googleapi.ServerResponse{
  29716. Header: res.Header,
  29717. HTTPStatusCode: res.StatusCode,
  29718. },
  29719. }
  29720. target := &ret
  29721. if err := gensupport.DecodeResponse(target, res); err != nil {
  29722. return nil, err
  29723. }
  29724. return ret, nil
  29725. // {
  29726. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  29727. // "httpMethod": "PATCH",
  29728. // "id": "dfareporting.floodlightActivities.patch",
  29729. // "parameterOrder": [
  29730. // "profileId",
  29731. // "id"
  29732. // ],
  29733. // "parameters": {
  29734. // "id": {
  29735. // "description": "Floodlight activity ID.",
  29736. // "format": "int64",
  29737. // "location": "query",
  29738. // "required": true,
  29739. // "type": "string"
  29740. // },
  29741. // "profileId": {
  29742. // "description": "User profile ID associated with this request.",
  29743. // "format": "int64",
  29744. // "location": "path",
  29745. // "required": true,
  29746. // "type": "string"
  29747. // }
  29748. // },
  29749. // "path": "userprofiles/{profileId}/floodlightActivities",
  29750. // "request": {
  29751. // "$ref": "FloodlightActivity"
  29752. // },
  29753. // "response": {
  29754. // "$ref": "FloodlightActivity"
  29755. // },
  29756. // "scopes": [
  29757. // "https://www.googleapis.com/auth/dfatrafficking"
  29758. // ]
  29759. // }
  29760. }
  29761. // method id "dfareporting.floodlightActivities.update":
  29762. type FloodlightActivitiesUpdateCall struct {
  29763. s *Service
  29764. profileId int64
  29765. floodlightactivity *FloodlightActivity
  29766. urlParams_ gensupport.URLParams
  29767. ctx_ context.Context
  29768. header_ http.Header
  29769. }
  29770. // Update: Updates an existing floodlight activity.
  29771. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  29772. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29773. c.profileId = profileId
  29774. c.floodlightactivity = floodlightactivity
  29775. return c
  29776. }
  29777. // Fields allows partial responses to be retrieved. See
  29778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29779. // for more information.
  29780. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  29781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29782. return c
  29783. }
  29784. // Context sets the context to be used in this call's Do method. Any
  29785. // pending HTTP request will be aborted if the provided context is
  29786. // canceled.
  29787. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  29788. c.ctx_ = ctx
  29789. return c
  29790. }
  29791. // Header returns an http.Header that can be modified by the caller to
  29792. // add HTTP headers to the request.
  29793. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  29794. if c.header_ == nil {
  29795. c.header_ = make(http.Header)
  29796. }
  29797. return c.header_
  29798. }
  29799. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  29800. reqHeaders := make(http.Header)
  29801. for k, v := range c.header_ {
  29802. reqHeaders[k] = v
  29803. }
  29804. reqHeaders.Set("User-Agent", c.s.userAgent())
  29805. var body io.Reader = nil
  29806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29807. if err != nil {
  29808. return nil, err
  29809. }
  29810. reqHeaders.Set("Content-Type", "application/json")
  29811. c.urlParams_.Set("alt", alt)
  29812. c.urlParams_.Set("prettyPrint", "false")
  29813. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29814. urls += "?" + c.urlParams_.Encode()
  29815. req, err := http.NewRequest("PUT", urls, body)
  29816. if err != nil {
  29817. return nil, err
  29818. }
  29819. req.Header = reqHeaders
  29820. googleapi.Expand(req.URL, map[string]string{
  29821. "profileId": strconv.FormatInt(c.profileId, 10),
  29822. })
  29823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29824. }
  29825. // Do executes the "dfareporting.floodlightActivities.update" call.
  29826. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29827. // non-2xx status code is an error. Response headers are in either
  29828. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29829. // returned at all) in error.(*googleapi.Error).Header. Use
  29830. // googleapi.IsNotModified to check whether the returned error was
  29831. // because http.StatusNotModified was returned.
  29832. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29833. gensupport.SetOptions(c.urlParams_, opts...)
  29834. res, err := c.doRequest("json")
  29835. if res != nil && res.StatusCode == http.StatusNotModified {
  29836. if res.Body != nil {
  29837. res.Body.Close()
  29838. }
  29839. return nil, &googleapi.Error{
  29840. Code: res.StatusCode,
  29841. Header: res.Header,
  29842. }
  29843. }
  29844. if err != nil {
  29845. return nil, err
  29846. }
  29847. defer googleapi.CloseBody(res)
  29848. if err := googleapi.CheckResponse(res); err != nil {
  29849. return nil, err
  29850. }
  29851. ret := &FloodlightActivity{
  29852. ServerResponse: googleapi.ServerResponse{
  29853. Header: res.Header,
  29854. HTTPStatusCode: res.StatusCode,
  29855. },
  29856. }
  29857. target := &ret
  29858. if err := gensupport.DecodeResponse(target, res); err != nil {
  29859. return nil, err
  29860. }
  29861. return ret, nil
  29862. // {
  29863. // "description": "Updates an existing floodlight activity.",
  29864. // "httpMethod": "PUT",
  29865. // "id": "dfareporting.floodlightActivities.update",
  29866. // "parameterOrder": [
  29867. // "profileId"
  29868. // ],
  29869. // "parameters": {
  29870. // "profileId": {
  29871. // "description": "User profile ID associated with this request.",
  29872. // "format": "int64",
  29873. // "location": "path",
  29874. // "required": true,
  29875. // "type": "string"
  29876. // }
  29877. // },
  29878. // "path": "userprofiles/{profileId}/floodlightActivities",
  29879. // "request": {
  29880. // "$ref": "FloodlightActivity"
  29881. // },
  29882. // "response": {
  29883. // "$ref": "FloodlightActivity"
  29884. // },
  29885. // "scopes": [
  29886. // "https://www.googleapis.com/auth/dfatrafficking"
  29887. // ]
  29888. // }
  29889. }
  29890. // method id "dfareporting.floodlightActivityGroups.get":
  29891. type FloodlightActivityGroupsGetCall struct {
  29892. s *Service
  29893. profileId int64
  29894. id int64
  29895. urlParams_ gensupport.URLParams
  29896. ifNoneMatch_ string
  29897. ctx_ context.Context
  29898. header_ http.Header
  29899. }
  29900. // Get: Gets one floodlight activity group by ID.
  29901. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  29902. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29903. c.profileId = profileId
  29904. c.id = id
  29905. return c
  29906. }
  29907. // Fields allows partial responses to be retrieved. See
  29908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29909. // for more information.
  29910. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  29911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29912. return c
  29913. }
  29914. // IfNoneMatch sets the optional parameter which makes the operation
  29915. // fail if the object's ETag matches the given value. This is useful for
  29916. // getting updates only after the object has changed since the last
  29917. // request. Use googleapi.IsNotModified to check whether the response
  29918. // error from Do is the result of In-None-Match.
  29919. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  29920. c.ifNoneMatch_ = entityTag
  29921. return c
  29922. }
  29923. // Context sets the context to be used in this call's Do method. Any
  29924. // pending HTTP request will be aborted if the provided context is
  29925. // canceled.
  29926. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  29927. c.ctx_ = ctx
  29928. return c
  29929. }
  29930. // Header returns an http.Header that can be modified by the caller to
  29931. // add HTTP headers to the request.
  29932. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  29933. if c.header_ == nil {
  29934. c.header_ = make(http.Header)
  29935. }
  29936. return c.header_
  29937. }
  29938. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  29939. reqHeaders := make(http.Header)
  29940. for k, v := range c.header_ {
  29941. reqHeaders[k] = v
  29942. }
  29943. reqHeaders.Set("User-Agent", c.s.userAgent())
  29944. if c.ifNoneMatch_ != "" {
  29945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29946. }
  29947. var body io.Reader = nil
  29948. c.urlParams_.Set("alt", alt)
  29949. c.urlParams_.Set("prettyPrint", "false")
  29950. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  29951. urls += "?" + c.urlParams_.Encode()
  29952. req, err := http.NewRequest("GET", urls, body)
  29953. if err != nil {
  29954. return nil, err
  29955. }
  29956. req.Header = reqHeaders
  29957. googleapi.Expand(req.URL, map[string]string{
  29958. "profileId": strconv.FormatInt(c.profileId, 10),
  29959. "id": strconv.FormatInt(c.id, 10),
  29960. })
  29961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29962. }
  29963. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  29964. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29965. // non-2xx status code is an error. Response headers are in either
  29966. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29967. // returned at all) in error.(*googleapi.Error).Header. Use
  29968. // googleapi.IsNotModified to check whether the returned error was
  29969. // because http.StatusNotModified was returned.
  29970. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29971. gensupport.SetOptions(c.urlParams_, opts...)
  29972. res, err := c.doRequest("json")
  29973. if res != nil && res.StatusCode == http.StatusNotModified {
  29974. if res.Body != nil {
  29975. res.Body.Close()
  29976. }
  29977. return nil, &googleapi.Error{
  29978. Code: res.StatusCode,
  29979. Header: res.Header,
  29980. }
  29981. }
  29982. if err != nil {
  29983. return nil, err
  29984. }
  29985. defer googleapi.CloseBody(res)
  29986. if err := googleapi.CheckResponse(res); err != nil {
  29987. return nil, err
  29988. }
  29989. ret := &FloodlightActivityGroup{
  29990. ServerResponse: googleapi.ServerResponse{
  29991. Header: res.Header,
  29992. HTTPStatusCode: res.StatusCode,
  29993. },
  29994. }
  29995. target := &ret
  29996. if err := gensupport.DecodeResponse(target, res); err != nil {
  29997. return nil, err
  29998. }
  29999. return ret, nil
  30000. // {
  30001. // "description": "Gets one floodlight activity group by ID.",
  30002. // "httpMethod": "GET",
  30003. // "id": "dfareporting.floodlightActivityGroups.get",
  30004. // "parameterOrder": [
  30005. // "profileId",
  30006. // "id"
  30007. // ],
  30008. // "parameters": {
  30009. // "id": {
  30010. // "description": "Floodlight activity Group ID.",
  30011. // "format": "int64",
  30012. // "location": "path",
  30013. // "required": true,
  30014. // "type": "string"
  30015. // },
  30016. // "profileId": {
  30017. // "description": "User profile ID associated with this request.",
  30018. // "format": "int64",
  30019. // "location": "path",
  30020. // "required": true,
  30021. // "type": "string"
  30022. // }
  30023. // },
  30024. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  30025. // "response": {
  30026. // "$ref": "FloodlightActivityGroup"
  30027. // },
  30028. // "scopes": [
  30029. // "https://www.googleapis.com/auth/dfatrafficking"
  30030. // ]
  30031. // }
  30032. }
  30033. // method id "dfareporting.floodlightActivityGroups.insert":
  30034. type FloodlightActivityGroupsInsertCall struct {
  30035. s *Service
  30036. profileId int64
  30037. floodlightactivitygroup *FloodlightActivityGroup
  30038. urlParams_ gensupport.URLParams
  30039. ctx_ context.Context
  30040. header_ http.Header
  30041. }
  30042. // Insert: Inserts a new floodlight activity group.
  30043. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  30044. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30045. c.profileId = profileId
  30046. c.floodlightactivitygroup = floodlightactivitygroup
  30047. return c
  30048. }
  30049. // Fields allows partial responses to be retrieved. See
  30050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30051. // for more information.
  30052. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  30053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30054. return c
  30055. }
  30056. // Context sets the context to be used in this call's Do method. Any
  30057. // pending HTTP request will be aborted if the provided context is
  30058. // canceled.
  30059. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  30060. c.ctx_ = ctx
  30061. return c
  30062. }
  30063. // Header returns an http.Header that can be modified by the caller to
  30064. // add HTTP headers to the request.
  30065. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  30066. if c.header_ == nil {
  30067. c.header_ = make(http.Header)
  30068. }
  30069. return c.header_
  30070. }
  30071. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  30072. reqHeaders := make(http.Header)
  30073. for k, v := range c.header_ {
  30074. reqHeaders[k] = v
  30075. }
  30076. reqHeaders.Set("User-Agent", c.s.userAgent())
  30077. var body io.Reader = nil
  30078. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30079. if err != nil {
  30080. return nil, err
  30081. }
  30082. reqHeaders.Set("Content-Type", "application/json")
  30083. c.urlParams_.Set("alt", alt)
  30084. c.urlParams_.Set("prettyPrint", "false")
  30085. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30086. urls += "?" + c.urlParams_.Encode()
  30087. req, err := http.NewRequest("POST", urls, body)
  30088. if err != nil {
  30089. return nil, err
  30090. }
  30091. req.Header = reqHeaders
  30092. googleapi.Expand(req.URL, map[string]string{
  30093. "profileId": strconv.FormatInt(c.profileId, 10),
  30094. })
  30095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30096. }
  30097. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  30098. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30099. // non-2xx status code is an error. Response headers are in either
  30100. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30101. // returned at all) in error.(*googleapi.Error).Header. Use
  30102. // googleapi.IsNotModified to check whether the returned error was
  30103. // because http.StatusNotModified was returned.
  30104. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30105. gensupport.SetOptions(c.urlParams_, opts...)
  30106. res, err := c.doRequest("json")
  30107. if res != nil && res.StatusCode == http.StatusNotModified {
  30108. if res.Body != nil {
  30109. res.Body.Close()
  30110. }
  30111. return nil, &googleapi.Error{
  30112. Code: res.StatusCode,
  30113. Header: res.Header,
  30114. }
  30115. }
  30116. if err != nil {
  30117. return nil, err
  30118. }
  30119. defer googleapi.CloseBody(res)
  30120. if err := googleapi.CheckResponse(res); err != nil {
  30121. return nil, err
  30122. }
  30123. ret := &FloodlightActivityGroup{
  30124. ServerResponse: googleapi.ServerResponse{
  30125. Header: res.Header,
  30126. HTTPStatusCode: res.StatusCode,
  30127. },
  30128. }
  30129. target := &ret
  30130. if err := gensupport.DecodeResponse(target, res); err != nil {
  30131. return nil, err
  30132. }
  30133. return ret, nil
  30134. // {
  30135. // "description": "Inserts a new floodlight activity group.",
  30136. // "httpMethod": "POST",
  30137. // "id": "dfareporting.floodlightActivityGroups.insert",
  30138. // "parameterOrder": [
  30139. // "profileId"
  30140. // ],
  30141. // "parameters": {
  30142. // "profileId": {
  30143. // "description": "User profile ID associated with this request.",
  30144. // "format": "int64",
  30145. // "location": "path",
  30146. // "required": true,
  30147. // "type": "string"
  30148. // }
  30149. // },
  30150. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30151. // "request": {
  30152. // "$ref": "FloodlightActivityGroup"
  30153. // },
  30154. // "response": {
  30155. // "$ref": "FloodlightActivityGroup"
  30156. // },
  30157. // "scopes": [
  30158. // "https://www.googleapis.com/auth/dfatrafficking"
  30159. // ]
  30160. // }
  30161. }
  30162. // method id "dfareporting.floodlightActivityGroups.list":
  30163. type FloodlightActivityGroupsListCall struct {
  30164. s *Service
  30165. profileId int64
  30166. urlParams_ gensupport.URLParams
  30167. ifNoneMatch_ string
  30168. ctx_ context.Context
  30169. header_ http.Header
  30170. }
  30171. // List: Retrieves a list of floodlight activity groups, possibly
  30172. // filtered. This method supports paging.
  30173. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  30174. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30175. c.profileId = profileId
  30176. return c
  30177. }
  30178. // AdvertiserId sets the optional parameter "advertiserId": Select only
  30179. // floodlight activity groups with the specified advertiser ID. Must
  30180. // specify either advertiserId or floodlightConfigurationId for a
  30181. // non-empty result.
  30182. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  30183. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  30184. return c
  30185. }
  30186. // FloodlightConfigurationId sets the optional parameter
  30187. // "floodlightConfigurationId": Select only floodlight activity groups
  30188. // with the specified floodlight configuration ID. Must specify either
  30189. // advertiserId, or floodlightConfigurationId for a non-empty result.
  30190. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  30191. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  30192. return c
  30193. }
  30194. // Ids sets the optional parameter "ids": Select only floodlight
  30195. // activity groups with the specified IDs. Must specify either
  30196. // advertiserId or floodlightConfigurationId for a non-empty result.
  30197. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  30198. var ids_ []string
  30199. for _, v := range ids {
  30200. ids_ = append(ids_, fmt.Sprint(v))
  30201. }
  30202. c.urlParams_.SetMulti("ids", ids_)
  30203. return c
  30204. }
  30205. // MaxResults sets the optional parameter "maxResults": Maximum number
  30206. // of results to return.
  30207. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  30208. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30209. return c
  30210. }
  30211. // PageToken sets the optional parameter "pageToken": Value of the
  30212. // nextPageToken from the previous result page.
  30213. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  30214. c.urlParams_.Set("pageToken", pageToken)
  30215. return c
  30216. }
  30217. // SearchString sets the optional parameter "searchString": Allows
  30218. // searching for objects by name or ID. Wildcards (*) are allowed. For
  30219. // example, "floodlightactivitygroup*2015" will return objects with
  30220. // names like "floodlightactivitygroup June 2015",
  30221. // "floodlightactivitygroup April 2015", or simply
  30222. // "floodlightactivitygroup 2015". Most of the searches also add
  30223. // wildcards implicitly at the start and the end of the search string.
  30224. // For example, a search string of "floodlightactivitygroup" will match
  30225. // objects with name "my floodlightactivitygroup activity",
  30226. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  30227. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  30228. c.urlParams_.Set("searchString", searchString)
  30229. return c
  30230. }
  30231. // SortField sets the optional parameter "sortField": Field by which to
  30232. // sort the list.
  30233. //
  30234. // Possible values:
  30235. // "ID" (default)
  30236. // "NAME"
  30237. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  30238. c.urlParams_.Set("sortField", sortField)
  30239. return c
  30240. }
  30241. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  30242. // results.
  30243. //
  30244. // Possible values:
  30245. // "ASCENDING" (default)
  30246. // "DESCENDING"
  30247. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  30248. c.urlParams_.Set("sortOrder", sortOrder)
  30249. return c
  30250. }
  30251. // Type sets the optional parameter "type": Select only floodlight
  30252. // activity groups with the specified floodlight activity group type.
  30253. //
  30254. // Possible values:
  30255. // "COUNTER"
  30256. // "SALE"
  30257. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  30258. c.urlParams_.Set("type", type_)
  30259. return c
  30260. }
  30261. // Fields allows partial responses to be retrieved. See
  30262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30263. // for more information.
  30264. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  30265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30266. return c
  30267. }
  30268. // IfNoneMatch sets the optional parameter which makes the operation
  30269. // fail if the object's ETag matches the given value. This is useful for
  30270. // getting updates only after the object has changed since the last
  30271. // request. Use googleapi.IsNotModified to check whether the response
  30272. // error from Do is the result of In-None-Match.
  30273. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  30274. c.ifNoneMatch_ = entityTag
  30275. return c
  30276. }
  30277. // Context sets the context to be used in this call's Do method. Any
  30278. // pending HTTP request will be aborted if the provided context is
  30279. // canceled.
  30280. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  30281. c.ctx_ = ctx
  30282. return c
  30283. }
  30284. // Header returns an http.Header that can be modified by the caller to
  30285. // add HTTP headers to the request.
  30286. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  30287. if c.header_ == nil {
  30288. c.header_ = make(http.Header)
  30289. }
  30290. return c.header_
  30291. }
  30292. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  30293. reqHeaders := make(http.Header)
  30294. for k, v := range c.header_ {
  30295. reqHeaders[k] = v
  30296. }
  30297. reqHeaders.Set("User-Agent", c.s.userAgent())
  30298. if c.ifNoneMatch_ != "" {
  30299. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30300. }
  30301. var body io.Reader = nil
  30302. c.urlParams_.Set("alt", alt)
  30303. c.urlParams_.Set("prettyPrint", "false")
  30304. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30305. urls += "?" + c.urlParams_.Encode()
  30306. req, err := http.NewRequest("GET", urls, body)
  30307. if err != nil {
  30308. return nil, err
  30309. }
  30310. req.Header = reqHeaders
  30311. googleapi.Expand(req.URL, map[string]string{
  30312. "profileId": strconv.FormatInt(c.profileId, 10),
  30313. })
  30314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30315. }
  30316. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  30317. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  30318. // non-nil. Any non-2xx status code is an error. Response headers are in
  30319. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  30320. // (if a response was returned at all) in
  30321. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30322. // whether the returned error was because http.StatusNotModified was
  30323. // returned.
  30324. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  30325. gensupport.SetOptions(c.urlParams_, opts...)
  30326. res, err := c.doRequest("json")
  30327. if res != nil && res.StatusCode == http.StatusNotModified {
  30328. if res.Body != nil {
  30329. res.Body.Close()
  30330. }
  30331. return nil, &googleapi.Error{
  30332. Code: res.StatusCode,
  30333. Header: res.Header,
  30334. }
  30335. }
  30336. if err != nil {
  30337. return nil, err
  30338. }
  30339. defer googleapi.CloseBody(res)
  30340. if err := googleapi.CheckResponse(res); err != nil {
  30341. return nil, err
  30342. }
  30343. ret := &FloodlightActivityGroupsListResponse{
  30344. ServerResponse: googleapi.ServerResponse{
  30345. Header: res.Header,
  30346. HTTPStatusCode: res.StatusCode,
  30347. },
  30348. }
  30349. target := &ret
  30350. if err := gensupport.DecodeResponse(target, res); err != nil {
  30351. return nil, err
  30352. }
  30353. return ret, nil
  30354. // {
  30355. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  30356. // "httpMethod": "GET",
  30357. // "id": "dfareporting.floodlightActivityGroups.list",
  30358. // "parameterOrder": [
  30359. // "profileId"
  30360. // ],
  30361. // "parameters": {
  30362. // "advertiserId": {
  30363. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  30364. // "format": "int64",
  30365. // "location": "query",
  30366. // "type": "string"
  30367. // },
  30368. // "floodlightConfigurationId": {
  30369. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  30370. // "format": "int64",
  30371. // "location": "query",
  30372. // "type": "string"
  30373. // },
  30374. // "ids": {
  30375. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  30376. // "format": "int64",
  30377. // "location": "query",
  30378. // "repeated": true,
  30379. // "type": "string"
  30380. // },
  30381. // "maxResults": {
  30382. // "default": "1000",
  30383. // "description": "Maximum number of results to return.",
  30384. // "format": "int32",
  30385. // "location": "query",
  30386. // "maximum": "1000",
  30387. // "minimum": "0",
  30388. // "type": "integer"
  30389. // },
  30390. // "pageToken": {
  30391. // "description": "Value of the nextPageToken from the previous result page.",
  30392. // "location": "query",
  30393. // "type": "string"
  30394. // },
  30395. // "profileId": {
  30396. // "description": "User profile ID associated with this request.",
  30397. // "format": "int64",
  30398. // "location": "path",
  30399. // "required": true,
  30400. // "type": "string"
  30401. // },
  30402. // "searchString": {
  30403. // "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\".",
  30404. // "location": "query",
  30405. // "type": "string"
  30406. // },
  30407. // "sortField": {
  30408. // "default": "ID",
  30409. // "description": "Field by which to sort the list.",
  30410. // "enum": [
  30411. // "ID",
  30412. // "NAME"
  30413. // ],
  30414. // "enumDescriptions": [
  30415. // "",
  30416. // ""
  30417. // ],
  30418. // "location": "query",
  30419. // "type": "string"
  30420. // },
  30421. // "sortOrder": {
  30422. // "default": "ASCENDING",
  30423. // "description": "Order of sorted results.",
  30424. // "enum": [
  30425. // "ASCENDING",
  30426. // "DESCENDING"
  30427. // ],
  30428. // "enumDescriptions": [
  30429. // "",
  30430. // ""
  30431. // ],
  30432. // "location": "query",
  30433. // "type": "string"
  30434. // },
  30435. // "type": {
  30436. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  30437. // "enum": [
  30438. // "COUNTER",
  30439. // "SALE"
  30440. // ],
  30441. // "enumDescriptions": [
  30442. // "",
  30443. // ""
  30444. // ],
  30445. // "location": "query",
  30446. // "type": "string"
  30447. // }
  30448. // },
  30449. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30450. // "response": {
  30451. // "$ref": "FloodlightActivityGroupsListResponse"
  30452. // },
  30453. // "scopes": [
  30454. // "https://www.googleapis.com/auth/dfatrafficking"
  30455. // ]
  30456. // }
  30457. }
  30458. // Pages invokes f for each page of results.
  30459. // A non-nil error returned from f will halt the iteration.
  30460. // The provided context supersedes any context provided to the Context method.
  30461. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  30462. c.ctx_ = ctx
  30463. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30464. for {
  30465. x, err := c.Do()
  30466. if err != nil {
  30467. return err
  30468. }
  30469. if err := f(x); err != nil {
  30470. return err
  30471. }
  30472. if x.NextPageToken == "" {
  30473. return nil
  30474. }
  30475. c.PageToken(x.NextPageToken)
  30476. }
  30477. }
  30478. // method id "dfareporting.floodlightActivityGroups.patch":
  30479. type FloodlightActivityGroupsPatchCall struct {
  30480. s *Service
  30481. profileId int64
  30482. floodlightactivitygroup *FloodlightActivityGroup
  30483. urlParams_ gensupport.URLParams
  30484. ctx_ context.Context
  30485. header_ http.Header
  30486. }
  30487. // Patch: Updates an existing floodlight activity group. This method
  30488. // supports patch semantics.
  30489. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  30490. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30491. c.profileId = profileId
  30492. c.urlParams_.Set("id", fmt.Sprint(id))
  30493. c.floodlightactivitygroup = floodlightactivitygroup
  30494. return c
  30495. }
  30496. // Fields allows partial responses to be retrieved. See
  30497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30498. // for more information.
  30499. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  30500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30501. return c
  30502. }
  30503. // Context sets the context to be used in this call's Do method. Any
  30504. // pending HTTP request will be aborted if the provided context is
  30505. // canceled.
  30506. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  30507. c.ctx_ = ctx
  30508. return c
  30509. }
  30510. // Header returns an http.Header that can be modified by the caller to
  30511. // add HTTP headers to the request.
  30512. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  30513. if c.header_ == nil {
  30514. c.header_ = make(http.Header)
  30515. }
  30516. return c.header_
  30517. }
  30518. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  30519. reqHeaders := make(http.Header)
  30520. for k, v := range c.header_ {
  30521. reqHeaders[k] = v
  30522. }
  30523. reqHeaders.Set("User-Agent", c.s.userAgent())
  30524. var body io.Reader = nil
  30525. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30526. if err != nil {
  30527. return nil, err
  30528. }
  30529. reqHeaders.Set("Content-Type", "application/json")
  30530. c.urlParams_.Set("alt", alt)
  30531. c.urlParams_.Set("prettyPrint", "false")
  30532. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30533. urls += "?" + c.urlParams_.Encode()
  30534. req, err := http.NewRequest("PATCH", urls, body)
  30535. if err != nil {
  30536. return nil, err
  30537. }
  30538. req.Header = reqHeaders
  30539. googleapi.Expand(req.URL, map[string]string{
  30540. "profileId": strconv.FormatInt(c.profileId, 10),
  30541. })
  30542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30543. }
  30544. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  30545. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30546. // non-2xx status code is an error. Response headers are in either
  30547. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30548. // returned at all) in error.(*googleapi.Error).Header. Use
  30549. // googleapi.IsNotModified to check whether the returned error was
  30550. // because http.StatusNotModified was returned.
  30551. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30552. gensupport.SetOptions(c.urlParams_, opts...)
  30553. res, err := c.doRequest("json")
  30554. if res != nil && res.StatusCode == http.StatusNotModified {
  30555. if res.Body != nil {
  30556. res.Body.Close()
  30557. }
  30558. return nil, &googleapi.Error{
  30559. Code: res.StatusCode,
  30560. Header: res.Header,
  30561. }
  30562. }
  30563. if err != nil {
  30564. return nil, err
  30565. }
  30566. defer googleapi.CloseBody(res)
  30567. if err := googleapi.CheckResponse(res); err != nil {
  30568. return nil, err
  30569. }
  30570. ret := &FloodlightActivityGroup{
  30571. ServerResponse: googleapi.ServerResponse{
  30572. Header: res.Header,
  30573. HTTPStatusCode: res.StatusCode,
  30574. },
  30575. }
  30576. target := &ret
  30577. if err := gensupport.DecodeResponse(target, res); err != nil {
  30578. return nil, err
  30579. }
  30580. return ret, nil
  30581. // {
  30582. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  30583. // "httpMethod": "PATCH",
  30584. // "id": "dfareporting.floodlightActivityGroups.patch",
  30585. // "parameterOrder": [
  30586. // "profileId",
  30587. // "id"
  30588. // ],
  30589. // "parameters": {
  30590. // "id": {
  30591. // "description": "Floodlight activity Group ID.",
  30592. // "format": "int64",
  30593. // "location": "query",
  30594. // "required": true,
  30595. // "type": "string"
  30596. // },
  30597. // "profileId": {
  30598. // "description": "User profile ID associated with this request.",
  30599. // "format": "int64",
  30600. // "location": "path",
  30601. // "required": true,
  30602. // "type": "string"
  30603. // }
  30604. // },
  30605. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30606. // "request": {
  30607. // "$ref": "FloodlightActivityGroup"
  30608. // },
  30609. // "response": {
  30610. // "$ref": "FloodlightActivityGroup"
  30611. // },
  30612. // "scopes": [
  30613. // "https://www.googleapis.com/auth/dfatrafficking"
  30614. // ]
  30615. // }
  30616. }
  30617. // method id "dfareporting.floodlightActivityGroups.update":
  30618. type FloodlightActivityGroupsUpdateCall struct {
  30619. s *Service
  30620. profileId int64
  30621. floodlightactivitygroup *FloodlightActivityGroup
  30622. urlParams_ gensupport.URLParams
  30623. ctx_ context.Context
  30624. header_ http.Header
  30625. }
  30626. // Update: Updates an existing floodlight activity group.
  30627. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  30628. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30629. c.profileId = profileId
  30630. c.floodlightactivitygroup = floodlightactivitygroup
  30631. return c
  30632. }
  30633. // Fields allows partial responses to be retrieved. See
  30634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30635. // for more information.
  30636. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  30637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30638. return c
  30639. }
  30640. // Context sets the context to be used in this call's Do method. Any
  30641. // pending HTTP request will be aborted if the provided context is
  30642. // canceled.
  30643. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  30644. c.ctx_ = ctx
  30645. return c
  30646. }
  30647. // Header returns an http.Header that can be modified by the caller to
  30648. // add HTTP headers to the request.
  30649. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  30650. if c.header_ == nil {
  30651. c.header_ = make(http.Header)
  30652. }
  30653. return c.header_
  30654. }
  30655. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30656. reqHeaders := make(http.Header)
  30657. for k, v := range c.header_ {
  30658. reqHeaders[k] = v
  30659. }
  30660. reqHeaders.Set("User-Agent", c.s.userAgent())
  30661. var body io.Reader = nil
  30662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30663. if err != nil {
  30664. return nil, err
  30665. }
  30666. reqHeaders.Set("Content-Type", "application/json")
  30667. c.urlParams_.Set("alt", alt)
  30668. c.urlParams_.Set("prettyPrint", "false")
  30669. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30670. urls += "?" + c.urlParams_.Encode()
  30671. req, err := http.NewRequest("PUT", urls, body)
  30672. if err != nil {
  30673. return nil, err
  30674. }
  30675. req.Header = reqHeaders
  30676. googleapi.Expand(req.URL, map[string]string{
  30677. "profileId": strconv.FormatInt(c.profileId, 10),
  30678. })
  30679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30680. }
  30681. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  30682. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30683. // non-2xx status code is an error. Response headers are in either
  30684. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30685. // returned at all) in error.(*googleapi.Error).Header. Use
  30686. // googleapi.IsNotModified to check whether the returned error was
  30687. // because http.StatusNotModified was returned.
  30688. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30689. gensupport.SetOptions(c.urlParams_, opts...)
  30690. res, err := c.doRequest("json")
  30691. if res != nil && res.StatusCode == http.StatusNotModified {
  30692. if res.Body != nil {
  30693. res.Body.Close()
  30694. }
  30695. return nil, &googleapi.Error{
  30696. Code: res.StatusCode,
  30697. Header: res.Header,
  30698. }
  30699. }
  30700. if err != nil {
  30701. return nil, err
  30702. }
  30703. defer googleapi.CloseBody(res)
  30704. if err := googleapi.CheckResponse(res); err != nil {
  30705. return nil, err
  30706. }
  30707. ret := &FloodlightActivityGroup{
  30708. ServerResponse: googleapi.ServerResponse{
  30709. Header: res.Header,
  30710. HTTPStatusCode: res.StatusCode,
  30711. },
  30712. }
  30713. target := &ret
  30714. if err := gensupport.DecodeResponse(target, res); err != nil {
  30715. return nil, err
  30716. }
  30717. return ret, nil
  30718. // {
  30719. // "description": "Updates an existing floodlight activity group.",
  30720. // "httpMethod": "PUT",
  30721. // "id": "dfareporting.floodlightActivityGroups.update",
  30722. // "parameterOrder": [
  30723. // "profileId"
  30724. // ],
  30725. // "parameters": {
  30726. // "profileId": {
  30727. // "description": "User profile ID associated with this request.",
  30728. // "format": "int64",
  30729. // "location": "path",
  30730. // "required": true,
  30731. // "type": "string"
  30732. // }
  30733. // },
  30734. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30735. // "request": {
  30736. // "$ref": "FloodlightActivityGroup"
  30737. // },
  30738. // "response": {
  30739. // "$ref": "FloodlightActivityGroup"
  30740. // },
  30741. // "scopes": [
  30742. // "https://www.googleapis.com/auth/dfatrafficking"
  30743. // ]
  30744. // }
  30745. }
  30746. // method id "dfareporting.floodlightConfigurations.get":
  30747. type FloodlightConfigurationsGetCall struct {
  30748. s *Service
  30749. profileId int64
  30750. id int64
  30751. urlParams_ gensupport.URLParams
  30752. ifNoneMatch_ string
  30753. ctx_ context.Context
  30754. header_ http.Header
  30755. }
  30756. // Get: Gets one floodlight configuration by ID.
  30757. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  30758. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30759. c.profileId = profileId
  30760. c.id = id
  30761. return c
  30762. }
  30763. // Fields allows partial responses to be retrieved. See
  30764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30765. // for more information.
  30766. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  30767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30768. return c
  30769. }
  30770. // IfNoneMatch sets the optional parameter which makes the operation
  30771. // fail if the object's ETag matches the given value. This is useful for
  30772. // getting updates only after the object has changed since the last
  30773. // request. Use googleapi.IsNotModified to check whether the response
  30774. // error from Do is the result of In-None-Match.
  30775. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  30776. c.ifNoneMatch_ = entityTag
  30777. return c
  30778. }
  30779. // Context sets the context to be used in this call's Do method. Any
  30780. // pending HTTP request will be aborted if the provided context is
  30781. // canceled.
  30782. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  30783. c.ctx_ = ctx
  30784. return c
  30785. }
  30786. // Header returns an http.Header that can be modified by the caller to
  30787. // add HTTP headers to the request.
  30788. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  30789. if c.header_ == nil {
  30790. c.header_ = make(http.Header)
  30791. }
  30792. return c.header_
  30793. }
  30794. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  30795. reqHeaders := make(http.Header)
  30796. for k, v := range c.header_ {
  30797. reqHeaders[k] = v
  30798. }
  30799. reqHeaders.Set("User-Agent", c.s.userAgent())
  30800. if c.ifNoneMatch_ != "" {
  30801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30802. }
  30803. var body io.Reader = nil
  30804. c.urlParams_.Set("alt", alt)
  30805. c.urlParams_.Set("prettyPrint", "false")
  30806. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  30807. urls += "?" + c.urlParams_.Encode()
  30808. req, err := http.NewRequest("GET", urls, body)
  30809. if err != nil {
  30810. return nil, err
  30811. }
  30812. req.Header = reqHeaders
  30813. googleapi.Expand(req.URL, map[string]string{
  30814. "profileId": strconv.FormatInt(c.profileId, 10),
  30815. "id": strconv.FormatInt(c.id, 10),
  30816. })
  30817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30818. }
  30819. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  30820. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30821. // non-2xx status code is an error. Response headers are in either
  30822. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30823. // returned at all) in error.(*googleapi.Error).Header. Use
  30824. // googleapi.IsNotModified to check whether the returned error was
  30825. // because http.StatusNotModified was returned.
  30826. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30827. gensupport.SetOptions(c.urlParams_, opts...)
  30828. res, err := c.doRequest("json")
  30829. if res != nil && res.StatusCode == http.StatusNotModified {
  30830. if res.Body != nil {
  30831. res.Body.Close()
  30832. }
  30833. return nil, &googleapi.Error{
  30834. Code: res.StatusCode,
  30835. Header: res.Header,
  30836. }
  30837. }
  30838. if err != nil {
  30839. return nil, err
  30840. }
  30841. defer googleapi.CloseBody(res)
  30842. if err := googleapi.CheckResponse(res); err != nil {
  30843. return nil, err
  30844. }
  30845. ret := &FloodlightConfiguration{
  30846. ServerResponse: googleapi.ServerResponse{
  30847. Header: res.Header,
  30848. HTTPStatusCode: res.StatusCode,
  30849. },
  30850. }
  30851. target := &ret
  30852. if err := gensupport.DecodeResponse(target, res); err != nil {
  30853. return nil, err
  30854. }
  30855. return ret, nil
  30856. // {
  30857. // "description": "Gets one floodlight configuration by ID.",
  30858. // "httpMethod": "GET",
  30859. // "id": "dfareporting.floodlightConfigurations.get",
  30860. // "parameterOrder": [
  30861. // "profileId",
  30862. // "id"
  30863. // ],
  30864. // "parameters": {
  30865. // "id": {
  30866. // "description": "Floodlight configuration ID.",
  30867. // "format": "int64",
  30868. // "location": "path",
  30869. // "required": true,
  30870. // "type": "string"
  30871. // },
  30872. // "profileId": {
  30873. // "description": "User profile ID associated with this request.",
  30874. // "format": "int64",
  30875. // "location": "path",
  30876. // "required": true,
  30877. // "type": "string"
  30878. // }
  30879. // },
  30880. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  30881. // "response": {
  30882. // "$ref": "FloodlightConfiguration"
  30883. // },
  30884. // "scopes": [
  30885. // "https://www.googleapis.com/auth/dfatrafficking"
  30886. // ]
  30887. // }
  30888. }
  30889. // method id "dfareporting.floodlightConfigurations.list":
  30890. type FloodlightConfigurationsListCall struct {
  30891. s *Service
  30892. profileId int64
  30893. urlParams_ gensupport.URLParams
  30894. ifNoneMatch_ string
  30895. ctx_ context.Context
  30896. header_ http.Header
  30897. }
  30898. // List: Retrieves a list of floodlight configurations, possibly
  30899. // filtered.
  30900. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  30901. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30902. c.profileId = profileId
  30903. return c
  30904. }
  30905. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  30906. // configurations to retrieve. Required field; otherwise an empty list
  30907. // will be returned.
  30908. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  30909. var ids_ []string
  30910. for _, v := range ids {
  30911. ids_ = append(ids_, fmt.Sprint(v))
  30912. }
  30913. c.urlParams_.SetMulti("ids", ids_)
  30914. return c
  30915. }
  30916. // Fields allows partial responses to be retrieved. See
  30917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30918. // for more information.
  30919. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  30920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30921. return c
  30922. }
  30923. // IfNoneMatch sets the optional parameter which makes the operation
  30924. // fail if the object's ETag matches the given value. This is useful for
  30925. // getting updates only after the object has changed since the last
  30926. // request. Use googleapi.IsNotModified to check whether the response
  30927. // error from Do is the result of In-None-Match.
  30928. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  30929. c.ifNoneMatch_ = entityTag
  30930. return c
  30931. }
  30932. // Context sets the context to be used in this call's Do method. Any
  30933. // pending HTTP request will be aborted if the provided context is
  30934. // canceled.
  30935. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  30936. c.ctx_ = ctx
  30937. return c
  30938. }
  30939. // Header returns an http.Header that can be modified by the caller to
  30940. // add HTTP headers to the request.
  30941. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  30942. if c.header_ == nil {
  30943. c.header_ = make(http.Header)
  30944. }
  30945. return c.header_
  30946. }
  30947. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  30948. reqHeaders := make(http.Header)
  30949. for k, v := range c.header_ {
  30950. reqHeaders[k] = v
  30951. }
  30952. reqHeaders.Set("User-Agent", c.s.userAgent())
  30953. if c.ifNoneMatch_ != "" {
  30954. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30955. }
  30956. var body io.Reader = nil
  30957. c.urlParams_.Set("alt", alt)
  30958. c.urlParams_.Set("prettyPrint", "false")
  30959. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30960. urls += "?" + c.urlParams_.Encode()
  30961. req, err := http.NewRequest("GET", urls, body)
  30962. if err != nil {
  30963. return nil, err
  30964. }
  30965. req.Header = reqHeaders
  30966. googleapi.Expand(req.URL, map[string]string{
  30967. "profileId": strconv.FormatInt(c.profileId, 10),
  30968. })
  30969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30970. }
  30971. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  30972. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  30973. // non-nil. Any non-2xx status code is an error. Response headers are in
  30974. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  30975. // (if a response was returned at all) in
  30976. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30977. // whether the returned error was because http.StatusNotModified was
  30978. // returned.
  30979. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  30980. gensupport.SetOptions(c.urlParams_, opts...)
  30981. res, err := c.doRequest("json")
  30982. if res != nil && res.StatusCode == http.StatusNotModified {
  30983. if res.Body != nil {
  30984. res.Body.Close()
  30985. }
  30986. return nil, &googleapi.Error{
  30987. Code: res.StatusCode,
  30988. Header: res.Header,
  30989. }
  30990. }
  30991. if err != nil {
  30992. return nil, err
  30993. }
  30994. defer googleapi.CloseBody(res)
  30995. if err := googleapi.CheckResponse(res); err != nil {
  30996. return nil, err
  30997. }
  30998. ret := &FloodlightConfigurationsListResponse{
  30999. ServerResponse: googleapi.ServerResponse{
  31000. Header: res.Header,
  31001. HTTPStatusCode: res.StatusCode,
  31002. },
  31003. }
  31004. target := &ret
  31005. if err := gensupport.DecodeResponse(target, res); err != nil {
  31006. return nil, err
  31007. }
  31008. return ret, nil
  31009. // {
  31010. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  31011. // "httpMethod": "GET",
  31012. // "id": "dfareporting.floodlightConfigurations.list",
  31013. // "parameterOrder": [
  31014. // "profileId"
  31015. // ],
  31016. // "parameters": {
  31017. // "ids": {
  31018. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  31019. // "format": "int64",
  31020. // "location": "query",
  31021. // "repeated": true,
  31022. // "type": "string"
  31023. // },
  31024. // "profileId": {
  31025. // "description": "User profile ID associated with this request.",
  31026. // "format": "int64",
  31027. // "location": "path",
  31028. // "required": true,
  31029. // "type": "string"
  31030. // }
  31031. // },
  31032. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31033. // "response": {
  31034. // "$ref": "FloodlightConfigurationsListResponse"
  31035. // },
  31036. // "scopes": [
  31037. // "https://www.googleapis.com/auth/dfatrafficking"
  31038. // ]
  31039. // }
  31040. }
  31041. // method id "dfareporting.floodlightConfigurations.patch":
  31042. type FloodlightConfigurationsPatchCall struct {
  31043. s *Service
  31044. profileId int64
  31045. floodlightconfiguration *FloodlightConfiguration
  31046. urlParams_ gensupport.URLParams
  31047. ctx_ context.Context
  31048. header_ http.Header
  31049. }
  31050. // Patch: Updates an existing floodlight configuration. This method
  31051. // supports patch semantics.
  31052. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  31053. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31054. c.profileId = profileId
  31055. c.urlParams_.Set("id", fmt.Sprint(id))
  31056. c.floodlightconfiguration = floodlightconfiguration
  31057. return c
  31058. }
  31059. // Fields allows partial responses to be retrieved. See
  31060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31061. // for more information.
  31062. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  31063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31064. return c
  31065. }
  31066. // Context sets the context to be used in this call's Do method. Any
  31067. // pending HTTP request will be aborted if the provided context is
  31068. // canceled.
  31069. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  31070. c.ctx_ = ctx
  31071. return c
  31072. }
  31073. // Header returns an http.Header that can be modified by the caller to
  31074. // add HTTP headers to the request.
  31075. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  31076. if c.header_ == nil {
  31077. c.header_ = make(http.Header)
  31078. }
  31079. return c.header_
  31080. }
  31081. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  31082. reqHeaders := make(http.Header)
  31083. for k, v := range c.header_ {
  31084. reqHeaders[k] = v
  31085. }
  31086. reqHeaders.Set("User-Agent", c.s.userAgent())
  31087. var body io.Reader = nil
  31088. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  31089. if err != nil {
  31090. return nil, err
  31091. }
  31092. reqHeaders.Set("Content-Type", "application/json")
  31093. c.urlParams_.Set("alt", alt)
  31094. c.urlParams_.Set("prettyPrint", "false")
  31095. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  31096. urls += "?" + c.urlParams_.Encode()
  31097. req, err := http.NewRequest("PATCH", urls, body)
  31098. if err != nil {
  31099. return nil, err
  31100. }
  31101. req.Header = reqHeaders
  31102. googleapi.Expand(req.URL, map[string]string{
  31103. "profileId": strconv.FormatInt(c.profileId, 10),
  31104. })
  31105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31106. }
  31107. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  31108. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  31109. // non-2xx status code is an error. Response headers are in either
  31110. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  31111. // returned at all) in error.(*googleapi.Error).Header. Use
  31112. // googleapi.IsNotModified to check whether the returned error was
  31113. // because http.StatusNotModified was returned.
  31114. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  31115. gensupport.SetOptions(c.urlParams_, opts...)
  31116. res, err := c.doRequest("json")
  31117. if res != nil && res.StatusCode == http.StatusNotModified {
  31118. if res.Body != nil {
  31119. res.Body.Close()
  31120. }
  31121. return nil, &googleapi.Error{
  31122. Code: res.StatusCode,
  31123. Header: res.Header,
  31124. }
  31125. }
  31126. if err != nil {
  31127. return nil, err
  31128. }
  31129. defer googleapi.CloseBody(res)
  31130. if err := googleapi.CheckResponse(res); err != nil {
  31131. return nil, err
  31132. }
  31133. ret := &FloodlightConfiguration{
  31134. ServerResponse: googleapi.ServerResponse{
  31135. Header: res.Header,
  31136. HTTPStatusCode: res.StatusCode,
  31137. },
  31138. }
  31139. target := &ret
  31140. if err := gensupport.DecodeResponse(target, res); err != nil {
  31141. return nil, err
  31142. }
  31143. return ret, nil
  31144. // {
  31145. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  31146. // "httpMethod": "PATCH",
  31147. // "id": "dfareporting.floodlightConfigurations.patch",
  31148. // "parameterOrder": [
  31149. // "profileId",
  31150. // "id"
  31151. // ],
  31152. // "parameters": {
  31153. // "id": {
  31154. // "description": "Floodlight configuration ID.",
  31155. // "format": "int64",
  31156. // "location": "query",
  31157. // "required": true,
  31158. // "type": "string"
  31159. // },
  31160. // "profileId": {
  31161. // "description": "User profile ID associated with this request.",
  31162. // "format": "int64",
  31163. // "location": "path",
  31164. // "required": true,
  31165. // "type": "string"
  31166. // }
  31167. // },
  31168. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31169. // "request": {
  31170. // "$ref": "FloodlightConfiguration"
  31171. // },
  31172. // "response": {
  31173. // "$ref": "FloodlightConfiguration"
  31174. // },
  31175. // "scopes": [
  31176. // "https://www.googleapis.com/auth/dfatrafficking"
  31177. // ]
  31178. // }
  31179. }
  31180. // method id "dfareporting.floodlightConfigurations.update":
  31181. type FloodlightConfigurationsUpdateCall struct {
  31182. s *Service
  31183. profileId int64
  31184. floodlightconfiguration *FloodlightConfiguration
  31185. urlParams_ gensupport.URLParams
  31186. ctx_ context.Context
  31187. header_ http.Header
  31188. }
  31189. // Update: Updates an existing floodlight configuration.
  31190. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  31191. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31192. c.profileId = profileId
  31193. c.floodlightconfiguration = floodlightconfiguration
  31194. return c
  31195. }
  31196. // Fields allows partial responses to be retrieved. See
  31197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31198. // for more information.
  31199. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  31200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31201. return c
  31202. }
  31203. // Context sets the context to be used in this call's Do method. Any
  31204. // pending HTTP request will be aborted if the provided context is
  31205. // canceled.
  31206. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  31207. c.ctx_ = ctx
  31208. return c
  31209. }
  31210. // Header returns an http.Header that can be modified by the caller to
  31211. // add HTTP headers to the request.
  31212. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  31213. if c.header_ == nil {
  31214. c.header_ = make(http.Header)
  31215. }
  31216. return c.header_
  31217. }
  31218. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  31219. reqHeaders := make(http.Header)
  31220. for k, v := range c.header_ {
  31221. reqHeaders[k] = v
  31222. }
  31223. reqHeaders.Set("User-Agent", c.s.userAgent())
  31224. var body io.Reader = nil
  31225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  31226. if err != nil {
  31227. return nil, err
  31228. }
  31229. reqHeaders.Set("Content-Type", "application/json")
  31230. c.urlParams_.Set("alt", alt)
  31231. c.urlParams_.Set("prettyPrint", "false")
  31232. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  31233. urls += "?" + c.urlParams_.Encode()
  31234. req, err := http.NewRequest("PUT", urls, body)
  31235. if err != nil {
  31236. return nil, err
  31237. }
  31238. req.Header = reqHeaders
  31239. googleapi.Expand(req.URL, map[string]string{
  31240. "profileId": strconv.FormatInt(c.profileId, 10),
  31241. })
  31242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31243. }
  31244. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  31245. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  31246. // non-2xx status code is an error. Response headers are in either
  31247. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  31248. // returned at all) in error.(*googleapi.Error).Header. Use
  31249. // googleapi.IsNotModified to check whether the returned error was
  31250. // because http.StatusNotModified was returned.
  31251. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  31252. gensupport.SetOptions(c.urlParams_, opts...)
  31253. res, err := c.doRequest("json")
  31254. if res != nil && res.StatusCode == http.StatusNotModified {
  31255. if res.Body != nil {
  31256. res.Body.Close()
  31257. }
  31258. return nil, &googleapi.Error{
  31259. Code: res.StatusCode,
  31260. Header: res.Header,
  31261. }
  31262. }
  31263. if err != nil {
  31264. return nil, err
  31265. }
  31266. defer googleapi.CloseBody(res)
  31267. if err := googleapi.CheckResponse(res); err != nil {
  31268. return nil, err
  31269. }
  31270. ret := &FloodlightConfiguration{
  31271. ServerResponse: googleapi.ServerResponse{
  31272. Header: res.Header,
  31273. HTTPStatusCode: res.StatusCode,
  31274. },
  31275. }
  31276. target := &ret
  31277. if err := gensupport.DecodeResponse(target, res); err != nil {
  31278. return nil, err
  31279. }
  31280. return ret, nil
  31281. // {
  31282. // "description": "Updates an existing floodlight configuration.",
  31283. // "httpMethod": "PUT",
  31284. // "id": "dfareporting.floodlightConfigurations.update",
  31285. // "parameterOrder": [
  31286. // "profileId"
  31287. // ],
  31288. // "parameters": {
  31289. // "profileId": {
  31290. // "description": "User profile ID associated with this request.",
  31291. // "format": "int64",
  31292. // "location": "path",
  31293. // "required": true,
  31294. // "type": "string"
  31295. // }
  31296. // },
  31297. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31298. // "request": {
  31299. // "$ref": "FloodlightConfiguration"
  31300. // },
  31301. // "response": {
  31302. // "$ref": "FloodlightConfiguration"
  31303. // },
  31304. // "scopes": [
  31305. // "https://www.googleapis.com/auth/dfatrafficking"
  31306. // ]
  31307. // }
  31308. }
  31309. // method id "dfareporting.inventoryItems.get":
  31310. type InventoryItemsGetCall struct {
  31311. s *Service
  31312. profileId int64
  31313. projectId int64
  31314. id int64
  31315. urlParams_ gensupport.URLParams
  31316. ifNoneMatch_ string
  31317. ctx_ context.Context
  31318. header_ http.Header
  31319. }
  31320. // Get: Gets one inventory item by ID.
  31321. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  31322. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31323. c.profileId = profileId
  31324. c.projectId = projectId
  31325. c.id = id
  31326. return c
  31327. }
  31328. // Fields allows partial responses to be retrieved. See
  31329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31330. // for more information.
  31331. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  31332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31333. return c
  31334. }
  31335. // IfNoneMatch sets the optional parameter which makes the operation
  31336. // fail if the object's ETag matches the given value. This is useful for
  31337. // getting updates only after the object has changed since the last
  31338. // request. Use googleapi.IsNotModified to check whether the response
  31339. // error from Do is the result of In-None-Match.
  31340. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  31341. c.ifNoneMatch_ = entityTag
  31342. return c
  31343. }
  31344. // Context sets the context to be used in this call's Do method. Any
  31345. // pending HTTP request will be aborted if the provided context is
  31346. // canceled.
  31347. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  31348. c.ctx_ = ctx
  31349. return c
  31350. }
  31351. // Header returns an http.Header that can be modified by the caller to
  31352. // add HTTP headers to the request.
  31353. func (c *InventoryItemsGetCall) Header() http.Header {
  31354. if c.header_ == nil {
  31355. c.header_ = make(http.Header)
  31356. }
  31357. return c.header_
  31358. }
  31359. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  31360. reqHeaders := make(http.Header)
  31361. for k, v := range c.header_ {
  31362. reqHeaders[k] = v
  31363. }
  31364. reqHeaders.Set("User-Agent", c.s.userAgent())
  31365. if c.ifNoneMatch_ != "" {
  31366. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31367. }
  31368. var body io.Reader = nil
  31369. c.urlParams_.Set("alt", alt)
  31370. c.urlParams_.Set("prettyPrint", "false")
  31371. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  31372. urls += "?" + c.urlParams_.Encode()
  31373. req, err := http.NewRequest("GET", urls, body)
  31374. if err != nil {
  31375. return nil, err
  31376. }
  31377. req.Header = reqHeaders
  31378. googleapi.Expand(req.URL, map[string]string{
  31379. "profileId": strconv.FormatInt(c.profileId, 10),
  31380. "projectId": strconv.FormatInt(c.projectId, 10),
  31381. "id": strconv.FormatInt(c.id, 10),
  31382. })
  31383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31384. }
  31385. // Do executes the "dfareporting.inventoryItems.get" call.
  31386. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  31387. // status code is an error. Response headers are in either
  31388. // *InventoryItem.ServerResponse.Header or (if a response was returned
  31389. // at all) in error.(*googleapi.Error).Header. Use
  31390. // googleapi.IsNotModified to check whether the returned error was
  31391. // because http.StatusNotModified was returned.
  31392. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  31393. gensupport.SetOptions(c.urlParams_, opts...)
  31394. res, err := c.doRequest("json")
  31395. if res != nil && res.StatusCode == http.StatusNotModified {
  31396. if res.Body != nil {
  31397. res.Body.Close()
  31398. }
  31399. return nil, &googleapi.Error{
  31400. Code: res.StatusCode,
  31401. Header: res.Header,
  31402. }
  31403. }
  31404. if err != nil {
  31405. return nil, err
  31406. }
  31407. defer googleapi.CloseBody(res)
  31408. if err := googleapi.CheckResponse(res); err != nil {
  31409. return nil, err
  31410. }
  31411. ret := &InventoryItem{
  31412. ServerResponse: googleapi.ServerResponse{
  31413. Header: res.Header,
  31414. HTTPStatusCode: res.StatusCode,
  31415. },
  31416. }
  31417. target := &ret
  31418. if err := gensupport.DecodeResponse(target, res); err != nil {
  31419. return nil, err
  31420. }
  31421. return ret, nil
  31422. // {
  31423. // "description": "Gets one inventory item by ID.",
  31424. // "httpMethod": "GET",
  31425. // "id": "dfareporting.inventoryItems.get",
  31426. // "parameterOrder": [
  31427. // "profileId",
  31428. // "projectId",
  31429. // "id"
  31430. // ],
  31431. // "parameters": {
  31432. // "id": {
  31433. // "description": "Inventory item ID.",
  31434. // "format": "int64",
  31435. // "location": "path",
  31436. // "required": true,
  31437. // "type": "string"
  31438. // },
  31439. // "profileId": {
  31440. // "description": "User profile ID associated with this request.",
  31441. // "format": "int64",
  31442. // "location": "path",
  31443. // "required": true,
  31444. // "type": "string"
  31445. // },
  31446. // "projectId": {
  31447. // "description": "Project ID for order documents.",
  31448. // "format": "int64",
  31449. // "location": "path",
  31450. // "required": true,
  31451. // "type": "string"
  31452. // }
  31453. // },
  31454. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  31455. // "response": {
  31456. // "$ref": "InventoryItem"
  31457. // },
  31458. // "scopes": [
  31459. // "https://www.googleapis.com/auth/dfatrafficking"
  31460. // ]
  31461. // }
  31462. }
  31463. // method id "dfareporting.inventoryItems.list":
  31464. type InventoryItemsListCall struct {
  31465. s *Service
  31466. profileId int64
  31467. projectId int64
  31468. urlParams_ gensupport.URLParams
  31469. ifNoneMatch_ string
  31470. ctx_ context.Context
  31471. header_ http.Header
  31472. }
  31473. // List: Retrieves a list of inventory items, possibly filtered. This
  31474. // method supports paging.
  31475. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  31476. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31477. c.profileId = profileId
  31478. c.projectId = projectId
  31479. return c
  31480. }
  31481. // Ids sets the optional parameter "ids": Select only inventory items
  31482. // with these IDs.
  31483. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  31484. var ids_ []string
  31485. for _, v := range ids {
  31486. ids_ = append(ids_, fmt.Sprint(v))
  31487. }
  31488. c.urlParams_.SetMulti("ids", ids_)
  31489. return c
  31490. }
  31491. // InPlan sets the optional parameter "inPlan": Select only inventory
  31492. // items that are in plan.
  31493. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  31494. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  31495. return c
  31496. }
  31497. // MaxResults sets the optional parameter "maxResults": Maximum number
  31498. // of results to return.
  31499. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  31500. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31501. return c
  31502. }
  31503. // OrderId sets the optional parameter "orderId": Select only inventory
  31504. // items that belong to specified orders.
  31505. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  31506. var orderId_ []string
  31507. for _, v := range orderId {
  31508. orderId_ = append(orderId_, fmt.Sprint(v))
  31509. }
  31510. c.urlParams_.SetMulti("orderId", orderId_)
  31511. return c
  31512. }
  31513. // PageToken sets the optional parameter "pageToken": Value of the
  31514. // nextPageToken from the previous result page.
  31515. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  31516. c.urlParams_.Set("pageToken", pageToken)
  31517. return c
  31518. }
  31519. // SiteId sets the optional parameter "siteId": Select only inventory
  31520. // items that are associated with these sites.
  31521. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  31522. var siteId_ []string
  31523. for _, v := range siteId {
  31524. siteId_ = append(siteId_, fmt.Sprint(v))
  31525. }
  31526. c.urlParams_.SetMulti("siteId", siteId_)
  31527. return c
  31528. }
  31529. // SortField sets the optional parameter "sortField": Field by which to
  31530. // sort the list.
  31531. //
  31532. // Possible values:
  31533. // "ID" (default)
  31534. // "NAME"
  31535. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  31536. c.urlParams_.Set("sortField", sortField)
  31537. return c
  31538. }
  31539. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  31540. // results.
  31541. //
  31542. // Possible values:
  31543. // "ASCENDING" (default)
  31544. // "DESCENDING"
  31545. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  31546. c.urlParams_.Set("sortOrder", sortOrder)
  31547. return c
  31548. }
  31549. // Type sets the optional parameter "type": Select only inventory items
  31550. // with this type.
  31551. //
  31552. // Possible values:
  31553. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  31554. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31555. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  31556. c.urlParams_.Set("type", type_)
  31557. return c
  31558. }
  31559. // Fields allows partial responses to be retrieved. See
  31560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31561. // for more information.
  31562. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  31563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31564. return c
  31565. }
  31566. // IfNoneMatch sets the optional parameter which makes the operation
  31567. // fail if the object's ETag matches the given value. This is useful for
  31568. // getting updates only after the object has changed since the last
  31569. // request. Use googleapi.IsNotModified to check whether the response
  31570. // error from Do is the result of In-None-Match.
  31571. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  31572. c.ifNoneMatch_ = entityTag
  31573. return c
  31574. }
  31575. // Context sets the context to be used in this call's Do method. Any
  31576. // pending HTTP request will be aborted if the provided context is
  31577. // canceled.
  31578. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  31579. c.ctx_ = ctx
  31580. return c
  31581. }
  31582. // Header returns an http.Header that can be modified by the caller to
  31583. // add HTTP headers to the request.
  31584. func (c *InventoryItemsListCall) Header() http.Header {
  31585. if c.header_ == nil {
  31586. c.header_ = make(http.Header)
  31587. }
  31588. return c.header_
  31589. }
  31590. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  31591. reqHeaders := make(http.Header)
  31592. for k, v := range c.header_ {
  31593. reqHeaders[k] = v
  31594. }
  31595. reqHeaders.Set("User-Agent", c.s.userAgent())
  31596. if c.ifNoneMatch_ != "" {
  31597. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31598. }
  31599. var body io.Reader = nil
  31600. c.urlParams_.Set("alt", alt)
  31601. c.urlParams_.Set("prettyPrint", "false")
  31602. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  31603. urls += "?" + c.urlParams_.Encode()
  31604. req, err := http.NewRequest("GET", urls, body)
  31605. if err != nil {
  31606. return nil, err
  31607. }
  31608. req.Header = reqHeaders
  31609. googleapi.Expand(req.URL, map[string]string{
  31610. "profileId": strconv.FormatInt(c.profileId, 10),
  31611. "projectId": strconv.FormatInt(c.projectId, 10),
  31612. })
  31613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31614. }
  31615. // Do executes the "dfareporting.inventoryItems.list" call.
  31616. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  31617. // Any non-2xx status code is an error. Response headers are in either
  31618. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  31619. // was returned at all) in error.(*googleapi.Error).Header. Use
  31620. // googleapi.IsNotModified to check whether the returned error was
  31621. // because http.StatusNotModified was returned.
  31622. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  31623. gensupport.SetOptions(c.urlParams_, opts...)
  31624. res, err := c.doRequest("json")
  31625. if res != nil && res.StatusCode == http.StatusNotModified {
  31626. if res.Body != nil {
  31627. res.Body.Close()
  31628. }
  31629. return nil, &googleapi.Error{
  31630. Code: res.StatusCode,
  31631. Header: res.Header,
  31632. }
  31633. }
  31634. if err != nil {
  31635. return nil, err
  31636. }
  31637. defer googleapi.CloseBody(res)
  31638. if err := googleapi.CheckResponse(res); err != nil {
  31639. return nil, err
  31640. }
  31641. ret := &InventoryItemsListResponse{
  31642. ServerResponse: googleapi.ServerResponse{
  31643. Header: res.Header,
  31644. HTTPStatusCode: res.StatusCode,
  31645. },
  31646. }
  31647. target := &ret
  31648. if err := gensupport.DecodeResponse(target, res); err != nil {
  31649. return nil, err
  31650. }
  31651. return ret, nil
  31652. // {
  31653. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  31654. // "httpMethod": "GET",
  31655. // "id": "dfareporting.inventoryItems.list",
  31656. // "parameterOrder": [
  31657. // "profileId",
  31658. // "projectId"
  31659. // ],
  31660. // "parameters": {
  31661. // "ids": {
  31662. // "description": "Select only inventory items with these IDs.",
  31663. // "format": "int64",
  31664. // "location": "query",
  31665. // "repeated": true,
  31666. // "type": "string"
  31667. // },
  31668. // "inPlan": {
  31669. // "description": "Select only inventory items that are in plan.",
  31670. // "location": "query",
  31671. // "type": "boolean"
  31672. // },
  31673. // "maxResults": {
  31674. // "default": "1000",
  31675. // "description": "Maximum number of results to return.",
  31676. // "format": "int32",
  31677. // "location": "query",
  31678. // "maximum": "1000",
  31679. // "minimum": "0",
  31680. // "type": "integer"
  31681. // },
  31682. // "orderId": {
  31683. // "description": "Select only inventory items that belong to specified orders.",
  31684. // "format": "int64",
  31685. // "location": "query",
  31686. // "repeated": true,
  31687. // "type": "string"
  31688. // },
  31689. // "pageToken": {
  31690. // "description": "Value of the nextPageToken from the previous result page.",
  31691. // "location": "query",
  31692. // "type": "string"
  31693. // },
  31694. // "profileId": {
  31695. // "description": "User profile ID associated with this request.",
  31696. // "format": "int64",
  31697. // "location": "path",
  31698. // "required": true,
  31699. // "type": "string"
  31700. // },
  31701. // "projectId": {
  31702. // "description": "Project ID for order documents.",
  31703. // "format": "int64",
  31704. // "location": "path",
  31705. // "required": true,
  31706. // "type": "string"
  31707. // },
  31708. // "siteId": {
  31709. // "description": "Select only inventory items that are associated with these sites.",
  31710. // "format": "int64",
  31711. // "location": "query",
  31712. // "repeated": true,
  31713. // "type": "string"
  31714. // },
  31715. // "sortField": {
  31716. // "default": "ID",
  31717. // "description": "Field by which to sort the list.",
  31718. // "enum": [
  31719. // "ID",
  31720. // "NAME"
  31721. // ],
  31722. // "enumDescriptions": [
  31723. // "",
  31724. // ""
  31725. // ],
  31726. // "location": "query",
  31727. // "type": "string"
  31728. // },
  31729. // "sortOrder": {
  31730. // "default": "ASCENDING",
  31731. // "description": "Order of sorted results.",
  31732. // "enum": [
  31733. // "ASCENDING",
  31734. // "DESCENDING"
  31735. // ],
  31736. // "enumDescriptions": [
  31737. // "",
  31738. // ""
  31739. // ],
  31740. // "location": "query",
  31741. // "type": "string"
  31742. // },
  31743. // "type": {
  31744. // "description": "Select only inventory items with this type.",
  31745. // "enum": [
  31746. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  31747. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31748. // ],
  31749. // "enumDescriptions": [
  31750. // "",
  31751. // ""
  31752. // ],
  31753. // "location": "query",
  31754. // "type": "string"
  31755. // }
  31756. // },
  31757. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  31758. // "response": {
  31759. // "$ref": "InventoryItemsListResponse"
  31760. // },
  31761. // "scopes": [
  31762. // "https://www.googleapis.com/auth/dfatrafficking"
  31763. // ]
  31764. // }
  31765. }
  31766. // Pages invokes f for each page of results.
  31767. // A non-nil error returned from f will halt the iteration.
  31768. // The provided context supersedes any context provided to the Context method.
  31769. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  31770. c.ctx_ = ctx
  31771. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31772. for {
  31773. x, err := c.Do()
  31774. if err != nil {
  31775. return err
  31776. }
  31777. if err := f(x); err != nil {
  31778. return err
  31779. }
  31780. if x.NextPageToken == "" {
  31781. return nil
  31782. }
  31783. c.PageToken(x.NextPageToken)
  31784. }
  31785. }
  31786. // method id "dfareporting.languages.list":
  31787. type LanguagesListCall struct {
  31788. s *Service
  31789. profileId int64
  31790. urlParams_ gensupport.URLParams
  31791. ifNoneMatch_ string
  31792. ctx_ context.Context
  31793. header_ http.Header
  31794. }
  31795. // List: Retrieves a list of languages.
  31796. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  31797. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31798. c.profileId = profileId
  31799. return c
  31800. }
  31801. // Fields allows partial responses to be retrieved. See
  31802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31803. // for more information.
  31804. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  31805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31806. return c
  31807. }
  31808. // IfNoneMatch sets the optional parameter which makes the operation
  31809. // fail if the object's ETag matches the given value. This is useful for
  31810. // getting updates only after the object has changed since the last
  31811. // request. Use googleapi.IsNotModified to check whether the response
  31812. // error from Do is the result of In-None-Match.
  31813. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  31814. c.ifNoneMatch_ = entityTag
  31815. return c
  31816. }
  31817. // Context sets the context to be used in this call's Do method. Any
  31818. // pending HTTP request will be aborted if the provided context is
  31819. // canceled.
  31820. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  31821. c.ctx_ = ctx
  31822. return c
  31823. }
  31824. // Header returns an http.Header that can be modified by the caller to
  31825. // add HTTP headers to the request.
  31826. func (c *LanguagesListCall) Header() http.Header {
  31827. if c.header_ == nil {
  31828. c.header_ = make(http.Header)
  31829. }
  31830. return c.header_
  31831. }
  31832. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  31833. reqHeaders := make(http.Header)
  31834. for k, v := range c.header_ {
  31835. reqHeaders[k] = v
  31836. }
  31837. reqHeaders.Set("User-Agent", c.s.userAgent())
  31838. if c.ifNoneMatch_ != "" {
  31839. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31840. }
  31841. var body io.Reader = nil
  31842. c.urlParams_.Set("alt", alt)
  31843. c.urlParams_.Set("prettyPrint", "false")
  31844. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  31845. urls += "?" + c.urlParams_.Encode()
  31846. req, err := http.NewRequest("GET", urls, body)
  31847. if err != nil {
  31848. return nil, err
  31849. }
  31850. req.Header = reqHeaders
  31851. googleapi.Expand(req.URL, map[string]string{
  31852. "profileId": strconv.FormatInt(c.profileId, 10),
  31853. })
  31854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31855. }
  31856. // Do executes the "dfareporting.languages.list" call.
  31857. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  31858. // non-2xx status code is an error. Response headers are in either
  31859. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  31860. // returned at all) in error.(*googleapi.Error).Header. Use
  31861. // googleapi.IsNotModified to check whether the returned error was
  31862. // because http.StatusNotModified was returned.
  31863. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  31864. gensupport.SetOptions(c.urlParams_, opts...)
  31865. res, err := c.doRequest("json")
  31866. if res != nil && res.StatusCode == http.StatusNotModified {
  31867. if res.Body != nil {
  31868. res.Body.Close()
  31869. }
  31870. return nil, &googleapi.Error{
  31871. Code: res.StatusCode,
  31872. Header: res.Header,
  31873. }
  31874. }
  31875. if err != nil {
  31876. return nil, err
  31877. }
  31878. defer googleapi.CloseBody(res)
  31879. if err := googleapi.CheckResponse(res); err != nil {
  31880. return nil, err
  31881. }
  31882. ret := &LanguagesListResponse{
  31883. ServerResponse: googleapi.ServerResponse{
  31884. Header: res.Header,
  31885. HTTPStatusCode: res.StatusCode,
  31886. },
  31887. }
  31888. target := &ret
  31889. if err := gensupport.DecodeResponse(target, res); err != nil {
  31890. return nil, err
  31891. }
  31892. return ret, nil
  31893. // {
  31894. // "description": "Retrieves a list of languages.",
  31895. // "httpMethod": "GET",
  31896. // "id": "dfareporting.languages.list",
  31897. // "parameterOrder": [
  31898. // "profileId"
  31899. // ],
  31900. // "parameters": {
  31901. // "profileId": {
  31902. // "description": "User profile ID associated with this request.",
  31903. // "format": "int64",
  31904. // "location": "path",
  31905. // "required": true,
  31906. // "type": "string"
  31907. // }
  31908. // },
  31909. // "path": "userprofiles/{profileId}/languages",
  31910. // "response": {
  31911. // "$ref": "LanguagesListResponse"
  31912. // },
  31913. // "scopes": [
  31914. // "https://www.googleapis.com/auth/dfatrafficking"
  31915. // ]
  31916. // }
  31917. }
  31918. // method id "dfareporting.metros.list":
  31919. type MetrosListCall struct {
  31920. s *Service
  31921. profileId int64
  31922. urlParams_ gensupport.URLParams
  31923. ifNoneMatch_ string
  31924. ctx_ context.Context
  31925. header_ http.Header
  31926. }
  31927. // List: Retrieves a list of metros.
  31928. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  31929. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31930. c.profileId = profileId
  31931. return c
  31932. }
  31933. // Fields allows partial responses to be retrieved. See
  31934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31935. // for more information.
  31936. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  31937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31938. return c
  31939. }
  31940. // IfNoneMatch sets the optional parameter which makes the operation
  31941. // fail if the object's ETag matches the given value. This is useful for
  31942. // getting updates only after the object has changed since the last
  31943. // request. Use googleapi.IsNotModified to check whether the response
  31944. // error from Do is the result of In-None-Match.
  31945. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  31946. c.ifNoneMatch_ = entityTag
  31947. return c
  31948. }
  31949. // Context sets the context to be used in this call's Do method. Any
  31950. // pending HTTP request will be aborted if the provided context is
  31951. // canceled.
  31952. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  31953. c.ctx_ = ctx
  31954. return c
  31955. }
  31956. // Header returns an http.Header that can be modified by the caller to
  31957. // add HTTP headers to the request.
  31958. func (c *MetrosListCall) Header() http.Header {
  31959. if c.header_ == nil {
  31960. c.header_ = make(http.Header)
  31961. }
  31962. return c.header_
  31963. }
  31964. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  31965. reqHeaders := make(http.Header)
  31966. for k, v := range c.header_ {
  31967. reqHeaders[k] = v
  31968. }
  31969. reqHeaders.Set("User-Agent", c.s.userAgent())
  31970. if c.ifNoneMatch_ != "" {
  31971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31972. }
  31973. var body io.Reader = nil
  31974. c.urlParams_.Set("alt", alt)
  31975. c.urlParams_.Set("prettyPrint", "false")
  31976. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  31977. urls += "?" + c.urlParams_.Encode()
  31978. req, err := http.NewRequest("GET", urls, body)
  31979. if err != nil {
  31980. return nil, err
  31981. }
  31982. req.Header = reqHeaders
  31983. googleapi.Expand(req.URL, map[string]string{
  31984. "profileId": strconv.FormatInt(c.profileId, 10),
  31985. })
  31986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31987. }
  31988. // Do executes the "dfareporting.metros.list" call.
  31989. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  31990. // non-2xx status code is an error. Response headers are in either
  31991. // *MetrosListResponse.ServerResponse.Header or (if a response was
  31992. // returned at all) in error.(*googleapi.Error).Header. Use
  31993. // googleapi.IsNotModified to check whether the returned error was
  31994. // because http.StatusNotModified was returned.
  31995. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  31996. gensupport.SetOptions(c.urlParams_, opts...)
  31997. res, err := c.doRequest("json")
  31998. if res != nil && res.StatusCode == http.StatusNotModified {
  31999. if res.Body != nil {
  32000. res.Body.Close()
  32001. }
  32002. return nil, &googleapi.Error{
  32003. Code: res.StatusCode,
  32004. Header: res.Header,
  32005. }
  32006. }
  32007. if err != nil {
  32008. return nil, err
  32009. }
  32010. defer googleapi.CloseBody(res)
  32011. if err := googleapi.CheckResponse(res); err != nil {
  32012. return nil, err
  32013. }
  32014. ret := &MetrosListResponse{
  32015. ServerResponse: googleapi.ServerResponse{
  32016. Header: res.Header,
  32017. HTTPStatusCode: res.StatusCode,
  32018. },
  32019. }
  32020. target := &ret
  32021. if err := gensupport.DecodeResponse(target, res); err != nil {
  32022. return nil, err
  32023. }
  32024. return ret, nil
  32025. // {
  32026. // "description": "Retrieves a list of metros.",
  32027. // "httpMethod": "GET",
  32028. // "id": "dfareporting.metros.list",
  32029. // "parameterOrder": [
  32030. // "profileId"
  32031. // ],
  32032. // "parameters": {
  32033. // "profileId": {
  32034. // "description": "User profile ID associated with this request.",
  32035. // "format": "int64",
  32036. // "location": "path",
  32037. // "required": true,
  32038. // "type": "string"
  32039. // }
  32040. // },
  32041. // "path": "userprofiles/{profileId}/metros",
  32042. // "response": {
  32043. // "$ref": "MetrosListResponse"
  32044. // },
  32045. // "scopes": [
  32046. // "https://www.googleapis.com/auth/dfatrafficking"
  32047. // ]
  32048. // }
  32049. }
  32050. // method id "dfareporting.mobileApps.get":
  32051. type MobileAppsGetCall struct {
  32052. s *Service
  32053. profileId int64
  32054. id string
  32055. urlParams_ gensupport.URLParams
  32056. ifNoneMatch_ string
  32057. ctx_ context.Context
  32058. header_ http.Header
  32059. }
  32060. // Get: Gets one mobile app by ID.
  32061. func (r *MobileAppsService) Get(profileId int64, id string) *MobileAppsGetCall {
  32062. c := &MobileAppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32063. c.profileId = profileId
  32064. c.id = id
  32065. return c
  32066. }
  32067. // Fields allows partial responses to be retrieved. See
  32068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32069. // for more information.
  32070. func (c *MobileAppsGetCall) Fields(s ...googleapi.Field) *MobileAppsGetCall {
  32071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32072. return c
  32073. }
  32074. // IfNoneMatch sets the optional parameter which makes the operation
  32075. // fail if the object's ETag matches the given value. This is useful for
  32076. // getting updates only after the object has changed since the last
  32077. // request. Use googleapi.IsNotModified to check whether the response
  32078. // error from Do is the result of In-None-Match.
  32079. func (c *MobileAppsGetCall) IfNoneMatch(entityTag string) *MobileAppsGetCall {
  32080. c.ifNoneMatch_ = entityTag
  32081. return c
  32082. }
  32083. // Context sets the context to be used in this call's Do method. Any
  32084. // pending HTTP request will be aborted if the provided context is
  32085. // canceled.
  32086. func (c *MobileAppsGetCall) Context(ctx context.Context) *MobileAppsGetCall {
  32087. c.ctx_ = ctx
  32088. return c
  32089. }
  32090. // Header returns an http.Header that can be modified by the caller to
  32091. // add HTTP headers to the request.
  32092. func (c *MobileAppsGetCall) Header() http.Header {
  32093. if c.header_ == nil {
  32094. c.header_ = make(http.Header)
  32095. }
  32096. return c.header_
  32097. }
  32098. func (c *MobileAppsGetCall) doRequest(alt string) (*http.Response, error) {
  32099. reqHeaders := make(http.Header)
  32100. for k, v := range c.header_ {
  32101. reqHeaders[k] = v
  32102. }
  32103. reqHeaders.Set("User-Agent", c.s.userAgent())
  32104. if c.ifNoneMatch_ != "" {
  32105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32106. }
  32107. var body io.Reader = nil
  32108. c.urlParams_.Set("alt", alt)
  32109. c.urlParams_.Set("prettyPrint", "false")
  32110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps/{id}")
  32111. urls += "?" + c.urlParams_.Encode()
  32112. req, err := http.NewRequest("GET", urls, body)
  32113. if err != nil {
  32114. return nil, err
  32115. }
  32116. req.Header = reqHeaders
  32117. googleapi.Expand(req.URL, map[string]string{
  32118. "profileId": strconv.FormatInt(c.profileId, 10),
  32119. "id": c.id,
  32120. })
  32121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32122. }
  32123. // Do executes the "dfareporting.mobileApps.get" call.
  32124. // Exactly one of *MobileApp or error will be non-nil. Any non-2xx
  32125. // status code is an error. Response headers are in either
  32126. // *MobileApp.ServerResponse.Header or (if a response was returned at
  32127. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32128. // to check whether the returned error was because
  32129. // http.StatusNotModified was returned.
  32130. func (c *MobileAppsGetCall) Do(opts ...googleapi.CallOption) (*MobileApp, error) {
  32131. gensupport.SetOptions(c.urlParams_, opts...)
  32132. res, err := c.doRequest("json")
  32133. if res != nil && res.StatusCode == http.StatusNotModified {
  32134. if res.Body != nil {
  32135. res.Body.Close()
  32136. }
  32137. return nil, &googleapi.Error{
  32138. Code: res.StatusCode,
  32139. Header: res.Header,
  32140. }
  32141. }
  32142. if err != nil {
  32143. return nil, err
  32144. }
  32145. defer googleapi.CloseBody(res)
  32146. if err := googleapi.CheckResponse(res); err != nil {
  32147. return nil, err
  32148. }
  32149. ret := &MobileApp{
  32150. ServerResponse: googleapi.ServerResponse{
  32151. Header: res.Header,
  32152. HTTPStatusCode: res.StatusCode,
  32153. },
  32154. }
  32155. target := &ret
  32156. if err := gensupport.DecodeResponse(target, res); err != nil {
  32157. return nil, err
  32158. }
  32159. return ret, nil
  32160. // {
  32161. // "description": "Gets one mobile app by ID.",
  32162. // "httpMethod": "GET",
  32163. // "id": "dfareporting.mobileApps.get",
  32164. // "parameterOrder": [
  32165. // "profileId",
  32166. // "id"
  32167. // ],
  32168. // "parameters": {
  32169. // "id": {
  32170. // "description": "Mobile app ID.",
  32171. // "location": "path",
  32172. // "required": true,
  32173. // "type": "string"
  32174. // },
  32175. // "profileId": {
  32176. // "description": "User profile ID associated with this request.",
  32177. // "format": "int64",
  32178. // "location": "path",
  32179. // "required": true,
  32180. // "type": "string"
  32181. // }
  32182. // },
  32183. // "path": "userprofiles/{profileId}/mobileApps/{id}",
  32184. // "response": {
  32185. // "$ref": "MobileApp"
  32186. // },
  32187. // "scopes": [
  32188. // "https://www.googleapis.com/auth/dfatrafficking"
  32189. // ]
  32190. // }
  32191. }
  32192. // method id "dfareporting.mobileApps.list":
  32193. type MobileAppsListCall struct {
  32194. s *Service
  32195. profileId int64
  32196. urlParams_ gensupport.URLParams
  32197. ifNoneMatch_ string
  32198. ctx_ context.Context
  32199. header_ http.Header
  32200. }
  32201. // List: Retrieves list of available mobile apps.
  32202. func (r *MobileAppsService) List(profileId int64) *MobileAppsListCall {
  32203. c := &MobileAppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32204. c.profileId = profileId
  32205. return c
  32206. }
  32207. // Directories sets the optional parameter "directories": Select only
  32208. // apps from these directories.
  32209. //
  32210. // Possible values:
  32211. // "APPLE_APP_STORE"
  32212. // "GOOGLE_PLAY_STORE"
  32213. // "UNKNOWN"
  32214. func (c *MobileAppsListCall) Directories(directories ...string) *MobileAppsListCall {
  32215. c.urlParams_.SetMulti("directories", append([]string{}, directories...))
  32216. return c
  32217. }
  32218. // Ids sets the optional parameter "ids": Select only apps with these
  32219. // IDs.
  32220. func (c *MobileAppsListCall) Ids(ids ...string) *MobileAppsListCall {
  32221. c.urlParams_.SetMulti("ids", append([]string{}, ids...))
  32222. return c
  32223. }
  32224. // MaxResults sets the optional parameter "maxResults": Maximum number
  32225. // of results to return.
  32226. func (c *MobileAppsListCall) MaxResults(maxResults int64) *MobileAppsListCall {
  32227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32228. return c
  32229. }
  32230. // PageToken sets the optional parameter "pageToken": Value of the
  32231. // nextPageToken from the previous result page.
  32232. func (c *MobileAppsListCall) PageToken(pageToken string) *MobileAppsListCall {
  32233. c.urlParams_.Set("pageToken", pageToken)
  32234. return c
  32235. }
  32236. // SearchString sets the optional parameter "searchString": Allows
  32237. // searching for objects by name or ID. Wildcards (*) are allowed. For
  32238. // example, "app*2015" will return objects with names like "app Jan
  32239. // 2018", "app Jan 2018", or simply "app 2018". Most of the searches
  32240. // also add wildcards implicitly at the start and the end of the search
  32241. // string. For example, a search string of "app" will match objects with
  32242. // name "my app", "app 2018", or simply "app".
  32243. func (c *MobileAppsListCall) SearchString(searchString string) *MobileAppsListCall {
  32244. c.urlParams_.Set("searchString", searchString)
  32245. return c
  32246. }
  32247. // Fields allows partial responses to be retrieved. See
  32248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32249. // for more information.
  32250. func (c *MobileAppsListCall) Fields(s ...googleapi.Field) *MobileAppsListCall {
  32251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32252. return c
  32253. }
  32254. // IfNoneMatch sets the optional parameter which makes the operation
  32255. // fail if the object's ETag matches the given value. This is useful for
  32256. // getting updates only after the object has changed since the last
  32257. // request. Use googleapi.IsNotModified to check whether the response
  32258. // error from Do is the result of In-None-Match.
  32259. func (c *MobileAppsListCall) IfNoneMatch(entityTag string) *MobileAppsListCall {
  32260. c.ifNoneMatch_ = entityTag
  32261. return c
  32262. }
  32263. // Context sets the context to be used in this call's Do method. Any
  32264. // pending HTTP request will be aborted if the provided context is
  32265. // canceled.
  32266. func (c *MobileAppsListCall) Context(ctx context.Context) *MobileAppsListCall {
  32267. c.ctx_ = ctx
  32268. return c
  32269. }
  32270. // Header returns an http.Header that can be modified by the caller to
  32271. // add HTTP headers to the request.
  32272. func (c *MobileAppsListCall) Header() http.Header {
  32273. if c.header_ == nil {
  32274. c.header_ = make(http.Header)
  32275. }
  32276. return c.header_
  32277. }
  32278. func (c *MobileAppsListCall) doRequest(alt string) (*http.Response, error) {
  32279. reqHeaders := make(http.Header)
  32280. for k, v := range c.header_ {
  32281. reqHeaders[k] = v
  32282. }
  32283. reqHeaders.Set("User-Agent", c.s.userAgent())
  32284. if c.ifNoneMatch_ != "" {
  32285. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32286. }
  32287. var body io.Reader = nil
  32288. c.urlParams_.Set("alt", alt)
  32289. c.urlParams_.Set("prettyPrint", "false")
  32290. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps")
  32291. urls += "?" + c.urlParams_.Encode()
  32292. req, err := http.NewRequest("GET", urls, body)
  32293. if err != nil {
  32294. return nil, err
  32295. }
  32296. req.Header = reqHeaders
  32297. googleapi.Expand(req.URL, map[string]string{
  32298. "profileId": strconv.FormatInt(c.profileId, 10),
  32299. })
  32300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32301. }
  32302. // Do executes the "dfareporting.mobileApps.list" call.
  32303. // Exactly one of *MobileAppsListResponse or error will be non-nil. Any
  32304. // non-2xx status code is an error. Response headers are in either
  32305. // *MobileAppsListResponse.ServerResponse.Header or (if a response was
  32306. // returned at all) in error.(*googleapi.Error).Header. Use
  32307. // googleapi.IsNotModified to check whether the returned error was
  32308. // because http.StatusNotModified was returned.
  32309. func (c *MobileAppsListCall) Do(opts ...googleapi.CallOption) (*MobileAppsListResponse, error) {
  32310. gensupport.SetOptions(c.urlParams_, opts...)
  32311. res, err := c.doRequest("json")
  32312. if res != nil && res.StatusCode == http.StatusNotModified {
  32313. if res.Body != nil {
  32314. res.Body.Close()
  32315. }
  32316. return nil, &googleapi.Error{
  32317. Code: res.StatusCode,
  32318. Header: res.Header,
  32319. }
  32320. }
  32321. if err != nil {
  32322. return nil, err
  32323. }
  32324. defer googleapi.CloseBody(res)
  32325. if err := googleapi.CheckResponse(res); err != nil {
  32326. return nil, err
  32327. }
  32328. ret := &MobileAppsListResponse{
  32329. ServerResponse: googleapi.ServerResponse{
  32330. Header: res.Header,
  32331. HTTPStatusCode: res.StatusCode,
  32332. },
  32333. }
  32334. target := &ret
  32335. if err := gensupport.DecodeResponse(target, res); err != nil {
  32336. return nil, err
  32337. }
  32338. return ret, nil
  32339. // {
  32340. // "description": "Retrieves list of available mobile apps.",
  32341. // "httpMethod": "GET",
  32342. // "id": "dfareporting.mobileApps.list",
  32343. // "parameterOrder": [
  32344. // "profileId"
  32345. // ],
  32346. // "parameters": {
  32347. // "directories": {
  32348. // "description": "Select only apps from these directories.",
  32349. // "enum": [
  32350. // "APPLE_APP_STORE",
  32351. // "GOOGLE_PLAY_STORE",
  32352. // "UNKNOWN"
  32353. // ],
  32354. // "enumDescriptions": [
  32355. // "",
  32356. // "",
  32357. // ""
  32358. // ],
  32359. // "location": "query",
  32360. // "repeated": true,
  32361. // "type": "string"
  32362. // },
  32363. // "ids": {
  32364. // "description": "Select only apps with these IDs.",
  32365. // "location": "query",
  32366. // "repeated": true,
  32367. // "type": "string"
  32368. // },
  32369. // "maxResults": {
  32370. // "default": "1000",
  32371. // "description": "Maximum number of results to return.",
  32372. // "format": "int32",
  32373. // "location": "query",
  32374. // "maximum": "1000",
  32375. // "minimum": "0",
  32376. // "type": "integer"
  32377. // },
  32378. // "pageToken": {
  32379. // "description": "Value of the nextPageToken from the previous result page.",
  32380. // "location": "query",
  32381. // "type": "string"
  32382. // },
  32383. // "profileId": {
  32384. // "description": "User profile ID associated with this request.",
  32385. // "format": "int64",
  32386. // "location": "path",
  32387. // "required": true,
  32388. // "type": "string"
  32389. // },
  32390. // "searchString": {
  32391. // "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\".",
  32392. // "location": "query",
  32393. // "type": "string"
  32394. // }
  32395. // },
  32396. // "path": "userprofiles/{profileId}/mobileApps",
  32397. // "response": {
  32398. // "$ref": "MobileAppsListResponse"
  32399. // },
  32400. // "scopes": [
  32401. // "https://www.googleapis.com/auth/dfatrafficking"
  32402. // ]
  32403. // }
  32404. }
  32405. // Pages invokes f for each page of results.
  32406. // A non-nil error returned from f will halt the iteration.
  32407. // The provided context supersedes any context provided to the Context method.
  32408. func (c *MobileAppsListCall) Pages(ctx context.Context, f func(*MobileAppsListResponse) error) error {
  32409. c.ctx_ = ctx
  32410. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32411. for {
  32412. x, err := c.Do()
  32413. if err != nil {
  32414. return err
  32415. }
  32416. if err := f(x); err != nil {
  32417. return err
  32418. }
  32419. if x.NextPageToken == "" {
  32420. return nil
  32421. }
  32422. c.PageToken(x.NextPageToken)
  32423. }
  32424. }
  32425. // method id "dfareporting.mobileCarriers.get":
  32426. type MobileCarriersGetCall struct {
  32427. s *Service
  32428. profileId int64
  32429. id int64
  32430. urlParams_ gensupport.URLParams
  32431. ifNoneMatch_ string
  32432. ctx_ context.Context
  32433. header_ http.Header
  32434. }
  32435. // Get: Gets one mobile carrier by ID.
  32436. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  32437. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32438. c.profileId = profileId
  32439. c.id = id
  32440. return c
  32441. }
  32442. // Fields allows partial responses to be retrieved. See
  32443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32444. // for more information.
  32445. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  32446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32447. return c
  32448. }
  32449. // IfNoneMatch sets the optional parameter which makes the operation
  32450. // fail if the object's ETag matches the given value. This is useful for
  32451. // getting updates only after the object has changed since the last
  32452. // request. Use googleapi.IsNotModified to check whether the response
  32453. // error from Do is the result of In-None-Match.
  32454. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  32455. c.ifNoneMatch_ = entityTag
  32456. return c
  32457. }
  32458. // Context sets the context to be used in this call's Do method. Any
  32459. // pending HTTP request will be aborted if the provided context is
  32460. // canceled.
  32461. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  32462. c.ctx_ = ctx
  32463. return c
  32464. }
  32465. // Header returns an http.Header that can be modified by the caller to
  32466. // add HTTP headers to the request.
  32467. func (c *MobileCarriersGetCall) Header() http.Header {
  32468. if c.header_ == nil {
  32469. c.header_ = make(http.Header)
  32470. }
  32471. return c.header_
  32472. }
  32473. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  32474. reqHeaders := make(http.Header)
  32475. for k, v := range c.header_ {
  32476. reqHeaders[k] = v
  32477. }
  32478. reqHeaders.Set("User-Agent", c.s.userAgent())
  32479. if c.ifNoneMatch_ != "" {
  32480. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32481. }
  32482. var body io.Reader = nil
  32483. c.urlParams_.Set("alt", alt)
  32484. c.urlParams_.Set("prettyPrint", "false")
  32485. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  32486. urls += "?" + c.urlParams_.Encode()
  32487. req, err := http.NewRequest("GET", urls, body)
  32488. if err != nil {
  32489. return nil, err
  32490. }
  32491. req.Header = reqHeaders
  32492. googleapi.Expand(req.URL, map[string]string{
  32493. "profileId": strconv.FormatInt(c.profileId, 10),
  32494. "id": strconv.FormatInt(c.id, 10),
  32495. })
  32496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32497. }
  32498. // Do executes the "dfareporting.mobileCarriers.get" call.
  32499. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  32500. // status code is an error. Response headers are in either
  32501. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  32502. // at all) in error.(*googleapi.Error).Header. Use
  32503. // googleapi.IsNotModified to check whether the returned error was
  32504. // because http.StatusNotModified was returned.
  32505. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  32506. gensupport.SetOptions(c.urlParams_, opts...)
  32507. res, err := c.doRequest("json")
  32508. if res != nil && res.StatusCode == http.StatusNotModified {
  32509. if res.Body != nil {
  32510. res.Body.Close()
  32511. }
  32512. return nil, &googleapi.Error{
  32513. Code: res.StatusCode,
  32514. Header: res.Header,
  32515. }
  32516. }
  32517. if err != nil {
  32518. return nil, err
  32519. }
  32520. defer googleapi.CloseBody(res)
  32521. if err := googleapi.CheckResponse(res); err != nil {
  32522. return nil, err
  32523. }
  32524. ret := &MobileCarrier{
  32525. ServerResponse: googleapi.ServerResponse{
  32526. Header: res.Header,
  32527. HTTPStatusCode: res.StatusCode,
  32528. },
  32529. }
  32530. target := &ret
  32531. if err := gensupport.DecodeResponse(target, res); err != nil {
  32532. return nil, err
  32533. }
  32534. return ret, nil
  32535. // {
  32536. // "description": "Gets one mobile carrier by ID.",
  32537. // "httpMethod": "GET",
  32538. // "id": "dfareporting.mobileCarriers.get",
  32539. // "parameterOrder": [
  32540. // "profileId",
  32541. // "id"
  32542. // ],
  32543. // "parameters": {
  32544. // "id": {
  32545. // "description": "Mobile carrier ID.",
  32546. // "format": "int64",
  32547. // "location": "path",
  32548. // "required": true,
  32549. // "type": "string"
  32550. // },
  32551. // "profileId": {
  32552. // "description": "User profile ID associated with this request.",
  32553. // "format": "int64",
  32554. // "location": "path",
  32555. // "required": true,
  32556. // "type": "string"
  32557. // }
  32558. // },
  32559. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  32560. // "response": {
  32561. // "$ref": "MobileCarrier"
  32562. // },
  32563. // "scopes": [
  32564. // "https://www.googleapis.com/auth/dfatrafficking"
  32565. // ]
  32566. // }
  32567. }
  32568. // method id "dfareporting.mobileCarriers.list":
  32569. type MobileCarriersListCall struct {
  32570. s *Service
  32571. profileId int64
  32572. urlParams_ gensupport.URLParams
  32573. ifNoneMatch_ string
  32574. ctx_ context.Context
  32575. header_ http.Header
  32576. }
  32577. // List: Retrieves a list of mobile carriers.
  32578. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  32579. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32580. c.profileId = profileId
  32581. return c
  32582. }
  32583. // Fields allows partial responses to be retrieved. See
  32584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32585. // for more information.
  32586. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  32587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32588. return c
  32589. }
  32590. // IfNoneMatch sets the optional parameter which makes the operation
  32591. // fail if the object's ETag matches the given value. This is useful for
  32592. // getting updates only after the object has changed since the last
  32593. // request. Use googleapi.IsNotModified to check whether the response
  32594. // error from Do is the result of In-None-Match.
  32595. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  32596. c.ifNoneMatch_ = entityTag
  32597. return c
  32598. }
  32599. // Context sets the context to be used in this call's Do method. Any
  32600. // pending HTTP request will be aborted if the provided context is
  32601. // canceled.
  32602. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  32603. c.ctx_ = ctx
  32604. return c
  32605. }
  32606. // Header returns an http.Header that can be modified by the caller to
  32607. // add HTTP headers to the request.
  32608. func (c *MobileCarriersListCall) Header() http.Header {
  32609. if c.header_ == nil {
  32610. c.header_ = make(http.Header)
  32611. }
  32612. return c.header_
  32613. }
  32614. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  32615. reqHeaders := make(http.Header)
  32616. for k, v := range c.header_ {
  32617. reqHeaders[k] = v
  32618. }
  32619. reqHeaders.Set("User-Agent", c.s.userAgent())
  32620. if c.ifNoneMatch_ != "" {
  32621. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32622. }
  32623. var body io.Reader = nil
  32624. c.urlParams_.Set("alt", alt)
  32625. c.urlParams_.Set("prettyPrint", "false")
  32626. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  32627. urls += "?" + c.urlParams_.Encode()
  32628. req, err := http.NewRequest("GET", urls, body)
  32629. if err != nil {
  32630. return nil, err
  32631. }
  32632. req.Header = reqHeaders
  32633. googleapi.Expand(req.URL, map[string]string{
  32634. "profileId": strconv.FormatInt(c.profileId, 10),
  32635. })
  32636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32637. }
  32638. // Do executes the "dfareporting.mobileCarriers.list" call.
  32639. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  32640. // Any non-2xx status code is an error. Response headers are in either
  32641. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  32642. // was returned at all) in error.(*googleapi.Error).Header. Use
  32643. // googleapi.IsNotModified to check whether the returned error was
  32644. // because http.StatusNotModified was returned.
  32645. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  32646. gensupport.SetOptions(c.urlParams_, opts...)
  32647. res, err := c.doRequest("json")
  32648. if res != nil && res.StatusCode == http.StatusNotModified {
  32649. if res.Body != nil {
  32650. res.Body.Close()
  32651. }
  32652. return nil, &googleapi.Error{
  32653. Code: res.StatusCode,
  32654. Header: res.Header,
  32655. }
  32656. }
  32657. if err != nil {
  32658. return nil, err
  32659. }
  32660. defer googleapi.CloseBody(res)
  32661. if err := googleapi.CheckResponse(res); err != nil {
  32662. return nil, err
  32663. }
  32664. ret := &MobileCarriersListResponse{
  32665. ServerResponse: googleapi.ServerResponse{
  32666. Header: res.Header,
  32667. HTTPStatusCode: res.StatusCode,
  32668. },
  32669. }
  32670. target := &ret
  32671. if err := gensupport.DecodeResponse(target, res); err != nil {
  32672. return nil, err
  32673. }
  32674. return ret, nil
  32675. // {
  32676. // "description": "Retrieves a list of mobile carriers.",
  32677. // "httpMethod": "GET",
  32678. // "id": "dfareporting.mobileCarriers.list",
  32679. // "parameterOrder": [
  32680. // "profileId"
  32681. // ],
  32682. // "parameters": {
  32683. // "profileId": {
  32684. // "description": "User profile ID associated with this request.",
  32685. // "format": "int64",
  32686. // "location": "path",
  32687. // "required": true,
  32688. // "type": "string"
  32689. // }
  32690. // },
  32691. // "path": "userprofiles/{profileId}/mobileCarriers",
  32692. // "response": {
  32693. // "$ref": "MobileCarriersListResponse"
  32694. // },
  32695. // "scopes": [
  32696. // "https://www.googleapis.com/auth/dfatrafficking"
  32697. // ]
  32698. // }
  32699. }
  32700. // method id "dfareporting.operatingSystemVersions.get":
  32701. type OperatingSystemVersionsGetCall struct {
  32702. s *Service
  32703. profileId int64
  32704. id int64
  32705. urlParams_ gensupport.URLParams
  32706. ifNoneMatch_ string
  32707. ctx_ context.Context
  32708. header_ http.Header
  32709. }
  32710. // Get: Gets one operating system version by ID.
  32711. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  32712. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32713. c.profileId = profileId
  32714. c.id = id
  32715. return c
  32716. }
  32717. // Fields allows partial responses to be retrieved. See
  32718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32719. // for more information.
  32720. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  32721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32722. return c
  32723. }
  32724. // IfNoneMatch sets the optional parameter which makes the operation
  32725. // fail if the object's ETag matches the given value. This is useful for
  32726. // getting updates only after the object has changed since the last
  32727. // request. Use googleapi.IsNotModified to check whether the response
  32728. // error from Do is the result of In-None-Match.
  32729. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  32730. c.ifNoneMatch_ = entityTag
  32731. return c
  32732. }
  32733. // Context sets the context to be used in this call's Do method. Any
  32734. // pending HTTP request will be aborted if the provided context is
  32735. // canceled.
  32736. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  32737. c.ctx_ = ctx
  32738. return c
  32739. }
  32740. // Header returns an http.Header that can be modified by the caller to
  32741. // add HTTP headers to the request.
  32742. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  32743. if c.header_ == nil {
  32744. c.header_ = make(http.Header)
  32745. }
  32746. return c.header_
  32747. }
  32748. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  32749. reqHeaders := make(http.Header)
  32750. for k, v := range c.header_ {
  32751. reqHeaders[k] = v
  32752. }
  32753. reqHeaders.Set("User-Agent", c.s.userAgent())
  32754. if c.ifNoneMatch_ != "" {
  32755. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32756. }
  32757. var body io.Reader = nil
  32758. c.urlParams_.Set("alt", alt)
  32759. c.urlParams_.Set("prettyPrint", "false")
  32760. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  32761. urls += "?" + c.urlParams_.Encode()
  32762. req, err := http.NewRequest("GET", urls, body)
  32763. if err != nil {
  32764. return nil, err
  32765. }
  32766. req.Header = reqHeaders
  32767. googleapi.Expand(req.URL, map[string]string{
  32768. "profileId": strconv.FormatInt(c.profileId, 10),
  32769. "id": strconv.FormatInt(c.id, 10),
  32770. })
  32771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32772. }
  32773. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  32774. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  32775. // non-2xx status code is an error. Response headers are in either
  32776. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  32777. // returned at all) in error.(*googleapi.Error).Header. Use
  32778. // googleapi.IsNotModified to check whether the returned error was
  32779. // because http.StatusNotModified was returned.
  32780. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  32781. gensupport.SetOptions(c.urlParams_, opts...)
  32782. res, err := c.doRequest("json")
  32783. if res != nil && res.StatusCode == http.StatusNotModified {
  32784. if res.Body != nil {
  32785. res.Body.Close()
  32786. }
  32787. return nil, &googleapi.Error{
  32788. Code: res.StatusCode,
  32789. Header: res.Header,
  32790. }
  32791. }
  32792. if err != nil {
  32793. return nil, err
  32794. }
  32795. defer googleapi.CloseBody(res)
  32796. if err := googleapi.CheckResponse(res); err != nil {
  32797. return nil, err
  32798. }
  32799. ret := &OperatingSystemVersion{
  32800. ServerResponse: googleapi.ServerResponse{
  32801. Header: res.Header,
  32802. HTTPStatusCode: res.StatusCode,
  32803. },
  32804. }
  32805. target := &ret
  32806. if err := gensupport.DecodeResponse(target, res); err != nil {
  32807. return nil, err
  32808. }
  32809. return ret, nil
  32810. // {
  32811. // "description": "Gets one operating system version by ID.",
  32812. // "httpMethod": "GET",
  32813. // "id": "dfareporting.operatingSystemVersions.get",
  32814. // "parameterOrder": [
  32815. // "profileId",
  32816. // "id"
  32817. // ],
  32818. // "parameters": {
  32819. // "id": {
  32820. // "description": "Operating system version ID.",
  32821. // "format": "int64",
  32822. // "location": "path",
  32823. // "required": true,
  32824. // "type": "string"
  32825. // },
  32826. // "profileId": {
  32827. // "description": "User profile ID associated with this request.",
  32828. // "format": "int64",
  32829. // "location": "path",
  32830. // "required": true,
  32831. // "type": "string"
  32832. // }
  32833. // },
  32834. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  32835. // "response": {
  32836. // "$ref": "OperatingSystemVersion"
  32837. // },
  32838. // "scopes": [
  32839. // "https://www.googleapis.com/auth/dfatrafficking"
  32840. // ]
  32841. // }
  32842. }
  32843. // method id "dfareporting.operatingSystemVersions.list":
  32844. type OperatingSystemVersionsListCall struct {
  32845. s *Service
  32846. profileId int64
  32847. urlParams_ gensupport.URLParams
  32848. ifNoneMatch_ string
  32849. ctx_ context.Context
  32850. header_ http.Header
  32851. }
  32852. // List: Retrieves a list of operating system versions.
  32853. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  32854. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32855. c.profileId = profileId
  32856. return c
  32857. }
  32858. // Fields allows partial responses to be retrieved. See
  32859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32860. // for more information.
  32861. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  32862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32863. return c
  32864. }
  32865. // IfNoneMatch sets the optional parameter which makes the operation
  32866. // fail if the object's ETag matches the given value. This is useful for
  32867. // getting updates only after the object has changed since the last
  32868. // request. Use googleapi.IsNotModified to check whether the response
  32869. // error from Do is the result of In-None-Match.
  32870. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  32871. c.ifNoneMatch_ = entityTag
  32872. return c
  32873. }
  32874. // Context sets the context to be used in this call's Do method. Any
  32875. // pending HTTP request will be aborted if the provided context is
  32876. // canceled.
  32877. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  32878. c.ctx_ = ctx
  32879. return c
  32880. }
  32881. // Header returns an http.Header that can be modified by the caller to
  32882. // add HTTP headers to the request.
  32883. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  32884. if c.header_ == nil {
  32885. c.header_ = make(http.Header)
  32886. }
  32887. return c.header_
  32888. }
  32889. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  32890. reqHeaders := make(http.Header)
  32891. for k, v := range c.header_ {
  32892. reqHeaders[k] = v
  32893. }
  32894. reqHeaders.Set("User-Agent", c.s.userAgent())
  32895. if c.ifNoneMatch_ != "" {
  32896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32897. }
  32898. var body io.Reader = nil
  32899. c.urlParams_.Set("alt", alt)
  32900. c.urlParams_.Set("prettyPrint", "false")
  32901. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  32902. urls += "?" + c.urlParams_.Encode()
  32903. req, err := http.NewRequest("GET", urls, body)
  32904. if err != nil {
  32905. return nil, err
  32906. }
  32907. req.Header = reqHeaders
  32908. googleapi.Expand(req.URL, map[string]string{
  32909. "profileId": strconv.FormatInt(c.profileId, 10),
  32910. })
  32911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32912. }
  32913. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  32914. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  32915. // non-nil. Any non-2xx status code is an error. Response headers are in
  32916. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  32917. // (if a response was returned at all) in
  32918. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  32919. // whether the returned error was because http.StatusNotModified was
  32920. // returned.
  32921. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  32922. gensupport.SetOptions(c.urlParams_, opts...)
  32923. res, err := c.doRequest("json")
  32924. if res != nil && res.StatusCode == http.StatusNotModified {
  32925. if res.Body != nil {
  32926. res.Body.Close()
  32927. }
  32928. return nil, &googleapi.Error{
  32929. Code: res.StatusCode,
  32930. Header: res.Header,
  32931. }
  32932. }
  32933. if err != nil {
  32934. return nil, err
  32935. }
  32936. defer googleapi.CloseBody(res)
  32937. if err := googleapi.CheckResponse(res); err != nil {
  32938. return nil, err
  32939. }
  32940. ret := &OperatingSystemVersionsListResponse{
  32941. ServerResponse: googleapi.ServerResponse{
  32942. Header: res.Header,
  32943. HTTPStatusCode: res.StatusCode,
  32944. },
  32945. }
  32946. target := &ret
  32947. if err := gensupport.DecodeResponse(target, res); err != nil {
  32948. return nil, err
  32949. }
  32950. return ret, nil
  32951. // {
  32952. // "description": "Retrieves a list of operating system versions.",
  32953. // "httpMethod": "GET",
  32954. // "id": "dfareporting.operatingSystemVersions.list",
  32955. // "parameterOrder": [
  32956. // "profileId"
  32957. // ],
  32958. // "parameters": {
  32959. // "profileId": {
  32960. // "description": "User profile ID associated with this request.",
  32961. // "format": "int64",
  32962. // "location": "path",
  32963. // "required": true,
  32964. // "type": "string"
  32965. // }
  32966. // },
  32967. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  32968. // "response": {
  32969. // "$ref": "OperatingSystemVersionsListResponse"
  32970. // },
  32971. // "scopes": [
  32972. // "https://www.googleapis.com/auth/dfatrafficking"
  32973. // ]
  32974. // }
  32975. }
  32976. // method id "dfareporting.operatingSystems.get":
  32977. type OperatingSystemsGetCall struct {
  32978. s *Service
  32979. profileId int64
  32980. dartId int64
  32981. urlParams_ gensupport.URLParams
  32982. ifNoneMatch_ string
  32983. ctx_ context.Context
  32984. header_ http.Header
  32985. }
  32986. // Get: Gets one operating system by DART ID.
  32987. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  32988. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32989. c.profileId = profileId
  32990. c.dartId = dartId
  32991. return c
  32992. }
  32993. // Fields allows partial responses to be retrieved. See
  32994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32995. // for more information.
  32996. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  32997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32998. return c
  32999. }
  33000. // IfNoneMatch sets the optional parameter which makes the operation
  33001. // fail if the object's ETag matches the given value. This is useful for
  33002. // getting updates only after the object has changed since the last
  33003. // request. Use googleapi.IsNotModified to check whether the response
  33004. // error from Do is the result of In-None-Match.
  33005. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  33006. c.ifNoneMatch_ = entityTag
  33007. return c
  33008. }
  33009. // Context sets the context to be used in this call's Do method. Any
  33010. // pending HTTP request will be aborted if the provided context is
  33011. // canceled.
  33012. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  33013. c.ctx_ = ctx
  33014. return c
  33015. }
  33016. // Header returns an http.Header that can be modified by the caller to
  33017. // add HTTP headers to the request.
  33018. func (c *OperatingSystemsGetCall) Header() http.Header {
  33019. if c.header_ == nil {
  33020. c.header_ = make(http.Header)
  33021. }
  33022. return c.header_
  33023. }
  33024. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  33025. reqHeaders := make(http.Header)
  33026. for k, v := range c.header_ {
  33027. reqHeaders[k] = v
  33028. }
  33029. reqHeaders.Set("User-Agent", c.s.userAgent())
  33030. if c.ifNoneMatch_ != "" {
  33031. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33032. }
  33033. var body io.Reader = nil
  33034. c.urlParams_.Set("alt", alt)
  33035. c.urlParams_.Set("prettyPrint", "false")
  33036. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  33037. urls += "?" + c.urlParams_.Encode()
  33038. req, err := http.NewRequest("GET", urls, body)
  33039. if err != nil {
  33040. return nil, err
  33041. }
  33042. req.Header = reqHeaders
  33043. googleapi.Expand(req.URL, map[string]string{
  33044. "profileId": strconv.FormatInt(c.profileId, 10),
  33045. "dartId": strconv.FormatInt(c.dartId, 10),
  33046. })
  33047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33048. }
  33049. // Do executes the "dfareporting.operatingSystems.get" call.
  33050. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  33051. // status code is an error. Response headers are in either
  33052. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  33053. // at all) in error.(*googleapi.Error).Header. Use
  33054. // googleapi.IsNotModified to check whether the returned error was
  33055. // because http.StatusNotModified was returned.
  33056. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  33057. gensupport.SetOptions(c.urlParams_, opts...)
  33058. res, err := c.doRequest("json")
  33059. if res != nil && res.StatusCode == http.StatusNotModified {
  33060. if res.Body != nil {
  33061. res.Body.Close()
  33062. }
  33063. return nil, &googleapi.Error{
  33064. Code: res.StatusCode,
  33065. Header: res.Header,
  33066. }
  33067. }
  33068. if err != nil {
  33069. return nil, err
  33070. }
  33071. defer googleapi.CloseBody(res)
  33072. if err := googleapi.CheckResponse(res); err != nil {
  33073. return nil, err
  33074. }
  33075. ret := &OperatingSystem{
  33076. ServerResponse: googleapi.ServerResponse{
  33077. Header: res.Header,
  33078. HTTPStatusCode: res.StatusCode,
  33079. },
  33080. }
  33081. target := &ret
  33082. if err := gensupport.DecodeResponse(target, res); err != nil {
  33083. return nil, err
  33084. }
  33085. return ret, nil
  33086. // {
  33087. // "description": "Gets one operating system by DART ID.",
  33088. // "httpMethod": "GET",
  33089. // "id": "dfareporting.operatingSystems.get",
  33090. // "parameterOrder": [
  33091. // "profileId",
  33092. // "dartId"
  33093. // ],
  33094. // "parameters": {
  33095. // "dartId": {
  33096. // "description": "Operating system DART ID.",
  33097. // "format": "int64",
  33098. // "location": "path",
  33099. // "required": true,
  33100. // "type": "string"
  33101. // },
  33102. // "profileId": {
  33103. // "description": "User profile ID associated with this request.",
  33104. // "format": "int64",
  33105. // "location": "path",
  33106. // "required": true,
  33107. // "type": "string"
  33108. // }
  33109. // },
  33110. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  33111. // "response": {
  33112. // "$ref": "OperatingSystem"
  33113. // },
  33114. // "scopes": [
  33115. // "https://www.googleapis.com/auth/dfatrafficking"
  33116. // ]
  33117. // }
  33118. }
  33119. // method id "dfareporting.operatingSystems.list":
  33120. type OperatingSystemsListCall struct {
  33121. s *Service
  33122. profileId int64
  33123. urlParams_ gensupport.URLParams
  33124. ifNoneMatch_ string
  33125. ctx_ context.Context
  33126. header_ http.Header
  33127. }
  33128. // List: Retrieves a list of operating systems.
  33129. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  33130. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33131. c.profileId = profileId
  33132. return c
  33133. }
  33134. // Fields allows partial responses to be retrieved. See
  33135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33136. // for more information.
  33137. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  33138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33139. return c
  33140. }
  33141. // IfNoneMatch sets the optional parameter which makes the operation
  33142. // fail if the object's ETag matches the given value. This is useful for
  33143. // getting updates only after the object has changed since the last
  33144. // request. Use googleapi.IsNotModified to check whether the response
  33145. // error from Do is the result of In-None-Match.
  33146. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  33147. c.ifNoneMatch_ = entityTag
  33148. return c
  33149. }
  33150. // Context sets the context to be used in this call's Do method. Any
  33151. // pending HTTP request will be aborted if the provided context is
  33152. // canceled.
  33153. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  33154. c.ctx_ = ctx
  33155. return c
  33156. }
  33157. // Header returns an http.Header that can be modified by the caller to
  33158. // add HTTP headers to the request.
  33159. func (c *OperatingSystemsListCall) Header() http.Header {
  33160. if c.header_ == nil {
  33161. c.header_ = make(http.Header)
  33162. }
  33163. return c.header_
  33164. }
  33165. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  33166. reqHeaders := make(http.Header)
  33167. for k, v := range c.header_ {
  33168. reqHeaders[k] = v
  33169. }
  33170. reqHeaders.Set("User-Agent", c.s.userAgent())
  33171. if c.ifNoneMatch_ != "" {
  33172. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33173. }
  33174. var body io.Reader = nil
  33175. c.urlParams_.Set("alt", alt)
  33176. c.urlParams_.Set("prettyPrint", "false")
  33177. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  33178. urls += "?" + c.urlParams_.Encode()
  33179. req, err := http.NewRequest("GET", urls, body)
  33180. if err != nil {
  33181. return nil, err
  33182. }
  33183. req.Header = reqHeaders
  33184. googleapi.Expand(req.URL, map[string]string{
  33185. "profileId": strconv.FormatInt(c.profileId, 10),
  33186. })
  33187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33188. }
  33189. // Do executes the "dfareporting.operatingSystems.list" call.
  33190. // Exactly one of *OperatingSystemsListResponse or error will be
  33191. // non-nil. Any non-2xx status code is an error. Response headers are in
  33192. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  33193. // response was returned at all) in error.(*googleapi.Error).Header. Use
  33194. // googleapi.IsNotModified to check whether the returned error was
  33195. // because http.StatusNotModified was returned.
  33196. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  33197. gensupport.SetOptions(c.urlParams_, opts...)
  33198. res, err := c.doRequest("json")
  33199. if res != nil && res.StatusCode == http.StatusNotModified {
  33200. if res.Body != nil {
  33201. res.Body.Close()
  33202. }
  33203. return nil, &googleapi.Error{
  33204. Code: res.StatusCode,
  33205. Header: res.Header,
  33206. }
  33207. }
  33208. if err != nil {
  33209. return nil, err
  33210. }
  33211. defer googleapi.CloseBody(res)
  33212. if err := googleapi.CheckResponse(res); err != nil {
  33213. return nil, err
  33214. }
  33215. ret := &OperatingSystemsListResponse{
  33216. ServerResponse: googleapi.ServerResponse{
  33217. Header: res.Header,
  33218. HTTPStatusCode: res.StatusCode,
  33219. },
  33220. }
  33221. target := &ret
  33222. if err := gensupport.DecodeResponse(target, res); err != nil {
  33223. return nil, err
  33224. }
  33225. return ret, nil
  33226. // {
  33227. // "description": "Retrieves a list of operating systems.",
  33228. // "httpMethod": "GET",
  33229. // "id": "dfareporting.operatingSystems.list",
  33230. // "parameterOrder": [
  33231. // "profileId"
  33232. // ],
  33233. // "parameters": {
  33234. // "profileId": {
  33235. // "description": "User profile ID associated with this request.",
  33236. // "format": "int64",
  33237. // "location": "path",
  33238. // "required": true,
  33239. // "type": "string"
  33240. // }
  33241. // },
  33242. // "path": "userprofiles/{profileId}/operatingSystems",
  33243. // "response": {
  33244. // "$ref": "OperatingSystemsListResponse"
  33245. // },
  33246. // "scopes": [
  33247. // "https://www.googleapis.com/auth/dfatrafficking"
  33248. // ]
  33249. // }
  33250. }
  33251. // method id "dfareporting.orderDocuments.get":
  33252. type OrderDocumentsGetCall struct {
  33253. s *Service
  33254. profileId int64
  33255. projectId int64
  33256. id int64
  33257. urlParams_ gensupport.URLParams
  33258. ifNoneMatch_ string
  33259. ctx_ context.Context
  33260. header_ http.Header
  33261. }
  33262. // Get: Gets one order document by ID.
  33263. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  33264. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33265. c.profileId = profileId
  33266. c.projectId = projectId
  33267. c.id = id
  33268. return c
  33269. }
  33270. // Fields allows partial responses to be retrieved. See
  33271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33272. // for more information.
  33273. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  33274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33275. return c
  33276. }
  33277. // IfNoneMatch sets the optional parameter which makes the operation
  33278. // fail if the object's ETag matches the given value. This is useful for
  33279. // getting updates only after the object has changed since the last
  33280. // request. Use googleapi.IsNotModified to check whether the response
  33281. // error from Do is the result of In-None-Match.
  33282. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  33283. c.ifNoneMatch_ = entityTag
  33284. return c
  33285. }
  33286. // Context sets the context to be used in this call's Do method. Any
  33287. // pending HTTP request will be aborted if the provided context is
  33288. // canceled.
  33289. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  33290. c.ctx_ = ctx
  33291. return c
  33292. }
  33293. // Header returns an http.Header that can be modified by the caller to
  33294. // add HTTP headers to the request.
  33295. func (c *OrderDocumentsGetCall) Header() http.Header {
  33296. if c.header_ == nil {
  33297. c.header_ = make(http.Header)
  33298. }
  33299. return c.header_
  33300. }
  33301. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  33302. reqHeaders := make(http.Header)
  33303. for k, v := range c.header_ {
  33304. reqHeaders[k] = v
  33305. }
  33306. reqHeaders.Set("User-Agent", c.s.userAgent())
  33307. if c.ifNoneMatch_ != "" {
  33308. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33309. }
  33310. var body io.Reader = nil
  33311. c.urlParams_.Set("alt", alt)
  33312. c.urlParams_.Set("prettyPrint", "false")
  33313. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  33314. urls += "?" + c.urlParams_.Encode()
  33315. req, err := http.NewRequest("GET", urls, body)
  33316. if err != nil {
  33317. return nil, err
  33318. }
  33319. req.Header = reqHeaders
  33320. googleapi.Expand(req.URL, map[string]string{
  33321. "profileId": strconv.FormatInt(c.profileId, 10),
  33322. "projectId": strconv.FormatInt(c.projectId, 10),
  33323. "id": strconv.FormatInt(c.id, 10),
  33324. })
  33325. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33326. }
  33327. // Do executes the "dfareporting.orderDocuments.get" call.
  33328. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  33329. // status code is an error. Response headers are in either
  33330. // *OrderDocument.ServerResponse.Header or (if a response was returned
  33331. // at all) in error.(*googleapi.Error).Header. Use
  33332. // googleapi.IsNotModified to check whether the returned error was
  33333. // because http.StatusNotModified was returned.
  33334. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  33335. gensupport.SetOptions(c.urlParams_, opts...)
  33336. res, err := c.doRequest("json")
  33337. if res != nil && res.StatusCode == http.StatusNotModified {
  33338. if res.Body != nil {
  33339. res.Body.Close()
  33340. }
  33341. return nil, &googleapi.Error{
  33342. Code: res.StatusCode,
  33343. Header: res.Header,
  33344. }
  33345. }
  33346. if err != nil {
  33347. return nil, err
  33348. }
  33349. defer googleapi.CloseBody(res)
  33350. if err := googleapi.CheckResponse(res); err != nil {
  33351. return nil, err
  33352. }
  33353. ret := &OrderDocument{
  33354. ServerResponse: googleapi.ServerResponse{
  33355. Header: res.Header,
  33356. HTTPStatusCode: res.StatusCode,
  33357. },
  33358. }
  33359. target := &ret
  33360. if err := gensupport.DecodeResponse(target, res); err != nil {
  33361. return nil, err
  33362. }
  33363. return ret, nil
  33364. // {
  33365. // "description": "Gets one order document by ID.",
  33366. // "httpMethod": "GET",
  33367. // "id": "dfareporting.orderDocuments.get",
  33368. // "parameterOrder": [
  33369. // "profileId",
  33370. // "projectId",
  33371. // "id"
  33372. // ],
  33373. // "parameters": {
  33374. // "id": {
  33375. // "description": "Order document ID.",
  33376. // "format": "int64",
  33377. // "location": "path",
  33378. // "required": true,
  33379. // "type": "string"
  33380. // },
  33381. // "profileId": {
  33382. // "description": "User profile ID associated with this request.",
  33383. // "format": "int64",
  33384. // "location": "path",
  33385. // "required": true,
  33386. // "type": "string"
  33387. // },
  33388. // "projectId": {
  33389. // "description": "Project ID for order documents.",
  33390. // "format": "int64",
  33391. // "location": "path",
  33392. // "required": true,
  33393. // "type": "string"
  33394. // }
  33395. // },
  33396. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  33397. // "response": {
  33398. // "$ref": "OrderDocument"
  33399. // },
  33400. // "scopes": [
  33401. // "https://www.googleapis.com/auth/dfatrafficking"
  33402. // ]
  33403. // }
  33404. }
  33405. // method id "dfareporting.orderDocuments.list":
  33406. type OrderDocumentsListCall struct {
  33407. s *Service
  33408. profileId int64
  33409. projectId int64
  33410. urlParams_ gensupport.URLParams
  33411. ifNoneMatch_ string
  33412. ctx_ context.Context
  33413. header_ http.Header
  33414. }
  33415. // List: Retrieves a list of order documents, possibly filtered. This
  33416. // method supports paging.
  33417. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  33418. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33419. c.profileId = profileId
  33420. c.projectId = projectId
  33421. return c
  33422. }
  33423. // Approved sets the optional parameter "approved": Select only order
  33424. // documents that have been approved by at least one user.
  33425. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  33426. c.urlParams_.Set("approved", fmt.Sprint(approved))
  33427. return c
  33428. }
  33429. // Ids sets the optional parameter "ids": Select only order documents
  33430. // with these IDs.
  33431. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  33432. var ids_ []string
  33433. for _, v := range ids {
  33434. ids_ = append(ids_, fmt.Sprint(v))
  33435. }
  33436. c.urlParams_.SetMulti("ids", ids_)
  33437. return c
  33438. }
  33439. // MaxResults sets the optional parameter "maxResults": Maximum number
  33440. // of results to return.
  33441. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  33442. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33443. return c
  33444. }
  33445. // OrderId sets the optional parameter "orderId": Select only order
  33446. // documents for specified orders.
  33447. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  33448. var orderId_ []string
  33449. for _, v := range orderId {
  33450. orderId_ = append(orderId_, fmt.Sprint(v))
  33451. }
  33452. c.urlParams_.SetMulti("orderId", orderId_)
  33453. return c
  33454. }
  33455. // PageToken sets the optional parameter "pageToken": Value of the
  33456. // nextPageToken from the previous result page.
  33457. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  33458. c.urlParams_.Set("pageToken", pageToken)
  33459. return c
  33460. }
  33461. // SearchString sets the optional parameter "searchString": Allows
  33462. // searching for order documents by name or ID. Wildcards (*) are
  33463. // allowed. For example, "orderdocument*2015" will return order
  33464. // documents with names like "orderdocument June 2015", "orderdocument
  33465. // April 2015", or simply "orderdocument 2015". Most of the searches
  33466. // also add wildcards implicitly at the start and the end of the search
  33467. // string. For example, a search string of "orderdocument" will match
  33468. // order documents with name "my orderdocument", "orderdocument 2015",
  33469. // or simply "orderdocument".
  33470. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  33471. c.urlParams_.Set("searchString", searchString)
  33472. return c
  33473. }
  33474. // SiteId sets the optional parameter "siteId": Select only order
  33475. // documents that are associated with these sites.
  33476. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  33477. var siteId_ []string
  33478. for _, v := range siteId {
  33479. siteId_ = append(siteId_, fmt.Sprint(v))
  33480. }
  33481. c.urlParams_.SetMulti("siteId", siteId_)
  33482. return c
  33483. }
  33484. // SortField sets the optional parameter "sortField": Field by which to
  33485. // sort the list.
  33486. //
  33487. // Possible values:
  33488. // "ID" (default)
  33489. // "NAME"
  33490. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  33491. c.urlParams_.Set("sortField", sortField)
  33492. return c
  33493. }
  33494. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33495. // results.
  33496. //
  33497. // Possible values:
  33498. // "ASCENDING" (default)
  33499. // "DESCENDING"
  33500. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  33501. c.urlParams_.Set("sortOrder", sortOrder)
  33502. return c
  33503. }
  33504. // Fields allows partial responses to be retrieved. See
  33505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33506. // for more information.
  33507. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  33508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33509. return c
  33510. }
  33511. // IfNoneMatch sets the optional parameter which makes the operation
  33512. // fail if the object's ETag matches the given value. This is useful for
  33513. // getting updates only after the object has changed since the last
  33514. // request. Use googleapi.IsNotModified to check whether the response
  33515. // error from Do is the result of In-None-Match.
  33516. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  33517. c.ifNoneMatch_ = entityTag
  33518. return c
  33519. }
  33520. // Context sets the context to be used in this call's Do method. Any
  33521. // pending HTTP request will be aborted if the provided context is
  33522. // canceled.
  33523. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  33524. c.ctx_ = ctx
  33525. return c
  33526. }
  33527. // Header returns an http.Header that can be modified by the caller to
  33528. // add HTTP headers to the request.
  33529. func (c *OrderDocumentsListCall) Header() http.Header {
  33530. if c.header_ == nil {
  33531. c.header_ = make(http.Header)
  33532. }
  33533. return c.header_
  33534. }
  33535. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  33536. reqHeaders := make(http.Header)
  33537. for k, v := range c.header_ {
  33538. reqHeaders[k] = v
  33539. }
  33540. reqHeaders.Set("User-Agent", c.s.userAgent())
  33541. if c.ifNoneMatch_ != "" {
  33542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33543. }
  33544. var body io.Reader = nil
  33545. c.urlParams_.Set("alt", alt)
  33546. c.urlParams_.Set("prettyPrint", "false")
  33547. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  33548. urls += "?" + c.urlParams_.Encode()
  33549. req, err := http.NewRequest("GET", urls, body)
  33550. if err != nil {
  33551. return nil, err
  33552. }
  33553. req.Header = reqHeaders
  33554. googleapi.Expand(req.URL, map[string]string{
  33555. "profileId": strconv.FormatInt(c.profileId, 10),
  33556. "projectId": strconv.FormatInt(c.projectId, 10),
  33557. })
  33558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33559. }
  33560. // Do executes the "dfareporting.orderDocuments.list" call.
  33561. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  33562. // Any non-2xx status code is an error. Response headers are in either
  33563. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  33564. // was returned at all) in error.(*googleapi.Error).Header. Use
  33565. // googleapi.IsNotModified to check whether the returned error was
  33566. // because http.StatusNotModified was returned.
  33567. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  33568. gensupport.SetOptions(c.urlParams_, opts...)
  33569. res, err := c.doRequest("json")
  33570. if res != nil && res.StatusCode == http.StatusNotModified {
  33571. if res.Body != nil {
  33572. res.Body.Close()
  33573. }
  33574. return nil, &googleapi.Error{
  33575. Code: res.StatusCode,
  33576. Header: res.Header,
  33577. }
  33578. }
  33579. if err != nil {
  33580. return nil, err
  33581. }
  33582. defer googleapi.CloseBody(res)
  33583. if err := googleapi.CheckResponse(res); err != nil {
  33584. return nil, err
  33585. }
  33586. ret := &OrderDocumentsListResponse{
  33587. ServerResponse: googleapi.ServerResponse{
  33588. Header: res.Header,
  33589. HTTPStatusCode: res.StatusCode,
  33590. },
  33591. }
  33592. target := &ret
  33593. if err := gensupport.DecodeResponse(target, res); err != nil {
  33594. return nil, err
  33595. }
  33596. return ret, nil
  33597. // {
  33598. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  33599. // "httpMethod": "GET",
  33600. // "id": "dfareporting.orderDocuments.list",
  33601. // "parameterOrder": [
  33602. // "profileId",
  33603. // "projectId"
  33604. // ],
  33605. // "parameters": {
  33606. // "approved": {
  33607. // "description": "Select only order documents that have been approved by at least one user.",
  33608. // "location": "query",
  33609. // "type": "boolean"
  33610. // },
  33611. // "ids": {
  33612. // "description": "Select only order documents with these IDs.",
  33613. // "format": "int64",
  33614. // "location": "query",
  33615. // "repeated": true,
  33616. // "type": "string"
  33617. // },
  33618. // "maxResults": {
  33619. // "default": "1000",
  33620. // "description": "Maximum number of results to return.",
  33621. // "format": "int32",
  33622. // "location": "query",
  33623. // "maximum": "1000",
  33624. // "minimum": "0",
  33625. // "type": "integer"
  33626. // },
  33627. // "orderId": {
  33628. // "description": "Select only order documents for specified orders.",
  33629. // "format": "int64",
  33630. // "location": "query",
  33631. // "repeated": true,
  33632. // "type": "string"
  33633. // },
  33634. // "pageToken": {
  33635. // "description": "Value of the nextPageToken from the previous result page.",
  33636. // "location": "query",
  33637. // "type": "string"
  33638. // },
  33639. // "profileId": {
  33640. // "description": "User profile ID associated with this request.",
  33641. // "format": "int64",
  33642. // "location": "path",
  33643. // "required": true,
  33644. // "type": "string"
  33645. // },
  33646. // "projectId": {
  33647. // "description": "Project ID for order documents.",
  33648. // "format": "int64",
  33649. // "location": "path",
  33650. // "required": true,
  33651. // "type": "string"
  33652. // },
  33653. // "searchString": {
  33654. // "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\".",
  33655. // "location": "query",
  33656. // "type": "string"
  33657. // },
  33658. // "siteId": {
  33659. // "description": "Select only order documents that are associated with these sites.",
  33660. // "format": "int64",
  33661. // "location": "query",
  33662. // "repeated": true,
  33663. // "type": "string"
  33664. // },
  33665. // "sortField": {
  33666. // "default": "ID",
  33667. // "description": "Field by which to sort the list.",
  33668. // "enum": [
  33669. // "ID",
  33670. // "NAME"
  33671. // ],
  33672. // "enumDescriptions": [
  33673. // "",
  33674. // ""
  33675. // ],
  33676. // "location": "query",
  33677. // "type": "string"
  33678. // },
  33679. // "sortOrder": {
  33680. // "default": "ASCENDING",
  33681. // "description": "Order of sorted results.",
  33682. // "enum": [
  33683. // "ASCENDING",
  33684. // "DESCENDING"
  33685. // ],
  33686. // "enumDescriptions": [
  33687. // "",
  33688. // ""
  33689. // ],
  33690. // "location": "query",
  33691. // "type": "string"
  33692. // }
  33693. // },
  33694. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  33695. // "response": {
  33696. // "$ref": "OrderDocumentsListResponse"
  33697. // },
  33698. // "scopes": [
  33699. // "https://www.googleapis.com/auth/dfatrafficking"
  33700. // ]
  33701. // }
  33702. }
  33703. // Pages invokes f for each page of results.
  33704. // A non-nil error returned from f will halt the iteration.
  33705. // The provided context supersedes any context provided to the Context method.
  33706. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  33707. c.ctx_ = ctx
  33708. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33709. for {
  33710. x, err := c.Do()
  33711. if err != nil {
  33712. return err
  33713. }
  33714. if err := f(x); err != nil {
  33715. return err
  33716. }
  33717. if x.NextPageToken == "" {
  33718. return nil
  33719. }
  33720. c.PageToken(x.NextPageToken)
  33721. }
  33722. }
  33723. // method id "dfareporting.orders.get":
  33724. type OrdersGetCall struct {
  33725. s *Service
  33726. profileId int64
  33727. projectId int64
  33728. id int64
  33729. urlParams_ gensupport.URLParams
  33730. ifNoneMatch_ string
  33731. ctx_ context.Context
  33732. header_ http.Header
  33733. }
  33734. // Get: Gets one order by ID.
  33735. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  33736. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33737. c.profileId = profileId
  33738. c.projectId = projectId
  33739. c.id = id
  33740. return c
  33741. }
  33742. // Fields allows partial responses to be retrieved. See
  33743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33744. // for more information.
  33745. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  33746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33747. return c
  33748. }
  33749. // IfNoneMatch sets the optional parameter which makes the operation
  33750. // fail if the object's ETag matches the given value. This is useful for
  33751. // getting updates only after the object has changed since the last
  33752. // request. Use googleapi.IsNotModified to check whether the response
  33753. // error from Do is the result of In-None-Match.
  33754. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  33755. c.ifNoneMatch_ = entityTag
  33756. return c
  33757. }
  33758. // Context sets the context to be used in this call's Do method. Any
  33759. // pending HTTP request will be aborted if the provided context is
  33760. // canceled.
  33761. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  33762. c.ctx_ = ctx
  33763. return c
  33764. }
  33765. // Header returns an http.Header that can be modified by the caller to
  33766. // add HTTP headers to the request.
  33767. func (c *OrdersGetCall) Header() http.Header {
  33768. if c.header_ == nil {
  33769. c.header_ = make(http.Header)
  33770. }
  33771. return c.header_
  33772. }
  33773. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  33774. reqHeaders := make(http.Header)
  33775. for k, v := range c.header_ {
  33776. reqHeaders[k] = v
  33777. }
  33778. reqHeaders.Set("User-Agent", c.s.userAgent())
  33779. if c.ifNoneMatch_ != "" {
  33780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33781. }
  33782. var body io.Reader = nil
  33783. c.urlParams_.Set("alt", alt)
  33784. c.urlParams_.Set("prettyPrint", "false")
  33785. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  33786. urls += "?" + c.urlParams_.Encode()
  33787. req, err := http.NewRequest("GET", urls, body)
  33788. if err != nil {
  33789. return nil, err
  33790. }
  33791. req.Header = reqHeaders
  33792. googleapi.Expand(req.URL, map[string]string{
  33793. "profileId": strconv.FormatInt(c.profileId, 10),
  33794. "projectId": strconv.FormatInt(c.projectId, 10),
  33795. "id": strconv.FormatInt(c.id, 10),
  33796. })
  33797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33798. }
  33799. // Do executes the "dfareporting.orders.get" call.
  33800. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  33801. // code is an error. Response headers are in either
  33802. // *Order.ServerResponse.Header or (if a response was returned at all)
  33803. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33804. // check whether the returned error was because http.StatusNotModified
  33805. // was returned.
  33806. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  33807. gensupport.SetOptions(c.urlParams_, opts...)
  33808. res, err := c.doRequest("json")
  33809. if res != nil && res.StatusCode == http.StatusNotModified {
  33810. if res.Body != nil {
  33811. res.Body.Close()
  33812. }
  33813. return nil, &googleapi.Error{
  33814. Code: res.StatusCode,
  33815. Header: res.Header,
  33816. }
  33817. }
  33818. if err != nil {
  33819. return nil, err
  33820. }
  33821. defer googleapi.CloseBody(res)
  33822. if err := googleapi.CheckResponse(res); err != nil {
  33823. return nil, err
  33824. }
  33825. ret := &Order{
  33826. ServerResponse: googleapi.ServerResponse{
  33827. Header: res.Header,
  33828. HTTPStatusCode: res.StatusCode,
  33829. },
  33830. }
  33831. target := &ret
  33832. if err := gensupport.DecodeResponse(target, res); err != nil {
  33833. return nil, err
  33834. }
  33835. return ret, nil
  33836. // {
  33837. // "description": "Gets one order by ID.",
  33838. // "httpMethod": "GET",
  33839. // "id": "dfareporting.orders.get",
  33840. // "parameterOrder": [
  33841. // "profileId",
  33842. // "projectId",
  33843. // "id"
  33844. // ],
  33845. // "parameters": {
  33846. // "id": {
  33847. // "description": "Order ID.",
  33848. // "format": "int64",
  33849. // "location": "path",
  33850. // "required": true,
  33851. // "type": "string"
  33852. // },
  33853. // "profileId": {
  33854. // "description": "User profile ID associated with this request.",
  33855. // "format": "int64",
  33856. // "location": "path",
  33857. // "required": true,
  33858. // "type": "string"
  33859. // },
  33860. // "projectId": {
  33861. // "description": "Project ID for orders.",
  33862. // "format": "int64",
  33863. // "location": "path",
  33864. // "required": true,
  33865. // "type": "string"
  33866. // }
  33867. // },
  33868. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  33869. // "response": {
  33870. // "$ref": "Order"
  33871. // },
  33872. // "scopes": [
  33873. // "https://www.googleapis.com/auth/dfatrafficking"
  33874. // ]
  33875. // }
  33876. }
  33877. // method id "dfareporting.orders.list":
  33878. type OrdersListCall struct {
  33879. s *Service
  33880. profileId int64
  33881. projectId int64
  33882. urlParams_ gensupport.URLParams
  33883. ifNoneMatch_ string
  33884. ctx_ context.Context
  33885. header_ http.Header
  33886. }
  33887. // List: Retrieves a list of orders, possibly filtered. This method
  33888. // supports paging.
  33889. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  33890. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33891. c.profileId = profileId
  33892. c.projectId = projectId
  33893. return c
  33894. }
  33895. // Ids sets the optional parameter "ids": Select only orders with these
  33896. // IDs.
  33897. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  33898. var ids_ []string
  33899. for _, v := range ids {
  33900. ids_ = append(ids_, fmt.Sprint(v))
  33901. }
  33902. c.urlParams_.SetMulti("ids", ids_)
  33903. return c
  33904. }
  33905. // MaxResults sets the optional parameter "maxResults": Maximum number
  33906. // of results to return.
  33907. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  33908. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33909. return c
  33910. }
  33911. // PageToken sets the optional parameter "pageToken": Value of the
  33912. // nextPageToken from the previous result page.
  33913. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  33914. c.urlParams_.Set("pageToken", pageToken)
  33915. return c
  33916. }
  33917. // SearchString sets the optional parameter "searchString": Allows
  33918. // searching for orders by name or ID. Wildcards (*) are allowed. For
  33919. // example, "order*2015" will return orders with names like "order June
  33920. // 2015", "order April 2015", or simply "order 2015". Most of the
  33921. // searches also add wildcards implicitly at the start and the end of
  33922. // the search string. For example, a search string of "order" will match
  33923. // orders with name "my order", "order 2015", or simply "order".
  33924. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  33925. c.urlParams_.Set("searchString", searchString)
  33926. return c
  33927. }
  33928. // SiteId sets the optional parameter "siteId": Select only orders that
  33929. // are associated with these site IDs.
  33930. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  33931. var siteId_ []string
  33932. for _, v := range siteId {
  33933. siteId_ = append(siteId_, fmt.Sprint(v))
  33934. }
  33935. c.urlParams_.SetMulti("siteId", siteId_)
  33936. return c
  33937. }
  33938. // SortField sets the optional parameter "sortField": Field by which to
  33939. // sort the list.
  33940. //
  33941. // Possible values:
  33942. // "ID" (default)
  33943. // "NAME"
  33944. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  33945. c.urlParams_.Set("sortField", sortField)
  33946. return c
  33947. }
  33948. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33949. // results.
  33950. //
  33951. // Possible values:
  33952. // "ASCENDING" (default)
  33953. // "DESCENDING"
  33954. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  33955. c.urlParams_.Set("sortOrder", sortOrder)
  33956. return c
  33957. }
  33958. // Fields allows partial responses to be retrieved. See
  33959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33960. // for more information.
  33961. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  33962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33963. return c
  33964. }
  33965. // IfNoneMatch sets the optional parameter which makes the operation
  33966. // fail if the object's ETag matches the given value. This is useful for
  33967. // getting updates only after the object has changed since the last
  33968. // request. Use googleapi.IsNotModified to check whether the response
  33969. // error from Do is the result of In-None-Match.
  33970. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  33971. c.ifNoneMatch_ = entityTag
  33972. return c
  33973. }
  33974. // Context sets the context to be used in this call's Do method. Any
  33975. // pending HTTP request will be aborted if the provided context is
  33976. // canceled.
  33977. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  33978. c.ctx_ = ctx
  33979. return c
  33980. }
  33981. // Header returns an http.Header that can be modified by the caller to
  33982. // add HTTP headers to the request.
  33983. func (c *OrdersListCall) Header() http.Header {
  33984. if c.header_ == nil {
  33985. c.header_ = make(http.Header)
  33986. }
  33987. return c.header_
  33988. }
  33989. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  33990. reqHeaders := make(http.Header)
  33991. for k, v := range c.header_ {
  33992. reqHeaders[k] = v
  33993. }
  33994. reqHeaders.Set("User-Agent", c.s.userAgent())
  33995. if c.ifNoneMatch_ != "" {
  33996. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33997. }
  33998. var body io.Reader = nil
  33999. c.urlParams_.Set("alt", alt)
  34000. c.urlParams_.Set("prettyPrint", "false")
  34001. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  34002. urls += "?" + c.urlParams_.Encode()
  34003. req, err := http.NewRequest("GET", urls, body)
  34004. if err != nil {
  34005. return nil, err
  34006. }
  34007. req.Header = reqHeaders
  34008. googleapi.Expand(req.URL, map[string]string{
  34009. "profileId": strconv.FormatInt(c.profileId, 10),
  34010. "projectId": strconv.FormatInt(c.projectId, 10),
  34011. })
  34012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34013. }
  34014. // Do executes the "dfareporting.orders.list" call.
  34015. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  34016. // non-2xx status code is an error. Response headers are in either
  34017. // *OrdersListResponse.ServerResponse.Header or (if a response was
  34018. // returned at all) in error.(*googleapi.Error).Header. Use
  34019. // googleapi.IsNotModified to check whether the returned error was
  34020. // because http.StatusNotModified was returned.
  34021. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  34022. gensupport.SetOptions(c.urlParams_, opts...)
  34023. res, err := c.doRequest("json")
  34024. if res != nil && res.StatusCode == http.StatusNotModified {
  34025. if res.Body != nil {
  34026. res.Body.Close()
  34027. }
  34028. return nil, &googleapi.Error{
  34029. Code: res.StatusCode,
  34030. Header: res.Header,
  34031. }
  34032. }
  34033. if err != nil {
  34034. return nil, err
  34035. }
  34036. defer googleapi.CloseBody(res)
  34037. if err := googleapi.CheckResponse(res); err != nil {
  34038. return nil, err
  34039. }
  34040. ret := &OrdersListResponse{
  34041. ServerResponse: googleapi.ServerResponse{
  34042. Header: res.Header,
  34043. HTTPStatusCode: res.StatusCode,
  34044. },
  34045. }
  34046. target := &ret
  34047. if err := gensupport.DecodeResponse(target, res); err != nil {
  34048. return nil, err
  34049. }
  34050. return ret, nil
  34051. // {
  34052. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  34053. // "httpMethod": "GET",
  34054. // "id": "dfareporting.orders.list",
  34055. // "parameterOrder": [
  34056. // "profileId",
  34057. // "projectId"
  34058. // ],
  34059. // "parameters": {
  34060. // "ids": {
  34061. // "description": "Select only orders with these IDs.",
  34062. // "format": "int64",
  34063. // "location": "query",
  34064. // "repeated": true,
  34065. // "type": "string"
  34066. // },
  34067. // "maxResults": {
  34068. // "default": "1000",
  34069. // "description": "Maximum number of results to return.",
  34070. // "format": "int32",
  34071. // "location": "query",
  34072. // "maximum": "1000",
  34073. // "minimum": "0",
  34074. // "type": "integer"
  34075. // },
  34076. // "pageToken": {
  34077. // "description": "Value of the nextPageToken from the previous result page.",
  34078. // "location": "query",
  34079. // "type": "string"
  34080. // },
  34081. // "profileId": {
  34082. // "description": "User profile ID associated with this request.",
  34083. // "format": "int64",
  34084. // "location": "path",
  34085. // "required": true,
  34086. // "type": "string"
  34087. // },
  34088. // "projectId": {
  34089. // "description": "Project ID for orders.",
  34090. // "format": "int64",
  34091. // "location": "path",
  34092. // "required": true,
  34093. // "type": "string"
  34094. // },
  34095. // "searchString": {
  34096. // "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\".",
  34097. // "location": "query",
  34098. // "type": "string"
  34099. // },
  34100. // "siteId": {
  34101. // "description": "Select only orders that are associated with these site IDs.",
  34102. // "format": "int64",
  34103. // "location": "query",
  34104. // "repeated": true,
  34105. // "type": "string"
  34106. // },
  34107. // "sortField": {
  34108. // "default": "ID",
  34109. // "description": "Field by which to sort the list.",
  34110. // "enum": [
  34111. // "ID",
  34112. // "NAME"
  34113. // ],
  34114. // "enumDescriptions": [
  34115. // "",
  34116. // ""
  34117. // ],
  34118. // "location": "query",
  34119. // "type": "string"
  34120. // },
  34121. // "sortOrder": {
  34122. // "default": "ASCENDING",
  34123. // "description": "Order of sorted results.",
  34124. // "enum": [
  34125. // "ASCENDING",
  34126. // "DESCENDING"
  34127. // ],
  34128. // "enumDescriptions": [
  34129. // "",
  34130. // ""
  34131. // ],
  34132. // "location": "query",
  34133. // "type": "string"
  34134. // }
  34135. // },
  34136. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  34137. // "response": {
  34138. // "$ref": "OrdersListResponse"
  34139. // },
  34140. // "scopes": [
  34141. // "https://www.googleapis.com/auth/dfatrafficking"
  34142. // ]
  34143. // }
  34144. }
  34145. // Pages invokes f for each page of results.
  34146. // A non-nil error returned from f will halt the iteration.
  34147. // The provided context supersedes any context provided to the Context method.
  34148. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  34149. c.ctx_ = ctx
  34150. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34151. for {
  34152. x, err := c.Do()
  34153. if err != nil {
  34154. return err
  34155. }
  34156. if err := f(x); err != nil {
  34157. return err
  34158. }
  34159. if x.NextPageToken == "" {
  34160. return nil
  34161. }
  34162. c.PageToken(x.NextPageToken)
  34163. }
  34164. }
  34165. // method id "dfareporting.placementGroups.get":
  34166. type PlacementGroupsGetCall struct {
  34167. s *Service
  34168. profileId int64
  34169. id int64
  34170. urlParams_ gensupport.URLParams
  34171. ifNoneMatch_ string
  34172. ctx_ context.Context
  34173. header_ http.Header
  34174. }
  34175. // Get: Gets one placement group by ID.
  34176. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  34177. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34178. c.profileId = profileId
  34179. c.id = id
  34180. return c
  34181. }
  34182. // Fields allows partial responses to be retrieved. See
  34183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34184. // for more information.
  34185. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  34186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34187. return c
  34188. }
  34189. // IfNoneMatch sets the optional parameter which makes the operation
  34190. // fail if the object's ETag matches the given value. This is useful for
  34191. // getting updates only after the object has changed since the last
  34192. // request. Use googleapi.IsNotModified to check whether the response
  34193. // error from Do is the result of In-None-Match.
  34194. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  34195. c.ifNoneMatch_ = entityTag
  34196. return c
  34197. }
  34198. // Context sets the context to be used in this call's Do method. Any
  34199. // pending HTTP request will be aborted if the provided context is
  34200. // canceled.
  34201. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  34202. c.ctx_ = ctx
  34203. return c
  34204. }
  34205. // Header returns an http.Header that can be modified by the caller to
  34206. // add HTTP headers to the request.
  34207. func (c *PlacementGroupsGetCall) Header() http.Header {
  34208. if c.header_ == nil {
  34209. c.header_ = make(http.Header)
  34210. }
  34211. return c.header_
  34212. }
  34213. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  34214. reqHeaders := make(http.Header)
  34215. for k, v := range c.header_ {
  34216. reqHeaders[k] = v
  34217. }
  34218. reqHeaders.Set("User-Agent", c.s.userAgent())
  34219. if c.ifNoneMatch_ != "" {
  34220. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34221. }
  34222. var body io.Reader = nil
  34223. c.urlParams_.Set("alt", alt)
  34224. c.urlParams_.Set("prettyPrint", "false")
  34225. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  34226. urls += "?" + c.urlParams_.Encode()
  34227. req, err := http.NewRequest("GET", urls, body)
  34228. if err != nil {
  34229. return nil, err
  34230. }
  34231. req.Header = reqHeaders
  34232. googleapi.Expand(req.URL, map[string]string{
  34233. "profileId": strconv.FormatInt(c.profileId, 10),
  34234. "id": strconv.FormatInt(c.id, 10),
  34235. })
  34236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34237. }
  34238. // Do executes the "dfareporting.placementGroups.get" call.
  34239. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34240. // status code is an error. Response headers are in either
  34241. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34242. // at all) in error.(*googleapi.Error).Header. Use
  34243. // googleapi.IsNotModified to check whether the returned error was
  34244. // because http.StatusNotModified was returned.
  34245. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34246. gensupport.SetOptions(c.urlParams_, opts...)
  34247. res, err := c.doRequest("json")
  34248. if res != nil && res.StatusCode == http.StatusNotModified {
  34249. if res.Body != nil {
  34250. res.Body.Close()
  34251. }
  34252. return nil, &googleapi.Error{
  34253. Code: res.StatusCode,
  34254. Header: res.Header,
  34255. }
  34256. }
  34257. if err != nil {
  34258. return nil, err
  34259. }
  34260. defer googleapi.CloseBody(res)
  34261. if err := googleapi.CheckResponse(res); err != nil {
  34262. return nil, err
  34263. }
  34264. ret := &PlacementGroup{
  34265. ServerResponse: googleapi.ServerResponse{
  34266. Header: res.Header,
  34267. HTTPStatusCode: res.StatusCode,
  34268. },
  34269. }
  34270. target := &ret
  34271. if err := gensupport.DecodeResponse(target, res); err != nil {
  34272. return nil, err
  34273. }
  34274. return ret, nil
  34275. // {
  34276. // "description": "Gets one placement group by ID.",
  34277. // "httpMethod": "GET",
  34278. // "id": "dfareporting.placementGroups.get",
  34279. // "parameterOrder": [
  34280. // "profileId",
  34281. // "id"
  34282. // ],
  34283. // "parameters": {
  34284. // "id": {
  34285. // "description": "Placement group ID.",
  34286. // "format": "int64",
  34287. // "location": "path",
  34288. // "required": true,
  34289. // "type": "string"
  34290. // },
  34291. // "profileId": {
  34292. // "description": "User profile ID associated with this request.",
  34293. // "format": "int64",
  34294. // "location": "path",
  34295. // "required": true,
  34296. // "type": "string"
  34297. // }
  34298. // },
  34299. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  34300. // "response": {
  34301. // "$ref": "PlacementGroup"
  34302. // },
  34303. // "scopes": [
  34304. // "https://www.googleapis.com/auth/dfatrafficking"
  34305. // ]
  34306. // }
  34307. }
  34308. // method id "dfareporting.placementGroups.insert":
  34309. type PlacementGroupsInsertCall struct {
  34310. s *Service
  34311. profileId int64
  34312. placementgroup *PlacementGroup
  34313. urlParams_ gensupport.URLParams
  34314. ctx_ context.Context
  34315. header_ http.Header
  34316. }
  34317. // Insert: Inserts a new placement group.
  34318. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  34319. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34320. c.profileId = profileId
  34321. c.placementgroup = placementgroup
  34322. return c
  34323. }
  34324. // Fields allows partial responses to be retrieved. See
  34325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34326. // for more information.
  34327. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  34328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34329. return c
  34330. }
  34331. // Context sets the context to be used in this call's Do method. Any
  34332. // pending HTTP request will be aborted if the provided context is
  34333. // canceled.
  34334. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  34335. c.ctx_ = ctx
  34336. return c
  34337. }
  34338. // Header returns an http.Header that can be modified by the caller to
  34339. // add HTTP headers to the request.
  34340. func (c *PlacementGroupsInsertCall) Header() http.Header {
  34341. if c.header_ == nil {
  34342. c.header_ = make(http.Header)
  34343. }
  34344. return c.header_
  34345. }
  34346. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  34347. reqHeaders := make(http.Header)
  34348. for k, v := range c.header_ {
  34349. reqHeaders[k] = v
  34350. }
  34351. reqHeaders.Set("User-Agent", c.s.userAgent())
  34352. var body io.Reader = nil
  34353. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34354. if err != nil {
  34355. return nil, err
  34356. }
  34357. reqHeaders.Set("Content-Type", "application/json")
  34358. c.urlParams_.Set("alt", alt)
  34359. c.urlParams_.Set("prettyPrint", "false")
  34360. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34361. urls += "?" + c.urlParams_.Encode()
  34362. req, err := http.NewRequest("POST", urls, body)
  34363. if err != nil {
  34364. return nil, err
  34365. }
  34366. req.Header = reqHeaders
  34367. googleapi.Expand(req.URL, map[string]string{
  34368. "profileId": strconv.FormatInt(c.profileId, 10),
  34369. })
  34370. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34371. }
  34372. // Do executes the "dfareporting.placementGroups.insert" call.
  34373. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34374. // status code is an error. Response headers are in either
  34375. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34376. // at all) in error.(*googleapi.Error).Header. Use
  34377. // googleapi.IsNotModified to check whether the returned error was
  34378. // because http.StatusNotModified was returned.
  34379. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34380. gensupport.SetOptions(c.urlParams_, opts...)
  34381. res, err := c.doRequest("json")
  34382. if res != nil && res.StatusCode == http.StatusNotModified {
  34383. if res.Body != nil {
  34384. res.Body.Close()
  34385. }
  34386. return nil, &googleapi.Error{
  34387. Code: res.StatusCode,
  34388. Header: res.Header,
  34389. }
  34390. }
  34391. if err != nil {
  34392. return nil, err
  34393. }
  34394. defer googleapi.CloseBody(res)
  34395. if err := googleapi.CheckResponse(res); err != nil {
  34396. return nil, err
  34397. }
  34398. ret := &PlacementGroup{
  34399. ServerResponse: googleapi.ServerResponse{
  34400. Header: res.Header,
  34401. HTTPStatusCode: res.StatusCode,
  34402. },
  34403. }
  34404. target := &ret
  34405. if err := gensupport.DecodeResponse(target, res); err != nil {
  34406. return nil, err
  34407. }
  34408. return ret, nil
  34409. // {
  34410. // "description": "Inserts a new placement group.",
  34411. // "httpMethod": "POST",
  34412. // "id": "dfareporting.placementGroups.insert",
  34413. // "parameterOrder": [
  34414. // "profileId"
  34415. // ],
  34416. // "parameters": {
  34417. // "profileId": {
  34418. // "description": "User profile ID associated with this request.",
  34419. // "format": "int64",
  34420. // "location": "path",
  34421. // "required": true,
  34422. // "type": "string"
  34423. // }
  34424. // },
  34425. // "path": "userprofiles/{profileId}/placementGroups",
  34426. // "request": {
  34427. // "$ref": "PlacementGroup"
  34428. // },
  34429. // "response": {
  34430. // "$ref": "PlacementGroup"
  34431. // },
  34432. // "scopes": [
  34433. // "https://www.googleapis.com/auth/dfatrafficking"
  34434. // ]
  34435. // }
  34436. }
  34437. // method id "dfareporting.placementGroups.list":
  34438. type PlacementGroupsListCall struct {
  34439. s *Service
  34440. profileId int64
  34441. urlParams_ gensupport.URLParams
  34442. ifNoneMatch_ string
  34443. ctx_ context.Context
  34444. header_ http.Header
  34445. }
  34446. // List: Retrieves a list of placement groups, possibly filtered. This
  34447. // method supports paging.
  34448. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  34449. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34450. c.profileId = profileId
  34451. return c
  34452. }
  34453. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  34454. // only placement groups that belong to these advertisers.
  34455. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  34456. var advertiserIds_ []string
  34457. for _, v := range advertiserIds {
  34458. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  34459. }
  34460. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  34461. return c
  34462. }
  34463. // Archived sets the optional parameter "archived": Select only archived
  34464. // placements. Don't set this field to select both archived and
  34465. // non-archived placements.
  34466. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  34467. c.urlParams_.Set("archived", fmt.Sprint(archived))
  34468. return c
  34469. }
  34470. // CampaignIds sets the optional parameter "campaignIds": Select only
  34471. // placement groups that belong to these campaigns.
  34472. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  34473. var campaignIds_ []string
  34474. for _, v := range campaignIds {
  34475. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  34476. }
  34477. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  34478. return c
  34479. }
  34480. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  34481. // Select only placement groups that are associated with these content
  34482. // categories.
  34483. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  34484. var contentCategoryIds_ []string
  34485. for _, v := range contentCategoryIds {
  34486. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  34487. }
  34488. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  34489. return c
  34490. }
  34491. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  34492. // Select only placement groups that are associated with these directory
  34493. // sites.
  34494. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  34495. var directorySiteIds_ []string
  34496. for _, v := range directorySiteIds {
  34497. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  34498. }
  34499. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  34500. return c
  34501. }
  34502. // Ids sets the optional parameter "ids": Select only placement groups
  34503. // with these IDs.
  34504. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  34505. var ids_ []string
  34506. for _, v := range ids {
  34507. ids_ = append(ids_, fmt.Sprint(v))
  34508. }
  34509. c.urlParams_.SetMulti("ids", ids_)
  34510. return c
  34511. }
  34512. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  34513. // placements or placement groups whose end date is on or before the
  34514. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  34515. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  34516. c.urlParams_.Set("maxEndDate", maxEndDate)
  34517. return c
  34518. }
  34519. // MaxResults sets the optional parameter "maxResults": Maximum number
  34520. // of results to return.
  34521. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  34522. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34523. return c
  34524. }
  34525. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  34526. // placements or placement groups whose start date is on or before the
  34527. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  34528. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  34529. c.urlParams_.Set("maxStartDate", maxStartDate)
  34530. return c
  34531. }
  34532. // MinEndDate sets the optional parameter "minEndDate": Select only
  34533. // placements or placement groups whose end date is on or after the
  34534. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  34535. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  34536. c.urlParams_.Set("minEndDate", minEndDate)
  34537. return c
  34538. }
  34539. // MinStartDate sets the optional parameter "minStartDate": Select only
  34540. // placements or placement groups whose start date is on or after the
  34541. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  34542. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  34543. c.urlParams_.Set("minStartDate", minStartDate)
  34544. return c
  34545. }
  34546. // PageToken sets the optional parameter "pageToken": Value of the
  34547. // nextPageToken from the previous result page.
  34548. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  34549. c.urlParams_.Set("pageToken", pageToken)
  34550. return c
  34551. }
  34552. // PlacementGroupType sets the optional parameter "placementGroupType":
  34553. // Select only placement groups belonging with this group type. A
  34554. // package is a simple group of placements that acts as a single pricing
  34555. // point for a group of tags. A roadblock is a group of placements that
  34556. // not only acts as a single pricing point but also assumes that all the
  34557. // tags in it will be served at the same time. A roadblock requires one
  34558. // of its assigned placements to be marked as primary for reporting.
  34559. //
  34560. // Possible values:
  34561. // "PLACEMENT_PACKAGE"
  34562. // "PLACEMENT_ROADBLOCK"
  34563. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  34564. c.urlParams_.Set("placementGroupType", placementGroupType)
  34565. return c
  34566. }
  34567. // PlacementStrategyIds sets the optional parameter
  34568. // "placementStrategyIds": Select only placement groups that are
  34569. // associated with these placement strategies.
  34570. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  34571. var placementStrategyIds_ []string
  34572. for _, v := range placementStrategyIds {
  34573. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  34574. }
  34575. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  34576. return c
  34577. }
  34578. // PricingTypes sets the optional parameter "pricingTypes": Select only
  34579. // placement groups with these pricing types.
  34580. //
  34581. // Possible values:
  34582. // "PRICING_TYPE_CPA"
  34583. // "PRICING_TYPE_CPC"
  34584. // "PRICING_TYPE_CPM"
  34585. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  34586. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  34587. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34588. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  34589. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  34590. return c
  34591. }
  34592. // SearchString sets the optional parameter "searchString": Allows
  34593. // searching for placement groups by name or ID. Wildcards (*) are
  34594. // allowed. For example, "placement*2015" will return placement groups
  34595. // with names like "placement group June 2015", "placement group May
  34596. // 2015", or simply "placements 2015". Most of the searches also add
  34597. // wildcards implicitly at the start and the end of the search string.
  34598. // For example, a search string of "placementgroup" will match placement
  34599. // groups with name "my placementgroup", "placementgroup 2015", or
  34600. // simply "placementgroup".
  34601. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  34602. c.urlParams_.Set("searchString", searchString)
  34603. return c
  34604. }
  34605. // SiteIds sets the optional parameter "siteIds": Select only placement
  34606. // groups that are associated with these sites.
  34607. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  34608. var siteIds_ []string
  34609. for _, v := range siteIds {
  34610. siteIds_ = append(siteIds_, fmt.Sprint(v))
  34611. }
  34612. c.urlParams_.SetMulti("siteIds", siteIds_)
  34613. return c
  34614. }
  34615. // SortField sets the optional parameter "sortField": Field by which to
  34616. // sort the list.
  34617. //
  34618. // Possible values:
  34619. // "ID" (default)
  34620. // "NAME"
  34621. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  34622. c.urlParams_.Set("sortField", sortField)
  34623. return c
  34624. }
  34625. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34626. // results.
  34627. //
  34628. // Possible values:
  34629. // "ASCENDING" (default)
  34630. // "DESCENDING"
  34631. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  34632. c.urlParams_.Set("sortOrder", sortOrder)
  34633. return c
  34634. }
  34635. // Fields allows partial responses to be retrieved. See
  34636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34637. // for more information.
  34638. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  34639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34640. return c
  34641. }
  34642. // IfNoneMatch sets the optional parameter which makes the operation
  34643. // fail if the object's ETag matches the given value. This is useful for
  34644. // getting updates only after the object has changed since the last
  34645. // request. Use googleapi.IsNotModified to check whether the response
  34646. // error from Do is the result of In-None-Match.
  34647. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  34648. c.ifNoneMatch_ = entityTag
  34649. return c
  34650. }
  34651. // Context sets the context to be used in this call's Do method. Any
  34652. // pending HTTP request will be aborted if the provided context is
  34653. // canceled.
  34654. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  34655. c.ctx_ = ctx
  34656. return c
  34657. }
  34658. // Header returns an http.Header that can be modified by the caller to
  34659. // add HTTP headers to the request.
  34660. func (c *PlacementGroupsListCall) Header() http.Header {
  34661. if c.header_ == nil {
  34662. c.header_ = make(http.Header)
  34663. }
  34664. return c.header_
  34665. }
  34666. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  34667. reqHeaders := make(http.Header)
  34668. for k, v := range c.header_ {
  34669. reqHeaders[k] = v
  34670. }
  34671. reqHeaders.Set("User-Agent", c.s.userAgent())
  34672. if c.ifNoneMatch_ != "" {
  34673. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34674. }
  34675. var body io.Reader = nil
  34676. c.urlParams_.Set("alt", alt)
  34677. c.urlParams_.Set("prettyPrint", "false")
  34678. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34679. urls += "?" + c.urlParams_.Encode()
  34680. req, err := http.NewRequest("GET", urls, body)
  34681. if err != nil {
  34682. return nil, err
  34683. }
  34684. req.Header = reqHeaders
  34685. googleapi.Expand(req.URL, map[string]string{
  34686. "profileId": strconv.FormatInt(c.profileId, 10),
  34687. })
  34688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34689. }
  34690. // Do executes the "dfareporting.placementGroups.list" call.
  34691. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  34692. // Any non-2xx status code is an error. Response headers are in either
  34693. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  34694. // was returned at all) in error.(*googleapi.Error).Header. Use
  34695. // googleapi.IsNotModified to check whether the returned error was
  34696. // because http.StatusNotModified was returned.
  34697. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  34698. gensupport.SetOptions(c.urlParams_, opts...)
  34699. res, err := c.doRequest("json")
  34700. if res != nil && res.StatusCode == http.StatusNotModified {
  34701. if res.Body != nil {
  34702. res.Body.Close()
  34703. }
  34704. return nil, &googleapi.Error{
  34705. Code: res.StatusCode,
  34706. Header: res.Header,
  34707. }
  34708. }
  34709. if err != nil {
  34710. return nil, err
  34711. }
  34712. defer googleapi.CloseBody(res)
  34713. if err := googleapi.CheckResponse(res); err != nil {
  34714. return nil, err
  34715. }
  34716. ret := &PlacementGroupsListResponse{
  34717. ServerResponse: googleapi.ServerResponse{
  34718. Header: res.Header,
  34719. HTTPStatusCode: res.StatusCode,
  34720. },
  34721. }
  34722. target := &ret
  34723. if err := gensupport.DecodeResponse(target, res); err != nil {
  34724. return nil, err
  34725. }
  34726. return ret, nil
  34727. // {
  34728. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  34729. // "httpMethod": "GET",
  34730. // "id": "dfareporting.placementGroups.list",
  34731. // "parameterOrder": [
  34732. // "profileId"
  34733. // ],
  34734. // "parameters": {
  34735. // "advertiserIds": {
  34736. // "description": "Select only placement groups that belong to these advertisers.",
  34737. // "format": "int64",
  34738. // "location": "query",
  34739. // "repeated": true,
  34740. // "type": "string"
  34741. // },
  34742. // "archived": {
  34743. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  34744. // "location": "query",
  34745. // "type": "boolean"
  34746. // },
  34747. // "campaignIds": {
  34748. // "description": "Select only placement groups that belong to these campaigns.",
  34749. // "format": "int64",
  34750. // "location": "query",
  34751. // "repeated": true,
  34752. // "type": "string"
  34753. // },
  34754. // "contentCategoryIds": {
  34755. // "description": "Select only placement groups that are associated with these content categories.",
  34756. // "format": "int64",
  34757. // "location": "query",
  34758. // "repeated": true,
  34759. // "type": "string"
  34760. // },
  34761. // "directorySiteIds": {
  34762. // "description": "Select only placement groups that are associated with these directory sites.",
  34763. // "format": "int64",
  34764. // "location": "query",
  34765. // "repeated": true,
  34766. // "type": "string"
  34767. // },
  34768. // "ids": {
  34769. // "description": "Select only placement groups with these IDs.",
  34770. // "format": "int64",
  34771. // "location": "query",
  34772. // "repeated": true,
  34773. // "type": "string"
  34774. // },
  34775. // "maxEndDate": {
  34776. // "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\".",
  34777. // "location": "query",
  34778. // "type": "string"
  34779. // },
  34780. // "maxResults": {
  34781. // "default": "800",
  34782. // "description": "Maximum number of results to return.",
  34783. // "format": "int32",
  34784. // "location": "query",
  34785. // "maximum": "800",
  34786. // "minimum": "0",
  34787. // "type": "integer"
  34788. // },
  34789. // "maxStartDate": {
  34790. // "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\".",
  34791. // "location": "query",
  34792. // "type": "string"
  34793. // },
  34794. // "minEndDate": {
  34795. // "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\".",
  34796. // "location": "query",
  34797. // "type": "string"
  34798. // },
  34799. // "minStartDate": {
  34800. // "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\".",
  34801. // "location": "query",
  34802. // "type": "string"
  34803. // },
  34804. // "pageToken": {
  34805. // "description": "Value of the nextPageToken from the previous result page.",
  34806. // "location": "query",
  34807. // "type": "string"
  34808. // },
  34809. // "placementGroupType": {
  34810. // "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.",
  34811. // "enum": [
  34812. // "PLACEMENT_PACKAGE",
  34813. // "PLACEMENT_ROADBLOCK"
  34814. // ],
  34815. // "enumDescriptions": [
  34816. // "",
  34817. // ""
  34818. // ],
  34819. // "location": "query",
  34820. // "type": "string"
  34821. // },
  34822. // "placementStrategyIds": {
  34823. // "description": "Select only placement groups that are associated with these placement strategies.",
  34824. // "format": "int64",
  34825. // "location": "query",
  34826. // "repeated": true,
  34827. // "type": "string"
  34828. // },
  34829. // "pricingTypes": {
  34830. // "description": "Select only placement groups with these pricing types.",
  34831. // "enum": [
  34832. // "PRICING_TYPE_CPA",
  34833. // "PRICING_TYPE_CPC",
  34834. // "PRICING_TYPE_CPM",
  34835. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  34836. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  34837. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34838. // ],
  34839. // "enumDescriptions": [
  34840. // "",
  34841. // "",
  34842. // "",
  34843. // "",
  34844. // "",
  34845. // ""
  34846. // ],
  34847. // "location": "query",
  34848. // "repeated": true,
  34849. // "type": "string"
  34850. // },
  34851. // "profileId": {
  34852. // "description": "User profile ID associated with this request.",
  34853. // "format": "int64",
  34854. // "location": "path",
  34855. // "required": true,
  34856. // "type": "string"
  34857. // },
  34858. // "searchString": {
  34859. // "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\".",
  34860. // "location": "query",
  34861. // "type": "string"
  34862. // },
  34863. // "siteIds": {
  34864. // "description": "Select only placement groups that are associated with these sites.",
  34865. // "format": "int64",
  34866. // "location": "query",
  34867. // "repeated": true,
  34868. // "type": "string"
  34869. // },
  34870. // "sortField": {
  34871. // "default": "ID",
  34872. // "description": "Field by which to sort the list.",
  34873. // "enum": [
  34874. // "ID",
  34875. // "NAME"
  34876. // ],
  34877. // "enumDescriptions": [
  34878. // "",
  34879. // ""
  34880. // ],
  34881. // "location": "query",
  34882. // "type": "string"
  34883. // },
  34884. // "sortOrder": {
  34885. // "default": "ASCENDING",
  34886. // "description": "Order of sorted results.",
  34887. // "enum": [
  34888. // "ASCENDING",
  34889. // "DESCENDING"
  34890. // ],
  34891. // "enumDescriptions": [
  34892. // "",
  34893. // ""
  34894. // ],
  34895. // "location": "query",
  34896. // "type": "string"
  34897. // }
  34898. // },
  34899. // "path": "userprofiles/{profileId}/placementGroups",
  34900. // "response": {
  34901. // "$ref": "PlacementGroupsListResponse"
  34902. // },
  34903. // "scopes": [
  34904. // "https://www.googleapis.com/auth/dfatrafficking"
  34905. // ]
  34906. // }
  34907. }
  34908. // Pages invokes f for each page of results.
  34909. // A non-nil error returned from f will halt the iteration.
  34910. // The provided context supersedes any context provided to the Context method.
  34911. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  34912. c.ctx_ = ctx
  34913. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34914. for {
  34915. x, err := c.Do()
  34916. if err != nil {
  34917. return err
  34918. }
  34919. if err := f(x); err != nil {
  34920. return err
  34921. }
  34922. if x.NextPageToken == "" {
  34923. return nil
  34924. }
  34925. c.PageToken(x.NextPageToken)
  34926. }
  34927. }
  34928. // method id "dfareporting.placementGroups.patch":
  34929. type PlacementGroupsPatchCall struct {
  34930. s *Service
  34931. profileId int64
  34932. placementgroup *PlacementGroup
  34933. urlParams_ gensupport.URLParams
  34934. ctx_ context.Context
  34935. header_ http.Header
  34936. }
  34937. // Patch: Updates an existing placement group. This method supports
  34938. // patch semantics.
  34939. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  34940. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34941. c.profileId = profileId
  34942. c.urlParams_.Set("id", fmt.Sprint(id))
  34943. c.placementgroup = placementgroup
  34944. return c
  34945. }
  34946. // Fields allows partial responses to be retrieved. See
  34947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34948. // for more information.
  34949. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  34950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34951. return c
  34952. }
  34953. // Context sets the context to be used in this call's Do method. Any
  34954. // pending HTTP request will be aborted if the provided context is
  34955. // canceled.
  34956. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  34957. c.ctx_ = ctx
  34958. return c
  34959. }
  34960. // Header returns an http.Header that can be modified by the caller to
  34961. // add HTTP headers to the request.
  34962. func (c *PlacementGroupsPatchCall) Header() http.Header {
  34963. if c.header_ == nil {
  34964. c.header_ = make(http.Header)
  34965. }
  34966. return c.header_
  34967. }
  34968. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  34969. reqHeaders := make(http.Header)
  34970. for k, v := range c.header_ {
  34971. reqHeaders[k] = v
  34972. }
  34973. reqHeaders.Set("User-Agent", c.s.userAgent())
  34974. var body io.Reader = nil
  34975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34976. if err != nil {
  34977. return nil, err
  34978. }
  34979. reqHeaders.Set("Content-Type", "application/json")
  34980. c.urlParams_.Set("alt", alt)
  34981. c.urlParams_.Set("prettyPrint", "false")
  34982. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34983. urls += "?" + c.urlParams_.Encode()
  34984. req, err := http.NewRequest("PATCH", urls, body)
  34985. if err != nil {
  34986. return nil, err
  34987. }
  34988. req.Header = reqHeaders
  34989. googleapi.Expand(req.URL, map[string]string{
  34990. "profileId": strconv.FormatInt(c.profileId, 10),
  34991. })
  34992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34993. }
  34994. // Do executes the "dfareporting.placementGroups.patch" call.
  34995. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34996. // status code is an error. Response headers are in either
  34997. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34998. // at all) in error.(*googleapi.Error).Header. Use
  34999. // googleapi.IsNotModified to check whether the returned error was
  35000. // because http.StatusNotModified was returned.
  35001. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  35002. gensupport.SetOptions(c.urlParams_, opts...)
  35003. res, err := c.doRequest("json")
  35004. if res != nil && res.StatusCode == http.StatusNotModified {
  35005. if res.Body != nil {
  35006. res.Body.Close()
  35007. }
  35008. return nil, &googleapi.Error{
  35009. Code: res.StatusCode,
  35010. Header: res.Header,
  35011. }
  35012. }
  35013. if err != nil {
  35014. return nil, err
  35015. }
  35016. defer googleapi.CloseBody(res)
  35017. if err := googleapi.CheckResponse(res); err != nil {
  35018. return nil, err
  35019. }
  35020. ret := &PlacementGroup{
  35021. ServerResponse: googleapi.ServerResponse{
  35022. Header: res.Header,
  35023. HTTPStatusCode: res.StatusCode,
  35024. },
  35025. }
  35026. target := &ret
  35027. if err := gensupport.DecodeResponse(target, res); err != nil {
  35028. return nil, err
  35029. }
  35030. return ret, nil
  35031. // {
  35032. // "description": "Updates an existing placement group. This method supports patch semantics.",
  35033. // "httpMethod": "PATCH",
  35034. // "id": "dfareporting.placementGroups.patch",
  35035. // "parameterOrder": [
  35036. // "profileId",
  35037. // "id"
  35038. // ],
  35039. // "parameters": {
  35040. // "id": {
  35041. // "description": "Placement group ID.",
  35042. // "format": "int64",
  35043. // "location": "query",
  35044. // "required": true,
  35045. // "type": "string"
  35046. // },
  35047. // "profileId": {
  35048. // "description": "User profile ID associated with this request.",
  35049. // "format": "int64",
  35050. // "location": "path",
  35051. // "required": true,
  35052. // "type": "string"
  35053. // }
  35054. // },
  35055. // "path": "userprofiles/{profileId}/placementGroups",
  35056. // "request": {
  35057. // "$ref": "PlacementGroup"
  35058. // },
  35059. // "response": {
  35060. // "$ref": "PlacementGroup"
  35061. // },
  35062. // "scopes": [
  35063. // "https://www.googleapis.com/auth/dfatrafficking"
  35064. // ]
  35065. // }
  35066. }
  35067. // method id "dfareporting.placementGroups.update":
  35068. type PlacementGroupsUpdateCall struct {
  35069. s *Service
  35070. profileId int64
  35071. placementgroup *PlacementGroup
  35072. urlParams_ gensupport.URLParams
  35073. ctx_ context.Context
  35074. header_ http.Header
  35075. }
  35076. // Update: Updates an existing placement group.
  35077. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  35078. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35079. c.profileId = profileId
  35080. c.placementgroup = placementgroup
  35081. return c
  35082. }
  35083. // Fields allows partial responses to be retrieved. See
  35084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35085. // for more information.
  35086. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  35087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35088. return c
  35089. }
  35090. // Context sets the context to be used in this call's Do method. Any
  35091. // pending HTTP request will be aborted if the provided context is
  35092. // canceled.
  35093. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  35094. c.ctx_ = ctx
  35095. return c
  35096. }
  35097. // Header returns an http.Header that can be modified by the caller to
  35098. // add HTTP headers to the request.
  35099. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  35100. if c.header_ == nil {
  35101. c.header_ = make(http.Header)
  35102. }
  35103. return c.header_
  35104. }
  35105. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35106. reqHeaders := make(http.Header)
  35107. for k, v := range c.header_ {
  35108. reqHeaders[k] = v
  35109. }
  35110. reqHeaders.Set("User-Agent", c.s.userAgent())
  35111. var body io.Reader = nil
  35112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  35113. if err != nil {
  35114. return nil, err
  35115. }
  35116. reqHeaders.Set("Content-Type", "application/json")
  35117. c.urlParams_.Set("alt", alt)
  35118. c.urlParams_.Set("prettyPrint", "false")
  35119. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  35120. urls += "?" + c.urlParams_.Encode()
  35121. req, err := http.NewRequest("PUT", urls, body)
  35122. if err != nil {
  35123. return nil, err
  35124. }
  35125. req.Header = reqHeaders
  35126. googleapi.Expand(req.URL, map[string]string{
  35127. "profileId": strconv.FormatInt(c.profileId, 10),
  35128. })
  35129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35130. }
  35131. // Do executes the "dfareporting.placementGroups.update" call.
  35132. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  35133. // status code is an error. Response headers are in either
  35134. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  35135. // at all) in error.(*googleapi.Error).Header. Use
  35136. // googleapi.IsNotModified to check whether the returned error was
  35137. // because http.StatusNotModified was returned.
  35138. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  35139. gensupport.SetOptions(c.urlParams_, opts...)
  35140. res, err := c.doRequest("json")
  35141. if res != nil && res.StatusCode == http.StatusNotModified {
  35142. if res.Body != nil {
  35143. res.Body.Close()
  35144. }
  35145. return nil, &googleapi.Error{
  35146. Code: res.StatusCode,
  35147. Header: res.Header,
  35148. }
  35149. }
  35150. if err != nil {
  35151. return nil, err
  35152. }
  35153. defer googleapi.CloseBody(res)
  35154. if err := googleapi.CheckResponse(res); err != nil {
  35155. return nil, err
  35156. }
  35157. ret := &PlacementGroup{
  35158. ServerResponse: googleapi.ServerResponse{
  35159. Header: res.Header,
  35160. HTTPStatusCode: res.StatusCode,
  35161. },
  35162. }
  35163. target := &ret
  35164. if err := gensupport.DecodeResponse(target, res); err != nil {
  35165. return nil, err
  35166. }
  35167. return ret, nil
  35168. // {
  35169. // "description": "Updates an existing placement group.",
  35170. // "httpMethod": "PUT",
  35171. // "id": "dfareporting.placementGroups.update",
  35172. // "parameterOrder": [
  35173. // "profileId"
  35174. // ],
  35175. // "parameters": {
  35176. // "profileId": {
  35177. // "description": "User profile ID associated with this request.",
  35178. // "format": "int64",
  35179. // "location": "path",
  35180. // "required": true,
  35181. // "type": "string"
  35182. // }
  35183. // },
  35184. // "path": "userprofiles/{profileId}/placementGroups",
  35185. // "request": {
  35186. // "$ref": "PlacementGroup"
  35187. // },
  35188. // "response": {
  35189. // "$ref": "PlacementGroup"
  35190. // },
  35191. // "scopes": [
  35192. // "https://www.googleapis.com/auth/dfatrafficking"
  35193. // ]
  35194. // }
  35195. }
  35196. // method id "dfareporting.placementStrategies.delete":
  35197. type PlacementStrategiesDeleteCall struct {
  35198. s *Service
  35199. profileId int64
  35200. id int64
  35201. urlParams_ gensupport.URLParams
  35202. ctx_ context.Context
  35203. header_ http.Header
  35204. }
  35205. // Delete: Deletes an existing placement strategy.
  35206. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  35207. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35208. c.profileId = profileId
  35209. c.id = id
  35210. return c
  35211. }
  35212. // Fields allows partial responses to be retrieved. See
  35213. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35214. // for more information.
  35215. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  35216. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35217. return c
  35218. }
  35219. // Context sets the context to be used in this call's Do method. Any
  35220. // pending HTTP request will be aborted if the provided context is
  35221. // canceled.
  35222. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  35223. c.ctx_ = ctx
  35224. return c
  35225. }
  35226. // Header returns an http.Header that can be modified by the caller to
  35227. // add HTTP headers to the request.
  35228. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  35229. if c.header_ == nil {
  35230. c.header_ = make(http.Header)
  35231. }
  35232. return c.header_
  35233. }
  35234. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  35235. reqHeaders := make(http.Header)
  35236. for k, v := range c.header_ {
  35237. reqHeaders[k] = v
  35238. }
  35239. reqHeaders.Set("User-Agent", c.s.userAgent())
  35240. var body io.Reader = nil
  35241. c.urlParams_.Set("alt", alt)
  35242. c.urlParams_.Set("prettyPrint", "false")
  35243. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  35244. urls += "?" + c.urlParams_.Encode()
  35245. req, err := http.NewRequest("DELETE", urls, body)
  35246. if err != nil {
  35247. return nil, err
  35248. }
  35249. req.Header = reqHeaders
  35250. googleapi.Expand(req.URL, map[string]string{
  35251. "profileId": strconv.FormatInt(c.profileId, 10),
  35252. "id": strconv.FormatInt(c.id, 10),
  35253. })
  35254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35255. }
  35256. // Do executes the "dfareporting.placementStrategies.delete" call.
  35257. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  35258. gensupport.SetOptions(c.urlParams_, opts...)
  35259. res, err := c.doRequest("json")
  35260. if err != nil {
  35261. return err
  35262. }
  35263. defer googleapi.CloseBody(res)
  35264. if err := googleapi.CheckResponse(res); err != nil {
  35265. return err
  35266. }
  35267. return nil
  35268. // {
  35269. // "description": "Deletes an existing placement strategy.",
  35270. // "httpMethod": "DELETE",
  35271. // "id": "dfareporting.placementStrategies.delete",
  35272. // "parameterOrder": [
  35273. // "profileId",
  35274. // "id"
  35275. // ],
  35276. // "parameters": {
  35277. // "id": {
  35278. // "description": "Placement strategy ID.",
  35279. // "format": "int64",
  35280. // "location": "path",
  35281. // "required": true,
  35282. // "type": "string"
  35283. // },
  35284. // "profileId": {
  35285. // "description": "User profile ID associated with this request.",
  35286. // "format": "int64",
  35287. // "location": "path",
  35288. // "required": true,
  35289. // "type": "string"
  35290. // }
  35291. // },
  35292. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  35293. // "scopes": [
  35294. // "https://www.googleapis.com/auth/dfatrafficking"
  35295. // ]
  35296. // }
  35297. }
  35298. // method id "dfareporting.placementStrategies.get":
  35299. type PlacementStrategiesGetCall struct {
  35300. s *Service
  35301. profileId int64
  35302. id int64
  35303. urlParams_ gensupport.URLParams
  35304. ifNoneMatch_ string
  35305. ctx_ context.Context
  35306. header_ http.Header
  35307. }
  35308. // Get: Gets one placement strategy by ID.
  35309. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  35310. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35311. c.profileId = profileId
  35312. c.id = id
  35313. return c
  35314. }
  35315. // Fields allows partial responses to be retrieved. See
  35316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35317. // for more information.
  35318. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  35319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35320. return c
  35321. }
  35322. // IfNoneMatch sets the optional parameter which makes the operation
  35323. // fail if the object's ETag matches the given value. This is useful for
  35324. // getting updates only after the object has changed since the last
  35325. // request. Use googleapi.IsNotModified to check whether the response
  35326. // error from Do is the result of In-None-Match.
  35327. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  35328. c.ifNoneMatch_ = entityTag
  35329. return c
  35330. }
  35331. // Context sets the context to be used in this call's Do method. Any
  35332. // pending HTTP request will be aborted if the provided context is
  35333. // canceled.
  35334. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  35335. c.ctx_ = ctx
  35336. return c
  35337. }
  35338. // Header returns an http.Header that can be modified by the caller to
  35339. // add HTTP headers to the request.
  35340. func (c *PlacementStrategiesGetCall) Header() http.Header {
  35341. if c.header_ == nil {
  35342. c.header_ = make(http.Header)
  35343. }
  35344. return c.header_
  35345. }
  35346. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  35347. reqHeaders := make(http.Header)
  35348. for k, v := range c.header_ {
  35349. reqHeaders[k] = v
  35350. }
  35351. reqHeaders.Set("User-Agent", c.s.userAgent())
  35352. if c.ifNoneMatch_ != "" {
  35353. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35354. }
  35355. var body io.Reader = nil
  35356. c.urlParams_.Set("alt", alt)
  35357. c.urlParams_.Set("prettyPrint", "false")
  35358. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  35359. urls += "?" + c.urlParams_.Encode()
  35360. req, err := http.NewRequest("GET", urls, body)
  35361. if err != nil {
  35362. return nil, err
  35363. }
  35364. req.Header = reqHeaders
  35365. googleapi.Expand(req.URL, map[string]string{
  35366. "profileId": strconv.FormatInt(c.profileId, 10),
  35367. "id": strconv.FormatInt(c.id, 10),
  35368. })
  35369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35370. }
  35371. // Do executes the "dfareporting.placementStrategies.get" call.
  35372. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35373. // non-2xx status code is an error. Response headers are in either
  35374. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35375. // returned at all) in error.(*googleapi.Error).Header. Use
  35376. // googleapi.IsNotModified to check whether the returned error was
  35377. // because http.StatusNotModified was returned.
  35378. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35379. gensupport.SetOptions(c.urlParams_, opts...)
  35380. res, err := c.doRequest("json")
  35381. if res != nil && res.StatusCode == http.StatusNotModified {
  35382. if res.Body != nil {
  35383. res.Body.Close()
  35384. }
  35385. return nil, &googleapi.Error{
  35386. Code: res.StatusCode,
  35387. Header: res.Header,
  35388. }
  35389. }
  35390. if err != nil {
  35391. return nil, err
  35392. }
  35393. defer googleapi.CloseBody(res)
  35394. if err := googleapi.CheckResponse(res); err != nil {
  35395. return nil, err
  35396. }
  35397. ret := &PlacementStrategy{
  35398. ServerResponse: googleapi.ServerResponse{
  35399. Header: res.Header,
  35400. HTTPStatusCode: res.StatusCode,
  35401. },
  35402. }
  35403. target := &ret
  35404. if err := gensupport.DecodeResponse(target, res); err != nil {
  35405. return nil, err
  35406. }
  35407. return ret, nil
  35408. // {
  35409. // "description": "Gets one placement strategy by ID.",
  35410. // "httpMethod": "GET",
  35411. // "id": "dfareporting.placementStrategies.get",
  35412. // "parameterOrder": [
  35413. // "profileId",
  35414. // "id"
  35415. // ],
  35416. // "parameters": {
  35417. // "id": {
  35418. // "description": "Placement strategy ID.",
  35419. // "format": "int64",
  35420. // "location": "path",
  35421. // "required": true,
  35422. // "type": "string"
  35423. // },
  35424. // "profileId": {
  35425. // "description": "User profile ID associated with this request.",
  35426. // "format": "int64",
  35427. // "location": "path",
  35428. // "required": true,
  35429. // "type": "string"
  35430. // }
  35431. // },
  35432. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  35433. // "response": {
  35434. // "$ref": "PlacementStrategy"
  35435. // },
  35436. // "scopes": [
  35437. // "https://www.googleapis.com/auth/dfatrafficking"
  35438. // ]
  35439. // }
  35440. }
  35441. // method id "dfareporting.placementStrategies.insert":
  35442. type PlacementStrategiesInsertCall struct {
  35443. s *Service
  35444. profileId int64
  35445. placementstrategy *PlacementStrategy
  35446. urlParams_ gensupport.URLParams
  35447. ctx_ context.Context
  35448. header_ http.Header
  35449. }
  35450. // Insert: Inserts a new placement strategy.
  35451. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  35452. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35453. c.profileId = profileId
  35454. c.placementstrategy = placementstrategy
  35455. return c
  35456. }
  35457. // Fields allows partial responses to be retrieved. See
  35458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35459. // for more information.
  35460. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  35461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35462. return c
  35463. }
  35464. // Context sets the context to be used in this call's Do method. Any
  35465. // pending HTTP request will be aborted if the provided context is
  35466. // canceled.
  35467. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  35468. c.ctx_ = ctx
  35469. return c
  35470. }
  35471. // Header returns an http.Header that can be modified by the caller to
  35472. // add HTTP headers to the request.
  35473. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  35474. if c.header_ == nil {
  35475. c.header_ = make(http.Header)
  35476. }
  35477. return c.header_
  35478. }
  35479. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  35480. reqHeaders := make(http.Header)
  35481. for k, v := range c.header_ {
  35482. reqHeaders[k] = v
  35483. }
  35484. reqHeaders.Set("User-Agent", c.s.userAgent())
  35485. var body io.Reader = nil
  35486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35487. if err != nil {
  35488. return nil, err
  35489. }
  35490. reqHeaders.Set("Content-Type", "application/json")
  35491. c.urlParams_.Set("alt", alt)
  35492. c.urlParams_.Set("prettyPrint", "false")
  35493. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35494. urls += "?" + c.urlParams_.Encode()
  35495. req, err := http.NewRequest("POST", urls, body)
  35496. if err != nil {
  35497. return nil, err
  35498. }
  35499. req.Header = reqHeaders
  35500. googleapi.Expand(req.URL, map[string]string{
  35501. "profileId": strconv.FormatInt(c.profileId, 10),
  35502. })
  35503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35504. }
  35505. // Do executes the "dfareporting.placementStrategies.insert" call.
  35506. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35507. // non-2xx status code is an error. Response headers are in either
  35508. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35509. // returned at all) in error.(*googleapi.Error).Header. Use
  35510. // googleapi.IsNotModified to check whether the returned error was
  35511. // because http.StatusNotModified was returned.
  35512. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35513. gensupport.SetOptions(c.urlParams_, opts...)
  35514. res, err := c.doRequest("json")
  35515. if res != nil && res.StatusCode == http.StatusNotModified {
  35516. if res.Body != nil {
  35517. res.Body.Close()
  35518. }
  35519. return nil, &googleapi.Error{
  35520. Code: res.StatusCode,
  35521. Header: res.Header,
  35522. }
  35523. }
  35524. if err != nil {
  35525. return nil, err
  35526. }
  35527. defer googleapi.CloseBody(res)
  35528. if err := googleapi.CheckResponse(res); err != nil {
  35529. return nil, err
  35530. }
  35531. ret := &PlacementStrategy{
  35532. ServerResponse: googleapi.ServerResponse{
  35533. Header: res.Header,
  35534. HTTPStatusCode: res.StatusCode,
  35535. },
  35536. }
  35537. target := &ret
  35538. if err := gensupport.DecodeResponse(target, res); err != nil {
  35539. return nil, err
  35540. }
  35541. return ret, nil
  35542. // {
  35543. // "description": "Inserts a new placement strategy.",
  35544. // "httpMethod": "POST",
  35545. // "id": "dfareporting.placementStrategies.insert",
  35546. // "parameterOrder": [
  35547. // "profileId"
  35548. // ],
  35549. // "parameters": {
  35550. // "profileId": {
  35551. // "description": "User profile ID associated with this request.",
  35552. // "format": "int64",
  35553. // "location": "path",
  35554. // "required": true,
  35555. // "type": "string"
  35556. // }
  35557. // },
  35558. // "path": "userprofiles/{profileId}/placementStrategies",
  35559. // "request": {
  35560. // "$ref": "PlacementStrategy"
  35561. // },
  35562. // "response": {
  35563. // "$ref": "PlacementStrategy"
  35564. // },
  35565. // "scopes": [
  35566. // "https://www.googleapis.com/auth/dfatrafficking"
  35567. // ]
  35568. // }
  35569. }
  35570. // method id "dfareporting.placementStrategies.list":
  35571. type PlacementStrategiesListCall struct {
  35572. s *Service
  35573. profileId int64
  35574. urlParams_ gensupport.URLParams
  35575. ifNoneMatch_ string
  35576. ctx_ context.Context
  35577. header_ http.Header
  35578. }
  35579. // List: Retrieves a list of placement strategies, possibly filtered.
  35580. // This method supports paging.
  35581. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  35582. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35583. c.profileId = profileId
  35584. return c
  35585. }
  35586. // Ids sets the optional parameter "ids": Select only placement
  35587. // strategies with these IDs.
  35588. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  35589. var ids_ []string
  35590. for _, v := range ids {
  35591. ids_ = append(ids_, fmt.Sprint(v))
  35592. }
  35593. c.urlParams_.SetMulti("ids", ids_)
  35594. return c
  35595. }
  35596. // MaxResults sets the optional parameter "maxResults": Maximum number
  35597. // of results to return.
  35598. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  35599. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35600. return c
  35601. }
  35602. // PageToken sets the optional parameter "pageToken": Value of the
  35603. // nextPageToken from the previous result page.
  35604. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  35605. c.urlParams_.Set("pageToken", pageToken)
  35606. return c
  35607. }
  35608. // SearchString sets the optional parameter "searchString": Allows
  35609. // searching for objects by name or ID. Wildcards (*) are allowed. For
  35610. // example, "placementstrategy*2015" will return objects with names like
  35611. // "placementstrategy June 2015", "placementstrategy April 2015", or
  35612. // simply "placementstrategy 2015". Most of the searches also add
  35613. // wildcards implicitly at the start and the end of the search string.
  35614. // For example, a search string of "placementstrategy" will match
  35615. // objects with name "my placementstrategy", "placementstrategy 2015",
  35616. // or simply "placementstrategy".
  35617. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  35618. c.urlParams_.Set("searchString", searchString)
  35619. return c
  35620. }
  35621. // SortField sets the optional parameter "sortField": Field by which to
  35622. // sort the list.
  35623. //
  35624. // Possible values:
  35625. // "ID" (default)
  35626. // "NAME"
  35627. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  35628. c.urlParams_.Set("sortField", sortField)
  35629. return c
  35630. }
  35631. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35632. // results.
  35633. //
  35634. // Possible values:
  35635. // "ASCENDING" (default)
  35636. // "DESCENDING"
  35637. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  35638. c.urlParams_.Set("sortOrder", sortOrder)
  35639. return c
  35640. }
  35641. // Fields allows partial responses to be retrieved. See
  35642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35643. // for more information.
  35644. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  35645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35646. return c
  35647. }
  35648. // IfNoneMatch sets the optional parameter which makes the operation
  35649. // fail if the object's ETag matches the given value. This is useful for
  35650. // getting updates only after the object has changed since the last
  35651. // request. Use googleapi.IsNotModified to check whether the response
  35652. // error from Do is the result of In-None-Match.
  35653. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  35654. c.ifNoneMatch_ = entityTag
  35655. return c
  35656. }
  35657. // Context sets the context to be used in this call's Do method. Any
  35658. // pending HTTP request will be aborted if the provided context is
  35659. // canceled.
  35660. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  35661. c.ctx_ = ctx
  35662. return c
  35663. }
  35664. // Header returns an http.Header that can be modified by the caller to
  35665. // add HTTP headers to the request.
  35666. func (c *PlacementStrategiesListCall) Header() http.Header {
  35667. if c.header_ == nil {
  35668. c.header_ = make(http.Header)
  35669. }
  35670. return c.header_
  35671. }
  35672. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  35673. reqHeaders := make(http.Header)
  35674. for k, v := range c.header_ {
  35675. reqHeaders[k] = v
  35676. }
  35677. reqHeaders.Set("User-Agent", c.s.userAgent())
  35678. if c.ifNoneMatch_ != "" {
  35679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35680. }
  35681. var body io.Reader = nil
  35682. c.urlParams_.Set("alt", alt)
  35683. c.urlParams_.Set("prettyPrint", "false")
  35684. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35685. urls += "?" + c.urlParams_.Encode()
  35686. req, err := http.NewRequest("GET", urls, body)
  35687. if err != nil {
  35688. return nil, err
  35689. }
  35690. req.Header = reqHeaders
  35691. googleapi.Expand(req.URL, map[string]string{
  35692. "profileId": strconv.FormatInt(c.profileId, 10),
  35693. })
  35694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35695. }
  35696. // Do executes the "dfareporting.placementStrategies.list" call.
  35697. // Exactly one of *PlacementStrategiesListResponse or error will be
  35698. // non-nil. Any non-2xx status code is an error. Response headers are in
  35699. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  35700. // a response was returned at all) in error.(*googleapi.Error).Header.
  35701. // Use googleapi.IsNotModified to check whether the returned error was
  35702. // because http.StatusNotModified was returned.
  35703. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  35704. gensupport.SetOptions(c.urlParams_, opts...)
  35705. res, err := c.doRequest("json")
  35706. if res != nil && res.StatusCode == http.StatusNotModified {
  35707. if res.Body != nil {
  35708. res.Body.Close()
  35709. }
  35710. return nil, &googleapi.Error{
  35711. Code: res.StatusCode,
  35712. Header: res.Header,
  35713. }
  35714. }
  35715. if err != nil {
  35716. return nil, err
  35717. }
  35718. defer googleapi.CloseBody(res)
  35719. if err := googleapi.CheckResponse(res); err != nil {
  35720. return nil, err
  35721. }
  35722. ret := &PlacementStrategiesListResponse{
  35723. ServerResponse: googleapi.ServerResponse{
  35724. Header: res.Header,
  35725. HTTPStatusCode: res.StatusCode,
  35726. },
  35727. }
  35728. target := &ret
  35729. if err := gensupport.DecodeResponse(target, res); err != nil {
  35730. return nil, err
  35731. }
  35732. return ret, nil
  35733. // {
  35734. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  35735. // "httpMethod": "GET",
  35736. // "id": "dfareporting.placementStrategies.list",
  35737. // "parameterOrder": [
  35738. // "profileId"
  35739. // ],
  35740. // "parameters": {
  35741. // "ids": {
  35742. // "description": "Select only placement strategies with these IDs.",
  35743. // "format": "int64",
  35744. // "location": "query",
  35745. // "repeated": true,
  35746. // "type": "string"
  35747. // },
  35748. // "maxResults": {
  35749. // "default": "1000",
  35750. // "description": "Maximum number of results to return.",
  35751. // "format": "int32",
  35752. // "location": "query",
  35753. // "maximum": "1000",
  35754. // "minimum": "0",
  35755. // "type": "integer"
  35756. // },
  35757. // "pageToken": {
  35758. // "description": "Value of the nextPageToken from the previous result page.",
  35759. // "location": "query",
  35760. // "type": "string"
  35761. // },
  35762. // "profileId": {
  35763. // "description": "User profile ID associated with this request.",
  35764. // "format": "int64",
  35765. // "location": "path",
  35766. // "required": true,
  35767. // "type": "string"
  35768. // },
  35769. // "searchString": {
  35770. // "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\".",
  35771. // "location": "query",
  35772. // "type": "string"
  35773. // },
  35774. // "sortField": {
  35775. // "default": "ID",
  35776. // "description": "Field by which to sort the list.",
  35777. // "enum": [
  35778. // "ID",
  35779. // "NAME"
  35780. // ],
  35781. // "enumDescriptions": [
  35782. // "",
  35783. // ""
  35784. // ],
  35785. // "location": "query",
  35786. // "type": "string"
  35787. // },
  35788. // "sortOrder": {
  35789. // "default": "ASCENDING",
  35790. // "description": "Order of sorted results.",
  35791. // "enum": [
  35792. // "ASCENDING",
  35793. // "DESCENDING"
  35794. // ],
  35795. // "enumDescriptions": [
  35796. // "",
  35797. // ""
  35798. // ],
  35799. // "location": "query",
  35800. // "type": "string"
  35801. // }
  35802. // },
  35803. // "path": "userprofiles/{profileId}/placementStrategies",
  35804. // "response": {
  35805. // "$ref": "PlacementStrategiesListResponse"
  35806. // },
  35807. // "scopes": [
  35808. // "https://www.googleapis.com/auth/dfatrafficking"
  35809. // ]
  35810. // }
  35811. }
  35812. // Pages invokes f for each page of results.
  35813. // A non-nil error returned from f will halt the iteration.
  35814. // The provided context supersedes any context provided to the Context method.
  35815. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  35816. c.ctx_ = ctx
  35817. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35818. for {
  35819. x, err := c.Do()
  35820. if err != nil {
  35821. return err
  35822. }
  35823. if err := f(x); err != nil {
  35824. return err
  35825. }
  35826. if x.NextPageToken == "" {
  35827. return nil
  35828. }
  35829. c.PageToken(x.NextPageToken)
  35830. }
  35831. }
  35832. // method id "dfareporting.placementStrategies.patch":
  35833. type PlacementStrategiesPatchCall struct {
  35834. s *Service
  35835. profileId int64
  35836. placementstrategy *PlacementStrategy
  35837. urlParams_ gensupport.URLParams
  35838. ctx_ context.Context
  35839. header_ http.Header
  35840. }
  35841. // Patch: Updates an existing placement strategy. This method supports
  35842. // patch semantics.
  35843. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  35844. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35845. c.profileId = profileId
  35846. c.urlParams_.Set("id", fmt.Sprint(id))
  35847. c.placementstrategy = placementstrategy
  35848. return c
  35849. }
  35850. // Fields allows partial responses to be retrieved. See
  35851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35852. // for more information.
  35853. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  35854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35855. return c
  35856. }
  35857. // Context sets the context to be used in this call's Do method. Any
  35858. // pending HTTP request will be aborted if the provided context is
  35859. // canceled.
  35860. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  35861. c.ctx_ = ctx
  35862. return c
  35863. }
  35864. // Header returns an http.Header that can be modified by the caller to
  35865. // add HTTP headers to the request.
  35866. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  35867. if c.header_ == nil {
  35868. c.header_ = make(http.Header)
  35869. }
  35870. return c.header_
  35871. }
  35872. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  35873. reqHeaders := make(http.Header)
  35874. for k, v := range c.header_ {
  35875. reqHeaders[k] = v
  35876. }
  35877. reqHeaders.Set("User-Agent", c.s.userAgent())
  35878. var body io.Reader = nil
  35879. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35880. if err != nil {
  35881. return nil, err
  35882. }
  35883. reqHeaders.Set("Content-Type", "application/json")
  35884. c.urlParams_.Set("alt", alt)
  35885. c.urlParams_.Set("prettyPrint", "false")
  35886. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35887. urls += "?" + c.urlParams_.Encode()
  35888. req, err := http.NewRequest("PATCH", urls, body)
  35889. if err != nil {
  35890. return nil, err
  35891. }
  35892. req.Header = reqHeaders
  35893. googleapi.Expand(req.URL, map[string]string{
  35894. "profileId": strconv.FormatInt(c.profileId, 10),
  35895. })
  35896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35897. }
  35898. // Do executes the "dfareporting.placementStrategies.patch" call.
  35899. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35900. // non-2xx status code is an error. Response headers are in either
  35901. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35902. // returned at all) in error.(*googleapi.Error).Header. Use
  35903. // googleapi.IsNotModified to check whether the returned error was
  35904. // because http.StatusNotModified was returned.
  35905. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35906. gensupport.SetOptions(c.urlParams_, opts...)
  35907. res, err := c.doRequest("json")
  35908. if res != nil && res.StatusCode == http.StatusNotModified {
  35909. if res.Body != nil {
  35910. res.Body.Close()
  35911. }
  35912. return nil, &googleapi.Error{
  35913. Code: res.StatusCode,
  35914. Header: res.Header,
  35915. }
  35916. }
  35917. if err != nil {
  35918. return nil, err
  35919. }
  35920. defer googleapi.CloseBody(res)
  35921. if err := googleapi.CheckResponse(res); err != nil {
  35922. return nil, err
  35923. }
  35924. ret := &PlacementStrategy{
  35925. ServerResponse: googleapi.ServerResponse{
  35926. Header: res.Header,
  35927. HTTPStatusCode: res.StatusCode,
  35928. },
  35929. }
  35930. target := &ret
  35931. if err := gensupport.DecodeResponse(target, res); err != nil {
  35932. return nil, err
  35933. }
  35934. return ret, nil
  35935. // {
  35936. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  35937. // "httpMethod": "PATCH",
  35938. // "id": "dfareporting.placementStrategies.patch",
  35939. // "parameterOrder": [
  35940. // "profileId",
  35941. // "id"
  35942. // ],
  35943. // "parameters": {
  35944. // "id": {
  35945. // "description": "Placement strategy ID.",
  35946. // "format": "int64",
  35947. // "location": "query",
  35948. // "required": true,
  35949. // "type": "string"
  35950. // },
  35951. // "profileId": {
  35952. // "description": "User profile ID associated with this request.",
  35953. // "format": "int64",
  35954. // "location": "path",
  35955. // "required": true,
  35956. // "type": "string"
  35957. // }
  35958. // },
  35959. // "path": "userprofiles/{profileId}/placementStrategies",
  35960. // "request": {
  35961. // "$ref": "PlacementStrategy"
  35962. // },
  35963. // "response": {
  35964. // "$ref": "PlacementStrategy"
  35965. // },
  35966. // "scopes": [
  35967. // "https://www.googleapis.com/auth/dfatrafficking"
  35968. // ]
  35969. // }
  35970. }
  35971. // method id "dfareporting.placementStrategies.update":
  35972. type PlacementStrategiesUpdateCall struct {
  35973. s *Service
  35974. profileId int64
  35975. placementstrategy *PlacementStrategy
  35976. urlParams_ gensupport.URLParams
  35977. ctx_ context.Context
  35978. header_ http.Header
  35979. }
  35980. // Update: Updates an existing placement strategy.
  35981. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  35982. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35983. c.profileId = profileId
  35984. c.placementstrategy = placementstrategy
  35985. return c
  35986. }
  35987. // Fields allows partial responses to be retrieved. See
  35988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35989. // for more information.
  35990. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  35991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35992. return c
  35993. }
  35994. // Context sets the context to be used in this call's Do method. Any
  35995. // pending HTTP request will be aborted if the provided context is
  35996. // canceled.
  35997. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  35998. c.ctx_ = ctx
  35999. return c
  36000. }
  36001. // Header returns an http.Header that can be modified by the caller to
  36002. // add HTTP headers to the request.
  36003. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  36004. if c.header_ == nil {
  36005. c.header_ = make(http.Header)
  36006. }
  36007. return c.header_
  36008. }
  36009. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  36010. reqHeaders := make(http.Header)
  36011. for k, v := range c.header_ {
  36012. reqHeaders[k] = v
  36013. }
  36014. reqHeaders.Set("User-Agent", c.s.userAgent())
  36015. var body io.Reader = nil
  36016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  36017. if err != nil {
  36018. return nil, err
  36019. }
  36020. reqHeaders.Set("Content-Type", "application/json")
  36021. c.urlParams_.Set("alt", alt)
  36022. c.urlParams_.Set("prettyPrint", "false")
  36023. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  36024. urls += "?" + c.urlParams_.Encode()
  36025. req, err := http.NewRequest("PUT", urls, body)
  36026. if err != nil {
  36027. return nil, err
  36028. }
  36029. req.Header = reqHeaders
  36030. googleapi.Expand(req.URL, map[string]string{
  36031. "profileId": strconv.FormatInt(c.profileId, 10),
  36032. })
  36033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36034. }
  36035. // Do executes the "dfareporting.placementStrategies.update" call.
  36036. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  36037. // non-2xx status code is an error. Response headers are in either
  36038. // *PlacementStrategy.ServerResponse.Header or (if a response was
  36039. // returned at all) in error.(*googleapi.Error).Header. Use
  36040. // googleapi.IsNotModified to check whether the returned error was
  36041. // because http.StatusNotModified was returned.
  36042. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  36043. gensupport.SetOptions(c.urlParams_, opts...)
  36044. res, err := c.doRequest("json")
  36045. if res != nil && res.StatusCode == http.StatusNotModified {
  36046. if res.Body != nil {
  36047. res.Body.Close()
  36048. }
  36049. return nil, &googleapi.Error{
  36050. Code: res.StatusCode,
  36051. Header: res.Header,
  36052. }
  36053. }
  36054. if err != nil {
  36055. return nil, err
  36056. }
  36057. defer googleapi.CloseBody(res)
  36058. if err := googleapi.CheckResponse(res); err != nil {
  36059. return nil, err
  36060. }
  36061. ret := &PlacementStrategy{
  36062. ServerResponse: googleapi.ServerResponse{
  36063. Header: res.Header,
  36064. HTTPStatusCode: res.StatusCode,
  36065. },
  36066. }
  36067. target := &ret
  36068. if err := gensupport.DecodeResponse(target, res); err != nil {
  36069. return nil, err
  36070. }
  36071. return ret, nil
  36072. // {
  36073. // "description": "Updates an existing placement strategy.",
  36074. // "httpMethod": "PUT",
  36075. // "id": "dfareporting.placementStrategies.update",
  36076. // "parameterOrder": [
  36077. // "profileId"
  36078. // ],
  36079. // "parameters": {
  36080. // "profileId": {
  36081. // "description": "User profile ID associated with this request.",
  36082. // "format": "int64",
  36083. // "location": "path",
  36084. // "required": true,
  36085. // "type": "string"
  36086. // }
  36087. // },
  36088. // "path": "userprofiles/{profileId}/placementStrategies",
  36089. // "request": {
  36090. // "$ref": "PlacementStrategy"
  36091. // },
  36092. // "response": {
  36093. // "$ref": "PlacementStrategy"
  36094. // },
  36095. // "scopes": [
  36096. // "https://www.googleapis.com/auth/dfatrafficking"
  36097. // ]
  36098. // }
  36099. }
  36100. // method id "dfareporting.placements.generatetags":
  36101. type PlacementsGeneratetagsCall struct {
  36102. s *Service
  36103. profileId int64
  36104. urlParams_ gensupport.URLParams
  36105. ctx_ context.Context
  36106. header_ http.Header
  36107. }
  36108. // Generatetags: Generates tags for a placement.
  36109. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  36110. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36111. c.profileId = profileId
  36112. return c
  36113. }
  36114. // CampaignId sets the optional parameter "campaignId": Generate
  36115. // placements belonging to this campaign. This is a required field.
  36116. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  36117. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  36118. return c
  36119. }
  36120. // PlacementIds sets the optional parameter "placementIds": Generate
  36121. // tags for these placements.
  36122. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  36123. var placementIds_ []string
  36124. for _, v := range placementIds {
  36125. placementIds_ = append(placementIds_, fmt.Sprint(v))
  36126. }
  36127. c.urlParams_.SetMulti("placementIds", placementIds_)
  36128. return c
  36129. }
  36130. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  36131. // generate for these placements.
  36132. //
  36133. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  36134. // placements.
  36135. //
  36136. // Possible values:
  36137. // "PLACEMENT_TAG_CLICK_COMMANDS"
  36138. // "PLACEMENT_TAG_IFRAME_ILAYER"
  36139. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  36140. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  36141. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  36142. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  36143. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  36144. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  36145. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  36146. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  36147. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  36148. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  36149. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  36150. // "PLACEMENT_TAG_JAVASCRIPT"
  36151. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  36152. // "PLACEMENT_TAG_STANDARD"
  36153. // "PLACEMENT_TAG_TRACKING"
  36154. // "PLACEMENT_TAG_TRACKING_IFRAME"
  36155. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  36156. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  36157. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  36158. return c
  36159. }
  36160. // Fields allows partial responses to be retrieved. See
  36161. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36162. // for more information.
  36163. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  36164. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36165. return c
  36166. }
  36167. // Context sets the context to be used in this call's Do method. Any
  36168. // pending HTTP request will be aborted if the provided context is
  36169. // canceled.
  36170. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  36171. c.ctx_ = ctx
  36172. return c
  36173. }
  36174. // Header returns an http.Header that can be modified by the caller to
  36175. // add HTTP headers to the request.
  36176. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  36177. if c.header_ == nil {
  36178. c.header_ = make(http.Header)
  36179. }
  36180. return c.header_
  36181. }
  36182. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  36183. reqHeaders := make(http.Header)
  36184. for k, v := range c.header_ {
  36185. reqHeaders[k] = v
  36186. }
  36187. reqHeaders.Set("User-Agent", c.s.userAgent())
  36188. var body io.Reader = nil
  36189. c.urlParams_.Set("alt", alt)
  36190. c.urlParams_.Set("prettyPrint", "false")
  36191. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  36192. urls += "?" + c.urlParams_.Encode()
  36193. req, err := http.NewRequest("POST", urls, body)
  36194. if err != nil {
  36195. return nil, err
  36196. }
  36197. req.Header = reqHeaders
  36198. googleapi.Expand(req.URL, map[string]string{
  36199. "profileId": strconv.FormatInt(c.profileId, 10),
  36200. })
  36201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36202. }
  36203. // Do executes the "dfareporting.placements.generatetags" call.
  36204. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  36205. // non-nil. Any non-2xx status code is an error. Response headers are in
  36206. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  36207. // response was returned at all) in error.(*googleapi.Error).Header. Use
  36208. // googleapi.IsNotModified to check whether the returned error was
  36209. // because http.StatusNotModified was returned.
  36210. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  36211. gensupport.SetOptions(c.urlParams_, opts...)
  36212. res, err := c.doRequest("json")
  36213. if res != nil && res.StatusCode == http.StatusNotModified {
  36214. if res.Body != nil {
  36215. res.Body.Close()
  36216. }
  36217. return nil, &googleapi.Error{
  36218. Code: res.StatusCode,
  36219. Header: res.Header,
  36220. }
  36221. }
  36222. if err != nil {
  36223. return nil, err
  36224. }
  36225. defer googleapi.CloseBody(res)
  36226. if err := googleapi.CheckResponse(res); err != nil {
  36227. return nil, err
  36228. }
  36229. ret := &PlacementsGenerateTagsResponse{
  36230. ServerResponse: googleapi.ServerResponse{
  36231. Header: res.Header,
  36232. HTTPStatusCode: res.StatusCode,
  36233. },
  36234. }
  36235. target := &ret
  36236. if err := gensupport.DecodeResponse(target, res); err != nil {
  36237. return nil, err
  36238. }
  36239. return ret, nil
  36240. // {
  36241. // "description": "Generates tags for a placement.",
  36242. // "httpMethod": "POST",
  36243. // "id": "dfareporting.placements.generatetags",
  36244. // "parameterOrder": [
  36245. // "profileId"
  36246. // ],
  36247. // "parameters": {
  36248. // "campaignId": {
  36249. // "description": "Generate placements belonging to this campaign. This is a required field.",
  36250. // "format": "int64",
  36251. // "location": "query",
  36252. // "type": "string"
  36253. // },
  36254. // "placementIds": {
  36255. // "description": "Generate tags for these placements.",
  36256. // "format": "int64",
  36257. // "location": "query",
  36258. // "repeated": true,
  36259. // "type": "string"
  36260. // },
  36261. // "profileId": {
  36262. // "description": "User profile ID associated with this request.",
  36263. // "format": "int64",
  36264. // "location": "path",
  36265. // "required": true,
  36266. // "type": "string"
  36267. // },
  36268. // "tagFormats": {
  36269. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  36270. // "enum": [
  36271. // "PLACEMENT_TAG_CLICK_COMMANDS",
  36272. // "PLACEMENT_TAG_IFRAME_ILAYER",
  36273. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  36274. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  36275. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  36276. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  36277. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  36278. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  36279. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  36280. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  36281. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  36282. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  36283. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  36284. // "PLACEMENT_TAG_JAVASCRIPT",
  36285. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  36286. // "PLACEMENT_TAG_STANDARD",
  36287. // "PLACEMENT_TAG_TRACKING",
  36288. // "PLACEMENT_TAG_TRACKING_IFRAME",
  36289. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  36290. // ],
  36291. // "enumDescriptions": [
  36292. // "",
  36293. // "",
  36294. // "",
  36295. // "",
  36296. // "",
  36297. // "",
  36298. // "",
  36299. // "",
  36300. // "",
  36301. // "",
  36302. // "",
  36303. // "",
  36304. // "",
  36305. // "",
  36306. // "",
  36307. // "",
  36308. // "",
  36309. // "",
  36310. // ""
  36311. // ],
  36312. // "location": "query",
  36313. // "repeated": true,
  36314. // "type": "string"
  36315. // }
  36316. // },
  36317. // "path": "userprofiles/{profileId}/placements/generatetags",
  36318. // "response": {
  36319. // "$ref": "PlacementsGenerateTagsResponse"
  36320. // },
  36321. // "scopes": [
  36322. // "https://www.googleapis.com/auth/dfatrafficking"
  36323. // ]
  36324. // }
  36325. }
  36326. // method id "dfareporting.placements.get":
  36327. type PlacementsGetCall struct {
  36328. s *Service
  36329. profileId int64
  36330. id int64
  36331. urlParams_ gensupport.URLParams
  36332. ifNoneMatch_ string
  36333. ctx_ context.Context
  36334. header_ http.Header
  36335. }
  36336. // Get: Gets one placement by ID.
  36337. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  36338. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36339. c.profileId = profileId
  36340. c.id = id
  36341. return c
  36342. }
  36343. // Fields allows partial responses to be retrieved. See
  36344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36345. // for more information.
  36346. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  36347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36348. return c
  36349. }
  36350. // IfNoneMatch sets the optional parameter which makes the operation
  36351. // fail if the object's ETag matches the given value. This is useful for
  36352. // getting updates only after the object has changed since the last
  36353. // request. Use googleapi.IsNotModified to check whether the response
  36354. // error from Do is the result of In-None-Match.
  36355. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  36356. c.ifNoneMatch_ = entityTag
  36357. return c
  36358. }
  36359. // Context sets the context to be used in this call's Do method. Any
  36360. // pending HTTP request will be aborted if the provided context is
  36361. // canceled.
  36362. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  36363. c.ctx_ = ctx
  36364. return c
  36365. }
  36366. // Header returns an http.Header that can be modified by the caller to
  36367. // add HTTP headers to the request.
  36368. func (c *PlacementsGetCall) Header() http.Header {
  36369. if c.header_ == nil {
  36370. c.header_ = make(http.Header)
  36371. }
  36372. return c.header_
  36373. }
  36374. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  36375. reqHeaders := make(http.Header)
  36376. for k, v := range c.header_ {
  36377. reqHeaders[k] = v
  36378. }
  36379. reqHeaders.Set("User-Agent", c.s.userAgent())
  36380. if c.ifNoneMatch_ != "" {
  36381. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36382. }
  36383. var body io.Reader = nil
  36384. c.urlParams_.Set("alt", alt)
  36385. c.urlParams_.Set("prettyPrint", "false")
  36386. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  36387. urls += "?" + c.urlParams_.Encode()
  36388. req, err := http.NewRequest("GET", urls, body)
  36389. if err != nil {
  36390. return nil, err
  36391. }
  36392. req.Header = reqHeaders
  36393. googleapi.Expand(req.URL, map[string]string{
  36394. "profileId": strconv.FormatInt(c.profileId, 10),
  36395. "id": strconv.FormatInt(c.id, 10),
  36396. })
  36397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36398. }
  36399. // Do executes the "dfareporting.placements.get" call.
  36400. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36401. // status code is an error. Response headers are in either
  36402. // *Placement.ServerResponse.Header or (if a response was returned at
  36403. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36404. // to check whether the returned error was because
  36405. // http.StatusNotModified was returned.
  36406. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36407. gensupport.SetOptions(c.urlParams_, opts...)
  36408. res, err := c.doRequest("json")
  36409. if res != nil && res.StatusCode == http.StatusNotModified {
  36410. if res.Body != nil {
  36411. res.Body.Close()
  36412. }
  36413. return nil, &googleapi.Error{
  36414. Code: res.StatusCode,
  36415. Header: res.Header,
  36416. }
  36417. }
  36418. if err != nil {
  36419. return nil, err
  36420. }
  36421. defer googleapi.CloseBody(res)
  36422. if err := googleapi.CheckResponse(res); err != nil {
  36423. return nil, err
  36424. }
  36425. ret := &Placement{
  36426. ServerResponse: googleapi.ServerResponse{
  36427. Header: res.Header,
  36428. HTTPStatusCode: res.StatusCode,
  36429. },
  36430. }
  36431. target := &ret
  36432. if err := gensupport.DecodeResponse(target, res); err != nil {
  36433. return nil, err
  36434. }
  36435. return ret, nil
  36436. // {
  36437. // "description": "Gets one placement by ID.",
  36438. // "httpMethod": "GET",
  36439. // "id": "dfareporting.placements.get",
  36440. // "parameterOrder": [
  36441. // "profileId",
  36442. // "id"
  36443. // ],
  36444. // "parameters": {
  36445. // "id": {
  36446. // "description": "Placement ID.",
  36447. // "format": "int64",
  36448. // "location": "path",
  36449. // "required": true,
  36450. // "type": "string"
  36451. // },
  36452. // "profileId": {
  36453. // "description": "User profile ID associated with this request.",
  36454. // "format": "int64",
  36455. // "location": "path",
  36456. // "required": true,
  36457. // "type": "string"
  36458. // }
  36459. // },
  36460. // "path": "userprofiles/{profileId}/placements/{id}",
  36461. // "response": {
  36462. // "$ref": "Placement"
  36463. // },
  36464. // "scopes": [
  36465. // "https://www.googleapis.com/auth/dfatrafficking"
  36466. // ]
  36467. // }
  36468. }
  36469. // method id "dfareporting.placements.insert":
  36470. type PlacementsInsertCall struct {
  36471. s *Service
  36472. profileId int64
  36473. placement *Placement
  36474. urlParams_ gensupport.URLParams
  36475. ctx_ context.Context
  36476. header_ http.Header
  36477. }
  36478. // Insert: Inserts a new placement.
  36479. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  36480. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36481. c.profileId = profileId
  36482. c.placement = placement
  36483. return c
  36484. }
  36485. // Fields allows partial responses to be retrieved. See
  36486. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36487. // for more information.
  36488. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  36489. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36490. return c
  36491. }
  36492. // Context sets the context to be used in this call's Do method. Any
  36493. // pending HTTP request will be aborted if the provided context is
  36494. // canceled.
  36495. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  36496. c.ctx_ = ctx
  36497. return c
  36498. }
  36499. // Header returns an http.Header that can be modified by the caller to
  36500. // add HTTP headers to the request.
  36501. func (c *PlacementsInsertCall) Header() http.Header {
  36502. if c.header_ == nil {
  36503. c.header_ = make(http.Header)
  36504. }
  36505. return c.header_
  36506. }
  36507. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  36508. reqHeaders := make(http.Header)
  36509. for k, v := range c.header_ {
  36510. reqHeaders[k] = v
  36511. }
  36512. reqHeaders.Set("User-Agent", c.s.userAgent())
  36513. var body io.Reader = nil
  36514. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36515. if err != nil {
  36516. return nil, err
  36517. }
  36518. reqHeaders.Set("Content-Type", "application/json")
  36519. c.urlParams_.Set("alt", alt)
  36520. c.urlParams_.Set("prettyPrint", "false")
  36521. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36522. urls += "?" + c.urlParams_.Encode()
  36523. req, err := http.NewRequest("POST", urls, body)
  36524. if err != nil {
  36525. return nil, err
  36526. }
  36527. req.Header = reqHeaders
  36528. googleapi.Expand(req.URL, map[string]string{
  36529. "profileId": strconv.FormatInt(c.profileId, 10),
  36530. })
  36531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36532. }
  36533. // Do executes the "dfareporting.placements.insert" call.
  36534. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36535. // status code is an error. Response headers are in either
  36536. // *Placement.ServerResponse.Header or (if a response was returned at
  36537. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36538. // to check whether the returned error was because
  36539. // http.StatusNotModified was returned.
  36540. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36541. gensupport.SetOptions(c.urlParams_, opts...)
  36542. res, err := c.doRequest("json")
  36543. if res != nil && res.StatusCode == http.StatusNotModified {
  36544. if res.Body != nil {
  36545. res.Body.Close()
  36546. }
  36547. return nil, &googleapi.Error{
  36548. Code: res.StatusCode,
  36549. Header: res.Header,
  36550. }
  36551. }
  36552. if err != nil {
  36553. return nil, err
  36554. }
  36555. defer googleapi.CloseBody(res)
  36556. if err := googleapi.CheckResponse(res); err != nil {
  36557. return nil, err
  36558. }
  36559. ret := &Placement{
  36560. ServerResponse: googleapi.ServerResponse{
  36561. Header: res.Header,
  36562. HTTPStatusCode: res.StatusCode,
  36563. },
  36564. }
  36565. target := &ret
  36566. if err := gensupport.DecodeResponse(target, res); err != nil {
  36567. return nil, err
  36568. }
  36569. return ret, nil
  36570. // {
  36571. // "description": "Inserts a new placement.",
  36572. // "httpMethod": "POST",
  36573. // "id": "dfareporting.placements.insert",
  36574. // "parameterOrder": [
  36575. // "profileId"
  36576. // ],
  36577. // "parameters": {
  36578. // "profileId": {
  36579. // "description": "User profile ID associated with this request.",
  36580. // "format": "int64",
  36581. // "location": "path",
  36582. // "required": true,
  36583. // "type": "string"
  36584. // }
  36585. // },
  36586. // "path": "userprofiles/{profileId}/placements",
  36587. // "request": {
  36588. // "$ref": "Placement"
  36589. // },
  36590. // "response": {
  36591. // "$ref": "Placement"
  36592. // },
  36593. // "scopes": [
  36594. // "https://www.googleapis.com/auth/dfatrafficking"
  36595. // ]
  36596. // }
  36597. }
  36598. // method id "dfareporting.placements.list":
  36599. type PlacementsListCall struct {
  36600. s *Service
  36601. profileId int64
  36602. urlParams_ gensupport.URLParams
  36603. ifNoneMatch_ string
  36604. ctx_ context.Context
  36605. header_ http.Header
  36606. }
  36607. // List: Retrieves a list of placements, possibly filtered. This method
  36608. // supports paging.
  36609. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  36610. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36611. c.profileId = profileId
  36612. return c
  36613. }
  36614. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36615. // only placements that belong to these advertisers.
  36616. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  36617. var advertiserIds_ []string
  36618. for _, v := range advertiserIds {
  36619. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36620. }
  36621. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36622. return c
  36623. }
  36624. // Archived sets the optional parameter "archived": Select only archived
  36625. // placements. Don't set this field to select both archived and
  36626. // non-archived placements.
  36627. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  36628. c.urlParams_.Set("archived", fmt.Sprint(archived))
  36629. return c
  36630. }
  36631. // CampaignIds sets the optional parameter "campaignIds": Select only
  36632. // placements that belong to these campaigns.
  36633. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  36634. var campaignIds_ []string
  36635. for _, v := range campaignIds {
  36636. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  36637. }
  36638. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  36639. return c
  36640. }
  36641. // Compatibilities sets the optional parameter "compatibilities": Select
  36642. // only placements that are associated with these compatibilities.
  36643. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  36644. // or on mobile devices for regular or interstitial ads respectively.
  36645. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  36646. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  36647. // with the VAST standard.
  36648. //
  36649. // Possible values:
  36650. // "APP"
  36651. // "APP_INTERSTITIAL"
  36652. // "DISPLAY"
  36653. // "DISPLAY_INTERSTITIAL"
  36654. // "IN_STREAM_AUDIO"
  36655. // "IN_STREAM_VIDEO"
  36656. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  36657. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  36658. return c
  36659. }
  36660. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  36661. // Select only placements that are associated with these content
  36662. // categories.
  36663. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  36664. var contentCategoryIds_ []string
  36665. for _, v := range contentCategoryIds {
  36666. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  36667. }
  36668. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  36669. return c
  36670. }
  36671. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  36672. // Select only placements that are associated with these directory
  36673. // sites.
  36674. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  36675. var directorySiteIds_ []string
  36676. for _, v := range directorySiteIds {
  36677. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  36678. }
  36679. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  36680. return c
  36681. }
  36682. // GroupIds sets the optional parameter "groupIds": Select only
  36683. // placements that belong to these placement groups.
  36684. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  36685. var groupIds_ []string
  36686. for _, v := range groupIds {
  36687. groupIds_ = append(groupIds_, fmt.Sprint(v))
  36688. }
  36689. c.urlParams_.SetMulti("groupIds", groupIds_)
  36690. return c
  36691. }
  36692. // Ids sets the optional parameter "ids": Select only placements with
  36693. // these IDs.
  36694. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  36695. var ids_ []string
  36696. for _, v := range ids {
  36697. ids_ = append(ids_, fmt.Sprint(v))
  36698. }
  36699. c.urlParams_.SetMulti("ids", ids_)
  36700. return c
  36701. }
  36702. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  36703. // placements or placement groups whose end date is on or before the
  36704. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  36705. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  36706. c.urlParams_.Set("maxEndDate", maxEndDate)
  36707. return c
  36708. }
  36709. // MaxResults sets the optional parameter "maxResults": Maximum number
  36710. // of results to return.
  36711. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  36712. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36713. return c
  36714. }
  36715. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  36716. // placements or placement groups whose start date is on or before the
  36717. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  36718. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  36719. c.urlParams_.Set("maxStartDate", maxStartDate)
  36720. return c
  36721. }
  36722. // MinEndDate sets the optional parameter "minEndDate": Select only
  36723. // placements or placement groups whose end date is on or after the
  36724. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  36725. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  36726. c.urlParams_.Set("minEndDate", minEndDate)
  36727. return c
  36728. }
  36729. // MinStartDate sets the optional parameter "minStartDate": Select only
  36730. // placements or placement groups whose start date is on or after the
  36731. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  36732. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  36733. c.urlParams_.Set("minStartDate", minStartDate)
  36734. return c
  36735. }
  36736. // PageToken sets the optional parameter "pageToken": Value of the
  36737. // nextPageToken from the previous result page.
  36738. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  36739. c.urlParams_.Set("pageToken", pageToken)
  36740. return c
  36741. }
  36742. // PaymentSource sets the optional parameter "paymentSource": Select
  36743. // only placements with this payment source.
  36744. //
  36745. // Possible values:
  36746. // "PLACEMENT_AGENCY_PAID"
  36747. // "PLACEMENT_PUBLISHER_PAID"
  36748. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  36749. c.urlParams_.Set("paymentSource", paymentSource)
  36750. return c
  36751. }
  36752. // PlacementStrategyIds sets the optional parameter
  36753. // "placementStrategyIds": Select only placements that are associated
  36754. // with these placement strategies.
  36755. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  36756. var placementStrategyIds_ []string
  36757. for _, v := range placementStrategyIds {
  36758. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  36759. }
  36760. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  36761. return c
  36762. }
  36763. // PricingTypes sets the optional parameter "pricingTypes": Select only
  36764. // placements with these pricing types.
  36765. //
  36766. // Possible values:
  36767. // "PRICING_TYPE_CPA"
  36768. // "PRICING_TYPE_CPC"
  36769. // "PRICING_TYPE_CPM"
  36770. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  36771. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  36772. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36773. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  36774. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  36775. return c
  36776. }
  36777. // SearchString sets the optional parameter "searchString": Allows
  36778. // searching for placements by name or ID. Wildcards (*) are allowed.
  36779. // For example, "placement*2015" will return placements with names like
  36780. // "placement June 2015", "placement May 2015", or simply "placements
  36781. // 2015". Most of the searches also add wildcards implicitly at the
  36782. // start and the end of the search string. For example, a search string
  36783. // of "placement" will match placements with name "my placement",
  36784. // "placement 2015", or simply "placement".
  36785. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  36786. c.urlParams_.Set("searchString", searchString)
  36787. return c
  36788. }
  36789. // SiteIds sets the optional parameter "siteIds": Select only placements
  36790. // that are associated with these sites.
  36791. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  36792. var siteIds_ []string
  36793. for _, v := range siteIds {
  36794. siteIds_ = append(siteIds_, fmt.Sprint(v))
  36795. }
  36796. c.urlParams_.SetMulti("siteIds", siteIds_)
  36797. return c
  36798. }
  36799. // SizeIds sets the optional parameter "sizeIds": Select only placements
  36800. // that are associated with these sizes.
  36801. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  36802. var sizeIds_ []string
  36803. for _, v := range sizeIds {
  36804. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  36805. }
  36806. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  36807. return c
  36808. }
  36809. // SortField sets the optional parameter "sortField": Field by which to
  36810. // sort the list.
  36811. //
  36812. // Possible values:
  36813. // "ID" (default)
  36814. // "NAME"
  36815. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  36816. c.urlParams_.Set("sortField", sortField)
  36817. return c
  36818. }
  36819. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36820. // results.
  36821. //
  36822. // Possible values:
  36823. // "ASCENDING" (default)
  36824. // "DESCENDING"
  36825. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  36826. c.urlParams_.Set("sortOrder", sortOrder)
  36827. return c
  36828. }
  36829. // Fields allows partial responses to be retrieved. See
  36830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36831. // for more information.
  36832. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  36833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36834. return c
  36835. }
  36836. // IfNoneMatch sets the optional parameter which makes the operation
  36837. // fail if the object's ETag matches the given value. This is useful for
  36838. // getting updates only after the object has changed since the last
  36839. // request. Use googleapi.IsNotModified to check whether the response
  36840. // error from Do is the result of In-None-Match.
  36841. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  36842. c.ifNoneMatch_ = entityTag
  36843. return c
  36844. }
  36845. // Context sets the context to be used in this call's Do method. Any
  36846. // pending HTTP request will be aborted if the provided context is
  36847. // canceled.
  36848. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  36849. c.ctx_ = ctx
  36850. return c
  36851. }
  36852. // Header returns an http.Header that can be modified by the caller to
  36853. // add HTTP headers to the request.
  36854. func (c *PlacementsListCall) Header() http.Header {
  36855. if c.header_ == nil {
  36856. c.header_ = make(http.Header)
  36857. }
  36858. return c.header_
  36859. }
  36860. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  36861. reqHeaders := make(http.Header)
  36862. for k, v := range c.header_ {
  36863. reqHeaders[k] = v
  36864. }
  36865. reqHeaders.Set("User-Agent", c.s.userAgent())
  36866. if c.ifNoneMatch_ != "" {
  36867. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36868. }
  36869. var body io.Reader = nil
  36870. c.urlParams_.Set("alt", alt)
  36871. c.urlParams_.Set("prettyPrint", "false")
  36872. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36873. urls += "?" + c.urlParams_.Encode()
  36874. req, err := http.NewRequest("GET", urls, body)
  36875. if err != nil {
  36876. return nil, err
  36877. }
  36878. req.Header = reqHeaders
  36879. googleapi.Expand(req.URL, map[string]string{
  36880. "profileId": strconv.FormatInt(c.profileId, 10),
  36881. })
  36882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36883. }
  36884. // Do executes the "dfareporting.placements.list" call.
  36885. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  36886. // non-2xx status code is an error. Response headers are in either
  36887. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  36888. // returned at all) in error.(*googleapi.Error).Header. Use
  36889. // googleapi.IsNotModified to check whether the returned error was
  36890. // because http.StatusNotModified was returned.
  36891. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  36892. gensupport.SetOptions(c.urlParams_, opts...)
  36893. res, err := c.doRequest("json")
  36894. if res != nil && res.StatusCode == http.StatusNotModified {
  36895. if res.Body != nil {
  36896. res.Body.Close()
  36897. }
  36898. return nil, &googleapi.Error{
  36899. Code: res.StatusCode,
  36900. Header: res.Header,
  36901. }
  36902. }
  36903. if err != nil {
  36904. return nil, err
  36905. }
  36906. defer googleapi.CloseBody(res)
  36907. if err := googleapi.CheckResponse(res); err != nil {
  36908. return nil, err
  36909. }
  36910. ret := &PlacementsListResponse{
  36911. ServerResponse: googleapi.ServerResponse{
  36912. Header: res.Header,
  36913. HTTPStatusCode: res.StatusCode,
  36914. },
  36915. }
  36916. target := &ret
  36917. if err := gensupport.DecodeResponse(target, res); err != nil {
  36918. return nil, err
  36919. }
  36920. return ret, nil
  36921. // {
  36922. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  36923. // "httpMethod": "GET",
  36924. // "id": "dfareporting.placements.list",
  36925. // "parameterOrder": [
  36926. // "profileId"
  36927. // ],
  36928. // "parameters": {
  36929. // "advertiserIds": {
  36930. // "description": "Select only placements that belong to these advertisers.",
  36931. // "format": "int64",
  36932. // "location": "query",
  36933. // "repeated": true,
  36934. // "type": "string"
  36935. // },
  36936. // "archived": {
  36937. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  36938. // "location": "query",
  36939. // "type": "boolean"
  36940. // },
  36941. // "campaignIds": {
  36942. // "description": "Select only placements that belong to these campaigns.",
  36943. // "format": "int64",
  36944. // "location": "query",
  36945. // "repeated": true,
  36946. // "type": "string"
  36947. // },
  36948. // "compatibilities": {
  36949. // "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.",
  36950. // "enum": [
  36951. // "APP",
  36952. // "APP_INTERSTITIAL",
  36953. // "DISPLAY",
  36954. // "DISPLAY_INTERSTITIAL",
  36955. // "IN_STREAM_AUDIO",
  36956. // "IN_STREAM_VIDEO"
  36957. // ],
  36958. // "enumDescriptions": [
  36959. // "",
  36960. // "",
  36961. // "",
  36962. // "",
  36963. // "",
  36964. // ""
  36965. // ],
  36966. // "location": "query",
  36967. // "repeated": true,
  36968. // "type": "string"
  36969. // },
  36970. // "contentCategoryIds": {
  36971. // "description": "Select only placements that are associated with these content categories.",
  36972. // "format": "int64",
  36973. // "location": "query",
  36974. // "repeated": true,
  36975. // "type": "string"
  36976. // },
  36977. // "directorySiteIds": {
  36978. // "description": "Select only placements that are associated with these directory sites.",
  36979. // "format": "int64",
  36980. // "location": "query",
  36981. // "repeated": true,
  36982. // "type": "string"
  36983. // },
  36984. // "groupIds": {
  36985. // "description": "Select only placements that belong to these placement groups.",
  36986. // "format": "int64",
  36987. // "location": "query",
  36988. // "repeated": true,
  36989. // "type": "string"
  36990. // },
  36991. // "ids": {
  36992. // "description": "Select only placements with these IDs.",
  36993. // "format": "int64",
  36994. // "location": "query",
  36995. // "repeated": true,
  36996. // "type": "string"
  36997. // },
  36998. // "maxEndDate": {
  36999. // "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\".",
  37000. // "location": "query",
  37001. // "type": "string"
  37002. // },
  37003. // "maxResults": {
  37004. // "default": "1000",
  37005. // "description": "Maximum number of results to return.",
  37006. // "format": "int32",
  37007. // "location": "query",
  37008. // "maximum": "1000",
  37009. // "minimum": "0",
  37010. // "type": "integer"
  37011. // },
  37012. // "maxStartDate": {
  37013. // "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\".",
  37014. // "location": "query",
  37015. // "type": "string"
  37016. // },
  37017. // "minEndDate": {
  37018. // "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\".",
  37019. // "location": "query",
  37020. // "type": "string"
  37021. // },
  37022. // "minStartDate": {
  37023. // "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\".",
  37024. // "location": "query",
  37025. // "type": "string"
  37026. // },
  37027. // "pageToken": {
  37028. // "description": "Value of the nextPageToken from the previous result page.",
  37029. // "location": "query",
  37030. // "type": "string"
  37031. // },
  37032. // "paymentSource": {
  37033. // "description": "Select only placements with this payment source.",
  37034. // "enum": [
  37035. // "PLACEMENT_AGENCY_PAID",
  37036. // "PLACEMENT_PUBLISHER_PAID"
  37037. // ],
  37038. // "enumDescriptions": [
  37039. // "",
  37040. // ""
  37041. // ],
  37042. // "location": "query",
  37043. // "type": "string"
  37044. // },
  37045. // "placementStrategyIds": {
  37046. // "description": "Select only placements that are associated with these placement strategies.",
  37047. // "format": "int64",
  37048. // "location": "query",
  37049. // "repeated": true,
  37050. // "type": "string"
  37051. // },
  37052. // "pricingTypes": {
  37053. // "description": "Select only placements with these pricing types.",
  37054. // "enum": [
  37055. // "PRICING_TYPE_CPA",
  37056. // "PRICING_TYPE_CPC",
  37057. // "PRICING_TYPE_CPM",
  37058. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  37059. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  37060. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  37061. // ],
  37062. // "enumDescriptions": [
  37063. // "",
  37064. // "",
  37065. // "",
  37066. // "",
  37067. // "",
  37068. // ""
  37069. // ],
  37070. // "location": "query",
  37071. // "repeated": true,
  37072. // "type": "string"
  37073. // },
  37074. // "profileId": {
  37075. // "description": "User profile ID associated with this request.",
  37076. // "format": "int64",
  37077. // "location": "path",
  37078. // "required": true,
  37079. // "type": "string"
  37080. // },
  37081. // "searchString": {
  37082. // "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\".",
  37083. // "location": "query",
  37084. // "type": "string"
  37085. // },
  37086. // "siteIds": {
  37087. // "description": "Select only placements that are associated with these sites.",
  37088. // "format": "int64",
  37089. // "location": "query",
  37090. // "repeated": true,
  37091. // "type": "string"
  37092. // },
  37093. // "sizeIds": {
  37094. // "description": "Select only placements that are associated with these sizes.",
  37095. // "format": "int64",
  37096. // "location": "query",
  37097. // "repeated": true,
  37098. // "type": "string"
  37099. // },
  37100. // "sortField": {
  37101. // "default": "ID",
  37102. // "description": "Field by which to sort the list.",
  37103. // "enum": [
  37104. // "ID",
  37105. // "NAME"
  37106. // ],
  37107. // "enumDescriptions": [
  37108. // "",
  37109. // ""
  37110. // ],
  37111. // "location": "query",
  37112. // "type": "string"
  37113. // },
  37114. // "sortOrder": {
  37115. // "default": "ASCENDING",
  37116. // "description": "Order of sorted results.",
  37117. // "enum": [
  37118. // "ASCENDING",
  37119. // "DESCENDING"
  37120. // ],
  37121. // "enumDescriptions": [
  37122. // "",
  37123. // ""
  37124. // ],
  37125. // "location": "query",
  37126. // "type": "string"
  37127. // }
  37128. // },
  37129. // "path": "userprofiles/{profileId}/placements",
  37130. // "response": {
  37131. // "$ref": "PlacementsListResponse"
  37132. // },
  37133. // "scopes": [
  37134. // "https://www.googleapis.com/auth/dfatrafficking"
  37135. // ]
  37136. // }
  37137. }
  37138. // Pages invokes f for each page of results.
  37139. // A non-nil error returned from f will halt the iteration.
  37140. // The provided context supersedes any context provided to the Context method.
  37141. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  37142. c.ctx_ = ctx
  37143. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37144. for {
  37145. x, err := c.Do()
  37146. if err != nil {
  37147. return err
  37148. }
  37149. if err := f(x); err != nil {
  37150. return err
  37151. }
  37152. if x.NextPageToken == "" {
  37153. return nil
  37154. }
  37155. c.PageToken(x.NextPageToken)
  37156. }
  37157. }
  37158. // method id "dfareporting.placements.patch":
  37159. type PlacementsPatchCall struct {
  37160. s *Service
  37161. profileId int64
  37162. placement *Placement
  37163. urlParams_ gensupport.URLParams
  37164. ctx_ context.Context
  37165. header_ http.Header
  37166. }
  37167. // Patch: Updates an existing placement. This method supports patch
  37168. // semantics.
  37169. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  37170. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37171. c.profileId = profileId
  37172. c.urlParams_.Set("id", fmt.Sprint(id))
  37173. c.placement = placement
  37174. return c
  37175. }
  37176. // Fields allows partial responses to be retrieved. See
  37177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37178. // for more information.
  37179. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  37180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37181. return c
  37182. }
  37183. // Context sets the context to be used in this call's Do method. Any
  37184. // pending HTTP request will be aborted if the provided context is
  37185. // canceled.
  37186. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  37187. c.ctx_ = ctx
  37188. return c
  37189. }
  37190. // Header returns an http.Header that can be modified by the caller to
  37191. // add HTTP headers to the request.
  37192. func (c *PlacementsPatchCall) Header() http.Header {
  37193. if c.header_ == nil {
  37194. c.header_ = make(http.Header)
  37195. }
  37196. return c.header_
  37197. }
  37198. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  37199. reqHeaders := make(http.Header)
  37200. for k, v := range c.header_ {
  37201. reqHeaders[k] = v
  37202. }
  37203. reqHeaders.Set("User-Agent", c.s.userAgent())
  37204. var body io.Reader = nil
  37205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  37206. if err != nil {
  37207. return nil, err
  37208. }
  37209. reqHeaders.Set("Content-Type", "application/json")
  37210. c.urlParams_.Set("alt", alt)
  37211. c.urlParams_.Set("prettyPrint", "false")
  37212. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  37213. urls += "?" + c.urlParams_.Encode()
  37214. req, err := http.NewRequest("PATCH", urls, body)
  37215. if err != nil {
  37216. return nil, err
  37217. }
  37218. req.Header = reqHeaders
  37219. googleapi.Expand(req.URL, map[string]string{
  37220. "profileId": strconv.FormatInt(c.profileId, 10),
  37221. })
  37222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37223. }
  37224. // Do executes the "dfareporting.placements.patch" call.
  37225. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  37226. // status code is an error. Response headers are in either
  37227. // *Placement.ServerResponse.Header or (if a response was returned at
  37228. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37229. // to check whether the returned error was because
  37230. // http.StatusNotModified was returned.
  37231. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  37232. gensupport.SetOptions(c.urlParams_, opts...)
  37233. res, err := c.doRequest("json")
  37234. if res != nil && res.StatusCode == http.StatusNotModified {
  37235. if res.Body != nil {
  37236. res.Body.Close()
  37237. }
  37238. return nil, &googleapi.Error{
  37239. Code: res.StatusCode,
  37240. Header: res.Header,
  37241. }
  37242. }
  37243. if err != nil {
  37244. return nil, err
  37245. }
  37246. defer googleapi.CloseBody(res)
  37247. if err := googleapi.CheckResponse(res); err != nil {
  37248. return nil, err
  37249. }
  37250. ret := &Placement{
  37251. ServerResponse: googleapi.ServerResponse{
  37252. Header: res.Header,
  37253. HTTPStatusCode: res.StatusCode,
  37254. },
  37255. }
  37256. target := &ret
  37257. if err := gensupport.DecodeResponse(target, res); err != nil {
  37258. return nil, err
  37259. }
  37260. return ret, nil
  37261. // {
  37262. // "description": "Updates an existing placement. This method supports patch semantics.",
  37263. // "httpMethod": "PATCH",
  37264. // "id": "dfareporting.placements.patch",
  37265. // "parameterOrder": [
  37266. // "profileId",
  37267. // "id"
  37268. // ],
  37269. // "parameters": {
  37270. // "id": {
  37271. // "description": "Placement ID.",
  37272. // "format": "int64",
  37273. // "location": "query",
  37274. // "required": true,
  37275. // "type": "string"
  37276. // },
  37277. // "profileId": {
  37278. // "description": "User profile ID associated with this request.",
  37279. // "format": "int64",
  37280. // "location": "path",
  37281. // "required": true,
  37282. // "type": "string"
  37283. // }
  37284. // },
  37285. // "path": "userprofiles/{profileId}/placements",
  37286. // "request": {
  37287. // "$ref": "Placement"
  37288. // },
  37289. // "response": {
  37290. // "$ref": "Placement"
  37291. // },
  37292. // "scopes": [
  37293. // "https://www.googleapis.com/auth/dfatrafficking"
  37294. // ]
  37295. // }
  37296. }
  37297. // method id "dfareporting.placements.update":
  37298. type PlacementsUpdateCall struct {
  37299. s *Service
  37300. profileId int64
  37301. placement *Placement
  37302. urlParams_ gensupport.URLParams
  37303. ctx_ context.Context
  37304. header_ http.Header
  37305. }
  37306. // Update: Updates an existing placement.
  37307. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  37308. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37309. c.profileId = profileId
  37310. c.placement = placement
  37311. return c
  37312. }
  37313. // Fields allows partial responses to be retrieved. See
  37314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37315. // for more information.
  37316. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  37317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37318. return c
  37319. }
  37320. // Context sets the context to be used in this call's Do method. Any
  37321. // pending HTTP request will be aborted if the provided context is
  37322. // canceled.
  37323. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  37324. c.ctx_ = ctx
  37325. return c
  37326. }
  37327. // Header returns an http.Header that can be modified by the caller to
  37328. // add HTTP headers to the request.
  37329. func (c *PlacementsUpdateCall) Header() http.Header {
  37330. if c.header_ == nil {
  37331. c.header_ = make(http.Header)
  37332. }
  37333. return c.header_
  37334. }
  37335. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  37336. reqHeaders := make(http.Header)
  37337. for k, v := range c.header_ {
  37338. reqHeaders[k] = v
  37339. }
  37340. reqHeaders.Set("User-Agent", c.s.userAgent())
  37341. var body io.Reader = nil
  37342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  37343. if err != nil {
  37344. return nil, err
  37345. }
  37346. reqHeaders.Set("Content-Type", "application/json")
  37347. c.urlParams_.Set("alt", alt)
  37348. c.urlParams_.Set("prettyPrint", "false")
  37349. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  37350. urls += "?" + c.urlParams_.Encode()
  37351. req, err := http.NewRequest("PUT", urls, body)
  37352. if err != nil {
  37353. return nil, err
  37354. }
  37355. req.Header = reqHeaders
  37356. googleapi.Expand(req.URL, map[string]string{
  37357. "profileId": strconv.FormatInt(c.profileId, 10),
  37358. })
  37359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37360. }
  37361. // Do executes the "dfareporting.placements.update" call.
  37362. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  37363. // status code is an error. Response headers are in either
  37364. // *Placement.ServerResponse.Header or (if a response was returned at
  37365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37366. // to check whether the returned error was because
  37367. // http.StatusNotModified was returned.
  37368. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  37369. gensupport.SetOptions(c.urlParams_, opts...)
  37370. res, err := c.doRequest("json")
  37371. if res != nil && res.StatusCode == http.StatusNotModified {
  37372. if res.Body != nil {
  37373. res.Body.Close()
  37374. }
  37375. return nil, &googleapi.Error{
  37376. Code: res.StatusCode,
  37377. Header: res.Header,
  37378. }
  37379. }
  37380. if err != nil {
  37381. return nil, err
  37382. }
  37383. defer googleapi.CloseBody(res)
  37384. if err := googleapi.CheckResponse(res); err != nil {
  37385. return nil, err
  37386. }
  37387. ret := &Placement{
  37388. ServerResponse: googleapi.ServerResponse{
  37389. Header: res.Header,
  37390. HTTPStatusCode: res.StatusCode,
  37391. },
  37392. }
  37393. target := &ret
  37394. if err := gensupport.DecodeResponse(target, res); err != nil {
  37395. return nil, err
  37396. }
  37397. return ret, nil
  37398. // {
  37399. // "description": "Updates an existing placement.",
  37400. // "httpMethod": "PUT",
  37401. // "id": "dfareporting.placements.update",
  37402. // "parameterOrder": [
  37403. // "profileId"
  37404. // ],
  37405. // "parameters": {
  37406. // "profileId": {
  37407. // "description": "User profile ID associated with this request.",
  37408. // "format": "int64",
  37409. // "location": "path",
  37410. // "required": true,
  37411. // "type": "string"
  37412. // }
  37413. // },
  37414. // "path": "userprofiles/{profileId}/placements",
  37415. // "request": {
  37416. // "$ref": "Placement"
  37417. // },
  37418. // "response": {
  37419. // "$ref": "Placement"
  37420. // },
  37421. // "scopes": [
  37422. // "https://www.googleapis.com/auth/dfatrafficking"
  37423. // ]
  37424. // }
  37425. }
  37426. // method id "dfareporting.platformTypes.get":
  37427. type PlatformTypesGetCall struct {
  37428. s *Service
  37429. profileId int64
  37430. id int64
  37431. urlParams_ gensupport.URLParams
  37432. ifNoneMatch_ string
  37433. ctx_ context.Context
  37434. header_ http.Header
  37435. }
  37436. // Get: Gets one platform type by ID.
  37437. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  37438. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37439. c.profileId = profileId
  37440. c.id = id
  37441. return c
  37442. }
  37443. // Fields allows partial responses to be retrieved. See
  37444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37445. // for more information.
  37446. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  37447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37448. return c
  37449. }
  37450. // IfNoneMatch sets the optional parameter which makes the operation
  37451. // fail if the object's ETag matches the given value. This is useful for
  37452. // getting updates only after the object has changed since the last
  37453. // request. Use googleapi.IsNotModified to check whether the response
  37454. // error from Do is the result of In-None-Match.
  37455. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  37456. c.ifNoneMatch_ = entityTag
  37457. return c
  37458. }
  37459. // Context sets the context to be used in this call's Do method. Any
  37460. // pending HTTP request will be aborted if the provided context is
  37461. // canceled.
  37462. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  37463. c.ctx_ = ctx
  37464. return c
  37465. }
  37466. // Header returns an http.Header that can be modified by the caller to
  37467. // add HTTP headers to the request.
  37468. func (c *PlatformTypesGetCall) Header() http.Header {
  37469. if c.header_ == nil {
  37470. c.header_ = make(http.Header)
  37471. }
  37472. return c.header_
  37473. }
  37474. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  37475. reqHeaders := make(http.Header)
  37476. for k, v := range c.header_ {
  37477. reqHeaders[k] = v
  37478. }
  37479. reqHeaders.Set("User-Agent", c.s.userAgent())
  37480. if c.ifNoneMatch_ != "" {
  37481. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37482. }
  37483. var body io.Reader = nil
  37484. c.urlParams_.Set("alt", alt)
  37485. c.urlParams_.Set("prettyPrint", "false")
  37486. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  37487. urls += "?" + c.urlParams_.Encode()
  37488. req, err := http.NewRequest("GET", urls, body)
  37489. if err != nil {
  37490. return nil, err
  37491. }
  37492. req.Header = reqHeaders
  37493. googleapi.Expand(req.URL, map[string]string{
  37494. "profileId": strconv.FormatInt(c.profileId, 10),
  37495. "id": strconv.FormatInt(c.id, 10),
  37496. })
  37497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37498. }
  37499. // Do executes the "dfareporting.platformTypes.get" call.
  37500. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  37501. // status code is an error. Response headers are in either
  37502. // *PlatformType.ServerResponse.Header or (if a response was returned at
  37503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37504. // to check whether the returned error was because
  37505. // http.StatusNotModified was returned.
  37506. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  37507. gensupport.SetOptions(c.urlParams_, opts...)
  37508. res, err := c.doRequest("json")
  37509. if res != nil && res.StatusCode == http.StatusNotModified {
  37510. if res.Body != nil {
  37511. res.Body.Close()
  37512. }
  37513. return nil, &googleapi.Error{
  37514. Code: res.StatusCode,
  37515. Header: res.Header,
  37516. }
  37517. }
  37518. if err != nil {
  37519. return nil, err
  37520. }
  37521. defer googleapi.CloseBody(res)
  37522. if err := googleapi.CheckResponse(res); err != nil {
  37523. return nil, err
  37524. }
  37525. ret := &PlatformType{
  37526. ServerResponse: googleapi.ServerResponse{
  37527. Header: res.Header,
  37528. HTTPStatusCode: res.StatusCode,
  37529. },
  37530. }
  37531. target := &ret
  37532. if err := gensupport.DecodeResponse(target, res); err != nil {
  37533. return nil, err
  37534. }
  37535. return ret, nil
  37536. // {
  37537. // "description": "Gets one platform type by ID.",
  37538. // "httpMethod": "GET",
  37539. // "id": "dfareporting.platformTypes.get",
  37540. // "parameterOrder": [
  37541. // "profileId",
  37542. // "id"
  37543. // ],
  37544. // "parameters": {
  37545. // "id": {
  37546. // "description": "Platform type ID.",
  37547. // "format": "int64",
  37548. // "location": "path",
  37549. // "required": true,
  37550. // "type": "string"
  37551. // },
  37552. // "profileId": {
  37553. // "description": "User profile ID associated with this request.",
  37554. // "format": "int64",
  37555. // "location": "path",
  37556. // "required": true,
  37557. // "type": "string"
  37558. // }
  37559. // },
  37560. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  37561. // "response": {
  37562. // "$ref": "PlatformType"
  37563. // },
  37564. // "scopes": [
  37565. // "https://www.googleapis.com/auth/dfatrafficking"
  37566. // ]
  37567. // }
  37568. }
  37569. // method id "dfareporting.platformTypes.list":
  37570. type PlatformTypesListCall struct {
  37571. s *Service
  37572. profileId int64
  37573. urlParams_ gensupport.URLParams
  37574. ifNoneMatch_ string
  37575. ctx_ context.Context
  37576. header_ http.Header
  37577. }
  37578. // List: Retrieves a list of platform types.
  37579. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  37580. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37581. c.profileId = profileId
  37582. return c
  37583. }
  37584. // Fields allows partial responses to be retrieved. See
  37585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37586. // for more information.
  37587. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  37588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37589. return c
  37590. }
  37591. // IfNoneMatch sets the optional parameter which makes the operation
  37592. // fail if the object's ETag matches the given value. This is useful for
  37593. // getting updates only after the object has changed since the last
  37594. // request. Use googleapi.IsNotModified to check whether the response
  37595. // error from Do is the result of In-None-Match.
  37596. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  37597. c.ifNoneMatch_ = entityTag
  37598. return c
  37599. }
  37600. // Context sets the context to be used in this call's Do method. Any
  37601. // pending HTTP request will be aborted if the provided context is
  37602. // canceled.
  37603. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  37604. c.ctx_ = ctx
  37605. return c
  37606. }
  37607. // Header returns an http.Header that can be modified by the caller to
  37608. // add HTTP headers to the request.
  37609. func (c *PlatformTypesListCall) Header() http.Header {
  37610. if c.header_ == nil {
  37611. c.header_ = make(http.Header)
  37612. }
  37613. return c.header_
  37614. }
  37615. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  37616. reqHeaders := make(http.Header)
  37617. for k, v := range c.header_ {
  37618. reqHeaders[k] = v
  37619. }
  37620. reqHeaders.Set("User-Agent", c.s.userAgent())
  37621. if c.ifNoneMatch_ != "" {
  37622. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37623. }
  37624. var body io.Reader = nil
  37625. c.urlParams_.Set("alt", alt)
  37626. c.urlParams_.Set("prettyPrint", "false")
  37627. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  37628. urls += "?" + c.urlParams_.Encode()
  37629. req, err := http.NewRequest("GET", urls, body)
  37630. if err != nil {
  37631. return nil, err
  37632. }
  37633. req.Header = reqHeaders
  37634. googleapi.Expand(req.URL, map[string]string{
  37635. "profileId": strconv.FormatInt(c.profileId, 10),
  37636. })
  37637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37638. }
  37639. // Do executes the "dfareporting.platformTypes.list" call.
  37640. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  37641. // Any non-2xx status code is an error. Response headers are in either
  37642. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  37643. // was returned at all) in error.(*googleapi.Error).Header. Use
  37644. // googleapi.IsNotModified to check whether the returned error was
  37645. // because http.StatusNotModified was returned.
  37646. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  37647. gensupport.SetOptions(c.urlParams_, opts...)
  37648. res, err := c.doRequest("json")
  37649. if res != nil && res.StatusCode == http.StatusNotModified {
  37650. if res.Body != nil {
  37651. res.Body.Close()
  37652. }
  37653. return nil, &googleapi.Error{
  37654. Code: res.StatusCode,
  37655. Header: res.Header,
  37656. }
  37657. }
  37658. if err != nil {
  37659. return nil, err
  37660. }
  37661. defer googleapi.CloseBody(res)
  37662. if err := googleapi.CheckResponse(res); err != nil {
  37663. return nil, err
  37664. }
  37665. ret := &PlatformTypesListResponse{
  37666. ServerResponse: googleapi.ServerResponse{
  37667. Header: res.Header,
  37668. HTTPStatusCode: res.StatusCode,
  37669. },
  37670. }
  37671. target := &ret
  37672. if err := gensupport.DecodeResponse(target, res); err != nil {
  37673. return nil, err
  37674. }
  37675. return ret, nil
  37676. // {
  37677. // "description": "Retrieves a list of platform types.",
  37678. // "httpMethod": "GET",
  37679. // "id": "dfareporting.platformTypes.list",
  37680. // "parameterOrder": [
  37681. // "profileId"
  37682. // ],
  37683. // "parameters": {
  37684. // "profileId": {
  37685. // "description": "User profile ID associated with this request.",
  37686. // "format": "int64",
  37687. // "location": "path",
  37688. // "required": true,
  37689. // "type": "string"
  37690. // }
  37691. // },
  37692. // "path": "userprofiles/{profileId}/platformTypes",
  37693. // "response": {
  37694. // "$ref": "PlatformTypesListResponse"
  37695. // },
  37696. // "scopes": [
  37697. // "https://www.googleapis.com/auth/dfatrafficking"
  37698. // ]
  37699. // }
  37700. }
  37701. // method id "dfareporting.postalCodes.get":
  37702. type PostalCodesGetCall struct {
  37703. s *Service
  37704. profileId int64
  37705. code string
  37706. urlParams_ gensupport.URLParams
  37707. ifNoneMatch_ string
  37708. ctx_ context.Context
  37709. header_ http.Header
  37710. }
  37711. // Get: Gets one postal code by ID.
  37712. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  37713. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37714. c.profileId = profileId
  37715. c.code = code
  37716. return c
  37717. }
  37718. // Fields allows partial responses to be retrieved. See
  37719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37720. // for more information.
  37721. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  37722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37723. return c
  37724. }
  37725. // IfNoneMatch sets the optional parameter which makes the operation
  37726. // fail if the object's ETag matches the given value. This is useful for
  37727. // getting updates only after the object has changed since the last
  37728. // request. Use googleapi.IsNotModified to check whether the response
  37729. // error from Do is the result of In-None-Match.
  37730. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  37731. c.ifNoneMatch_ = entityTag
  37732. return c
  37733. }
  37734. // Context sets the context to be used in this call's Do method. Any
  37735. // pending HTTP request will be aborted if the provided context is
  37736. // canceled.
  37737. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  37738. c.ctx_ = ctx
  37739. return c
  37740. }
  37741. // Header returns an http.Header that can be modified by the caller to
  37742. // add HTTP headers to the request.
  37743. func (c *PostalCodesGetCall) Header() http.Header {
  37744. if c.header_ == nil {
  37745. c.header_ = make(http.Header)
  37746. }
  37747. return c.header_
  37748. }
  37749. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  37750. reqHeaders := make(http.Header)
  37751. for k, v := range c.header_ {
  37752. reqHeaders[k] = v
  37753. }
  37754. reqHeaders.Set("User-Agent", c.s.userAgent())
  37755. if c.ifNoneMatch_ != "" {
  37756. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37757. }
  37758. var body io.Reader = nil
  37759. c.urlParams_.Set("alt", alt)
  37760. c.urlParams_.Set("prettyPrint", "false")
  37761. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  37762. urls += "?" + c.urlParams_.Encode()
  37763. req, err := http.NewRequest("GET", urls, body)
  37764. if err != nil {
  37765. return nil, err
  37766. }
  37767. req.Header = reqHeaders
  37768. googleapi.Expand(req.URL, map[string]string{
  37769. "profileId": strconv.FormatInt(c.profileId, 10),
  37770. "code": c.code,
  37771. })
  37772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37773. }
  37774. // Do executes the "dfareporting.postalCodes.get" call.
  37775. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  37776. // status code is an error. Response headers are in either
  37777. // *PostalCode.ServerResponse.Header or (if a response was returned at
  37778. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37779. // to check whether the returned error was because
  37780. // http.StatusNotModified was returned.
  37781. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  37782. gensupport.SetOptions(c.urlParams_, opts...)
  37783. res, err := c.doRequest("json")
  37784. if res != nil && res.StatusCode == http.StatusNotModified {
  37785. if res.Body != nil {
  37786. res.Body.Close()
  37787. }
  37788. return nil, &googleapi.Error{
  37789. Code: res.StatusCode,
  37790. Header: res.Header,
  37791. }
  37792. }
  37793. if err != nil {
  37794. return nil, err
  37795. }
  37796. defer googleapi.CloseBody(res)
  37797. if err := googleapi.CheckResponse(res); err != nil {
  37798. return nil, err
  37799. }
  37800. ret := &PostalCode{
  37801. ServerResponse: googleapi.ServerResponse{
  37802. Header: res.Header,
  37803. HTTPStatusCode: res.StatusCode,
  37804. },
  37805. }
  37806. target := &ret
  37807. if err := gensupport.DecodeResponse(target, res); err != nil {
  37808. return nil, err
  37809. }
  37810. return ret, nil
  37811. // {
  37812. // "description": "Gets one postal code by ID.",
  37813. // "httpMethod": "GET",
  37814. // "id": "dfareporting.postalCodes.get",
  37815. // "parameterOrder": [
  37816. // "profileId",
  37817. // "code"
  37818. // ],
  37819. // "parameters": {
  37820. // "code": {
  37821. // "description": "Postal code ID.",
  37822. // "location": "path",
  37823. // "required": true,
  37824. // "type": "string"
  37825. // },
  37826. // "profileId": {
  37827. // "description": "User profile ID associated with this request.",
  37828. // "format": "int64",
  37829. // "location": "path",
  37830. // "required": true,
  37831. // "type": "string"
  37832. // }
  37833. // },
  37834. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  37835. // "response": {
  37836. // "$ref": "PostalCode"
  37837. // },
  37838. // "scopes": [
  37839. // "https://www.googleapis.com/auth/dfatrafficking"
  37840. // ]
  37841. // }
  37842. }
  37843. // method id "dfareporting.postalCodes.list":
  37844. type PostalCodesListCall struct {
  37845. s *Service
  37846. profileId int64
  37847. urlParams_ gensupport.URLParams
  37848. ifNoneMatch_ string
  37849. ctx_ context.Context
  37850. header_ http.Header
  37851. }
  37852. // List: Retrieves a list of postal codes.
  37853. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  37854. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37855. c.profileId = profileId
  37856. return c
  37857. }
  37858. // Fields allows partial responses to be retrieved. See
  37859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37860. // for more information.
  37861. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  37862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37863. return c
  37864. }
  37865. // IfNoneMatch sets the optional parameter which makes the operation
  37866. // fail if the object's ETag matches the given value. This is useful for
  37867. // getting updates only after the object has changed since the last
  37868. // request. Use googleapi.IsNotModified to check whether the response
  37869. // error from Do is the result of In-None-Match.
  37870. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  37871. c.ifNoneMatch_ = entityTag
  37872. return c
  37873. }
  37874. // Context sets the context to be used in this call's Do method. Any
  37875. // pending HTTP request will be aborted if the provided context is
  37876. // canceled.
  37877. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  37878. c.ctx_ = ctx
  37879. return c
  37880. }
  37881. // Header returns an http.Header that can be modified by the caller to
  37882. // add HTTP headers to the request.
  37883. func (c *PostalCodesListCall) Header() http.Header {
  37884. if c.header_ == nil {
  37885. c.header_ = make(http.Header)
  37886. }
  37887. return c.header_
  37888. }
  37889. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  37890. reqHeaders := make(http.Header)
  37891. for k, v := range c.header_ {
  37892. reqHeaders[k] = v
  37893. }
  37894. reqHeaders.Set("User-Agent", c.s.userAgent())
  37895. if c.ifNoneMatch_ != "" {
  37896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37897. }
  37898. var body io.Reader = nil
  37899. c.urlParams_.Set("alt", alt)
  37900. c.urlParams_.Set("prettyPrint", "false")
  37901. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  37902. urls += "?" + c.urlParams_.Encode()
  37903. req, err := http.NewRequest("GET", urls, body)
  37904. if err != nil {
  37905. return nil, err
  37906. }
  37907. req.Header = reqHeaders
  37908. googleapi.Expand(req.URL, map[string]string{
  37909. "profileId": strconv.FormatInt(c.profileId, 10),
  37910. })
  37911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37912. }
  37913. // Do executes the "dfareporting.postalCodes.list" call.
  37914. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  37915. // non-2xx status code is an error. Response headers are in either
  37916. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  37917. // returned at all) in error.(*googleapi.Error).Header. Use
  37918. // googleapi.IsNotModified to check whether the returned error was
  37919. // because http.StatusNotModified was returned.
  37920. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  37921. gensupport.SetOptions(c.urlParams_, opts...)
  37922. res, err := c.doRequest("json")
  37923. if res != nil && res.StatusCode == http.StatusNotModified {
  37924. if res.Body != nil {
  37925. res.Body.Close()
  37926. }
  37927. return nil, &googleapi.Error{
  37928. Code: res.StatusCode,
  37929. Header: res.Header,
  37930. }
  37931. }
  37932. if err != nil {
  37933. return nil, err
  37934. }
  37935. defer googleapi.CloseBody(res)
  37936. if err := googleapi.CheckResponse(res); err != nil {
  37937. return nil, err
  37938. }
  37939. ret := &PostalCodesListResponse{
  37940. ServerResponse: googleapi.ServerResponse{
  37941. Header: res.Header,
  37942. HTTPStatusCode: res.StatusCode,
  37943. },
  37944. }
  37945. target := &ret
  37946. if err := gensupport.DecodeResponse(target, res); err != nil {
  37947. return nil, err
  37948. }
  37949. return ret, nil
  37950. // {
  37951. // "description": "Retrieves a list of postal codes.",
  37952. // "httpMethod": "GET",
  37953. // "id": "dfareporting.postalCodes.list",
  37954. // "parameterOrder": [
  37955. // "profileId"
  37956. // ],
  37957. // "parameters": {
  37958. // "profileId": {
  37959. // "description": "User profile ID associated with this request.",
  37960. // "format": "int64",
  37961. // "location": "path",
  37962. // "required": true,
  37963. // "type": "string"
  37964. // }
  37965. // },
  37966. // "path": "userprofiles/{profileId}/postalCodes",
  37967. // "response": {
  37968. // "$ref": "PostalCodesListResponse"
  37969. // },
  37970. // "scopes": [
  37971. // "https://www.googleapis.com/auth/dfatrafficking"
  37972. // ]
  37973. // }
  37974. }
  37975. // method id "dfareporting.projects.get":
  37976. type ProjectsGetCall struct {
  37977. s *Service
  37978. profileId int64
  37979. id int64
  37980. urlParams_ gensupport.URLParams
  37981. ifNoneMatch_ string
  37982. ctx_ context.Context
  37983. header_ http.Header
  37984. }
  37985. // Get: Gets one project by ID.
  37986. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  37987. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37988. c.profileId = profileId
  37989. c.id = id
  37990. return c
  37991. }
  37992. // Fields allows partial responses to be retrieved. See
  37993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37994. // for more information.
  37995. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  37996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37997. return c
  37998. }
  37999. // IfNoneMatch sets the optional parameter which makes the operation
  38000. // fail if the object's ETag matches the given value. This is useful for
  38001. // getting updates only after the object has changed since the last
  38002. // request. Use googleapi.IsNotModified to check whether the response
  38003. // error from Do is the result of In-None-Match.
  38004. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  38005. c.ifNoneMatch_ = entityTag
  38006. return c
  38007. }
  38008. // Context sets the context to be used in this call's Do method. Any
  38009. // pending HTTP request will be aborted if the provided context is
  38010. // canceled.
  38011. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  38012. c.ctx_ = ctx
  38013. return c
  38014. }
  38015. // Header returns an http.Header that can be modified by the caller to
  38016. // add HTTP headers to the request.
  38017. func (c *ProjectsGetCall) Header() http.Header {
  38018. if c.header_ == nil {
  38019. c.header_ = make(http.Header)
  38020. }
  38021. return c.header_
  38022. }
  38023. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  38024. reqHeaders := make(http.Header)
  38025. for k, v := range c.header_ {
  38026. reqHeaders[k] = v
  38027. }
  38028. reqHeaders.Set("User-Agent", c.s.userAgent())
  38029. if c.ifNoneMatch_ != "" {
  38030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38031. }
  38032. var body io.Reader = nil
  38033. c.urlParams_.Set("alt", alt)
  38034. c.urlParams_.Set("prettyPrint", "false")
  38035. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  38036. urls += "?" + c.urlParams_.Encode()
  38037. req, err := http.NewRequest("GET", urls, body)
  38038. if err != nil {
  38039. return nil, err
  38040. }
  38041. req.Header = reqHeaders
  38042. googleapi.Expand(req.URL, map[string]string{
  38043. "profileId": strconv.FormatInt(c.profileId, 10),
  38044. "id": strconv.FormatInt(c.id, 10),
  38045. })
  38046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38047. }
  38048. // Do executes the "dfareporting.projects.get" call.
  38049. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  38050. // code is an error. Response headers are in either
  38051. // *Project.ServerResponse.Header or (if a response was returned at all)
  38052. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38053. // check whether the returned error was because http.StatusNotModified
  38054. // was returned.
  38055. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  38056. gensupport.SetOptions(c.urlParams_, opts...)
  38057. res, err := c.doRequest("json")
  38058. if res != nil && res.StatusCode == http.StatusNotModified {
  38059. if res.Body != nil {
  38060. res.Body.Close()
  38061. }
  38062. return nil, &googleapi.Error{
  38063. Code: res.StatusCode,
  38064. Header: res.Header,
  38065. }
  38066. }
  38067. if err != nil {
  38068. return nil, err
  38069. }
  38070. defer googleapi.CloseBody(res)
  38071. if err := googleapi.CheckResponse(res); err != nil {
  38072. return nil, err
  38073. }
  38074. ret := &Project{
  38075. ServerResponse: googleapi.ServerResponse{
  38076. Header: res.Header,
  38077. HTTPStatusCode: res.StatusCode,
  38078. },
  38079. }
  38080. target := &ret
  38081. if err := gensupport.DecodeResponse(target, res); err != nil {
  38082. return nil, err
  38083. }
  38084. return ret, nil
  38085. // {
  38086. // "description": "Gets one project by ID.",
  38087. // "httpMethod": "GET",
  38088. // "id": "dfareporting.projects.get",
  38089. // "parameterOrder": [
  38090. // "profileId",
  38091. // "id"
  38092. // ],
  38093. // "parameters": {
  38094. // "id": {
  38095. // "description": "Project ID.",
  38096. // "format": "int64",
  38097. // "location": "path",
  38098. // "required": true,
  38099. // "type": "string"
  38100. // },
  38101. // "profileId": {
  38102. // "description": "User profile ID associated with this request.",
  38103. // "format": "int64",
  38104. // "location": "path",
  38105. // "required": true,
  38106. // "type": "string"
  38107. // }
  38108. // },
  38109. // "path": "userprofiles/{profileId}/projects/{id}",
  38110. // "response": {
  38111. // "$ref": "Project"
  38112. // },
  38113. // "scopes": [
  38114. // "https://www.googleapis.com/auth/dfatrafficking"
  38115. // ]
  38116. // }
  38117. }
  38118. // method id "dfareporting.projects.list":
  38119. type ProjectsListCall struct {
  38120. s *Service
  38121. profileId int64
  38122. urlParams_ gensupport.URLParams
  38123. ifNoneMatch_ string
  38124. ctx_ context.Context
  38125. header_ http.Header
  38126. }
  38127. // List: Retrieves a list of projects, possibly filtered. This method
  38128. // supports paging.
  38129. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  38130. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38131. c.profileId = profileId
  38132. return c
  38133. }
  38134. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  38135. // only projects with these advertiser IDs.
  38136. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  38137. var advertiserIds_ []string
  38138. for _, v := range advertiserIds {
  38139. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  38140. }
  38141. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  38142. return c
  38143. }
  38144. // Ids sets the optional parameter "ids": Select only projects with
  38145. // these IDs.
  38146. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  38147. var ids_ []string
  38148. for _, v := range ids {
  38149. ids_ = append(ids_, fmt.Sprint(v))
  38150. }
  38151. c.urlParams_.SetMulti("ids", ids_)
  38152. return c
  38153. }
  38154. // MaxResults sets the optional parameter "maxResults": Maximum number
  38155. // of results to return.
  38156. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  38157. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38158. return c
  38159. }
  38160. // PageToken sets the optional parameter "pageToken": Value of the
  38161. // nextPageToken from the previous result page.
  38162. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  38163. c.urlParams_.Set("pageToken", pageToken)
  38164. return c
  38165. }
  38166. // SearchString sets the optional parameter "searchString": Allows
  38167. // searching for projects by name or ID. Wildcards (*) are allowed. For
  38168. // example, "project*2015" will return projects with names like "project
  38169. // June 2015", "project April 2015", or simply "project 2015". Most of
  38170. // the searches also add wildcards implicitly at the start and the end
  38171. // of the search string. For example, a search string of "project" will
  38172. // match projects with name "my project", "project 2015", or simply
  38173. // "project".
  38174. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  38175. c.urlParams_.Set("searchString", searchString)
  38176. return c
  38177. }
  38178. // SortField sets the optional parameter "sortField": Field by which to
  38179. // sort the list.
  38180. //
  38181. // Possible values:
  38182. // "ID" (default)
  38183. // "NAME"
  38184. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  38185. c.urlParams_.Set("sortField", sortField)
  38186. return c
  38187. }
  38188. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38189. // results.
  38190. //
  38191. // Possible values:
  38192. // "ASCENDING" (default)
  38193. // "DESCENDING"
  38194. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  38195. c.urlParams_.Set("sortOrder", sortOrder)
  38196. return c
  38197. }
  38198. // Fields allows partial responses to be retrieved. See
  38199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38200. // for more information.
  38201. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  38202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38203. return c
  38204. }
  38205. // IfNoneMatch sets the optional parameter which makes the operation
  38206. // fail if the object's ETag matches the given value. This is useful for
  38207. // getting updates only after the object has changed since the last
  38208. // request. Use googleapi.IsNotModified to check whether the response
  38209. // error from Do is the result of In-None-Match.
  38210. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  38211. c.ifNoneMatch_ = entityTag
  38212. return c
  38213. }
  38214. // Context sets the context to be used in this call's Do method. Any
  38215. // pending HTTP request will be aborted if the provided context is
  38216. // canceled.
  38217. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  38218. c.ctx_ = ctx
  38219. return c
  38220. }
  38221. // Header returns an http.Header that can be modified by the caller to
  38222. // add HTTP headers to the request.
  38223. func (c *ProjectsListCall) Header() http.Header {
  38224. if c.header_ == nil {
  38225. c.header_ = make(http.Header)
  38226. }
  38227. return c.header_
  38228. }
  38229. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  38230. reqHeaders := make(http.Header)
  38231. for k, v := range c.header_ {
  38232. reqHeaders[k] = v
  38233. }
  38234. reqHeaders.Set("User-Agent", c.s.userAgent())
  38235. if c.ifNoneMatch_ != "" {
  38236. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38237. }
  38238. var body io.Reader = nil
  38239. c.urlParams_.Set("alt", alt)
  38240. c.urlParams_.Set("prettyPrint", "false")
  38241. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  38242. urls += "?" + c.urlParams_.Encode()
  38243. req, err := http.NewRequest("GET", urls, body)
  38244. if err != nil {
  38245. return nil, err
  38246. }
  38247. req.Header = reqHeaders
  38248. googleapi.Expand(req.URL, map[string]string{
  38249. "profileId": strconv.FormatInt(c.profileId, 10),
  38250. })
  38251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38252. }
  38253. // Do executes the "dfareporting.projects.list" call.
  38254. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  38255. // non-2xx status code is an error. Response headers are in either
  38256. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  38257. // returned at all) in error.(*googleapi.Error).Header. Use
  38258. // googleapi.IsNotModified to check whether the returned error was
  38259. // because http.StatusNotModified was returned.
  38260. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  38261. gensupport.SetOptions(c.urlParams_, opts...)
  38262. res, err := c.doRequest("json")
  38263. if res != nil && res.StatusCode == http.StatusNotModified {
  38264. if res.Body != nil {
  38265. res.Body.Close()
  38266. }
  38267. return nil, &googleapi.Error{
  38268. Code: res.StatusCode,
  38269. Header: res.Header,
  38270. }
  38271. }
  38272. if err != nil {
  38273. return nil, err
  38274. }
  38275. defer googleapi.CloseBody(res)
  38276. if err := googleapi.CheckResponse(res); err != nil {
  38277. return nil, err
  38278. }
  38279. ret := &ProjectsListResponse{
  38280. ServerResponse: googleapi.ServerResponse{
  38281. Header: res.Header,
  38282. HTTPStatusCode: res.StatusCode,
  38283. },
  38284. }
  38285. target := &ret
  38286. if err := gensupport.DecodeResponse(target, res); err != nil {
  38287. return nil, err
  38288. }
  38289. return ret, nil
  38290. // {
  38291. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  38292. // "httpMethod": "GET",
  38293. // "id": "dfareporting.projects.list",
  38294. // "parameterOrder": [
  38295. // "profileId"
  38296. // ],
  38297. // "parameters": {
  38298. // "advertiserIds": {
  38299. // "description": "Select only projects with these advertiser IDs.",
  38300. // "format": "int64",
  38301. // "location": "query",
  38302. // "repeated": true,
  38303. // "type": "string"
  38304. // },
  38305. // "ids": {
  38306. // "description": "Select only projects with these IDs.",
  38307. // "format": "int64",
  38308. // "location": "query",
  38309. // "repeated": true,
  38310. // "type": "string"
  38311. // },
  38312. // "maxResults": {
  38313. // "default": "1000",
  38314. // "description": "Maximum number of results to return.",
  38315. // "format": "int32",
  38316. // "location": "query",
  38317. // "maximum": "1000",
  38318. // "minimum": "0",
  38319. // "type": "integer"
  38320. // },
  38321. // "pageToken": {
  38322. // "description": "Value of the nextPageToken from the previous result page.",
  38323. // "location": "query",
  38324. // "type": "string"
  38325. // },
  38326. // "profileId": {
  38327. // "description": "User profile ID associated with this request.",
  38328. // "format": "int64",
  38329. // "location": "path",
  38330. // "required": true,
  38331. // "type": "string"
  38332. // },
  38333. // "searchString": {
  38334. // "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\".",
  38335. // "location": "query",
  38336. // "type": "string"
  38337. // },
  38338. // "sortField": {
  38339. // "default": "ID",
  38340. // "description": "Field by which to sort the list.",
  38341. // "enum": [
  38342. // "ID",
  38343. // "NAME"
  38344. // ],
  38345. // "enumDescriptions": [
  38346. // "",
  38347. // ""
  38348. // ],
  38349. // "location": "query",
  38350. // "type": "string"
  38351. // },
  38352. // "sortOrder": {
  38353. // "default": "ASCENDING",
  38354. // "description": "Order of sorted results.",
  38355. // "enum": [
  38356. // "ASCENDING",
  38357. // "DESCENDING"
  38358. // ],
  38359. // "enumDescriptions": [
  38360. // "",
  38361. // ""
  38362. // ],
  38363. // "location": "query",
  38364. // "type": "string"
  38365. // }
  38366. // },
  38367. // "path": "userprofiles/{profileId}/projects",
  38368. // "response": {
  38369. // "$ref": "ProjectsListResponse"
  38370. // },
  38371. // "scopes": [
  38372. // "https://www.googleapis.com/auth/dfatrafficking"
  38373. // ]
  38374. // }
  38375. }
  38376. // Pages invokes f for each page of results.
  38377. // A non-nil error returned from f will halt the iteration.
  38378. // The provided context supersedes any context provided to the Context method.
  38379. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  38380. c.ctx_ = ctx
  38381. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38382. for {
  38383. x, err := c.Do()
  38384. if err != nil {
  38385. return err
  38386. }
  38387. if err := f(x); err != nil {
  38388. return err
  38389. }
  38390. if x.NextPageToken == "" {
  38391. return nil
  38392. }
  38393. c.PageToken(x.NextPageToken)
  38394. }
  38395. }
  38396. // method id "dfareporting.regions.list":
  38397. type RegionsListCall struct {
  38398. s *Service
  38399. profileId int64
  38400. urlParams_ gensupport.URLParams
  38401. ifNoneMatch_ string
  38402. ctx_ context.Context
  38403. header_ http.Header
  38404. }
  38405. // List: Retrieves a list of regions.
  38406. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  38407. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38408. c.profileId = profileId
  38409. return c
  38410. }
  38411. // Fields allows partial responses to be retrieved. See
  38412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38413. // for more information.
  38414. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  38415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38416. return c
  38417. }
  38418. // IfNoneMatch sets the optional parameter which makes the operation
  38419. // fail if the object's ETag matches the given value. This is useful for
  38420. // getting updates only after the object has changed since the last
  38421. // request. Use googleapi.IsNotModified to check whether the response
  38422. // error from Do is the result of In-None-Match.
  38423. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  38424. c.ifNoneMatch_ = entityTag
  38425. return c
  38426. }
  38427. // Context sets the context to be used in this call's Do method. Any
  38428. // pending HTTP request will be aborted if the provided context is
  38429. // canceled.
  38430. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  38431. c.ctx_ = ctx
  38432. return c
  38433. }
  38434. // Header returns an http.Header that can be modified by the caller to
  38435. // add HTTP headers to the request.
  38436. func (c *RegionsListCall) Header() http.Header {
  38437. if c.header_ == nil {
  38438. c.header_ = make(http.Header)
  38439. }
  38440. return c.header_
  38441. }
  38442. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  38443. reqHeaders := make(http.Header)
  38444. for k, v := range c.header_ {
  38445. reqHeaders[k] = v
  38446. }
  38447. reqHeaders.Set("User-Agent", c.s.userAgent())
  38448. if c.ifNoneMatch_ != "" {
  38449. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38450. }
  38451. var body io.Reader = nil
  38452. c.urlParams_.Set("alt", alt)
  38453. c.urlParams_.Set("prettyPrint", "false")
  38454. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  38455. urls += "?" + c.urlParams_.Encode()
  38456. req, err := http.NewRequest("GET", urls, body)
  38457. if err != nil {
  38458. return nil, err
  38459. }
  38460. req.Header = reqHeaders
  38461. googleapi.Expand(req.URL, map[string]string{
  38462. "profileId": strconv.FormatInt(c.profileId, 10),
  38463. })
  38464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38465. }
  38466. // Do executes the "dfareporting.regions.list" call.
  38467. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  38468. // non-2xx status code is an error. Response headers are in either
  38469. // *RegionsListResponse.ServerResponse.Header or (if a response was
  38470. // returned at all) in error.(*googleapi.Error).Header. Use
  38471. // googleapi.IsNotModified to check whether the returned error was
  38472. // because http.StatusNotModified was returned.
  38473. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  38474. gensupport.SetOptions(c.urlParams_, opts...)
  38475. res, err := c.doRequest("json")
  38476. if res != nil && res.StatusCode == http.StatusNotModified {
  38477. if res.Body != nil {
  38478. res.Body.Close()
  38479. }
  38480. return nil, &googleapi.Error{
  38481. Code: res.StatusCode,
  38482. Header: res.Header,
  38483. }
  38484. }
  38485. if err != nil {
  38486. return nil, err
  38487. }
  38488. defer googleapi.CloseBody(res)
  38489. if err := googleapi.CheckResponse(res); err != nil {
  38490. return nil, err
  38491. }
  38492. ret := &RegionsListResponse{
  38493. ServerResponse: googleapi.ServerResponse{
  38494. Header: res.Header,
  38495. HTTPStatusCode: res.StatusCode,
  38496. },
  38497. }
  38498. target := &ret
  38499. if err := gensupport.DecodeResponse(target, res); err != nil {
  38500. return nil, err
  38501. }
  38502. return ret, nil
  38503. // {
  38504. // "description": "Retrieves a list of regions.",
  38505. // "httpMethod": "GET",
  38506. // "id": "dfareporting.regions.list",
  38507. // "parameterOrder": [
  38508. // "profileId"
  38509. // ],
  38510. // "parameters": {
  38511. // "profileId": {
  38512. // "description": "User profile ID associated with this request.",
  38513. // "format": "int64",
  38514. // "location": "path",
  38515. // "required": true,
  38516. // "type": "string"
  38517. // }
  38518. // },
  38519. // "path": "userprofiles/{profileId}/regions",
  38520. // "response": {
  38521. // "$ref": "RegionsListResponse"
  38522. // },
  38523. // "scopes": [
  38524. // "https://www.googleapis.com/auth/dfatrafficking"
  38525. // ]
  38526. // }
  38527. }
  38528. // method id "dfareporting.remarketingListShares.get":
  38529. type RemarketingListSharesGetCall struct {
  38530. s *Service
  38531. profileId int64
  38532. remarketingListId int64
  38533. urlParams_ gensupport.URLParams
  38534. ifNoneMatch_ string
  38535. ctx_ context.Context
  38536. header_ http.Header
  38537. }
  38538. // Get: Gets one remarketing list share by remarketing list ID.
  38539. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  38540. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38541. c.profileId = profileId
  38542. c.remarketingListId = remarketingListId
  38543. return c
  38544. }
  38545. // Fields allows partial responses to be retrieved. See
  38546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38547. // for more information.
  38548. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  38549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38550. return c
  38551. }
  38552. // IfNoneMatch sets the optional parameter which makes the operation
  38553. // fail if the object's ETag matches the given value. This is useful for
  38554. // getting updates only after the object has changed since the last
  38555. // request. Use googleapi.IsNotModified to check whether the response
  38556. // error from Do is the result of In-None-Match.
  38557. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  38558. c.ifNoneMatch_ = entityTag
  38559. return c
  38560. }
  38561. // Context sets the context to be used in this call's Do method. Any
  38562. // pending HTTP request will be aborted if the provided context is
  38563. // canceled.
  38564. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  38565. c.ctx_ = ctx
  38566. return c
  38567. }
  38568. // Header returns an http.Header that can be modified by the caller to
  38569. // add HTTP headers to the request.
  38570. func (c *RemarketingListSharesGetCall) Header() http.Header {
  38571. if c.header_ == nil {
  38572. c.header_ = make(http.Header)
  38573. }
  38574. return c.header_
  38575. }
  38576. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  38577. reqHeaders := make(http.Header)
  38578. for k, v := range c.header_ {
  38579. reqHeaders[k] = v
  38580. }
  38581. reqHeaders.Set("User-Agent", c.s.userAgent())
  38582. if c.ifNoneMatch_ != "" {
  38583. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38584. }
  38585. var body io.Reader = nil
  38586. c.urlParams_.Set("alt", alt)
  38587. c.urlParams_.Set("prettyPrint", "false")
  38588. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  38589. urls += "?" + c.urlParams_.Encode()
  38590. req, err := http.NewRequest("GET", urls, body)
  38591. if err != nil {
  38592. return nil, err
  38593. }
  38594. req.Header = reqHeaders
  38595. googleapi.Expand(req.URL, map[string]string{
  38596. "profileId": strconv.FormatInt(c.profileId, 10),
  38597. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  38598. })
  38599. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38600. }
  38601. // Do executes the "dfareporting.remarketingListShares.get" call.
  38602. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38603. // non-2xx status code is an error. Response headers are in either
  38604. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38605. // returned at all) in error.(*googleapi.Error).Header. Use
  38606. // googleapi.IsNotModified to check whether the returned error was
  38607. // because http.StatusNotModified was returned.
  38608. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38609. gensupport.SetOptions(c.urlParams_, opts...)
  38610. res, err := c.doRequest("json")
  38611. if res != nil && res.StatusCode == http.StatusNotModified {
  38612. if res.Body != nil {
  38613. res.Body.Close()
  38614. }
  38615. return nil, &googleapi.Error{
  38616. Code: res.StatusCode,
  38617. Header: res.Header,
  38618. }
  38619. }
  38620. if err != nil {
  38621. return nil, err
  38622. }
  38623. defer googleapi.CloseBody(res)
  38624. if err := googleapi.CheckResponse(res); err != nil {
  38625. return nil, err
  38626. }
  38627. ret := &RemarketingListShare{
  38628. ServerResponse: googleapi.ServerResponse{
  38629. Header: res.Header,
  38630. HTTPStatusCode: res.StatusCode,
  38631. },
  38632. }
  38633. target := &ret
  38634. if err := gensupport.DecodeResponse(target, res); err != nil {
  38635. return nil, err
  38636. }
  38637. return ret, nil
  38638. // {
  38639. // "description": "Gets one remarketing list share by remarketing list ID.",
  38640. // "httpMethod": "GET",
  38641. // "id": "dfareporting.remarketingListShares.get",
  38642. // "parameterOrder": [
  38643. // "profileId",
  38644. // "remarketingListId"
  38645. // ],
  38646. // "parameters": {
  38647. // "profileId": {
  38648. // "description": "User profile ID associated with this request.",
  38649. // "format": "int64",
  38650. // "location": "path",
  38651. // "required": true,
  38652. // "type": "string"
  38653. // },
  38654. // "remarketingListId": {
  38655. // "description": "Remarketing list ID.",
  38656. // "format": "int64",
  38657. // "location": "path",
  38658. // "required": true,
  38659. // "type": "string"
  38660. // }
  38661. // },
  38662. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  38663. // "response": {
  38664. // "$ref": "RemarketingListShare"
  38665. // },
  38666. // "scopes": [
  38667. // "https://www.googleapis.com/auth/dfatrafficking"
  38668. // ]
  38669. // }
  38670. }
  38671. // method id "dfareporting.remarketingListShares.patch":
  38672. type RemarketingListSharesPatchCall struct {
  38673. s *Service
  38674. profileId int64
  38675. remarketinglistshare *RemarketingListShare
  38676. urlParams_ gensupport.URLParams
  38677. ctx_ context.Context
  38678. header_ http.Header
  38679. }
  38680. // Patch: Updates an existing remarketing list share. This method
  38681. // supports patch semantics.
  38682. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  38683. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38684. c.profileId = profileId
  38685. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  38686. c.remarketinglistshare = remarketinglistshare
  38687. return c
  38688. }
  38689. // Fields allows partial responses to be retrieved. See
  38690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38691. // for more information.
  38692. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  38693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38694. return c
  38695. }
  38696. // Context sets the context to be used in this call's Do method. Any
  38697. // pending HTTP request will be aborted if the provided context is
  38698. // canceled.
  38699. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  38700. c.ctx_ = ctx
  38701. return c
  38702. }
  38703. // Header returns an http.Header that can be modified by the caller to
  38704. // add HTTP headers to the request.
  38705. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  38706. if c.header_ == nil {
  38707. c.header_ = make(http.Header)
  38708. }
  38709. return c.header_
  38710. }
  38711. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  38712. reqHeaders := make(http.Header)
  38713. for k, v := range c.header_ {
  38714. reqHeaders[k] = v
  38715. }
  38716. reqHeaders.Set("User-Agent", c.s.userAgent())
  38717. var body io.Reader = nil
  38718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38719. if err != nil {
  38720. return nil, err
  38721. }
  38722. reqHeaders.Set("Content-Type", "application/json")
  38723. c.urlParams_.Set("alt", alt)
  38724. c.urlParams_.Set("prettyPrint", "false")
  38725. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38726. urls += "?" + c.urlParams_.Encode()
  38727. req, err := http.NewRequest("PATCH", urls, body)
  38728. if err != nil {
  38729. return nil, err
  38730. }
  38731. req.Header = reqHeaders
  38732. googleapi.Expand(req.URL, map[string]string{
  38733. "profileId": strconv.FormatInt(c.profileId, 10),
  38734. })
  38735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38736. }
  38737. // Do executes the "dfareporting.remarketingListShares.patch" call.
  38738. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38739. // non-2xx status code is an error. Response headers are in either
  38740. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38741. // returned at all) in error.(*googleapi.Error).Header. Use
  38742. // googleapi.IsNotModified to check whether the returned error was
  38743. // because http.StatusNotModified was returned.
  38744. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38745. gensupport.SetOptions(c.urlParams_, opts...)
  38746. res, err := c.doRequest("json")
  38747. if res != nil && res.StatusCode == http.StatusNotModified {
  38748. if res.Body != nil {
  38749. res.Body.Close()
  38750. }
  38751. return nil, &googleapi.Error{
  38752. Code: res.StatusCode,
  38753. Header: res.Header,
  38754. }
  38755. }
  38756. if err != nil {
  38757. return nil, err
  38758. }
  38759. defer googleapi.CloseBody(res)
  38760. if err := googleapi.CheckResponse(res); err != nil {
  38761. return nil, err
  38762. }
  38763. ret := &RemarketingListShare{
  38764. ServerResponse: googleapi.ServerResponse{
  38765. Header: res.Header,
  38766. HTTPStatusCode: res.StatusCode,
  38767. },
  38768. }
  38769. target := &ret
  38770. if err := gensupport.DecodeResponse(target, res); err != nil {
  38771. return nil, err
  38772. }
  38773. return ret, nil
  38774. // {
  38775. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  38776. // "httpMethod": "PATCH",
  38777. // "id": "dfareporting.remarketingListShares.patch",
  38778. // "parameterOrder": [
  38779. // "profileId",
  38780. // "remarketingListId"
  38781. // ],
  38782. // "parameters": {
  38783. // "profileId": {
  38784. // "description": "User profile ID associated with this request.",
  38785. // "format": "int64",
  38786. // "location": "path",
  38787. // "required": true,
  38788. // "type": "string"
  38789. // },
  38790. // "remarketingListId": {
  38791. // "description": "Remarketing list ID.",
  38792. // "format": "int64",
  38793. // "location": "query",
  38794. // "required": true,
  38795. // "type": "string"
  38796. // }
  38797. // },
  38798. // "path": "userprofiles/{profileId}/remarketingListShares",
  38799. // "request": {
  38800. // "$ref": "RemarketingListShare"
  38801. // },
  38802. // "response": {
  38803. // "$ref": "RemarketingListShare"
  38804. // },
  38805. // "scopes": [
  38806. // "https://www.googleapis.com/auth/dfatrafficking"
  38807. // ]
  38808. // }
  38809. }
  38810. // method id "dfareporting.remarketingListShares.update":
  38811. type RemarketingListSharesUpdateCall struct {
  38812. s *Service
  38813. profileId int64
  38814. remarketinglistshare *RemarketingListShare
  38815. urlParams_ gensupport.URLParams
  38816. ctx_ context.Context
  38817. header_ http.Header
  38818. }
  38819. // Update: Updates an existing remarketing list share.
  38820. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  38821. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38822. c.profileId = profileId
  38823. c.remarketinglistshare = remarketinglistshare
  38824. return c
  38825. }
  38826. // Fields allows partial responses to be retrieved. See
  38827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38828. // for more information.
  38829. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  38830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38831. return c
  38832. }
  38833. // Context sets the context to be used in this call's Do method. Any
  38834. // pending HTTP request will be aborted if the provided context is
  38835. // canceled.
  38836. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  38837. c.ctx_ = ctx
  38838. return c
  38839. }
  38840. // Header returns an http.Header that can be modified by the caller to
  38841. // add HTTP headers to the request.
  38842. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  38843. if c.header_ == nil {
  38844. c.header_ = make(http.Header)
  38845. }
  38846. return c.header_
  38847. }
  38848. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  38849. reqHeaders := make(http.Header)
  38850. for k, v := range c.header_ {
  38851. reqHeaders[k] = v
  38852. }
  38853. reqHeaders.Set("User-Agent", c.s.userAgent())
  38854. var body io.Reader = nil
  38855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38856. if err != nil {
  38857. return nil, err
  38858. }
  38859. reqHeaders.Set("Content-Type", "application/json")
  38860. c.urlParams_.Set("alt", alt)
  38861. c.urlParams_.Set("prettyPrint", "false")
  38862. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38863. urls += "?" + c.urlParams_.Encode()
  38864. req, err := http.NewRequest("PUT", urls, body)
  38865. if err != nil {
  38866. return nil, err
  38867. }
  38868. req.Header = reqHeaders
  38869. googleapi.Expand(req.URL, map[string]string{
  38870. "profileId": strconv.FormatInt(c.profileId, 10),
  38871. })
  38872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38873. }
  38874. // Do executes the "dfareporting.remarketingListShares.update" call.
  38875. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38876. // non-2xx status code is an error. Response headers are in either
  38877. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38878. // returned at all) in error.(*googleapi.Error).Header. Use
  38879. // googleapi.IsNotModified to check whether the returned error was
  38880. // because http.StatusNotModified was returned.
  38881. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38882. gensupport.SetOptions(c.urlParams_, opts...)
  38883. res, err := c.doRequest("json")
  38884. if res != nil && res.StatusCode == http.StatusNotModified {
  38885. if res.Body != nil {
  38886. res.Body.Close()
  38887. }
  38888. return nil, &googleapi.Error{
  38889. Code: res.StatusCode,
  38890. Header: res.Header,
  38891. }
  38892. }
  38893. if err != nil {
  38894. return nil, err
  38895. }
  38896. defer googleapi.CloseBody(res)
  38897. if err := googleapi.CheckResponse(res); err != nil {
  38898. return nil, err
  38899. }
  38900. ret := &RemarketingListShare{
  38901. ServerResponse: googleapi.ServerResponse{
  38902. Header: res.Header,
  38903. HTTPStatusCode: res.StatusCode,
  38904. },
  38905. }
  38906. target := &ret
  38907. if err := gensupport.DecodeResponse(target, res); err != nil {
  38908. return nil, err
  38909. }
  38910. return ret, nil
  38911. // {
  38912. // "description": "Updates an existing remarketing list share.",
  38913. // "httpMethod": "PUT",
  38914. // "id": "dfareporting.remarketingListShares.update",
  38915. // "parameterOrder": [
  38916. // "profileId"
  38917. // ],
  38918. // "parameters": {
  38919. // "profileId": {
  38920. // "description": "User profile ID associated with this request.",
  38921. // "format": "int64",
  38922. // "location": "path",
  38923. // "required": true,
  38924. // "type": "string"
  38925. // }
  38926. // },
  38927. // "path": "userprofiles/{profileId}/remarketingListShares",
  38928. // "request": {
  38929. // "$ref": "RemarketingListShare"
  38930. // },
  38931. // "response": {
  38932. // "$ref": "RemarketingListShare"
  38933. // },
  38934. // "scopes": [
  38935. // "https://www.googleapis.com/auth/dfatrafficking"
  38936. // ]
  38937. // }
  38938. }
  38939. // method id "dfareporting.remarketingLists.get":
  38940. type RemarketingListsGetCall struct {
  38941. s *Service
  38942. profileId int64
  38943. id int64
  38944. urlParams_ gensupport.URLParams
  38945. ifNoneMatch_ string
  38946. ctx_ context.Context
  38947. header_ http.Header
  38948. }
  38949. // Get: Gets one remarketing list by ID.
  38950. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  38951. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38952. c.profileId = profileId
  38953. c.id = id
  38954. return c
  38955. }
  38956. // Fields allows partial responses to be retrieved. See
  38957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38958. // for more information.
  38959. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  38960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38961. return c
  38962. }
  38963. // IfNoneMatch sets the optional parameter which makes the operation
  38964. // fail if the object's ETag matches the given value. This is useful for
  38965. // getting updates only after the object has changed since the last
  38966. // request. Use googleapi.IsNotModified to check whether the response
  38967. // error from Do is the result of In-None-Match.
  38968. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  38969. c.ifNoneMatch_ = entityTag
  38970. return c
  38971. }
  38972. // Context sets the context to be used in this call's Do method. Any
  38973. // pending HTTP request will be aborted if the provided context is
  38974. // canceled.
  38975. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  38976. c.ctx_ = ctx
  38977. return c
  38978. }
  38979. // Header returns an http.Header that can be modified by the caller to
  38980. // add HTTP headers to the request.
  38981. func (c *RemarketingListsGetCall) Header() http.Header {
  38982. if c.header_ == nil {
  38983. c.header_ = make(http.Header)
  38984. }
  38985. return c.header_
  38986. }
  38987. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  38988. reqHeaders := make(http.Header)
  38989. for k, v := range c.header_ {
  38990. reqHeaders[k] = v
  38991. }
  38992. reqHeaders.Set("User-Agent", c.s.userAgent())
  38993. if c.ifNoneMatch_ != "" {
  38994. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38995. }
  38996. var body io.Reader = nil
  38997. c.urlParams_.Set("alt", alt)
  38998. c.urlParams_.Set("prettyPrint", "false")
  38999. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  39000. urls += "?" + c.urlParams_.Encode()
  39001. req, err := http.NewRequest("GET", urls, body)
  39002. if err != nil {
  39003. return nil, err
  39004. }
  39005. req.Header = reqHeaders
  39006. googleapi.Expand(req.URL, map[string]string{
  39007. "profileId": strconv.FormatInt(c.profileId, 10),
  39008. "id": strconv.FormatInt(c.id, 10),
  39009. })
  39010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39011. }
  39012. // Do executes the "dfareporting.remarketingLists.get" call.
  39013. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39014. // status code is an error. Response headers are in either
  39015. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39016. // at all) in error.(*googleapi.Error).Header. Use
  39017. // googleapi.IsNotModified to check whether the returned error was
  39018. // because http.StatusNotModified was returned.
  39019. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39020. gensupport.SetOptions(c.urlParams_, opts...)
  39021. res, err := c.doRequest("json")
  39022. if res != nil && res.StatusCode == http.StatusNotModified {
  39023. if res.Body != nil {
  39024. res.Body.Close()
  39025. }
  39026. return nil, &googleapi.Error{
  39027. Code: res.StatusCode,
  39028. Header: res.Header,
  39029. }
  39030. }
  39031. if err != nil {
  39032. return nil, err
  39033. }
  39034. defer googleapi.CloseBody(res)
  39035. if err := googleapi.CheckResponse(res); err != nil {
  39036. return nil, err
  39037. }
  39038. ret := &RemarketingList{
  39039. ServerResponse: googleapi.ServerResponse{
  39040. Header: res.Header,
  39041. HTTPStatusCode: res.StatusCode,
  39042. },
  39043. }
  39044. target := &ret
  39045. if err := gensupport.DecodeResponse(target, res); err != nil {
  39046. return nil, err
  39047. }
  39048. return ret, nil
  39049. // {
  39050. // "description": "Gets one remarketing list by ID.",
  39051. // "httpMethod": "GET",
  39052. // "id": "dfareporting.remarketingLists.get",
  39053. // "parameterOrder": [
  39054. // "profileId",
  39055. // "id"
  39056. // ],
  39057. // "parameters": {
  39058. // "id": {
  39059. // "description": "Remarketing list ID.",
  39060. // "format": "int64",
  39061. // "location": "path",
  39062. // "required": true,
  39063. // "type": "string"
  39064. // },
  39065. // "profileId": {
  39066. // "description": "User profile ID associated with this request.",
  39067. // "format": "int64",
  39068. // "location": "path",
  39069. // "required": true,
  39070. // "type": "string"
  39071. // }
  39072. // },
  39073. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  39074. // "response": {
  39075. // "$ref": "RemarketingList"
  39076. // },
  39077. // "scopes": [
  39078. // "https://www.googleapis.com/auth/dfatrafficking"
  39079. // ]
  39080. // }
  39081. }
  39082. // method id "dfareporting.remarketingLists.insert":
  39083. type RemarketingListsInsertCall struct {
  39084. s *Service
  39085. profileId int64
  39086. remarketinglist *RemarketingList
  39087. urlParams_ gensupport.URLParams
  39088. ctx_ context.Context
  39089. header_ http.Header
  39090. }
  39091. // Insert: Inserts a new remarketing list.
  39092. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  39093. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39094. c.profileId = profileId
  39095. c.remarketinglist = remarketinglist
  39096. return c
  39097. }
  39098. // Fields allows partial responses to be retrieved. See
  39099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39100. // for more information.
  39101. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  39102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39103. return c
  39104. }
  39105. // Context sets the context to be used in this call's Do method. Any
  39106. // pending HTTP request will be aborted if the provided context is
  39107. // canceled.
  39108. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  39109. c.ctx_ = ctx
  39110. return c
  39111. }
  39112. // Header returns an http.Header that can be modified by the caller to
  39113. // add HTTP headers to the request.
  39114. func (c *RemarketingListsInsertCall) Header() http.Header {
  39115. if c.header_ == nil {
  39116. c.header_ = make(http.Header)
  39117. }
  39118. return c.header_
  39119. }
  39120. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  39121. reqHeaders := make(http.Header)
  39122. for k, v := range c.header_ {
  39123. reqHeaders[k] = v
  39124. }
  39125. reqHeaders.Set("User-Agent", c.s.userAgent())
  39126. var body io.Reader = nil
  39127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39128. if err != nil {
  39129. return nil, err
  39130. }
  39131. reqHeaders.Set("Content-Type", "application/json")
  39132. c.urlParams_.Set("alt", alt)
  39133. c.urlParams_.Set("prettyPrint", "false")
  39134. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39135. urls += "?" + c.urlParams_.Encode()
  39136. req, err := http.NewRequest("POST", urls, body)
  39137. if err != nil {
  39138. return nil, err
  39139. }
  39140. req.Header = reqHeaders
  39141. googleapi.Expand(req.URL, map[string]string{
  39142. "profileId": strconv.FormatInt(c.profileId, 10),
  39143. })
  39144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39145. }
  39146. // Do executes the "dfareporting.remarketingLists.insert" call.
  39147. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39148. // status code is an error. Response headers are in either
  39149. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39150. // at all) in error.(*googleapi.Error).Header. Use
  39151. // googleapi.IsNotModified to check whether the returned error was
  39152. // because http.StatusNotModified was returned.
  39153. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39154. gensupport.SetOptions(c.urlParams_, opts...)
  39155. res, err := c.doRequest("json")
  39156. if res != nil && res.StatusCode == http.StatusNotModified {
  39157. if res.Body != nil {
  39158. res.Body.Close()
  39159. }
  39160. return nil, &googleapi.Error{
  39161. Code: res.StatusCode,
  39162. Header: res.Header,
  39163. }
  39164. }
  39165. if err != nil {
  39166. return nil, err
  39167. }
  39168. defer googleapi.CloseBody(res)
  39169. if err := googleapi.CheckResponse(res); err != nil {
  39170. return nil, err
  39171. }
  39172. ret := &RemarketingList{
  39173. ServerResponse: googleapi.ServerResponse{
  39174. Header: res.Header,
  39175. HTTPStatusCode: res.StatusCode,
  39176. },
  39177. }
  39178. target := &ret
  39179. if err := gensupport.DecodeResponse(target, res); err != nil {
  39180. return nil, err
  39181. }
  39182. return ret, nil
  39183. // {
  39184. // "description": "Inserts a new remarketing list.",
  39185. // "httpMethod": "POST",
  39186. // "id": "dfareporting.remarketingLists.insert",
  39187. // "parameterOrder": [
  39188. // "profileId"
  39189. // ],
  39190. // "parameters": {
  39191. // "profileId": {
  39192. // "description": "User profile ID associated with this request.",
  39193. // "format": "int64",
  39194. // "location": "path",
  39195. // "required": true,
  39196. // "type": "string"
  39197. // }
  39198. // },
  39199. // "path": "userprofiles/{profileId}/remarketingLists",
  39200. // "request": {
  39201. // "$ref": "RemarketingList"
  39202. // },
  39203. // "response": {
  39204. // "$ref": "RemarketingList"
  39205. // },
  39206. // "scopes": [
  39207. // "https://www.googleapis.com/auth/dfatrafficking"
  39208. // ]
  39209. // }
  39210. }
  39211. // method id "dfareporting.remarketingLists.list":
  39212. type RemarketingListsListCall struct {
  39213. s *Service
  39214. profileId int64
  39215. urlParams_ gensupport.URLParams
  39216. ifNoneMatch_ string
  39217. ctx_ context.Context
  39218. header_ http.Header
  39219. }
  39220. // List: Retrieves a list of remarketing lists, possibly filtered. This
  39221. // method supports paging.
  39222. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  39223. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39224. c.profileId = profileId
  39225. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  39226. return c
  39227. }
  39228. // Active sets the optional parameter "active": Select only active or
  39229. // only inactive remarketing lists.
  39230. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  39231. c.urlParams_.Set("active", fmt.Sprint(active))
  39232. return c
  39233. }
  39234. // FloodlightActivityId sets the optional parameter
  39235. // "floodlightActivityId": Select only remarketing lists that have this
  39236. // floodlight activity ID.
  39237. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  39238. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  39239. return c
  39240. }
  39241. // MaxResults sets the optional parameter "maxResults": Maximum number
  39242. // of results to return.
  39243. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  39244. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39245. return c
  39246. }
  39247. // Name sets the optional parameter "name": Allows searching for objects
  39248. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  39249. // list*2015" will return objects with names like "remarketing list June
  39250. // 2015", "remarketing list April 2015", or simply "remarketing list
  39251. // 2015". Most of the searches also add wildcards implicitly at the
  39252. // start and the end of the search string. For example, a search string
  39253. // of "remarketing list" will match objects with name "my remarketing
  39254. // list", "remarketing list 2015", or simply "remarketing list".
  39255. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  39256. c.urlParams_.Set("name", name)
  39257. return c
  39258. }
  39259. // PageToken sets the optional parameter "pageToken": Value of the
  39260. // nextPageToken from the previous result page.
  39261. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  39262. c.urlParams_.Set("pageToken", pageToken)
  39263. return c
  39264. }
  39265. // SortField sets the optional parameter "sortField": Field by which to
  39266. // sort the list.
  39267. //
  39268. // Possible values:
  39269. // "ID" (default)
  39270. // "NAME"
  39271. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  39272. c.urlParams_.Set("sortField", sortField)
  39273. return c
  39274. }
  39275. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39276. // results.
  39277. //
  39278. // Possible values:
  39279. // "ASCENDING" (default)
  39280. // "DESCENDING"
  39281. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  39282. c.urlParams_.Set("sortOrder", sortOrder)
  39283. return c
  39284. }
  39285. // Fields allows partial responses to be retrieved. See
  39286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39287. // for more information.
  39288. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  39289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39290. return c
  39291. }
  39292. // IfNoneMatch sets the optional parameter which makes the operation
  39293. // fail if the object's ETag matches the given value. This is useful for
  39294. // getting updates only after the object has changed since the last
  39295. // request. Use googleapi.IsNotModified to check whether the response
  39296. // error from Do is the result of In-None-Match.
  39297. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  39298. c.ifNoneMatch_ = entityTag
  39299. return c
  39300. }
  39301. // Context sets the context to be used in this call's Do method. Any
  39302. // pending HTTP request will be aborted if the provided context is
  39303. // canceled.
  39304. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  39305. c.ctx_ = ctx
  39306. return c
  39307. }
  39308. // Header returns an http.Header that can be modified by the caller to
  39309. // add HTTP headers to the request.
  39310. func (c *RemarketingListsListCall) Header() http.Header {
  39311. if c.header_ == nil {
  39312. c.header_ = make(http.Header)
  39313. }
  39314. return c.header_
  39315. }
  39316. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  39317. reqHeaders := make(http.Header)
  39318. for k, v := range c.header_ {
  39319. reqHeaders[k] = v
  39320. }
  39321. reqHeaders.Set("User-Agent", c.s.userAgent())
  39322. if c.ifNoneMatch_ != "" {
  39323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39324. }
  39325. var body io.Reader = nil
  39326. c.urlParams_.Set("alt", alt)
  39327. c.urlParams_.Set("prettyPrint", "false")
  39328. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39329. urls += "?" + c.urlParams_.Encode()
  39330. req, err := http.NewRequest("GET", urls, body)
  39331. if err != nil {
  39332. return nil, err
  39333. }
  39334. req.Header = reqHeaders
  39335. googleapi.Expand(req.URL, map[string]string{
  39336. "profileId": strconv.FormatInt(c.profileId, 10),
  39337. })
  39338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39339. }
  39340. // Do executes the "dfareporting.remarketingLists.list" call.
  39341. // Exactly one of *RemarketingListsListResponse or error will be
  39342. // non-nil. Any non-2xx status code is an error. Response headers are in
  39343. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  39344. // response was returned at all) in error.(*googleapi.Error).Header. Use
  39345. // googleapi.IsNotModified to check whether the returned error was
  39346. // because http.StatusNotModified was returned.
  39347. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  39348. gensupport.SetOptions(c.urlParams_, opts...)
  39349. res, err := c.doRequest("json")
  39350. if res != nil && res.StatusCode == http.StatusNotModified {
  39351. if res.Body != nil {
  39352. res.Body.Close()
  39353. }
  39354. return nil, &googleapi.Error{
  39355. Code: res.StatusCode,
  39356. Header: res.Header,
  39357. }
  39358. }
  39359. if err != nil {
  39360. return nil, err
  39361. }
  39362. defer googleapi.CloseBody(res)
  39363. if err := googleapi.CheckResponse(res); err != nil {
  39364. return nil, err
  39365. }
  39366. ret := &RemarketingListsListResponse{
  39367. ServerResponse: googleapi.ServerResponse{
  39368. Header: res.Header,
  39369. HTTPStatusCode: res.StatusCode,
  39370. },
  39371. }
  39372. target := &ret
  39373. if err := gensupport.DecodeResponse(target, res); err != nil {
  39374. return nil, err
  39375. }
  39376. return ret, nil
  39377. // {
  39378. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  39379. // "httpMethod": "GET",
  39380. // "id": "dfareporting.remarketingLists.list",
  39381. // "parameterOrder": [
  39382. // "profileId",
  39383. // "advertiserId"
  39384. // ],
  39385. // "parameters": {
  39386. // "active": {
  39387. // "description": "Select only active or only inactive remarketing lists.",
  39388. // "location": "query",
  39389. // "type": "boolean"
  39390. // },
  39391. // "advertiserId": {
  39392. // "description": "Select only remarketing lists owned by this advertiser.",
  39393. // "format": "int64",
  39394. // "location": "query",
  39395. // "required": true,
  39396. // "type": "string"
  39397. // },
  39398. // "floodlightActivityId": {
  39399. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  39400. // "format": "int64",
  39401. // "location": "query",
  39402. // "type": "string"
  39403. // },
  39404. // "maxResults": {
  39405. // "default": "1000",
  39406. // "description": "Maximum number of results to return.",
  39407. // "format": "int32",
  39408. // "location": "query",
  39409. // "maximum": "1000",
  39410. // "minimum": "0",
  39411. // "type": "integer"
  39412. // },
  39413. // "name": {
  39414. // "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\".",
  39415. // "location": "query",
  39416. // "type": "string"
  39417. // },
  39418. // "pageToken": {
  39419. // "description": "Value of the nextPageToken from the previous result page.",
  39420. // "location": "query",
  39421. // "type": "string"
  39422. // },
  39423. // "profileId": {
  39424. // "description": "User profile ID associated with this request.",
  39425. // "format": "int64",
  39426. // "location": "path",
  39427. // "required": true,
  39428. // "type": "string"
  39429. // },
  39430. // "sortField": {
  39431. // "default": "ID",
  39432. // "description": "Field by which to sort the list.",
  39433. // "enum": [
  39434. // "ID",
  39435. // "NAME"
  39436. // ],
  39437. // "enumDescriptions": [
  39438. // "",
  39439. // ""
  39440. // ],
  39441. // "location": "query",
  39442. // "type": "string"
  39443. // },
  39444. // "sortOrder": {
  39445. // "default": "ASCENDING",
  39446. // "description": "Order of sorted results.",
  39447. // "enum": [
  39448. // "ASCENDING",
  39449. // "DESCENDING"
  39450. // ],
  39451. // "enumDescriptions": [
  39452. // "",
  39453. // ""
  39454. // ],
  39455. // "location": "query",
  39456. // "type": "string"
  39457. // }
  39458. // },
  39459. // "path": "userprofiles/{profileId}/remarketingLists",
  39460. // "response": {
  39461. // "$ref": "RemarketingListsListResponse"
  39462. // },
  39463. // "scopes": [
  39464. // "https://www.googleapis.com/auth/dfatrafficking"
  39465. // ]
  39466. // }
  39467. }
  39468. // Pages invokes f for each page of results.
  39469. // A non-nil error returned from f will halt the iteration.
  39470. // The provided context supersedes any context provided to the Context method.
  39471. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  39472. c.ctx_ = ctx
  39473. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39474. for {
  39475. x, err := c.Do()
  39476. if err != nil {
  39477. return err
  39478. }
  39479. if err := f(x); err != nil {
  39480. return err
  39481. }
  39482. if x.NextPageToken == "" {
  39483. return nil
  39484. }
  39485. c.PageToken(x.NextPageToken)
  39486. }
  39487. }
  39488. // method id "dfareporting.remarketingLists.patch":
  39489. type RemarketingListsPatchCall struct {
  39490. s *Service
  39491. profileId int64
  39492. remarketinglist *RemarketingList
  39493. urlParams_ gensupport.URLParams
  39494. ctx_ context.Context
  39495. header_ http.Header
  39496. }
  39497. // Patch: Updates an existing remarketing list. This method supports
  39498. // patch semantics.
  39499. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  39500. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39501. c.profileId = profileId
  39502. c.urlParams_.Set("id", fmt.Sprint(id))
  39503. c.remarketinglist = remarketinglist
  39504. return c
  39505. }
  39506. // Fields allows partial responses to be retrieved. See
  39507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39508. // for more information.
  39509. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  39510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39511. return c
  39512. }
  39513. // Context sets the context to be used in this call's Do method. Any
  39514. // pending HTTP request will be aborted if the provided context is
  39515. // canceled.
  39516. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  39517. c.ctx_ = ctx
  39518. return c
  39519. }
  39520. // Header returns an http.Header that can be modified by the caller to
  39521. // add HTTP headers to the request.
  39522. func (c *RemarketingListsPatchCall) Header() http.Header {
  39523. if c.header_ == nil {
  39524. c.header_ = make(http.Header)
  39525. }
  39526. return c.header_
  39527. }
  39528. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  39529. reqHeaders := make(http.Header)
  39530. for k, v := range c.header_ {
  39531. reqHeaders[k] = v
  39532. }
  39533. reqHeaders.Set("User-Agent", c.s.userAgent())
  39534. var body io.Reader = nil
  39535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39536. if err != nil {
  39537. return nil, err
  39538. }
  39539. reqHeaders.Set("Content-Type", "application/json")
  39540. c.urlParams_.Set("alt", alt)
  39541. c.urlParams_.Set("prettyPrint", "false")
  39542. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39543. urls += "?" + c.urlParams_.Encode()
  39544. req, err := http.NewRequest("PATCH", urls, body)
  39545. if err != nil {
  39546. return nil, err
  39547. }
  39548. req.Header = reqHeaders
  39549. googleapi.Expand(req.URL, map[string]string{
  39550. "profileId": strconv.FormatInt(c.profileId, 10),
  39551. })
  39552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39553. }
  39554. // Do executes the "dfareporting.remarketingLists.patch" call.
  39555. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39556. // status code is an error. Response headers are in either
  39557. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39558. // at all) in error.(*googleapi.Error).Header. Use
  39559. // googleapi.IsNotModified to check whether the returned error was
  39560. // because http.StatusNotModified was returned.
  39561. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39562. gensupport.SetOptions(c.urlParams_, opts...)
  39563. res, err := c.doRequest("json")
  39564. if res != nil && res.StatusCode == http.StatusNotModified {
  39565. if res.Body != nil {
  39566. res.Body.Close()
  39567. }
  39568. return nil, &googleapi.Error{
  39569. Code: res.StatusCode,
  39570. Header: res.Header,
  39571. }
  39572. }
  39573. if err != nil {
  39574. return nil, err
  39575. }
  39576. defer googleapi.CloseBody(res)
  39577. if err := googleapi.CheckResponse(res); err != nil {
  39578. return nil, err
  39579. }
  39580. ret := &RemarketingList{
  39581. ServerResponse: googleapi.ServerResponse{
  39582. Header: res.Header,
  39583. HTTPStatusCode: res.StatusCode,
  39584. },
  39585. }
  39586. target := &ret
  39587. if err := gensupport.DecodeResponse(target, res); err != nil {
  39588. return nil, err
  39589. }
  39590. return ret, nil
  39591. // {
  39592. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  39593. // "httpMethod": "PATCH",
  39594. // "id": "dfareporting.remarketingLists.patch",
  39595. // "parameterOrder": [
  39596. // "profileId",
  39597. // "id"
  39598. // ],
  39599. // "parameters": {
  39600. // "id": {
  39601. // "description": "Remarketing list ID.",
  39602. // "format": "int64",
  39603. // "location": "query",
  39604. // "required": true,
  39605. // "type": "string"
  39606. // },
  39607. // "profileId": {
  39608. // "description": "User profile ID associated with this request.",
  39609. // "format": "int64",
  39610. // "location": "path",
  39611. // "required": true,
  39612. // "type": "string"
  39613. // }
  39614. // },
  39615. // "path": "userprofiles/{profileId}/remarketingLists",
  39616. // "request": {
  39617. // "$ref": "RemarketingList"
  39618. // },
  39619. // "response": {
  39620. // "$ref": "RemarketingList"
  39621. // },
  39622. // "scopes": [
  39623. // "https://www.googleapis.com/auth/dfatrafficking"
  39624. // ]
  39625. // }
  39626. }
  39627. // method id "dfareporting.remarketingLists.update":
  39628. type RemarketingListsUpdateCall struct {
  39629. s *Service
  39630. profileId int64
  39631. remarketinglist *RemarketingList
  39632. urlParams_ gensupport.URLParams
  39633. ctx_ context.Context
  39634. header_ http.Header
  39635. }
  39636. // Update: Updates an existing remarketing list.
  39637. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  39638. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39639. c.profileId = profileId
  39640. c.remarketinglist = remarketinglist
  39641. return c
  39642. }
  39643. // Fields allows partial responses to be retrieved. See
  39644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39645. // for more information.
  39646. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  39647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39648. return c
  39649. }
  39650. // Context sets the context to be used in this call's Do method. Any
  39651. // pending HTTP request will be aborted if the provided context is
  39652. // canceled.
  39653. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  39654. c.ctx_ = ctx
  39655. return c
  39656. }
  39657. // Header returns an http.Header that can be modified by the caller to
  39658. // add HTTP headers to the request.
  39659. func (c *RemarketingListsUpdateCall) Header() http.Header {
  39660. if c.header_ == nil {
  39661. c.header_ = make(http.Header)
  39662. }
  39663. return c.header_
  39664. }
  39665. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39666. reqHeaders := make(http.Header)
  39667. for k, v := range c.header_ {
  39668. reqHeaders[k] = v
  39669. }
  39670. reqHeaders.Set("User-Agent", c.s.userAgent())
  39671. var body io.Reader = nil
  39672. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39673. if err != nil {
  39674. return nil, err
  39675. }
  39676. reqHeaders.Set("Content-Type", "application/json")
  39677. c.urlParams_.Set("alt", alt)
  39678. c.urlParams_.Set("prettyPrint", "false")
  39679. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39680. urls += "?" + c.urlParams_.Encode()
  39681. req, err := http.NewRequest("PUT", urls, body)
  39682. if err != nil {
  39683. return nil, err
  39684. }
  39685. req.Header = reqHeaders
  39686. googleapi.Expand(req.URL, map[string]string{
  39687. "profileId": strconv.FormatInt(c.profileId, 10),
  39688. })
  39689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39690. }
  39691. // Do executes the "dfareporting.remarketingLists.update" call.
  39692. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39693. // status code is an error. Response headers are in either
  39694. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39695. // at all) in error.(*googleapi.Error).Header. Use
  39696. // googleapi.IsNotModified to check whether the returned error was
  39697. // because http.StatusNotModified was returned.
  39698. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39699. gensupport.SetOptions(c.urlParams_, opts...)
  39700. res, err := c.doRequest("json")
  39701. if res != nil && res.StatusCode == http.StatusNotModified {
  39702. if res.Body != nil {
  39703. res.Body.Close()
  39704. }
  39705. return nil, &googleapi.Error{
  39706. Code: res.StatusCode,
  39707. Header: res.Header,
  39708. }
  39709. }
  39710. if err != nil {
  39711. return nil, err
  39712. }
  39713. defer googleapi.CloseBody(res)
  39714. if err := googleapi.CheckResponse(res); err != nil {
  39715. return nil, err
  39716. }
  39717. ret := &RemarketingList{
  39718. ServerResponse: googleapi.ServerResponse{
  39719. Header: res.Header,
  39720. HTTPStatusCode: res.StatusCode,
  39721. },
  39722. }
  39723. target := &ret
  39724. if err := gensupport.DecodeResponse(target, res); err != nil {
  39725. return nil, err
  39726. }
  39727. return ret, nil
  39728. // {
  39729. // "description": "Updates an existing remarketing list.",
  39730. // "httpMethod": "PUT",
  39731. // "id": "dfareporting.remarketingLists.update",
  39732. // "parameterOrder": [
  39733. // "profileId"
  39734. // ],
  39735. // "parameters": {
  39736. // "profileId": {
  39737. // "description": "User profile ID associated with this request.",
  39738. // "format": "int64",
  39739. // "location": "path",
  39740. // "required": true,
  39741. // "type": "string"
  39742. // }
  39743. // },
  39744. // "path": "userprofiles/{profileId}/remarketingLists",
  39745. // "request": {
  39746. // "$ref": "RemarketingList"
  39747. // },
  39748. // "response": {
  39749. // "$ref": "RemarketingList"
  39750. // },
  39751. // "scopes": [
  39752. // "https://www.googleapis.com/auth/dfatrafficking"
  39753. // ]
  39754. // }
  39755. }
  39756. // method id "dfareporting.reports.delete":
  39757. type ReportsDeleteCall struct {
  39758. s *Service
  39759. profileId int64
  39760. reportId int64
  39761. urlParams_ gensupport.URLParams
  39762. ctx_ context.Context
  39763. header_ http.Header
  39764. }
  39765. // Delete: Deletes a report by its ID.
  39766. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  39767. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39768. c.profileId = profileId
  39769. c.reportId = reportId
  39770. return c
  39771. }
  39772. // Fields allows partial responses to be retrieved. See
  39773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39774. // for more information.
  39775. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  39776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39777. return c
  39778. }
  39779. // Context sets the context to be used in this call's Do method. Any
  39780. // pending HTTP request will be aborted if the provided context is
  39781. // canceled.
  39782. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  39783. c.ctx_ = ctx
  39784. return c
  39785. }
  39786. // Header returns an http.Header that can be modified by the caller to
  39787. // add HTTP headers to the request.
  39788. func (c *ReportsDeleteCall) Header() http.Header {
  39789. if c.header_ == nil {
  39790. c.header_ = make(http.Header)
  39791. }
  39792. return c.header_
  39793. }
  39794. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39795. reqHeaders := make(http.Header)
  39796. for k, v := range c.header_ {
  39797. reqHeaders[k] = v
  39798. }
  39799. reqHeaders.Set("User-Agent", c.s.userAgent())
  39800. var body io.Reader = nil
  39801. c.urlParams_.Set("alt", alt)
  39802. c.urlParams_.Set("prettyPrint", "false")
  39803. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39804. urls += "?" + c.urlParams_.Encode()
  39805. req, err := http.NewRequest("DELETE", urls, body)
  39806. if err != nil {
  39807. return nil, err
  39808. }
  39809. req.Header = reqHeaders
  39810. googleapi.Expand(req.URL, map[string]string{
  39811. "profileId": strconv.FormatInt(c.profileId, 10),
  39812. "reportId": strconv.FormatInt(c.reportId, 10),
  39813. })
  39814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39815. }
  39816. // Do executes the "dfareporting.reports.delete" call.
  39817. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  39818. gensupport.SetOptions(c.urlParams_, opts...)
  39819. res, err := c.doRequest("json")
  39820. if err != nil {
  39821. return err
  39822. }
  39823. defer googleapi.CloseBody(res)
  39824. if err := googleapi.CheckResponse(res); err != nil {
  39825. return err
  39826. }
  39827. return nil
  39828. // {
  39829. // "description": "Deletes a report by its ID.",
  39830. // "httpMethod": "DELETE",
  39831. // "id": "dfareporting.reports.delete",
  39832. // "parameterOrder": [
  39833. // "profileId",
  39834. // "reportId"
  39835. // ],
  39836. // "parameters": {
  39837. // "profileId": {
  39838. // "description": "The DFA user profile ID.",
  39839. // "format": "int64",
  39840. // "location": "path",
  39841. // "required": true,
  39842. // "type": "string"
  39843. // },
  39844. // "reportId": {
  39845. // "description": "The ID of the report.",
  39846. // "format": "int64",
  39847. // "location": "path",
  39848. // "required": true,
  39849. // "type": "string"
  39850. // }
  39851. // },
  39852. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39853. // "scopes": [
  39854. // "https://www.googleapis.com/auth/dfareporting"
  39855. // ]
  39856. // }
  39857. }
  39858. // method id "dfareporting.reports.get":
  39859. type ReportsGetCall struct {
  39860. s *Service
  39861. profileId int64
  39862. reportId int64
  39863. urlParams_ gensupport.URLParams
  39864. ifNoneMatch_ string
  39865. ctx_ context.Context
  39866. header_ http.Header
  39867. }
  39868. // Get: Retrieves a report by its ID.
  39869. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  39870. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39871. c.profileId = profileId
  39872. c.reportId = reportId
  39873. return c
  39874. }
  39875. // Fields allows partial responses to be retrieved. See
  39876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39877. // for more information.
  39878. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  39879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39880. return c
  39881. }
  39882. // IfNoneMatch sets the optional parameter which makes the operation
  39883. // fail if the object's ETag matches the given value. This is useful for
  39884. // getting updates only after the object has changed since the last
  39885. // request. Use googleapi.IsNotModified to check whether the response
  39886. // error from Do is the result of In-None-Match.
  39887. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  39888. c.ifNoneMatch_ = entityTag
  39889. return c
  39890. }
  39891. // Context sets the context to be used in this call's Do method. Any
  39892. // pending HTTP request will be aborted if the provided context is
  39893. // canceled.
  39894. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  39895. c.ctx_ = ctx
  39896. return c
  39897. }
  39898. // Header returns an http.Header that can be modified by the caller to
  39899. // add HTTP headers to the request.
  39900. func (c *ReportsGetCall) Header() http.Header {
  39901. if c.header_ == nil {
  39902. c.header_ = make(http.Header)
  39903. }
  39904. return c.header_
  39905. }
  39906. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  39907. reqHeaders := make(http.Header)
  39908. for k, v := range c.header_ {
  39909. reqHeaders[k] = v
  39910. }
  39911. reqHeaders.Set("User-Agent", c.s.userAgent())
  39912. if c.ifNoneMatch_ != "" {
  39913. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39914. }
  39915. var body io.Reader = nil
  39916. c.urlParams_.Set("alt", alt)
  39917. c.urlParams_.Set("prettyPrint", "false")
  39918. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39919. urls += "?" + c.urlParams_.Encode()
  39920. req, err := http.NewRequest("GET", urls, body)
  39921. if err != nil {
  39922. return nil, err
  39923. }
  39924. req.Header = reqHeaders
  39925. googleapi.Expand(req.URL, map[string]string{
  39926. "profileId": strconv.FormatInt(c.profileId, 10),
  39927. "reportId": strconv.FormatInt(c.reportId, 10),
  39928. })
  39929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39930. }
  39931. // Do executes the "dfareporting.reports.get" call.
  39932. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39933. // code is an error. Response headers are in either
  39934. // *Report.ServerResponse.Header or (if a response was returned at all)
  39935. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39936. // check whether the returned error was because http.StatusNotModified
  39937. // was returned.
  39938. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39939. gensupport.SetOptions(c.urlParams_, opts...)
  39940. res, err := c.doRequest("json")
  39941. if res != nil && res.StatusCode == http.StatusNotModified {
  39942. if res.Body != nil {
  39943. res.Body.Close()
  39944. }
  39945. return nil, &googleapi.Error{
  39946. Code: res.StatusCode,
  39947. Header: res.Header,
  39948. }
  39949. }
  39950. if err != nil {
  39951. return nil, err
  39952. }
  39953. defer googleapi.CloseBody(res)
  39954. if err := googleapi.CheckResponse(res); err != nil {
  39955. return nil, err
  39956. }
  39957. ret := &Report{
  39958. ServerResponse: googleapi.ServerResponse{
  39959. Header: res.Header,
  39960. HTTPStatusCode: res.StatusCode,
  39961. },
  39962. }
  39963. target := &ret
  39964. if err := gensupport.DecodeResponse(target, res); err != nil {
  39965. return nil, err
  39966. }
  39967. return ret, nil
  39968. // {
  39969. // "description": "Retrieves a report by its ID.",
  39970. // "httpMethod": "GET",
  39971. // "id": "dfareporting.reports.get",
  39972. // "parameterOrder": [
  39973. // "profileId",
  39974. // "reportId"
  39975. // ],
  39976. // "parameters": {
  39977. // "profileId": {
  39978. // "description": "The DFA user profile ID.",
  39979. // "format": "int64",
  39980. // "location": "path",
  39981. // "required": true,
  39982. // "type": "string"
  39983. // },
  39984. // "reportId": {
  39985. // "description": "The ID of the report.",
  39986. // "format": "int64",
  39987. // "location": "path",
  39988. // "required": true,
  39989. // "type": "string"
  39990. // }
  39991. // },
  39992. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39993. // "response": {
  39994. // "$ref": "Report"
  39995. // },
  39996. // "scopes": [
  39997. // "https://www.googleapis.com/auth/dfareporting"
  39998. // ]
  39999. // }
  40000. }
  40001. // method id "dfareporting.reports.insert":
  40002. type ReportsInsertCall struct {
  40003. s *Service
  40004. profileId int64
  40005. report *Report
  40006. urlParams_ gensupport.URLParams
  40007. ctx_ context.Context
  40008. header_ http.Header
  40009. }
  40010. // Insert: Creates a report.
  40011. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  40012. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40013. c.profileId = profileId
  40014. c.report = report
  40015. return c
  40016. }
  40017. // Fields allows partial responses to be retrieved. See
  40018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40019. // for more information.
  40020. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  40021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40022. return c
  40023. }
  40024. // Context sets the context to be used in this call's Do method. Any
  40025. // pending HTTP request will be aborted if the provided context is
  40026. // canceled.
  40027. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  40028. c.ctx_ = ctx
  40029. return c
  40030. }
  40031. // Header returns an http.Header that can be modified by the caller to
  40032. // add HTTP headers to the request.
  40033. func (c *ReportsInsertCall) Header() http.Header {
  40034. if c.header_ == nil {
  40035. c.header_ = make(http.Header)
  40036. }
  40037. return c.header_
  40038. }
  40039. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  40040. reqHeaders := make(http.Header)
  40041. for k, v := range c.header_ {
  40042. reqHeaders[k] = v
  40043. }
  40044. reqHeaders.Set("User-Agent", c.s.userAgent())
  40045. var body io.Reader = nil
  40046. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40047. if err != nil {
  40048. return nil, err
  40049. }
  40050. reqHeaders.Set("Content-Type", "application/json")
  40051. c.urlParams_.Set("alt", alt)
  40052. c.urlParams_.Set("prettyPrint", "false")
  40053. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  40054. urls += "?" + c.urlParams_.Encode()
  40055. req, err := http.NewRequest("POST", urls, body)
  40056. if err != nil {
  40057. return nil, err
  40058. }
  40059. req.Header = reqHeaders
  40060. googleapi.Expand(req.URL, map[string]string{
  40061. "profileId": strconv.FormatInt(c.profileId, 10),
  40062. })
  40063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40064. }
  40065. // Do executes the "dfareporting.reports.insert" call.
  40066. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40067. // code is an error. Response headers are in either
  40068. // *Report.ServerResponse.Header or (if a response was returned at all)
  40069. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40070. // check whether the returned error was because http.StatusNotModified
  40071. // was returned.
  40072. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40073. gensupport.SetOptions(c.urlParams_, opts...)
  40074. res, err := c.doRequest("json")
  40075. if res != nil && res.StatusCode == http.StatusNotModified {
  40076. if res.Body != nil {
  40077. res.Body.Close()
  40078. }
  40079. return nil, &googleapi.Error{
  40080. Code: res.StatusCode,
  40081. Header: res.Header,
  40082. }
  40083. }
  40084. if err != nil {
  40085. return nil, err
  40086. }
  40087. defer googleapi.CloseBody(res)
  40088. if err := googleapi.CheckResponse(res); err != nil {
  40089. return nil, err
  40090. }
  40091. ret := &Report{
  40092. ServerResponse: googleapi.ServerResponse{
  40093. Header: res.Header,
  40094. HTTPStatusCode: res.StatusCode,
  40095. },
  40096. }
  40097. target := &ret
  40098. if err := gensupport.DecodeResponse(target, res); err != nil {
  40099. return nil, err
  40100. }
  40101. return ret, nil
  40102. // {
  40103. // "description": "Creates a report.",
  40104. // "httpMethod": "POST",
  40105. // "id": "dfareporting.reports.insert",
  40106. // "parameterOrder": [
  40107. // "profileId"
  40108. // ],
  40109. // "parameters": {
  40110. // "profileId": {
  40111. // "description": "The DFA user profile ID.",
  40112. // "format": "int64",
  40113. // "location": "path",
  40114. // "required": true,
  40115. // "type": "string"
  40116. // }
  40117. // },
  40118. // "path": "userprofiles/{profileId}/reports",
  40119. // "request": {
  40120. // "$ref": "Report"
  40121. // },
  40122. // "response": {
  40123. // "$ref": "Report"
  40124. // },
  40125. // "scopes": [
  40126. // "https://www.googleapis.com/auth/dfareporting"
  40127. // ]
  40128. // }
  40129. }
  40130. // method id "dfareporting.reports.list":
  40131. type ReportsListCall struct {
  40132. s *Service
  40133. profileId int64
  40134. urlParams_ gensupport.URLParams
  40135. ifNoneMatch_ string
  40136. ctx_ context.Context
  40137. header_ http.Header
  40138. }
  40139. // List: Retrieves list of reports.
  40140. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  40141. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40142. c.profileId = profileId
  40143. return c
  40144. }
  40145. // MaxResults sets the optional parameter "maxResults": Maximum number
  40146. // of results to return.
  40147. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  40148. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40149. return c
  40150. }
  40151. // PageToken sets the optional parameter "pageToken": The value of the
  40152. // nextToken from the previous result page.
  40153. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  40154. c.urlParams_.Set("pageToken", pageToken)
  40155. return c
  40156. }
  40157. // Scope sets the optional parameter "scope": The scope that defines
  40158. // which results are returned.
  40159. //
  40160. // Possible values:
  40161. // "ALL" - All reports in account.
  40162. // "MINE" (default) - My reports.
  40163. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  40164. c.urlParams_.Set("scope", scope)
  40165. return c
  40166. }
  40167. // SortField sets the optional parameter "sortField": The field by which
  40168. // to sort the list.
  40169. //
  40170. // Possible values:
  40171. // "ID" - Sort by report ID.
  40172. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  40173. // "NAME" - Sort by name of reports.
  40174. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  40175. c.urlParams_.Set("sortField", sortField)
  40176. return c
  40177. }
  40178. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40179. // results.
  40180. //
  40181. // Possible values:
  40182. // "ASCENDING" - Ascending order.
  40183. // "DESCENDING" (default) - Descending order.
  40184. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  40185. c.urlParams_.Set("sortOrder", sortOrder)
  40186. return c
  40187. }
  40188. // Fields allows partial responses to be retrieved. See
  40189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40190. // for more information.
  40191. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  40192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40193. return c
  40194. }
  40195. // IfNoneMatch sets the optional parameter which makes the operation
  40196. // fail if the object's ETag matches the given value. This is useful for
  40197. // getting updates only after the object has changed since the last
  40198. // request. Use googleapi.IsNotModified to check whether the response
  40199. // error from Do is the result of In-None-Match.
  40200. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  40201. c.ifNoneMatch_ = entityTag
  40202. return c
  40203. }
  40204. // Context sets the context to be used in this call's Do method. Any
  40205. // pending HTTP request will be aborted if the provided context is
  40206. // canceled.
  40207. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  40208. c.ctx_ = ctx
  40209. return c
  40210. }
  40211. // Header returns an http.Header that can be modified by the caller to
  40212. // add HTTP headers to the request.
  40213. func (c *ReportsListCall) Header() http.Header {
  40214. if c.header_ == nil {
  40215. c.header_ = make(http.Header)
  40216. }
  40217. return c.header_
  40218. }
  40219. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  40220. reqHeaders := make(http.Header)
  40221. for k, v := range c.header_ {
  40222. reqHeaders[k] = v
  40223. }
  40224. reqHeaders.Set("User-Agent", c.s.userAgent())
  40225. if c.ifNoneMatch_ != "" {
  40226. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40227. }
  40228. var body io.Reader = nil
  40229. c.urlParams_.Set("alt", alt)
  40230. c.urlParams_.Set("prettyPrint", "false")
  40231. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  40232. urls += "?" + c.urlParams_.Encode()
  40233. req, err := http.NewRequest("GET", urls, body)
  40234. if err != nil {
  40235. return nil, err
  40236. }
  40237. req.Header = reqHeaders
  40238. googleapi.Expand(req.URL, map[string]string{
  40239. "profileId": strconv.FormatInt(c.profileId, 10),
  40240. })
  40241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40242. }
  40243. // Do executes the "dfareporting.reports.list" call.
  40244. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  40245. // status code is an error. Response headers are in either
  40246. // *ReportList.ServerResponse.Header or (if a response was returned at
  40247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40248. // to check whether the returned error was because
  40249. // http.StatusNotModified was returned.
  40250. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  40251. gensupport.SetOptions(c.urlParams_, opts...)
  40252. res, err := c.doRequest("json")
  40253. if res != nil && res.StatusCode == http.StatusNotModified {
  40254. if res.Body != nil {
  40255. res.Body.Close()
  40256. }
  40257. return nil, &googleapi.Error{
  40258. Code: res.StatusCode,
  40259. Header: res.Header,
  40260. }
  40261. }
  40262. if err != nil {
  40263. return nil, err
  40264. }
  40265. defer googleapi.CloseBody(res)
  40266. if err := googleapi.CheckResponse(res); err != nil {
  40267. return nil, err
  40268. }
  40269. ret := &ReportList{
  40270. ServerResponse: googleapi.ServerResponse{
  40271. Header: res.Header,
  40272. HTTPStatusCode: res.StatusCode,
  40273. },
  40274. }
  40275. target := &ret
  40276. if err := gensupport.DecodeResponse(target, res); err != nil {
  40277. return nil, err
  40278. }
  40279. return ret, nil
  40280. // {
  40281. // "description": "Retrieves list of reports.",
  40282. // "httpMethod": "GET",
  40283. // "id": "dfareporting.reports.list",
  40284. // "parameterOrder": [
  40285. // "profileId"
  40286. // ],
  40287. // "parameters": {
  40288. // "maxResults": {
  40289. // "default": "10",
  40290. // "description": "Maximum number of results to return.",
  40291. // "format": "int32",
  40292. // "location": "query",
  40293. // "maximum": "10",
  40294. // "minimum": "0",
  40295. // "type": "integer"
  40296. // },
  40297. // "pageToken": {
  40298. // "description": "The value of the nextToken from the previous result page.",
  40299. // "location": "query",
  40300. // "type": "string"
  40301. // },
  40302. // "profileId": {
  40303. // "description": "The DFA user profile ID.",
  40304. // "format": "int64",
  40305. // "location": "path",
  40306. // "required": true,
  40307. // "type": "string"
  40308. // },
  40309. // "scope": {
  40310. // "default": "MINE",
  40311. // "description": "The scope that defines which results are returned.",
  40312. // "enum": [
  40313. // "ALL",
  40314. // "MINE"
  40315. // ],
  40316. // "enumDescriptions": [
  40317. // "All reports in account.",
  40318. // "My reports."
  40319. // ],
  40320. // "location": "query",
  40321. // "type": "string"
  40322. // },
  40323. // "sortField": {
  40324. // "default": "LAST_MODIFIED_TIME",
  40325. // "description": "The field by which to sort the list.",
  40326. // "enum": [
  40327. // "ID",
  40328. // "LAST_MODIFIED_TIME",
  40329. // "NAME"
  40330. // ],
  40331. // "enumDescriptions": [
  40332. // "Sort by report ID.",
  40333. // "Sort by 'lastModifiedTime' field.",
  40334. // "Sort by name of reports."
  40335. // ],
  40336. // "location": "query",
  40337. // "type": "string"
  40338. // },
  40339. // "sortOrder": {
  40340. // "default": "DESCENDING",
  40341. // "description": "Order of sorted results.",
  40342. // "enum": [
  40343. // "ASCENDING",
  40344. // "DESCENDING"
  40345. // ],
  40346. // "enumDescriptions": [
  40347. // "Ascending order.",
  40348. // "Descending order."
  40349. // ],
  40350. // "location": "query",
  40351. // "type": "string"
  40352. // }
  40353. // },
  40354. // "path": "userprofiles/{profileId}/reports",
  40355. // "response": {
  40356. // "$ref": "ReportList"
  40357. // },
  40358. // "scopes": [
  40359. // "https://www.googleapis.com/auth/dfareporting"
  40360. // ]
  40361. // }
  40362. }
  40363. // Pages invokes f for each page of results.
  40364. // A non-nil error returned from f will halt the iteration.
  40365. // The provided context supersedes any context provided to the Context method.
  40366. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  40367. c.ctx_ = ctx
  40368. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40369. for {
  40370. x, err := c.Do()
  40371. if err != nil {
  40372. return err
  40373. }
  40374. if err := f(x); err != nil {
  40375. return err
  40376. }
  40377. if x.NextPageToken == "" {
  40378. return nil
  40379. }
  40380. c.PageToken(x.NextPageToken)
  40381. }
  40382. }
  40383. // method id "dfareporting.reports.patch":
  40384. type ReportsPatchCall struct {
  40385. s *Service
  40386. profileId int64
  40387. reportId int64
  40388. report *Report
  40389. urlParams_ gensupport.URLParams
  40390. ctx_ context.Context
  40391. header_ http.Header
  40392. }
  40393. // Patch: Updates a report. This method supports patch semantics.
  40394. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  40395. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40396. c.profileId = profileId
  40397. c.reportId = reportId
  40398. c.report = report
  40399. return c
  40400. }
  40401. // Fields allows partial responses to be retrieved. See
  40402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40403. // for more information.
  40404. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  40405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40406. return c
  40407. }
  40408. // Context sets the context to be used in this call's Do method. Any
  40409. // pending HTTP request will be aborted if the provided context is
  40410. // canceled.
  40411. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  40412. c.ctx_ = ctx
  40413. return c
  40414. }
  40415. // Header returns an http.Header that can be modified by the caller to
  40416. // add HTTP headers to the request.
  40417. func (c *ReportsPatchCall) Header() http.Header {
  40418. if c.header_ == nil {
  40419. c.header_ = make(http.Header)
  40420. }
  40421. return c.header_
  40422. }
  40423. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  40424. reqHeaders := make(http.Header)
  40425. for k, v := range c.header_ {
  40426. reqHeaders[k] = v
  40427. }
  40428. reqHeaders.Set("User-Agent", c.s.userAgent())
  40429. var body io.Reader = nil
  40430. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40431. if err != nil {
  40432. return nil, err
  40433. }
  40434. reqHeaders.Set("Content-Type", "application/json")
  40435. c.urlParams_.Set("alt", alt)
  40436. c.urlParams_.Set("prettyPrint", "false")
  40437. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40438. urls += "?" + c.urlParams_.Encode()
  40439. req, err := http.NewRequest("PATCH", urls, body)
  40440. if err != nil {
  40441. return nil, err
  40442. }
  40443. req.Header = reqHeaders
  40444. googleapi.Expand(req.URL, map[string]string{
  40445. "profileId": strconv.FormatInt(c.profileId, 10),
  40446. "reportId": strconv.FormatInt(c.reportId, 10),
  40447. })
  40448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40449. }
  40450. // Do executes the "dfareporting.reports.patch" call.
  40451. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40452. // code is an error. Response headers are in either
  40453. // *Report.ServerResponse.Header or (if a response was returned at all)
  40454. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40455. // check whether the returned error was because http.StatusNotModified
  40456. // was returned.
  40457. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40458. gensupport.SetOptions(c.urlParams_, opts...)
  40459. res, err := c.doRequest("json")
  40460. if res != nil && res.StatusCode == http.StatusNotModified {
  40461. if res.Body != nil {
  40462. res.Body.Close()
  40463. }
  40464. return nil, &googleapi.Error{
  40465. Code: res.StatusCode,
  40466. Header: res.Header,
  40467. }
  40468. }
  40469. if err != nil {
  40470. return nil, err
  40471. }
  40472. defer googleapi.CloseBody(res)
  40473. if err := googleapi.CheckResponse(res); err != nil {
  40474. return nil, err
  40475. }
  40476. ret := &Report{
  40477. ServerResponse: googleapi.ServerResponse{
  40478. Header: res.Header,
  40479. HTTPStatusCode: res.StatusCode,
  40480. },
  40481. }
  40482. target := &ret
  40483. if err := gensupport.DecodeResponse(target, res); err != nil {
  40484. return nil, err
  40485. }
  40486. return ret, nil
  40487. // {
  40488. // "description": "Updates a report. This method supports patch semantics.",
  40489. // "httpMethod": "PATCH",
  40490. // "id": "dfareporting.reports.patch",
  40491. // "parameterOrder": [
  40492. // "profileId",
  40493. // "reportId"
  40494. // ],
  40495. // "parameters": {
  40496. // "profileId": {
  40497. // "description": "The DFA user profile ID.",
  40498. // "format": "int64",
  40499. // "location": "path",
  40500. // "required": true,
  40501. // "type": "string"
  40502. // },
  40503. // "reportId": {
  40504. // "description": "The ID of the report.",
  40505. // "format": "int64",
  40506. // "location": "path",
  40507. // "required": true,
  40508. // "type": "string"
  40509. // }
  40510. // },
  40511. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40512. // "request": {
  40513. // "$ref": "Report"
  40514. // },
  40515. // "response": {
  40516. // "$ref": "Report"
  40517. // },
  40518. // "scopes": [
  40519. // "https://www.googleapis.com/auth/dfareporting"
  40520. // ]
  40521. // }
  40522. }
  40523. // method id "dfareporting.reports.run":
  40524. type ReportsRunCall struct {
  40525. s *Service
  40526. profileId int64
  40527. reportId int64
  40528. urlParams_ gensupport.URLParams
  40529. ctx_ context.Context
  40530. header_ http.Header
  40531. }
  40532. // Run: Runs a report.
  40533. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  40534. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40535. c.profileId = profileId
  40536. c.reportId = reportId
  40537. return c
  40538. }
  40539. // Synchronous sets the optional parameter "synchronous": If set and
  40540. // true, tries to run the report synchronously.
  40541. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  40542. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  40543. return c
  40544. }
  40545. // Fields allows partial responses to be retrieved. See
  40546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40547. // for more information.
  40548. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  40549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40550. return c
  40551. }
  40552. // Context sets the context to be used in this call's Do method. Any
  40553. // pending HTTP request will be aborted if the provided context is
  40554. // canceled.
  40555. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  40556. c.ctx_ = ctx
  40557. return c
  40558. }
  40559. // Header returns an http.Header that can be modified by the caller to
  40560. // add HTTP headers to the request.
  40561. func (c *ReportsRunCall) Header() http.Header {
  40562. if c.header_ == nil {
  40563. c.header_ = make(http.Header)
  40564. }
  40565. return c.header_
  40566. }
  40567. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  40568. reqHeaders := make(http.Header)
  40569. for k, v := range c.header_ {
  40570. reqHeaders[k] = v
  40571. }
  40572. reqHeaders.Set("User-Agent", c.s.userAgent())
  40573. var body io.Reader = nil
  40574. c.urlParams_.Set("alt", alt)
  40575. c.urlParams_.Set("prettyPrint", "false")
  40576. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  40577. urls += "?" + c.urlParams_.Encode()
  40578. req, err := http.NewRequest("POST", urls, body)
  40579. if err != nil {
  40580. return nil, err
  40581. }
  40582. req.Header = reqHeaders
  40583. googleapi.Expand(req.URL, map[string]string{
  40584. "profileId": strconv.FormatInt(c.profileId, 10),
  40585. "reportId": strconv.FormatInt(c.reportId, 10),
  40586. })
  40587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40588. }
  40589. // Do executes the "dfareporting.reports.run" call.
  40590. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40591. // code is an error. Response headers are in either
  40592. // *File.ServerResponse.Header or (if a response was returned at all) in
  40593. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40594. // whether the returned error was because http.StatusNotModified was
  40595. // returned.
  40596. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40597. gensupport.SetOptions(c.urlParams_, opts...)
  40598. res, err := c.doRequest("json")
  40599. if res != nil && res.StatusCode == http.StatusNotModified {
  40600. if res.Body != nil {
  40601. res.Body.Close()
  40602. }
  40603. return nil, &googleapi.Error{
  40604. Code: res.StatusCode,
  40605. Header: res.Header,
  40606. }
  40607. }
  40608. if err != nil {
  40609. return nil, err
  40610. }
  40611. defer googleapi.CloseBody(res)
  40612. if err := googleapi.CheckResponse(res); err != nil {
  40613. return nil, err
  40614. }
  40615. ret := &File{
  40616. ServerResponse: googleapi.ServerResponse{
  40617. Header: res.Header,
  40618. HTTPStatusCode: res.StatusCode,
  40619. },
  40620. }
  40621. target := &ret
  40622. if err := gensupport.DecodeResponse(target, res); err != nil {
  40623. return nil, err
  40624. }
  40625. return ret, nil
  40626. // {
  40627. // "description": "Runs a report.",
  40628. // "httpMethod": "POST",
  40629. // "id": "dfareporting.reports.run",
  40630. // "parameterOrder": [
  40631. // "profileId",
  40632. // "reportId"
  40633. // ],
  40634. // "parameters": {
  40635. // "profileId": {
  40636. // "description": "The DFA profile ID.",
  40637. // "format": "int64",
  40638. // "location": "path",
  40639. // "required": true,
  40640. // "type": "string"
  40641. // },
  40642. // "reportId": {
  40643. // "description": "The ID of the report.",
  40644. // "format": "int64",
  40645. // "location": "path",
  40646. // "required": true,
  40647. // "type": "string"
  40648. // },
  40649. // "synchronous": {
  40650. // "default": "false",
  40651. // "description": "If set and true, tries to run the report synchronously.",
  40652. // "location": "query",
  40653. // "type": "boolean"
  40654. // }
  40655. // },
  40656. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  40657. // "response": {
  40658. // "$ref": "File"
  40659. // },
  40660. // "scopes": [
  40661. // "https://www.googleapis.com/auth/dfareporting"
  40662. // ]
  40663. // }
  40664. }
  40665. // method id "dfareporting.reports.update":
  40666. type ReportsUpdateCall struct {
  40667. s *Service
  40668. profileId int64
  40669. reportId int64
  40670. report *Report
  40671. urlParams_ gensupport.URLParams
  40672. ctx_ context.Context
  40673. header_ http.Header
  40674. }
  40675. // Update: Updates a report.
  40676. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  40677. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40678. c.profileId = profileId
  40679. c.reportId = reportId
  40680. c.report = report
  40681. return c
  40682. }
  40683. // Fields allows partial responses to be retrieved. See
  40684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40685. // for more information.
  40686. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  40687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40688. return c
  40689. }
  40690. // Context sets the context to be used in this call's Do method. Any
  40691. // pending HTTP request will be aborted if the provided context is
  40692. // canceled.
  40693. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  40694. c.ctx_ = ctx
  40695. return c
  40696. }
  40697. // Header returns an http.Header that can be modified by the caller to
  40698. // add HTTP headers to the request.
  40699. func (c *ReportsUpdateCall) Header() http.Header {
  40700. if c.header_ == nil {
  40701. c.header_ = make(http.Header)
  40702. }
  40703. return c.header_
  40704. }
  40705. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  40706. reqHeaders := make(http.Header)
  40707. for k, v := range c.header_ {
  40708. reqHeaders[k] = v
  40709. }
  40710. reqHeaders.Set("User-Agent", c.s.userAgent())
  40711. var body io.Reader = nil
  40712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40713. if err != nil {
  40714. return nil, err
  40715. }
  40716. reqHeaders.Set("Content-Type", "application/json")
  40717. c.urlParams_.Set("alt", alt)
  40718. c.urlParams_.Set("prettyPrint", "false")
  40719. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40720. urls += "?" + c.urlParams_.Encode()
  40721. req, err := http.NewRequest("PUT", urls, body)
  40722. if err != nil {
  40723. return nil, err
  40724. }
  40725. req.Header = reqHeaders
  40726. googleapi.Expand(req.URL, map[string]string{
  40727. "profileId": strconv.FormatInt(c.profileId, 10),
  40728. "reportId": strconv.FormatInt(c.reportId, 10),
  40729. })
  40730. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40731. }
  40732. // Do executes the "dfareporting.reports.update" call.
  40733. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40734. // code is an error. Response headers are in either
  40735. // *Report.ServerResponse.Header or (if a response was returned at all)
  40736. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40737. // check whether the returned error was because http.StatusNotModified
  40738. // was returned.
  40739. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40740. gensupport.SetOptions(c.urlParams_, opts...)
  40741. res, err := c.doRequest("json")
  40742. if res != nil && res.StatusCode == http.StatusNotModified {
  40743. if res.Body != nil {
  40744. res.Body.Close()
  40745. }
  40746. return nil, &googleapi.Error{
  40747. Code: res.StatusCode,
  40748. Header: res.Header,
  40749. }
  40750. }
  40751. if err != nil {
  40752. return nil, err
  40753. }
  40754. defer googleapi.CloseBody(res)
  40755. if err := googleapi.CheckResponse(res); err != nil {
  40756. return nil, err
  40757. }
  40758. ret := &Report{
  40759. ServerResponse: googleapi.ServerResponse{
  40760. Header: res.Header,
  40761. HTTPStatusCode: res.StatusCode,
  40762. },
  40763. }
  40764. target := &ret
  40765. if err := gensupport.DecodeResponse(target, res); err != nil {
  40766. return nil, err
  40767. }
  40768. return ret, nil
  40769. // {
  40770. // "description": "Updates a report.",
  40771. // "httpMethod": "PUT",
  40772. // "id": "dfareporting.reports.update",
  40773. // "parameterOrder": [
  40774. // "profileId",
  40775. // "reportId"
  40776. // ],
  40777. // "parameters": {
  40778. // "profileId": {
  40779. // "description": "The DFA user profile ID.",
  40780. // "format": "int64",
  40781. // "location": "path",
  40782. // "required": true,
  40783. // "type": "string"
  40784. // },
  40785. // "reportId": {
  40786. // "description": "The ID of the report.",
  40787. // "format": "int64",
  40788. // "location": "path",
  40789. // "required": true,
  40790. // "type": "string"
  40791. // }
  40792. // },
  40793. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40794. // "request": {
  40795. // "$ref": "Report"
  40796. // },
  40797. // "response": {
  40798. // "$ref": "Report"
  40799. // },
  40800. // "scopes": [
  40801. // "https://www.googleapis.com/auth/dfareporting"
  40802. // ]
  40803. // }
  40804. }
  40805. // method id "dfareporting.reports.compatibleFields.query":
  40806. type ReportsCompatibleFieldsQueryCall struct {
  40807. s *Service
  40808. profileId int64
  40809. report *Report
  40810. urlParams_ gensupport.URLParams
  40811. ctx_ context.Context
  40812. header_ http.Header
  40813. }
  40814. // Query: Returns the fields that are compatible to be selected in the
  40815. // respective sections of a report criteria, given the fields already
  40816. // selected in the input report and user permissions.
  40817. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  40818. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40819. c.profileId = profileId
  40820. c.report = report
  40821. return c
  40822. }
  40823. // Fields allows partial responses to be retrieved. See
  40824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40825. // for more information.
  40826. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  40827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40828. return c
  40829. }
  40830. // Context sets the context to be used in this call's Do method. Any
  40831. // pending HTTP request will be aborted if the provided context is
  40832. // canceled.
  40833. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  40834. c.ctx_ = ctx
  40835. return c
  40836. }
  40837. // Header returns an http.Header that can be modified by the caller to
  40838. // add HTTP headers to the request.
  40839. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  40840. if c.header_ == nil {
  40841. c.header_ = make(http.Header)
  40842. }
  40843. return c.header_
  40844. }
  40845. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  40846. reqHeaders := make(http.Header)
  40847. for k, v := range c.header_ {
  40848. reqHeaders[k] = v
  40849. }
  40850. reqHeaders.Set("User-Agent", c.s.userAgent())
  40851. var body io.Reader = nil
  40852. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40853. if err != nil {
  40854. return nil, err
  40855. }
  40856. reqHeaders.Set("Content-Type", "application/json")
  40857. c.urlParams_.Set("alt", alt)
  40858. c.urlParams_.Set("prettyPrint", "false")
  40859. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  40860. urls += "?" + c.urlParams_.Encode()
  40861. req, err := http.NewRequest("POST", urls, body)
  40862. if err != nil {
  40863. return nil, err
  40864. }
  40865. req.Header = reqHeaders
  40866. googleapi.Expand(req.URL, map[string]string{
  40867. "profileId": strconv.FormatInt(c.profileId, 10),
  40868. })
  40869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40870. }
  40871. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  40872. // Exactly one of *CompatibleFields or error will be non-nil. Any
  40873. // non-2xx status code is an error. Response headers are in either
  40874. // *CompatibleFields.ServerResponse.Header or (if a response was
  40875. // returned at all) in error.(*googleapi.Error).Header. Use
  40876. // googleapi.IsNotModified to check whether the returned error was
  40877. // because http.StatusNotModified was returned.
  40878. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  40879. gensupport.SetOptions(c.urlParams_, opts...)
  40880. res, err := c.doRequest("json")
  40881. if res != nil && res.StatusCode == http.StatusNotModified {
  40882. if res.Body != nil {
  40883. res.Body.Close()
  40884. }
  40885. return nil, &googleapi.Error{
  40886. Code: res.StatusCode,
  40887. Header: res.Header,
  40888. }
  40889. }
  40890. if err != nil {
  40891. return nil, err
  40892. }
  40893. defer googleapi.CloseBody(res)
  40894. if err := googleapi.CheckResponse(res); err != nil {
  40895. return nil, err
  40896. }
  40897. ret := &CompatibleFields{
  40898. ServerResponse: googleapi.ServerResponse{
  40899. Header: res.Header,
  40900. HTTPStatusCode: res.StatusCode,
  40901. },
  40902. }
  40903. target := &ret
  40904. if err := gensupport.DecodeResponse(target, res); err != nil {
  40905. return nil, err
  40906. }
  40907. return ret, nil
  40908. // {
  40909. // "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.",
  40910. // "httpMethod": "POST",
  40911. // "id": "dfareporting.reports.compatibleFields.query",
  40912. // "parameterOrder": [
  40913. // "profileId"
  40914. // ],
  40915. // "parameters": {
  40916. // "profileId": {
  40917. // "description": "The DFA user profile ID.",
  40918. // "format": "int64",
  40919. // "location": "path",
  40920. // "required": true,
  40921. // "type": "string"
  40922. // }
  40923. // },
  40924. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  40925. // "request": {
  40926. // "$ref": "Report"
  40927. // },
  40928. // "response": {
  40929. // "$ref": "CompatibleFields"
  40930. // },
  40931. // "scopes": [
  40932. // "https://www.googleapis.com/auth/dfareporting"
  40933. // ]
  40934. // }
  40935. }
  40936. // method id "dfareporting.reports.files.get":
  40937. type ReportsFilesGetCall struct {
  40938. s *Service
  40939. profileId int64
  40940. reportId int64
  40941. fileId int64
  40942. urlParams_ gensupport.URLParams
  40943. ifNoneMatch_ string
  40944. ctx_ context.Context
  40945. header_ http.Header
  40946. }
  40947. // Get: Retrieves a report file. This method supports media download.
  40948. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  40949. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40950. c.profileId = profileId
  40951. c.reportId = reportId
  40952. c.fileId = fileId
  40953. return c
  40954. }
  40955. // Fields allows partial responses to be retrieved. See
  40956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40957. // for more information.
  40958. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  40959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40960. return c
  40961. }
  40962. // IfNoneMatch sets the optional parameter which makes the operation
  40963. // fail if the object's ETag matches the given value. This is useful for
  40964. // getting updates only after the object has changed since the last
  40965. // request. Use googleapi.IsNotModified to check whether the response
  40966. // error from Do is the result of In-None-Match.
  40967. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  40968. c.ifNoneMatch_ = entityTag
  40969. return c
  40970. }
  40971. // Context sets the context to be used in this call's Do and Download
  40972. // methods. Any pending HTTP request will be aborted if the provided
  40973. // context is canceled.
  40974. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  40975. c.ctx_ = ctx
  40976. return c
  40977. }
  40978. // Header returns an http.Header that can be modified by the caller to
  40979. // add HTTP headers to the request.
  40980. func (c *ReportsFilesGetCall) Header() http.Header {
  40981. if c.header_ == nil {
  40982. c.header_ = make(http.Header)
  40983. }
  40984. return c.header_
  40985. }
  40986. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  40987. reqHeaders := make(http.Header)
  40988. for k, v := range c.header_ {
  40989. reqHeaders[k] = v
  40990. }
  40991. reqHeaders.Set("User-Agent", c.s.userAgent())
  40992. if c.ifNoneMatch_ != "" {
  40993. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40994. }
  40995. var body io.Reader = nil
  40996. c.urlParams_.Set("alt", alt)
  40997. c.urlParams_.Set("prettyPrint", "false")
  40998. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  40999. urls += "?" + c.urlParams_.Encode()
  41000. req, err := http.NewRequest("GET", urls, body)
  41001. if err != nil {
  41002. return nil, err
  41003. }
  41004. req.Header = reqHeaders
  41005. googleapi.Expand(req.URL, map[string]string{
  41006. "profileId": strconv.FormatInt(c.profileId, 10),
  41007. "reportId": strconv.FormatInt(c.reportId, 10),
  41008. "fileId": strconv.FormatInt(c.fileId, 10),
  41009. })
  41010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41011. }
  41012. // Download fetches the API endpoint's "media" value, instead of the normal
  41013. // API response value. If the returned error is nil, the Response is guaranteed to
  41014. // have a 2xx status code. Callers must close the Response.Body as usual.
  41015. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  41016. gensupport.SetOptions(c.urlParams_, opts...)
  41017. res, err := c.doRequest("media")
  41018. if err != nil {
  41019. return nil, err
  41020. }
  41021. if err := googleapi.CheckMediaResponse(res); err != nil {
  41022. res.Body.Close()
  41023. return nil, err
  41024. }
  41025. return res, nil
  41026. }
  41027. // Do executes the "dfareporting.reports.files.get" call.
  41028. // Exactly one of *File or error will be non-nil. Any non-2xx status
  41029. // code is an error. Response headers are in either
  41030. // *File.ServerResponse.Header or (if a response was returned at all) in
  41031. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41032. // whether the returned error was because http.StatusNotModified was
  41033. // returned.
  41034. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  41035. gensupport.SetOptions(c.urlParams_, opts...)
  41036. res, err := c.doRequest("json")
  41037. if res != nil && res.StatusCode == http.StatusNotModified {
  41038. if res.Body != nil {
  41039. res.Body.Close()
  41040. }
  41041. return nil, &googleapi.Error{
  41042. Code: res.StatusCode,
  41043. Header: res.Header,
  41044. }
  41045. }
  41046. if err != nil {
  41047. return nil, err
  41048. }
  41049. defer googleapi.CloseBody(res)
  41050. if err := googleapi.CheckResponse(res); err != nil {
  41051. return nil, err
  41052. }
  41053. ret := &File{
  41054. ServerResponse: googleapi.ServerResponse{
  41055. Header: res.Header,
  41056. HTTPStatusCode: res.StatusCode,
  41057. },
  41058. }
  41059. target := &ret
  41060. if err := gensupport.DecodeResponse(target, res); err != nil {
  41061. return nil, err
  41062. }
  41063. return ret, nil
  41064. // {
  41065. // "description": "Retrieves a report file. This method supports media download.",
  41066. // "httpMethod": "GET",
  41067. // "id": "dfareporting.reports.files.get",
  41068. // "parameterOrder": [
  41069. // "profileId",
  41070. // "reportId",
  41071. // "fileId"
  41072. // ],
  41073. // "parameters": {
  41074. // "fileId": {
  41075. // "description": "The ID of the report file.",
  41076. // "format": "int64",
  41077. // "location": "path",
  41078. // "required": true,
  41079. // "type": "string"
  41080. // },
  41081. // "profileId": {
  41082. // "description": "The DFA profile ID.",
  41083. // "format": "int64",
  41084. // "location": "path",
  41085. // "required": true,
  41086. // "type": "string"
  41087. // },
  41088. // "reportId": {
  41089. // "description": "The ID of the report.",
  41090. // "format": "int64",
  41091. // "location": "path",
  41092. // "required": true,
  41093. // "type": "string"
  41094. // }
  41095. // },
  41096. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  41097. // "response": {
  41098. // "$ref": "File"
  41099. // },
  41100. // "scopes": [
  41101. // "https://www.googleapis.com/auth/dfareporting"
  41102. // ],
  41103. // "supportsMediaDownload": true
  41104. // }
  41105. }
  41106. // method id "dfareporting.reports.files.list":
  41107. type ReportsFilesListCall struct {
  41108. s *Service
  41109. profileId int64
  41110. reportId int64
  41111. urlParams_ gensupport.URLParams
  41112. ifNoneMatch_ string
  41113. ctx_ context.Context
  41114. header_ http.Header
  41115. }
  41116. // List: Lists files for a report.
  41117. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  41118. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41119. c.profileId = profileId
  41120. c.reportId = reportId
  41121. return c
  41122. }
  41123. // MaxResults sets the optional parameter "maxResults": Maximum number
  41124. // of results to return.
  41125. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  41126. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41127. return c
  41128. }
  41129. // PageToken sets the optional parameter "pageToken": The value of the
  41130. // nextToken from the previous result page.
  41131. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  41132. c.urlParams_.Set("pageToken", pageToken)
  41133. return c
  41134. }
  41135. // SortField sets the optional parameter "sortField": The field by which
  41136. // to sort the list.
  41137. //
  41138. // Possible values:
  41139. // "ID" - Sort by file ID.
  41140. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  41141. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  41142. c.urlParams_.Set("sortField", sortField)
  41143. return c
  41144. }
  41145. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41146. // results.
  41147. //
  41148. // Possible values:
  41149. // "ASCENDING" - Ascending order.
  41150. // "DESCENDING" (default) - Descending order.
  41151. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  41152. c.urlParams_.Set("sortOrder", sortOrder)
  41153. return c
  41154. }
  41155. // Fields allows partial responses to be retrieved. See
  41156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41157. // for more information.
  41158. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  41159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41160. return c
  41161. }
  41162. // IfNoneMatch sets the optional parameter which makes the operation
  41163. // fail if the object's ETag matches the given value. This is useful for
  41164. // getting updates only after the object has changed since the last
  41165. // request. Use googleapi.IsNotModified to check whether the response
  41166. // error from Do is the result of In-None-Match.
  41167. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  41168. c.ifNoneMatch_ = entityTag
  41169. return c
  41170. }
  41171. // Context sets the context to be used in this call's Do method. Any
  41172. // pending HTTP request will be aborted if the provided context is
  41173. // canceled.
  41174. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  41175. c.ctx_ = ctx
  41176. return c
  41177. }
  41178. // Header returns an http.Header that can be modified by the caller to
  41179. // add HTTP headers to the request.
  41180. func (c *ReportsFilesListCall) Header() http.Header {
  41181. if c.header_ == nil {
  41182. c.header_ = make(http.Header)
  41183. }
  41184. return c.header_
  41185. }
  41186. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  41187. reqHeaders := make(http.Header)
  41188. for k, v := range c.header_ {
  41189. reqHeaders[k] = v
  41190. }
  41191. reqHeaders.Set("User-Agent", c.s.userAgent())
  41192. if c.ifNoneMatch_ != "" {
  41193. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41194. }
  41195. var body io.Reader = nil
  41196. c.urlParams_.Set("alt", alt)
  41197. c.urlParams_.Set("prettyPrint", "false")
  41198. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  41199. urls += "?" + c.urlParams_.Encode()
  41200. req, err := http.NewRequest("GET", urls, body)
  41201. if err != nil {
  41202. return nil, err
  41203. }
  41204. req.Header = reqHeaders
  41205. googleapi.Expand(req.URL, map[string]string{
  41206. "profileId": strconv.FormatInt(c.profileId, 10),
  41207. "reportId": strconv.FormatInt(c.reportId, 10),
  41208. })
  41209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41210. }
  41211. // Do executes the "dfareporting.reports.files.list" call.
  41212. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  41213. // code is an error. Response headers are in either
  41214. // *FileList.ServerResponse.Header or (if a response was returned at
  41215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41216. // to check whether the returned error was because
  41217. // http.StatusNotModified was returned.
  41218. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  41219. gensupport.SetOptions(c.urlParams_, opts...)
  41220. res, err := c.doRequest("json")
  41221. if res != nil && res.StatusCode == http.StatusNotModified {
  41222. if res.Body != nil {
  41223. res.Body.Close()
  41224. }
  41225. return nil, &googleapi.Error{
  41226. Code: res.StatusCode,
  41227. Header: res.Header,
  41228. }
  41229. }
  41230. if err != nil {
  41231. return nil, err
  41232. }
  41233. defer googleapi.CloseBody(res)
  41234. if err := googleapi.CheckResponse(res); err != nil {
  41235. return nil, err
  41236. }
  41237. ret := &FileList{
  41238. ServerResponse: googleapi.ServerResponse{
  41239. Header: res.Header,
  41240. HTTPStatusCode: res.StatusCode,
  41241. },
  41242. }
  41243. target := &ret
  41244. if err := gensupport.DecodeResponse(target, res); err != nil {
  41245. return nil, err
  41246. }
  41247. return ret, nil
  41248. // {
  41249. // "description": "Lists files for a report.",
  41250. // "httpMethod": "GET",
  41251. // "id": "dfareporting.reports.files.list",
  41252. // "parameterOrder": [
  41253. // "profileId",
  41254. // "reportId"
  41255. // ],
  41256. // "parameters": {
  41257. // "maxResults": {
  41258. // "default": "10",
  41259. // "description": "Maximum number of results to return.",
  41260. // "format": "int32",
  41261. // "location": "query",
  41262. // "maximum": "10",
  41263. // "minimum": "0",
  41264. // "type": "integer"
  41265. // },
  41266. // "pageToken": {
  41267. // "description": "The value of the nextToken from the previous result page.",
  41268. // "location": "query",
  41269. // "type": "string"
  41270. // },
  41271. // "profileId": {
  41272. // "description": "The DFA profile ID.",
  41273. // "format": "int64",
  41274. // "location": "path",
  41275. // "required": true,
  41276. // "type": "string"
  41277. // },
  41278. // "reportId": {
  41279. // "description": "The ID of the parent report.",
  41280. // "format": "int64",
  41281. // "location": "path",
  41282. // "required": true,
  41283. // "type": "string"
  41284. // },
  41285. // "sortField": {
  41286. // "default": "LAST_MODIFIED_TIME",
  41287. // "description": "The field by which to sort the list.",
  41288. // "enum": [
  41289. // "ID",
  41290. // "LAST_MODIFIED_TIME"
  41291. // ],
  41292. // "enumDescriptions": [
  41293. // "Sort by file ID.",
  41294. // "Sort by 'lastmodifiedAt' field."
  41295. // ],
  41296. // "location": "query",
  41297. // "type": "string"
  41298. // },
  41299. // "sortOrder": {
  41300. // "default": "DESCENDING",
  41301. // "description": "Order of sorted results.",
  41302. // "enum": [
  41303. // "ASCENDING",
  41304. // "DESCENDING"
  41305. // ],
  41306. // "enumDescriptions": [
  41307. // "Ascending order.",
  41308. // "Descending order."
  41309. // ],
  41310. // "location": "query",
  41311. // "type": "string"
  41312. // }
  41313. // },
  41314. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  41315. // "response": {
  41316. // "$ref": "FileList"
  41317. // },
  41318. // "scopes": [
  41319. // "https://www.googleapis.com/auth/dfareporting"
  41320. // ]
  41321. // }
  41322. }
  41323. // Pages invokes f for each page of results.
  41324. // A non-nil error returned from f will halt the iteration.
  41325. // The provided context supersedes any context provided to the Context method.
  41326. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  41327. c.ctx_ = ctx
  41328. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41329. for {
  41330. x, err := c.Do()
  41331. if err != nil {
  41332. return err
  41333. }
  41334. if err := f(x); err != nil {
  41335. return err
  41336. }
  41337. if x.NextPageToken == "" {
  41338. return nil
  41339. }
  41340. c.PageToken(x.NextPageToken)
  41341. }
  41342. }
  41343. // method id "dfareporting.sites.get":
  41344. type SitesGetCall struct {
  41345. s *Service
  41346. profileId int64
  41347. id int64
  41348. urlParams_ gensupport.URLParams
  41349. ifNoneMatch_ string
  41350. ctx_ context.Context
  41351. header_ http.Header
  41352. }
  41353. // Get: Gets one site by ID.
  41354. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  41355. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41356. c.profileId = profileId
  41357. c.id = id
  41358. return c
  41359. }
  41360. // Fields allows partial responses to be retrieved. See
  41361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41362. // for more information.
  41363. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  41364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41365. return c
  41366. }
  41367. // IfNoneMatch sets the optional parameter which makes the operation
  41368. // fail if the object's ETag matches the given value. This is useful for
  41369. // getting updates only after the object has changed since the last
  41370. // request. Use googleapi.IsNotModified to check whether the response
  41371. // error from Do is the result of In-None-Match.
  41372. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  41373. c.ifNoneMatch_ = entityTag
  41374. return c
  41375. }
  41376. // Context sets the context to be used in this call's Do method. Any
  41377. // pending HTTP request will be aborted if the provided context is
  41378. // canceled.
  41379. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  41380. c.ctx_ = ctx
  41381. return c
  41382. }
  41383. // Header returns an http.Header that can be modified by the caller to
  41384. // add HTTP headers to the request.
  41385. func (c *SitesGetCall) Header() http.Header {
  41386. if c.header_ == nil {
  41387. c.header_ = make(http.Header)
  41388. }
  41389. return c.header_
  41390. }
  41391. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  41392. reqHeaders := make(http.Header)
  41393. for k, v := range c.header_ {
  41394. reqHeaders[k] = v
  41395. }
  41396. reqHeaders.Set("User-Agent", c.s.userAgent())
  41397. if c.ifNoneMatch_ != "" {
  41398. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41399. }
  41400. var body io.Reader = nil
  41401. c.urlParams_.Set("alt", alt)
  41402. c.urlParams_.Set("prettyPrint", "false")
  41403. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  41404. urls += "?" + c.urlParams_.Encode()
  41405. req, err := http.NewRequest("GET", urls, body)
  41406. if err != nil {
  41407. return nil, err
  41408. }
  41409. req.Header = reqHeaders
  41410. googleapi.Expand(req.URL, map[string]string{
  41411. "profileId": strconv.FormatInt(c.profileId, 10),
  41412. "id": strconv.FormatInt(c.id, 10),
  41413. })
  41414. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41415. }
  41416. // Do executes the "dfareporting.sites.get" call.
  41417. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41418. // code is an error. Response headers are in either
  41419. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41420. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41421. // whether the returned error was because http.StatusNotModified was
  41422. // returned.
  41423. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41424. gensupport.SetOptions(c.urlParams_, opts...)
  41425. res, err := c.doRequest("json")
  41426. if res != nil && res.StatusCode == http.StatusNotModified {
  41427. if res.Body != nil {
  41428. res.Body.Close()
  41429. }
  41430. return nil, &googleapi.Error{
  41431. Code: res.StatusCode,
  41432. Header: res.Header,
  41433. }
  41434. }
  41435. if err != nil {
  41436. return nil, err
  41437. }
  41438. defer googleapi.CloseBody(res)
  41439. if err := googleapi.CheckResponse(res); err != nil {
  41440. return nil, err
  41441. }
  41442. ret := &Site{
  41443. ServerResponse: googleapi.ServerResponse{
  41444. Header: res.Header,
  41445. HTTPStatusCode: res.StatusCode,
  41446. },
  41447. }
  41448. target := &ret
  41449. if err := gensupport.DecodeResponse(target, res); err != nil {
  41450. return nil, err
  41451. }
  41452. return ret, nil
  41453. // {
  41454. // "description": "Gets one site by ID.",
  41455. // "httpMethod": "GET",
  41456. // "id": "dfareporting.sites.get",
  41457. // "parameterOrder": [
  41458. // "profileId",
  41459. // "id"
  41460. // ],
  41461. // "parameters": {
  41462. // "id": {
  41463. // "description": "Site ID.",
  41464. // "format": "int64",
  41465. // "location": "path",
  41466. // "required": true,
  41467. // "type": "string"
  41468. // },
  41469. // "profileId": {
  41470. // "description": "User profile ID associated with this request.",
  41471. // "format": "int64",
  41472. // "location": "path",
  41473. // "required": true,
  41474. // "type": "string"
  41475. // }
  41476. // },
  41477. // "path": "userprofiles/{profileId}/sites/{id}",
  41478. // "response": {
  41479. // "$ref": "Site"
  41480. // },
  41481. // "scopes": [
  41482. // "https://www.googleapis.com/auth/dfatrafficking"
  41483. // ]
  41484. // }
  41485. }
  41486. // method id "dfareporting.sites.insert":
  41487. type SitesInsertCall struct {
  41488. s *Service
  41489. profileId int64
  41490. site *Site
  41491. urlParams_ gensupport.URLParams
  41492. ctx_ context.Context
  41493. header_ http.Header
  41494. }
  41495. // Insert: Inserts a new site.
  41496. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  41497. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41498. c.profileId = profileId
  41499. c.site = site
  41500. return c
  41501. }
  41502. // Fields allows partial responses to be retrieved. See
  41503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41504. // for more information.
  41505. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  41506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41507. return c
  41508. }
  41509. // Context sets the context to be used in this call's Do method. Any
  41510. // pending HTTP request will be aborted if the provided context is
  41511. // canceled.
  41512. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  41513. c.ctx_ = ctx
  41514. return c
  41515. }
  41516. // Header returns an http.Header that can be modified by the caller to
  41517. // add HTTP headers to the request.
  41518. func (c *SitesInsertCall) Header() http.Header {
  41519. if c.header_ == nil {
  41520. c.header_ = make(http.Header)
  41521. }
  41522. return c.header_
  41523. }
  41524. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  41525. reqHeaders := make(http.Header)
  41526. for k, v := range c.header_ {
  41527. reqHeaders[k] = v
  41528. }
  41529. reqHeaders.Set("User-Agent", c.s.userAgent())
  41530. var body io.Reader = nil
  41531. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41532. if err != nil {
  41533. return nil, err
  41534. }
  41535. reqHeaders.Set("Content-Type", "application/json")
  41536. c.urlParams_.Set("alt", alt)
  41537. c.urlParams_.Set("prettyPrint", "false")
  41538. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41539. urls += "?" + c.urlParams_.Encode()
  41540. req, err := http.NewRequest("POST", urls, body)
  41541. if err != nil {
  41542. return nil, err
  41543. }
  41544. req.Header = reqHeaders
  41545. googleapi.Expand(req.URL, map[string]string{
  41546. "profileId": strconv.FormatInt(c.profileId, 10),
  41547. })
  41548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41549. }
  41550. // Do executes the "dfareporting.sites.insert" call.
  41551. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41552. // code is an error. Response headers are in either
  41553. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41554. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41555. // whether the returned error was because http.StatusNotModified was
  41556. // returned.
  41557. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41558. gensupport.SetOptions(c.urlParams_, opts...)
  41559. res, err := c.doRequest("json")
  41560. if res != nil && res.StatusCode == http.StatusNotModified {
  41561. if res.Body != nil {
  41562. res.Body.Close()
  41563. }
  41564. return nil, &googleapi.Error{
  41565. Code: res.StatusCode,
  41566. Header: res.Header,
  41567. }
  41568. }
  41569. if err != nil {
  41570. return nil, err
  41571. }
  41572. defer googleapi.CloseBody(res)
  41573. if err := googleapi.CheckResponse(res); err != nil {
  41574. return nil, err
  41575. }
  41576. ret := &Site{
  41577. ServerResponse: googleapi.ServerResponse{
  41578. Header: res.Header,
  41579. HTTPStatusCode: res.StatusCode,
  41580. },
  41581. }
  41582. target := &ret
  41583. if err := gensupport.DecodeResponse(target, res); err != nil {
  41584. return nil, err
  41585. }
  41586. return ret, nil
  41587. // {
  41588. // "description": "Inserts a new site.",
  41589. // "httpMethod": "POST",
  41590. // "id": "dfareporting.sites.insert",
  41591. // "parameterOrder": [
  41592. // "profileId"
  41593. // ],
  41594. // "parameters": {
  41595. // "profileId": {
  41596. // "description": "User profile ID associated with this request.",
  41597. // "format": "int64",
  41598. // "location": "path",
  41599. // "required": true,
  41600. // "type": "string"
  41601. // }
  41602. // },
  41603. // "path": "userprofiles/{profileId}/sites",
  41604. // "request": {
  41605. // "$ref": "Site"
  41606. // },
  41607. // "response": {
  41608. // "$ref": "Site"
  41609. // },
  41610. // "scopes": [
  41611. // "https://www.googleapis.com/auth/dfatrafficking"
  41612. // ]
  41613. // }
  41614. }
  41615. // method id "dfareporting.sites.list":
  41616. type SitesListCall struct {
  41617. s *Service
  41618. profileId int64
  41619. urlParams_ gensupport.URLParams
  41620. ifNoneMatch_ string
  41621. ctx_ context.Context
  41622. header_ http.Header
  41623. }
  41624. // List: Retrieves a list of sites, possibly filtered. This method
  41625. // supports paging.
  41626. func (r *SitesService) List(profileId int64) *SitesListCall {
  41627. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41628. c.profileId = profileId
  41629. return c
  41630. }
  41631. // AcceptsInStreamVideoPlacements sets the optional parameter
  41632. // "acceptsInStreamVideoPlacements": This search filter is no longer
  41633. // supported and will have no effect on the results returned.
  41634. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  41635. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  41636. return c
  41637. }
  41638. // AcceptsInterstitialPlacements sets the optional parameter
  41639. // "acceptsInterstitialPlacements": This search filter is no longer
  41640. // supported and will have no effect on the results returned.
  41641. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  41642. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  41643. return c
  41644. }
  41645. // AcceptsPublisherPaidPlacements sets the optional parameter
  41646. // "acceptsPublisherPaidPlacements": Select only sites that accept
  41647. // publisher paid placements.
  41648. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  41649. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  41650. return c
  41651. }
  41652. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  41653. // AdWords sites.
  41654. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  41655. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  41656. return c
  41657. }
  41658. // Approved sets the optional parameter "approved": Select only approved
  41659. // sites.
  41660. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  41661. c.urlParams_.Set("approved", fmt.Sprint(approved))
  41662. return c
  41663. }
  41664. // CampaignIds sets the optional parameter "campaignIds": Select only
  41665. // sites with these campaign IDs.
  41666. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  41667. var campaignIds_ []string
  41668. for _, v := range campaignIds {
  41669. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  41670. }
  41671. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  41672. return c
  41673. }
  41674. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  41675. // Select only sites with these directory site IDs.
  41676. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  41677. var directorySiteIds_ []string
  41678. for _, v := range directorySiteIds {
  41679. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  41680. }
  41681. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  41682. return c
  41683. }
  41684. // Ids sets the optional parameter "ids": Select only sites with these
  41685. // IDs.
  41686. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  41687. var ids_ []string
  41688. for _, v := range ids {
  41689. ids_ = append(ids_, fmt.Sprint(v))
  41690. }
  41691. c.urlParams_.SetMulti("ids", ids_)
  41692. return c
  41693. }
  41694. // MaxResults sets the optional parameter "maxResults": Maximum number
  41695. // of results to return.
  41696. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  41697. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41698. return c
  41699. }
  41700. // PageToken sets the optional parameter "pageToken": Value of the
  41701. // nextPageToken from the previous result page.
  41702. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  41703. c.urlParams_.Set("pageToken", pageToken)
  41704. return c
  41705. }
  41706. // SearchString sets the optional parameter "searchString": Allows
  41707. // searching for objects by name, ID or keyName. Wildcards (*) are
  41708. // allowed. For example, "site*2015" will return objects with names like
  41709. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  41710. // the searches also add wildcards implicitly at the start and the end
  41711. // of the search string. For example, a search string of "site" will
  41712. // match objects with name "my site", "site 2015", or simply "site".
  41713. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  41714. c.urlParams_.Set("searchString", searchString)
  41715. return c
  41716. }
  41717. // SortField sets the optional parameter "sortField": Field by which to
  41718. // sort the list.
  41719. //
  41720. // Possible values:
  41721. // "ID" (default)
  41722. // "NAME"
  41723. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  41724. c.urlParams_.Set("sortField", sortField)
  41725. return c
  41726. }
  41727. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41728. // results.
  41729. //
  41730. // Possible values:
  41731. // "ASCENDING" (default)
  41732. // "DESCENDING"
  41733. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  41734. c.urlParams_.Set("sortOrder", sortOrder)
  41735. return c
  41736. }
  41737. // SubaccountId sets the optional parameter "subaccountId": Select only
  41738. // sites with this subaccount ID.
  41739. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  41740. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  41741. return c
  41742. }
  41743. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  41744. // sites that have not been mapped to a directory site.
  41745. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  41746. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  41747. return c
  41748. }
  41749. // Fields allows partial responses to be retrieved. See
  41750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41751. // for more information.
  41752. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  41753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41754. return c
  41755. }
  41756. // IfNoneMatch sets the optional parameter which makes the operation
  41757. // fail if the object's ETag matches the given value. This is useful for
  41758. // getting updates only after the object has changed since the last
  41759. // request. Use googleapi.IsNotModified to check whether the response
  41760. // error from Do is the result of In-None-Match.
  41761. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  41762. c.ifNoneMatch_ = entityTag
  41763. return c
  41764. }
  41765. // Context sets the context to be used in this call's Do method. Any
  41766. // pending HTTP request will be aborted if the provided context is
  41767. // canceled.
  41768. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  41769. c.ctx_ = ctx
  41770. return c
  41771. }
  41772. // Header returns an http.Header that can be modified by the caller to
  41773. // add HTTP headers to the request.
  41774. func (c *SitesListCall) Header() http.Header {
  41775. if c.header_ == nil {
  41776. c.header_ = make(http.Header)
  41777. }
  41778. return c.header_
  41779. }
  41780. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  41781. reqHeaders := make(http.Header)
  41782. for k, v := range c.header_ {
  41783. reqHeaders[k] = v
  41784. }
  41785. reqHeaders.Set("User-Agent", c.s.userAgent())
  41786. if c.ifNoneMatch_ != "" {
  41787. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41788. }
  41789. var body io.Reader = nil
  41790. c.urlParams_.Set("alt", alt)
  41791. c.urlParams_.Set("prettyPrint", "false")
  41792. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41793. urls += "?" + c.urlParams_.Encode()
  41794. req, err := http.NewRequest("GET", urls, body)
  41795. if err != nil {
  41796. return nil, err
  41797. }
  41798. req.Header = reqHeaders
  41799. googleapi.Expand(req.URL, map[string]string{
  41800. "profileId": strconv.FormatInt(c.profileId, 10),
  41801. })
  41802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41803. }
  41804. // Do executes the "dfareporting.sites.list" call.
  41805. // Exactly one of *SitesListResponse or error will be non-nil. Any
  41806. // non-2xx status code is an error. Response headers are in either
  41807. // *SitesListResponse.ServerResponse.Header or (if a response was
  41808. // returned at all) in error.(*googleapi.Error).Header. Use
  41809. // googleapi.IsNotModified to check whether the returned error was
  41810. // because http.StatusNotModified was returned.
  41811. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  41812. gensupport.SetOptions(c.urlParams_, opts...)
  41813. res, err := c.doRequest("json")
  41814. if res != nil && res.StatusCode == http.StatusNotModified {
  41815. if res.Body != nil {
  41816. res.Body.Close()
  41817. }
  41818. return nil, &googleapi.Error{
  41819. Code: res.StatusCode,
  41820. Header: res.Header,
  41821. }
  41822. }
  41823. if err != nil {
  41824. return nil, err
  41825. }
  41826. defer googleapi.CloseBody(res)
  41827. if err := googleapi.CheckResponse(res); err != nil {
  41828. return nil, err
  41829. }
  41830. ret := &SitesListResponse{
  41831. ServerResponse: googleapi.ServerResponse{
  41832. Header: res.Header,
  41833. HTTPStatusCode: res.StatusCode,
  41834. },
  41835. }
  41836. target := &ret
  41837. if err := gensupport.DecodeResponse(target, res); err != nil {
  41838. return nil, err
  41839. }
  41840. return ret, nil
  41841. // {
  41842. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  41843. // "httpMethod": "GET",
  41844. // "id": "dfareporting.sites.list",
  41845. // "parameterOrder": [
  41846. // "profileId"
  41847. // ],
  41848. // "parameters": {
  41849. // "acceptsInStreamVideoPlacements": {
  41850. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41851. // "location": "query",
  41852. // "type": "boolean"
  41853. // },
  41854. // "acceptsInterstitialPlacements": {
  41855. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41856. // "location": "query",
  41857. // "type": "boolean"
  41858. // },
  41859. // "acceptsPublisherPaidPlacements": {
  41860. // "description": "Select only sites that accept publisher paid placements.",
  41861. // "location": "query",
  41862. // "type": "boolean"
  41863. // },
  41864. // "adWordsSite": {
  41865. // "description": "Select only AdWords sites.",
  41866. // "location": "query",
  41867. // "type": "boolean"
  41868. // },
  41869. // "approved": {
  41870. // "description": "Select only approved sites.",
  41871. // "location": "query",
  41872. // "type": "boolean"
  41873. // },
  41874. // "campaignIds": {
  41875. // "description": "Select only sites with these campaign IDs.",
  41876. // "format": "int64",
  41877. // "location": "query",
  41878. // "repeated": true,
  41879. // "type": "string"
  41880. // },
  41881. // "directorySiteIds": {
  41882. // "description": "Select only sites with these directory site IDs.",
  41883. // "format": "int64",
  41884. // "location": "query",
  41885. // "repeated": true,
  41886. // "type": "string"
  41887. // },
  41888. // "ids": {
  41889. // "description": "Select only sites with these IDs.",
  41890. // "format": "int64",
  41891. // "location": "query",
  41892. // "repeated": true,
  41893. // "type": "string"
  41894. // },
  41895. // "maxResults": {
  41896. // "default": "1000",
  41897. // "description": "Maximum number of results to return.",
  41898. // "format": "int32",
  41899. // "location": "query",
  41900. // "maximum": "1000",
  41901. // "minimum": "0",
  41902. // "type": "integer"
  41903. // },
  41904. // "pageToken": {
  41905. // "description": "Value of the nextPageToken from the previous result page.",
  41906. // "location": "query",
  41907. // "type": "string"
  41908. // },
  41909. // "profileId": {
  41910. // "description": "User profile ID associated with this request.",
  41911. // "format": "int64",
  41912. // "location": "path",
  41913. // "required": true,
  41914. // "type": "string"
  41915. // },
  41916. // "searchString": {
  41917. // "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\".",
  41918. // "location": "query",
  41919. // "type": "string"
  41920. // },
  41921. // "sortField": {
  41922. // "default": "ID",
  41923. // "description": "Field by which to sort the list.",
  41924. // "enum": [
  41925. // "ID",
  41926. // "NAME"
  41927. // ],
  41928. // "enumDescriptions": [
  41929. // "",
  41930. // ""
  41931. // ],
  41932. // "location": "query",
  41933. // "type": "string"
  41934. // },
  41935. // "sortOrder": {
  41936. // "default": "ASCENDING",
  41937. // "description": "Order of sorted results.",
  41938. // "enum": [
  41939. // "ASCENDING",
  41940. // "DESCENDING"
  41941. // ],
  41942. // "enumDescriptions": [
  41943. // "",
  41944. // ""
  41945. // ],
  41946. // "location": "query",
  41947. // "type": "string"
  41948. // },
  41949. // "subaccountId": {
  41950. // "description": "Select only sites with this subaccount ID.",
  41951. // "format": "int64",
  41952. // "location": "query",
  41953. // "type": "string"
  41954. // },
  41955. // "unmappedSite": {
  41956. // "description": "Select only sites that have not been mapped to a directory site.",
  41957. // "location": "query",
  41958. // "type": "boolean"
  41959. // }
  41960. // },
  41961. // "path": "userprofiles/{profileId}/sites",
  41962. // "response": {
  41963. // "$ref": "SitesListResponse"
  41964. // },
  41965. // "scopes": [
  41966. // "https://www.googleapis.com/auth/dfatrafficking"
  41967. // ]
  41968. // }
  41969. }
  41970. // Pages invokes f for each page of results.
  41971. // A non-nil error returned from f will halt the iteration.
  41972. // The provided context supersedes any context provided to the Context method.
  41973. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  41974. c.ctx_ = ctx
  41975. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41976. for {
  41977. x, err := c.Do()
  41978. if err != nil {
  41979. return err
  41980. }
  41981. if err := f(x); err != nil {
  41982. return err
  41983. }
  41984. if x.NextPageToken == "" {
  41985. return nil
  41986. }
  41987. c.PageToken(x.NextPageToken)
  41988. }
  41989. }
  41990. // method id "dfareporting.sites.patch":
  41991. type SitesPatchCall struct {
  41992. s *Service
  41993. profileId int64
  41994. site *Site
  41995. urlParams_ gensupport.URLParams
  41996. ctx_ context.Context
  41997. header_ http.Header
  41998. }
  41999. // Patch: Updates an existing site. This method supports patch
  42000. // semantics.
  42001. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  42002. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42003. c.profileId = profileId
  42004. c.urlParams_.Set("id", fmt.Sprint(id))
  42005. c.site = site
  42006. return c
  42007. }
  42008. // Fields allows partial responses to be retrieved. See
  42009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42010. // for more information.
  42011. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  42012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42013. return c
  42014. }
  42015. // Context sets the context to be used in this call's Do method. Any
  42016. // pending HTTP request will be aborted if the provided context is
  42017. // canceled.
  42018. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  42019. c.ctx_ = ctx
  42020. return c
  42021. }
  42022. // Header returns an http.Header that can be modified by the caller to
  42023. // add HTTP headers to the request.
  42024. func (c *SitesPatchCall) Header() http.Header {
  42025. if c.header_ == nil {
  42026. c.header_ = make(http.Header)
  42027. }
  42028. return c.header_
  42029. }
  42030. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  42031. reqHeaders := make(http.Header)
  42032. for k, v := range c.header_ {
  42033. reqHeaders[k] = v
  42034. }
  42035. reqHeaders.Set("User-Agent", c.s.userAgent())
  42036. var body io.Reader = nil
  42037. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  42038. if err != nil {
  42039. return nil, err
  42040. }
  42041. reqHeaders.Set("Content-Type", "application/json")
  42042. c.urlParams_.Set("alt", alt)
  42043. c.urlParams_.Set("prettyPrint", "false")
  42044. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  42045. urls += "?" + c.urlParams_.Encode()
  42046. req, err := http.NewRequest("PATCH", urls, body)
  42047. if err != nil {
  42048. return nil, err
  42049. }
  42050. req.Header = reqHeaders
  42051. googleapi.Expand(req.URL, map[string]string{
  42052. "profileId": strconv.FormatInt(c.profileId, 10),
  42053. })
  42054. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42055. }
  42056. // Do executes the "dfareporting.sites.patch" call.
  42057. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  42058. // code is an error. Response headers are in either
  42059. // *Site.ServerResponse.Header or (if a response was returned at all) in
  42060. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42061. // whether the returned error was because http.StatusNotModified was
  42062. // returned.
  42063. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  42064. gensupport.SetOptions(c.urlParams_, opts...)
  42065. res, err := c.doRequest("json")
  42066. if res != nil && res.StatusCode == http.StatusNotModified {
  42067. if res.Body != nil {
  42068. res.Body.Close()
  42069. }
  42070. return nil, &googleapi.Error{
  42071. Code: res.StatusCode,
  42072. Header: res.Header,
  42073. }
  42074. }
  42075. if err != nil {
  42076. return nil, err
  42077. }
  42078. defer googleapi.CloseBody(res)
  42079. if err := googleapi.CheckResponse(res); err != nil {
  42080. return nil, err
  42081. }
  42082. ret := &Site{
  42083. ServerResponse: googleapi.ServerResponse{
  42084. Header: res.Header,
  42085. HTTPStatusCode: res.StatusCode,
  42086. },
  42087. }
  42088. target := &ret
  42089. if err := gensupport.DecodeResponse(target, res); err != nil {
  42090. return nil, err
  42091. }
  42092. return ret, nil
  42093. // {
  42094. // "description": "Updates an existing site. This method supports patch semantics.",
  42095. // "httpMethod": "PATCH",
  42096. // "id": "dfareporting.sites.patch",
  42097. // "parameterOrder": [
  42098. // "profileId",
  42099. // "id"
  42100. // ],
  42101. // "parameters": {
  42102. // "id": {
  42103. // "description": "Site ID.",
  42104. // "format": "int64",
  42105. // "location": "query",
  42106. // "required": true,
  42107. // "type": "string"
  42108. // },
  42109. // "profileId": {
  42110. // "description": "User profile ID associated with this request.",
  42111. // "format": "int64",
  42112. // "location": "path",
  42113. // "required": true,
  42114. // "type": "string"
  42115. // }
  42116. // },
  42117. // "path": "userprofiles/{profileId}/sites",
  42118. // "request": {
  42119. // "$ref": "Site"
  42120. // },
  42121. // "response": {
  42122. // "$ref": "Site"
  42123. // },
  42124. // "scopes": [
  42125. // "https://www.googleapis.com/auth/dfatrafficking"
  42126. // ]
  42127. // }
  42128. }
  42129. // method id "dfareporting.sites.update":
  42130. type SitesUpdateCall struct {
  42131. s *Service
  42132. profileId int64
  42133. site *Site
  42134. urlParams_ gensupport.URLParams
  42135. ctx_ context.Context
  42136. header_ http.Header
  42137. }
  42138. // Update: Updates an existing site.
  42139. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  42140. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42141. c.profileId = profileId
  42142. c.site = site
  42143. return c
  42144. }
  42145. // Fields allows partial responses to be retrieved. See
  42146. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42147. // for more information.
  42148. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  42149. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42150. return c
  42151. }
  42152. // Context sets the context to be used in this call's Do method. Any
  42153. // pending HTTP request will be aborted if the provided context is
  42154. // canceled.
  42155. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  42156. c.ctx_ = ctx
  42157. return c
  42158. }
  42159. // Header returns an http.Header that can be modified by the caller to
  42160. // add HTTP headers to the request.
  42161. func (c *SitesUpdateCall) Header() http.Header {
  42162. if c.header_ == nil {
  42163. c.header_ = make(http.Header)
  42164. }
  42165. return c.header_
  42166. }
  42167. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  42168. reqHeaders := make(http.Header)
  42169. for k, v := range c.header_ {
  42170. reqHeaders[k] = v
  42171. }
  42172. reqHeaders.Set("User-Agent", c.s.userAgent())
  42173. var body io.Reader = nil
  42174. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  42175. if err != nil {
  42176. return nil, err
  42177. }
  42178. reqHeaders.Set("Content-Type", "application/json")
  42179. c.urlParams_.Set("alt", alt)
  42180. c.urlParams_.Set("prettyPrint", "false")
  42181. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  42182. urls += "?" + c.urlParams_.Encode()
  42183. req, err := http.NewRequest("PUT", urls, body)
  42184. if err != nil {
  42185. return nil, err
  42186. }
  42187. req.Header = reqHeaders
  42188. googleapi.Expand(req.URL, map[string]string{
  42189. "profileId": strconv.FormatInt(c.profileId, 10),
  42190. })
  42191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42192. }
  42193. // Do executes the "dfareporting.sites.update" call.
  42194. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  42195. // code is an error. Response headers are in either
  42196. // *Site.ServerResponse.Header or (if a response was returned at all) in
  42197. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42198. // whether the returned error was because http.StatusNotModified was
  42199. // returned.
  42200. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  42201. gensupport.SetOptions(c.urlParams_, opts...)
  42202. res, err := c.doRequest("json")
  42203. if res != nil && res.StatusCode == http.StatusNotModified {
  42204. if res.Body != nil {
  42205. res.Body.Close()
  42206. }
  42207. return nil, &googleapi.Error{
  42208. Code: res.StatusCode,
  42209. Header: res.Header,
  42210. }
  42211. }
  42212. if err != nil {
  42213. return nil, err
  42214. }
  42215. defer googleapi.CloseBody(res)
  42216. if err := googleapi.CheckResponse(res); err != nil {
  42217. return nil, err
  42218. }
  42219. ret := &Site{
  42220. ServerResponse: googleapi.ServerResponse{
  42221. Header: res.Header,
  42222. HTTPStatusCode: res.StatusCode,
  42223. },
  42224. }
  42225. target := &ret
  42226. if err := gensupport.DecodeResponse(target, res); err != nil {
  42227. return nil, err
  42228. }
  42229. return ret, nil
  42230. // {
  42231. // "description": "Updates an existing site.",
  42232. // "httpMethod": "PUT",
  42233. // "id": "dfareporting.sites.update",
  42234. // "parameterOrder": [
  42235. // "profileId"
  42236. // ],
  42237. // "parameters": {
  42238. // "profileId": {
  42239. // "description": "User profile ID associated with this request.",
  42240. // "format": "int64",
  42241. // "location": "path",
  42242. // "required": true,
  42243. // "type": "string"
  42244. // }
  42245. // },
  42246. // "path": "userprofiles/{profileId}/sites",
  42247. // "request": {
  42248. // "$ref": "Site"
  42249. // },
  42250. // "response": {
  42251. // "$ref": "Site"
  42252. // },
  42253. // "scopes": [
  42254. // "https://www.googleapis.com/auth/dfatrafficking"
  42255. // ]
  42256. // }
  42257. }
  42258. // method id "dfareporting.sizes.get":
  42259. type SizesGetCall struct {
  42260. s *Service
  42261. profileId int64
  42262. id int64
  42263. urlParams_ gensupport.URLParams
  42264. ifNoneMatch_ string
  42265. ctx_ context.Context
  42266. header_ http.Header
  42267. }
  42268. // Get: Gets one size by ID.
  42269. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  42270. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42271. c.profileId = profileId
  42272. c.id = id
  42273. return c
  42274. }
  42275. // Fields allows partial responses to be retrieved. See
  42276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42277. // for more information.
  42278. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  42279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42280. return c
  42281. }
  42282. // IfNoneMatch sets the optional parameter which makes the operation
  42283. // fail if the object's ETag matches the given value. This is useful for
  42284. // getting updates only after the object has changed since the last
  42285. // request. Use googleapi.IsNotModified to check whether the response
  42286. // error from Do is the result of In-None-Match.
  42287. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  42288. c.ifNoneMatch_ = entityTag
  42289. return c
  42290. }
  42291. // Context sets the context to be used in this call's Do method. Any
  42292. // pending HTTP request will be aborted if the provided context is
  42293. // canceled.
  42294. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  42295. c.ctx_ = ctx
  42296. return c
  42297. }
  42298. // Header returns an http.Header that can be modified by the caller to
  42299. // add HTTP headers to the request.
  42300. func (c *SizesGetCall) Header() http.Header {
  42301. if c.header_ == nil {
  42302. c.header_ = make(http.Header)
  42303. }
  42304. return c.header_
  42305. }
  42306. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  42307. reqHeaders := make(http.Header)
  42308. for k, v := range c.header_ {
  42309. reqHeaders[k] = v
  42310. }
  42311. reqHeaders.Set("User-Agent", c.s.userAgent())
  42312. if c.ifNoneMatch_ != "" {
  42313. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42314. }
  42315. var body io.Reader = nil
  42316. c.urlParams_.Set("alt", alt)
  42317. c.urlParams_.Set("prettyPrint", "false")
  42318. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  42319. urls += "?" + c.urlParams_.Encode()
  42320. req, err := http.NewRequest("GET", urls, body)
  42321. if err != nil {
  42322. return nil, err
  42323. }
  42324. req.Header = reqHeaders
  42325. googleapi.Expand(req.URL, map[string]string{
  42326. "profileId": strconv.FormatInt(c.profileId, 10),
  42327. "id": strconv.FormatInt(c.id, 10),
  42328. })
  42329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42330. }
  42331. // Do executes the "dfareporting.sizes.get" call.
  42332. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  42333. // code is an error. Response headers are in either
  42334. // *Size.ServerResponse.Header or (if a response was returned at all) in
  42335. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42336. // whether the returned error was because http.StatusNotModified was
  42337. // returned.
  42338. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  42339. gensupport.SetOptions(c.urlParams_, opts...)
  42340. res, err := c.doRequest("json")
  42341. if res != nil && res.StatusCode == http.StatusNotModified {
  42342. if res.Body != nil {
  42343. res.Body.Close()
  42344. }
  42345. return nil, &googleapi.Error{
  42346. Code: res.StatusCode,
  42347. Header: res.Header,
  42348. }
  42349. }
  42350. if err != nil {
  42351. return nil, err
  42352. }
  42353. defer googleapi.CloseBody(res)
  42354. if err := googleapi.CheckResponse(res); err != nil {
  42355. return nil, err
  42356. }
  42357. ret := &Size{
  42358. ServerResponse: googleapi.ServerResponse{
  42359. Header: res.Header,
  42360. HTTPStatusCode: res.StatusCode,
  42361. },
  42362. }
  42363. target := &ret
  42364. if err := gensupport.DecodeResponse(target, res); err != nil {
  42365. return nil, err
  42366. }
  42367. return ret, nil
  42368. // {
  42369. // "description": "Gets one size by ID.",
  42370. // "httpMethod": "GET",
  42371. // "id": "dfareporting.sizes.get",
  42372. // "parameterOrder": [
  42373. // "profileId",
  42374. // "id"
  42375. // ],
  42376. // "parameters": {
  42377. // "id": {
  42378. // "description": "Size ID.",
  42379. // "format": "int64",
  42380. // "location": "path",
  42381. // "required": true,
  42382. // "type": "string"
  42383. // },
  42384. // "profileId": {
  42385. // "description": "User profile ID associated with this request.",
  42386. // "format": "int64",
  42387. // "location": "path",
  42388. // "required": true,
  42389. // "type": "string"
  42390. // }
  42391. // },
  42392. // "path": "userprofiles/{profileId}/sizes/{id}",
  42393. // "response": {
  42394. // "$ref": "Size"
  42395. // },
  42396. // "scopes": [
  42397. // "https://www.googleapis.com/auth/dfatrafficking"
  42398. // ]
  42399. // }
  42400. }
  42401. // method id "dfareporting.sizes.insert":
  42402. type SizesInsertCall struct {
  42403. s *Service
  42404. profileId int64
  42405. size *Size
  42406. urlParams_ gensupport.URLParams
  42407. ctx_ context.Context
  42408. header_ http.Header
  42409. }
  42410. // Insert: Inserts a new size.
  42411. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  42412. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42413. c.profileId = profileId
  42414. c.size = size
  42415. return c
  42416. }
  42417. // Fields allows partial responses to be retrieved. See
  42418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42419. // for more information.
  42420. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  42421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42422. return c
  42423. }
  42424. // Context sets the context to be used in this call's Do method. Any
  42425. // pending HTTP request will be aborted if the provided context is
  42426. // canceled.
  42427. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  42428. c.ctx_ = ctx
  42429. return c
  42430. }
  42431. // Header returns an http.Header that can be modified by the caller to
  42432. // add HTTP headers to the request.
  42433. func (c *SizesInsertCall) Header() http.Header {
  42434. if c.header_ == nil {
  42435. c.header_ = make(http.Header)
  42436. }
  42437. return c.header_
  42438. }
  42439. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  42440. reqHeaders := make(http.Header)
  42441. for k, v := range c.header_ {
  42442. reqHeaders[k] = v
  42443. }
  42444. reqHeaders.Set("User-Agent", c.s.userAgent())
  42445. var body io.Reader = nil
  42446. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  42447. if err != nil {
  42448. return nil, err
  42449. }
  42450. reqHeaders.Set("Content-Type", "application/json")
  42451. c.urlParams_.Set("alt", alt)
  42452. c.urlParams_.Set("prettyPrint", "false")
  42453. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  42454. urls += "?" + c.urlParams_.Encode()
  42455. req, err := http.NewRequest("POST", urls, body)
  42456. if err != nil {
  42457. return nil, err
  42458. }
  42459. req.Header = reqHeaders
  42460. googleapi.Expand(req.URL, map[string]string{
  42461. "profileId": strconv.FormatInt(c.profileId, 10),
  42462. })
  42463. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42464. }
  42465. // Do executes the "dfareporting.sizes.insert" call.
  42466. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  42467. // code is an error. Response headers are in either
  42468. // *Size.ServerResponse.Header or (if a response was returned at all) in
  42469. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  42470. // whether the returned error was because http.StatusNotModified was
  42471. // returned.
  42472. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  42473. gensupport.SetOptions(c.urlParams_, opts...)
  42474. res, err := c.doRequest("json")
  42475. if res != nil && res.StatusCode == http.StatusNotModified {
  42476. if res.Body != nil {
  42477. res.Body.Close()
  42478. }
  42479. return nil, &googleapi.Error{
  42480. Code: res.StatusCode,
  42481. Header: res.Header,
  42482. }
  42483. }
  42484. if err != nil {
  42485. return nil, err
  42486. }
  42487. defer googleapi.CloseBody(res)
  42488. if err := googleapi.CheckResponse(res); err != nil {
  42489. return nil, err
  42490. }
  42491. ret := &Size{
  42492. ServerResponse: googleapi.ServerResponse{
  42493. Header: res.Header,
  42494. HTTPStatusCode: res.StatusCode,
  42495. },
  42496. }
  42497. target := &ret
  42498. if err := gensupport.DecodeResponse(target, res); err != nil {
  42499. return nil, err
  42500. }
  42501. return ret, nil
  42502. // {
  42503. // "description": "Inserts a new size.",
  42504. // "httpMethod": "POST",
  42505. // "id": "dfareporting.sizes.insert",
  42506. // "parameterOrder": [
  42507. // "profileId"
  42508. // ],
  42509. // "parameters": {
  42510. // "profileId": {
  42511. // "description": "User profile ID associated with this request.",
  42512. // "format": "int64",
  42513. // "location": "path",
  42514. // "required": true,
  42515. // "type": "string"
  42516. // }
  42517. // },
  42518. // "path": "userprofiles/{profileId}/sizes",
  42519. // "request": {
  42520. // "$ref": "Size"
  42521. // },
  42522. // "response": {
  42523. // "$ref": "Size"
  42524. // },
  42525. // "scopes": [
  42526. // "https://www.googleapis.com/auth/dfatrafficking"
  42527. // ]
  42528. // }
  42529. }
  42530. // method id "dfareporting.sizes.list":
  42531. type SizesListCall struct {
  42532. s *Service
  42533. profileId int64
  42534. urlParams_ gensupport.URLParams
  42535. ifNoneMatch_ string
  42536. ctx_ context.Context
  42537. header_ http.Header
  42538. }
  42539. // List: Retrieves a list of sizes, possibly filtered. Retrieved sizes
  42540. // are globally unique and may include values not currently in use by
  42541. // your account. Due to this, the list of sizes returned by this method
  42542. // may differ from the list seen in the Trafficking UI.
  42543. func (r *SizesService) List(profileId int64) *SizesListCall {
  42544. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42545. c.profileId = profileId
  42546. return c
  42547. }
  42548. // Height sets the optional parameter "height": Select only sizes with
  42549. // this height.
  42550. func (c *SizesListCall) Height(height int64) *SizesListCall {
  42551. c.urlParams_.Set("height", fmt.Sprint(height))
  42552. return c
  42553. }
  42554. // IabStandard sets the optional parameter "iabStandard": Select only
  42555. // IAB standard sizes.
  42556. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  42557. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  42558. return c
  42559. }
  42560. // Ids sets the optional parameter "ids": Select only sizes with these
  42561. // IDs.
  42562. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  42563. var ids_ []string
  42564. for _, v := range ids {
  42565. ids_ = append(ids_, fmt.Sprint(v))
  42566. }
  42567. c.urlParams_.SetMulti("ids", ids_)
  42568. return c
  42569. }
  42570. // Width sets the optional parameter "width": Select only sizes with
  42571. // this width.
  42572. func (c *SizesListCall) Width(width int64) *SizesListCall {
  42573. c.urlParams_.Set("width", fmt.Sprint(width))
  42574. return c
  42575. }
  42576. // Fields allows partial responses to be retrieved. See
  42577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42578. // for more information.
  42579. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  42580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42581. return c
  42582. }
  42583. // IfNoneMatch sets the optional parameter which makes the operation
  42584. // fail if the object's ETag matches the given value. This is useful for
  42585. // getting updates only after the object has changed since the last
  42586. // request. Use googleapi.IsNotModified to check whether the response
  42587. // error from Do is the result of In-None-Match.
  42588. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  42589. c.ifNoneMatch_ = entityTag
  42590. return c
  42591. }
  42592. // Context sets the context to be used in this call's Do method. Any
  42593. // pending HTTP request will be aborted if the provided context is
  42594. // canceled.
  42595. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  42596. c.ctx_ = ctx
  42597. return c
  42598. }
  42599. // Header returns an http.Header that can be modified by the caller to
  42600. // add HTTP headers to the request.
  42601. func (c *SizesListCall) Header() http.Header {
  42602. if c.header_ == nil {
  42603. c.header_ = make(http.Header)
  42604. }
  42605. return c.header_
  42606. }
  42607. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  42608. reqHeaders := make(http.Header)
  42609. for k, v := range c.header_ {
  42610. reqHeaders[k] = v
  42611. }
  42612. reqHeaders.Set("User-Agent", c.s.userAgent())
  42613. if c.ifNoneMatch_ != "" {
  42614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42615. }
  42616. var body io.Reader = nil
  42617. c.urlParams_.Set("alt", alt)
  42618. c.urlParams_.Set("prettyPrint", "false")
  42619. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  42620. urls += "?" + c.urlParams_.Encode()
  42621. req, err := http.NewRequest("GET", urls, body)
  42622. if err != nil {
  42623. return nil, err
  42624. }
  42625. req.Header = reqHeaders
  42626. googleapi.Expand(req.URL, map[string]string{
  42627. "profileId": strconv.FormatInt(c.profileId, 10),
  42628. })
  42629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42630. }
  42631. // Do executes the "dfareporting.sizes.list" call.
  42632. // Exactly one of *SizesListResponse or error will be non-nil. Any
  42633. // non-2xx status code is an error. Response headers are in either
  42634. // *SizesListResponse.ServerResponse.Header or (if a response was
  42635. // returned at all) in error.(*googleapi.Error).Header. Use
  42636. // googleapi.IsNotModified to check whether the returned error was
  42637. // because http.StatusNotModified was returned.
  42638. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  42639. gensupport.SetOptions(c.urlParams_, opts...)
  42640. res, err := c.doRequest("json")
  42641. if res != nil && res.StatusCode == http.StatusNotModified {
  42642. if res.Body != nil {
  42643. res.Body.Close()
  42644. }
  42645. return nil, &googleapi.Error{
  42646. Code: res.StatusCode,
  42647. Header: res.Header,
  42648. }
  42649. }
  42650. if err != nil {
  42651. return nil, err
  42652. }
  42653. defer googleapi.CloseBody(res)
  42654. if err := googleapi.CheckResponse(res); err != nil {
  42655. return nil, err
  42656. }
  42657. ret := &SizesListResponse{
  42658. ServerResponse: googleapi.ServerResponse{
  42659. Header: res.Header,
  42660. HTTPStatusCode: res.StatusCode,
  42661. },
  42662. }
  42663. target := &ret
  42664. if err := gensupport.DecodeResponse(target, res); err != nil {
  42665. return nil, err
  42666. }
  42667. return ret, nil
  42668. // {
  42669. // "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.",
  42670. // "httpMethod": "GET",
  42671. // "id": "dfareporting.sizes.list",
  42672. // "parameterOrder": [
  42673. // "profileId"
  42674. // ],
  42675. // "parameters": {
  42676. // "height": {
  42677. // "description": "Select only sizes with this height.",
  42678. // "format": "int32",
  42679. // "location": "query",
  42680. // "maximum": "32767",
  42681. // "minimum": "0",
  42682. // "type": "integer"
  42683. // },
  42684. // "iabStandard": {
  42685. // "description": "Select only IAB standard sizes.",
  42686. // "location": "query",
  42687. // "type": "boolean"
  42688. // },
  42689. // "ids": {
  42690. // "description": "Select only sizes with these IDs.",
  42691. // "format": "int64",
  42692. // "location": "query",
  42693. // "repeated": true,
  42694. // "type": "string"
  42695. // },
  42696. // "profileId": {
  42697. // "description": "User profile ID associated with this request.",
  42698. // "format": "int64",
  42699. // "location": "path",
  42700. // "required": true,
  42701. // "type": "string"
  42702. // },
  42703. // "width": {
  42704. // "description": "Select only sizes with this width.",
  42705. // "format": "int32",
  42706. // "location": "query",
  42707. // "maximum": "32767",
  42708. // "minimum": "0",
  42709. // "type": "integer"
  42710. // }
  42711. // },
  42712. // "path": "userprofiles/{profileId}/sizes",
  42713. // "response": {
  42714. // "$ref": "SizesListResponse"
  42715. // },
  42716. // "scopes": [
  42717. // "https://www.googleapis.com/auth/dfatrafficking"
  42718. // ]
  42719. // }
  42720. }
  42721. // method id "dfareporting.subaccounts.get":
  42722. type SubaccountsGetCall struct {
  42723. s *Service
  42724. profileId int64
  42725. id int64
  42726. urlParams_ gensupport.URLParams
  42727. ifNoneMatch_ string
  42728. ctx_ context.Context
  42729. header_ http.Header
  42730. }
  42731. // Get: Gets one subaccount by ID.
  42732. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  42733. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42734. c.profileId = profileId
  42735. c.id = id
  42736. return c
  42737. }
  42738. // Fields allows partial responses to be retrieved. See
  42739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42740. // for more information.
  42741. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  42742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42743. return c
  42744. }
  42745. // IfNoneMatch sets the optional parameter which makes the operation
  42746. // fail if the object's ETag matches the given value. This is useful for
  42747. // getting updates only after the object has changed since the last
  42748. // request. Use googleapi.IsNotModified to check whether the response
  42749. // error from Do is the result of In-None-Match.
  42750. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  42751. c.ifNoneMatch_ = entityTag
  42752. return c
  42753. }
  42754. // Context sets the context to be used in this call's Do method. Any
  42755. // pending HTTP request will be aborted if the provided context is
  42756. // canceled.
  42757. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  42758. c.ctx_ = ctx
  42759. return c
  42760. }
  42761. // Header returns an http.Header that can be modified by the caller to
  42762. // add HTTP headers to the request.
  42763. func (c *SubaccountsGetCall) Header() http.Header {
  42764. if c.header_ == nil {
  42765. c.header_ = make(http.Header)
  42766. }
  42767. return c.header_
  42768. }
  42769. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  42770. reqHeaders := make(http.Header)
  42771. for k, v := range c.header_ {
  42772. reqHeaders[k] = v
  42773. }
  42774. reqHeaders.Set("User-Agent", c.s.userAgent())
  42775. if c.ifNoneMatch_ != "" {
  42776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42777. }
  42778. var body io.Reader = nil
  42779. c.urlParams_.Set("alt", alt)
  42780. c.urlParams_.Set("prettyPrint", "false")
  42781. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  42782. urls += "?" + c.urlParams_.Encode()
  42783. req, err := http.NewRequest("GET", urls, body)
  42784. if err != nil {
  42785. return nil, err
  42786. }
  42787. req.Header = reqHeaders
  42788. googleapi.Expand(req.URL, map[string]string{
  42789. "profileId": strconv.FormatInt(c.profileId, 10),
  42790. "id": strconv.FormatInt(c.id, 10),
  42791. })
  42792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42793. }
  42794. // Do executes the "dfareporting.subaccounts.get" call.
  42795. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42796. // status code is an error. Response headers are in either
  42797. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42798. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42799. // to check whether the returned error was because
  42800. // http.StatusNotModified was returned.
  42801. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42802. gensupport.SetOptions(c.urlParams_, opts...)
  42803. res, err := c.doRequest("json")
  42804. if res != nil && res.StatusCode == http.StatusNotModified {
  42805. if res.Body != nil {
  42806. res.Body.Close()
  42807. }
  42808. return nil, &googleapi.Error{
  42809. Code: res.StatusCode,
  42810. Header: res.Header,
  42811. }
  42812. }
  42813. if err != nil {
  42814. return nil, err
  42815. }
  42816. defer googleapi.CloseBody(res)
  42817. if err := googleapi.CheckResponse(res); err != nil {
  42818. return nil, err
  42819. }
  42820. ret := &Subaccount{
  42821. ServerResponse: googleapi.ServerResponse{
  42822. Header: res.Header,
  42823. HTTPStatusCode: res.StatusCode,
  42824. },
  42825. }
  42826. target := &ret
  42827. if err := gensupport.DecodeResponse(target, res); err != nil {
  42828. return nil, err
  42829. }
  42830. return ret, nil
  42831. // {
  42832. // "description": "Gets one subaccount by ID.",
  42833. // "httpMethod": "GET",
  42834. // "id": "dfareporting.subaccounts.get",
  42835. // "parameterOrder": [
  42836. // "profileId",
  42837. // "id"
  42838. // ],
  42839. // "parameters": {
  42840. // "id": {
  42841. // "description": "Subaccount ID.",
  42842. // "format": "int64",
  42843. // "location": "path",
  42844. // "required": true,
  42845. // "type": "string"
  42846. // },
  42847. // "profileId": {
  42848. // "description": "User profile ID associated with this request.",
  42849. // "format": "int64",
  42850. // "location": "path",
  42851. // "required": true,
  42852. // "type": "string"
  42853. // }
  42854. // },
  42855. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  42856. // "response": {
  42857. // "$ref": "Subaccount"
  42858. // },
  42859. // "scopes": [
  42860. // "https://www.googleapis.com/auth/dfatrafficking"
  42861. // ]
  42862. // }
  42863. }
  42864. // method id "dfareporting.subaccounts.insert":
  42865. type SubaccountsInsertCall struct {
  42866. s *Service
  42867. profileId int64
  42868. subaccount *Subaccount
  42869. urlParams_ gensupport.URLParams
  42870. ctx_ context.Context
  42871. header_ http.Header
  42872. }
  42873. // Insert: Inserts a new subaccount.
  42874. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  42875. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42876. c.profileId = profileId
  42877. c.subaccount = subaccount
  42878. return c
  42879. }
  42880. // Fields allows partial responses to be retrieved. See
  42881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42882. // for more information.
  42883. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  42884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42885. return c
  42886. }
  42887. // Context sets the context to be used in this call's Do method. Any
  42888. // pending HTTP request will be aborted if the provided context is
  42889. // canceled.
  42890. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  42891. c.ctx_ = ctx
  42892. return c
  42893. }
  42894. // Header returns an http.Header that can be modified by the caller to
  42895. // add HTTP headers to the request.
  42896. func (c *SubaccountsInsertCall) Header() http.Header {
  42897. if c.header_ == nil {
  42898. c.header_ = make(http.Header)
  42899. }
  42900. return c.header_
  42901. }
  42902. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  42903. reqHeaders := make(http.Header)
  42904. for k, v := range c.header_ {
  42905. reqHeaders[k] = v
  42906. }
  42907. reqHeaders.Set("User-Agent", c.s.userAgent())
  42908. var body io.Reader = nil
  42909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42910. if err != nil {
  42911. return nil, err
  42912. }
  42913. reqHeaders.Set("Content-Type", "application/json")
  42914. c.urlParams_.Set("alt", alt)
  42915. c.urlParams_.Set("prettyPrint", "false")
  42916. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42917. urls += "?" + c.urlParams_.Encode()
  42918. req, err := http.NewRequest("POST", urls, body)
  42919. if err != nil {
  42920. return nil, err
  42921. }
  42922. req.Header = reqHeaders
  42923. googleapi.Expand(req.URL, map[string]string{
  42924. "profileId": strconv.FormatInt(c.profileId, 10),
  42925. })
  42926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42927. }
  42928. // Do executes the "dfareporting.subaccounts.insert" call.
  42929. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42930. // status code is an error. Response headers are in either
  42931. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42932. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42933. // to check whether the returned error was because
  42934. // http.StatusNotModified was returned.
  42935. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42936. gensupport.SetOptions(c.urlParams_, opts...)
  42937. res, err := c.doRequest("json")
  42938. if res != nil && res.StatusCode == http.StatusNotModified {
  42939. if res.Body != nil {
  42940. res.Body.Close()
  42941. }
  42942. return nil, &googleapi.Error{
  42943. Code: res.StatusCode,
  42944. Header: res.Header,
  42945. }
  42946. }
  42947. if err != nil {
  42948. return nil, err
  42949. }
  42950. defer googleapi.CloseBody(res)
  42951. if err := googleapi.CheckResponse(res); err != nil {
  42952. return nil, err
  42953. }
  42954. ret := &Subaccount{
  42955. ServerResponse: googleapi.ServerResponse{
  42956. Header: res.Header,
  42957. HTTPStatusCode: res.StatusCode,
  42958. },
  42959. }
  42960. target := &ret
  42961. if err := gensupport.DecodeResponse(target, res); err != nil {
  42962. return nil, err
  42963. }
  42964. return ret, nil
  42965. // {
  42966. // "description": "Inserts a new subaccount.",
  42967. // "httpMethod": "POST",
  42968. // "id": "dfareporting.subaccounts.insert",
  42969. // "parameterOrder": [
  42970. // "profileId"
  42971. // ],
  42972. // "parameters": {
  42973. // "profileId": {
  42974. // "description": "User profile ID associated with this request.",
  42975. // "format": "int64",
  42976. // "location": "path",
  42977. // "required": true,
  42978. // "type": "string"
  42979. // }
  42980. // },
  42981. // "path": "userprofiles/{profileId}/subaccounts",
  42982. // "request": {
  42983. // "$ref": "Subaccount"
  42984. // },
  42985. // "response": {
  42986. // "$ref": "Subaccount"
  42987. // },
  42988. // "scopes": [
  42989. // "https://www.googleapis.com/auth/dfatrafficking"
  42990. // ]
  42991. // }
  42992. }
  42993. // method id "dfareporting.subaccounts.list":
  42994. type SubaccountsListCall struct {
  42995. s *Service
  42996. profileId int64
  42997. urlParams_ gensupport.URLParams
  42998. ifNoneMatch_ string
  42999. ctx_ context.Context
  43000. header_ http.Header
  43001. }
  43002. // List: Gets a list of subaccounts, possibly filtered. This method
  43003. // supports paging.
  43004. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  43005. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43006. c.profileId = profileId
  43007. return c
  43008. }
  43009. // Ids sets the optional parameter "ids": Select only subaccounts with
  43010. // these IDs.
  43011. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  43012. var ids_ []string
  43013. for _, v := range ids {
  43014. ids_ = append(ids_, fmt.Sprint(v))
  43015. }
  43016. c.urlParams_.SetMulti("ids", ids_)
  43017. return c
  43018. }
  43019. // MaxResults sets the optional parameter "maxResults": Maximum number
  43020. // of results to return.
  43021. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  43022. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43023. return c
  43024. }
  43025. // PageToken sets the optional parameter "pageToken": Value of the
  43026. // nextPageToken from the previous result page.
  43027. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  43028. c.urlParams_.Set("pageToken", pageToken)
  43029. return c
  43030. }
  43031. // SearchString sets the optional parameter "searchString": Allows
  43032. // searching for objects by name or ID. Wildcards (*) are allowed. For
  43033. // example, "subaccount*2015" will return objects with names like
  43034. // "subaccount June 2015", "subaccount April 2015", or simply
  43035. // "subaccount 2015". Most of the searches also add wildcards implicitly
  43036. // at the start and the end of the search string. For example, a search
  43037. // string of "subaccount" will match objects with name "my subaccount",
  43038. // "subaccount 2015", or simply "subaccount".
  43039. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  43040. c.urlParams_.Set("searchString", searchString)
  43041. return c
  43042. }
  43043. // SortField sets the optional parameter "sortField": Field by which to
  43044. // sort the list.
  43045. //
  43046. // Possible values:
  43047. // "ID" (default)
  43048. // "NAME"
  43049. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  43050. c.urlParams_.Set("sortField", sortField)
  43051. return c
  43052. }
  43053. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43054. // results.
  43055. //
  43056. // Possible values:
  43057. // "ASCENDING" (default)
  43058. // "DESCENDING"
  43059. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  43060. c.urlParams_.Set("sortOrder", sortOrder)
  43061. return c
  43062. }
  43063. // Fields allows partial responses to be retrieved. See
  43064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43065. // for more information.
  43066. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  43067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43068. return c
  43069. }
  43070. // IfNoneMatch sets the optional parameter which makes the operation
  43071. // fail if the object's ETag matches the given value. This is useful for
  43072. // getting updates only after the object has changed since the last
  43073. // request. Use googleapi.IsNotModified to check whether the response
  43074. // error from Do is the result of In-None-Match.
  43075. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  43076. c.ifNoneMatch_ = entityTag
  43077. return c
  43078. }
  43079. // Context sets the context to be used in this call's Do method. Any
  43080. // pending HTTP request will be aborted if the provided context is
  43081. // canceled.
  43082. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  43083. c.ctx_ = ctx
  43084. return c
  43085. }
  43086. // Header returns an http.Header that can be modified by the caller to
  43087. // add HTTP headers to the request.
  43088. func (c *SubaccountsListCall) Header() http.Header {
  43089. if c.header_ == nil {
  43090. c.header_ = make(http.Header)
  43091. }
  43092. return c.header_
  43093. }
  43094. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  43095. reqHeaders := make(http.Header)
  43096. for k, v := range c.header_ {
  43097. reqHeaders[k] = v
  43098. }
  43099. reqHeaders.Set("User-Agent", c.s.userAgent())
  43100. if c.ifNoneMatch_ != "" {
  43101. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43102. }
  43103. var body io.Reader = nil
  43104. c.urlParams_.Set("alt", alt)
  43105. c.urlParams_.Set("prettyPrint", "false")
  43106. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43107. urls += "?" + c.urlParams_.Encode()
  43108. req, err := http.NewRequest("GET", urls, body)
  43109. if err != nil {
  43110. return nil, err
  43111. }
  43112. req.Header = reqHeaders
  43113. googleapi.Expand(req.URL, map[string]string{
  43114. "profileId": strconv.FormatInt(c.profileId, 10),
  43115. })
  43116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43117. }
  43118. // Do executes the "dfareporting.subaccounts.list" call.
  43119. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  43120. // non-2xx status code is an error. Response headers are in either
  43121. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  43122. // returned at all) in error.(*googleapi.Error).Header. Use
  43123. // googleapi.IsNotModified to check whether the returned error was
  43124. // because http.StatusNotModified was returned.
  43125. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  43126. gensupport.SetOptions(c.urlParams_, opts...)
  43127. res, err := c.doRequest("json")
  43128. if res != nil && res.StatusCode == http.StatusNotModified {
  43129. if res.Body != nil {
  43130. res.Body.Close()
  43131. }
  43132. return nil, &googleapi.Error{
  43133. Code: res.StatusCode,
  43134. Header: res.Header,
  43135. }
  43136. }
  43137. if err != nil {
  43138. return nil, err
  43139. }
  43140. defer googleapi.CloseBody(res)
  43141. if err := googleapi.CheckResponse(res); err != nil {
  43142. return nil, err
  43143. }
  43144. ret := &SubaccountsListResponse{
  43145. ServerResponse: googleapi.ServerResponse{
  43146. Header: res.Header,
  43147. HTTPStatusCode: res.StatusCode,
  43148. },
  43149. }
  43150. target := &ret
  43151. if err := gensupport.DecodeResponse(target, res); err != nil {
  43152. return nil, err
  43153. }
  43154. return ret, nil
  43155. // {
  43156. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  43157. // "httpMethod": "GET",
  43158. // "id": "dfareporting.subaccounts.list",
  43159. // "parameterOrder": [
  43160. // "profileId"
  43161. // ],
  43162. // "parameters": {
  43163. // "ids": {
  43164. // "description": "Select only subaccounts with these IDs.",
  43165. // "format": "int64",
  43166. // "location": "query",
  43167. // "repeated": true,
  43168. // "type": "string"
  43169. // },
  43170. // "maxResults": {
  43171. // "default": "1000",
  43172. // "description": "Maximum number of results to return.",
  43173. // "format": "int32",
  43174. // "location": "query",
  43175. // "maximum": "1000",
  43176. // "minimum": "0",
  43177. // "type": "integer"
  43178. // },
  43179. // "pageToken": {
  43180. // "description": "Value of the nextPageToken from the previous result page.",
  43181. // "location": "query",
  43182. // "type": "string"
  43183. // },
  43184. // "profileId": {
  43185. // "description": "User profile ID associated with this request.",
  43186. // "format": "int64",
  43187. // "location": "path",
  43188. // "required": true,
  43189. // "type": "string"
  43190. // },
  43191. // "searchString": {
  43192. // "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\".",
  43193. // "location": "query",
  43194. // "type": "string"
  43195. // },
  43196. // "sortField": {
  43197. // "default": "ID",
  43198. // "description": "Field by which to sort the list.",
  43199. // "enum": [
  43200. // "ID",
  43201. // "NAME"
  43202. // ],
  43203. // "enumDescriptions": [
  43204. // "",
  43205. // ""
  43206. // ],
  43207. // "location": "query",
  43208. // "type": "string"
  43209. // },
  43210. // "sortOrder": {
  43211. // "default": "ASCENDING",
  43212. // "description": "Order of sorted results.",
  43213. // "enum": [
  43214. // "ASCENDING",
  43215. // "DESCENDING"
  43216. // ],
  43217. // "enumDescriptions": [
  43218. // "",
  43219. // ""
  43220. // ],
  43221. // "location": "query",
  43222. // "type": "string"
  43223. // }
  43224. // },
  43225. // "path": "userprofiles/{profileId}/subaccounts",
  43226. // "response": {
  43227. // "$ref": "SubaccountsListResponse"
  43228. // },
  43229. // "scopes": [
  43230. // "https://www.googleapis.com/auth/dfatrafficking"
  43231. // ]
  43232. // }
  43233. }
  43234. // Pages invokes f for each page of results.
  43235. // A non-nil error returned from f will halt the iteration.
  43236. // The provided context supersedes any context provided to the Context method.
  43237. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  43238. c.ctx_ = ctx
  43239. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43240. for {
  43241. x, err := c.Do()
  43242. if err != nil {
  43243. return err
  43244. }
  43245. if err := f(x); err != nil {
  43246. return err
  43247. }
  43248. if x.NextPageToken == "" {
  43249. return nil
  43250. }
  43251. c.PageToken(x.NextPageToken)
  43252. }
  43253. }
  43254. // method id "dfareporting.subaccounts.patch":
  43255. type SubaccountsPatchCall struct {
  43256. s *Service
  43257. profileId int64
  43258. subaccount *Subaccount
  43259. urlParams_ gensupport.URLParams
  43260. ctx_ context.Context
  43261. header_ http.Header
  43262. }
  43263. // Patch: Updates an existing subaccount. This method supports patch
  43264. // semantics.
  43265. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  43266. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43267. c.profileId = profileId
  43268. c.urlParams_.Set("id", fmt.Sprint(id))
  43269. c.subaccount = subaccount
  43270. return c
  43271. }
  43272. // Fields allows partial responses to be retrieved. See
  43273. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43274. // for more information.
  43275. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  43276. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43277. return c
  43278. }
  43279. // Context sets the context to be used in this call's Do method. Any
  43280. // pending HTTP request will be aborted if the provided context is
  43281. // canceled.
  43282. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  43283. c.ctx_ = ctx
  43284. return c
  43285. }
  43286. // Header returns an http.Header that can be modified by the caller to
  43287. // add HTTP headers to the request.
  43288. func (c *SubaccountsPatchCall) Header() http.Header {
  43289. if c.header_ == nil {
  43290. c.header_ = make(http.Header)
  43291. }
  43292. return c.header_
  43293. }
  43294. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  43295. reqHeaders := make(http.Header)
  43296. for k, v := range c.header_ {
  43297. reqHeaders[k] = v
  43298. }
  43299. reqHeaders.Set("User-Agent", c.s.userAgent())
  43300. var body io.Reader = nil
  43301. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  43302. if err != nil {
  43303. return nil, err
  43304. }
  43305. reqHeaders.Set("Content-Type", "application/json")
  43306. c.urlParams_.Set("alt", alt)
  43307. c.urlParams_.Set("prettyPrint", "false")
  43308. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43309. urls += "?" + c.urlParams_.Encode()
  43310. req, err := http.NewRequest("PATCH", urls, body)
  43311. if err != nil {
  43312. return nil, err
  43313. }
  43314. req.Header = reqHeaders
  43315. googleapi.Expand(req.URL, map[string]string{
  43316. "profileId": strconv.FormatInt(c.profileId, 10),
  43317. })
  43318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43319. }
  43320. // Do executes the "dfareporting.subaccounts.patch" call.
  43321. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  43322. // status code is an error. Response headers are in either
  43323. // *Subaccount.ServerResponse.Header or (if a response was returned at
  43324. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43325. // to check whether the returned error was because
  43326. // http.StatusNotModified was returned.
  43327. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  43328. gensupport.SetOptions(c.urlParams_, opts...)
  43329. res, err := c.doRequest("json")
  43330. if res != nil && res.StatusCode == http.StatusNotModified {
  43331. if res.Body != nil {
  43332. res.Body.Close()
  43333. }
  43334. return nil, &googleapi.Error{
  43335. Code: res.StatusCode,
  43336. Header: res.Header,
  43337. }
  43338. }
  43339. if err != nil {
  43340. return nil, err
  43341. }
  43342. defer googleapi.CloseBody(res)
  43343. if err := googleapi.CheckResponse(res); err != nil {
  43344. return nil, err
  43345. }
  43346. ret := &Subaccount{
  43347. ServerResponse: googleapi.ServerResponse{
  43348. Header: res.Header,
  43349. HTTPStatusCode: res.StatusCode,
  43350. },
  43351. }
  43352. target := &ret
  43353. if err := gensupport.DecodeResponse(target, res); err != nil {
  43354. return nil, err
  43355. }
  43356. return ret, nil
  43357. // {
  43358. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  43359. // "httpMethod": "PATCH",
  43360. // "id": "dfareporting.subaccounts.patch",
  43361. // "parameterOrder": [
  43362. // "profileId",
  43363. // "id"
  43364. // ],
  43365. // "parameters": {
  43366. // "id": {
  43367. // "description": "Subaccount ID.",
  43368. // "format": "int64",
  43369. // "location": "query",
  43370. // "required": true,
  43371. // "type": "string"
  43372. // },
  43373. // "profileId": {
  43374. // "description": "User profile ID associated with this request.",
  43375. // "format": "int64",
  43376. // "location": "path",
  43377. // "required": true,
  43378. // "type": "string"
  43379. // }
  43380. // },
  43381. // "path": "userprofiles/{profileId}/subaccounts",
  43382. // "request": {
  43383. // "$ref": "Subaccount"
  43384. // },
  43385. // "response": {
  43386. // "$ref": "Subaccount"
  43387. // },
  43388. // "scopes": [
  43389. // "https://www.googleapis.com/auth/dfatrafficking"
  43390. // ]
  43391. // }
  43392. }
  43393. // method id "dfareporting.subaccounts.update":
  43394. type SubaccountsUpdateCall struct {
  43395. s *Service
  43396. profileId int64
  43397. subaccount *Subaccount
  43398. urlParams_ gensupport.URLParams
  43399. ctx_ context.Context
  43400. header_ http.Header
  43401. }
  43402. // Update: Updates an existing subaccount.
  43403. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  43404. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43405. c.profileId = profileId
  43406. c.subaccount = subaccount
  43407. return c
  43408. }
  43409. // Fields allows partial responses to be retrieved. See
  43410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43411. // for more information.
  43412. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  43413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43414. return c
  43415. }
  43416. // Context sets the context to be used in this call's Do method. Any
  43417. // pending HTTP request will be aborted if the provided context is
  43418. // canceled.
  43419. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  43420. c.ctx_ = ctx
  43421. return c
  43422. }
  43423. // Header returns an http.Header that can be modified by the caller to
  43424. // add HTTP headers to the request.
  43425. func (c *SubaccountsUpdateCall) Header() http.Header {
  43426. if c.header_ == nil {
  43427. c.header_ = make(http.Header)
  43428. }
  43429. return c.header_
  43430. }
  43431. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  43432. reqHeaders := make(http.Header)
  43433. for k, v := range c.header_ {
  43434. reqHeaders[k] = v
  43435. }
  43436. reqHeaders.Set("User-Agent", c.s.userAgent())
  43437. var body io.Reader = nil
  43438. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  43439. if err != nil {
  43440. return nil, err
  43441. }
  43442. reqHeaders.Set("Content-Type", "application/json")
  43443. c.urlParams_.Set("alt", alt)
  43444. c.urlParams_.Set("prettyPrint", "false")
  43445. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  43446. urls += "?" + c.urlParams_.Encode()
  43447. req, err := http.NewRequest("PUT", urls, body)
  43448. if err != nil {
  43449. return nil, err
  43450. }
  43451. req.Header = reqHeaders
  43452. googleapi.Expand(req.URL, map[string]string{
  43453. "profileId": strconv.FormatInt(c.profileId, 10),
  43454. })
  43455. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43456. }
  43457. // Do executes the "dfareporting.subaccounts.update" call.
  43458. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  43459. // status code is an error. Response headers are in either
  43460. // *Subaccount.ServerResponse.Header or (if a response was returned at
  43461. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43462. // to check whether the returned error was because
  43463. // http.StatusNotModified was returned.
  43464. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  43465. gensupport.SetOptions(c.urlParams_, opts...)
  43466. res, err := c.doRequest("json")
  43467. if res != nil && res.StatusCode == http.StatusNotModified {
  43468. if res.Body != nil {
  43469. res.Body.Close()
  43470. }
  43471. return nil, &googleapi.Error{
  43472. Code: res.StatusCode,
  43473. Header: res.Header,
  43474. }
  43475. }
  43476. if err != nil {
  43477. return nil, err
  43478. }
  43479. defer googleapi.CloseBody(res)
  43480. if err := googleapi.CheckResponse(res); err != nil {
  43481. return nil, err
  43482. }
  43483. ret := &Subaccount{
  43484. ServerResponse: googleapi.ServerResponse{
  43485. Header: res.Header,
  43486. HTTPStatusCode: res.StatusCode,
  43487. },
  43488. }
  43489. target := &ret
  43490. if err := gensupport.DecodeResponse(target, res); err != nil {
  43491. return nil, err
  43492. }
  43493. return ret, nil
  43494. // {
  43495. // "description": "Updates an existing subaccount.",
  43496. // "httpMethod": "PUT",
  43497. // "id": "dfareporting.subaccounts.update",
  43498. // "parameterOrder": [
  43499. // "profileId"
  43500. // ],
  43501. // "parameters": {
  43502. // "profileId": {
  43503. // "description": "User profile ID associated with this request.",
  43504. // "format": "int64",
  43505. // "location": "path",
  43506. // "required": true,
  43507. // "type": "string"
  43508. // }
  43509. // },
  43510. // "path": "userprofiles/{profileId}/subaccounts",
  43511. // "request": {
  43512. // "$ref": "Subaccount"
  43513. // },
  43514. // "response": {
  43515. // "$ref": "Subaccount"
  43516. // },
  43517. // "scopes": [
  43518. // "https://www.googleapis.com/auth/dfatrafficking"
  43519. // ]
  43520. // }
  43521. }
  43522. // method id "dfareporting.targetableRemarketingLists.get":
  43523. type TargetableRemarketingListsGetCall struct {
  43524. s *Service
  43525. profileId int64
  43526. id int64
  43527. urlParams_ gensupport.URLParams
  43528. ifNoneMatch_ string
  43529. ctx_ context.Context
  43530. header_ http.Header
  43531. }
  43532. // Get: Gets one remarketing list by ID.
  43533. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  43534. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43535. c.profileId = profileId
  43536. c.id = id
  43537. return c
  43538. }
  43539. // Fields allows partial responses to be retrieved. See
  43540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43541. // for more information.
  43542. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  43543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43544. return c
  43545. }
  43546. // IfNoneMatch sets the optional parameter which makes the operation
  43547. // fail if the object's ETag matches the given value. This is useful for
  43548. // getting updates only after the object has changed since the last
  43549. // request. Use googleapi.IsNotModified to check whether the response
  43550. // error from Do is the result of In-None-Match.
  43551. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  43552. c.ifNoneMatch_ = entityTag
  43553. return c
  43554. }
  43555. // Context sets the context to be used in this call's Do method. Any
  43556. // pending HTTP request will be aborted if the provided context is
  43557. // canceled.
  43558. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  43559. c.ctx_ = ctx
  43560. return c
  43561. }
  43562. // Header returns an http.Header that can be modified by the caller to
  43563. // add HTTP headers to the request.
  43564. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  43565. if c.header_ == nil {
  43566. c.header_ = make(http.Header)
  43567. }
  43568. return c.header_
  43569. }
  43570. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  43571. reqHeaders := make(http.Header)
  43572. for k, v := range c.header_ {
  43573. reqHeaders[k] = v
  43574. }
  43575. reqHeaders.Set("User-Agent", c.s.userAgent())
  43576. if c.ifNoneMatch_ != "" {
  43577. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43578. }
  43579. var body io.Reader = nil
  43580. c.urlParams_.Set("alt", alt)
  43581. c.urlParams_.Set("prettyPrint", "false")
  43582. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  43583. urls += "?" + c.urlParams_.Encode()
  43584. req, err := http.NewRequest("GET", urls, body)
  43585. if err != nil {
  43586. return nil, err
  43587. }
  43588. req.Header = reqHeaders
  43589. googleapi.Expand(req.URL, map[string]string{
  43590. "profileId": strconv.FormatInt(c.profileId, 10),
  43591. "id": strconv.FormatInt(c.id, 10),
  43592. })
  43593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43594. }
  43595. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  43596. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  43597. // Any non-2xx status code is an error. Response headers are in either
  43598. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  43599. // was returned at all) in error.(*googleapi.Error).Header. Use
  43600. // googleapi.IsNotModified to check whether the returned error was
  43601. // because http.StatusNotModified was returned.
  43602. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  43603. gensupport.SetOptions(c.urlParams_, opts...)
  43604. res, err := c.doRequest("json")
  43605. if res != nil && res.StatusCode == http.StatusNotModified {
  43606. if res.Body != nil {
  43607. res.Body.Close()
  43608. }
  43609. return nil, &googleapi.Error{
  43610. Code: res.StatusCode,
  43611. Header: res.Header,
  43612. }
  43613. }
  43614. if err != nil {
  43615. return nil, err
  43616. }
  43617. defer googleapi.CloseBody(res)
  43618. if err := googleapi.CheckResponse(res); err != nil {
  43619. return nil, err
  43620. }
  43621. ret := &TargetableRemarketingList{
  43622. ServerResponse: googleapi.ServerResponse{
  43623. Header: res.Header,
  43624. HTTPStatusCode: res.StatusCode,
  43625. },
  43626. }
  43627. target := &ret
  43628. if err := gensupport.DecodeResponse(target, res); err != nil {
  43629. return nil, err
  43630. }
  43631. return ret, nil
  43632. // {
  43633. // "description": "Gets one remarketing list by ID.",
  43634. // "httpMethod": "GET",
  43635. // "id": "dfareporting.targetableRemarketingLists.get",
  43636. // "parameterOrder": [
  43637. // "profileId",
  43638. // "id"
  43639. // ],
  43640. // "parameters": {
  43641. // "id": {
  43642. // "description": "Remarketing list ID.",
  43643. // "format": "int64",
  43644. // "location": "path",
  43645. // "required": true,
  43646. // "type": "string"
  43647. // },
  43648. // "profileId": {
  43649. // "description": "User profile ID associated with this request.",
  43650. // "format": "int64",
  43651. // "location": "path",
  43652. // "required": true,
  43653. // "type": "string"
  43654. // }
  43655. // },
  43656. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  43657. // "response": {
  43658. // "$ref": "TargetableRemarketingList"
  43659. // },
  43660. // "scopes": [
  43661. // "https://www.googleapis.com/auth/dfatrafficking"
  43662. // ]
  43663. // }
  43664. }
  43665. // method id "dfareporting.targetableRemarketingLists.list":
  43666. type TargetableRemarketingListsListCall struct {
  43667. s *Service
  43668. profileId int64
  43669. urlParams_ gensupport.URLParams
  43670. ifNoneMatch_ string
  43671. ctx_ context.Context
  43672. header_ http.Header
  43673. }
  43674. // List: Retrieves a list of targetable remarketing lists, possibly
  43675. // filtered. This method supports paging.
  43676. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  43677. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43678. c.profileId = profileId
  43679. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43680. return c
  43681. }
  43682. // Active sets the optional parameter "active": Select only active or
  43683. // only inactive targetable remarketing lists.
  43684. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  43685. c.urlParams_.Set("active", fmt.Sprint(active))
  43686. return c
  43687. }
  43688. // MaxResults sets the optional parameter "maxResults": Maximum number
  43689. // of results to return.
  43690. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  43691. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43692. return c
  43693. }
  43694. // Name sets the optional parameter "name": Allows searching for objects
  43695. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  43696. // list*2015" will return objects with names like "remarketing list June
  43697. // 2015", "remarketing list April 2015", or simply "remarketing list
  43698. // 2015". Most of the searches also add wildcards implicitly at the
  43699. // start and the end of the search string. For example, a search string
  43700. // of "remarketing list" will match objects with name "my remarketing
  43701. // list", "remarketing list 2015", or simply "remarketing list".
  43702. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  43703. c.urlParams_.Set("name", name)
  43704. return c
  43705. }
  43706. // PageToken sets the optional parameter "pageToken": Value of the
  43707. // nextPageToken from the previous result page.
  43708. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  43709. c.urlParams_.Set("pageToken", pageToken)
  43710. return c
  43711. }
  43712. // SortField sets the optional parameter "sortField": Field by which to
  43713. // sort the list.
  43714. //
  43715. // Possible values:
  43716. // "ID" (default)
  43717. // "NAME"
  43718. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  43719. c.urlParams_.Set("sortField", sortField)
  43720. return c
  43721. }
  43722. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43723. // results.
  43724. //
  43725. // Possible values:
  43726. // "ASCENDING" (default)
  43727. // "DESCENDING"
  43728. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  43729. c.urlParams_.Set("sortOrder", sortOrder)
  43730. return c
  43731. }
  43732. // Fields allows partial responses to be retrieved. See
  43733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43734. // for more information.
  43735. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  43736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43737. return c
  43738. }
  43739. // IfNoneMatch sets the optional parameter which makes the operation
  43740. // fail if the object's ETag matches the given value. This is useful for
  43741. // getting updates only after the object has changed since the last
  43742. // request. Use googleapi.IsNotModified to check whether the response
  43743. // error from Do is the result of In-None-Match.
  43744. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  43745. c.ifNoneMatch_ = entityTag
  43746. return c
  43747. }
  43748. // Context sets the context to be used in this call's Do method. Any
  43749. // pending HTTP request will be aborted if the provided context is
  43750. // canceled.
  43751. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  43752. c.ctx_ = ctx
  43753. return c
  43754. }
  43755. // Header returns an http.Header that can be modified by the caller to
  43756. // add HTTP headers to the request.
  43757. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  43758. if c.header_ == nil {
  43759. c.header_ = make(http.Header)
  43760. }
  43761. return c.header_
  43762. }
  43763. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  43764. reqHeaders := make(http.Header)
  43765. for k, v := range c.header_ {
  43766. reqHeaders[k] = v
  43767. }
  43768. reqHeaders.Set("User-Agent", c.s.userAgent())
  43769. if c.ifNoneMatch_ != "" {
  43770. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43771. }
  43772. var body io.Reader = nil
  43773. c.urlParams_.Set("alt", alt)
  43774. c.urlParams_.Set("prettyPrint", "false")
  43775. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  43776. urls += "?" + c.urlParams_.Encode()
  43777. req, err := http.NewRequest("GET", urls, body)
  43778. if err != nil {
  43779. return nil, err
  43780. }
  43781. req.Header = reqHeaders
  43782. googleapi.Expand(req.URL, map[string]string{
  43783. "profileId": strconv.FormatInt(c.profileId, 10),
  43784. })
  43785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43786. }
  43787. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  43788. // Exactly one of *TargetableRemarketingListsListResponse or error will
  43789. // be non-nil. Any non-2xx status code is an error. Response headers are
  43790. // in either
  43791. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  43792. // a response was returned at all) in error.(*googleapi.Error).Header.
  43793. // Use googleapi.IsNotModified to check whether the returned error was
  43794. // because http.StatusNotModified was returned.
  43795. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  43796. gensupport.SetOptions(c.urlParams_, opts...)
  43797. res, err := c.doRequest("json")
  43798. if res != nil && res.StatusCode == http.StatusNotModified {
  43799. if res.Body != nil {
  43800. res.Body.Close()
  43801. }
  43802. return nil, &googleapi.Error{
  43803. Code: res.StatusCode,
  43804. Header: res.Header,
  43805. }
  43806. }
  43807. if err != nil {
  43808. return nil, err
  43809. }
  43810. defer googleapi.CloseBody(res)
  43811. if err := googleapi.CheckResponse(res); err != nil {
  43812. return nil, err
  43813. }
  43814. ret := &TargetableRemarketingListsListResponse{
  43815. ServerResponse: googleapi.ServerResponse{
  43816. Header: res.Header,
  43817. HTTPStatusCode: res.StatusCode,
  43818. },
  43819. }
  43820. target := &ret
  43821. if err := gensupport.DecodeResponse(target, res); err != nil {
  43822. return nil, err
  43823. }
  43824. return ret, nil
  43825. // {
  43826. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  43827. // "httpMethod": "GET",
  43828. // "id": "dfareporting.targetableRemarketingLists.list",
  43829. // "parameterOrder": [
  43830. // "profileId",
  43831. // "advertiserId"
  43832. // ],
  43833. // "parameters": {
  43834. // "active": {
  43835. // "description": "Select only active or only inactive targetable remarketing lists.",
  43836. // "location": "query",
  43837. // "type": "boolean"
  43838. // },
  43839. // "advertiserId": {
  43840. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  43841. // "format": "int64",
  43842. // "location": "query",
  43843. // "required": true,
  43844. // "type": "string"
  43845. // },
  43846. // "maxResults": {
  43847. // "default": "1000",
  43848. // "description": "Maximum number of results to return.",
  43849. // "format": "int32",
  43850. // "location": "query",
  43851. // "maximum": "1000",
  43852. // "minimum": "0",
  43853. // "type": "integer"
  43854. // },
  43855. // "name": {
  43856. // "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\".",
  43857. // "location": "query",
  43858. // "type": "string"
  43859. // },
  43860. // "pageToken": {
  43861. // "description": "Value of the nextPageToken from the previous result page.",
  43862. // "location": "query",
  43863. // "type": "string"
  43864. // },
  43865. // "profileId": {
  43866. // "description": "User profile ID associated with this request.",
  43867. // "format": "int64",
  43868. // "location": "path",
  43869. // "required": true,
  43870. // "type": "string"
  43871. // },
  43872. // "sortField": {
  43873. // "default": "ID",
  43874. // "description": "Field by which to sort the list.",
  43875. // "enum": [
  43876. // "ID",
  43877. // "NAME"
  43878. // ],
  43879. // "enumDescriptions": [
  43880. // "",
  43881. // ""
  43882. // ],
  43883. // "location": "query",
  43884. // "type": "string"
  43885. // },
  43886. // "sortOrder": {
  43887. // "default": "ASCENDING",
  43888. // "description": "Order of sorted results.",
  43889. // "enum": [
  43890. // "ASCENDING",
  43891. // "DESCENDING"
  43892. // ],
  43893. // "enumDescriptions": [
  43894. // "",
  43895. // ""
  43896. // ],
  43897. // "location": "query",
  43898. // "type": "string"
  43899. // }
  43900. // },
  43901. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  43902. // "response": {
  43903. // "$ref": "TargetableRemarketingListsListResponse"
  43904. // },
  43905. // "scopes": [
  43906. // "https://www.googleapis.com/auth/dfatrafficking"
  43907. // ]
  43908. // }
  43909. }
  43910. // Pages invokes f for each page of results.
  43911. // A non-nil error returned from f will halt the iteration.
  43912. // The provided context supersedes any context provided to the Context method.
  43913. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  43914. c.ctx_ = ctx
  43915. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43916. for {
  43917. x, err := c.Do()
  43918. if err != nil {
  43919. return err
  43920. }
  43921. if err := f(x); err != nil {
  43922. return err
  43923. }
  43924. if x.NextPageToken == "" {
  43925. return nil
  43926. }
  43927. c.PageToken(x.NextPageToken)
  43928. }
  43929. }
  43930. // method id "dfareporting.targetingTemplates.get":
  43931. type TargetingTemplatesGetCall struct {
  43932. s *Service
  43933. profileId int64
  43934. id int64
  43935. urlParams_ gensupport.URLParams
  43936. ifNoneMatch_ string
  43937. ctx_ context.Context
  43938. header_ http.Header
  43939. }
  43940. // Get: Gets one targeting template by ID.
  43941. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  43942. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43943. c.profileId = profileId
  43944. c.id = id
  43945. return c
  43946. }
  43947. // Fields allows partial responses to be retrieved. See
  43948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43949. // for more information.
  43950. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  43951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43952. return c
  43953. }
  43954. // IfNoneMatch sets the optional parameter which makes the operation
  43955. // fail if the object's ETag matches the given value. This is useful for
  43956. // getting updates only after the object has changed since the last
  43957. // request. Use googleapi.IsNotModified to check whether the response
  43958. // error from Do is the result of In-None-Match.
  43959. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  43960. c.ifNoneMatch_ = entityTag
  43961. return c
  43962. }
  43963. // Context sets the context to be used in this call's Do method. Any
  43964. // pending HTTP request will be aborted if the provided context is
  43965. // canceled.
  43966. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  43967. c.ctx_ = ctx
  43968. return c
  43969. }
  43970. // Header returns an http.Header that can be modified by the caller to
  43971. // add HTTP headers to the request.
  43972. func (c *TargetingTemplatesGetCall) Header() http.Header {
  43973. if c.header_ == nil {
  43974. c.header_ = make(http.Header)
  43975. }
  43976. return c.header_
  43977. }
  43978. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  43979. reqHeaders := make(http.Header)
  43980. for k, v := range c.header_ {
  43981. reqHeaders[k] = v
  43982. }
  43983. reqHeaders.Set("User-Agent", c.s.userAgent())
  43984. if c.ifNoneMatch_ != "" {
  43985. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43986. }
  43987. var body io.Reader = nil
  43988. c.urlParams_.Set("alt", alt)
  43989. c.urlParams_.Set("prettyPrint", "false")
  43990. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  43991. urls += "?" + c.urlParams_.Encode()
  43992. req, err := http.NewRequest("GET", urls, body)
  43993. if err != nil {
  43994. return nil, err
  43995. }
  43996. req.Header = reqHeaders
  43997. googleapi.Expand(req.URL, map[string]string{
  43998. "profileId": strconv.FormatInt(c.profileId, 10),
  43999. "id": strconv.FormatInt(c.id, 10),
  44000. })
  44001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44002. }
  44003. // Do executes the "dfareporting.targetingTemplates.get" call.
  44004. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44005. // non-2xx status code is an error. Response headers are in either
  44006. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44007. // returned at all) in error.(*googleapi.Error).Header. Use
  44008. // googleapi.IsNotModified to check whether the returned error was
  44009. // because http.StatusNotModified was returned.
  44010. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44011. gensupport.SetOptions(c.urlParams_, opts...)
  44012. res, err := c.doRequest("json")
  44013. if res != nil && res.StatusCode == http.StatusNotModified {
  44014. if res.Body != nil {
  44015. res.Body.Close()
  44016. }
  44017. return nil, &googleapi.Error{
  44018. Code: res.StatusCode,
  44019. Header: res.Header,
  44020. }
  44021. }
  44022. if err != nil {
  44023. return nil, err
  44024. }
  44025. defer googleapi.CloseBody(res)
  44026. if err := googleapi.CheckResponse(res); err != nil {
  44027. return nil, err
  44028. }
  44029. ret := &TargetingTemplate{
  44030. ServerResponse: googleapi.ServerResponse{
  44031. Header: res.Header,
  44032. HTTPStatusCode: res.StatusCode,
  44033. },
  44034. }
  44035. target := &ret
  44036. if err := gensupport.DecodeResponse(target, res); err != nil {
  44037. return nil, err
  44038. }
  44039. return ret, nil
  44040. // {
  44041. // "description": "Gets one targeting template by ID.",
  44042. // "httpMethod": "GET",
  44043. // "id": "dfareporting.targetingTemplates.get",
  44044. // "parameterOrder": [
  44045. // "profileId",
  44046. // "id"
  44047. // ],
  44048. // "parameters": {
  44049. // "id": {
  44050. // "description": "Targeting template ID.",
  44051. // "format": "int64",
  44052. // "location": "path",
  44053. // "required": true,
  44054. // "type": "string"
  44055. // },
  44056. // "profileId": {
  44057. // "description": "User profile ID associated with this request.",
  44058. // "format": "int64",
  44059. // "location": "path",
  44060. // "required": true,
  44061. // "type": "string"
  44062. // }
  44063. // },
  44064. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  44065. // "response": {
  44066. // "$ref": "TargetingTemplate"
  44067. // },
  44068. // "scopes": [
  44069. // "https://www.googleapis.com/auth/dfatrafficking"
  44070. // ]
  44071. // }
  44072. }
  44073. // method id "dfareporting.targetingTemplates.insert":
  44074. type TargetingTemplatesInsertCall struct {
  44075. s *Service
  44076. profileId int64
  44077. targetingtemplate *TargetingTemplate
  44078. urlParams_ gensupport.URLParams
  44079. ctx_ context.Context
  44080. header_ http.Header
  44081. }
  44082. // Insert: Inserts a new targeting template.
  44083. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  44084. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44085. c.profileId = profileId
  44086. c.targetingtemplate = targetingtemplate
  44087. return c
  44088. }
  44089. // Fields allows partial responses to be retrieved. See
  44090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44091. // for more information.
  44092. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  44093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44094. return c
  44095. }
  44096. // Context sets the context to be used in this call's Do method. Any
  44097. // pending HTTP request will be aborted if the provided context is
  44098. // canceled.
  44099. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  44100. c.ctx_ = ctx
  44101. return c
  44102. }
  44103. // Header returns an http.Header that can be modified by the caller to
  44104. // add HTTP headers to the request.
  44105. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  44106. if c.header_ == nil {
  44107. c.header_ = make(http.Header)
  44108. }
  44109. return c.header_
  44110. }
  44111. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  44112. reqHeaders := make(http.Header)
  44113. for k, v := range c.header_ {
  44114. reqHeaders[k] = v
  44115. }
  44116. reqHeaders.Set("User-Agent", c.s.userAgent())
  44117. var body io.Reader = nil
  44118. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44119. if err != nil {
  44120. return nil, err
  44121. }
  44122. reqHeaders.Set("Content-Type", "application/json")
  44123. c.urlParams_.Set("alt", alt)
  44124. c.urlParams_.Set("prettyPrint", "false")
  44125. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44126. urls += "?" + c.urlParams_.Encode()
  44127. req, err := http.NewRequest("POST", urls, body)
  44128. if err != nil {
  44129. return nil, err
  44130. }
  44131. req.Header = reqHeaders
  44132. googleapi.Expand(req.URL, map[string]string{
  44133. "profileId": strconv.FormatInt(c.profileId, 10),
  44134. })
  44135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44136. }
  44137. // Do executes the "dfareporting.targetingTemplates.insert" call.
  44138. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44139. // non-2xx status code is an error. Response headers are in either
  44140. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44141. // returned at all) in error.(*googleapi.Error).Header. Use
  44142. // googleapi.IsNotModified to check whether the returned error was
  44143. // because http.StatusNotModified was returned.
  44144. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44145. gensupport.SetOptions(c.urlParams_, opts...)
  44146. res, err := c.doRequest("json")
  44147. if res != nil && res.StatusCode == http.StatusNotModified {
  44148. if res.Body != nil {
  44149. res.Body.Close()
  44150. }
  44151. return nil, &googleapi.Error{
  44152. Code: res.StatusCode,
  44153. Header: res.Header,
  44154. }
  44155. }
  44156. if err != nil {
  44157. return nil, err
  44158. }
  44159. defer googleapi.CloseBody(res)
  44160. if err := googleapi.CheckResponse(res); err != nil {
  44161. return nil, err
  44162. }
  44163. ret := &TargetingTemplate{
  44164. ServerResponse: googleapi.ServerResponse{
  44165. Header: res.Header,
  44166. HTTPStatusCode: res.StatusCode,
  44167. },
  44168. }
  44169. target := &ret
  44170. if err := gensupport.DecodeResponse(target, res); err != nil {
  44171. return nil, err
  44172. }
  44173. return ret, nil
  44174. // {
  44175. // "description": "Inserts a new targeting template.",
  44176. // "httpMethod": "POST",
  44177. // "id": "dfareporting.targetingTemplates.insert",
  44178. // "parameterOrder": [
  44179. // "profileId"
  44180. // ],
  44181. // "parameters": {
  44182. // "profileId": {
  44183. // "description": "User profile ID associated with this request.",
  44184. // "format": "int64",
  44185. // "location": "path",
  44186. // "required": true,
  44187. // "type": "string"
  44188. // }
  44189. // },
  44190. // "path": "userprofiles/{profileId}/targetingTemplates",
  44191. // "request": {
  44192. // "$ref": "TargetingTemplate"
  44193. // },
  44194. // "response": {
  44195. // "$ref": "TargetingTemplate"
  44196. // },
  44197. // "scopes": [
  44198. // "https://www.googleapis.com/auth/dfatrafficking"
  44199. // ]
  44200. // }
  44201. }
  44202. // method id "dfareporting.targetingTemplates.list":
  44203. type TargetingTemplatesListCall struct {
  44204. s *Service
  44205. profileId int64
  44206. urlParams_ gensupport.URLParams
  44207. ifNoneMatch_ string
  44208. ctx_ context.Context
  44209. header_ http.Header
  44210. }
  44211. // List: Retrieves a list of targeting templates, optionally filtered.
  44212. // This method supports paging.
  44213. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  44214. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44215. c.profileId = profileId
  44216. return c
  44217. }
  44218. // AdvertiserId sets the optional parameter "advertiserId": Select only
  44219. // targeting templates with this advertiser ID.
  44220. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  44221. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  44222. return c
  44223. }
  44224. // Ids sets the optional parameter "ids": Select only targeting
  44225. // templates with these IDs.
  44226. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  44227. var ids_ []string
  44228. for _, v := range ids {
  44229. ids_ = append(ids_, fmt.Sprint(v))
  44230. }
  44231. c.urlParams_.SetMulti("ids", ids_)
  44232. return c
  44233. }
  44234. // MaxResults sets the optional parameter "maxResults": Maximum number
  44235. // of results to return.
  44236. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  44237. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44238. return c
  44239. }
  44240. // PageToken sets the optional parameter "pageToken": Value of the
  44241. // nextPageToken from the previous result page.
  44242. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  44243. c.urlParams_.Set("pageToken", pageToken)
  44244. return c
  44245. }
  44246. // SearchString sets the optional parameter "searchString": Allows
  44247. // searching for objects by name or ID. Wildcards (*) are allowed. For
  44248. // example, "template*2015" will return objects with names like
  44249. // "template June 2015", "template April 2015", or simply "template
  44250. // 2015". Most of the searches also add wildcards implicitly at the
  44251. // start and the end of the search string. For example, a search string
  44252. // of "template" will match objects with name "my template", "template
  44253. // 2015", or simply "template".
  44254. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  44255. c.urlParams_.Set("searchString", searchString)
  44256. return c
  44257. }
  44258. // SortField sets the optional parameter "sortField": Field by which to
  44259. // sort the list.
  44260. //
  44261. // Possible values:
  44262. // "ID" (default)
  44263. // "NAME"
  44264. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  44265. c.urlParams_.Set("sortField", sortField)
  44266. return c
  44267. }
  44268. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  44269. // results.
  44270. //
  44271. // Possible values:
  44272. // "ASCENDING" (default)
  44273. // "DESCENDING"
  44274. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  44275. c.urlParams_.Set("sortOrder", sortOrder)
  44276. return c
  44277. }
  44278. // Fields allows partial responses to be retrieved. See
  44279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44280. // for more information.
  44281. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  44282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44283. return c
  44284. }
  44285. // IfNoneMatch sets the optional parameter which makes the operation
  44286. // fail if the object's ETag matches the given value. This is useful for
  44287. // getting updates only after the object has changed since the last
  44288. // request. Use googleapi.IsNotModified to check whether the response
  44289. // error from Do is the result of In-None-Match.
  44290. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  44291. c.ifNoneMatch_ = entityTag
  44292. return c
  44293. }
  44294. // Context sets the context to be used in this call's Do method. Any
  44295. // pending HTTP request will be aborted if the provided context is
  44296. // canceled.
  44297. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  44298. c.ctx_ = ctx
  44299. return c
  44300. }
  44301. // Header returns an http.Header that can be modified by the caller to
  44302. // add HTTP headers to the request.
  44303. func (c *TargetingTemplatesListCall) Header() http.Header {
  44304. if c.header_ == nil {
  44305. c.header_ = make(http.Header)
  44306. }
  44307. return c.header_
  44308. }
  44309. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  44310. reqHeaders := make(http.Header)
  44311. for k, v := range c.header_ {
  44312. reqHeaders[k] = v
  44313. }
  44314. reqHeaders.Set("User-Agent", c.s.userAgent())
  44315. if c.ifNoneMatch_ != "" {
  44316. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44317. }
  44318. var body io.Reader = nil
  44319. c.urlParams_.Set("alt", alt)
  44320. c.urlParams_.Set("prettyPrint", "false")
  44321. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44322. urls += "?" + c.urlParams_.Encode()
  44323. req, err := http.NewRequest("GET", urls, body)
  44324. if err != nil {
  44325. return nil, err
  44326. }
  44327. req.Header = reqHeaders
  44328. googleapi.Expand(req.URL, map[string]string{
  44329. "profileId": strconv.FormatInt(c.profileId, 10),
  44330. })
  44331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44332. }
  44333. // Do executes the "dfareporting.targetingTemplates.list" call.
  44334. // Exactly one of *TargetingTemplatesListResponse or error will be
  44335. // non-nil. Any non-2xx status code is an error. Response headers are in
  44336. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  44337. // response was returned at all) in error.(*googleapi.Error).Header. Use
  44338. // googleapi.IsNotModified to check whether the returned error was
  44339. // because http.StatusNotModified was returned.
  44340. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  44341. gensupport.SetOptions(c.urlParams_, opts...)
  44342. res, err := c.doRequest("json")
  44343. if res != nil && res.StatusCode == http.StatusNotModified {
  44344. if res.Body != nil {
  44345. res.Body.Close()
  44346. }
  44347. return nil, &googleapi.Error{
  44348. Code: res.StatusCode,
  44349. Header: res.Header,
  44350. }
  44351. }
  44352. if err != nil {
  44353. return nil, err
  44354. }
  44355. defer googleapi.CloseBody(res)
  44356. if err := googleapi.CheckResponse(res); err != nil {
  44357. return nil, err
  44358. }
  44359. ret := &TargetingTemplatesListResponse{
  44360. ServerResponse: googleapi.ServerResponse{
  44361. Header: res.Header,
  44362. HTTPStatusCode: res.StatusCode,
  44363. },
  44364. }
  44365. target := &ret
  44366. if err := gensupport.DecodeResponse(target, res); err != nil {
  44367. return nil, err
  44368. }
  44369. return ret, nil
  44370. // {
  44371. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  44372. // "httpMethod": "GET",
  44373. // "id": "dfareporting.targetingTemplates.list",
  44374. // "parameterOrder": [
  44375. // "profileId"
  44376. // ],
  44377. // "parameters": {
  44378. // "advertiserId": {
  44379. // "description": "Select only targeting templates with this advertiser ID.",
  44380. // "format": "int64",
  44381. // "location": "query",
  44382. // "type": "string"
  44383. // },
  44384. // "ids": {
  44385. // "description": "Select only targeting templates with these IDs.",
  44386. // "format": "int64",
  44387. // "location": "query",
  44388. // "repeated": true,
  44389. // "type": "string"
  44390. // },
  44391. // "maxResults": {
  44392. // "default": "1000",
  44393. // "description": "Maximum number of results to return.",
  44394. // "format": "int32",
  44395. // "location": "query",
  44396. // "maximum": "1000",
  44397. // "minimum": "0",
  44398. // "type": "integer"
  44399. // },
  44400. // "pageToken": {
  44401. // "description": "Value of the nextPageToken from the previous result page.",
  44402. // "location": "query",
  44403. // "type": "string"
  44404. // },
  44405. // "profileId": {
  44406. // "description": "User profile ID associated with this request.",
  44407. // "format": "int64",
  44408. // "location": "path",
  44409. // "required": true,
  44410. // "type": "string"
  44411. // },
  44412. // "searchString": {
  44413. // "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\".",
  44414. // "location": "query",
  44415. // "type": "string"
  44416. // },
  44417. // "sortField": {
  44418. // "default": "ID",
  44419. // "description": "Field by which to sort the list.",
  44420. // "enum": [
  44421. // "ID",
  44422. // "NAME"
  44423. // ],
  44424. // "enumDescriptions": [
  44425. // "",
  44426. // ""
  44427. // ],
  44428. // "location": "query",
  44429. // "type": "string"
  44430. // },
  44431. // "sortOrder": {
  44432. // "default": "ASCENDING",
  44433. // "description": "Order of sorted results.",
  44434. // "enum": [
  44435. // "ASCENDING",
  44436. // "DESCENDING"
  44437. // ],
  44438. // "enumDescriptions": [
  44439. // "",
  44440. // ""
  44441. // ],
  44442. // "location": "query",
  44443. // "type": "string"
  44444. // }
  44445. // },
  44446. // "path": "userprofiles/{profileId}/targetingTemplates",
  44447. // "response": {
  44448. // "$ref": "TargetingTemplatesListResponse"
  44449. // },
  44450. // "scopes": [
  44451. // "https://www.googleapis.com/auth/dfatrafficking"
  44452. // ]
  44453. // }
  44454. }
  44455. // Pages invokes f for each page of results.
  44456. // A non-nil error returned from f will halt the iteration.
  44457. // The provided context supersedes any context provided to the Context method.
  44458. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  44459. c.ctx_ = ctx
  44460. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44461. for {
  44462. x, err := c.Do()
  44463. if err != nil {
  44464. return err
  44465. }
  44466. if err := f(x); err != nil {
  44467. return err
  44468. }
  44469. if x.NextPageToken == "" {
  44470. return nil
  44471. }
  44472. c.PageToken(x.NextPageToken)
  44473. }
  44474. }
  44475. // method id "dfareporting.targetingTemplates.patch":
  44476. type TargetingTemplatesPatchCall struct {
  44477. s *Service
  44478. profileId int64
  44479. targetingtemplate *TargetingTemplate
  44480. urlParams_ gensupport.URLParams
  44481. ctx_ context.Context
  44482. header_ http.Header
  44483. }
  44484. // Patch: Updates an existing targeting template. This method supports
  44485. // patch semantics.
  44486. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  44487. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44488. c.profileId = profileId
  44489. c.urlParams_.Set("id", fmt.Sprint(id))
  44490. c.targetingtemplate = targetingtemplate
  44491. return c
  44492. }
  44493. // Fields allows partial responses to be retrieved. See
  44494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44495. // for more information.
  44496. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  44497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44498. return c
  44499. }
  44500. // Context sets the context to be used in this call's Do method. Any
  44501. // pending HTTP request will be aborted if the provided context is
  44502. // canceled.
  44503. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  44504. c.ctx_ = ctx
  44505. return c
  44506. }
  44507. // Header returns an http.Header that can be modified by the caller to
  44508. // add HTTP headers to the request.
  44509. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  44510. if c.header_ == nil {
  44511. c.header_ = make(http.Header)
  44512. }
  44513. return c.header_
  44514. }
  44515. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  44516. reqHeaders := make(http.Header)
  44517. for k, v := range c.header_ {
  44518. reqHeaders[k] = v
  44519. }
  44520. reqHeaders.Set("User-Agent", c.s.userAgent())
  44521. var body io.Reader = nil
  44522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44523. if err != nil {
  44524. return nil, err
  44525. }
  44526. reqHeaders.Set("Content-Type", "application/json")
  44527. c.urlParams_.Set("alt", alt)
  44528. c.urlParams_.Set("prettyPrint", "false")
  44529. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44530. urls += "?" + c.urlParams_.Encode()
  44531. req, err := http.NewRequest("PATCH", urls, body)
  44532. if err != nil {
  44533. return nil, err
  44534. }
  44535. req.Header = reqHeaders
  44536. googleapi.Expand(req.URL, map[string]string{
  44537. "profileId": strconv.FormatInt(c.profileId, 10),
  44538. })
  44539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44540. }
  44541. // Do executes the "dfareporting.targetingTemplates.patch" call.
  44542. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44543. // non-2xx status code is an error. Response headers are in either
  44544. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44545. // returned at all) in error.(*googleapi.Error).Header. Use
  44546. // googleapi.IsNotModified to check whether the returned error was
  44547. // because http.StatusNotModified was returned.
  44548. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44549. gensupport.SetOptions(c.urlParams_, opts...)
  44550. res, err := c.doRequest("json")
  44551. if res != nil && res.StatusCode == http.StatusNotModified {
  44552. if res.Body != nil {
  44553. res.Body.Close()
  44554. }
  44555. return nil, &googleapi.Error{
  44556. Code: res.StatusCode,
  44557. Header: res.Header,
  44558. }
  44559. }
  44560. if err != nil {
  44561. return nil, err
  44562. }
  44563. defer googleapi.CloseBody(res)
  44564. if err := googleapi.CheckResponse(res); err != nil {
  44565. return nil, err
  44566. }
  44567. ret := &TargetingTemplate{
  44568. ServerResponse: googleapi.ServerResponse{
  44569. Header: res.Header,
  44570. HTTPStatusCode: res.StatusCode,
  44571. },
  44572. }
  44573. target := &ret
  44574. if err := gensupport.DecodeResponse(target, res); err != nil {
  44575. return nil, err
  44576. }
  44577. return ret, nil
  44578. // {
  44579. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  44580. // "httpMethod": "PATCH",
  44581. // "id": "dfareporting.targetingTemplates.patch",
  44582. // "parameterOrder": [
  44583. // "profileId",
  44584. // "id"
  44585. // ],
  44586. // "parameters": {
  44587. // "id": {
  44588. // "description": "Targeting template ID.",
  44589. // "format": "int64",
  44590. // "location": "query",
  44591. // "required": true,
  44592. // "type": "string"
  44593. // },
  44594. // "profileId": {
  44595. // "description": "User profile ID associated with this request.",
  44596. // "format": "int64",
  44597. // "location": "path",
  44598. // "required": true,
  44599. // "type": "string"
  44600. // }
  44601. // },
  44602. // "path": "userprofiles/{profileId}/targetingTemplates",
  44603. // "request": {
  44604. // "$ref": "TargetingTemplate"
  44605. // },
  44606. // "response": {
  44607. // "$ref": "TargetingTemplate"
  44608. // },
  44609. // "scopes": [
  44610. // "https://www.googleapis.com/auth/dfatrafficking"
  44611. // ]
  44612. // }
  44613. }
  44614. // method id "dfareporting.targetingTemplates.update":
  44615. type TargetingTemplatesUpdateCall struct {
  44616. s *Service
  44617. profileId int64
  44618. targetingtemplate *TargetingTemplate
  44619. urlParams_ gensupport.URLParams
  44620. ctx_ context.Context
  44621. header_ http.Header
  44622. }
  44623. // Update: Updates an existing targeting template.
  44624. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  44625. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44626. c.profileId = profileId
  44627. c.targetingtemplate = targetingtemplate
  44628. return c
  44629. }
  44630. // Fields allows partial responses to be retrieved. See
  44631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44632. // for more information.
  44633. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  44634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44635. return c
  44636. }
  44637. // Context sets the context to be used in this call's Do method. Any
  44638. // pending HTTP request will be aborted if the provided context is
  44639. // canceled.
  44640. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  44641. c.ctx_ = ctx
  44642. return c
  44643. }
  44644. // Header returns an http.Header that can be modified by the caller to
  44645. // add HTTP headers to the request.
  44646. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  44647. if c.header_ == nil {
  44648. c.header_ = make(http.Header)
  44649. }
  44650. return c.header_
  44651. }
  44652. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  44653. reqHeaders := make(http.Header)
  44654. for k, v := range c.header_ {
  44655. reqHeaders[k] = v
  44656. }
  44657. reqHeaders.Set("User-Agent", c.s.userAgent())
  44658. var body io.Reader = nil
  44659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44660. if err != nil {
  44661. return nil, err
  44662. }
  44663. reqHeaders.Set("Content-Type", "application/json")
  44664. c.urlParams_.Set("alt", alt)
  44665. c.urlParams_.Set("prettyPrint", "false")
  44666. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44667. urls += "?" + c.urlParams_.Encode()
  44668. req, err := http.NewRequest("PUT", urls, body)
  44669. if err != nil {
  44670. return nil, err
  44671. }
  44672. req.Header = reqHeaders
  44673. googleapi.Expand(req.URL, map[string]string{
  44674. "profileId": strconv.FormatInt(c.profileId, 10),
  44675. })
  44676. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44677. }
  44678. // Do executes the "dfareporting.targetingTemplates.update" call.
  44679. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44680. // non-2xx status code is an error. Response headers are in either
  44681. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44682. // returned at all) in error.(*googleapi.Error).Header. Use
  44683. // googleapi.IsNotModified to check whether the returned error was
  44684. // because http.StatusNotModified was returned.
  44685. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44686. gensupport.SetOptions(c.urlParams_, opts...)
  44687. res, err := c.doRequest("json")
  44688. if res != nil && res.StatusCode == http.StatusNotModified {
  44689. if res.Body != nil {
  44690. res.Body.Close()
  44691. }
  44692. return nil, &googleapi.Error{
  44693. Code: res.StatusCode,
  44694. Header: res.Header,
  44695. }
  44696. }
  44697. if err != nil {
  44698. return nil, err
  44699. }
  44700. defer googleapi.CloseBody(res)
  44701. if err := googleapi.CheckResponse(res); err != nil {
  44702. return nil, err
  44703. }
  44704. ret := &TargetingTemplate{
  44705. ServerResponse: googleapi.ServerResponse{
  44706. Header: res.Header,
  44707. HTTPStatusCode: res.StatusCode,
  44708. },
  44709. }
  44710. target := &ret
  44711. if err := gensupport.DecodeResponse(target, res); err != nil {
  44712. return nil, err
  44713. }
  44714. return ret, nil
  44715. // {
  44716. // "description": "Updates an existing targeting template.",
  44717. // "httpMethod": "PUT",
  44718. // "id": "dfareporting.targetingTemplates.update",
  44719. // "parameterOrder": [
  44720. // "profileId"
  44721. // ],
  44722. // "parameters": {
  44723. // "profileId": {
  44724. // "description": "User profile ID associated with this request.",
  44725. // "format": "int64",
  44726. // "location": "path",
  44727. // "required": true,
  44728. // "type": "string"
  44729. // }
  44730. // },
  44731. // "path": "userprofiles/{profileId}/targetingTemplates",
  44732. // "request": {
  44733. // "$ref": "TargetingTemplate"
  44734. // },
  44735. // "response": {
  44736. // "$ref": "TargetingTemplate"
  44737. // },
  44738. // "scopes": [
  44739. // "https://www.googleapis.com/auth/dfatrafficking"
  44740. // ]
  44741. // }
  44742. }
  44743. // method id "dfareporting.userProfiles.get":
  44744. type UserProfilesGetCall struct {
  44745. s *Service
  44746. profileId int64
  44747. urlParams_ gensupport.URLParams
  44748. ifNoneMatch_ string
  44749. ctx_ context.Context
  44750. header_ http.Header
  44751. }
  44752. // Get: Gets one user profile by ID.
  44753. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  44754. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44755. c.profileId = profileId
  44756. return c
  44757. }
  44758. // Fields allows partial responses to be retrieved. See
  44759. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44760. // for more information.
  44761. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  44762. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44763. return c
  44764. }
  44765. // IfNoneMatch sets the optional parameter which makes the operation
  44766. // fail if the object's ETag matches the given value. This is useful for
  44767. // getting updates only after the object has changed since the last
  44768. // request. Use googleapi.IsNotModified to check whether the response
  44769. // error from Do is the result of In-None-Match.
  44770. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  44771. c.ifNoneMatch_ = entityTag
  44772. return c
  44773. }
  44774. // Context sets the context to be used in this call's Do method. Any
  44775. // pending HTTP request will be aborted if the provided context is
  44776. // canceled.
  44777. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  44778. c.ctx_ = ctx
  44779. return c
  44780. }
  44781. // Header returns an http.Header that can be modified by the caller to
  44782. // add HTTP headers to the request.
  44783. func (c *UserProfilesGetCall) Header() http.Header {
  44784. if c.header_ == nil {
  44785. c.header_ = make(http.Header)
  44786. }
  44787. return c.header_
  44788. }
  44789. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  44790. reqHeaders := make(http.Header)
  44791. for k, v := range c.header_ {
  44792. reqHeaders[k] = v
  44793. }
  44794. reqHeaders.Set("User-Agent", c.s.userAgent())
  44795. if c.ifNoneMatch_ != "" {
  44796. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44797. }
  44798. var body io.Reader = nil
  44799. c.urlParams_.Set("alt", alt)
  44800. c.urlParams_.Set("prettyPrint", "false")
  44801. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  44802. urls += "?" + c.urlParams_.Encode()
  44803. req, err := http.NewRequest("GET", urls, body)
  44804. if err != nil {
  44805. return nil, err
  44806. }
  44807. req.Header = reqHeaders
  44808. googleapi.Expand(req.URL, map[string]string{
  44809. "profileId": strconv.FormatInt(c.profileId, 10),
  44810. })
  44811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44812. }
  44813. // Do executes the "dfareporting.userProfiles.get" call.
  44814. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  44815. // status code is an error. Response headers are in either
  44816. // *UserProfile.ServerResponse.Header or (if a response was returned at
  44817. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44818. // to check whether the returned error was because
  44819. // http.StatusNotModified was returned.
  44820. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  44821. gensupport.SetOptions(c.urlParams_, opts...)
  44822. res, err := c.doRequest("json")
  44823. if res != nil && res.StatusCode == http.StatusNotModified {
  44824. if res.Body != nil {
  44825. res.Body.Close()
  44826. }
  44827. return nil, &googleapi.Error{
  44828. Code: res.StatusCode,
  44829. Header: res.Header,
  44830. }
  44831. }
  44832. if err != nil {
  44833. return nil, err
  44834. }
  44835. defer googleapi.CloseBody(res)
  44836. if err := googleapi.CheckResponse(res); err != nil {
  44837. return nil, err
  44838. }
  44839. ret := &UserProfile{
  44840. ServerResponse: googleapi.ServerResponse{
  44841. Header: res.Header,
  44842. HTTPStatusCode: res.StatusCode,
  44843. },
  44844. }
  44845. target := &ret
  44846. if err := gensupport.DecodeResponse(target, res); err != nil {
  44847. return nil, err
  44848. }
  44849. return ret, nil
  44850. // {
  44851. // "description": "Gets one user profile by ID.",
  44852. // "httpMethod": "GET",
  44853. // "id": "dfareporting.userProfiles.get",
  44854. // "parameterOrder": [
  44855. // "profileId"
  44856. // ],
  44857. // "parameters": {
  44858. // "profileId": {
  44859. // "description": "The user profile ID.",
  44860. // "format": "int64",
  44861. // "location": "path",
  44862. // "required": true,
  44863. // "type": "string"
  44864. // }
  44865. // },
  44866. // "path": "userprofiles/{profileId}",
  44867. // "response": {
  44868. // "$ref": "UserProfile"
  44869. // },
  44870. // "scopes": [
  44871. // "https://www.googleapis.com/auth/dfareporting",
  44872. // "https://www.googleapis.com/auth/dfatrafficking"
  44873. // ]
  44874. // }
  44875. }
  44876. // method id "dfareporting.userProfiles.list":
  44877. type UserProfilesListCall struct {
  44878. s *Service
  44879. urlParams_ gensupport.URLParams
  44880. ifNoneMatch_ string
  44881. ctx_ context.Context
  44882. header_ http.Header
  44883. }
  44884. // List: Retrieves list of user profiles for a user.
  44885. func (r *UserProfilesService) List() *UserProfilesListCall {
  44886. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44887. return c
  44888. }
  44889. // Fields allows partial responses to be retrieved. See
  44890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44891. // for more information.
  44892. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  44893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44894. return c
  44895. }
  44896. // IfNoneMatch sets the optional parameter which makes the operation
  44897. // fail if the object's ETag matches the given value. This is useful for
  44898. // getting updates only after the object has changed since the last
  44899. // request. Use googleapi.IsNotModified to check whether the response
  44900. // error from Do is the result of In-None-Match.
  44901. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  44902. c.ifNoneMatch_ = entityTag
  44903. return c
  44904. }
  44905. // Context sets the context to be used in this call's Do method. Any
  44906. // pending HTTP request will be aborted if the provided context is
  44907. // canceled.
  44908. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  44909. c.ctx_ = ctx
  44910. return c
  44911. }
  44912. // Header returns an http.Header that can be modified by the caller to
  44913. // add HTTP headers to the request.
  44914. func (c *UserProfilesListCall) Header() http.Header {
  44915. if c.header_ == nil {
  44916. c.header_ = make(http.Header)
  44917. }
  44918. return c.header_
  44919. }
  44920. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  44921. reqHeaders := make(http.Header)
  44922. for k, v := range c.header_ {
  44923. reqHeaders[k] = v
  44924. }
  44925. reqHeaders.Set("User-Agent", c.s.userAgent())
  44926. if c.ifNoneMatch_ != "" {
  44927. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44928. }
  44929. var body io.Reader = nil
  44930. c.urlParams_.Set("alt", alt)
  44931. c.urlParams_.Set("prettyPrint", "false")
  44932. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  44933. urls += "?" + c.urlParams_.Encode()
  44934. req, err := http.NewRequest("GET", urls, body)
  44935. if err != nil {
  44936. return nil, err
  44937. }
  44938. req.Header = reqHeaders
  44939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44940. }
  44941. // Do executes the "dfareporting.userProfiles.list" call.
  44942. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  44943. // status code is an error. Response headers are in either
  44944. // *UserProfileList.ServerResponse.Header or (if a response was returned
  44945. // at all) in error.(*googleapi.Error).Header. Use
  44946. // googleapi.IsNotModified to check whether the returned error was
  44947. // because http.StatusNotModified was returned.
  44948. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  44949. gensupport.SetOptions(c.urlParams_, opts...)
  44950. res, err := c.doRequest("json")
  44951. if res != nil && res.StatusCode == http.StatusNotModified {
  44952. if res.Body != nil {
  44953. res.Body.Close()
  44954. }
  44955. return nil, &googleapi.Error{
  44956. Code: res.StatusCode,
  44957. Header: res.Header,
  44958. }
  44959. }
  44960. if err != nil {
  44961. return nil, err
  44962. }
  44963. defer googleapi.CloseBody(res)
  44964. if err := googleapi.CheckResponse(res); err != nil {
  44965. return nil, err
  44966. }
  44967. ret := &UserProfileList{
  44968. ServerResponse: googleapi.ServerResponse{
  44969. Header: res.Header,
  44970. HTTPStatusCode: res.StatusCode,
  44971. },
  44972. }
  44973. target := &ret
  44974. if err := gensupport.DecodeResponse(target, res); err != nil {
  44975. return nil, err
  44976. }
  44977. return ret, nil
  44978. // {
  44979. // "description": "Retrieves list of user profiles for a user.",
  44980. // "httpMethod": "GET",
  44981. // "id": "dfareporting.userProfiles.list",
  44982. // "path": "userprofiles",
  44983. // "response": {
  44984. // "$ref": "UserProfileList"
  44985. // },
  44986. // "scopes": [
  44987. // "https://www.googleapis.com/auth/dfareporting",
  44988. // "https://www.googleapis.com/auth/dfatrafficking"
  44989. // ]
  44990. // }
  44991. }
  44992. // method id "dfareporting.userRolePermissionGroups.get":
  44993. type UserRolePermissionGroupsGetCall struct {
  44994. s *Service
  44995. profileId int64
  44996. id int64
  44997. urlParams_ gensupport.URLParams
  44998. ifNoneMatch_ string
  44999. ctx_ context.Context
  45000. header_ http.Header
  45001. }
  45002. // Get: Gets one user role permission group by ID.
  45003. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  45004. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45005. c.profileId = profileId
  45006. c.id = id
  45007. return c
  45008. }
  45009. // Fields allows partial responses to be retrieved. See
  45010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45011. // for more information.
  45012. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  45013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45014. return c
  45015. }
  45016. // IfNoneMatch sets the optional parameter which makes the operation
  45017. // fail if the object's ETag matches the given value. This is useful for
  45018. // getting updates only after the object has changed since the last
  45019. // request. Use googleapi.IsNotModified to check whether the response
  45020. // error from Do is the result of In-None-Match.
  45021. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  45022. c.ifNoneMatch_ = entityTag
  45023. return c
  45024. }
  45025. // Context sets the context to be used in this call's Do method. Any
  45026. // pending HTTP request will be aborted if the provided context is
  45027. // canceled.
  45028. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  45029. c.ctx_ = ctx
  45030. return c
  45031. }
  45032. // Header returns an http.Header that can be modified by the caller to
  45033. // add HTTP headers to the request.
  45034. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  45035. if c.header_ == nil {
  45036. c.header_ = make(http.Header)
  45037. }
  45038. return c.header_
  45039. }
  45040. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  45041. reqHeaders := make(http.Header)
  45042. for k, v := range c.header_ {
  45043. reqHeaders[k] = v
  45044. }
  45045. reqHeaders.Set("User-Agent", c.s.userAgent())
  45046. if c.ifNoneMatch_ != "" {
  45047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45048. }
  45049. var body io.Reader = nil
  45050. c.urlParams_.Set("alt", alt)
  45051. c.urlParams_.Set("prettyPrint", "false")
  45052. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  45053. urls += "?" + c.urlParams_.Encode()
  45054. req, err := http.NewRequest("GET", urls, body)
  45055. if err != nil {
  45056. return nil, err
  45057. }
  45058. req.Header = reqHeaders
  45059. googleapi.Expand(req.URL, map[string]string{
  45060. "profileId": strconv.FormatInt(c.profileId, 10),
  45061. "id": strconv.FormatInt(c.id, 10),
  45062. })
  45063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45064. }
  45065. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  45066. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  45067. // non-2xx status code is an error. Response headers are in either
  45068. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  45069. // returned at all) in error.(*googleapi.Error).Header. Use
  45070. // googleapi.IsNotModified to check whether the returned error was
  45071. // because http.StatusNotModified was returned.
  45072. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  45073. gensupport.SetOptions(c.urlParams_, opts...)
  45074. res, err := c.doRequest("json")
  45075. if res != nil && res.StatusCode == http.StatusNotModified {
  45076. if res.Body != nil {
  45077. res.Body.Close()
  45078. }
  45079. return nil, &googleapi.Error{
  45080. Code: res.StatusCode,
  45081. Header: res.Header,
  45082. }
  45083. }
  45084. if err != nil {
  45085. return nil, err
  45086. }
  45087. defer googleapi.CloseBody(res)
  45088. if err := googleapi.CheckResponse(res); err != nil {
  45089. return nil, err
  45090. }
  45091. ret := &UserRolePermissionGroup{
  45092. ServerResponse: googleapi.ServerResponse{
  45093. Header: res.Header,
  45094. HTTPStatusCode: res.StatusCode,
  45095. },
  45096. }
  45097. target := &ret
  45098. if err := gensupport.DecodeResponse(target, res); err != nil {
  45099. return nil, err
  45100. }
  45101. return ret, nil
  45102. // {
  45103. // "description": "Gets one user role permission group by ID.",
  45104. // "httpMethod": "GET",
  45105. // "id": "dfareporting.userRolePermissionGroups.get",
  45106. // "parameterOrder": [
  45107. // "profileId",
  45108. // "id"
  45109. // ],
  45110. // "parameters": {
  45111. // "id": {
  45112. // "description": "User role permission group ID.",
  45113. // "format": "int64",
  45114. // "location": "path",
  45115. // "required": true,
  45116. // "type": "string"
  45117. // },
  45118. // "profileId": {
  45119. // "description": "User profile ID associated with this request.",
  45120. // "format": "int64",
  45121. // "location": "path",
  45122. // "required": true,
  45123. // "type": "string"
  45124. // }
  45125. // },
  45126. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  45127. // "response": {
  45128. // "$ref": "UserRolePermissionGroup"
  45129. // },
  45130. // "scopes": [
  45131. // "https://www.googleapis.com/auth/dfatrafficking"
  45132. // ]
  45133. // }
  45134. }
  45135. // method id "dfareporting.userRolePermissionGroups.list":
  45136. type UserRolePermissionGroupsListCall struct {
  45137. s *Service
  45138. profileId int64
  45139. urlParams_ gensupport.URLParams
  45140. ifNoneMatch_ string
  45141. ctx_ context.Context
  45142. header_ http.Header
  45143. }
  45144. // List: Gets a list of all supported user role permission groups.
  45145. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  45146. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45147. c.profileId = profileId
  45148. return c
  45149. }
  45150. // Fields allows partial responses to be retrieved. See
  45151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45152. // for more information.
  45153. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  45154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45155. return c
  45156. }
  45157. // IfNoneMatch sets the optional parameter which makes the operation
  45158. // fail if the object's ETag matches the given value. This is useful for
  45159. // getting updates only after the object has changed since the last
  45160. // request. Use googleapi.IsNotModified to check whether the response
  45161. // error from Do is the result of In-None-Match.
  45162. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  45163. c.ifNoneMatch_ = entityTag
  45164. return c
  45165. }
  45166. // Context sets the context to be used in this call's Do method. Any
  45167. // pending HTTP request will be aborted if the provided context is
  45168. // canceled.
  45169. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  45170. c.ctx_ = ctx
  45171. return c
  45172. }
  45173. // Header returns an http.Header that can be modified by the caller to
  45174. // add HTTP headers to the request.
  45175. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  45176. if c.header_ == nil {
  45177. c.header_ = make(http.Header)
  45178. }
  45179. return c.header_
  45180. }
  45181. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  45182. reqHeaders := make(http.Header)
  45183. for k, v := range c.header_ {
  45184. reqHeaders[k] = v
  45185. }
  45186. reqHeaders.Set("User-Agent", c.s.userAgent())
  45187. if c.ifNoneMatch_ != "" {
  45188. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45189. }
  45190. var body io.Reader = nil
  45191. c.urlParams_.Set("alt", alt)
  45192. c.urlParams_.Set("prettyPrint", "false")
  45193. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  45194. urls += "?" + c.urlParams_.Encode()
  45195. req, err := http.NewRequest("GET", urls, body)
  45196. if err != nil {
  45197. return nil, err
  45198. }
  45199. req.Header = reqHeaders
  45200. googleapi.Expand(req.URL, map[string]string{
  45201. "profileId": strconv.FormatInt(c.profileId, 10),
  45202. })
  45203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45204. }
  45205. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  45206. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  45207. // non-nil. Any non-2xx status code is an error. Response headers are in
  45208. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  45209. // (if a response was returned at all) in
  45210. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  45211. // whether the returned error was because http.StatusNotModified was
  45212. // returned.
  45213. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  45214. gensupport.SetOptions(c.urlParams_, opts...)
  45215. res, err := c.doRequest("json")
  45216. if res != nil && res.StatusCode == http.StatusNotModified {
  45217. if res.Body != nil {
  45218. res.Body.Close()
  45219. }
  45220. return nil, &googleapi.Error{
  45221. Code: res.StatusCode,
  45222. Header: res.Header,
  45223. }
  45224. }
  45225. if err != nil {
  45226. return nil, err
  45227. }
  45228. defer googleapi.CloseBody(res)
  45229. if err := googleapi.CheckResponse(res); err != nil {
  45230. return nil, err
  45231. }
  45232. ret := &UserRolePermissionGroupsListResponse{
  45233. ServerResponse: googleapi.ServerResponse{
  45234. Header: res.Header,
  45235. HTTPStatusCode: res.StatusCode,
  45236. },
  45237. }
  45238. target := &ret
  45239. if err := gensupport.DecodeResponse(target, res); err != nil {
  45240. return nil, err
  45241. }
  45242. return ret, nil
  45243. // {
  45244. // "description": "Gets a list of all supported user role permission groups.",
  45245. // "httpMethod": "GET",
  45246. // "id": "dfareporting.userRolePermissionGroups.list",
  45247. // "parameterOrder": [
  45248. // "profileId"
  45249. // ],
  45250. // "parameters": {
  45251. // "profileId": {
  45252. // "description": "User profile ID associated with this request.",
  45253. // "format": "int64",
  45254. // "location": "path",
  45255. // "required": true,
  45256. // "type": "string"
  45257. // }
  45258. // },
  45259. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  45260. // "response": {
  45261. // "$ref": "UserRolePermissionGroupsListResponse"
  45262. // },
  45263. // "scopes": [
  45264. // "https://www.googleapis.com/auth/dfatrafficking"
  45265. // ]
  45266. // }
  45267. }
  45268. // method id "dfareporting.userRolePermissions.get":
  45269. type UserRolePermissionsGetCall struct {
  45270. s *Service
  45271. profileId int64
  45272. id int64
  45273. urlParams_ gensupport.URLParams
  45274. ifNoneMatch_ string
  45275. ctx_ context.Context
  45276. header_ http.Header
  45277. }
  45278. // Get: Gets one user role permission by ID.
  45279. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  45280. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45281. c.profileId = profileId
  45282. c.id = id
  45283. return c
  45284. }
  45285. // Fields allows partial responses to be retrieved. See
  45286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45287. // for more information.
  45288. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  45289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45290. return c
  45291. }
  45292. // IfNoneMatch sets the optional parameter which makes the operation
  45293. // fail if the object's ETag matches the given value. This is useful for
  45294. // getting updates only after the object has changed since the last
  45295. // request. Use googleapi.IsNotModified to check whether the response
  45296. // error from Do is the result of In-None-Match.
  45297. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  45298. c.ifNoneMatch_ = entityTag
  45299. return c
  45300. }
  45301. // Context sets the context to be used in this call's Do method. Any
  45302. // pending HTTP request will be aborted if the provided context is
  45303. // canceled.
  45304. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  45305. c.ctx_ = ctx
  45306. return c
  45307. }
  45308. // Header returns an http.Header that can be modified by the caller to
  45309. // add HTTP headers to the request.
  45310. func (c *UserRolePermissionsGetCall) Header() http.Header {
  45311. if c.header_ == nil {
  45312. c.header_ = make(http.Header)
  45313. }
  45314. return c.header_
  45315. }
  45316. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  45317. reqHeaders := make(http.Header)
  45318. for k, v := range c.header_ {
  45319. reqHeaders[k] = v
  45320. }
  45321. reqHeaders.Set("User-Agent", c.s.userAgent())
  45322. if c.ifNoneMatch_ != "" {
  45323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45324. }
  45325. var body io.Reader = nil
  45326. c.urlParams_.Set("alt", alt)
  45327. c.urlParams_.Set("prettyPrint", "false")
  45328. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  45329. urls += "?" + c.urlParams_.Encode()
  45330. req, err := http.NewRequest("GET", urls, body)
  45331. if err != nil {
  45332. return nil, err
  45333. }
  45334. req.Header = reqHeaders
  45335. googleapi.Expand(req.URL, map[string]string{
  45336. "profileId": strconv.FormatInt(c.profileId, 10),
  45337. "id": strconv.FormatInt(c.id, 10),
  45338. })
  45339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45340. }
  45341. // Do executes the "dfareporting.userRolePermissions.get" call.
  45342. // Exactly one of *UserRolePermission or error will be non-nil. Any
  45343. // non-2xx status code is an error. Response headers are in either
  45344. // *UserRolePermission.ServerResponse.Header or (if a response was
  45345. // returned at all) in error.(*googleapi.Error).Header. Use
  45346. // googleapi.IsNotModified to check whether the returned error was
  45347. // because http.StatusNotModified was returned.
  45348. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  45349. gensupport.SetOptions(c.urlParams_, opts...)
  45350. res, err := c.doRequest("json")
  45351. if res != nil && res.StatusCode == http.StatusNotModified {
  45352. if res.Body != nil {
  45353. res.Body.Close()
  45354. }
  45355. return nil, &googleapi.Error{
  45356. Code: res.StatusCode,
  45357. Header: res.Header,
  45358. }
  45359. }
  45360. if err != nil {
  45361. return nil, err
  45362. }
  45363. defer googleapi.CloseBody(res)
  45364. if err := googleapi.CheckResponse(res); err != nil {
  45365. return nil, err
  45366. }
  45367. ret := &UserRolePermission{
  45368. ServerResponse: googleapi.ServerResponse{
  45369. Header: res.Header,
  45370. HTTPStatusCode: res.StatusCode,
  45371. },
  45372. }
  45373. target := &ret
  45374. if err := gensupport.DecodeResponse(target, res); err != nil {
  45375. return nil, err
  45376. }
  45377. return ret, nil
  45378. // {
  45379. // "description": "Gets one user role permission by ID.",
  45380. // "httpMethod": "GET",
  45381. // "id": "dfareporting.userRolePermissions.get",
  45382. // "parameterOrder": [
  45383. // "profileId",
  45384. // "id"
  45385. // ],
  45386. // "parameters": {
  45387. // "id": {
  45388. // "description": "User role permission ID.",
  45389. // "format": "int64",
  45390. // "location": "path",
  45391. // "required": true,
  45392. // "type": "string"
  45393. // },
  45394. // "profileId": {
  45395. // "description": "User profile ID associated with this request.",
  45396. // "format": "int64",
  45397. // "location": "path",
  45398. // "required": true,
  45399. // "type": "string"
  45400. // }
  45401. // },
  45402. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  45403. // "response": {
  45404. // "$ref": "UserRolePermission"
  45405. // },
  45406. // "scopes": [
  45407. // "https://www.googleapis.com/auth/dfatrafficking"
  45408. // ]
  45409. // }
  45410. }
  45411. // method id "dfareporting.userRolePermissions.list":
  45412. type UserRolePermissionsListCall struct {
  45413. s *Service
  45414. profileId int64
  45415. urlParams_ gensupport.URLParams
  45416. ifNoneMatch_ string
  45417. ctx_ context.Context
  45418. header_ http.Header
  45419. }
  45420. // List: Gets a list of user role permissions, possibly filtered.
  45421. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  45422. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45423. c.profileId = profileId
  45424. return c
  45425. }
  45426. // Ids sets the optional parameter "ids": Select only user role
  45427. // permissions with these IDs.
  45428. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  45429. var ids_ []string
  45430. for _, v := range ids {
  45431. ids_ = append(ids_, fmt.Sprint(v))
  45432. }
  45433. c.urlParams_.SetMulti("ids", ids_)
  45434. return c
  45435. }
  45436. // Fields allows partial responses to be retrieved. See
  45437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45438. // for more information.
  45439. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  45440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45441. return c
  45442. }
  45443. // IfNoneMatch sets the optional parameter which makes the operation
  45444. // fail if the object's ETag matches the given value. This is useful for
  45445. // getting updates only after the object has changed since the last
  45446. // request. Use googleapi.IsNotModified to check whether the response
  45447. // error from Do is the result of In-None-Match.
  45448. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  45449. c.ifNoneMatch_ = entityTag
  45450. return c
  45451. }
  45452. // Context sets the context to be used in this call's Do method. Any
  45453. // pending HTTP request will be aborted if the provided context is
  45454. // canceled.
  45455. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  45456. c.ctx_ = ctx
  45457. return c
  45458. }
  45459. // Header returns an http.Header that can be modified by the caller to
  45460. // add HTTP headers to the request.
  45461. func (c *UserRolePermissionsListCall) Header() http.Header {
  45462. if c.header_ == nil {
  45463. c.header_ = make(http.Header)
  45464. }
  45465. return c.header_
  45466. }
  45467. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  45468. reqHeaders := make(http.Header)
  45469. for k, v := range c.header_ {
  45470. reqHeaders[k] = v
  45471. }
  45472. reqHeaders.Set("User-Agent", c.s.userAgent())
  45473. if c.ifNoneMatch_ != "" {
  45474. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45475. }
  45476. var body io.Reader = nil
  45477. c.urlParams_.Set("alt", alt)
  45478. c.urlParams_.Set("prettyPrint", "false")
  45479. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  45480. urls += "?" + c.urlParams_.Encode()
  45481. req, err := http.NewRequest("GET", urls, body)
  45482. if err != nil {
  45483. return nil, err
  45484. }
  45485. req.Header = reqHeaders
  45486. googleapi.Expand(req.URL, map[string]string{
  45487. "profileId": strconv.FormatInt(c.profileId, 10),
  45488. })
  45489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45490. }
  45491. // Do executes the "dfareporting.userRolePermissions.list" call.
  45492. // Exactly one of *UserRolePermissionsListResponse or error will be
  45493. // non-nil. Any non-2xx status code is an error. Response headers are in
  45494. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  45495. // a response was returned at all) in error.(*googleapi.Error).Header.
  45496. // Use googleapi.IsNotModified to check whether the returned error was
  45497. // because http.StatusNotModified was returned.
  45498. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  45499. gensupport.SetOptions(c.urlParams_, opts...)
  45500. res, err := c.doRequest("json")
  45501. if res != nil && res.StatusCode == http.StatusNotModified {
  45502. if res.Body != nil {
  45503. res.Body.Close()
  45504. }
  45505. return nil, &googleapi.Error{
  45506. Code: res.StatusCode,
  45507. Header: res.Header,
  45508. }
  45509. }
  45510. if err != nil {
  45511. return nil, err
  45512. }
  45513. defer googleapi.CloseBody(res)
  45514. if err := googleapi.CheckResponse(res); err != nil {
  45515. return nil, err
  45516. }
  45517. ret := &UserRolePermissionsListResponse{
  45518. ServerResponse: googleapi.ServerResponse{
  45519. Header: res.Header,
  45520. HTTPStatusCode: res.StatusCode,
  45521. },
  45522. }
  45523. target := &ret
  45524. if err := gensupport.DecodeResponse(target, res); err != nil {
  45525. return nil, err
  45526. }
  45527. return ret, nil
  45528. // {
  45529. // "description": "Gets a list of user role permissions, possibly filtered.",
  45530. // "httpMethod": "GET",
  45531. // "id": "dfareporting.userRolePermissions.list",
  45532. // "parameterOrder": [
  45533. // "profileId"
  45534. // ],
  45535. // "parameters": {
  45536. // "ids": {
  45537. // "description": "Select only user role permissions with these IDs.",
  45538. // "format": "int64",
  45539. // "location": "query",
  45540. // "repeated": true,
  45541. // "type": "string"
  45542. // },
  45543. // "profileId": {
  45544. // "description": "User profile ID associated with this request.",
  45545. // "format": "int64",
  45546. // "location": "path",
  45547. // "required": true,
  45548. // "type": "string"
  45549. // }
  45550. // },
  45551. // "path": "userprofiles/{profileId}/userRolePermissions",
  45552. // "response": {
  45553. // "$ref": "UserRolePermissionsListResponse"
  45554. // },
  45555. // "scopes": [
  45556. // "https://www.googleapis.com/auth/dfatrafficking"
  45557. // ]
  45558. // }
  45559. }
  45560. // method id "dfareporting.userRoles.delete":
  45561. type UserRolesDeleteCall struct {
  45562. s *Service
  45563. profileId int64
  45564. id int64
  45565. urlParams_ gensupport.URLParams
  45566. ctx_ context.Context
  45567. header_ http.Header
  45568. }
  45569. // Delete: Deletes an existing user role.
  45570. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  45571. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45572. c.profileId = profileId
  45573. c.id = id
  45574. return c
  45575. }
  45576. // Fields allows partial responses to be retrieved. See
  45577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45578. // for more information.
  45579. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  45580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45581. return c
  45582. }
  45583. // Context sets the context to be used in this call's Do method. Any
  45584. // pending HTTP request will be aborted if the provided context is
  45585. // canceled.
  45586. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  45587. c.ctx_ = ctx
  45588. return c
  45589. }
  45590. // Header returns an http.Header that can be modified by the caller to
  45591. // add HTTP headers to the request.
  45592. func (c *UserRolesDeleteCall) Header() http.Header {
  45593. if c.header_ == nil {
  45594. c.header_ = make(http.Header)
  45595. }
  45596. return c.header_
  45597. }
  45598. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  45599. reqHeaders := make(http.Header)
  45600. for k, v := range c.header_ {
  45601. reqHeaders[k] = v
  45602. }
  45603. reqHeaders.Set("User-Agent", c.s.userAgent())
  45604. var body io.Reader = nil
  45605. c.urlParams_.Set("alt", alt)
  45606. c.urlParams_.Set("prettyPrint", "false")
  45607. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45608. urls += "?" + c.urlParams_.Encode()
  45609. req, err := http.NewRequest("DELETE", urls, body)
  45610. if err != nil {
  45611. return nil, err
  45612. }
  45613. req.Header = reqHeaders
  45614. googleapi.Expand(req.URL, map[string]string{
  45615. "profileId": strconv.FormatInt(c.profileId, 10),
  45616. "id": strconv.FormatInt(c.id, 10),
  45617. })
  45618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45619. }
  45620. // Do executes the "dfareporting.userRoles.delete" call.
  45621. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  45622. gensupport.SetOptions(c.urlParams_, opts...)
  45623. res, err := c.doRequest("json")
  45624. if err != nil {
  45625. return err
  45626. }
  45627. defer googleapi.CloseBody(res)
  45628. if err := googleapi.CheckResponse(res); err != nil {
  45629. return err
  45630. }
  45631. return nil
  45632. // {
  45633. // "description": "Deletes an existing user role.",
  45634. // "httpMethod": "DELETE",
  45635. // "id": "dfareporting.userRoles.delete",
  45636. // "parameterOrder": [
  45637. // "profileId",
  45638. // "id"
  45639. // ],
  45640. // "parameters": {
  45641. // "id": {
  45642. // "description": "User role ID.",
  45643. // "format": "int64",
  45644. // "location": "path",
  45645. // "required": true,
  45646. // "type": "string"
  45647. // },
  45648. // "profileId": {
  45649. // "description": "User profile ID associated with this request.",
  45650. // "format": "int64",
  45651. // "location": "path",
  45652. // "required": true,
  45653. // "type": "string"
  45654. // }
  45655. // },
  45656. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45657. // "scopes": [
  45658. // "https://www.googleapis.com/auth/dfatrafficking"
  45659. // ]
  45660. // }
  45661. }
  45662. // method id "dfareporting.userRoles.get":
  45663. type UserRolesGetCall struct {
  45664. s *Service
  45665. profileId int64
  45666. id int64
  45667. urlParams_ gensupport.URLParams
  45668. ifNoneMatch_ string
  45669. ctx_ context.Context
  45670. header_ http.Header
  45671. }
  45672. // Get: Gets one user role by ID.
  45673. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  45674. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45675. c.profileId = profileId
  45676. c.id = id
  45677. return c
  45678. }
  45679. // Fields allows partial responses to be retrieved. See
  45680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45681. // for more information.
  45682. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  45683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45684. return c
  45685. }
  45686. // IfNoneMatch sets the optional parameter which makes the operation
  45687. // fail if the object's ETag matches the given value. This is useful for
  45688. // getting updates only after the object has changed since the last
  45689. // request. Use googleapi.IsNotModified to check whether the response
  45690. // error from Do is the result of In-None-Match.
  45691. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  45692. c.ifNoneMatch_ = entityTag
  45693. return c
  45694. }
  45695. // Context sets the context to be used in this call's Do method. Any
  45696. // pending HTTP request will be aborted if the provided context is
  45697. // canceled.
  45698. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  45699. c.ctx_ = ctx
  45700. return c
  45701. }
  45702. // Header returns an http.Header that can be modified by the caller to
  45703. // add HTTP headers to the request.
  45704. func (c *UserRolesGetCall) Header() http.Header {
  45705. if c.header_ == nil {
  45706. c.header_ = make(http.Header)
  45707. }
  45708. return c.header_
  45709. }
  45710. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  45711. reqHeaders := make(http.Header)
  45712. for k, v := range c.header_ {
  45713. reqHeaders[k] = v
  45714. }
  45715. reqHeaders.Set("User-Agent", c.s.userAgent())
  45716. if c.ifNoneMatch_ != "" {
  45717. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45718. }
  45719. var body io.Reader = nil
  45720. c.urlParams_.Set("alt", alt)
  45721. c.urlParams_.Set("prettyPrint", "false")
  45722. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45723. urls += "?" + c.urlParams_.Encode()
  45724. req, err := http.NewRequest("GET", urls, body)
  45725. if err != nil {
  45726. return nil, err
  45727. }
  45728. req.Header = reqHeaders
  45729. googleapi.Expand(req.URL, map[string]string{
  45730. "profileId": strconv.FormatInt(c.profileId, 10),
  45731. "id": strconv.FormatInt(c.id, 10),
  45732. })
  45733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45734. }
  45735. // Do executes the "dfareporting.userRoles.get" call.
  45736. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45737. // code is an error. Response headers are in either
  45738. // *UserRole.ServerResponse.Header or (if a response was returned at
  45739. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45740. // to check whether the returned error was because
  45741. // http.StatusNotModified was returned.
  45742. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45743. gensupport.SetOptions(c.urlParams_, opts...)
  45744. res, err := c.doRequest("json")
  45745. if res != nil && res.StatusCode == http.StatusNotModified {
  45746. if res.Body != nil {
  45747. res.Body.Close()
  45748. }
  45749. return nil, &googleapi.Error{
  45750. Code: res.StatusCode,
  45751. Header: res.Header,
  45752. }
  45753. }
  45754. if err != nil {
  45755. return nil, err
  45756. }
  45757. defer googleapi.CloseBody(res)
  45758. if err := googleapi.CheckResponse(res); err != nil {
  45759. return nil, err
  45760. }
  45761. ret := &UserRole{
  45762. ServerResponse: googleapi.ServerResponse{
  45763. Header: res.Header,
  45764. HTTPStatusCode: res.StatusCode,
  45765. },
  45766. }
  45767. target := &ret
  45768. if err := gensupport.DecodeResponse(target, res); err != nil {
  45769. return nil, err
  45770. }
  45771. return ret, nil
  45772. // {
  45773. // "description": "Gets one user role by ID.",
  45774. // "httpMethod": "GET",
  45775. // "id": "dfareporting.userRoles.get",
  45776. // "parameterOrder": [
  45777. // "profileId",
  45778. // "id"
  45779. // ],
  45780. // "parameters": {
  45781. // "id": {
  45782. // "description": "User role ID.",
  45783. // "format": "int64",
  45784. // "location": "path",
  45785. // "required": true,
  45786. // "type": "string"
  45787. // },
  45788. // "profileId": {
  45789. // "description": "User profile ID associated with this request.",
  45790. // "format": "int64",
  45791. // "location": "path",
  45792. // "required": true,
  45793. // "type": "string"
  45794. // }
  45795. // },
  45796. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45797. // "response": {
  45798. // "$ref": "UserRole"
  45799. // },
  45800. // "scopes": [
  45801. // "https://www.googleapis.com/auth/dfatrafficking"
  45802. // ]
  45803. // }
  45804. }
  45805. // method id "dfareporting.userRoles.insert":
  45806. type UserRolesInsertCall struct {
  45807. s *Service
  45808. profileId int64
  45809. userrole *UserRole
  45810. urlParams_ gensupport.URLParams
  45811. ctx_ context.Context
  45812. header_ http.Header
  45813. }
  45814. // Insert: Inserts a new user role.
  45815. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  45816. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45817. c.profileId = profileId
  45818. c.userrole = userrole
  45819. return c
  45820. }
  45821. // Fields allows partial responses to be retrieved. See
  45822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45823. // for more information.
  45824. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  45825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45826. return c
  45827. }
  45828. // Context sets the context to be used in this call's Do method. Any
  45829. // pending HTTP request will be aborted if the provided context is
  45830. // canceled.
  45831. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  45832. c.ctx_ = ctx
  45833. return c
  45834. }
  45835. // Header returns an http.Header that can be modified by the caller to
  45836. // add HTTP headers to the request.
  45837. func (c *UserRolesInsertCall) Header() http.Header {
  45838. if c.header_ == nil {
  45839. c.header_ = make(http.Header)
  45840. }
  45841. return c.header_
  45842. }
  45843. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  45844. reqHeaders := make(http.Header)
  45845. for k, v := range c.header_ {
  45846. reqHeaders[k] = v
  45847. }
  45848. reqHeaders.Set("User-Agent", c.s.userAgent())
  45849. var body io.Reader = nil
  45850. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45851. if err != nil {
  45852. return nil, err
  45853. }
  45854. reqHeaders.Set("Content-Type", "application/json")
  45855. c.urlParams_.Set("alt", alt)
  45856. c.urlParams_.Set("prettyPrint", "false")
  45857. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45858. urls += "?" + c.urlParams_.Encode()
  45859. req, err := http.NewRequest("POST", urls, body)
  45860. if err != nil {
  45861. return nil, err
  45862. }
  45863. req.Header = reqHeaders
  45864. googleapi.Expand(req.URL, map[string]string{
  45865. "profileId": strconv.FormatInt(c.profileId, 10),
  45866. })
  45867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45868. }
  45869. // Do executes the "dfareporting.userRoles.insert" call.
  45870. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45871. // code is an error. Response headers are in either
  45872. // *UserRole.ServerResponse.Header or (if a response was returned at
  45873. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45874. // to check whether the returned error was because
  45875. // http.StatusNotModified was returned.
  45876. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45877. gensupport.SetOptions(c.urlParams_, opts...)
  45878. res, err := c.doRequest("json")
  45879. if res != nil && res.StatusCode == http.StatusNotModified {
  45880. if res.Body != nil {
  45881. res.Body.Close()
  45882. }
  45883. return nil, &googleapi.Error{
  45884. Code: res.StatusCode,
  45885. Header: res.Header,
  45886. }
  45887. }
  45888. if err != nil {
  45889. return nil, err
  45890. }
  45891. defer googleapi.CloseBody(res)
  45892. if err := googleapi.CheckResponse(res); err != nil {
  45893. return nil, err
  45894. }
  45895. ret := &UserRole{
  45896. ServerResponse: googleapi.ServerResponse{
  45897. Header: res.Header,
  45898. HTTPStatusCode: res.StatusCode,
  45899. },
  45900. }
  45901. target := &ret
  45902. if err := gensupport.DecodeResponse(target, res); err != nil {
  45903. return nil, err
  45904. }
  45905. return ret, nil
  45906. // {
  45907. // "description": "Inserts a new user role.",
  45908. // "httpMethod": "POST",
  45909. // "id": "dfareporting.userRoles.insert",
  45910. // "parameterOrder": [
  45911. // "profileId"
  45912. // ],
  45913. // "parameters": {
  45914. // "profileId": {
  45915. // "description": "User profile ID associated with this request.",
  45916. // "format": "int64",
  45917. // "location": "path",
  45918. // "required": true,
  45919. // "type": "string"
  45920. // }
  45921. // },
  45922. // "path": "userprofiles/{profileId}/userRoles",
  45923. // "request": {
  45924. // "$ref": "UserRole"
  45925. // },
  45926. // "response": {
  45927. // "$ref": "UserRole"
  45928. // },
  45929. // "scopes": [
  45930. // "https://www.googleapis.com/auth/dfatrafficking"
  45931. // ]
  45932. // }
  45933. }
  45934. // method id "dfareporting.userRoles.list":
  45935. type UserRolesListCall struct {
  45936. s *Service
  45937. profileId int64
  45938. urlParams_ gensupport.URLParams
  45939. ifNoneMatch_ string
  45940. ctx_ context.Context
  45941. header_ http.Header
  45942. }
  45943. // List: Retrieves a list of user roles, possibly filtered. This method
  45944. // supports paging.
  45945. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  45946. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45947. c.profileId = profileId
  45948. return c
  45949. }
  45950. // AccountUserRoleOnly sets the optional parameter
  45951. // "accountUserRoleOnly": Select only account level user roles not
  45952. // associated with any specific subaccount.
  45953. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  45954. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  45955. return c
  45956. }
  45957. // Ids sets the optional parameter "ids": Select only user roles with
  45958. // the specified IDs.
  45959. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  45960. var ids_ []string
  45961. for _, v := range ids {
  45962. ids_ = append(ids_, fmt.Sprint(v))
  45963. }
  45964. c.urlParams_.SetMulti("ids", ids_)
  45965. return c
  45966. }
  45967. // MaxResults sets the optional parameter "maxResults": Maximum number
  45968. // of results to return.
  45969. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  45970. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45971. return c
  45972. }
  45973. // PageToken sets the optional parameter "pageToken": Value of the
  45974. // nextPageToken from the previous result page.
  45975. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  45976. c.urlParams_.Set("pageToken", pageToken)
  45977. return c
  45978. }
  45979. // SearchString sets the optional parameter "searchString": Allows
  45980. // searching for objects by name or ID. Wildcards (*) are allowed. For
  45981. // example, "userrole*2015" will return objects with names like
  45982. // "userrole June 2015", "userrole April 2015", or simply "userrole
  45983. // 2015". Most of the searches also add wildcards implicitly at the
  45984. // start and the end of the search string. For example, a search string
  45985. // of "userrole" will match objects with name "my userrole", "userrole
  45986. // 2015", or simply "userrole".
  45987. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  45988. c.urlParams_.Set("searchString", searchString)
  45989. return c
  45990. }
  45991. // SortField sets the optional parameter "sortField": Field by which to
  45992. // sort the list.
  45993. //
  45994. // Possible values:
  45995. // "ID" (default)
  45996. // "NAME"
  45997. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  45998. c.urlParams_.Set("sortField", sortField)
  45999. return c
  46000. }
  46001. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  46002. // results.
  46003. //
  46004. // Possible values:
  46005. // "ASCENDING" (default)
  46006. // "DESCENDING"
  46007. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  46008. c.urlParams_.Set("sortOrder", sortOrder)
  46009. return c
  46010. }
  46011. // SubaccountId sets the optional parameter "subaccountId": Select only
  46012. // user roles that belong to this subaccount.
  46013. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  46014. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  46015. return c
  46016. }
  46017. // Fields allows partial responses to be retrieved. See
  46018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46019. // for more information.
  46020. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  46021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46022. return c
  46023. }
  46024. // IfNoneMatch sets the optional parameter which makes the operation
  46025. // fail if the object's ETag matches the given value. This is useful for
  46026. // getting updates only after the object has changed since the last
  46027. // request. Use googleapi.IsNotModified to check whether the response
  46028. // error from Do is the result of In-None-Match.
  46029. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  46030. c.ifNoneMatch_ = entityTag
  46031. return c
  46032. }
  46033. // Context sets the context to be used in this call's Do method. Any
  46034. // pending HTTP request will be aborted if the provided context is
  46035. // canceled.
  46036. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  46037. c.ctx_ = ctx
  46038. return c
  46039. }
  46040. // Header returns an http.Header that can be modified by the caller to
  46041. // add HTTP headers to the request.
  46042. func (c *UserRolesListCall) Header() http.Header {
  46043. if c.header_ == nil {
  46044. c.header_ = make(http.Header)
  46045. }
  46046. return c.header_
  46047. }
  46048. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  46049. reqHeaders := make(http.Header)
  46050. for k, v := range c.header_ {
  46051. reqHeaders[k] = v
  46052. }
  46053. reqHeaders.Set("User-Agent", c.s.userAgent())
  46054. if c.ifNoneMatch_ != "" {
  46055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46056. }
  46057. var body io.Reader = nil
  46058. c.urlParams_.Set("alt", alt)
  46059. c.urlParams_.Set("prettyPrint", "false")
  46060. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  46061. urls += "?" + c.urlParams_.Encode()
  46062. req, err := http.NewRequest("GET", urls, body)
  46063. if err != nil {
  46064. return nil, err
  46065. }
  46066. req.Header = reqHeaders
  46067. googleapi.Expand(req.URL, map[string]string{
  46068. "profileId": strconv.FormatInt(c.profileId, 10),
  46069. })
  46070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46071. }
  46072. // Do executes the "dfareporting.userRoles.list" call.
  46073. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  46074. // non-2xx status code is an error. Response headers are in either
  46075. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  46076. // returned at all) in error.(*googleapi.Error).Header. Use
  46077. // googleapi.IsNotModified to check whether the returned error was
  46078. // because http.StatusNotModified was returned.
  46079. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  46080. gensupport.SetOptions(c.urlParams_, opts...)
  46081. res, err := c.doRequest("json")
  46082. if res != nil && res.StatusCode == http.StatusNotModified {
  46083. if res.Body != nil {
  46084. res.Body.Close()
  46085. }
  46086. return nil, &googleapi.Error{
  46087. Code: res.StatusCode,
  46088. Header: res.Header,
  46089. }
  46090. }
  46091. if err != nil {
  46092. return nil, err
  46093. }
  46094. defer googleapi.CloseBody(res)
  46095. if err := googleapi.CheckResponse(res); err != nil {
  46096. return nil, err
  46097. }
  46098. ret := &UserRolesListResponse{
  46099. ServerResponse: googleapi.ServerResponse{
  46100. Header: res.Header,
  46101. HTTPStatusCode: res.StatusCode,
  46102. },
  46103. }
  46104. target := &ret
  46105. if err := gensupport.DecodeResponse(target, res); err != nil {
  46106. return nil, err
  46107. }
  46108. return ret, nil
  46109. // {
  46110. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  46111. // "httpMethod": "GET",
  46112. // "id": "dfareporting.userRoles.list",
  46113. // "parameterOrder": [
  46114. // "profileId"
  46115. // ],
  46116. // "parameters": {
  46117. // "accountUserRoleOnly": {
  46118. // "description": "Select only account level user roles not associated with any specific subaccount.",
  46119. // "location": "query",
  46120. // "type": "boolean"
  46121. // },
  46122. // "ids": {
  46123. // "description": "Select only user roles with the specified IDs.",
  46124. // "format": "int64",
  46125. // "location": "query",
  46126. // "repeated": true,
  46127. // "type": "string"
  46128. // },
  46129. // "maxResults": {
  46130. // "default": "1000",
  46131. // "description": "Maximum number of results to return.",
  46132. // "format": "int32",
  46133. // "location": "query",
  46134. // "maximum": "1000",
  46135. // "minimum": "0",
  46136. // "type": "integer"
  46137. // },
  46138. // "pageToken": {
  46139. // "description": "Value of the nextPageToken from the previous result page.",
  46140. // "location": "query",
  46141. // "type": "string"
  46142. // },
  46143. // "profileId": {
  46144. // "description": "User profile ID associated with this request.",
  46145. // "format": "int64",
  46146. // "location": "path",
  46147. // "required": true,
  46148. // "type": "string"
  46149. // },
  46150. // "searchString": {
  46151. // "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\".",
  46152. // "location": "query",
  46153. // "type": "string"
  46154. // },
  46155. // "sortField": {
  46156. // "default": "ID",
  46157. // "description": "Field by which to sort the list.",
  46158. // "enum": [
  46159. // "ID",
  46160. // "NAME"
  46161. // ],
  46162. // "enumDescriptions": [
  46163. // "",
  46164. // ""
  46165. // ],
  46166. // "location": "query",
  46167. // "type": "string"
  46168. // },
  46169. // "sortOrder": {
  46170. // "default": "ASCENDING",
  46171. // "description": "Order of sorted results.",
  46172. // "enum": [
  46173. // "ASCENDING",
  46174. // "DESCENDING"
  46175. // ],
  46176. // "enumDescriptions": [
  46177. // "",
  46178. // ""
  46179. // ],
  46180. // "location": "query",
  46181. // "type": "string"
  46182. // },
  46183. // "subaccountId": {
  46184. // "description": "Select only user roles that belong to this subaccount.",
  46185. // "format": "int64",
  46186. // "location": "query",
  46187. // "type": "string"
  46188. // }
  46189. // },
  46190. // "path": "userprofiles/{profileId}/userRoles",
  46191. // "response": {
  46192. // "$ref": "UserRolesListResponse"
  46193. // },
  46194. // "scopes": [
  46195. // "https://www.googleapis.com/auth/dfatrafficking"
  46196. // ]
  46197. // }
  46198. }
  46199. // Pages invokes f for each page of results.
  46200. // A non-nil error returned from f will halt the iteration.
  46201. // The provided context supersedes any context provided to the Context method.
  46202. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  46203. c.ctx_ = ctx
  46204. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46205. for {
  46206. x, err := c.Do()
  46207. if err != nil {
  46208. return err
  46209. }
  46210. if err := f(x); err != nil {
  46211. return err
  46212. }
  46213. if x.NextPageToken == "" {
  46214. return nil
  46215. }
  46216. c.PageToken(x.NextPageToken)
  46217. }
  46218. }
  46219. // method id "dfareporting.userRoles.patch":
  46220. type UserRolesPatchCall struct {
  46221. s *Service
  46222. profileId int64
  46223. userrole *UserRole
  46224. urlParams_ gensupport.URLParams
  46225. ctx_ context.Context
  46226. header_ http.Header
  46227. }
  46228. // Patch: Updates an existing user role. This method supports patch
  46229. // semantics.
  46230. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  46231. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46232. c.profileId = profileId
  46233. c.urlParams_.Set("id", fmt.Sprint(id))
  46234. c.userrole = userrole
  46235. return c
  46236. }
  46237. // Fields allows partial responses to be retrieved. See
  46238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46239. // for more information.
  46240. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  46241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46242. return c
  46243. }
  46244. // Context sets the context to be used in this call's Do method. Any
  46245. // pending HTTP request will be aborted if the provided context is
  46246. // canceled.
  46247. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  46248. c.ctx_ = ctx
  46249. return c
  46250. }
  46251. // Header returns an http.Header that can be modified by the caller to
  46252. // add HTTP headers to the request.
  46253. func (c *UserRolesPatchCall) Header() http.Header {
  46254. if c.header_ == nil {
  46255. c.header_ = make(http.Header)
  46256. }
  46257. return c.header_
  46258. }
  46259. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  46260. reqHeaders := make(http.Header)
  46261. for k, v := range c.header_ {
  46262. reqHeaders[k] = v
  46263. }
  46264. reqHeaders.Set("User-Agent", c.s.userAgent())
  46265. var body io.Reader = nil
  46266. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  46267. if err != nil {
  46268. return nil, err
  46269. }
  46270. reqHeaders.Set("Content-Type", "application/json")
  46271. c.urlParams_.Set("alt", alt)
  46272. c.urlParams_.Set("prettyPrint", "false")
  46273. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  46274. urls += "?" + c.urlParams_.Encode()
  46275. req, err := http.NewRequest("PATCH", urls, body)
  46276. if err != nil {
  46277. return nil, err
  46278. }
  46279. req.Header = reqHeaders
  46280. googleapi.Expand(req.URL, map[string]string{
  46281. "profileId": strconv.FormatInt(c.profileId, 10),
  46282. })
  46283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46284. }
  46285. // Do executes the "dfareporting.userRoles.patch" call.
  46286. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  46287. // code is an error. Response headers are in either
  46288. // *UserRole.ServerResponse.Header or (if a response was returned at
  46289. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46290. // to check whether the returned error was because
  46291. // http.StatusNotModified was returned.
  46292. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  46293. gensupport.SetOptions(c.urlParams_, opts...)
  46294. res, err := c.doRequest("json")
  46295. if res != nil && res.StatusCode == http.StatusNotModified {
  46296. if res.Body != nil {
  46297. res.Body.Close()
  46298. }
  46299. return nil, &googleapi.Error{
  46300. Code: res.StatusCode,
  46301. Header: res.Header,
  46302. }
  46303. }
  46304. if err != nil {
  46305. return nil, err
  46306. }
  46307. defer googleapi.CloseBody(res)
  46308. if err := googleapi.CheckResponse(res); err != nil {
  46309. return nil, err
  46310. }
  46311. ret := &UserRole{
  46312. ServerResponse: googleapi.ServerResponse{
  46313. Header: res.Header,
  46314. HTTPStatusCode: res.StatusCode,
  46315. },
  46316. }
  46317. target := &ret
  46318. if err := gensupport.DecodeResponse(target, res); err != nil {
  46319. return nil, err
  46320. }
  46321. return ret, nil
  46322. // {
  46323. // "description": "Updates an existing user role. This method supports patch semantics.",
  46324. // "httpMethod": "PATCH",
  46325. // "id": "dfareporting.userRoles.patch",
  46326. // "parameterOrder": [
  46327. // "profileId",
  46328. // "id"
  46329. // ],
  46330. // "parameters": {
  46331. // "id": {
  46332. // "description": "User role ID.",
  46333. // "format": "int64",
  46334. // "location": "query",
  46335. // "required": true,
  46336. // "type": "string"
  46337. // },
  46338. // "profileId": {
  46339. // "description": "User profile ID associated with this request.",
  46340. // "format": "int64",
  46341. // "location": "path",
  46342. // "required": true,
  46343. // "type": "string"
  46344. // }
  46345. // },
  46346. // "path": "userprofiles/{profileId}/userRoles",
  46347. // "request": {
  46348. // "$ref": "UserRole"
  46349. // },
  46350. // "response": {
  46351. // "$ref": "UserRole"
  46352. // },
  46353. // "scopes": [
  46354. // "https://www.googleapis.com/auth/dfatrafficking"
  46355. // ]
  46356. // }
  46357. }
  46358. // method id "dfareporting.userRoles.update":
  46359. type UserRolesUpdateCall struct {
  46360. s *Service
  46361. profileId int64
  46362. userrole *UserRole
  46363. urlParams_ gensupport.URLParams
  46364. ctx_ context.Context
  46365. header_ http.Header
  46366. }
  46367. // Update: Updates an existing user role.
  46368. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  46369. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46370. c.profileId = profileId
  46371. c.userrole = userrole
  46372. return c
  46373. }
  46374. // Fields allows partial responses to be retrieved. See
  46375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46376. // for more information.
  46377. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  46378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46379. return c
  46380. }
  46381. // Context sets the context to be used in this call's Do method. Any
  46382. // pending HTTP request will be aborted if the provided context is
  46383. // canceled.
  46384. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  46385. c.ctx_ = ctx
  46386. return c
  46387. }
  46388. // Header returns an http.Header that can be modified by the caller to
  46389. // add HTTP headers to the request.
  46390. func (c *UserRolesUpdateCall) Header() http.Header {
  46391. if c.header_ == nil {
  46392. c.header_ = make(http.Header)
  46393. }
  46394. return c.header_
  46395. }
  46396. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  46397. reqHeaders := make(http.Header)
  46398. for k, v := range c.header_ {
  46399. reqHeaders[k] = v
  46400. }
  46401. reqHeaders.Set("User-Agent", c.s.userAgent())
  46402. var body io.Reader = nil
  46403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  46404. if err != nil {
  46405. return nil, err
  46406. }
  46407. reqHeaders.Set("Content-Type", "application/json")
  46408. c.urlParams_.Set("alt", alt)
  46409. c.urlParams_.Set("prettyPrint", "false")
  46410. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  46411. urls += "?" + c.urlParams_.Encode()
  46412. req, err := http.NewRequest("PUT", urls, body)
  46413. if err != nil {
  46414. return nil, err
  46415. }
  46416. req.Header = reqHeaders
  46417. googleapi.Expand(req.URL, map[string]string{
  46418. "profileId": strconv.FormatInt(c.profileId, 10),
  46419. })
  46420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46421. }
  46422. // Do executes the "dfareporting.userRoles.update" call.
  46423. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  46424. // code is an error. Response headers are in either
  46425. // *UserRole.ServerResponse.Header or (if a response was returned at
  46426. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46427. // to check whether the returned error was because
  46428. // http.StatusNotModified was returned.
  46429. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  46430. gensupport.SetOptions(c.urlParams_, opts...)
  46431. res, err := c.doRequest("json")
  46432. if res != nil && res.StatusCode == http.StatusNotModified {
  46433. if res.Body != nil {
  46434. res.Body.Close()
  46435. }
  46436. return nil, &googleapi.Error{
  46437. Code: res.StatusCode,
  46438. Header: res.Header,
  46439. }
  46440. }
  46441. if err != nil {
  46442. return nil, err
  46443. }
  46444. defer googleapi.CloseBody(res)
  46445. if err := googleapi.CheckResponse(res); err != nil {
  46446. return nil, err
  46447. }
  46448. ret := &UserRole{
  46449. ServerResponse: googleapi.ServerResponse{
  46450. Header: res.Header,
  46451. HTTPStatusCode: res.StatusCode,
  46452. },
  46453. }
  46454. target := &ret
  46455. if err := gensupport.DecodeResponse(target, res); err != nil {
  46456. return nil, err
  46457. }
  46458. return ret, nil
  46459. // {
  46460. // "description": "Updates an existing user role.",
  46461. // "httpMethod": "PUT",
  46462. // "id": "dfareporting.userRoles.update",
  46463. // "parameterOrder": [
  46464. // "profileId"
  46465. // ],
  46466. // "parameters": {
  46467. // "profileId": {
  46468. // "description": "User profile ID associated with this request.",
  46469. // "format": "int64",
  46470. // "location": "path",
  46471. // "required": true,
  46472. // "type": "string"
  46473. // }
  46474. // },
  46475. // "path": "userprofiles/{profileId}/userRoles",
  46476. // "request": {
  46477. // "$ref": "UserRole"
  46478. // },
  46479. // "response": {
  46480. // "$ref": "UserRole"
  46481. // },
  46482. // "scopes": [
  46483. // "https://www.googleapis.com/auth/dfatrafficking"
  46484. // ]
  46485. // }
  46486. }
  46487. // method id "dfareporting.videoFormats.get":
  46488. type VideoFormatsGetCall struct {
  46489. s *Service
  46490. profileId int64
  46491. id int64
  46492. urlParams_ gensupport.URLParams
  46493. ifNoneMatch_ string
  46494. ctx_ context.Context
  46495. header_ http.Header
  46496. }
  46497. // Get: Gets one video format by ID.
  46498. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  46499. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46500. c.profileId = profileId
  46501. c.id = id
  46502. return c
  46503. }
  46504. // Fields allows partial responses to be retrieved. See
  46505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46506. // for more information.
  46507. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  46508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46509. return c
  46510. }
  46511. // IfNoneMatch sets the optional parameter which makes the operation
  46512. // fail if the object's ETag matches the given value. This is useful for
  46513. // getting updates only after the object has changed since the last
  46514. // request. Use googleapi.IsNotModified to check whether the response
  46515. // error from Do is the result of In-None-Match.
  46516. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  46517. c.ifNoneMatch_ = entityTag
  46518. return c
  46519. }
  46520. // Context sets the context to be used in this call's Do method. Any
  46521. // pending HTTP request will be aborted if the provided context is
  46522. // canceled.
  46523. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  46524. c.ctx_ = ctx
  46525. return c
  46526. }
  46527. // Header returns an http.Header that can be modified by the caller to
  46528. // add HTTP headers to the request.
  46529. func (c *VideoFormatsGetCall) Header() http.Header {
  46530. if c.header_ == nil {
  46531. c.header_ = make(http.Header)
  46532. }
  46533. return c.header_
  46534. }
  46535. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  46536. reqHeaders := make(http.Header)
  46537. for k, v := range c.header_ {
  46538. reqHeaders[k] = v
  46539. }
  46540. reqHeaders.Set("User-Agent", c.s.userAgent())
  46541. if c.ifNoneMatch_ != "" {
  46542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46543. }
  46544. var body io.Reader = nil
  46545. c.urlParams_.Set("alt", alt)
  46546. c.urlParams_.Set("prettyPrint", "false")
  46547. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  46548. urls += "?" + c.urlParams_.Encode()
  46549. req, err := http.NewRequest("GET", urls, body)
  46550. if err != nil {
  46551. return nil, err
  46552. }
  46553. req.Header = reqHeaders
  46554. googleapi.Expand(req.URL, map[string]string{
  46555. "profileId": strconv.FormatInt(c.profileId, 10),
  46556. "id": strconv.FormatInt(c.id, 10),
  46557. })
  46558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46559. }
  46560. // Do executes the "dfareporting.videoFormats.get" call.
  46561. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  46562. // status code is an error. Response headers are in either
  46563. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  46564. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46565. // to check whether the returned error was because
  46566. // http.StatusNotModified was returned.
  46567. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  46568. gensupport.SetOptions(c.urlParams_, opts...)
  46569. res, err := c.doRequest("json")
  46570. if res != nil && res.StatusCode == http.StatusNotModified {
  46571. if res.Body != nil {
  46572. res.Body.Close()
  46573. }
  46574. return nil, &googleapi.Error{
  46575. Code: res.StatusCode,
  46576. Header: res.Header,
  46577. }
  46578. }
  46579. if err != nil {
  46580. return nil, err
  46581. }
  46582. defer googleapi.CloseBody(res)
  46583. if err := googleapi.CheckResponse(res); err != nil {
  46584. return nil, err
  46585. }
  46586. ret := &VideoFormat{
  46587. ServerResponse: googleapi.ServerResponse{
  46588. Header: res.Header,
  46589. HTTPStatusCode: res.StatusCode,
  46590. },
  46591. }
  46592. target := &ret
  46593. if err := gensupport.DecodeResponse(target, res); err != nil {
  46594. return nil, err
  46595. }
  46596. return ret, nil
  46597. // {
  46598. // "description": "Gets one video format by ID.",
  46599. // "httpMethod": "GET",
  46600. // "id": "dfareporting.videoFormats.get",
  46601. // "parameterOrder": [
  46602. // "profileId",
  46603. // "id"
  46604. // ],
  46605. // "parameters": {
  46606. // "id": {
  46607. // "description": "Video format ID.",
  46608. // "format": "int32",
  46609. // "location": "path",
  46610. // "required": true,
  46611. // "type": "integer"
  46612. // },
  46613. // "profileId": {
  46614. // "description": "User profile ID associated with this request.",
  46615. // "format": "int64",
  46616. // "location": "path",
  46617. // "required": true,
  46618. // "type": "string"
  46619. // }
  46620. // },
  46621. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  46622. // "response": {
  46623. // "$ref": "VideoFormat"
  46624. // },
  46625. // "scopes": [
  46626. // "https://www.googleapis.com/auth/dfatrafficking"
  46627. // ]
  46628. // }
  46629. }
  46630. // method id "dfareporting.videoFormats.list":
  46631. type VideoFormatsListCall struct {
  46632. s *Service
  46633. profileId int64
  46634. urlParams_ gensupport.URLParams
  46635. ifNoneMatch_ string
  46636. ctx_ context.Context
  46637. header_ http.Header
  46638. }
  46639. // List: Lists available video formats.
  46640. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  46641. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46642. c.profileId = profileId
  46643. return c
  46644. }
  46645. // Fields allows partial responses to be retrieved. See
  46646. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46647. // for more information.
  46648. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  46649. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46650. return c
  46651. }
  46652. // IfNoneMatch sets the optional parameter which makes the operation
  46653. // fail if the object's ETag matches the given value. This is useful for
  46654. // getting updates only after the object has changed since the last
  46655. // request. Use googleapi.IsNotModified to check whether the response
  46656. // error from Do is the result of In-None-Match.
  46657. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  46658. c.ifNoneMatch_ = entityTag
  46659. return c
  46660. }
  46661. // Context sets the context to be used in this call's Do method. Any
  46662. // pending HTTP request will be aborted if the provided context is
  46663. // canceled.
  46664. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  46665. c.ctx_ = ctx
  46666. return c
  46667. }
  46668. // Header returns an http.Header that can be modified by the caller to
  46669. // add HTTP headers to the request.
  46670. func (c *VideoFormatsListCall) Header() http.Header {
  46671. if c.header_ == nil {
  46672. c.header_ = make(http.Header)
  46673. }
  46674. return c.header_
  46675. }
  46676. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  46677. reqHeaders := make(http.Header)
  46678. for k, v := range c.header_ {
  46679. reqHeaders[k] = v
  46680. }
  46681. reqHeaders.Set("User-Agent", c.s.userAgent())
  46682. if c.ifNoneMatch_ != "" {
  46683. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46684. }
  46685. var body io.Reader = nil
  46686. c.urlParams_.Set("alt", alt)
  46687. c.urlParams_.Set("prettyPrint", "false")
  46688. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  46689. urls += "?" + c.urlParams_.Encode()
  46690. req, err := http.NewRequest("GET", urls, body)
  46691. if err != nil {
  46692. return nil, err
  46693. }
  46694. req.Header = reqHeaders
  46695. googleapi.Expand(req.URL, map[string]string{
  46696. "profileId": strconv.FormatInt(c.profileId, 10),
  46697. })
  46698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46699. }
  46700. // Do executes the "dfareporting.videoFormats.list" call.
  46701. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  46702. // Any non-2xx status code is an error. Response headers are in either
  46703. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  46704. // returned at all) in error.(*googleapi.Error).Header. Use
  46705. // googleapi.IsNotModified to check whether the returned error was
  46706. // because http.StatusNotModified was returned.
  46707. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  46708. gensupport.SetOptions(c.urlParams_, opts...)
  46709. res, err := c.doRequest("json")
  46710. if res != nil && res.StatusCode == http.StatusNotModified {
  46711. if res.Body != nil {
  46712. res.Body.Close()
  46713. }
  46714. return nil, &googleapi.Error{
  46715. Code: res.StatusCode,
  46716. Header: res.Header,
  46717. }
  46718. }
  46719. if err != nil {
  46720. return nil, err
  46721. }
  46722. defer googleapi.CloseBody(res)
  46723. if err := googleapi.CheckResponse(res); err != nil {
  46724. return nil, err
  46725. }
  46726. ret := &VideoFormatsListResponse{
  46727. ServerResponse: googleapi.ServerResponse{
  46728. Header: res.Header,
  46729. HTTPStatusCode: res.StatusCode,
  46730. },
  46731. }
  46732. target := &ret
  46733. if err := gensupport.DecodeResponse(target, res); err != nil {
  46734. return nil, err
  46735. }
  46736. return ret, nil
  46737. // {
  46738. // "description": "Lists available video formats.",
  46739. // "httpMethod": "GET",
  46740. // "id": "dfareporting.videoFormats.list",
  46741. // "parameterOrder": [
  46742. // "profileId"
  46743. // ],
  46744. // "parameters": {
  46745. // "profileId": {
  46746. // "description": "User profile ID associated with this request.",
  46747. // "format": "int64",
  46748. // "location": "path",
  46749. // "required": true,
  46750. // "type": "string"
  46751. // }
  46752. // },
  46753. // "path": "userprofiles/{profileId}/videoFormats",
  46754. // "response": {
  46755. // "$ref": "VideoFormatsListResponse"
  46756. // },
  46757. // "scopes": [
  46758. // "https://www.googleapis.com/auth/dfatrafficking"
  46759. // ]
  46760. // }
  46761. }